From 835c67483b40dbceb40aa39715960cdd95cad9b6 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 17 Aug 2019 13:08:46 -0400 Subject: [PATCH] DB/Creature: The instance_encounters extra flag (CREATURE_FLAG_EXTRA_DUNGEON_BOSS) now properly propagates to all difficulty entries (not just difficulty 0). Port From (https://github.com/TrinityCore/TrinityCore/commit/6455f1c256e566da43d55583bca9c94c0d3139ce) --- Source/Game/Entities/Creature/Creature.cs | 7 +------ Source/Game/Globals/ObjectManager.cs | 12 +++++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index cc0fd66dd..6344ff474 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -2585,12 +2585,6 @@ namespace Game.Entities GetVehicleKit().RelocatePassengers(); } - public bool IsDungeonBoss() - { - CreatureTemplate cinfo = Global.ObjectMgr.GetCreatureTemplate(GetEntry()); - return cinfo != null && (cinfo.FlagsExtra.HasAnyFlag(CreatureFlagsExtra.DungeonBoss)); - } - public float GetAggroRange(Unit target) { // Determines the aggro range for creatures (usually pets), used mainly for aggressive pet target selection. @@ -2879,6 +2873,7 @@ namespace Game.Entities { return GetCreatureTemplate().InhabitType.HasAnyFlag(InhabitType.Air); } + public bool IsDungeonBoss() { return (GetCreatureTemplate().FlagsExtra.HasAnyFlag(CreatureFlagsExtra.DungeonBoss); } public void SetReactState(ReactStates st) { diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index c3541941b..7159865a9 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -5167,7 +5167,17 @@ namespace Game continue; } creatureInfo.FlagsExtra |= CreatureFlagsExtra.DungeonBoss; - break; + for (byte diff = 0; diff < SharedConst.MaxCreatureDifficulties; ++diff) + { + uint diffEntry = creatureInfo.DifficultyEntry[diff]; + if (diffEntry != 0) + { + CreatureTemplate diffInfo = GetCreatureTemplate(diffEntry); + if (diffInfo != null) + diffInfo.FlagsExtra |= CreatureFlagsExtra.DungeonBoss; + } + } + break; } case EncounterCreditType.CastSpell: if (!Global.SpellMgr.HasSpellInfo(creditEntry))