refactor(Scripts/TempestKeep): Clean up script files (#17727)

This commit is contained in:
Andrew
2023-11-16 14:01:45 -03:00
committed by GitHub
parent 1f30a755dc
commit 79ef4fa671
10 changed files with 12 additions and 64 deletions

View File

@@ -36,13 +36,7 @@ enum Spells
struct boss_gatewatcher_gyrokill : public BossAI
{
boss_gatewatcher_gyrokill(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_gatewatcher_gyrokill(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) { }
void JustDied(Unit* /*killer*/) override
{

View File

@@ -37,13 +37,7 @@ enum Spells
struct boss_gatewatcher_iron_hand : public BossAI
{
boss_gatewatcher_iron_hand(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_IRON_HAND)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_gatewatcher_iron_hand(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_IRON_HAND) { }
void JustEngagedWith(Unit* /*who*/) override
{

View File

@@ -48,13 +48,7 @@ enum Yells
struct boss_mechano_lord_capacitus : public BossAI
{
boss_mechano_lord_capacitus(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_mechano_lord_capacitus(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { }
void JustEngagedWith(Unit* /*who*/) override
{

View File

@@ -46,13 +46,7 @@ enum Spells
struct boss_nethermancer_sepethrea : public BossAI
{
boss_nethermancer_sepethrea(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_nethermancer_sepethrea(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) { }
bool CanAIAttack(Unit const* target) const override
{
@@ -165,7 +159,7 @@ struct npc_raging_flames : public ScriptedAI
FixateRandomTarget();
_scheduler.Schedule(15s, 25s, [this](TaskContext task)
scheduler.Schedule(15s, 25s, [this](TaskContext task)
{
DoCastSelf(SPELL_INFERNO);
FixateRandomTarget();
@@ -176,7 +170,7 @@ struct npc_raging_flames : public ScriptedAI
void Reset() override
{
_scheduler.CancelAll();
scheduler.CancelAll();
}
void EnterEvadeMode(EvadeReason /*why*/) override
@@ -189,13 +183,10 @@ struct npc_raging_flames : public ScriptedAI
if (!UpdateVictim())
return;
_scheduler.Update(diff);
scheduler.Update(diff);
DoMeleeAttackIfReady();
}
private:
TaskScheduler _scheduler;
};
class spell_ragin_flames_inferno : public AuraScript

View File

@@ -56,13 +56,7 @@ enum Misc
struct boss_pathaleon_the_calculator : public BossAI
{
boss_pathaleon_the_calculator(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_pathaleon_the_calculator(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }
bool _isEnraged;

View File

@@ -50,13 +50,7 @@ enum Misc
struct boss_harbinger_skyriss : public BossAI
{
boss_harbinger_skyriss(Creature* creature) : BossAI(creature, DATA_WARDEN_MELLICHAR)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_harbinger_skyriss(Creature* creature) : BossAI(creature, DATA_WARDEN_MELLICHAR) { }
void Reset() override
{

View File

@@ -67,11 +67,6 @@ struct boss_wrath_scryer_soccothrates : public BossAI
boss_wrath_scryer_soccothrates(Creature* creature) : BossAI(creature, DATA_SOCCOTHRATES)
{
preFight = instance->GetBossState(DATA_DALLIAH) == DONE;
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
void Reset() override

View File

@@ -37,13 +37,7 @@ enum Spells
struct boss_zereketh_the_unbound : public BossAI
{
boss_zereketh_the_unbound(Creature* creature) : BossAI(creature, DATA_ZEREKETH)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
boss_zereketh_the_unbound(Creature* creature) : BossAI(creature, DATA_ZEREKETH) { }
void JustDied(Unit* /*killer*/) override
{

View File

@@ -51,6 +51,8 @@ struct boss_high_botanist_freywinn : public BossAI
void JustEngagedWith(Unit* /*who*/) override
{
scheduler.ClearValidator();
_JustEngagedWith();
Talk(SAY_AGGRO);

View File

@@ -45,10 +45,6 @@ struct boss_thorngrin_the_tender : public BossAI
{
me->m_SightDistance = 100.0f;
_intro = false;
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
void Reset() override