Jump to content

[FIND SOLUTION] Role party bonus bug


Go to solution Solved by VegaS™,

Recommended Posts

  • Premium

If you use the skill duration extension group bonus, the duration of the STUN will be prolonged in a dangerous/ugly way.  (STUN can to last kinda 70 seconds)

Can we exclude ONLY the STUN bonus from this calculation?

 

Ps.The official server, says that perch fish is used to remove this "bug" so it's good. Most of players hate this so I think is better to exclude STUN bonus from the duration calculation.

  • Love 2
Link to comment
Share on other sites

  • Forum Moderator

I didn't tested that "bug", but you can disable the calculation from char_skill.cpp. (not tested)

				iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS);

By change it with:

				// Ignore the party role bonus just for stun flag.
				// SLOW, FIRE_CONT, POISON, BLEEDING will still be working.
				if (!IS_SET(m_pkSk->dwFlag, SKILL_FLAG_STUN))
					iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS);

 

  • Love 2
Link to comment
Share on other sites

  • Premium
9 minutes ago, VegaS™ said:

I didn't tested that "bug", but you can disable the calculation from party.cpp. (not tested)


				iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS);

By change it with:


				// Ignore the party role bonus just for stun flag.
				// SLOW, FIRE_CONT, POISON, BLEEDING will still be working.
				if (!IS_SET(m_pkSk->dwFlag, SKILL_FLAG_STUN))
					iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS);

 

Thx you so much Vegas, I'll test it and let you know here the result!

Link to comment
Share on other sites

  • Forum Moderator
  • Solution

Btw, instead of removing the calculation, i would set a MIN-MAX value for duration of stun flag.

So, let's take a look how the duration is calculated for POINT_PARTY_BUFFER_BONUS.

iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS);
Spoiler

int	CHARACTER::GetSkillPowerByLevel(int level, bool bMob) const
{
	return CTableBySkill::instance().GetSkillPowerByLevelFromType(GetJob(), GetSkillGroup(), MINMAX(0, level, SKILL_MAX_LEVEL), bMob);
}

int CTableBySkill::GetSkillPowerByLevelFromType(int job, int skillgroup, int skilllevel, bool bMob) const
{
	if (bMob)
		return m_aiSkillPowerByLevelFromType[0][skilllevel];

	if (job >= JOB_MAX_NUM || skillgroup == 0)
		return 0;

	int idx = (job * 2) + (skillgroup - 1);
	return m_aiSkillPowerByLevelFromType[idx][skilllevel];
}

 

m_iLeadership = Leader skill ship skill level which is increased by (book vnum: 50301, 50302, 50303)

Let's take a example, a warrior, skill group 1.

CHARACTER::GetSkillPowerByLevel << CTableBySkill::GetSkillPowerByLevelFromType

  • idx = 0 * 2 + 1 - 1 = 0
  • skilllevel = m_iLeadership
  • m_iLeadership = 40 (Skill Perfect Master)
// 0 5 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 50 52 54 56 58 60 63 66 69 72 82 85 88 91 94 98 102 106 110 115 125 125 125 125 125
m_aiSkillPowerByLevelFromType[0][40] = 125
  • int iBonus = (int) (5 + 45 * k);
  • float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) ) / 100.0f;
  • k = 125 / 100 = 1.25
  • iBonus = 5 + 45 1.25 = 56.5 (converted to integer will be 61) 
leadership Set as attacker Set as berserker Set as melee Set as blocker Set as defender Set as wizzard
Image Set as attacker.jpg Set as berserker.jpg Set as melee.jpg Set as blocker.jpg Set as defender.jpg Set as wizzard.jpg
G1 +59 AP +5 AS MaxHP +1.239 Length of spell: +41 From P on From G6 on
G2 +61 AP +5 AS MaxHP +1.282 Length of spell: +43 From P on From G6 on
G3 +62 AP +5 AS MaxHP +1.326 Length of spell: +44 From P on From G6 on
G4 +64 AP +5 AS MaxHP +1.369 Length of spell: +45 From P on From G6 on
G5 +66 AP +5 AS MaxHP +1.413 Length of spell: +47 From P on From G6 on
G6 +68 AP +5 AS MaxHP +1.471 Length of spell: +49 From P on MaxMP +613
G7 +71 AP +6 AS MaxHP +1.529 Length of spell: +50 From P on MaxSP +637
G8 +73 AP +6 AS MaxHP +1.587 Length of spell: +52 From P on MaxSP +661
G9 +76 AP +6 AS MaxHP +1.645 Length of spell: +54 From P on MaxSP +685
G10 +79 AW +6 AG MaxHP +1.717 Length of spell: +56 From P on MaxSP +715
P +85 AW +7 AG MaxHP +1.862 Length of spell: +61 Defence: +42 MaxSP +775
Quote

(STUN can to last kinda 70 seconds)

That means 61 seconds of duration are getted from the party role bonus, so you can set a limit.

				// Set a min-max value for party role bonus just when flag is stun.
				const uint16_t iMaxStunDuration = 30;
				if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_STUN))
				{
					iDur += MINMAX(static_cast<int>(m_pkSk->kDurationPoly2.Eval()), m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS), iMaxStunDuration);
				}
				else
				{
					// SLOW, FIRE_CONT, POISON, BLEEDING will still be working with the default calculation.
					iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS);
				}

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 3
  • Love 3
Link to comment
Share on other sites

That's actually easier

//this is char_skill.cpp struct FuncSplashDamage (so if you happen to modify your skill proto removing flag SPLASH from a skill which has ATTACK_STUN this won't have any effect)
struct FuncSplashDamage{
//...
			if (IS_SET(m_pkSk->dwFlag, SKILL_FLAG_SLOW | SKILL_FLAG_STUN | SKILL_FLAG_FIRE_CONT | SKILL_FLAG_POISON)) //Here will check for SKILL_FLAG_STUN which is flag ATTACK_STUN in db you could be either changing DB flag of skill 18 & 107 (from ATTACK_STUN to CRUSH used for every other stunning skill not applying POINT_PARTY_BUFFER_BONUS) or adding a check for SKILL_FLAG_STUN as suggested by WeedHex and have both flags the same. Pick your poison or start rewriting stupid korean code.
			{
				int iPct = (int) m_pkSk->kPointPoly2.Eval();
				int iDur = (int) m_pkSk->kDurationPoly2.Eval();

				iDur += m_pkChr->GetPoint(POINT_PARTY_BUFFER_BONUS) / 10;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.