[Quest API] Add DescribeSpecialAbilities() to Perl/Lua (#4269)

This commit is contained in:
Alex King 2024-04-20 22:20:37 -04:00 committed by GitHub
parent 703d2cd1d8
commit 6b698b5f51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 27 additions and 0 deletions

View File

@ -3363,6 +3363,12 @@ bool Lua_Client::SetAutoLoginCharacterName(std::string character_name)
return quest_manager.SetAutoLoginCharacterNameByAccountID(self->AccountID(), character_name);
}
void Lua_Client::DescribeSpecialAbilities(Lua_NPC n)
{
Lua_Safe_Call_Void();
n.DescribeSpecialAbilities(self);
}
luabind::scope lua_register_client() {
return luabind::class_<Lua_Client, Lua_Mob>("Client")
.def(luabind::constructor<>())
@ -3446,6 +3452,7 @@ luabind::scope lua_register_client() {
.def("CreateExpeditionFromTemplate", &Lua_Client::CreateExpeditionFromTemplate)
.def("CreateTaskDynamicZone", &Lua_Client::CreateTaskDynamicZone)
.def("DecreaseByID", (bool(Lua_Client::*)(uint32,int))&Lua_Client::DecreaseByID)
.def("DescribeSpecialAbilities", (void(Lua_Client::*)(Lua_NPC))&Lua_Client::DescribeSpecialAbilities)
.def("DeleteBucket", (void(Lua_Client::*)(std::string))&Lua_Client::DeleteBucket)
.def("DeleteItemInInventory", (void(Lua_Client::*)(int,int))&Lua_Client::DeleteItemInInventory)
.def("DeleteItemInInventory", (void(Lua_Client::*)(int,int,bool))&Lua_Client::DeleteItemInInventory)

View File

@ -502,6 +502,7 @@ public:
std::string GetAutoLoginCharacterName();
bool SetAutoLoginCharacterName();
bool SetAutoLoginCharacterName(std::string character_name);
void DescribeSpecialAbilities(Lua_NPC n);
void ApplySpell(int spell_id);
void ApplySpell(int spell_id, int duration);

View File

@ -831,6 +831,12 @@ uint32 Lua_NPC::GetNPCSpellsEffectsID()
return self->GetNPCSpellsEffectsID();
}
void Lua_NPC::DescribeSpecialAbilities(Lua_Client c)
{
Lua_Safe_Call_Void();
self->DescribeSpecialAbilities(c);
}
luabind::scope lua_register_npc() {
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
.def(luabind::constructor<>())
@ -859,6 +865,7 @@ luabind::scope lua_register_npc() {
.def("CountItem", (uint16(Lua_NPC::*)(uint32))&Lua_NPC::CountItem)
.def("CountLoot", (int(Lua_NPC::*)(void))&Lua_NPC::CountLoot)
.def("DeleteBucket", (void(Lua_NPC::*)(std::string))&Lua_NPC::DeleteBucket)
.def("DescribeSpecialAbilities", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::DescribeSpecialAbilities)
.def("DisplayWaypointInfo", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::DisplayWaypointInfo)
.def("DoClassAttacks", (void(Lua_NPC::*)(Lua_Mob))&Lua_NPC::DoClassAttacks)
.def("GetAccuracyRating", (int(Lua_NPC::*)(void))&Lua_NPC::GetAccuracyRating)

View File

@ -185,6 +185,7 @@ public:
bool GetNPCAggro();
void SetNPCAggro(bool in_npc_aggro);
uint32 GetNPCSpellsEffectsID();
void DescribeSpecialAbilities(Lua_Client c);
};
#endif

View File

@ -3163,6 +3163,11 @@ bool Perl_Client_SetAutoLoginCharacterName(Client* self, std::string character_n
return quest_manager.SetAutoLoginCharacterNameByAccountID(self->AccountID(), character_name);
}
void Perl_Client_DescribeSpecialAbilities(Client* self, NPC* n)
{
n->DescribeSpecialAbilities(self);
}
void perl_register_client()
{
perl::interpreter perl(PERL_GET_THX);
@ -3249,6 +3254,7 @@ void perl_register_client()
package.add("CreateExpeditionFromTemplate", &Perl_Client_CreateExpeditionFromTemplate);
package.add("CreateTaskDynamicZone", &Perl_Client_CreateTaskDynamicZone);
package.add("DecreaseByID", &Perl_Client_DecreaseByID);
package.add("DescribeSpecialAbilities", &Perl_Client_DescribeSpecialAbilities);
package.add("DeleteItemInInventory", (void(*)(Client*, int16))&Perl_Client_DeleteItemInInventory);
package.add("DeleteItemInInventory", (void(*)(Client*, int16, int16))&Perl_Client_DeleteItemInInventory);
package.add("DeleteItemInInventory", (void(*)(Client*, int16, int16, bool))&Perl_Client_DeleteItemInInventory);

View File

@ -791,6 +791,10 @@ uint32 Perl_NPC_GetNPCSpellsEffectsID(NPC* self)
return self->GetNPCSpellsEffectsID();
}
void Perl_NPC_DescribeSpecialAbilities(NPC* self, Client* c)
{
self->DescribeSpecialAbilities(c);
}
void perl_register_npc()
{
@ -827,6 +831,7 @@ void perl_register_npc()
package.add("ClearLastName", &Perl_NPC_ClearLastName);
package.add("CountItem", &Perl_NPC_CountItem);
package.add("CountLoot", &Perl_NPC_CountLoot);
package.add("DescribeSpecialAbilities", &Perl_NPC_DescribeSpecialAbilities);
package.add("DisplayWaypointInfo", &Perl_NPC_DisplayWaypointInfo);
package.add("DoClassAttacks", &Perl_NPC_DoClassAttacks);
package.add("GetAccuracyRating", &Perl_NPC_GetAccuracyRating);