Go Back   EQEmulator Home > EQEmulator Forums > Development > Development: Custom Code

Development: Custom Code This is for code thatdoes not emulate live and wont be added to the official code.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-03-2012, 02:22 PM
Cilraaz
Sarnak
 
Join Date: Mar 2010
Posts: 77
Default 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)
{

	int16 check_levelm1 = check_level-1;
	float racemod;
	float classmod;
	float mod;
	if (check_level < 31)
		mod = 1.0;
	else if (check_level < 36)
		mod = 1.1;
	else if (check_level < 41)
		mod = 1.2;
	else if (check_level < 46)
		mod = 1.3;
	else if (check_level < 52)
		mod = 1.4;
	else if (check_level < 53)
		mod = 1.5;
	else if (check_level < 54)
		mod = 1.6;
	else if (check_level < 55)
		mod = 1.7;
	else if (check_level < 56)
		mod = 1.9;
	else if (check_level < 57)
		mod = 2.1;
	else if (check_level < 58)
		mod = 2.3;
	else if (check_level < 59)
		mod = 2.5;
	else if (check_level < 60)
		mod = 2.7;
	else if (check_level < 61)
		mod = 3.0;
	else
		mod = 3.1;
	
	float base = (check_levelm1)*(check_levelm1)*(check_levelm1);

	mod *= 1000;

	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;
	} else {
		//do nothing
	}

	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;
	} else {
		//do nothing
	}	

	return(uint32(base * mod * racemod * classmod));
}
AddEXP modification (twice: once within the if(resexp) block and once after):

Code:
	if(RuleB(Character,UseRaceClassExpBonuses))
	{
		if(GetBaseRace() == TROLL || GetBaseRace() == IKSAR) {
			totalmod *= 0.833;
		} else if(GetBaseRace() == OGRE) {
			totalmod *= 0.870;
		} else if(GetBaseRace() == BARBARIAN) {
			totalmod *= 0.952;
		} else if(GetBaseRace() == HALFLING) {
			totalmod *= 1.053;
		} else {
			//do nothing
		}

		if(GetClass() == PALADIN || GetClass() == SHADOWKNIGHT || GetClass() == RANGER || GetClass() == BARD) {
			totalmod *= 0.714;
		} else if(GetClass() == MONK) {
			totalmod *= 0.833;
		} else if(GetClass() == WIZARD || GetClass() == ENCHANTER || GetClass() == MAGICIAN || GetClass() == NECROMANCER) {
			totalmod *= 0.909;
		} else if(GetClass() == ROGUE) {
			totalmod *= 1.099;
		} else if(GetClass() == WARRIOR) {
			totalmod *= 1.111;
		} else {
			//do nothing
		}
	}
Thanks for any insight that anyone could provide.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:46 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3