mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 12:41:30 +00:00
[Quest API] Add GetNPCTintIndex() to Perl/Lua (#4983)
This commit is contained in:
parent
d475428157
commit
e13b133ac8
@ -945,10 +945,16 @@ bool Lua_NPC::IsResumedFromZoneSuspend()
|
||||
return self->IsResumedFromZoneSuspend();
|
||||
}
|
||||
|
||||
void Lua_NPC::SetNPCTintIndex(uint32 id)
|
||||
void Lua_NPC::SetNPCTintIndex(uint32 index)
|
||||
{
|
||||
Lua_Safe_Call_Void();
|
||||
self->SendAppearancePacket(AppearanceType::NPCTintIndex, id);
|
||||
self->SetNPCTintIndex(index);
|
||||
}
|
||||
|
||||
uint32 Lua_NPC::GetNPCTintIndex()
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetNPCTintIndex();
|
||||
}
|
||||
|
||||
luabind::scope lua_register_npc() {
|
||||
@ -1018,6 +1024,7 @@ luabind::scope lua_register_npc() {
|
||||
.def("GetNPCSpellsEffectsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsEffectsID)
|
||||
.def("GetNPCSpellsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
|
||||
.def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat)
|
||||
.def("GetNPCTintIndex", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCTintIndex)
|
||||
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
|
||||
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)
|
||||
.def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill)
|
||||
|
||||
@ -200,6 +200,7 @@ public:
|
||||
Lua_Spawn GetSpawn(lua_State* L);
|
||||
bool IsResumedFromZoneSuspend();
|
||||
void SetNPCTintIndex(uint32 id);
|
||||
uint32 GetNPCTintIndex();
|
||||
|
||||
};
|
||||
|
||||
|
||||
13
zone/npc.cpp
13
zone/npc.cpp
@ -4940,3 +4940,16 @@ void NPC::ResetMultiQuest() {
|
||||
|
||||
m_hand_in = {};
|
||||
}
|
||||
|
||||
void NPC::SetNPCTintIndex(uint32 index)
|
||||
{
|
||||
auto outapp = new EQApplicationPacket(OP_SpawnAppearance, sizeof(SpawnAppearance_Struct));
|
||||
auto* s = (SpawnAppearance_Struct*) outapp->pBuffer;
|
||||
|
||||
s->spawn_id = GetID();
|
||||
s->type = AppearanceType::NPCTintIndex;
|
||||
s->parameter = index;
|
||||
|
||||
entity_list.QueueClients(this, outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
@ -552,6 +552,9 @@ public:
|
||||
|
||||
void ScaleNPC(uint8 npc_level, bool always_scale = false, bool override_special_abilities = false);
|
||||
|
||||
uint32 GetNPCTintIndex() { return m_npc_tint_id; }
|
||||
void SetNPCTintIndex(uint32 index);
|
||||
|
||||
void RecalculateSkills();
|
||||
void ReloadSpells();
|
||||
|
||||
|
||||
@ -885,9 +885,14 @@ Spawn2* Perl_NPC_GetSpawn(NPC* self)
|
||||
return self->GetSpawn();
|
||||
}
|
||||
|
||||
void Perl_NPC_SetNPCTintIndex(NPC* self, uint32 id)
|
||||
void Perl_NPC_SetNPCTintIndex(NPC* self, uint32 index)
|
||||
{
|
||||
return self->SendAppearancePacket(AppearanceType::NPCTintIndex, id);
|
||||
self->SetNPCTintIndex(index);
|
||||
}
|
||||
|
||||
uint32 Perl_NPC_GetNPCTintIndex(NPC* self)
|
||||
{
|
||||
return self->GetNPCTintIndex();
|
||||
}
|
||||
|
||||
void perl_register_npc()
|
||||
@ -959,6 +964,7 @@ void perl_register_npc()
|
||||
package.add("GetNPCSpellsEffectsID", &Perl_NPC_GetNPCSpellsEffectsID);
|
||||
package.add("GetNPCSpellsID", &Perl_NPC_GetNPCSpellsID);
|
||||
package.add("GetNPCStat", &Perl_NPC_GetNPCStat);
|
||||
package.add("GetNPCTintIndex", &Perl_NPC_GetNPCTintIndex);
|
||||
package.add("GetPetSpellID", &Perl_NPC_GetPetSpellID);
|
||||
package.add("GetPlatinum", &Perl_NPC_GetPlatinum);
|
||||
package.add("GetPrimSkill", &Perl_NPC_GetPrimSkill);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user