[Quest API] Add Mob/Entity type check methods to Perl/Lua (#3493)

* [Quest API] Add Mob/Entity type check methods to Perl/Lua

# Perl
- Add `$mob->IsAura()`.
- Add `$mob->IsEncounter()`.
- Add `$mob->IsMerc()`.
- Add `$mob->IsOfClientBot()`.
- Add `$mob->IsOfClientBotMerc()`.
- Add `$mob->IsTemporaryPet()`.

# Lua
- Add `entity:IsAura()`.
- Add `entity:IsOfClientBot()`.
- Add `entity:IsOfClientBotMerc()`.
- Add `mob:IsTemporaryPet()`.

* Update lua_entity.cpp

* Update lua_mob.cpp
This commit is contained in:
Alex King
2023-07-12 22:20:07 -04:00
committed by GitHub
parent c81d05940a
commit 4854201b2a
5 changed files with 70 additions and 5 deletions
+18
View File
@@ -78,6 +78,21 @@ bool Lua_Entity::IsBot() {
return self->IsBot();
}
bool Lua_Entity::IsAura() {
Lua_Safe_Call_Bool();
return self->IsAura();
}
bool Lua_Entity::IsOfClientBot() {
Lua_Safe_Call_Bool();
return self->IsOfClientBot();
}
bool Lua_Entity::IsOfClientBotMerc() {
Lua_Safe_Call_Bool();
return self->IsOfClientBotMerc();
}
int Lua_Entity::GetID() {
Lua_Safe_Call_Bool();
return self->GetID();
@@ -138,6 +153,7 @@ luabind::scope lua_register_entity() {
.def("CastToNPC", &Lua_Entity::CastToNPC)
.def("CastToObject", &Lua_Entity::CastToObject)
.def("GetID", &Lua_Entity::GetID)
.def("IsAura", &Lua_Entity::IsAura)
.def("IsBeacon", &Lua_Entity::IsBeacon)
.def("IsBot", &Lua_Entity::IsBot)
.def("IsClient", &Lua_Entity::IsClient)
@@ -149,6 +165,8 @@ luabind::scope lua_register_entity() {
.def("IsNPC", &Lua_Entity::IsNPC)
.def("IsNPCCorpse", &Lua_Entity::IsNPCCorpse)
.def("IsObject", &Lua_Entity::IsObject)
.def("IsOfClientBot", &Lua_Entity::IsOfClientBot)
.def("IsOfClientBotMerc", &Lua_Entity::IsOfClientBotMerc)
.def("IsPlayerCorpse", &Lua_Entity::IsPlayerCorpse)
.def("IsTrap", &Lua_Entity::IsTrap);
}