diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-10-16 12:35:32 +0200 |
---|---|---|
committer | treeston <treeston.mmoc@gmail.com> | 2016-10-16 12:35:47 +0200 |
commit | 0d725e1336f4eb40ab392471af4c2381ea04b9e6 (patch) | |
tree | edaf83c113128784410b6b6c367ec83ad0163110 /src | |
parent | b54131057875d5bd51420540801d15a516d63eb0 (diff) |
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.
Diffstat (limited to 'src')
5 files changed, 21 insertions, 2 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index b312f5694be..bed9123ac4c 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1661,6 +1661,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 SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 5111f109cb9..d79e55b623e 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -691,6 +691,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma // Handling caster facing during spellcast void SetTarget(ObjectGuid 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); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h index 685d0f51edd..2eda9509bb8 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h @@ -33,7 +33,8 @@ enum DataTypes DATA_WATCHER_NARJIL, DATA_WATCHER_GASHRA, DATA_WATCHER_SILTHIK, - DATA_ANUBARAK_WALL + DATA_ANUBARAK_WALL, + DATA_ANUBARAK_WALL_2 }; enum CreatureIds diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 5238de69bed..2860698a8b2 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -129,6 +129,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->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOTTA_GO_START_EVENT); @@ -181,6 +183,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); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index 8af4f6cecc4..7f0ce5c369e 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -41,7 +41,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 }; @@ -77,6 +78,17 @@ class instance_azjol_nerub : public InstanceMapScript if (Creature* gatewatcher = GetCreature(DATA_KRIKTHIR)) 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 |