From e2f14566245458b932d741ef3769f8f0e2a3c6c5 Mon Sep 17 00:00:00 2001 From: Cilraaz Date: Wed, 14 Oct 2015 22:57:17 -0400 Subject: [PATCH] Allow For Old Race/Class Experience Modifiers Add new ruletypes 'Character:UseOldRaceExpPenalties' and 'Character:UseOldClassExpPenalties' When set to true, adds in bonuses/penalties that existed in Classic Class-based penalties were disabled during Velious, while race-based penalties were not removed until TSS This method uses the original SOE method of increase exp needed to level, rather than decreasing exp gained --- common/ruletypes.h | 2 ++ zone/exp.cpp | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/common/ruletypes.h b/common/ruletypes.h index 1b4baa371..9c05821e5 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -85,6 +85,8 @@ RULE_INT(Character, MaxCharmDurationForPlayerCharacter, 15) RULE_INT(Character, BaseHPRegenBonusRaces, 4352) //a bitmask of race(s) that receive the regen bonus. Iksar (4096) & Troll (256) = 4352. see common/races.h for the bitmask values RULE_BOOL(Character, SoDClientUseSoDHPManaEnd, false) // Setting this to true will allow SoD clients to use the SoD HP/Mana/End formulas and previous clients will use the old formulas RULE_BOOL(Character, UseRaceClassExpBonuses, true) // Setting this to true will enable Class and Racial experience rate bonuses +RULE_BOOL(Character, UseOldRaceExpPenalties, false) // Setting this to true will enable racial exp penalties for Iksar, Troll, Ogre, and Barbarian, as well as the bonus for Halflings +RULE_BOOL(Character, UseOldClassExpPenalties, false) // Setting this to true will enable old class exp penalties for Paladin, SK, Ranger, Bard, Monk, Wizard, Enchanter, Magician, and Necromancer, as well as the bonus for Rogues and Warriors RULE_BOOL(Character, RespawnFromHover, false) // Use Respawn window, or not. RULE_INT(Character, RespawnFromHoverTimer, 300) // Respawn Window countdown timer, in SECONDS RULE_BOOL(Character, UseNewStatsWindow, true) // New stats window shows everything diff --git a/zone/exp.cpp b/zone/exp.cpp index 0172263e7..2e231cc36 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -665,6 +665,41 @@ uint32 Client::GetEXPForLevel(uint16 check_level) mod *= 1000; uint32 finalxp = uint32(base * mod); + + if(RuleB(Character,UseOldRaceExpPenalties)) + { + float racemod = 1.0; + if(GetBaseRace() == TROLL || GetBaseRace() == IKSAR) { + racemod = 1.2; + } else if(GetBaseRace() == OGRE) { + racemod = 1.15; + } else if(GetBaseRace() == BARBARIAN) { + racemod = 1.05; + } else if(GetBaseRace() == HALFLING) { + racemod = 0.95; + } + + finalxp = uint32(finalxp * racemod); + } + + if(RuleB(Character,UseOldClassExpPenalties)) + { + float classmod = 1.0; + if(GetClass() == PALADIN || GetClass() == SHADOWKNIGHT || GetClass() == RANGER || GetClass() == BARD) { + classmod = 1.4; + } else if(GetClass() == MONK) { + classmod = 1.2; + } else if(GetClass() == WIZARD || GetClass() == ENCHANTER || GetClass() == MAGICIAN || GetClass() == NECROMANCER) { + classmod = 1.1; + } else if(GetClass() == ROGUE) { + classmod = 0.91; + } else if(GetClass() == WARRIOR) { + classmod = 0.9; + } + + finalxp = uint32(finalxp * classmod); + } + finalxp = mod_client_xp_for_level(finalxp, check_level); return finalxp;