flamyman1412 4 Report post Posted November 22, 2021 Job Champ how to make max hp increase damage to skills. Quote Share this post Link to post Share on other sites
Graf 209 Report post Posted November 22, 2021 (edited) @flamyman1412 local mxhp = GetChaAttr(ATKER,ATTR_MXHP) local bonus_dmg = 0 if (mxhp >= 15000) then bonus_dmg = 500 end dmg = bonus_dmg * dmg Edited November 22, 2021 by Graf Quote Share this post Link to post Share on other sites
flamyman1412 4 Report post Posted November 22, 2021 21 minutes ago, Graf said: @flamyman1412 local mxhp = GetChaAttr(ATKER,ATTR_MXHP) local bonus_dmg = 0 if (mxhp >= 15000) then bonus_dmg = 500 end dmg = bonus_dmg * dmg thankyou Quote Share this post Link to post Share on other sites
V3ct0r 2,116 Report post Posted November 22, 2021 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! 1 Quote Some useful links / Полезные ссылки Tips for making a topic in 'Questions & Help' / Рекомендации по созданию тем в разделе "Помощь" Server Advertising Section Rules / Правила раздела "Реклама серверов" Available e-mail domains for registration / Допустимые e-mail домены для регистрации User groups / Группы пользователей User ranks / Звания пользователей "Broken" pictures on the forum / "Битые" изображения на форуме Beware of scammers! / Осторожно, мошенники! My developments / Мои разработки Mods for client and server / Моды для клиента и сервера PKOdev.NET website for Tales of Pirates Server / PKOdev.NET веб-обвязка для сервера Пиратии I do not provide any help in private messages and outside the forum. Use 'Questions & Help' section please. Thank you for understanding! Я не оказываю какую-либо помощь в личных сообщениях и вне форума. Пожалуйста, используйте раздел "Пиратия: Помощь". Благодарю за понимание! Share this post Link to post Share on other sites
flamyman1412 4 Report post Posted November 23, 2021 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 Quote Share this post Link to post Share on other sites