Add GetExtraFlags

This commit is contained in:
BuildingOutLoud
2021-04-16 12:52:08 -06:00
parent 8f5c4699b2
commit df3c7b4be6
2 changed files with 21 additions and 0 deletions

View File

@@ -864,6 +864,24 @@ auto const& threatlist = creature->getThreatManager().getThreatList();
return 1;
}
/**
* Returns the [Creature]'s Extra flags.
*
* These are used to control whether the NPC is a civilian, uses pathfinding,
* if it's a guard, etc.
*
* @return [ExtraFlags] extraFlags
*/
int GetExtraFlags(lua_State* L, Creature* creature)
{
#if defined(TRINITY) || defined(AZEROTHCORE)
Eluna::Push(L, creature->GetCreatureTemplate()->flags_extra);
#else
Eluna::Push(L, creature->GetCreatureInfo()->ExtraFlags);
#endif
return 1;
}
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
/**
* Returns the [Creature]'s shield block value.

View File

@@ -782,6 +782,9 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "GetLootRecipient", &LuaCreature::GetLootRecipient },
{ "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup },
{ "GetNPCFlags", &LuaCreature::GetNPCFlags },
#if defined(TRINITY) || defined(AZEROTHCORE)
{ "GetExtraFlags", &LuaCreature::GetNPCFlags },
#endif
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
#endif