Merge pull request #354 from BuildingOutLoud/Add-Creature-GetExtraFlags

Add Creature GetExtraFlags()
This commit is contained in:
Rochet2
2021-04-16 23:37:52 +03:00
committed by GitHub
2 changed files with 19 additions and 0 deletions

View File

@@ -878,6 +878,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,7 @@ ElunaRegister<Creature> CreatureMethods[] =
{ "GetLootRecipient", &LuaCreature::GetLootRecipient },
{ "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup },
{ "GetNPCFlags", &LuaCreature::GetNPCFlags },
{ "GetExtraFlags", &LuaCreature::GetExtraFlags },
#if defined(CLASSIC) || defined(TBC) || defined(WOTLK)
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
#endif