[Pets] Add Pet Constants and Methods (#4987)

* [Pets] Add Pet Constants and Methods

* Remove GetID

* GetPetTypeName()

* Cleanup
This commit is contained in:
Alex King
2025-08-17 01:00:31 -04:00
committed by GitHub
parent 207ee2daa0
commit a4e47d9180
28 changed files with 1209 additions and 742 deletions
+14 -1
View File
@@ -5701,6 +5701,16 @@ luabind::object lua_get_timers(lua_State* L, Mob* m) {
return t;
}
std::string lua_get_pet_command_name(uint8 pet_command)
{
return PetCommand::GetName(pet_command);
}
std::string lua_get_pet_type_name(uint8 pet_type)
{
return PetType::GetName(pet_type);
}
#define LuaCreateNPCParse(name, c_type, default_value) do { \
cur = table[#name]; \
if(luabind::type(cur) != LUA_TNIL) { \
@@ -6514,6 +6524,8 @@ luabind::scope lua_register_general() {
luabind::def("handin", &lua_handin),
luabind::def("get_paused_timers", &lua_get_paused_timers),
luabind::def("get_timers", &lua_get_timers),
luabind::def("get_pet_command_name", &lua_get_pet_command_name),
luabind::def("get_pet_type_name", &lua_get_pet_type_name),
/*
Cross Zone
*/
@@ -6979,7 +6991,8 @@ luabind::scope lua_register_events() {
luabind::value("entity_variable_set", static_cast<int>(EVENT_ENTITY_VARIABLE_SET)),
luabind::value("entity_variable_update", static_cast<int>(EVENT_ENTITY_VARIABLE_UPDATE)),
luabind::value("aa_loss", static_cast<int>(EVENT_AA_LOSS)),
luabind::value("read", static_cast<int>(EVENT_READ_ITEM))
luabind::value("read", static_cast<int>(EVENT_READ_ITEM)),
luabind::value("pet_command", static_cast<int>(EVENT_PET_COMMAND))
)];
}