Jump to content
metin2dev
  • 0
charparodar

open Sura Manashield Bug

Question

Hello,

I'm testing the damages on my server and we realized that magic sura using it's protection gets much more damage than he takes without it...

My skill proto row

INSERT INTO `skill_proto`(`dwVnum`, `szName`, `bType`, `bLevelStep`, `bMaxLevel`, `bLevelLimit`, `szPointOn`, `szPointPoly`, `szSPCostPoly`, `szDurationPoly`, `szDurationSPCostPoly`, `szCooldownPoly`, `szMasterBonusPoly`, `szAttackGradePoly`, `setFlag`, `setAffectFlag`, `szPointOn2`, `szPointPoly2`, `szDurationPoly2`, `setAffectFlag2`, `szPointOn3`, `szPointPoly3`, `szDurationPoly3`, `szGrandMasterAddSPCostPoly`, `prerequisiteSkillVnum`, `prerequisiteSkillLevel`, `eSkillType`, `iMaxHit`, `szSplashAroundDamageAdjustPoly`, `dwTargetRange`, `dwSplashRange`) VALUES (79, 0xC8E6BDC5BCF6C8A3, 3, 1, 1, 0, 'DEF_GRADE', '(0.5*iq+15)*k', '20+30*k', '60+120*k', '5+10*k', '63+120*k', '(0.5*iq+15)*k', '', 'SELFONLY,TOGGLE', 'MANASHIELD', 'MANASHIELD', '100-((iq*0.84)*k)', '60+120*k', '', '', '', '', '20+30*k', 0, 0, 'MAGIC', 1, '0.8', 0, 0);

My char_battle.cpp

			// POINT_MANASHIELD �� �۾������� ����
			int iDamageSPPart = (dam * GetPoint(POINT_MANASHIELD)) / 100;
			int iDamageToSP = iDamageSPPart * 0.2f;
			int iSP = GetSP();

			// SP�� ������ ������ ������ ���� ����
			if (iDamageToSP <= iSP)
			{
				PointChange(POINT_SP, -iDamageToSP);
				dam -= iDamageSPPart;
			}
			else
			{
				// ���ŷ��� ���ڶ��� �ǰ� �� �←���ҋ�
				PointChange(POINT_SP, -GetSP());
				dam -= (iSP / 20) * 100;
			}

Does anyone know what is wrong?

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0
3 hours ago, charparodar said:

BUMP

You changed the formula didn't you? It's different from usual. What were you trying to do? I can write it for you.

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, Syreldar said:

You changed the formula didn't you? It's different from usual. What were you trying to do? I can write it for you.

I didn't touch the formula actually, and I even compared the formula with another serverfiles and it was the same...

I've touched every other skill that does damage, like warrior aura, triple attack, etc, didn't touch defensive skills

Share this post


Link to post
Share on other sites
  • 0
	if (IsAffectFlag(AFF_MANASHIELD))
	{
		// POINT_MANASHIELD ´Â ÀÛ¾ÆÁú¼ö·Ï ÁÁ´Ù
		int iDamageSPPart = dam / 3;
		int iDamageToSP = iDamageSPPart * GetPoint(POINT_MANASHIELD) / 100;
		int iSP = GetSP();

		// SP°¡ ÀÖÀ¸¸é ¹«Á¶°Ç µ¥¹ÌÁö Àý¹Ý °¨¼Ò
		if (iDamageToSP <= iSP)
		{
			PointChange(POINT_SP, -iDamageToSP);
			dam -= iDamageSPPart;
		}
		else
		{
			// Á¤½Å·ÂÀÌ ¸ðÀÚ¶ó¼­ ÇÇ°¡ ´õ ±ï¿©¾ßÇÒ‹š
			PointChange(POINT_SP, -GetSP());
			dam -= iSP * 100 / MAX(GetPoint(POINT_MANASHIELD), 1);
		}
	}

This is the real formula.

Share this post


Link to post
Share on other sites
  • 0

Ah that formula, yes I changed it. I'm using the one from vanilla's source, but I tried both original and the one from vanilla, even thought the results were different, it wasn't what it was supposed to do...

Share this post


Link to post
Share on other sites
  • 0
1 minute ago, charparodar said:

