diff --git a/CreatureMethods.h b/CreatureMethods.h index 0774e0a..6b1d82c 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -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. diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 04ffa87..ed3fbce 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -782,6 +782,7 @@ ElunaRegister CreatureMethods[] = { "GetLootRecipient", &LuaCreature::GetLootRecipient }, { "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, { "GetNPCFlags", &LuaCreature::GetNPCFlags }, + { "GetExtraFlags", &LuaCreature::GetExtraFlags }, #if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, #endif