Reject Swords reflect (max hp cap)

vBrenth

New member
Messages
391
Points
0
Age
35
Location
Philippines
Discord
Brenth
Github
vBrenth
Emulator
Client Version
RE
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
default_biggrin.png


  //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
default_biggrin.png


wd.damage = (int)cap_value(wd.damage, 0, ((TBL_PC*)src)->status.max_hp);
Code:
wd.damage = cap_value(wd.damage, 0, (int64)((TBL_PC*)src)->status.max_hp);
Code:
if (sd)wd.damage = cap_value(wd.damage, 0, (int64)(sd->status.max_hp));
Code:
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 ]

 
Just a question... why were you using ATTACKER'S HP then? You'd need to use target, and not src. Try this one:

Code:
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);	}
 
Removed (false fix)

 
Last edited by a moderator:
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

 
Last edited by a moderator:
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.

 
Last edited by a moderator:
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
default_biggrin.png
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.

 
Last edited by a moderator:
Back
Top