Jump to content
Forgot your email address? ×
×
×
  • Create New...

Sura Magic Sword Skill Fix


Recommended Posts

Char_battle.cpp [ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) ]

if (pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) && number(0, 4) > 0) // 80% Č®·ü
			{
				int i = MIN(dam, iCurHP) * pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) / 100;

				if (i)
				{
					CreateFly(FLY_HP_SMALL, pAttacker);
					pAttacker->PointChange(POINT_HP, i);
				}
			}

Replace

if (pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) && number(0, 4) > 0) // 80% Č®·ü
			{
				int i = MIN(dam, iCurHP) * pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) / 100;

				if (i && i > 0)
				{
					CreateFly(FLY_HP_SMALL, pAttacker);
					pAttacker->PointChange(POINT_HP, i);
				}
			}
  • Love 9
Link to comment
  • Replies 19
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Taken from vanilla core:
 
if (pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) && number(0, 4) > 0) // 80% Č®·ü
            {
                int i = MIN(dam, iCurHP) * pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) / 100;
 
                if (i)
                {
                    if (i < 0)
                         i *= -1;
                    CreateFly(FLY_HP_SMALL, pAttacker);
                    pAttacker->PointChange(POINT_HP, i);
                }
            }

 

  • Love 7

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to comment

when you are a sura using the sword skill that makes the sword glow and you use normal attacks on an opponent you lose some of your own hp

 

I have tried several times and I can't reproduce this. What else do you need to do besides using Enchanted Blade? (By the way this fix applies to whatever that recovers hp so it should happen with items that have the bonus, no?)

 

 

Taken from vanilla core:

 

if (pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) && number(0, 4) > 0) // 80% Č®·ü

            {

                int i = MIN(dam, iCurHP) * pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) / 100;

 

                if (i)

                {

                    if (i < 0)

                         i *= -1;

                    CreateFly(FLY_HP_SMALL, pAttacker);

                    pAttacker->PointChange(POINT_HP, i);

                }

            }

 

Now I'm lost... so if the damage you do is negative, or the enemy's HP is negative (i.e is dead, or should be), you get HP? How does that make sense?

Link to comment

That's for example if an overkill is happening. The bug with the sura skill is when you overkill an enemy, the hp of the enemy goes > 0 and that's influencing this calculation as you can see: You loose hp.

My fix will allow sura's to get the hp they earned by overkilling an enemy.

Remember: You can't deal < 0 damage, as if it's < 0 it'll be normalized to a number between (afaik) 1-5. The overkill is the only thing producing this bug and the fix will not only prevent the bug but still letting suras get what they earned (if you choose to have the other fix you'll still have a bug: The bug that if you overkill an enemy, you won't get the hp even if you should).

 

the bug he meantioned is simply the bug that's occuring when you overkill an enemy (which happens at least.. 99% of all kills you make since your last hit won't to damage equal to the hp left so you nullify his hp exactly). If you're leveling, you'll get hit hard by this bug if you're going to level at places where the enemies are low on def but high on damage.

  • Love 1

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to comment

Yes the damage is normalized - I can't find where but I recall seeing it. Regardless, it's mathematically impossible for damage to be negative as there are no deductions from the initial value when you get to that point, so the negative part is the iCurHP indeed. I knew they could have negative but I thought they were marked as dead and nothing was further processed. Should have checked, my bad.

 

However, that was not my point. I meant, what's the point of giving the player HP for killing an enemy which is already dead? I still don't find it logical... It's up to the implementation of course. I still prefer if(i > 0)  :P

Link to comment

That's for example if an overkill is happening. The bug with the sura skill is when you overkill an enemy, the hp of the enemy goes > 0 and that's influencing this calculation as you can see: You loose hp.

My fix will allow sura's to get the hp they earned by overkilling an enemy.

Remember: You can't deal < 0 damage, as if it's < 0 it'll be normalized to a number between (afaik) 1-5. The overkill is the only thing producing this bug and the fix will not only prevent the bug but still letting suras get what they earned (if you choose to have the other fix you'll still have a bug: The bug that if you overkill an enemy, you won't get the hp even if you should).

 

the bug he meantioned is simply the bug that's occuring when you overkill an enemy (which happens at least.. 99% of all kills you make since your last hit won't to damage equal to the hp left so you nullify his hp exactly). If you're leveling, you'll get hit hard by this bug if you're going to level at places where the enemies are low on def but high on damage.

Are you referring to mobs as enemies too? Because you should not be receiving HP when attacking players.

Link to comment

You'd get hp from players too. I refer to both mobs and players.

 

The point is: You can't damage a already defeated character/mob. But as I said, if you overkill him/it, you'll surely make his hp go < 0. You can see it in duels, just make one and after you died you'd check your hp before reviving -> there you can see the negative values. Same goes with mobs. And as soon as you hit the hp into negative values, you'll loose hp. And that's not fair, you made the damage and you'd be rewarded for the things you managed to do. That's why I reverted it back, so if you manage to overkill someone (which happens everytime) you shouldn't be punished by not getting the bonus you earned from maxing your magic sword.

  • Love 1

We are the tortured.
We're not your friends.
As long as we're not visible.
We are unfixable.

Link to comment
  • 4 years later...

*= -1 makes no sense because there is no "overkill" the bug happens because you hit already dead (by hp) character, here's how it should be fixed

 

			//HP and SP recovery bug fix
			if (iCurHP > 0)
			{
				// Ä¥ ¶§¸¶´Ù HPȸº¹
				if (pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) && number(0, 4) > 0) // 80% È®·ü
				{
					int i = MIN(dam, iCurHP) * pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) / 100;

					if (i)
					{
						CreateFly(FLY_HP_SMALL, pAttacker);
						pAttacker->PointChange(POINT_HP, i);
					}
				}
			}

 

Link to comment
  • 5 months later...

for all guys don't understend . take the good cod

if (pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) && number(0, 4) > 0) // 80% E¢ç¡¤u
            {
                int i = ((iCurHP>=0)?MIN(dam, iCurHP):dam) * pAttacker->GetPoint(POINT_HIT_HP_RECOVERY) / 100; //@fixme107

                if (i)
                {
                    CreateFly(FLY_HP_SMALL, pAttacker);
                    pAttacker->PointChange(POINT_HP, i);
                }
            }
            if (pAttacker->GetPoint(POINT_HIT_SP_RECOVERY) && number(0, 4) > 0) // 80% E¢ç¡¤u
            {
                int i = ((iCurHP>=0)?MIN(dam, iCurHP):dam) * pAttacker->GetPoint(POINT_HIT_SP_RECOVERY) / 100; //@fixme107

                if (i)
                {
                    CreateFly(FLY_SP_SMALL, pAttacker);
                    pAttacker->PointChange(POINT_SP, i);
                }
            }

 

  • Love 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Announcements

  • -15% Discount in Metin2 Dev Store (01/10/2021 => 31/12/2021) => Code => 15_PCT_OCT_TO_DEC_2021


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.