TheLieka
08-25-2007, 10:44 AM
When I set up my server with the intention of having "hotspot" zones, I noticed that the zone_exp_multiplier from the zone table was not being used to calculated the xp for a kill.
I'm sure there are better ways to do this, but here's what I changed in my code to make this work:
I made the following change to the void Client::AddEXP function within exp.cpp
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
int32 add_aaxp;
if(resexp) {
add_aaxp = 0;
} else {
//figure out how much of this goes to AAs
add_aaxp = add_exp * m_epp.perAA / 100;
//take that ammount away from regular exp
add_exp -= add_aaxp;
float totalmod = 1.0;
//get modifiers
if (zone->GetEXPMod() > 0) {
totalmod = zone->GetEXPMod();
//Lieka: Add in the zone_exp_multiplier value from the database
totalmod *= zone->newzone_data.zone_exp_multiplier;
}
if(RuleR(Character, ExpMultiplier) >= 0){
totalmod *= RuleR(Character, ExpMultiplier);
}
add_exp = int32(float(add_exp) * totalmod);
Thanks,
Daxum
I'm sure there are better ways to do this, but here's what I changed in my code to make this work:
I made the following change to the void Client::AddEXP function within exp.cpp
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
int32 add_aaxp;
if(resexp) {
add_aaxp = 0;
} else {
//figure out how much of this goes to AAs
add_aaxp = add_exp * m_epp.perAA / 100;
//take that ammount away from regular exp
add_exp -= add_aaxp;
float totalmod = 1.0;
//get modifiers
if (zone->GetEXPMod() > 0) {
totalmod = zone->GetEXPMod();
//Lieka: Add in the zone_exp_multiplier value from the database
totalmod *= zone->newzone_data.zone_exp_multiplier;
}
if(RuleR(Character, ExpMultiplier) >= 0){
totalmod *= RuleR(Character, ExpMultiplier);
}
add_exp = int32(float(add_exp) * totalmod);
Thanks,
Daxum