[Quest API] Add GetSpawn() to Perl and Lua (#4702)

* [Quest API] Add GetSpawn() to Perl and Lua

* Push

* Update npc.h
This commit is contained in:
Alex King
2025-02-21 23:57:41 -05:00
committed by GitHub
parent aa4869c6e9
commit 486c7c44be
5 changed files with 18 additions and 4 deletions
+8
View File
@@ -9,6 +9,7 @@
#include "lua_client.h"
#include "lua_item.h"
#include "lua_iteminst.h"
#include "lua_spawn.h"
struct Lua_NPC_Loot_List {
std::vector<uint32> entries;
@@ -932,6 +933,12 @@ void Lua_NPC::ReturnHandinItems(Lua_Client c)
self->ReturnHandinItems(c);
}
Lua_Spawn Lua_NPC::GetSpawn(lua_State* L)
{
Lua_Safe_Call_Class(Lua_Spawn);
return Lua_Spawn(self->GetSpawn());
}
luabind::scope lua_register_npc() {
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
.def(luabind::constructor<>())
@@ -1009,6 +1016,7 @@ luabind::scope lua_register_npc() {
.def("GetSilver", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetSilver)
.def("GetSlowMitigation", (int(Lua_NPC::*)(void))&Lua_NPC::GetSlowMitigation)
.def("GetSp2", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetSp2)
.def("GetSpawn", (Lua_Spawn(Lua_NPC::*)(void))&Lua_NPC::GetSpawn)
.def("GetSpawnKillCount", (int(Lua_NPC::*)(void))&Lua_NPC::GetSpawnKillCount)
.def("GetSpawnPointH", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointH)
.def("GetSpawnPointID", (int(Lua_NPC::*)(void))&Lua_NPC::GetSpawnPointID)