[Quest API] Add GetNPCSpellsEffectsID() to Perl/Lua (#4117)

# Perl
- Add `$npc->GetNPCSpellsEffectsID()`.

# Lua
- Add `npc:GetNPCSpellsEffectsID()`.

# Notes
- Allows operator's to get an NPC's spell effects ID.
This commit is contained in:
Alex King 2024-02-24 23:51:37 -05:00 committed by GitHub
parent f57c37e9c5
commit a478fd2600
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 4 deletions

View File

@ -378,7 +378,7 @@ bool Lua_NPC::GetFollowCanRun() {
return self->GetFollowCanRun(); return self->GetFollowCanRun();
} }
int Lua_NPC::GetNPCSpellsID() { uint32 Lua_NPC::GetNPCSpellsID() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetNPCSpellsID(); return self->GetNPCSpellsID();
} }
@ -825,6 +825,12 @@ void Lua_NPC::SetNPCAggro(bool in_npc_aggro)
self->SetNPCAggro(in_npc_aggro); self->SetNPCAggro(in_npc_aggro);
} }
uint32 Lua_NPC::GetNPCSpellsEffectsID()
{
Lua_Safe_Call_Int();
return self->GetNPCSpellsEffectsID();
}
luabind::scope lua_register_npc() { luabind::scope lua_register_npc() {
return luabind::class_<Lua_NPC, Lua_Mob>("NPC") return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
.def(luabind::constructor<>()) .def(luabind::constructor<>())
@ -887,8 +893,8 @@ luabind::scope lua_register_npc() {
.def("GetNPCAggro", (bool(Lua_NPC::*)(void))&Lua_NPC::GetNPCAggro) .def("GetNPCAggro", (bool(Lua_NPC::*)(void))&Lua_NPC::GetNPCAggro)
.def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID) .def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID)
.def("GetNPCHate", (int64(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate) .def("GetNPCHate", (int64(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate)
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID) .def("GetNPCSpellsEffectsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsEffectsID)
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID) .def("GetNPCSpellsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
.def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat) .def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat)
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID) .def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum) .def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)

View File

@ -102,7 +102,7 @@ public:
int GetFollowID(); int GetFollowID();
int GetFollowDistance(); int GetFollowDistance();
bool GetFollowCanRun(); bool GetFollowCanRun();
int GetNPCSpellsID(); uint32 GetNPCSpellsID();
int GetSpawnPointID(); int GetSpawnPointID();
float GetSpawnPointX(); float GetSpawnPointX();
float GetSpawnPointY(); float GetSpawnPointY();
@ -184,6 +184,7 @@ public:
void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration); void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration);
bool GetNPCAggro(); bool GetNPCAggro();
void SetNPCAggro(bool in_npc_aggro); void SetNPCAggro(bool in_npc_aggro);
uint32 GetNPCSpellsEffectsID();
}; };
#endif #endif

View File

@ -786,6 +786,11 @@ void Perl_NPC_SetNPCAggro(NPC* self, bool in_npc_aggro) // @categories Script Ut
self->SetNPCAggro(in_npc_aggro); self->SetNPCAggro(in_npc_aggro);
} }
uint32 Perl_NPC_GetNPCSpellsEffectsID(NPC* self)
{
return self->GetNPCSpellsEffectsID();
}
void perl_register_npc() void perl_register_npc()
{ {
@ -851,6 +856,7 @@ void perl_register_npc()
package.add("GetNPCAggro", &Perl_NPC_GetNPCAggro); package.add("GetNPCAggro", &Perl_NPC_GetNPCAggro);
package.add("GetNPCFactionID", &Perl_NPC_GetNPCFactionID); package.add("GetNPCFactionID", &Perl_NPC_GetNPCFactionID);
package.add("GetNPCHate", &Perl_NPC_GetNPCHate); package.add("GetNPCHate", &Perl_NPC_GetNPCHate);
package.add("GetNPCSpellsEffectsID", &Perl_NPC_GetNPCSpellsEffectsID);
package.add("GetNPCSpellsID", &Perl_NPC_GetNPCSpellsID); package.add("GetNPCSpellsID", &Perl_NPC_GetNPCSpellsID);
package.add("GetNPCStat", &Perl_NPC_GetNPCStat); package.add("GetNPCStat", &Perl_NPC_GetNPCStat);
package.add("GetPetSpellID", &Perl_NPC_GetPetSpellID); package.add("GetPetSpellID", &Perl_NPC_GetPetSpellID);