mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-14 20:12:26 +00:00
[Quest API] Add UntrainDiscBySpellID(spell_id, update_client) to Perl/Lua. (#1565)
- Add $client->UntrainDiscBySpellID(spell_id, update_client) to Perl. - Add client:UntrainDiscBySpellID(spell_id, update_client) to Lua.
This commit is contained in:
parent
92e03dccb9
commit
2f5d360e53
@ -800,6 +800,7 @@ public:
|
||||
void UnscribeSpellAll(bool update_client = true);
|
||||
void UntrainDisc(int slot, bool update_client = true);
|
||||
void UntrainDiscAll(bool update_client = true);
|
||||
void UntrainDiscBySpellID(uint16 spell_id, bool update_client = true);
|
||||
bool SpellGlobalCheck(uint16 spell_id, uint32 char_id);
|
||||
bool SpellBucketCheck(uint16 spell_id, uint32 char_id);
|
||||
uint32 GetCharMaxLevelFromQGlobal();
|
||||
|
||||
@ -2206,17 +2206,27 @@ int Lua_Client::CountItem(uint32 item_id) {
|
||||
|
||||
void Lua_Client::RemoveItem(uint32 item_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->RemoveItem(item_id);
|
||||
self->RemoveItem(item_id);
|
||||
}
|
||||
|
||||
void Lua_Client::RemoveItem(uint32 item_id, uint32 quantity) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->RemoveItem(item_id, quantity);
|
||||
self->RemoveItem(item_id, quantity);
|
||||
}
|
||||
|
||||
void Lua_Client::SetGMStatus(uint32 newStatus) {
|
||||
Lua_Safe_Call_Void();
|
||||
return self->SetGMStatus(newStatus);
|
||||
self->SetGMStatus(newStatus);
|
||||
}
|
||||
|
||||
void Lua_Client::UntrainDiscBySpellID(uint16 spell_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->UntrainDiscBySpellID(spell_id);
|
||||
}
|
||||
|
||||
void Lua_Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->UntrainDiscBySpellID(spell_id, update_client);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_client() {
|
||||
@ -2475,7 +2485,7 @@ luabind::scope lua_register_client() {
|
||||
.def("ClearCompassMark",(void(Lua_Client::*)(void))&Lua_Client::ClearCompassMark)
|
||||
.def("GetNextAvailableSpellBookSlot", (int(Lua_Client::*)(void))&Lua_Client::GetNextAvailableSpellBookSlot)
|
||||
.def("GetNextAvailableSpellBookSlot", (int(Lua_Client::*)(int))&Lua_Client::GetNextAvailableSpellBookSlot)
|
||||
.def("GetSpellIDByBookSlot", (uint32(Lua_Client::*)(int))& Lua_Client::GetSpellIDByBookSlot)
|
||||
.def("GetSpellIDByBookSlot", (uint32(Lua_Client::*)(int))&Lua_Client::GetSpellIDByBookSlot)
|
||||
.def("FindSpellBookSlotBySpellID", (int(Lua_Client::*)(int))&Lua_Client::FindSpellBookSlotBySpellID)
|
||||
.def("UpdateTaskActivity", (void(Lua_Client::*)(int,int,int))&Lua_Client::UpdateTaskActivity)
|
||||
.def("AssignTask", (void(Lua_Client::*)(int,int))&Lua_Client::AssignTask)
|
||||
@ -2580,19 +2590,21 @@ luabind::scope lua_register_client() {
|
||||
.def("AddLDoNLoss", (void(Lua_Client::*)(uint32))&Lua_Client::AddLDoNLoss)
|
||||
.def("AddLDoNWin", (void(Lua_Client::*)(uint32))&Lua_Client::AddLDoNWin)
|
||||
.def("SetHideMe", (void(Lua_Client::*)(bool))&Lua_Client::SetHideMe)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*))& Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32))& Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32))& Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32))& Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32,uint32))& Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32,uint32,const char*,const char*))& Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*))&Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32))&Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32))&Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32))&Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32,uint32))&Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32,uint32,const char*,const char*))&Lua_Client::Popup)
|
||||
.def("Popup", (void(Lua_Client::*)(const char*,const char*,uint32,uint32,uint32,uint32,const char*,const char*,uint32))&Lua_Client::Popup)
|
||||
.def("ResetAllDisciplineTimers", (void(Lua_Client::*)(void))&Lua_Client::ResetAllDisciplineTimers)
|
||||
.def("SendToInstance", (void(Lua_Client::*)(std::string,std::string,uint32,float,float,float,float,std::string,uint32))&Lua_Client::SendToInstance)
|
||||
.def("CountItem", (int(Lua_Client::*)(uint32))&Lua_Client::CountItem)
|
||||
.def("RemoveItem", (void(Lua_Client::*)(uint32))&Lua_Client::RemoveItem)
|
||||
.def("RemoveItem", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::RemoveItem)
|
||||
.def("SetGMStatus", (void(Lua_Client::*)(int32))& Lua_Client::SetGMStatus);
|
||||
.def("SetGMStatus", (void(Lua_Client::*)(int32))&Lua_Client::SetGMStatus)
|
||||
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16))&Lua_Client::UntrainDiscBySpellID)
|
||||
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16,bool))&Lua_Client::UntrainDiscBySpellID);
|
||||
}
|
||||
|
||||
luabind::scope lua_register_inventory_where() {
|
||||
|
||||
@ -183,6 +183,8 @@ public:
|
||||
int GetDiscSlotBySpellID(int32 spell_id);
|
||||
void UntrainDisc(int slot);
|
||||
void UntrainDisc(int slot, bool update_client);
|
||||
void UntrainDiscBySpellID(uint16 spell_id);
|
||||
void UntrainDiscBySpellID(uint16 spell_id, bool update_client);
|
||||
void UntrainDiscAll();
|
||||
void UntrainDiscAll(bool update_client);
|
||||
bool IsStanding();
|
||||
|
||||
@ -5693,6 +5693,25 @@ XS(XS_Client_DiaWind) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_UntrainDiscBySpellID); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_UntrainDiscBySpellID) {
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: Client::UntrainDiscBySpellID(THIS, uint16 spell_id, [bool update_client = true])"); // @categories Spells and Disciplines
|
||||
{
|
||||
Client *THIS;
|
||||
uint16 spell_id = (uint16) SvUV(ST(1));
|
||||
bool update_client = true;
|
||||
VALIDATE_THIS_IS_CLIENT;
|
||||
if (items == 3) {
|
||||
update_client = (bool) SvTRUE(ST(2));
|
||||
}
|
||||
|
||||
THIS->UntrainDiscBySpellID(spell_id, update_client);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
@ -5998,6 +6017,7 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "UnscribeSpellAll"), XS_Client_UnscribeSpellAll, file, "$;$");
|
||||
newXSproto(strcpy(buf, "UntrainDisc"), XS_Client_UntrainDisc, file, "$$;$");
|
||||
newXSproto(strcpy(buf, "UntrainDiscAll"), XS_Client_UntrainDiscAll, file, "$;$");
|
||||
newXSproto(strcpy(buf, "UntrainDiscBySpellID"), XS_Client_UntrainDiscBySpellID, file, "$$;$");
|
||||
newXSproto(strcpy(buf, "UpdateAdmin"), XS_Client_UpdateAdmin, file, "$;$");
|
||||
newXSproto(strcpy(buf, "SetGMStatus"), XS_Client_SetGMStatus, file, "$$");
|
||||
newXSproto(strcpy(buf, "UpdateGroupAAs"), XS_Client_UpdateGroupAAs, file, "$$$");
|
||||
|
||||
@ -5335,6 +5335,16 @@ void Client::UntrainDiscAll(bool update_client)
|
||||
}
|
||||
}
|
||||
|
||||
void Client::UntrainDiscBySpellID(uint16 spell_id, bool update_client)
|
||||
{
|
||||
for (int slot = 0; slot < MAX_PP_DISCIPLINES; slot++) {
|
||||
if (m_pp.disciplines.values[slot] == spell_id) {
|
||||
UntrainDisc(slot, update_client);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Client::GetNextAvailableSpellBookSlot(int starting_slot) {
|
||||
for (int i = starting_slot; i < EQ::spells::SPELLBOOK_SIZE; i++) { //using starting_slot should help speed this up when we're iterating through a bunch of spells
|
||||
if (!IsValidSpell(GetSpellByBookSlot(i)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user