From df3c7b4be6daae739c3463f2686e7b2807f4b9fd Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Fri, 16 Apr 2021 12:52:08 -0600 Subject: [PATCH 1/3] Add GetExtraFlags --- CreatureMethods.h | 18 ++++++++++++++++++ LuaFunctions.cpp | 3 +++ 2 files changed, 21 insertions(+) diff --git a/CreatureMethods.h b/CreatureMethods.h index b3db467..4a43cbf 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -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. diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index d5448c9..f006937 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -782,6 +782,9 @@ ElunaRegister 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 From 9bad880f12c5544dd016526104d3e3080844c71e Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Fri, 16 Apr 2021 13:26:57 -0600 Subject: [PATCH 2/3] copy/paste mistake --- LuaFunctions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index f006937..c233d75 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -783,7 +783,7 @@ ElunaRegister CreatureMethods[] = { "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, { "GetNPCFlags", &LuaCreature::GetNPCFlags }, #if defined(TRINITY) || defined(AZEROTHCORE) - { "GetExtraFlags", &LuaCreature::GetNPCFlags }, + { "GetExtraFlags", &LuaCreature::GetExtraFlags }, #endif #if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, From 995ad6acd9a001b45b4df8a8f65523090a46e095 Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Fri, 16 Apr 2021 13:45:34 -0600 Subject: [PATCH 3/3] oops --- LuaFunctions.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index c233d75..9e1e33f 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -782,9 +782,7 @@ ElunaRegister CreatureMethods[] = { "GetLootRecipient", &LuaCreature::GetLootRecipient }, { "GetLootRecipientGroup", &LuaCreature::GetLootRecipientGroup }, { "GetNPCFlags", &LuaCreature::GetNPCFlags }, -#if defined(TRINITY) || defined(AZEROTHCORE) { "GetExtraFlags", &LuaCreature::GetExtraFlags }, -#endif #if defined(CLASSIC) || defined(TBC) || defined(WOTLK) { "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue }, #endif