mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Entities/Creature: Fix an edge case issue where creatures would re-acquire target after respawn if they despawned while spell focusing.
Instance/AzjolNerub: Fix Anub'arak wall and add sequence break info. Fixes and closes #18013.
(cherry picked from commit 0d725e1336)
This commit is contained in:
@@ -1696,6 +1696,7 @@ void Creature::setDeathState(DeathState s)
|
||||
SaveRespawnTime();
|
||||
|
||||
ReleaseFocus(nullptr, false); // remove spellcast focus
|
||||
DoNotReacquireTarget(); // cancel delayed re-target
|
||||
SetTarget(ObjectGuid::Empty); // drop target - dead mobs shouldn't ever target things
|
||||
|
||||
SetUInt64Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
|
||||
@@ -319,6 +319,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
|
||||
// Handling caster facing during spellcast
|
||||
void SetTarget(ObjectGuid const& guid) override;
|
||||
void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next ::Update call
|
||||
void DoNotReacquireTarget() { m_shouldReacquireTarget = false; m_suppressedTarget = ObjectGuid::Empty; m_suppressedOrientation = 0.0f; }
|
||||
void FocusTarget(Spell const* focusSpell, WorldObject const* target);
|
||||
bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false);
|
||||
void ReleaseFocus(Spell const* focusSpell = nullptr, bool withDelay = true);
|
||||
|
||||
@@ -36,7 +36,8 @@ enum ANDataTypes
|
||||
DATA_WATCHER_NARJIL,
|
||||
DATA_WATCHER_GASHRA,
|
||||
DATA_WATCHER_SILTHIK,
|
||||
DATA_ANUBARAK_WALL
|
||||
DATA_ANUBARAK_WALL,
|
||||
DATA_ANUBARAK_WALL_2
|
||||
};
|
||||
|
||||
enum ANCreatureIds
|
||||
|
||||
@@ -136,6 +136,8 @@ public:
|
||||
|
||||
if (GameObject* door = instance->GetGameObject(DATA_ANUBARAK_WALL))
|
||||
door->SetGoState(GO_STATE_ACTIVE); // open door for now
|
||||
if (GameObject* door2 = instance->GetGameObject(DATA_ANUBARAK_WALL_2))
|
||||
door2->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
instance->DoStartCriteriaTimer(CRITERIA_TIMED_TYPE_EVENT, ACHIEV_GOTTA_GO_START_EVENT);
|
||||
@@ -188,6 +190,8 @@ public:
|
||||
case EVENT_CLOSE_DOOR:
|
||||
if (GameObject* door = instance->GetGameObject(DATA_ANUBARAK_WALL))
|
||||
door->SetGoState(GO_STATE_READY);
|
||||
if (GameObject* door2 = instance->GetGameObject(DATA_ANUBARAK_WALL_2))
|
||||
door2->SetGoState(GO_STATE_READY);
|
||||
break;
|
||||
case EVENT_POUND:
|
||||
DoCastVictim(SPELL_POUND);
|
||||
|
||||
@@ -45,7 +45,8 @@ ObjectData const creatureData[] =
|
||||
|
||||
ObjectData const gameobjectData[] =
|
||||
{
|
||||
{ GO_ANUBARAK_DOOR_3, DATA_ANUBARAK_WALL },
|
||||
{ GO_ANUBARAK_DOOR_1, DATA_ANUBARAK_WALL },
|
||||
{ GO_ANUBARAK_DOOR_3, DATA_ANUBARAK_WALL_2 },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
@@ -81,6 +82,17 @@ class instance_azjol_nerub : public InstanceMapScript
|
||||
if (Creature* gatewatcher = GetCreature(DATA_KRIKTHIR_THE_GATEWATCHER))
|
||||
gatewatcher->AI()->DoAction(-ACTION_GATEWATCHER_GREET);
|
||||
}
|
||||
|
||||
bool CheckRequiredBosses(uint32 bossId, Player const* player) const override
|
||||
{
|
||||
if (_SkipCheckRequiredBosses(player))
|
||||
return true;
|
||||
|
||||
if (bossId > DATA_KRIKTHIR && GetBossState(DATA_KRIKTHIR) != DONE)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
Reference in New Issue
Block a user