Jump to content
The Naid

[Source] 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

Share this post


Link to post

hello very nice but its posivel make a dif for game_34083 8Mbs ? 

 

Thanks 

Share this post


Link to post

Not the best way to fix it.

Just multiply i * -1 and the lifesteal won't get lost.. :-)

Share this post


Link to post

can you give this information for game 34083 ? 

 

You must create a dif file.

Change the byte 84 (!=) to 88 (>=).

Share this post


Link to post

can you now create for my i habe game_34083 8 mbs 

 

No, but you can replace this in function CHARACTER::Damage.

Share this post


Link to post
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

Share this post


Link to post

Yeah would love a DIF for 34083. Mine is also 7.94MB.

Share this post


Link to post
Guest

And now explain for the general public what does this FIX actually fix ?

Share this post


Link to post

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

Share this post


Link to post

no body cann make on dif for this for the game 34083 8 mb ? 

 

Thanks

Share this post


Link to post

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?

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

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

 

Share this post


Link to post

You can simply be a good person and not be greedy.

Put this

if (iCurHP >= iHP)

and you won't apply life steal if victim doesn't have that much HP.

 

Dude why do we reply on a 2014 topic

0_0

  • Love 1

Share this post


Link to post

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

 

Share this post


Link to post

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

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.