fix(Scripts/TheEye): Fix Al'ar berserk timer (#20572)
This commit is contained in:
@@ -72,11 +72,10 @@ enum Misc
|
|||||||
|
|
||||||
EVENT_RELOCATE_MIDDLE = 1,
|
EVENT_RELOCATE_MIDDLE = 1,
|
||||||
EVENT_REBIRTH = 2,
|
EVENT_REBIRTH = 2,
|
||||||
EVENT_SPELL_BERSERK = 3,
|
|
||||||
|
|
||||||
EVENT_MOVE_TO_PHASE_2 = 4,
|
EVENT_MOVE_TO_PHASE_2 = 3,
|
||||||
EVENT_FINISH_DIVE = 5,
|
EVENT_FINISH_DIVE = 4,
|
||||||
EVENT_INVISIBLE = 6
|
EVENT_INVISIBLE = 5
|
||||||
};
|
};
|
||||||
|
|
||||||
enum GroupAlar
|
enum GroupAlar
|
||||||
@@ -121,16 +120,15 @@ struct boss_alar : public BossAI
|
|||||||
me->SetModelVisible(true);
|
me->SetModelVisible(true);
|
||||||
me->SetReactState(REACT_AGGRESSIVE);
|
me->SetReactState(REACT_AGGRESSIVE);
|
||||||
ConstructWaypointsAndMove();
|
ConstructWaypointsAndMove();
|
||||||
|
me->m_Events.KillAllEvents(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustReachedHome() override
|
void JustReachedHome() override
|
||||||
{
|
{
|
||||||
BossAI::JustReachedHome();
|
BossAI::JustReachedHome();
|
||||||
if (me->IsEngaged())
|
if (me->IsEngaged())
|
||||||
{
|
|
||||||
ConstructWaypointsAndMove();
|
ConstructWaypointsAndMove();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void JustEngagedWith(Unit* who) override
|
void JustEngagedWith(Unit* who) override
|
||||||
{
|
{
|
||||||
@@ -158,6 +156,7 @@ struct boss_alar : public BossAI
|
|||||||
}
|
}
|
||||||
context.Repeat(_platformMoveRepeatTimer);
|
context.Repeat(_platformMoveRepeatTimer);
|
||||||
});
|
});
|
||||||
|
|
||||||
ScheduleMainSpellAttack(0s);
|
ScheduleMainSpellAttack(0s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,37 +171,22 @@ struct boss_alar : public BossAI
|
|||||||
void EnterEvadeMode(EvadeReason why) override
|
void EnterEvadeMode(EvadeReason why) override
|
||||||
{
|
{
|
||||||
if (why == EVADE_REASON_BOUNDARY)
|
if (why == EVADE_REASON_BOUNDARY)
|
||||||
{
|
|
||||||
BossAI::EnterEvadeMode(why);
|
BossAI::EnterEvadeMode(why);
|
||||||
}
|
else if (me->GetThreatMgr().GetThreatList().empty())
|
||||||
else
|
|
||||||
{
|
|
||||||
if (me->GetThreatMgr().GetThreatList().empty())
|
|
||||||
{
|
|
||||||
BossAI::EnterEvadeMode(why);
|
BossAI::EnterEvadeMode(why);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void JustDied(Unit* killer) override
|
void JustDied(Unit* killer) override
|
||||||
{
|
{
|
||||||
BossAI::JustDied(killer);
|
BossAI::JustDied(killer);
|
||||||
me->SetModelVisible(true);
|
me->SetModelVisible(true);
|
||||||
|
|
||||||
if (Map* map = me->GetMap())
|
me->GetMap()->DoForAllPlayers([&](Player* player)
|
||||||
{
|
|
||||||
map->DoForAllPlayers([&](Player* player)
|
|
||||||
{
|
|
||||||
if (player->GetQuestStatus(QUEST_RUSE_OF_THE_ASHTONGUE) == QUEST_STATUS_INCOMPLETE)
|
|
||||||
{
|
|
||||||
if (player->HasAura(SPELL_ASHTONGUE_RUSE))
|
|
||||||
{
|
{
|
||||||
|
if (player->GetQuestStatus(QUEST_RUSE_OF_THE_ASHTONGUE) == QUEST_STATUS_INCOMPLETE && player->HasAura(SPELL_ASHTONGUE_RUSE))
|
||||||
player->AreaExploredOrEventHappens(QUEST_RUSE_OF_THE_ASHTONGUE);
|
player->AreaExploredOrEventHappens(QUEST_RUSE_OF_THE_ASHTONGUE);
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit* /*who*/) override { }
|
void MoveInLineOfSight(Unit* /*who*/) override { }
|
||||||
|
|
||||||
@@ -235,7 +219,7 @@ struct boss_alar : public BossAI
|
|||||||
_noMelee = false;
|
_noMelee = false;
|
||||||
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||||
_platform = POINT_MIDDLE;
|
_platform = POINT_MIDDLE;
|
||||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
me->ResumeChasingVictim();
|
||||||
ScheduleAbilities();
|
ScheduleAbilities();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -270,19 +254,18 @@ struct boss_alar : public BossAI
|
|||||||
{
|
{
|
||||||
// find spell from sniffs?
|
// find spell from sniffs?
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 50.0f, true))
|
||||||
{
|
|
||||||
me->SummonCreature(NPC_FLAME_PATCH, *target, TEMPSUMMON_TIMED_DESPAWN, 2 * MINUTE * IN_MILLISECONDS);
|
me->SummonCreature(NPC_FLAME_PATCH, *target, TEMPSUMMON_TIMED_DESPAWN, 2 * MINUTE * IN_MILLISECONDS);
|
||||||
}
|
|
||||||
}, 30s);
|
}, 30s);
|
||||||
ScheduleTimedEvent(34s, [&]
|
ScheduleTimedEvent(34s, [&]
|
||||||
{
|
{
|
||||||
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], false, true);
|
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], false, true);
|
||||||
scheduler.DelayAll(15s);
|
scheduler.DelayAll(15s);
|
||||||
}, 57s);
|
}, 57s);
|
||||||
ScheduleUniqueTimedEvent(10min, [&]
|
|
||||||
{
|
me->m_Events.AddEventAtOffset([&] {
|
||||||
DoCastSelf(SPELL_BERSERK);
|
DoCastSelf(SPELL_BERSERK, true);
|
||||||
}, EVENT_SPELL_BERSERK);
|
}, 10min);
|
||||||
|
|
||||||
ScheduleMainSpellAttack(0s);
|
ScheduleMainSpellAttack(0s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -304,16 +287,14 @@ struct boss_alar : public BossAI
|
|||||||
scheduler.Schedule(2s, [this](TaskContext)
|
scheduler.Schedule(2s, [this](TaskContext)
|
||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 110.0f, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 110.0f, true))
|
||||||
{
|
|
||||||
SpawnPhoenixes(2, target);
|
SpawnPhoenixes(2, target);
|
||||||
}
|
|
||||||
}).Schedule(6s, [this](TaskContext)
|
}).Schedule(6s, [this](TaskContext)
|
||||||
{
|
{
|
||||||
me->SetModelVisible(true);
|
me->SetModelVisible(true);
|
||||||
DoCastSelf(SPELL_REBIRTH_DIVE);
|
DoCastSelf(SPELL_REBIRTH_DIVE);
|
||||||
}).Schedule(10s, [this](TaskContext)
|
}).Schedule(10s, [this](TaskContext)
|
||||||
{
|
{
|
||||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
me->ResumeChasingVictim();
|
||||||
_noMelee = false;
|
_noMelee = false;
|
||||||
});
|
});
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
|
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 90.0f, true))
|
||||||
@@ -331,9 +312,8 @@ struct boss_alar : public BossAI
|
|||||||
if (type != POINT_MOTION_TYPE)
|
if (type != POINT_MOTION_TYPE)
|
||||||
{
|
{
|
||||||
if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized() && !me->IsInCombat())
|
if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized() && !me->IsInCombat())
|
||||||
{
|
|
||||||
ConstructWaypointsAndMove();
|
ConstructWaypointsAndMove();
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,9 +346,8 @@ struct boss_alar : public BossAI
|
|||||||
scheduler.Schedule(timer, GROUP_FLAME_BUFFET, [this](TaskContext context)
|
scheduler.Schedule(timer, GROUP_FLAME_BUFFET, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
if (!me->SelectNearestTarget(me->GetCombatReach()) && !me->isMoving())
|
if (!me->SelectNearestTarget(me->GetCombatReach()) && !me->isMoving())
|
||||||
{
|
|
||||||
DoCastVictim(SPELL_FLAME_BUFFET);
|
DoCastVictim(SPELL_FLAME_BUFFET);
|
||||||
}
|
|
||||||
context.Repeat(2s);
|
context.Repeat(2s);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -394,22 +373,16 @@ struct boss_alar : public BossAI
|
|||||||
_transitionScheduler.Update(diff);
|
_transitionScheduler.Update(diff);
|
||||||
|
|
||||||
if (!UpdateVictim())
|
if (!UpdateVictim())
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
scheduler.Update(diff);
|
scheduler.Update(diff);
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if (!_noMelee)
|
if (!_noMelee)
|
||||||
{
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Position DeterminePhoenixPosition(Position playerPosition)
|
Position DeterminePhoenixPosition(Position playerPosition)
|
||||||
{
|
{
|
||||||
@@ -498,14 +471,10 @@ class spell_alar_ember_blast : public SpellScript
|
|||||||
void HandleCast()
|
void HandleCast()
|
||||||
{
|
{
|
||||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||||
{
|
|
||||||
if (Creature* alar = instance->GetCreature(DATA_ALAR))
|
if (Creature* alar = instance->GetCreature(DATA_ALAR))
|
||||||
{
|
|
||||||
if (!alar->HasAura(SPELL_MODEL_VISIBILITY))
|
if (!alar->HasAura(SPELL_MODEL_VISIBILITY))
|
||||||
Unit::DealDamage(GetCaster(), alar, alar->CountPctFromMaxHealth(2));
|
Unit::DealDamage(GetCaster(), alar, alar->CountPctFromMaxHealth(2));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user