Merge pull request #467 from Cilraaz/master

Old Race/Class Experience Mods
This commit is contained in:
Michael Cook (mackal) 2015-11-20 14:00:03 -05:00
commit 0fa5b8d3f2
2 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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;