Jump to content

How do I modify party Leadership bonuses?


Go to solution Solved by VegaS™,

Recommended Posts

Hello everyone, I have searched on most of the forums to find a way to modify these bonuses but I couldn't find anything. 

Does anyone knows how to modify the bonuses granted by Party Leadership? 

More info about Leadership can be found here: http://wiki.metin-2.com/index.php/Leadership

I want to know how to modify the bonuses granted by "Set As Berserker" , "Set as melee", and so on...

Can anyone help me with this issue please?

  • Metin2 Dev 1
Link to comment
Share on other sites

  • Forum Moderator
  • Solution
  • Srcs/Server/game/src/party.cpp
float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) ) / 100.0f;

// PARTY_ROLE_ATTACKER
int iBonus = (int) (10 + 60 * k);

// PARTY_ROLE_TANKER
int iBonus = (int) (50 + 1450 * k);

// PARTY_ROLE_BUFFER
int iBonus = (int) (5 + 45 * k);

// PARTY_ROLE_SKILL_MASTER
int iBonus = (int) (25 + 600 * k);

// PARTY_ROLE_HASTE
int iBonus = (int) (1+5*k);

// PARTY_ROLE_DEFENDER
int iBonus = (int) (5+30*k);
  • float k = (float) ch->GetSkillPowerByLevel( MIN(SKILL_MAX_LEVEL, m_iLeadership ) ) / 100.0f;

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

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

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

  • 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

PARTY_ROLE_DEFENDER: (5+30*k)

  • k = 125 / 100 = 1.25
  • iBonus 5 + 30 * 1.25 = 42.5 (converted to integer will be 42) 

Output from skill P:

// PARTY_ROLE_ATTACKER - Set as attacker
10 + 60 * (125 / 100) = 85
// PARTY_ROLE_TANKER - Set as berserker
1 + 5 * (125 / 100) = 7.25 = 7
// PARTY_ROLE_BUFFER - Set as melee
50 + 1450 * (125 / 100) = 1862.5 = 1862
// PARTY_ROLE_SKILL_MASTER - Set as blocker
5 + 45 * (125 / 100) = 61.25 = 61
// PARTY_ROLE_HASTE - Set as defender
5 + 30 * (125 / 100) = 42.5 = 42
// PARTY_ROLE_DEFENDER - Set as wizzard
25 + 600 * (125 / 100) = 775

3ddscab.png

Is a fast explanation, i hope you understand it.

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

  • Forum Moderator
1 hour ago, avertuss said:

but probably he wanted to change these bonuses like att to monster instead of attack speed etc.

Even if he wanted to change the bonus type, you still need how calculation works, you'll add Att Monster instead of Max HP and at Perfect Master, the value will be 1.862?
So he still need the calculations, before doing this, also for change the type of bonus isn't so easy, at least you need to know some things.

The current party bonuses are saved just as a point-value, not as a real bonus, the real bonus is calculated from another parts.

PARTY_ROLE_SKILL_MASTER > POINT_PARTY_SKILL_MASTER_BONUS
case POINT_MAX_SP:
{
	SetPoint(type, GetPoint(type) + amount);
	const int iRealPointSP = GetRealPoint(POINT_MAX_SP);
	int iAddSP = MIN(800, iRealPointSP * GetPoint(POINT_MAX_SP_PCT) / 100);
	iAddSP += GetPoint(POINT_MAX_SP);
	// Add SP to current value by party skill bonus
	iAddSP += GetPoint(POINT_PARTY_SKILL_MASTER_BONUS);

	SetMaxSP(iRealPointSP + iAddSP);
	val = GetMaxSP();
}
break;
  • POINT_PARTY_ATTACKER_BONUS
Spoiler

iM3Cgab.png

  • POINT_PARTY_TANKER_BONUS
Spoiler

lq8Hbab.png

  • POINT_PARTY_BUFFER_BONUS
Spoiler

yttjfab.png

  • POINT_PARTY_SKILL_MASTER_BONUS
Spoiler

WLb9fab.png

  • POINT_PARTY_HASTE_BONUS
Spoiler

jWhMeab.png

  • POINT_PARTY_DEFENDER_BONUS
Spoiler

Xq2dgab.png

So if you want to change the bonuses, you've to rewrite all the calculations from those functions (remove the lines += GetPoint(..), and make them static, depends of you how and where, you can add it inside party.cpp after ComputePoints of each bonus like.

// Set as melee
ch->PointChange(POINT_ATTBONUS_MONSTER, ch->GetPoint(POINT_PARTY_BUFFER_BONUS));

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 2
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.