mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 12:21:34 +00:00
Merge pull request #553 from KinglyKrab/master
Added GetAAPercent() to Perl and Lua.
This commit is contained in:
commit
50469b858b
@ -796,6 +796,7 @@ public:
|
|||||||
void SendClearAA();
|
void SendClearAA();
|
||||||
inline uint32 GetMaxAAXP(void) const { return max_AAXP; }
|
inline uint32 GetMaxAAXP(void) const { return max_AAXP; }
|
||||||
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
inline uint32 GetAAXP() const { return m_pp.expAA; }
|
||||||
|
inline uint32 GetAAPercent() const { return m_epp.perAA; }
|
||||||
int16 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
|
int16 CalcAAFocus(focusType type, const AA::Rank &rank, uint16 spell_id);
|
||||||
void SetAATitle(const char *Title);
|
void SetAATitle(const char *Title);
|
||||||
void SetTitleSuffix(const char *txt);
|
void SetTitleSuffix(const char *txt);
|
||||||
|
|||||||
@ -185,6 +185,11 @@ uint32 Lua_Client::GetAAExp() {
|
|||||||
return self->GetAAXP();
|
return self->GetAAXP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Client::GetAAPercent() {
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetAAPercent();
|
||||||
|
}
|
||||||
|
|
||||||
uint32 Lua_Client::GetTotalSecondsPlayed() {
|
uint32 Lua_Client::GetTotalSecondsPlayed() {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetTotalSecondsPlayed();
|
return self->GetTotalSecondsPlayed();
|
||||||
@ -1377,6 +1382,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("GetWeight", (int(Lua_Client::*)(void))&Lua_Client::GetWeight)
|
.def("GetWeight", (int(Lua_Client::*)(void))&Lua_Client::GetWeight)
|
||||||
.def("GetEXP", (uint32(Lua_Client::*)(void))&Lua_Client::GetEXP)
|
.def("GetEXP", (uint32(Lua_Client::*)(void))&Lua_Client::GetEXP)
|
||||||
.def("GetAAExp", (uint32(Lua_Client::*)(void))&Lua_Client::GetAAExp)
|
.def("GetAAExp", (uint32(Lua_Client::*)(void))&Lua_Client::GetAAExp)
|
||||||
|
.def("GetAAPercent", (uint32(Lua_Client::*)(void))&Lua_Client::GetAAPercent)
|
||||||
.def("GetTotalSecondsPlayed", (uint32(Lua_Client::*)(void))&Lua_Client::GetTotalSecondsPlayed)
|
.def("GetTotalSecondsPlayed", (uint32(Lua_Client::*)(void))&Lua_Client::GetTotalSecondsPlayed)
|
||||||
.def("UpdateLDoNPoints", (void(Lua_Client::*)(int,uint32))&Lua_Client::UpdateLDoNPoints)
|
.def("UpdateLDoNPoints", (void(Lua_Client::*)(int,uint32))&Lua_Client::UpdateLDoNPoints)
|
||||||
.def("SetDeity", (void(Lua_Client::*)(int))&Lua_Client::SetDeity)
|
.def("SetDeity", (void(Lua_Client::*)(int))&Lua_Client::SetDeity)
|
||||||
|
|||||||
@ -63,6 +63,7 @@ public:
|
|||||||
int GetWeight();
|
int GetWeight();
|
||||||
uint32 GetEXP();
|
uint32 GetEXP();
|
||||||
uint32 GetAAExp();
|
uint32 GetAAExp();
|
||||||
|
uint32 GetAAPercent();
|
||||||
uint32 GetTotalSecondsPlayed();
|
uint32 GetTotalSecondsPlayed();
|
||||||
void UpdateLDoNPoints(int points, uint32 theme);
|
void UpdateLDoNPoints(int points, uint32 theme);
|
||||||
void SetDeity(int v);
|
void SetDeity(int v);
|
||||||
|
|||||||
@ -871,6 +871,32 @@ XS(XS_Client_GetAAExp)
|
|||||||
XSRETURN(1);
|
XSRETURN(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS_Client_GetAAPercent);
|
||||||
|
XS(XS_Client_GetAAPercent)
|
||||||
|
{
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 1)
|
||||||
|
Perl_croak(aTHX_ "Usage: Client::GetAAPercent(THIS)");
|
||||||
|
{
|
||||||
|
Client* THIS;
|
||||||
|
uint32 RETVAL;
|
||||||
|
dXSTARG;
|
||||||
|
|
||||||
|
if (sv_derived_from(ST(0), "Client")) {
|
||||||
|
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||||
|
THIS = INT2PTR(Client *,tmp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||||
|
if(THIS == nullptr)
|
||||||
|
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||||
|
|
||||||
|
RETVAL = THIS->GetAAPercent();
|
||||||
|
XSprePUSH; PUSHu((UV)RETVAL);
|
||||||
|
}
|
||||||
|
XSRETURN(1);
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS_Client_GetTotalSecondsPlayed); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_Client_GetTotalSecondsPlayed); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_Client_GetTotalSecondsPlayed)
|
XS(XS_Client_GetTotalSecondsPlayed)
|
||||||
{
|
{
|
||||||
@ -6465,6 +6491,7 @@ XS(boot_Client)
|
|||||||
newXSproto(strcpy(buf, "GetWeight"), XS_Client_GetWeight, file, "$");
|
newXSproto(strcpy(buf, "GetWeight"), XS_Client_GetWeight, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetEXP"), XS_Client_GetEXP, file, "$");
|
newXSproto(strcpy(buf, "GetEXP"), XS_Client_GetEXP, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetAAExp"), XS_Client_GetAAExp, file, "$");
|
newXSproto(strcpy(buf, "GetAAExp"), XS_Client_GetAAExp, file, "$");
|
||||||
|
newXSproto(strcpy(buf, "GetAAPercent"), XS_Client_GetAAPercent, file, "$");
|
||||||
newXSproto(strcpy(buf, "GetTotalSecondsPlayed"), XS_Client_GetTotalSecondsPlayed, file, "$");
|
newXSproto(strcpy(buf, "GetTotalSecondsPlayed"), XS_Client_GetTotalSecondsPlayed, file, "$");
|
||||||
newXSproto(strcpy(buf, "UpdateLDoNPoints"), XS_Client_UpdateLDoNPoints, file, "$$$");
|
newXSproto(strcpy(buf, "UpdateLDoNPoints"), XS_Client_UpdateLDoNPoints, file, "$$$");
|
||||||
newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$");
|
newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user