diff options
author | sirikfoll <sirikfoll@hotmail.com> | 2017-05-29 19:20:13 -0300 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2020-06-14 23:49:04 +0200 |
commit | c99963b02396703bd6ea73bfb7a6a86cbe213408 (patch) | |
tree | 47d44dff31882f76268276e91416b652841da8c7 | |
parent | aa811d57b6dfd21689b6aaac3502c03528533222 (diff) |
Core/Scripts Properly set Freya's BossState do DONE and avoid some loot exploits
Closes #19823
(cherry picked from commit 1cc0458b114490238ff9cfed78b1932df67def29)
-rw-r--r-- | src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index f22095817cf..e0a73d09571 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -270,6 +270,7 @@ class boss_freya : public CreatureScript { boss_freyaAI(Creature* creature) : BossAI(creature, BOSS_FREYA) { + _encounterFinished = false; Initialize(); memset(elementalTimer, 0, sizeof(elementalTimer)); diffTimer = 0; @@ -312,9 +313,13 @@ class boss_freya : public CreatureScript bool checkElementalAlive[2]; bool trioDefeated[2]; bool random[3]; + bool _encounterFinished; void Reset() override { + if (_encounterFinished) + return; + _Reset(); Initialize(); } @@ -595,6 +600,11 @@ class boss_freya : public CreatureScript void JustDied(Unit* /*killer*/) override { + if (_encounterFinished) + return; + + _encounterFinished = true; + //! Freya's chest is dynamically spawned on death by different spells. const uint32 summonSpell[2][4] = { @@ -606,15 +616,15 @@ class boss_freya : public CreatureScript me->CastSpell((Unit*)NULL, summonSpell[me->GetMap()->GetDifficultyID() - DIFFICULTY_10_N][elderCount], true); Talk(SAY_DEATH); + me->SetReactState(REACT_PASSIVE); - _JustDied(); - me->RemoveAllAuras(); + me->InterruptNonMeleeSpells(true); + me->RemoveAllAttackers(); me->AttackStop(); me->SetFaction(FACTION_FRIENDLY); - me->DeleteThreatList(); - me->CombatStop(true); me->DespawnOrUnsummon(7500); me->CastSpell(me, SPELL_KNOCK_ON_WOOD_CREDIT, true); + _JustDied(); for (uint8 n = 0; n < 3; ++n) { |