Jump to content
flamyman1412

How to make increase damage skill (Solved) ✔️

Recommended Posts

Hello @flamyman1412!

 

1) Open file skillinfo.txt and look for any Champion skill you are interested in. For example, ID: 82 Mighty Strike;

2) Find the function that is called when using the skill. For Mighty Strike it will be Skill_Zj_End;

3) Now open file SkillEffect.lua and look for the function. In our case you will see something like:

function Skill_Zj_End ( ATKER , DEFER , sklv ) 

	atk_rad = 1.2 + sklv * 0.05 
	hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER )	
	Hp_Endure_Dmg ( DEFER , hpdmg )  

	Check_Ys_Rem ( ATKER ,DEFER )
	
end 

4) You can see Hp_Endure_Dmg() function call. This function deals damage to the target (takes health points (HP)). As the second parameter it uses the number of HP that need to be taken away from target. Obviously, it is calculated using the formula above:

atk_rad = 1.2 + sklv * 0.05 
hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER )

The function Atk_Raise() calculates damage depending on the minimum and maximum attack points of the character, as well as on the defense and physical resistance of the target. The variable atk_rad calculates the percentage by which the character's attack will be increased. For example, my character has attack from 100 to 120 and Mighty Strike level 1. Damage will be equal: 125% * random(100, 120) = 125 ... 150 points (I do not take into consideration the defense and physical resistance of the target).

 

5) Modify the formula. You can modify variable atk_rad to influence the damage percentage or variable hpdmg to influence specific number of damage points. For simplicity, let's change the variable hpdmg. Let's say we want 10% of the character's max HP to be added to damage. Then, we write the following:

-- Get player's max HP value
local mxhp = GetChaAttr(ATKER, ATTR_MXHP)

-- New formula
hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER ) + (0.1 * mxhp)	

Now, if my character has 4000 health points, Mighty Strike will be guaranteed to deal an additional 400 damage points.

 

6) Note, Mighty Strike used exclusively by profession Champion. If you want to change the skills that are used by other professions (Illusion Slash, Berserk), you need to add profession check:

	-- Get player's job ID
	local job = GetChaAttr(role, ATTR_JOB)
	
	-- Check that player is a Champion
	if (job == JOB_TYPE_JUJS) then -- JOB_TYPE_JUJS = 8 (Champion)
    
		-- Get player's max HP value
		local mxhp = GetChaAttr(ATKER, ATTR_MXHP)
        
		-- Use our formula which considers the maximum number of HP of the character
		hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER ) + (0.1 * mxhp)	
        
	else
		-- Use original formula
		hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER )	
	end

 

Good luck!

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, V3ct0r said:

Hello @flamyman1412!

 

1) Open file skillinfo.txt and look for any Champion skill you are interested in. For example, ID: 82 Mighty Strike;

2) Find the function that is called when using the skill. For Mighty Strike it will be Skill_Zj_End;

3) Now open file SkillEffect.lua and look for the function. In our case you will see something like:


function Skill_Zj_End ( ATKER , DEFER , sklv ) 

	atk_rad = 1.2 + sklv * 0.05 
	hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER )	
	Hp_Endure_Dmg ( DEFER , hpdmg )  

	Check_Ys_Rem ( ATKER ,DEFER )
	
end 

4) You can see Hp_Endure_Dmg() function call. This function deals damage to the target (takes health points (HP)). As the second parameter it uses the number of HP that need to be taken away from target. Obviously, it is calculated using the formula above:


atk_rad = 1.2 + sklv * 0.05 
hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER )

The function Atk_Raise() calculates damage depending on the minimum and maximum attack points of the character, as well as on the defense and physical resistance of the target. The variable atk_rad calculates the percentage by which the character's attack will be increased. For example, my character has attack from 100 to 120 and Mighty Strike level 1. Damage will be equal: 125% * random(100, 120) = 125 ... 150 points (I do not take into consideration the defense and physical resistance of the target).

 

5) Modify the formula. You can modify variable atk_rad to influence the damage percentage or variable hpdmg to influence specific number of damage points. For simplicity, let's change the variable hpdmg. Let's say we want 10% of the character's max HP to be added to damage. Then, we write the following:


-- Get player's max HP value
local mxhp = GetChaAttr(ATKER, ATTR_MXHP)

-- New formula
hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER ) + (0.1 * mxhp)	

Now, if my character has 4000 health points, Mighty Strike will be guaranteed to deal an additional 400 damage points.

 

6) Note, Mighty Strike used exclusively by profession Champion. If you want to change the skills that are used by other professions (Illusion Slash, Berserk), you need to add profession check:


	-- Get player's job ID
	local job = GetChaAttr(role, ATTR_JOB)
	
	-- Check that player is a Champion
	if (job == JOB_TYPE_JUJS) then -- JOB_TYPE_JUJS = 8 (Champion)
    
		-- Get player's max HP value
		local mxhp = GetChaAttr(ATKER, ATTR_MXHP)
        
		-- Use our formula which considers the maximum number of HP of the character
		hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER ) + (0.1 * mxhp)	
        
	else
		-- Use original formula
		hpdmg = Atk_Raise ( atk_rad , ATKER , DEFER )	
	end

 

Good luck!

Thank you very much

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...