Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ struct boss_ragnaros : public BossAI
boss_ragnaros(Creature* creature) : BossAI(creature, DATA_RAGNAROS),
_isIntroDone(false),
_hasYelledMagmaBurst(false),
_processingMagmaBurst(false),
_hasSubmergedOnce(false),
_isKnockbackEmoteAllowed(true)
{
Expand All @@ -140,7 +139,6 @@ struct boss_ragnaros : public BossAI
}

_hasYelledMagmaBurst = false;
_processingMagmaBurst = false;
_hasSubmergedOnce = false;
_isKnockbackEmoteAllowed = true;
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Expand Down Expand Up @@ -218,29 +216,6 @@ struct boss_ragnaros : public BossAI
DoStartNoMovement(target);
}

void EnterEvadeMode(EvadeReason why) override
{
if (!me->GetThreatMgr().IsThreatListEmpty())
{
if (!_processingMagmaBurst)
{
// Boss try to evade, but still got some targets on threat list - it means that none of these targets are in melee range - cast magma blast
_processingMagmaBurst = true;
events.ScheduleEvent(EVENT_MAGMA_BLAST, 4s, PHASE_EMERGED, PHASE_EMERGED);
}
}
else
{
BossAI::EnterEvadeMode(why);
}
}

bool CanAIAttack(Unit const* victim) const override
{
// Used for Magma Blast handling to force EnterEvadeMode if there are no melee targets
return me->IsWithinMeleeRange(victim);
}

void UpdateAI(uint32 diff) override
{
if (!extraEvents.Empty())
Expand Down Expand Up @@ -307,10 +282,7 @@ struct boss_ragnaros : public BossAI
}

if (!UpdateVictim())
{
if (!_processingMagmaBurst)
return;
}
return;

events.Update(diff);

Expand Down Expand Up @@ -350,8 +322,6 @@ struct boss_ragnaros : public BossAI
}
case EVENT_MAGMA_BLAST:
{
_processingMagmaBurst = false;

if (!IsVictimWithinMeleeRange())
{
DoCastRandomTarget(SPELL_MAGMA_BLAST);
Expand All @@ -362,7 +332,7 @@ struct boss_ragnaros : public BossAI
_hasYelledMagmaBurst = true;
}
}

events.Repeat(4s);
break;
}
case EVENT_MIGHT_OF_RAGNAROS:
Expand Down Expand Up @@ -419,7 +389,6 @@ struct boss_ragnaros : public BossAI
EventMap extraEvents;
bool _isIntroDone;
bool _hasYelledMagmaBurst;
bool _processingMagmaBurst;
bool _hasSubmergedOnce;
bool _isKnockbackEmoteAllowed; // Prevents possible text overlap

Expand Down Expand Up @@ -452,6 +421,7 @@ struct boss_ragnaros : public BossAI
events.RescheduleEvent(EVENT_WRATH_OF_RAGNAROS, 30s, PHASE_EMERGED, PHASE_EMERGED);
events.RescheduleEvent(EVENT_HAND_OF_RAGNAROS, 25s, PHASE_EMERGED, PHASE_EMERGED);
events.RescheduleEvent(EVENT_LAVA_BURST, 10s, PHASE_EMERGED, PHASE_EMERGED);
events.RescheduleEvent(EVENT_MAGMA_BLAST, 4s, PHASE_EMERGED, PHASE_EMERGED);
events.RescheduleEvent(EVENT_SUBMERGE, 180s, PHASE_EMERGED, PHASE_EMERGED);
events.RescheduleEvent(EVENT_MIGHT_OF_RAGNAROS, 11s, PHASE_EMERGED, PHASE_EMERGED);
}
Expand Down
Loading