mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
DB/Creature: The instance_encounters extra flag (CREATURE_FLAG_EXTRA_DUNGEON_BOSS) now properly propagates to all difficulty entries (not just difficulty 0).
This lets us simplify IsDungeonBoss() on Creature (and move it to header). Closes #18824.
This commit is contained in:
@@ -2686,12 +2686,6 @@ void Creature::SetPosition(float x, float y, float z, float o)
|
||||
GetVehicleKit()->RelocatePassengers();
|
||||
}
|
||||
|
||||
bool Creature::IsDungeonBoss() const
|
||||
{
|
||||
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
|
||||
return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS);
|
||||
}
|
||||
|
||||
bool Creature::SetWalk(bool enable)
|
||||
{
|
||||
if (!Unit::SetWalk(enable))
|
||||
|
||||
@@ -462,6 +462,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
bool CanWalk() const { return (GetCreatureTemplate()->InhabitType & INHABIT_GROUND) != 0; }
|
||||
bool CanSwim() const { return (GetCreatureTemplate()->InhabitType & INHABIT_WATER) != 0 || IsPet(); }
|
||||
bool CanFly() const override { return (GetCreatureTemplate()->InhabitType & INHABIT_AIR) != 0; }
|
||||
bool IsDungeonBoss() const { return (GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS) != 0; }
|
||||
|
||||
void SetReactState(ReactStates st) { m_reactState = st; }
|
||||
ReactStates GetReactState() const { return m_reactState; }
|
||||
@@ -478,8 +479,6 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
bool isElite() const;
|
||||
bool isWorldBoss() const;
|
||||
|
||||
bool IsDungeonBoss() const;
|
||||
|
||||
uint8 getLevelForTarget(WorldObject const* target) const override; // overwrite Unit::getLevelForTarget for boss level support
|
||||
|
||||
bool IsInEvadeMode() const { return HasUnitState(UNIT_STATE_EVADE); }
|
||||
|
||||
@@ -5462,6 +5462,14 @@ void ObjectMgr::LoadInstanceEncounters()
|
||||
continue;
|
||||
}
|
||||
const_cast<CreatureTemplate*>(creatureInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
|
||||
for (uint8 diff = 1; diff < MAX_DIFFICULTY; ++diff)
|
||||
{
|
||||
if (uint32 diffEntry = creatureInfo->DifficultyEntry[diff - 1])
|
||||
{
|
||||
if (CreatureTemplate const* diffInfo = GetCreatureTemplate(diffEntry))
|
||||
const_cast<CreatureTemplate*>(diffInfo)->flags_extra |= CREATURE_FLAG_EXTRA_DUNGEON_BOSS;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ENCOUNTER_CREDIT_CAST_SPELL:
|
||||
|
||||
Reference in New Issue
Block a user