Jump to content
  • 0

Auto Guard / Parrying / Kyrie Eleison & bShortWeaponDamageReturn


Scylla

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

This has been asked a few times as I've searched the forum with this problem as well as i am aware that this is currently the official behavior on official servers but i wasn't able to find the solution for it. So, if you're wearing an equipment with bShortWeaponDamageReturn script (Orc Lord Card for example or Valkyrie Manteau) and you're in auto guard / parrying / kyrie eleison + they proc'ed, the damage will miss but there's still a reflect to the attacker. Like this on the video: 

 

But the expected result is it shouldn't have reflect because there wasn't any damage registered to the target.

I've tried various possible solutions by editing this line in battle.cpp:

	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id)&INF2_TRAP || !status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);

But i wasn't able to revert it. 

May i ask for help on reverting this? Thank you!

Edited by Scylla
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

I've finally solved it.

battle.cpp:

	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id, INF2_ISTRAP) || !status_reflect) && sd && sd->bonus.short_weapon_damage_return ) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		} else if( status_reflect && sc && sc->count ) {

to

	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id)&INF2_TRAP || !status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage = i64max(rdamage,-1);
		}
		else if ( (status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		}
		if( status_reflect && sc && sc->count ) {

Thanks a lot to @Wazaby for assisting me with this.

 

EDIT: You may just add this line on else if, if you want trap to reflect

skill_get_inf2(skill_id)&INF2_TRAP

EDIT 2:

 

 Just to update to my fix, for those people using bLongWeaponDamageReturn:

in battle.cpp

Find:

        if (!status_reflect && sd && sd->bonus.long_weapon_damage_return) {
            rdamage += damage * sd->bonus.long_weapon_damage_return / 100;
            rdamage = i64max(rdamage, 1);
        }
    }

to:

        if (!status_reflect && sd && sd->bonus.long_weapon_damage_return) {
            rdamage = i64max(rdamage,-1);
        }
        else if (status_reflect && sd && sd->bonus.long_weapon_damage_return) {
            rdamage += damage * sd->bonus.long_weapon_damage_return / 100;
            rdamage = i64max(rdamage, 1);
    }

 

Edited by Scylla
  • Upvote 1
  • MVP 2
Link to comment
Share on other sites

  • 1

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.03
  • Content Count:  640
  • Reputation:   82
  • Joined:  04/07/14
  • Last Seen:  

Well this isnt compatible with my TRUNK. But @Scylla was able to help me with it. Thank you so much bro!

if somebody have this on your battle.c

	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id, INF2_ISTRAP) || !status_reflect) && sd && sd->bonus.short_weapon_damage_return ) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		} else if( status_reflect && sc && sc->count ) {

change it to
 

	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id, INF2_ISTRAP) || !status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage = i64max(rdamage,-1);
		}
		else if ( (status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		}
		if( status_reflect && sc && sc->count ) {


voila!!!

Edited by Gidz Cross
  • Upvote 1
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  31
  • Reputation:   10
  • Joined:  04/19/20
  • Last Seen:  

15 hours ago, Scylla said:

I've finally solved it.

battle.cpp:


	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id, INF2_ISTRAP) || !status_reflect) && sd && sd->bonus.short_weapon_damage_return ) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		} else if( status_reflect && sc && sc->count ) {

to


	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id)&INF2_TRAP || !status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage = i64max(rdamage,-1);
		}
		else if ( (status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		}
		if( status_reflect && sc && sc->count ) {

Thanks a lot to @Wazaby for assisting me with this.

 

EDIT: You may just add this line on else if, if you want trap to reflect


skill_get_inf2(skill_id)&INF2_TRAP

Thanks for the mention. ?

  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

On 10/17/2020 at 1:43 AM, Scylla said:

I've finally solved it.

battle.cpp:


	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id, INF2_ISTRAP) || !status_reflect) && sd && sd->bonus.short_weapon_damage_return ) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		} else if( status_reflect && sc && sc->count ) {

to


	if (flag & BF_SHORT) {//Bounces back part of the damage.
		if ( (skill_get_inf2(skill_id)&INF2_TRAP || !status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage = i64max(rdamage,-1);
		}
		else if ( (status_reflect) && sd && sd->bonus.short_weapon_damage_return) {
			rdamage += damage * sd->bonus.short_weapon_damage_return / 100;
			rdamage = i64max(rdamage,1);
		}
		if( status_reflect && sc && sc->count ) {

Thanks a lot to @Wazaby for assisting me with this.

 

EDIT: You may just add this line on else if, if you want trap to reflect


skill_get_inf2(skill_id)&INF2_TRAP

can you please update the codes to the latest git/pull

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

1 hour ago, kalabasa said:

can you please update the codes to the latest git/pull

Nothing really changed...

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...