aleph075 Posted April 28 Group: Members Topic Count: 22 Topics Per Day: 0.69 Content Count: 48 Reputation: 0 Joined: 04/10/24 Last Seen: 23 hours ago Share Posted April 28 (edited) I am trying to reduce the defense power by items armor and trying change this: /** * RE DEF Reduction * Damage = Attack * (4000+eDEF)/(4000+eDEF*10) - sDEF * Pierce defence gains 1 atk per def/2 */ if( def1 == -400 ) /* -400 creates a division by 0 and subsequently crashes */ def1 = -399; ATK_ADD2(wd->damage, wd->damage2, is_attack_piercing(wd, src, target, skill_id, skill_lv, EQI_HAND_R) ? (def1*battle_calc_attack_skill_ratio(wd, src, target, skill_id, skill_lv))/200 : 0, is_attack_piercing(wd, src, target, skill_id, skill_lv, EQI_HAND_L) ? (def1*battle_calc_attack_skill_ratio(wd, src, target, skill_id, skill_lv))/200 : 0 ); if( !attack_ignores_def(wd, src, target, skill_id, skill_lv, EQI_HAND_R) && !is_attack_piercing(wd, src, target, skill_id, skill_lv, EQI_HAND_R) ) wd->damage = wd->damage * (4000+def1) / (4000+10*def1) - vit_def; <-------- ///Here/// if( is_attack_left_handed(src, skill_id) && !attack_ignores_def(wd, src, target, skill_id, skill_lv, EQI_HAND_L) && !is_attack_piercing(wd, src, target, skill_id, skill_lv, EQI_HAND_L) ) wd->damage2 = wd->damage2 * (4000+def1) / (4000+10*def1) - vit_def; The 4000 constants to 5000. But i want to add a plus damage reduction by users VIT stat (no vit_def) How can i do that, wich sintaxis? Or it's not even here in the code? And, I can't find where is the code that defines vit_def (see photo) Thx! Edited April 28 by aleph075 Quote Link to comment Share on other sites More sharing options...
0 Playtester Posted April 29 Group: Developer Topic Count: 35 Topics Per Day: 0.01 Content Count: 815 Reputation: 236 Joined: 01/30/13 Last Seen: 9 hours ago Share Posted April 29 Are you running your server in renewal after all? Because that's the renewal defense code. There is not a single function that calculates VIT_DEF at the moment, but it's basically calculated right above the code you quoted. It uses DEF2 from status.cpp as input. Just search for "def2" in that file (calculation depends on bl type). Quote Link to comment Share on other sites More sharing options...
Question
aleph075
I am trying to reduce the defense power by items armor and trying change this:
The 4000 constants to 5000. But i want to add a plus damage reduction by users VIT stat (no vit_def)
How can i do that, wich sintaxis? Or it's not even here in the code?
And, I can't find where is the code that defines vit_def (see photo)
Thx!
Edited by aleph075
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.