diff --git a/zone/lua_npc.cpp b/zone/lua_npc.cpp index af975b913..c8bc012c9 100644 --- a/zone/lua_npc.cpp +++ b/zone/lua_npc.cpp @@ -606,6 +606,18 @@ uint16 Lua_NPC::GetFirstSlotByItemID(uint32 item_id) return self->GetFirstSlotByItemID(item_id); } +float Lua_NPC::GetHealScale() +{ + Lua_Safe_Call_Real(); + return self->GetHealScale(); +} + +float Lua_NPC::GetSpellScale() +{ + Lua_Safe_Call_Real(); + return self->GetSpellScale(); +} + luabind::scope lua_register_npc() { return luabind::class_("NPC") .def(luabind::constructor<>()) @@ -726,7 +738,9 @@ luabind::scope lua_register_npc() { .def("HasItem", (bool(Lua_NPC::*)(uint32))&Lua_NPC::HasItem) .def("CountItem", (uint16(Lua_NPC::*)(uint32))&Lua_NPC::CountItem) .def("GetItemIDBySlot", (uint32(Lua_NPC::*)(uint16))&Lua_NPC::GetItemIDBySlot) - .def("GetFirstSlotByItemID", (uint16(Lua_NPC::*)(uint32))&Lua_NPC::GetFirstSlotByItemID); + .def("GetFirstSlotByItemID", (uint16(Lua_NPC::*)(uint32))&Lua_NPC::GetFirstSlotByItemID) + .def("GetHealScale", (float(Lua_NPC::*)(void))&Lua_NPC::GetHealScale) + .def("GetSpellScale", (float(Lua_NPC::*)(void))&Lua_NPC::GetSpellScale); } #endif diff --git a/zone/lua_npc.h b/zone/lua_npc.h index e4773636f..1577a1e20 100644 --- a/zone/lua_npc.h +++ b/zone/lua_npc.h @@ -144,6 +144,8 @@ public: uint16 CountItem(uint32 item_id); uint32 GetItemIDBySlot(uint16 slot_id); uint16 GetFirstSlotByItemID(uint32 item_id); + float GetHealScale(); + float GetSpellScale(); }; #endif diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index 2a5061bd0..6496e5863 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -1812,6 +1812,40 @@ XS(XS_NPC_GetFirstSlotByItemID) { XSRETURN(1); } +XS(XS_NPC_GetHealScale); +XS(XS_NPC_GetHealScale) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: NPC::GetHealScale(THIS)"); // @categories Stats and Attributes + { + NPC *THIS; + float healscale; + dXSTARG; + VALIDATE_THIS_IS_NPC; + healscale = THIS->GetHealScale(); + XSprePUSH; + PUSHn((double) healscale); + } + XSRETURN(1); +} + +XS(XS_NPC_GetSpellScale); +XS(XS_NPC_GetSpellScale) { + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "Usage: NPC::GetSpellScale(THIS)"); // @categories Stats and Attributes + { + NPC *THIS; + float spellscale; + dXSTARG; + VALIDATE_THIS_IS_NPC; + spellscale = THIS->GetSpellScale(); + XSprePUSH; + PUSHn((double) spellscale); + } + XSRETURN(1); +} + #ifdef __cplusplus extern "C" #endif @@ -1934,6 +1968,8 @@ XS(boot_NPC) { newXSproto(strcpy(buf, "CountItem"), XS_NPC_CountItem, file, "$$"); newXSproto(strcpy(buf, "GetItemIDBySlot"), XS_NPC_GetItemIDBySlot, file, "$$"); newXSproto(strcpy(buf, "GetFirstSlotByItemID"), XS_NPC_GetFirstSlotByItemID, file, "$$"); + newXSproto(strcpy(buf, "GetHealScale"), XS_NPC_GetHealScale, file, "$"); + newXSproto(strcpy(buf, "GetSpellScale"), XS_NPC_GetSpellScale, file, "$"); XSRETURN_YES; }