vBrenth 39 Posted January 19, 2015 I would like to ask for a help regarding this one, i cannot make it work on my own and with the help of my friends so here i am posting this //Reject Sword bugreport:4493 by Daegaladh if(wd.damage && tsc && tsc->data[SC_SWORDREJECT] && (src->type!=BL_PC || ( ((TBL_PC *)src)->weapontype1 == W_DAGGER || ((TBL_PC *)src)->weapontype1 == W_1HSWORD || ((TBL_PC *)src)->status.weapon == W_2HSWORD )) && rnd()%100 < tsc->data[SC_SWORDREJECT]->val2 ) { ATK_RATER(50); status_fix_damage(target,src,wd.damage,clif->damage(target,src,0,0,wd.damage,0,0,0)); clif->skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_SWORDREJECT]->val1,1); if( --(tsc->data[SC_SWORDREJECT]->val3) <= 0 ) status_change_end(target, SC_SWORDREJECT, INVALID_TIMER); } What i wanted to aim?, I want to make the reject swords reflect damage cannot go higher than casters HP. We tried to add this things but doesnt work (under) ATK_RATER(50); Thanks to Dastgir for multiple tries to help me wd.damage = (int)cap_value(wd.damage, 0, ((TBL_PC*)src)->status.max_hp); wd.damage = cap_value(wd.damage, 0, (int64)((TBL_PC*)src)->status.max_hp); if (sd)wd.damage = cap_value(wd.damage, 0, (int64)(sd->status.max_hp)); if (sd)wd.damage = min(status_get_max_hp(src),wd.damage); Little hand please? Another problem i have encounter on newer clients [ Whisper bug [2013-12-23c ] Quote Share this post Link to post Share on other sites
0 Garr 117 Posted January 19, 2015 Just a question... why were you using ATTACKER'S HP then? You'd need to use target, and not src. Try this one: if(wd.damage && tsc && tsc->data[SC_SWORDREJECT] && (src->type!=BL_PC || ( ((TBL_PC *)src)->weapontype1 == W_DAGGER || ((TBL_PC *)src)->weapontype1 == W_1HSWORD || ((TBL_PC *)src)->status.weapon == W_2HSWORD )) && rnd()%100 < tsc->data[SC_SWORDREJECT]->val2 ) { ATK_RATER(50); wd.damage = min(status_get_max_hp(target),wd.damage); status_fix_damage(target,src,wd.damage,clif->damage(target,src,0,0,wd.damage,0,0,0)); clif->skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_SWORDREJECT]->val1,1); if( --(tsc->data[SC_SWORDREJECT]->val3) <= 0 ) status_change_end(target, SC_SWORDREJECT, INVALID_TIMER); } 1 vBrenth reacted to this Quote Share this post Link to post Share on other sites
0 vBrenth 39 Posted January 19, 2015 (edited) Removed (false fix) Edited January 19, 2015 by Wynne Quote Share this post Link to post Share on other sites
0 vBrenth 39 Posted January 19, 2015 (edited) Just a question... why were you using ATTACKER'S HP then? You'd need to use target, and not src. Try this one: if(wd.damage && tsc && tsc->data[SC_SWORDREJECT] && (src->type!=BL_PC || ( ((TBL_PC *)src)->weapontype1 == W_DAGGER || ((TBL_PC *)src)->weapontype1 == W_1HSWORD || ((TBL_PC *)src)->status.weapon == W_2HSWORD )) && rnd()%100 < tsc->data[SC_SWORDREJECT]->val2 ) { ATK_RATER(50); wd.damage = min(status_get_max_hp(target),wd.damage); status_fix_damage(target,src,wd.damage,clif->damage(target,src,0,0,wd.damage,0,0,0)); clif->skill_nodamage(target,target,ST_REJECTSWORD,tsc->data[SC_SWORDREJECT]->val1,1); if( --(tsc->data[SC_SWORDREJECT]->val3) <= 0 ) status_change_end(target, SC_SWORDREJECT, INVALID_TIMER); } Thanks for the response sir Edited January 19, 2015 by Wynne Quote Share this post Link to post Share on other sites
0 Garr 117 Posted January 19, 2015 (edited) I'm sorry to break it to you, but if you'll use csnv's fix, it will only send packet to client showing minimized damage, yet the damage applied on server will be full... I think if you'll hit the attacker after you'll see what I mean. ETA: Yup, if you'll check it with monster that shows HP in () after name, you'll see what I mean. Easiest to test with quad tanee shoes stalker. Edited January 19, 2015 by Garr 1 vBrenth reacted to this Quote Share this post Link to post Share on other sites
0 vBrenth 39 Posted January 19, 2015 (edited) I'm sorry to break it to you, but if you'll use csnv's fix, it will only send packet to client showing minimized damage, yet the damage applied on server will be full... I think if you'll hit the attacker after you'll see what I mean. Oh thank you Garr, i am blind not to see it, and csnv explain it to me too thanks. Another question if you can help me regarding the reflect shield and items it shows that they splitting damage into 2, i wonder how i can revert the old one? Using ur fix now. Edited January 19, 2015 by Wynne Quote Share this post Link to post Share on other sites
I would like to ask for a help regarding this one, i cannot make it work on my own and with the help of my friends so here i am posting this
What i wanted to aim?, I want to make the reject swords reflect damage cannot go higher than casters HP.
We tried to add this things but doesnt work (under) ATK_RATER(50);
Thanks to Dastgir for multiple tries to help me
Little hand please?
Another problem i have encounter on newer clients [ Whisper bug [2013-12-23c ]
Share this post
Link to post
Share on other sites