Original Trilogy Race/Class Modifiers
I'm working on an original trilogy server currently and am curious what the best way to impliment the original race/class bonuses/penalties would be. It looks like there is currently code in place to grant 5% bonus experience for the Halfling race, as well as Rogue and Warrior classes. As I understand it, the original bonuses/penalties were actually modifiers to total experience needed per level, rather than experience earned per mob.
I've looked at it, and it seems that I could do this in one of two ways, both in EQEmuServer/zone/exp.cpp. I could either modify GetEXPForLevel to include the modifier and increase the exp needed per level, or modify AddEXP to include an inverse of the modifier to decrease the exp gained per mob. Theoretically, either way should yield the same results, but I believe modifying GetEXPForLevel would be "more correct" based on rounding errors. Is there any reason that this might cause a problem? The comment above the function is what brings up my concern about doing it that way ("// Note: The client calculates exp separately, we cant change this function"). In addition, there is already code the modifies exp gained. In any case, here are my two options. If anyone knows why either would work, please let me know. GetEXPForLevel modification: Code:
uint32 Client::GetEXPForLevel(int16 check_level) Code:
if(RuleB(Character,UseRaceClassExpBonuses)) |
I realized when I compiled the first option (still haven't had a chance to test it) that I failed to initialize racemod and classmod properly. They should have been initialized equal to 1.0, default for any of the non-modified races/classes. Oops.
Code:
float racemod = 1.0; |
Well, for anyone who wanted to use this on their server for old race/class modifiers, it appears to work properly. Here's a table of test data, where the experience numbers are totals needed to complete the level:
Code:
Wood Elf Druid (0%) |
All times are GMT -4. The time now is 05:22 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.