Jump to content
  • 0
vBrenth

Reject Swords reflect (max hp cap)

Question

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 :D

    //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 :D

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 ]

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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);	}

Share this post


Link to post
Share on other sites
  • 0

 

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 by Wynne

Share this post


Link to post
Share on other sites
  • 0

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 by Garr

Share this post


Link to post
Share on other sites
  • 0

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 :D 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 by Wynne

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
Answer this question...

×   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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.