Add scripting for NPCTintIndex

This commit is contained in:
Mitch Freeman 2025-04-23 23:13:26 -03:00
parent 780120036d
commit de44910d3b
3 changed files with 15 additions and 0 deletions

View File

@ -945,6 +945,12 @@ bool Lua_NPC::IsResumedFromZoneSuspend()
return self->IsResumedFromZoneSuspend();
}
void Lua_NPC::SetNPCTintIndex(uint32 id)
{
Lua_Safe_Call_Void();
self->SendAppearancePacket(AppearanceType::NPCTintIndex, id);
}
luabind::scope lua_register_npc() {
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
.def(luabind::constructor<>())
@ -1091,6 +1097,7 @@ luabind::scope lua_register_npc() {
.def("SetLDoNTrapType", (void(Lua_NPC::*)(uint8))&Lua_NPC::SetLDoNTrapType)
.def("SetNPCAggro", (void(Lua_NPC::*)(bool))&Lua_NPC::SetNPCAggro)
.def("SetNPCFactionID", (void(Lua_NPC::*)(int))&Lua_NPC::SetNPCFactionID)
.def("SetNPCTintIndex", &Lua_NPC::SetNPCTintIndex)
.def("SetPetSpellID", (void(Lua_NPC::*)(int))&Lua_NPC::SetPetSpellID)
.def("SetPlatinum", (void(Lua_NPC::*)(uint32))&Lua_NPC::SetPlatinum)
.def("SetPrimSkill", (void(Lua_NPC::*)(int))&Lua_NPC::SetPrimSkill)

View File

@ -199,6 +199,8 @@ public:
void ReturnHandinItems(Lua_Client c);
Lua_Spawn GetSpawn(lua_State* L);
bool IsResumedFromZoneSuspend();
void SetNPCTintIndex(uint32 id);
};
#endif

View File

@ -885,6 +885,11 @@ Spawn2* Perl_NPC_GetSpawn(NPC* self)
return self->GetSpawn();
}
void Perl_NPC_SetNPCTintIndex(NPC* self, uint32 id)
{
return self->SendAppearancePacket(AppearanceType::NPCTintIndex, id);
}
void perl_register_npc()
{
perl::interpreter perl(PERL_GET_THX);
@ -1034,6 +1039,7 @@ void perl_register_npc()
package.add("SetGold", &Perl_NPC_SetGold);
package.add("SetGrid", &Perl_NPC_SetGrid);
package.add("SetNPCFactionID", &Perl_NPC_SetNPCFactionID);
package.add("SetNPCTintIndex", &Perl_NPC_SetNPCTintIndex);
package.add("SetPetSpellID", &Perl_NPC_SetPetSpellID);
package.add("SetPlatinum", &Perl_NPC_SetPlatinum);
package.add("SetPrimSkill", &Perl_NPC_SetPrimSkill);