Jump to content
  • 0

Auto Guard / Parrying / Kyrie Eleison & bShortWeaponDamageReturn


Question

Posted (edited)

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

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

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
  • 1
Posted (edited)

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
  • 0
Posted
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
  • 0
Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...