refactor(Scripts/Outland): Update Doomwalker to new register model (#17987)
This commit is contained in:
@@ -38,14 +38,9 @@ enum Spells
|
||||
SPELL_AURA_DEATH = 37131
|
||||
};
|
||||
|
||||
class boss_doomwalker : public CreatureScript
|
||||
struct boss_doomwalker : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
boss_doomwalker() : CreatureScript("boss_doomwalker") { }
|
||||
|
||||
struct boss_doomwalkerAI : public ScriptedAI
|
||||
{
|
||||
boss_doomwalkerAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
boss_doomwalker(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
@@ -56,10 +51,8 @@ public:
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
victim->CastSpell(victim, SPELL_MARK_DEATH, 0);
|
||||
if (urand(0, 4))
|
||||
return;
|
||||
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
if (roll_chance_i(25) && victim->IsPlayer())
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
@@ -87,10 +80,7 @@ public:
|
||||
context.Repeat(10s, 25s);
|
||||
}).Schedule(10s, 30s, [this](TaskContext context)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_CHAIN_LIGHTNING);
|
||||
}
|
||||
DoCastRandomTarget(SPELL_CHAIN_LIGHTNING, 1);
|
||||
context.Repeat(7s, 27s);
|
||||
}).Schedule(25s, 35s, [this](TaskContext context)
|
||||
{
|
||||
@@ -130,23 +120,18 @@ public:
|
||||
return;
|
||||
|
||||
scheduler.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
bool _inEnrage;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new boss_doomwalkerAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_doomwalker()
|
||||
{
|
||||
new boss_doomwalker();
|
||||
RegisterCreatureAI(boss_doomwalker);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user