Ah that formula, yes I changed it. I'm using the one from vanilla's source, but I tried both original and the one from vanilla, even thought the results were different, it wasn't what it was supposed to do...

What do you mean?

Share this post


Link to post
Share on other sites
  • 0
Just now, Syreldar said:

What do you mean?

I tested with the original source formula and the one from vanilla that can be activated and deactivated with a config option.

The one from vanilla is letting the sura getting much more damage. An example, yesterday me and my friends tested, while I was without the manashield I got 800 of damage (hit), when I used the manashield I started getting 3000 (hit) (it was neither critic or penetration)

With the original formula I can't remember exactly what was the difference, but it wasn't doing what was supposed to as well...

Share this post


Link to post
Share on other sites
  • 0
8 hours ago, WeedHex said:

Show us you manashield formula 

INSERT INTO `player`.`skill_proto`(`dwVnum`, `szName`, `bType`, `bLevelStep`, `bMaxLevel`, `bLevelLimit`, `szPointOn`, `szPointPoly`, `szSPCostPoly`, `szDurationPoly`, `szDurationSPCostPoly`, `szCooldownPoly`, `szMasterBonusPoly`, `szAttackGradePoly`, `setFlag`, `setAffectFlag`, `szPointOn2`, `szPointPoly2`, `szDurationPoly2`, `setAffectFlag2`, `szPointOn3`, `szPointPoly3`, `szDurationPoly3`, `szGrandMasterAddSPCostPoly`, `prerequisiteSkillVnum`, `prerequisiteSkillLevel`, `eSkillType`, `iMaxHit`, `szSplashAroundDamageAdjustPoly`, `dwTargetRange`, `dwSplashRange`) VALUES (79, 0xC8E6BDC5BCF6C8A3, 3, 1, 1, 0, 'DEF_GRADE', '(0.5*iq+15)*k', '20+30*k', '60+120*k', '5+10*k', '63+120*k', '(0.5*iq+15)*k', '', 'SELFONLY,TOGGLE', 'MANASHIELD', 'MANASHIELD', '100-((iq*0.84)*k)', '60+120*k', '', '', '', '', '20+30*k', 0, 0, 'MAGIC', 1, '0.8', 0, 0);

On source I'm using the one, also tried the one from vanilla source but didn't work:

		if(!bugfix_sura_manashield)
		{
			// POINT_MANASHIELD ´Â ÀÛ¾ÆÁú¼ö·Ï ÁÁ´Ù
			int iDamageSPPart = dam / 3;
			int iDamageToSP = iDamageSPPart * GetPoint(POINT_MANASHIELD) / 100;
			int iSP = GetSP();

			// SP°¡ ÀÖÀ¸¸é ¹«Á¶°Ç µ¥¹ÌÁö Àý¹Ý °¨¼Ò
			if (iDamageToSP <= iSP)
			{
				PointChange(POINT_SP, -iDamageToSP);
				dam -= iDamageSPPart;
			}
			else
			{
				// Á¤½Å·ÂÀÌ ¸ðÀÚ¶ó¼­ ÇÇ°¡ ´õ ±ï¿©¾ßÇÒ‹š
				PointChange(POINT_SP, -GetSP());
				dam -= iSP * 100 / MAX(GetPoint(POINT_MANASHIELD), 1);
			}
		} else {
			// POINT_MANASHIELD ´Â ÀÛ¾ÆÁú¼ö·Ï ÁÁ´Ù
			int iDamageSPPart = (dam * GetPoint(POINT_MANASHIELD)) / 100;
			int iDamageToSP = iDamageSPPart * 0.2f;
			int iSP = GetSP();

			// SP°¡ ÀÖÀ¸¸é ¹«Á¶°Ç µ¥¹ÌÁö Àý¹Ý °¨¼Ò
			if (iDamageToSP <= iSP)
			{
				PointChange(POINT_SP, -iDamageToSP);
				dam -= iDamageSPPart;
			}
			else
			{
				// Á¤½Å·ÂÀÌ ¸ðÀÚ¶ó¼­ ÇÇ°¡ ´õ ±ï¿©¾ßÇÒ‹š
				PointChange(POINT_SP, -GetSP());
				dam -= (iSP / 20) * 100;
			}
		}

 

Share this post


Link to post
Share on other sites

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.

×