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
|
SPELL_AURA_DEATH = 37131
|
||||||
};
|
};
|
||||||
|
|
||||||
class boss_doomwalker : public CreatureScript
|
struct boss_doomwalker : public ScriptedAI
|
||||||
{
|
{
|
||||||
public:
|
boss_doomwalker(Creature* creature) : ScriptedAI(creature) { }
|
||||||
boss_doomwalker() : CreatureScript("boss_doomwalker") { }
|
|
||||||
|
|
||||||
struct boss_doomwalkerAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
boss_doomwalkerAI(Creature* creature) : ScriptedAI(creature) {}
|
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
@@ -56,10 +51,8 @@ public:
|
|||||||
void KilledUnit(Unit* victim) override
|
void KilledUnit(Unit* victim) override
|
||||||
{
|
{
|
||||||
victim->CastSpell(victim, SPELL_MARK_DEATH, 0);
|
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);
|
Talk(SAY_SLAY);
|
||||||
}
|
}
|
||||||
@@ -87,10 +80,7 @@ public:
|
|||||||
context.Repeat(10s, 25s);
|
context.Repeat(10s, 25s);
|
||||||
}).Schedule(10s, 30s, [this](TaskContext context)
|
}).Schedule(10s, 30s, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1, 0.0f, true))
|
DoCastRandomTarget(SPELL_CHAIN_LIGHTNING, 1);
|
||||||
{
|
|
||||||
DoCast(target, SPELL_CHAIN_LIGHTNING);
|
|
||||||
}
|
|
||||||
context.Repeat(7s, 27s);
|
context.Repeat(7s, 27s);
|
||||||
}).Schedule(25s, 35s, [this](TaskContext context)
|
}).Schedule(25s, 35s, [this](TaskContext context)
|
||||||
{
|
{
|
||||||
@@ -130,6 +120,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
scheduler.Update(diff);
|
scheduler.Update(diff);
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -140,13 +131,7 @@ public:
|
|||||||
bool _inEnrage;
|
bool _inEnrage;
|
||||||
};
|
};
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new boss_doomwalkerAI (creature);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddSC_boss_doomwalker()
|
void AddSC_boss_doomwalker()
|
||||||
{
|
{
|
||||||
new boss_doomwalker();
|
RegisterCreatureAI(boss_doomwalker);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user