From 687c9585e3963e214c4ae20c8b7e6d2321c4e78d Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Tue, 13 Apr 2021 09:28:42 -0600 Subject: [PATCH 1/4] Add IsDungeonBoss --- CreatureMethods.h | 12 ++++++++++++ LuaFunctions.cpp | 1 + 2 files changed, 13 insertions(+) diff --git a/CreatureMethods.h b/CreatureMethods.h index b3db467..e008655 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -234,6 +234,18 @@ namespace LuaCreature return 1; } + /** + * Returns `true` if the [Creature]'s flags_extra includes Dungeon Boss (0x1000000), + * and returns `false` otherwise. + * + * @return bool isDungeonBoss + */ + int IsDungeonBoss(lua_State* L, Creature* creature) + { + Eluna::Push(L, creature->IsDungeonBoss()); + return 1; + } + /** * Returns `true` if the [Creature]'s rank is Boss, * and returns `false` otherwise. diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index d5448c9..28cb331 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -809,6 +809,7 @@ ElunaRegister CreatureMethods[] = { "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots }, // Boolean + { "IsDungeonBoss", &LuaCreature::IsWorldBoss }, { "IsWorldBoss", &LuaCreature::IsWorldBoss }, { "IsRacialLeader", &LuaCreature::IsRacialLeader }, { "IsCivilian", &LuaCreature::IsCivilian }, From 88bc259151598ffd3f17ad04b81f2842415fc23e Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Tue, 13 Apr 2021 11:49:36 -0600 Subject: [PATCH 2/4] Update IsDungeonBoss for Mangos --- CreatureMethods.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CreatureMethods.h b/CreatureMethods.h index e008655..00f04bc 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -242,7 +242,11 @@ namespace LuaCreature */ int IsDungeonBoss(lua_State* L, Creature* creature) { +#if defined(TRINITY) || defined(AZEROTHCORE) Eluna::Push(L, creature->IsDungeonBoss()); +#else + Eluna::Push(L, creature->IsWorldBoss()); +#endif return 1; } From 7b24c69f933e7c9e002d6295697b3fd97c28e111 Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Fri, 16 Apr 2021 10:28:11 -0600 Subject: [PATCH 3/4] Only allow IsDungeonBoss for TC/AC --- CreatureMethods.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CreatureMethods.h b/CreatureMethods.h index 00f04bc..0774e0a 100644 --- a/CreatureMethods.h +++ b/CreatureMethods.h @@ -240,15 +240,13 @@ namespace LuaCreature * * @return bool isDungeonBoss */ +#if defined(TRINITY) || defined(AZEROTHCORE) int IsDungeonBoss(lua_State* L, Creature* creature) { -#if defined(TRINITY) || defined(AZEROTHCORE) Eluna::Push(L, creature->IsDungeonBoss()); -#else - Eluna::Push(L, creature->IsWorldBoss()); -#endif return 1; } +#endif /** * Returns `true` if the [Creature]'s rank is Boss, From dd0217f5c9f04aca8ee000c9c3345a6386eb214d Mon Sep 17 00:00:00 2001 From: BuildingOutLoud Date: Fri, 16 Apr 2021 12:57:55 -0600 Subject: [PATCH 4/4] Fix LuaFunctions.cpp Co-authored-by: Rochet2 --- LuaFunctions.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LuaFunctions.cpp b/LuaFunctions.cpp index 28cb331..04ffa87 100644 --- a/LuaFunctions.cpp +++ b/LuaFunctions.cpp @@ -809,7 +809,9 @@ ElunaRegister CreatureMethods[] = { "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots }, // Boolean - { "IsDungeonBoss", &LuaCreature::IsWorldBoss }, +#if defined(TRINITY) || defined(AZEROTHCORE) + { "IsDungeonBoss", &LuaCreature::IsDungeonBoss }, +#endif { "IsWorldBoss", &LuaCreature::IsWorldBoss }, { "IsRacialLeader", &LuaCreature::IsRacialLeader }, { "IsCivilian", &LuaCreature::IsCivilian },