mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Add SetRadiantCrystals() and SetEbonCrystals() to Perl/Lua. (#1159)
- Add $client->SetRadiantCrystals(value) to Perl. - Add $client->SetEbonCrystals(value) to Perl. - Add client:SetRadiantCrystals(value) to Lua. - Add client:SetEbonCrystals(value) to Lua. Co-authored-by: Chris Miles <akkadius1@gmail.com>
This commit is contained in:
parent
c1d7a82307
commit
c593ed6a05
@ -5745,6 +5745,18 @@ void Client::AddCrystals(uint32 Radiant, uint32 Ebon)
|
|||||||
SendCrystalCounts();
|
SendCrystalCounts();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Client::SetEbonCrystals(uint32 value) {
|
||||||
|
m_pp.currentEbonCrystals = value;
|
||||||
|
SaveCurrency();
|
||||||
|
SendCrystalCounts();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Client::SetRadiantCrystals(uint32 value) {
|
||||||
|
m_pp.currentRadCrystals = value;
|
||||||
|
SaveCurrency();
|
||||||
|
SendCrystalCounts();
|
||||||
|
}
|
||||||
|
|
||||||
// Processes a client request to inspect a SoF+ client's equipment.
|
// Processes a client request to inspect a SoF+ client's equipment.
|
||||||
void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||||
if(requestee && requester) {
|
if(requestee && requester) {
|
||||||
|
|||||||
@ -594,9 +594,9 @@ public:
|
|||||||
uint32 GetPVPPoints() { return m_pp.PVPCurrentPoints; }
|
uint32 GetPVPPoints() { return m_pp.PVPCurrentPoints; }
|
||||||
void AddPVPPoints(uint32 Points);
|
void AddPVPPoints(uint32 Points);
|
||||||
uint32 GetRadiantCrystals() { return m_pp.currentRadCrystals; }
|
uint32 GetRadiantCrystals() { return m_pp.currentRadCrystals; }
|
||||||
void SetRadiantCrystals(uint32 Crystals) { m_pp.currentRadCrystals = Crystals; }
|
void SetRadiantCrystals(uint32 value);
|
||||||
uint32 GetEbonCrystals() { return m_pp.currentEbonCrystals; }
|
uint32 GetEbonCrystals() { return m_pp.currentEbonCrystals; }
|
||||||
void SetEbonCrystals(uint32 Crystals) { m_pp.currentEbonCrystals = Crystals; }
|
void SetEbonCrystals(uint32 value);
|
||||||
void AddCrystals(uint32 Radiant, uint32 Ebon);
|
void AddCrystals(uint32 Radiant, uint32 Ebon);
|
||||||
void SendCrystalCounts();
|
void SendCrystalCounts();
|
||||||
|
|
||||||
|
|||||||
@ -2025,12 +2025,10 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app)
|
|||||||
else if (aps->Type == NorrathsKeepersMerchant)
|
else if (aps->Type == NorrathsKeepersMerchant)
|
||||||
{
|
{
|
||||||
SetRadiantCrystals(GetRadiantCrystals() - (int32)item->LDoNPrice);
|
SetRadiantCrystals(GetRadiantCrystals() - (int32)item->LDoNPrice);
|
||||||
SendCrystalCounts();
|
|
||||||
}
|
}
|
||||||
else if (aps->Type == DarkReignMerchant)
|
else if (aps->Type == DarkReignMerchant)
|
||||||
{
|
{
|
||||||
SetEbonCrystals(GetEbonCrystals() - (int32)item->LDoNPrice);
|
SetEbonCrystals(GetEbonCrystals() - (int32)item->LDoNPrice);
|
||||||
SendCrystalCounts();
|
|
||||||
}
|
}
|
||||||
int16 charges = 1;
|
int16 charges = 1;
|
||||||
if (item->MaxCharges != 0)
|
if (item->MaxCharges != 0)
|
||||||
|
|||||||
@ -7855,14 +7855,10 @@ void command_setcrystals(Client *c, const Seperator *sep)
|
|||||||
else if(!strcasecmp(sep->arg[1], "radiant"))
|
else if(!strcasecmp(sep->arg[1], "radiant"))
|
||||||
{
|
{
|
||||||
t->SetRadiantCrystals(atoi(sep->arg[2]));
|
t->SetRadiantCrystals(atoi(sep->arg[2]));
|
||||||
t->SendCrystalCounts();
|
|
||||||
t->SaveCurrency();
|
|
||||||
}
|
}
|
||||||
else if(!strcasecmp(sep->arg[1], "ebon"))
|
else if(!strcasecmp(sep->arg[1], "ebon"))
|
||||||
{
|
{
|
||||||
t->SetEbonCrystals(atoi(sep->arg[2]));
|
t->SetEbonCrystals(atoi(sep->arg[2]));
|
||||||
t->SendCrystalCounts();
|
|
||||||
t->SaveCurrency();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1040,6 +1040,16 @@ void Lua_Client::AddCrystals(uint32 radiant, uint32 ebon) {
|
|||||||
self->AddCrystals(radiant, ebon);
|
self->AddCrystals(radiant, ebon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Lua_Client::SetEbonCrystals(uint32 value) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->SetEbonCrystals(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Lua_Client::SetRadiantCrystals(uint32 value) {
|
||||||
|
Lua_Safe_Call_Void();
|
||||||
|
self->SetRadiantCrystals(value);
|
||||||
|
}
|
||||||
|
|
||||||
uint32 Lua_Client::GetPVPPoints() {
|
uint32 Lua_Client::GetPVPPoints() {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetPVPPoints();
|
return self->GetPVPPoints();
|
||||||
@ -1846,6 +1856,8 @@ luabind::scope lua_register_client() {
|
|||||||
.def("KeyRingCheck", (bool(Lua_Client::*)(uint32))&Lua_Client::KeyRingCheck)
|
.def("KeyRingCheck", (bool(Lua_Client::*)(uint32))&Lua_Client::KeyRingCheck)
|
||||||
.def("AddPVPPoints", (void(Lua_Client::*)(uint32))&Lua_Client::AddPVPPoints)
|
.def("AddPVPPoints", (void(Lua_Client::*)(uint32))&Lua_Client::AddPVPPoints)
|
||||||
.def("AddCrystals", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::AddCrystals)
|
.def("AddCrystals", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::AddCrystals)
|
||||||
|
.def("SetEbonCrystals", (void(Lua_Client::*)(uint32))&Lua_Client::SetEbonCrystals)
|
||||||
|
.def("SetRadiantCrystals", (void(Lua_Client::*)(uint32))&Lua_Client::SetRadiantCrystals)
|
||||||
.def("GetPVPPoints", (uint32(Lua_Client::*)(void))&Lua_Client::GetPVPPoints)
|
.def("GetPVPPoints", (uint32(Lua_Client::*)(void))&Lua_Client::GetPVPPoints)
|
||||||
.def("GetRadiantCrystals", (uint32(Lua_Client::*)(void))&Lua_Client::GetRadiantCrystals)
|
.def("GetRadiantCrystals", (uint32(Lua_Client::*)(void))&Lua_Client::GetRadiantCrystals)
|
||||||
.def("GetEbonCrystals", (uint32(Lua_Client::*)(void))&Lua_Client::GetEbonCrystals)
|
.def("GetEbonCrystals", (uint32(Lua_Client::*)(void))&Lua_Client::GetEbonCrystals)
|
||||||
|
|||||||
@ -235,6 +235,8 @@ public:
|
|||||||
bool KeyRingCheck(uint32 item);
|
bool KeyRingCheck(uint32 item);
|
||||||
void AddPVPPoints(uint32 points);
|
void AddPVPPoints(uint32 points);
|
||||||
void AddCrystals(uint32 radiant, uint32 ebon);
|
void AddCrystals(uint32 radiant, uint32 ebon);
|
||||||
|
void SetEbonCrystals(uint32 value);
|
||||||
|
void SetRadiantCrystals(uint32 value);
|
||||||
uint32 GetPVPPoints();
|
uint32 GetPVPPoints();
|
||||||
uint32 GetRadiantCrystals();
|
uint32 GetRadiantCrystals();
|
||||||
uint32 GetEbonCrystals();
|
uint32 GetEbonCrystals();
|
||||||
|
|||||||
@ -4707,6 +4707,50 @@ XS(XS_Client_AddCrystals) {
|
|||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS_Client_SetEbonCrystals);
|
||||||
|
XS(XS_Client_SetEbonCrystals) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: Client::SetEbonCrystals(THIS, uint32 value)");
|
||||||
|
{
|
||||||
|
Client *THIS;
|
||||||
|
uint32 value = (uint32) SvUV(ST(1));
|
||||||
|
|
||||||
|
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.");
|
||||||
|
|
||||||
|
THIS->SetEbonCrystals(value);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
XS(XS_Client_SetRadiantCrystals);
|
||||||
|
XS(XS_Client_SetRadiantCrystals) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: Client::SetRadiantCrystals(THIS, uint32 value)");
|
||||||
|
{
|
||||||
|
Client *THIS;
|
||||||
|
uint32 value = (uint32) SvUV(ST(1));
|
||||||
|
|
||||||
|
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.");
|
||||||
|
|
||||||
|
THIS->SetRadiantCrystals(value);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS_Client_GetPVPPoints); /* prototype to pass -Wmissing-prototypes */
|
XS(XS_Client_GetPVPPoints); /* prototype to pass -Wmissing-prototypes */
|
||||||
XS(XS_Client_GetPVPPoints) {
|
XS(XS_Client_GetPVPPoints) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
@ -6942,6 +6986,7 @@ XS(boot_Client) {
|
|||||||
newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$");
|
newXSproto(strcpy(buf, "SetDeity"), XS_Client_SetDeity, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetDueling"), XS_Client_SetDueling, file, "$$");
|
newXSproto(strcpy(buf, "SetDueling"), XS_Client_SetDueling, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetDuelTarget"), XS_Client_SetDuelTarget, file, "$$");
|
newXSproto(strcpy(buf, "SetDuelTarget"), XS_Client_SetDuelTarget, file, "$$");
|
||||||
|
newXSproto(strcpy(buf, "SetEbonCrystals"), XS_Client_SetEbonCrystals, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetEndurance"), XS_Client_SetEndurance, file, "$$");
|
newXSproto(strcpy(buf, "SetEndurance"), XS_Client_SetEndurance, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetEXP"), XS_Client_SetEXP, file, "$$$;$");
|
newXSproto(strcpy(buf, "SetEXP"), XS_Client_SetEXP, file, "$$$;$");
|
||||||
newXSproto(strcpy(buf, "SetFactionLevel"), XS_Client_SetFactionLevel, file, "$$$$$$");
|
newXSproto(strcpy(buf, "SetFactionLevel"), XS_Client_SetFactionLevel, file, "$$$$$$");
|
||||||
@ -6954,6 +6999,7 @@ XS(boot_Client) {
|
|||||||
newXSproto(strcpy(buf, "SetMaterial"), XS_Client_SetMaterial, file, "$$$");
|
newXSproto(strcpy(buf, "SetMaterial"), XS_Client_SetMaterial, file, "$$$");
|
||||||
newXSproto(strcpy(buf, "SetPrimaryWeaponOrnamentation"), XS_Client_SetPrimaryWeaponOrnamentation, file, "$$");
|
newXSproto(strcpy(buf, "SetPrimaryWeaponOrnamentation"), XS_Client_SetPrimaryWeaponOrnamentation, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetPVP"), XS_Client_SetPVP, file, "$$");
|
newXSproto(strcpy(buf, "SetPVP"), XS_Client_SetPVP, file, "$$");
|
||||||
|
newXSproto(strcpy(buf, "SetRadiantCrystals"), XS_Client_SetRadiantCrystals, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetSecondaryWeaponOrnamentation"), XS_Client_SetSecondaryWeaponOrnamentation, file, "$$");
|
newXSproto(strcpy(buf, "SetSecondaryWeaponOrnamentation"), XS_Client_SetSecondaryWeaponOrnamentation, file, "$$");
|
||||||
newXSproto(strcpy(buf, "SetSkill"), XS_Client_SetSkill, file, "$$$");
|
newXSproto(strcpy(buf, "SetSkill"), XS_Client_SetSkill, file, "$$$");
|
||||||
newXSproto(strcpy(buf, "SetSkillPoints"), XS_Client_SetSkillPoints, file, "$$");
|
newXSproto(strcpy(buf, "SetSkillPoints"), XS_Client_SetSkillPoints, file, "$$");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user