HisaoShou 3 Posted April 12, 2019 Share Posted April 12, 2019 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? 1 Link to comment Share on other sites More sharing options...
Forum Moderator Solution VegaS™ 10267 Posted April 14, 2019 Forum Moderator Solution Share Posted April 14, 2019 (edited) 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 Is a fast explanation, i hope you understand it. Edited August 25, 2022 by Metin2 Dev Core X - External 2 Internal 4 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
avertuss 48 Posted April 15, 2019 Share Posted April 15, 2019 @VegaS™ Good explanation but probably he wanted to change these bonuses like att to monster instead of attack speed etc. Link to comment Share on other sites More sharing options...
Forum Moderator VegaS™ 10267 Posted April 15, 2019 Forum Moderator Share Posted April 15, 2019 (edited) 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 POINT_PARTY_TANKER_BONUS Spoiler POINT_PARTY_BUFFER_BONUS Spoiler POINT_PARTY_SKILL_MASTER_BONUS Spoiler POINT_PARTY_HASTE_BONUS Spoiler POINT_PARTY_DEFENDER_BONUS Spoiler 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 August 25, 2022 by Metin2 Dev Core X - External 2 Internal 2 Check my GitHub Profile Click to find all the threads started by me [TOOL] Text file loader + JSON Link to comment Share on other sites More sharing options...
HisaoShou 3 Posted April 15, 2019 Author Share Posted April 15, 2019 Thank you very much for pointing out how to solve the issue, I will see how this will end. Have a good day and thank you again! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now