mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Added optional 'ignore_mods' parameter to AddLevelBasedExp() in Perl and Lua.
This commit is contained in:
parent
754ed71f9a
commit
15609ab1e8
@ -603,7 +603,7 @@ public:
|
|||||||
void CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel);
|
void CalculateLeadershipExp(uint32 &add_exp, uint8 conlevel);
|
||||||
void CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp, uint8 conlevel, bool resexp);
|
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);
|
void SetEXP(uint32 set_exp, uint32 set_aaxp, bool resexp=false);
|
||||||
void AddLevelBasedExp(uint8 exp_percentage, uint8 max_level=0);
|
void AddLevelBasedExp(uint8 exp_percentage, uint8 max_level = 0, bool ignore_mods = false);
|
||||||
void SetLeadershipEXP(uint32 group_exp, uint32 raid_exp);
|
void SetLeadershipEXP(uint32 group_exp, uint32 raid_exp);
|
||||||
void AddLeadershipEXP(uint32 group_exp, uint32 raid_exp);
|
void AddLeadershipEXP(uint32 group_exp, uint32 raid_exp);
|
||||||
void SendLeadershipEXPUpdate();
|
void SendLeadershipEXPUpdate();
|
||||||
|
|||||||
@ -940,7 +940,7 @@ uint32 Client::GetEXPForLevel(uint16 check_level)
|
|||||||
return finalxp;
|
return finalxp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::AddLevelBasedExp(uint8 exp_percentage, uint8 max_level)
|
void Client::AddLevelBasedExp(uint8 exp_percentage, uint8 max_level, bool ignore_mods)
|
||||||
{
|
{
|
||||||
uint32 award;
|
uint32 award;
|
||||||
uint32 xp_for_level;
|
uint32 xp_for_level;
|
||||||
@ -958,7 +958,7 @@ void Client::AddLevelBasedExp(uint8 exp_percentage, uint8 max_level)
|
|||||||
xp_for_level = GetEXPForLevel(max_level + 1) - GetEXPForLevel(max_level);
|
xp_for_level = GetEXPForLevel(max_level + 1) - GetEXPForLevel(max_level);
|
||||||
award = xp_for_level * exp_percentage / 100;
|
award = xp_for_level * exp_percentage / 100;
|
||||||
|
|
||||||
if(RuleB(Zone, LevelBasedEXPMods))
|
if(RuleB(Zone, LevelBasedEXPMods) && !ignore_mods)
|
||||||
{
|
{
|
||||||
if(zone->level_exp_mod[GetLevel()].ExpMod)
|
if(zone->level_exp_mod[GetLevel()].ExpMod)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1065,6 +1065,11 @@ void Lua_Client::AddLevelBasedExp(int exp_pct, int max_level) {
|
|||||||
self->AddLevelBasedExp(exp_pct, max_level);
|
self->AddLevelBasedExp(exp_pct, max_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lua_Client::AddLevelBasedExp(int exp_pct, int max_level, bool ignore_mods) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->AddLevelBasedExp(exp_pct, max_level, ignore_mods);
|
||||||
|
}
|
||||||
|
|
||||||
void Lua_Client::IncrementAA(int aa) {
|
void Lua_Client::IncrementAA(int aa) {
|
||||||
Lua_Safe_Call_Void();
|
Lua_Safe_Call_Void();
|
||||||
self->IncrementAlternateAdvancementRank(aa);
|
self->IncrementAlternateAdvancementRank(aa);
|
||||||
@ -1741,6 +1746,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("GetIP", (uint32(Lua_Client::*)(void))&Lua_Client::GetIP)
|
.def("GetIP", (uint32(Lua_Client::*)(void))&Lua_Client::GetIP)
|
||||||
.def("AddLevelBasedExp", (void(Lua_Client::*)(int))&Lua_Client::AddLevelBasedExp)
|
.def("AddLevelBasedExp", (void(Lua_Client::*)(int))&Lua_Client::AddLevelBasedExp)
|
||||||
.def("AddLevelBasedExp", (void(Lua_Client::*)(int,int))&Lua_Client::AddLevelBasedExp)
|
.def("AddLevelBasedExp", (void(Lua_Client::*)(int,int))&Lua_Client::AddLevelBasedExp)
|
||||||
|
.def("AddLevelBasedExp", (void(Lua_Client::*)(int,int,bool))&Lua_Client::AddLevelBasedExp)
|
||||||
.def("IncrementAA", (void(Lua_Client::*)(int))&Lua_Client::IncrementAA)
|
.def("IncrementAA", (void(Lua_Client::*)(int))&Lua_Client::IncrementAA)
|
||||||
.def("GrantAlternateAdvancementAbility", (bool(Lua_Client::*)(int, int))&Lua_Client::GrantAlternateAdvancementAbility)
|
.def("GrantAlternateAdvancementAbility", (bool(Lua_Client::*)(int, int))&Lua_Client::GrantAlternateAdvancementAbility)
|
||||||
.def("GrantAlternateAdvancementAbility", (bool(Lua_Client::*)(int, int, bool))&Lua_Client::GrantAlternateAdvancementAbility)
|
.def("GrantAlternateAdvancementAbility", (bool(Lua_Client::*)(int, int, bool))&Lua_Client::GrantAlternateAdvancementAbility)
|
||||||
|
|||||||
@ -240,6 +240,7 @@ public:
|
|||||||
uint32 GetIP();
|
uint32 GetIP();
|
||||||
void AddLevelBasedExp(int exp_pct);
|
void AddLevelBasedExp(int exp_pct);
|
||||||
void AddLevelBasedExp(int exp_pct, int max_level);
|
void AddLevelBasedExp(int exp_pct, int max_level);
|
||||||
|
void AddLevelBasedExp(int exp_pct, int max_level, bool ignore_mods);
|
||||||
void IncrementAA(int aa);
|
void IncrementAA(int aa);
|
||||||
bool GrantAlternateAdvancementAbility(int aa_id, int points);
|
bool GrantAlternateAdvancementAbility(int aa_id, int points);
|
||||||
bool GrantAlternateAdvancementAbility(int aa_id, int points, bool ignore_cost);
|
bool GrantAlternateAdvancementAbility(int aa_id, int points, bool ignore_cost);
|
||||||
|
|||||||
@ -4768,12 +4768,13 @@ XS(XS_Client_GetIP) {
|
|||||||
XS(XS_Client_AddLevelBasedExp);
|
XS(XS_Client_AddLevelBasedExp);
|
||||||
XS(XS_Client_AddLevelBasedExp) {
|
XS(XS_Client_AddLevelBasedExp) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
if (items < 2 || items > 3)
|
if (items < 2 || items > 4)
|
||||||
Perl_croak(aTHX_ "Usage: Client::AddLevelBasedExp(THIS, uint8 exp_percentage, uint8 max_level = 0)");
|
Perl_croak(aTHX_ "Usage: Client::AddLevelBasedExp(THIS, uint8 exp_percentage, uint8 max_level = 0, bool ignore_mods = false)");
|
||||||
{
|
{
|
||||||
Client *THIS;
|
Client *THIS;
|
||||||
uint8 exp_percentage = (uint8) SvUV(ST(1));
|
uint8 exp_percentage = (uint8) SvUV(ST(1));
|
||||||
uint8 max_level = 0;
|
uint8 max_level = 0;
|
||||||
|
bool ignore_mods = false;
|
||||||
|
|
||||||
if (sv_derived_from(ST(0), "Client")) {
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||||
@ -4785,8 +4786,11 @@ XS(XS_Client_AddLevelBasedExp) {
|
|||||||
|
|
||||||
if (items > 2)
|
if (items > 2)
|
||||||
max_level = (uint8) SvUV(ST(2));
|
max_level = (uint8) SvUV(ST(2));
|
||||||
|
|
||||||
|
if (items > 3)
|
||||||
|
ignore_mods = (bool) SvTRUE(ST(3));
|
||||||
|
|
||||||
THIS->AddLevelBasedExp(exp_percentage, max_level);
|
THIS->AddLevelBasedExp(exp_percentage, max_level, ignore_mods);
|
||||||
}
|
}
|
||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
@ -6339,7 +6343,7 @@ XS(boot_Client) {
|
|||||||
newXSproto(strcpy(buf, "AddAlternateCurrencyValue"), XS_Client_AddAlternateCurrencyValue, file, "$$$");
|
newXSproto(strcpy(buf, "AddAlternateCurrencyValue"), XS_Client_AddAlternateCurrencyValue, file, "$$$");
|
||||||
newXSproto(strcpy(buf, "AddCrystals"), XS_Client_AddCrystals, file, "$$");
|
newXSproto(strcpy(buf, "AddCrystals"), XS_Client_AddCrystals, file, "$$");
|
||||||
newXSproto(strcpy(buf, "AddEXP"), XS_Client_AddEXP, file, "$$;$$");
|
newXSproto(strcpy(buf, "AddEXP"), XS_Client_AddEXP, file, "$$;$$");
|
||||||
newXSproto(strcpy(buf, "AddLevelBasedExp"), XS_Client_AddLevelBasedExp, file, "$$;$");
|
newXSproto(strcpy(buf, "AddLevelBasedExp"), XS_Client_AddLevelBasedExp, file, "$$;$$");
|
||||||
newXSproto(strcpy(buf, "AddMoneyToPP"), XS_Client_AddMoneyToPP, file, "$$$$$$");
|
newXSproto(strcpy(buf, "AddMoneyToPP"), XS_Client_AddMoneyToPP, file, "$$$$$$");
|
||||||
newXSproto(strcpy(buf, "AddPVPPoints"), XS_Client_AddPVPPoints, file, "$$");
|
newXSproto(strcpy(buf, "AddPVPPoints"), XS_Client_AddPVPPoints, file, "$$");
|
||||||
newXSproto(strcpy(buf, "AddSkill"), XS_Client_AddSkill, file, "$$$");
|
newXSproto(strcpy(buf, "AddSkill"), XS_Client_AddSkill, file, "$$$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user