From 1cc0458b114490238ff9cfed78b1932df67def29 Mon Sep 17 00:00:00 2001 From: sirikfoll Date: Mon, 29 May 2017 19:20:13 -0300 Subject: Core/Scripts Properly set Freya's BossState do DONE and avoid some loot exploits Closes #19823 --- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index b1668a5185f..61482ac9f83 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -266,6 +266,7 @@ class boss_freya : public CreatureScript { boss_freyaAI(Creature* creature) : BossAI(creature, BOSS_FREYA) { + _encounterFinished = false; Initialize(); memset(elementalTimer, 0, sizeof(elementalTimer)); diffTimer = 0; @@ -308,9 +309,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(); } @@ -591,6 +596,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] = { @@ -602,15 +612,15 @@ class boss_freya : public CreatureScript me->CastSpell((Unit*)NULL, summonSpell[me->GetMap()->GetDifficulty()][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) { -- cgit v1.2.3