diff --git a/zone/attack.cpp b/zone/attack.cpp index 4931095e1..1732f4e7e 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2497,7 +2497,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy Group *kg = entity_list.GetGroupByClient(give_exp_client); Raid *kr = entity_list.GetRaidByClient(give_exp_client); - int32 finalxp = give_exp_client->GetExperienceForKill(this); + int64 finalxp = give_exp_client->GetExperienceForKill(this); finalxp = give_exp_client->mod_client_xp(finalxp, this); // handle task credit on behalf of the killer diff --git a/zone/client.h b/zone/client.h index ee4806319..58087b772 100644 --- a/zone/client.h +++ b/zone/client.h @@ -625,17 +625,17 @@ public: void AddCrystals(uint32 Radiant, uint32 Ebon); void SendCrystalCounts(); - uint32 GetExperienceForKill(Mob *against); - void AddEXP(uint32 in_add_exp, uint8 conlevel = 0xFF, bool resexp = false); - uint32 CalcEXP(uint8 conlevel = 0xFF); - void CalculateNormalizedAAExp(uint32 &add_aaxp, uint8 conlevel, bool resexp); - void CalculateStandardAAExp(uint32 &add_aaxp, uint8 conlevel, bool resexp); - void CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel); - void CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, uint8 conlevel, bool resexp); - void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp=false); + uint64 GetExperienceForKill(Mob *against); + void AddEXP(uint64 in_add_exp, uint8 conlevel = 0xFF, bool resexp = false); + uint64 CalcEXP(uint8 conlevel = 0xFF); + void CalculateNormalizedAAExp(uint64 &add_aaxp, uint8 conlevel, bool resexp); + void CalculateStandardAAExp(uint64 &add_aaxp, uint8 conlevel, bool resexp); + void CalculateLeadershipExp(uint64 &add_exp, uint8 conlevel); + void CalculateExp(uint64 in_add_exp, uint64 &add_exp, uint64 &add_aaxp, uint8 conlevel, bool resexp); + void SetEXP(uint64 set_exp, uint64 set_aaxp, bool resexp=false); void AddLevelBasedExp(uint8 exp_percentage, uint8 max_level = 0, bool ignore_mods = false); - void SetLeadershipEXP(uint32 group_exp, uint32 raid_exp); - void AddLeadershipEXP(uint32 group_exp, uint32 raid_exp); + void SetLeadershipEXP(uint64 group_exp, uint64 raid_exp); + void AddLeadershipEXP(uint64 group_exp, uint64 raid_exp); void SendLeadershipEXPUpdate(); bool IsLeadershipEXPOn(); inline int GetLeadershipAA(int AAID) { return m_pp.leader_abilities.ranks[AAID]; } @@ -1608,7 +1608,7 @@ public: void mod_client_death_npc(Mob* killerMob); void mod_client_death_duel(Mob* killerMob); void mod_client_death_env(); - int32 mod_client_xp(int32 in_exp, NPC *npc); + int64 mod_client_xp(int64 in_exp, NPC *npc); uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level); int mod_client_haste_cap(int cap); int mod_consume(EQ::ItemData *item, EQ::item::ItemType type, int change); diff --git a/zone/exp.cpp b/zone/exp.cpp index c4c07093a..ebf53700d 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -38,7 +38,7 @@ extern QueryServ* QServ; -static uint32 ScaleAAXPBasedOnCurrentAATotal(int earnedAA, uint32 add_aaxp) +static uint64 ScaleAAXPBasedOnCurrentAATotal(int earnedAA, uint64 add_aaxp) { float baseModifier = RuleR(AA, ModernAAScalingStartPercent); int aaMinimum = RuleI(AA, ModernAAScalingAAMinimum); @@ -64,7 +64,7 @@ static uint32 ScaleAAXPBasedOnCurrentAATotal(int earnedAA, uint32 add_aaxp) float normalizedScale = (float)remainingAA / scaleRange; // Scale. - uint32 totalWithExpMod = add_aaxp * (baseModifier / 100) * normalizedScale; + uint64 totalWithExpMod = add_aaxp * (baseModifier / 100) * normalizedScale; // Are we so close to the scale limit that we're earning more XP without scaling? This // will happen when we get very close to the limit. In this case, just grant the unscaled @@ -104,13 +104,13 @@ static uint32 MaxBankedRaidLeadershipPoints(int Level) return 10; } -uint32 Client::CalcEXP(uint8 conlevel) { +uint64 Client::CalcEXP(uint8 conlevel) { - uint32 in_add_exp = EXP_FORMULA; + uint64 in_add_exp = EXP_FORMULA; if((XPRate != 0)) - in_add_exp = static_cast(in_add_exp * (static_cast(XPRate) / 100.0f)); + in_add_exp = static_cast(in_add_exp * (static_cast(XPRate) / 100.0f)); float totalmod = 1.0; float zemmod = 1.0; @@ -139,7 +139,7 @@ uint32 Client::CalcEXP(uint8 conlevel) { totalmod += RuleR(Zone, HotZoneBonus); } - in_add_exp = uint32(float(in_add_exp) * totalmod * zemmod); + in_add_exp = uint64(float(in_add_exp) * totalmod * zemmod); if(RuleB(Character,UseXPConScaling)) { @@ -202,10 +202,10 @@ uint32 Client::CalcEXP(uint8 conlevel) { return in_add_exp; } -uint32 Client::GetExperienceForKill(Mob *against) +uint64 Client::GetExperienceForKill(Mob *against) { #ifdef LUA_EQEMU - uint32 lua_ret = 0; + uint64 lua_ret = 0; bool ignoreDefault = false; lua_ret = LuaParser::Instance()->GetExperienceForKill(this, against, ignoreDefault); @@ -216,7 +216,7 @@ uint32 Client::GetExperienceForKill(Mob *against) if (against && against->IsNPC()) { uint32 level = (uint32)against->GetLevel(); - uint32 ret = EXP_FORMULA; + uint64 ret = EXP_FORMULA; auto mod = against->GetKillExpMod(); if(mod >= 0) { @@ -257,7 +257,7 @@ float static GetConLevelModifierPercent(uint8 conlevel) } } -void Client::CalculateNormalizedAAExp(uint32 &add_aaxp, uint8 conlevel, bool resexp) +void Client::CalculateNormalizedAAExp(uint64 &add_aaxp, uint8 conlevel, bool resexp) { // Functionally this is the same as having the case in the switch, but this is // cleaner to read. @@ -281,7 +281,7 @@ void Client::CalculateNormalizedAAExp(uint32 &add_aaxp, uint8 conlevel, bool res add_aaxp = percentToAAXp * (xpPerAA / (whiteConKillsPerAA / colorModifier)); } -void Client::CalculateStandardAAExp(uint32 &add_aaxp, uint8 conlevel, bool resexp) +void Client::CalculateStandardAAExp(uint64 &add_aaxp, uint8 conlevel, bool resexp) { if (!resexp) { @@ -332,26 +332,26 @@ void Client::CalculateStandardAAExp(uint32 &add_aaxp, uint8 conlevel, bool resex add_aaxp *= GetAAEXPModifier(zone->GetZoneID(), zone->GetInstanceVersion()); } - add_aaxp = (uint32)(RuleR(Character, AAExpMultiplier) * add_aaxp * aatotalmod); + add_aaxp = (uint64)(RuleR(Character, AAExpMultiplier) * add_aaxp * aatotalmod); } -void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) +void Client::CalculateLeadershipExp(uint64 &add_exp, uint8 conlevel) { if (IsLeadershipEXPOn() && (conlevel == CON_BLUE || conlevel == CON_WHITE || conlevel == CON_YELLOW || conlevel == CON_RED)) { - add_exp = static_cast(static_cast(add_exp) * 0.8f); + add_exp = static_cast(static_cast(add_exp) * 0.8f); if (GetGroup()) { if (m_pp.group_leadership_points < MaxBankedGroupLeadershipPoints(GetLevel()) && RuleI(Character, KillsPerGroupLeadershipAA) > 0) { - uint32 exp = GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA); + uint64 exp = GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA); Client *mentoree = GetGroup()->GetMentoree(); if (GetGroup()->GetMentorPercent() && mentoree && mentoree->GetGroupPoints() < MaxBankedGroupLeadershipPoints(mentoree->GetLevel())) { - uint32 mentor_exp = exp * (GetGroup()->GetMentorPercent() / 100.0f); + uint64 mentor_exp = exp * (GetGroup()->GetMentorPercent() / 100.0f); exp -= mentor_exp; mentoree->AddLeadershipEXP(mentor_exp, 0); // ends up rounded down mentoree->MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); @@ -391,12 +391,12 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) && RuleI(Character, KillsPerGroupLeadershipAA) > 0) { uint32 group_id = raid->GetGroup(this); - uint32 exp = GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA); + uint64 exp = GROUP_EXP_PER_POINT / RuleI(Character, KillsPerGroupLeadershipAA); Client *mentoree = raid->GetMentoree(group_id); if (raid->GetMentorPercent(group_id) && mentoree && mentoree->GetGroupPoints() < MaxBankedGroupLeadershipPoints(mentoree->GetLevel())) { - uint32 mentor_exp = exp * (raid->GetMentorPercent(group_id) / 100.0f); + uint64 mentor_exp = exp * (raid->GetMentorPercent(group_id) / 100.0f); exp -= mentor_exp; mentoree->AddLeadershipEXP(mentor_exp, 0); mentoree->MessageString(Chat::LeaderShip, GAIN_GROUP_LEADERSHIP_EXP); @@ -416,13 +416,13 @@ void Client::CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel) } } -void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, uint8 conlevel, bool resexp) +void Client::CalculateExp(uint64 in_add_exp, uint64 &add_exp, uint64 &add_aaxp, uint8 conlevel, bool resexp) { add_exp = in_add_exp; if (!resexp && (XPRate != 0)) { - add_exp = static_cast(in_add_exp * (static_cast(XPRate) / 100.0f)); + add_exp = static_cast(in_add_exp * (static_cast(XPRate) / 100.0f)); } // Make sure it was initialized. @@ -466,7 +466,7 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, totalmod += RuleR(Zone, HotZoneBonus); } - add_exp = uint32(float(add_exp) * totalmod * zemmod); + add_exp = uint64(float(add_exp) * totalmod * zemmod); //if XP scaling is based on the con of a monster, do that now. if (RuleB(Character, UseXPConScaling)) @@ -503,20 +503,21 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, auto experience_for_level = (GetEXPForLevel(GetLevel() + 1) - GetEXPForLevel(GetLevel())); auto exp_percent = static_cast(std::ceil(static_cast(add_exp / experience_for_level) * 100.0f)); if (exp_percent > kill_percent_xp_cap) { - add_exp = static_cast(std::floor(experience_for_level * (kill_percent_xp_cap / 100.0f))); + add_exp = static_cast(std::floor(experience_for_level * (kill_percent_xp_cap / 100.0f))); } } } -void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { +void Client::AddEXP(uint64 in_add_exp, uint8 conlevel, bool resexp) { if (!IsEXPEnabled()) { return; } + EVENT_ITEM_ScriptStopReturn(); - uint32 exp = 0; - uint32 aaexp = 0; + uint64 exp = 0; + uint64 aaexp = 0; if (m_epp.perAA < 0 || m_epp.perAA > 100) { m_epp.perAA = 0; // stop exploit with sanity check @@ -583,7 +584,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { SetEXP(exp, aaexp, resexp); } -void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { +void Client::SetEXP(uint64 set_exp, uint64 set_aaxp, bool isrezzexp) { LogDebug("Attempting to Set Exp for [{}] (XP: [{}], AAXP: [{}], Rez: [{}])", GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); auto max_AAXP = GetRequiredAAExperience(); @@ -604,15 +605,21 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { if ((set_exp + set_aaxp) > (m_pp.exp+m_pp.expAA)) { - uint32 exp_gained = set_exp - m_pp.exp; - uint32 aaxp_gained = set_aaxp - m_pp.expAA; + uint64 exp_gained = set_exp - m_pp.exp; + uint64 aaxp_gained = set_aaxp - m_pp.expAA; float exp_percent = (float)((float)exp_gained / (float)(GetEXPForLevel(GetLevel() + 1) - GetEXPForLevel(GetLevel())))*(float)100; //EXP needed for level float aaxp_percent = (float)((float)aaxp_gained / (float)(RuleI(AA, ExpPerPoint)))*(float)100; //AAEXP needed for level std::string exp_amount_message = ""; if (RuleI(Character, ShowExpValues) >= 1) { - if (exp_gained > 0 && aaxp_gained > 0) exp_amount_message = StringFormat("%u, %u AA", exp_gained, aaxp_gained); - else if (exp_gained > 0) exp_amount_message = StringFormat("%u", exp_gained); - else exp_amount_message = StringFormat("%u AA", aaxp_gained); + if (exp_gained > 0 && aaxp_gained > 0) { + exp_amount_message = fmt::format("({}) ({})", exp_gained, aaxp_gained); + } + else if (exp_gained > 0) { + exp_amount_message = fmt::format("({})", exp_gained); + } + else { + exp_amount_message = fmt::format("({}) AA", aaxp_gained); + } } std::string exp_percent_message = ""; @@ -645,7 +652,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { } } else if((set_exp + set_aaxp) < (m_pp.exp+m_pp.expAA)){ //only loss message if you lose exp, no message if you gained/lost nothing. - uint32 exp_lost = m_pp.exp - set_exp; + uint64 exp_lost = m_pp.exp - set_exp; float exp_percent = (float)((float)exp_lost / (float)(GetEXPForLevel(GetLevel() + 1) - GetEXPForLevel(GetLevel())))*(float)100; if (RuleI(Character, ShowExpValues) == 1 && exp_lost > 0) Message(Chat::Yellow, "You have lost %i experience.", exp_lost); @@ -1017,7 +1024,7 @@ uint32 Client::GetEXPForLevel(uint16 check_level) racemod = 0.95; } - finalxp = uint32(finalxp * racemod); + finalxp = uint64(finalxp * racemod); } if(RuleB(Character,UseOldClassExpPenalties)) @@ -1035,7 +1042,7 @@ uint32 Client::GetEXPForLevel(uint16 check_level) classmod = 0.9; } - finalxp = uint32(finalxp * classmod); + finalxp = uint64(finalxp * classmod); } finalxp = mod_client_xp_for_level(finalxp, check_level); @@ -1045,8 +1052,8 @@ uint32 Client::GetEXPForLevel(uint16 check_level) void Client::AddLevelBasedExp(uint8 exp_percentage, uint8 max_level, bool ignore_mods) { - uint32 award; - uint32 xp_for_level; + uint64 award; + uint64 xp_for_level; if (exp_percentage > 100) { @@ -1071,11 +1078,11 @@ void Client::AddLevelBasedExp(uint8 exp_percentage, uint8 max_level, bool ignore award *= RuleR(Character, FinalExpMultiplier); } - uint32 newexp = GetEXP() + award; + uint64 newexp = GetEXP() + award; SetEXP(newexp, GetAAXP()); } -void Group::SplitExp(uint32 exp, Mob* other) { +void Group::SplitExp(uint64 exp, Mob* other) { if( other->CastToNPC()->MerchantType != 0 ) // Ensure NPC isn't a merchant return; @@ -1083,7 +1090,7 @@ void Group::SplitExp(uint32 exp, Mob* other) { return; unsigned int i; - uint32 groupexp = exp; + uint64 groupexp = exp; uint8 membercount = 0; uint8 maxlevel = 1; @@ -1104,7 +1111,7 @@ void Group::SplitExp(uint32 exp, Mob* other) { else groupmod = 1.0; if(membercount > 1 && membercount <= 6) - groupexp += (uint32)((float)exp * groupmod * (RuleR(Character, GroupExpMultiplier))); + groupexp += (uint64)((float)exp * groupmod * (RuleR(Character, GroupExpMultiplier))); int conlevel = Mob::GetLevelCon(maxlevel, other->GetLevel()); if(conlevel == CON_GRAY) @@ -1123,22 +1130,22 @@ void Group::SplitExp(uint32 exp, Mob* other) { if(maxdiff > -5) maxdiff = -5; if (diff >= (maxdiff)) { /*Instead of person who killed the mob, the person who has the highest level in the group*/ - uint32 tmp = (cmember->GetLevel()+3) * (cmember->GetLevel()+3) * 75 * 35 / 10; - uint32 tmp2 = groupexp / membercount; + uint64 tmp = (cmember->GetLevel()+3) * (cmember->GetLevel()+3) * 75 * 35 / 10; + uint64 tmp2 = groupexp / membercount; cmember->AddEXP( tmp < tmp2 ? tmp : tmp2, conlevel ); } } } } -void Raid::SplitExp(uint32 exp, Mob* other) { +void Raid::SplitExp(uint64 exp, Mob* other) { if( other->CastToNPC()->MerchantType != 0 ) // Ensure NPC isn't a merchant return; if(other->GetOwner() && other->GetOwner()->IsClient()) // Ensure owner isn't pc return; - uint32 groupexp = exp; + uint64 groupexp = exp; uint8 membercount = 0; uint8 maxlevel = 1; @@ -1151,7 +1158,7 @@ void Raid::SplitExp(uint32 exp, Mob* other) { } } - groupexp = (uint32)((float)groupexp * (1.0f-(RuleR(Character, RaidExpMultiplier)))); + groupexp = (uint64)((float)groupexp * (1.0f-(RuleR(Character, RaidExpMultiplier)))); int conlevel = Mob::GetLevelCon(maxlevel, other->GetLevel()); if(conlevel == CON_GRAY) @@ -1170,15 +1177,15 @@ void Raid::SplitExp(uint32 exp, Mob* other) { if(maxdiff > -5) maxdiff = -5; if (diff >= (maxdiff)) { /*Instead of person who killed the mob, the person who has the highest level in the group*/ - uint32 tmp = (cmember->GetLevel()+3) * (cmember->GetLevel()+3) * 75 * 35 / 10; - uint32 tmp2 = (groupexp / membercount) + 1; + uint64 tmp = (cmember->GetLevel()+3) * (cmember->GetLevel()+3) * 75 * 35 / 10; + uint64 tmp2 = (groupexp / membercount) + 1; cmember->AddEXP( tmp < tmp2 ? tmp : tmp2, conlevel ); } } } } -void Client::SetLeadershipEXP(uint32 group_exp, uint32 raid_exp) { +void Client::SetLeadershipEXP(uint64 group_exp, uint64 raid_exp) { while(group_exp >= GROUP_EXP_PER_POINT) { group_exp -= GROUP_EXP_PER_POINT; m_pp.group_leadership_points++; @@ -1196,7 +1203,7 @@ void Client::SetLeadershipEXP(uint32 group_exp, uint32 raid_exp) { SendLeadershipEXPUpdate(); } -void Client::AddLeadershipEXP(uint32 group_exp, uint32 raid_exp) { +void Client::AddLeadershipEXP(uint64 group_exp, uint64 raid_exp) { SetLeadershipEXP(GetGroupEXP() + group_exp, GetRaidEXP() + raid_exp); } diff --git a/zone/groups.h b/zone/groups.h index 3800f3872..04f8c3f75 100644 --- a/zone/groups.h +++ b/zone/groups.h @@ -71,7 +71,7 @@ public: bool IsGroup() { return true; } void SendGroupJoinOOZ(Mob* NewMember); void CastGroupSpell(Mob* caster,uint16 spellid); - void SplitExp(uint32 exp, Mob* other); + void SplitExp(uint64 exp, Mob* other); void GroupMessage(Mob* sender,uint8 language,uint8 lang_skill,const char* message); void GroupMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); uint32 GetTotalGroupDamage(Mob* other); diff --git a/zone/lua_client.cpp b/zone/lua_client.cpp index c86df5a89..7fdfbb199 100644 --- a/zone/lua_client.cpp +++ b/zone/lua_client.cpp @@ -266,12 +266,12 @@ void Lua_Client::AddEXP(uint32 add_exp, int conlevel, bool resexp) { self->AddEXP(add_exp, conlevel, resexp); } -void Lua_Client::SetEXP(uint32 set_exp, uint32 set_aaxp) { +void Lua_Client::SetEXP(uint64 set_exp, uint64 set_aaxp) { Lua_Safe_Call_Void(); self->SetEXP(set_exp, set_aaxp); } -void Lua_Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp) { +void Lua_Client::SetEXP(uint64 set_exp, uint64 set_aaxp, bool resexp) { Lua_Safe_Call_Void(); self->SetEXP(set_exp, set_aaxp, resexp); } @@ -3418,8 +3418,8 @@ luabind::scope lua_register_client() { .def("SetDeity", (void(Lua_Client::*)(int))&Lua_Client::SetDeity) .def("SetDuelTarget", (void(Lua_Client::*)(int))&Lua_Client::SetDuelTarget) .def("SetDueling", (void(Lua_Client::*)(bool))&Lua_Client::SetDueling) - .def("SetEXP", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::SetEXP) - .def("SetEXP", (void(Lua_Client::*)(uint32,uint32,bool))&Lua_Client::SetEXP) + .def("SetEXP", (void(Lua_Client::*)(uint64,uint64))&Lua_Client::SetEXP) + .def("SetEXP", (void(Lua_Client::*)(uint64,uint64,bool))&Lua_Client::SetEXP) .def("SetEXPEnabled", (void(Lua_Client::*)(bool))&Lua_Client::SetEXPEnabled) .def("SetEXPModifier", (void(Lua_Client::*)(uint32,double))&Lua_Client::SetEXPModifier) .def("SetEXPModifier", (void(Lua_Client::*)(uint32,double,int16))&Lua_Client::SetEXPModifier) diff --git a/zone/lua_client.h b/zone/lua_client.h index f9d534e4a..5a3032ed5 100644 --- a/zone/lua_client.h +++ b/zone/lua_client.h @@ -92,8 +92,8 @@ public: void AddEXP(uint32 add_exp); void AddEXP(uint32 add_exp, int conlevel); void AddEXP(uint32 add_exp, int conlevel, bool resexp); - void SetEXP(uint32 set_exp, uint32 set_aaxp); - void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp); + void SetEXP(uint64 set_exp, uint64 set_aaxp); + void SetEXP(uint64 set_exp, uint64 set_aaxp, bool resexp); void SetBindPoint(); void SetBindPoint(int to_zone); void SetBindPoint(int to_zone, int to_instance); diff --git a/zone/lua_group.cpp b/zone/lua_group.cpp index 1578be2be..4a3907960 100644 --- a/zone/lua_group.cpp +++ b/zone/lua_group.cpp @@ -34,7 +34,7 @@ void Lua_Group::CastGroupSpell(Lua_Mob caster, int spell_id) { self->CastGroupSpell(caster, spell_id); } -void Lua_Group::SplitExp(uint32 exp, Lua_Mob other) { +void Lua_Group::SplitExp(uint64 exp, Lua_Mob other) { Lua_Safe_Call_Void(); self->SplitExp(exp, other); } diff --git a/zone/lua_group.h b/zone/lua_group.h index 0f6c87ba3..e24118f02 100644 --- a/zone/lua_group.h +++ b/zone/lua_group.h @@ -34,7 +34,7 @@ public: bool IsGroupMember(const char* name); bool IsGroupMember(Lua_Mob c); void CastGroupSpell(Lua_Mob caster, int spell_id); - void SplitExp(uint32 exp, Lua_Mob other); + void SplitExp(uint64 exp, Lua_Mob other); void GroupMessage(Lua_Mob sender, const char* message); void GroupMessage(Lua_Mob sender, int language, const char* message); uint32 GetTotalGroupDamage(Lua_Mob other); diff --git a/zone/lua_mod.cpp b/zone/lua_mod.cpp index 85dced1dc..84c063dbf 100644 --- a/zone/lua_mod.cpp +++ b/zone/lua_mod.cpp @@ -581,10 +581,10 @@ void LuaMod::GetEXPForLevel(Client *self, uint16 level, uint32 &returnValue, boo } } -void LuaMod::GetExperienceForKill(Client *self, Mob *against, uint32 &returnValue, bool &ignoreDefault) +void LuaMod::GetExperienceForKill(Client *self, Mob *against, uint64 &returnValue, bool &ignoreDefault) { int start = lua_gettop(L); - uint32 retval = 0; + uint64 retval = 0; try { if (!m_has_get_experience_for_kill) { diff --git a/zone/lua_mod.h b/zone/lua_mod.h index defc5edab..99dc3cd80 100644 --- a/zone/lua_mod.h +++ b/zone/lua_mod.h @@ -25,7 +25,7 @@ public: void TryCriticalHit(Mob *self, Mob *defender, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault); void GetRequiredAAExperience(Client *self, uint32 &returnValue, bool &ignoreDefault); void GetEXPForLevel(Client *self, uint16 level, uint32 &returnValue, bool &ignoreDefault); - void GetExperienceForKill(Client *self, Mob *against, uint32 &returnValue, bool &ignoreDefault); + void GetExperienceForKill(Client *self, Mob *against, uint64 &returnValue, bool &ignoreDefault); private: LuaParser *parser_; lua_State *L; diff --git a/zone/lua_parser.cpp b/zone/lua_parser.cpp index 942a9e449..1020233f3 100644 --- a/zone/lua_parser.cpp +++ b/zone/lua_parser.cpp @@ -1484,9 +1484,9 @@ uint32 LuaParser::GetEXPForLevel(Client *self, uint16 level, bool &ignoreDefault return retval; } -uint32 LuaParser::GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault) +uint64 LuaParser::GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault) { - uint32 retval = 0; + uint64 retval = 0; for (auto &mod : mods_) { mod.GetExperienceForKill(self, against, retval, ignoreDefault); } diff --git a/zone/lua_parser.h b/zone/lua_parser.h index f3141f97a..949180108 100644 --- a/zone/lua_parser.h +++ b/zone/lua_parser.h @@ -206,7 +206,7 @@ public: void CommonOutgoingHitSuccess(Mob *self, Mob* other, DamageHitInfo &hit, ExtraAttackOptions *opts, bool &ignoreDefault); uint32 GetRequiredAAExperience(Client *self, bool &ignoreDefault); uint32 GetEXPForLevel(Client *self, uint16 level, bool &ignoreDefault); - uint32 GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault); + uint64 GetExperienceForKill(Client *self, Mob *against, bool &ignoreDefault); private: LuaParser(); diff --git a/zone/lua_raid.cpp b/zone/lua_raid.cpp index ceed49e28..f689dd157 100644 --- a/zone/lua_raid.cpp +++ b/zone/lua_raid.cpp @@ -48,7 +48,7 @@ int Lua_Raid::GetGroup(Lua_Client c) { return self->GetGroup(c); } -void Lua_Raid::SplitExp(uint32 exp, Lua_Mob other) { +void Lua_Raid::SplitExp(uint64 exp, Lua_Mob other) { Lua_Safe_Call_Void(); self->SplitExp(exp, other); } diff --git a/zone/lua_raid.h b/zone/lua_raid.h index a2f687e16..c2b4d90b5 100644 --- a/zone/lua_raid.h +++ b/zone/lua_raid.h @@ -33,7 +33,7 @@ public: int RaidCount(); int GetGroup(const char *c); int GetGroup(Lua_Client c); - void SplitExp(uint32 exp, Lua_Mob other); + void SplitExp(uint64 exp, Lua_Mob other); uint32 GetTotalRaidDamage(Lua_Mob other); void SplitMoney(uint32 gid, uint32 copper, uint32 silver, uint32 gold, uint32 platinum); void SplitMoney(uint32 gid, uint32 copper, uint32 silver, uint32 gold, uint32 platinum, Lua_Client splitter); diff --git a/zone/mod_functions.cpp b/zone/mod_functions.cpp index 523302495..9b7520f67 100644 --- a/zone/mod_functions.cpp +++ b/zone/mod_functions.cpp @@ -99,7 +99,7 @@ void Client::mod_client_death_duel(Mob* killerMob) { return; } void Client::mod_client_death_env() { return; } //Calculated xp before consider modifier, called whenever a client gets XP for killing a mob. -int32 Client::mod_client_xp(int32 in_xp, NPC *npc) { return(in_xp); } +int64 Client::mod_client_xp(int64 in_xp, NPC *npc) { return(in_xp); } //Client XP formula. Changes here will cause clients to change level after gaining or losing xp. //Either modify this before your server goes live, or be prepared to write a quest script that fixes levels. diff --git a/zone/mod_functions_base.cpp b/zone/mod_functions_base.cpp index a6ce9e8d5..fc6d915c9 100644 --- a/zone/mod_functions_base.cpp +++ b/zone/mod_functions_base.cpp @@ -104,7 +104,7 @@ void Client::mod_client_death_duel(Mob* killerMob) { return; } void Client::mod_client_death_env() { return; } //Calculated xp before consider modifier, called whenever a client gets XP for killing a mob. -int32 Client::mod_client_xp(int32 in_xp, NPC *npc) { return(in_xp); } +int64 Client::mod_client_xp(int64 in_xp, NPC *npc) { return(in_xp); } //Client XP formula. Changes here will cause clients to change level after gaining or losing xp. //Either modify this before your server goes live, or be prepared to write a quest script that fixes levels. diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index f5b8e8152..3b40d7659 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -234,12 +234,12 @@ void Perl_Client_AddEXP(Client* self, uint32 add_exp, uint8 conlevel, bool resex self->AddEXP(add_exp, conlevel, resexp); } -void Perl_Client_SetEXP(Client* self, uint32 set_exp, uint32 set_aaxp) // @categories Experience and Level +void Perl_Client_SetEXP(Client* self, uint64 set_exp, uint64 set_aaxp) // @categories Experience and Level { self->SetEXP(set_exp, set_aaxp); } -void Perl_Client_SetEXP(Client* self, uint32 set_exp, uint32 set_aaxp, bool resexp) // @categories Experience and Level +void Perl_Client_SetEXP(Client* self, uint64 set_exp, uint64 set_aaxp, bool resexp) // @categories Experience and Level { self->SetEXP(set_exp, set_aaxp, resexp); } @@ -3286,8 +3286,8 @@ void perl_register_client() package.add("SetDeity", &Perl_Client_SetDeity); package.add("SetDuelTarget", &Perl_Client_SetDuelTarget); package.add("SetDueling", &Perl_Client_SetDueling); - package.add("SetEXP", (void(*)(Client*, uint32, uint32))&Perl_Client_SetEXP); - package.add("SetEXP", (void(*)(Client*, uint32, uint32, bool))&Perl_Client_SetEXP); + package.add("SetEXP", (void(*)(Client*, uint64, uint64))&Perl_Client_SetEXP); + package.add("SetEXP", (void(*)(Client*, uint64, uint64, bool))&Perl_Client_SetEXP); package.add("SetEXPModifier", (void(*)(Client*, uint32, double))&Perl_Client_SetEXPModifier); package.add("SetEXPModifier", (void(*)(Client*, uint32, double, int16))&Perl_Client_SetEXPModifier); package.add("SetEbonCrystals", &Perl_Client_SetEbonCrystals); diff --git a/zone/raids.h b/zone/raids.h index 5974c0f4a..28fe21afd 100644 --- a/zone/raids.h +++ b/zone/raids.h @@ -156,7 +156,7 @@ public: void RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); void CastGroupSpell(Mob* caster,uint16 spellid, uint32 gid); - void SplitExp(uint32 exp, Mob* other); + void SplitExp(uint64 exp, Mob* other); uint32 GetTotalRaidDamage(Mob* other); void BalanceHP(int32 penalty, uint32 gid, float range = 0, Mob* caster = nullptr, int32 limit = 0); void BalanceMana(int32 penalty, uint32 gid, float range = 0, Mob* caster = nullptr, int32 limit = 0);