View Single Post
  #9  
Old 01-12-2007, 11:12 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

This wouldn't be very hard and really isn't that bad an idea I threw something like this together quickly:

Code:
Index: exp.cpp
===================================================================
--- exp.cpp	(revision 940)
+++ exp.cpp	(working copy)
@@ -29,8 +29,16 @@
 //                            war   cle    pal    ran    shd    dru    mnk    brd    rog    shm    nec    wiz    mag    enc    bst    bes
 float class_modifiers[16] = { 9.0f, 10.0f, 14.0f, 14.0f, 14.0f, 10.0f, 12.0f, 14.0f, 9.05f, 10.0f, 11.0f, 11.0f, 11.0f, 11.0f, 10.0f, 10.0f};
 
+#define MAX_LEVEL_MOD 70
+float level_modifiers[MAX_LEVEL_MOD] = { 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+					1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+					1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+					1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+					1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+					1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f,
+					1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f };
+							
 
-
 void Client::AddEXP(int32 add_exp, int8 conlevel, bool resexp) {
 	if (m_epp.perAA<0 || m_epp.perAA>100)
 		m_epp.perAA=0;	// stop exploit with sanity check
@@ -44,10 +52,22 @@
 		//take that ammount away from regular exp
 		add_exp -= add_aaxp;
 	
-		//get zone modifier
+		float totalmod = 1.0;
+		//get modifiers... I don't like how we mix floats and ints so much but for now...
 		if (zone->GetEXPMod() > 0) {
-			add_exp = int32(float(add_exp) * zone->GetEXPMod());
+			totalmod = zone->GetEXPMod();
 		}
+		
+		if(RuleR(Character, ExpMultiplier) > 0){
+			totalmod *= RuleR(Character, ExpMultiplier);
+		}
+		
+		if(GetLevel() <= MAX_LEVEL_MOD && GetLevel >= 1){
+			totalmod *= level_modifiers[GetLevel()-1];
+		}
+		add_exp = int32(float(add_exp) * totalmod);
+		
+		
 	
 #ifdef CON_XP_SCALING
 		if (conlevel != 0xFF) {
..also noticed expmodifier rule doesn't appear to be working right now while doing which I will fix. Haven't tested this but yeah could also do it with something in the database too if wanted.. not a difficult concept and very nice for legit servers that want to tweak how they play.
Reply With Quote