mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 11:55:43 +00:00
fix(DB/SmartAI): port Shadow of Doom script to SmartAI (#22735)
This commit is contained in:
@@ -802,69 +802,6 @@ struct npc_cultist_engineer : public ScriptedAI
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_shadow_of_doom : public CombatAI
|
||||
{
|
||||
npc_shadow_of_doom(Creature* creature) : CombatAI(creature) { }
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
scheduler.Schedule(2s, [&](TaskContext context)
|
||||
{
|
||||
DoCastVictim(SPELL_MINDFLAY);
|
||||
context.Repeat(6500ms, 13s);
|
||||
}).Schedule(2s, [&](TaskContext context)
|
||||
{
|
||||
DoCastVictim(SPELL_FEAR);
|
||||
context.Repeat(14500ms, 14500ms);
|
||||
});
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
me->SetImmuneToPC(false);
|
||||
}
|
||||
|
||||
void IsSummonedBy(WorldObject* summoner) override
|
||||
{
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
if (Player* player = summoner->ToPlayer())
|
||||
{
|
||||
me->SetImmuneToPC(true);
|
||||
me->SetFacingToObject(player);
|
||||
|
||||
Talk(SHADOW_OF_DOOM_SAY_AGGRO, player);
|
||||
DoCastSelf(SPELL_SPAWN_SMOKE, true);
|
||||
|
||||
scheduler.Schedule(5s, [this, player](TaskContext const& /*context*/)
|
||||
{
|
||||
me->SetImmuneToPC(false);
|
||||
if (me->CanStartAttack(player))
|
||||
AttackStart(player);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*pKiller*/) override
|
||||
{
|
||||
DoCastSelf(SPELL_ZAP_CRYSTAL_CORPSE, true);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /* caster */, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_SPIRIT_SPAWN_OUT)
|
||||
me->DespawnOrUnsummon(3000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff) override
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_flameshocker : public CombatAI
|
||||
{
|
||||
npc_flameshocker(Creature* creature) : CombatAI(creature) { }
|
||||
@@ -1121,7 +1058,6 @@ void AddSC_scourge_invasion()
|
||||
RegisterCreatureAI(npc_minion_spawner);
|
||||
RegisterCreatureAI(npc_pallid_horror);
|
||||
RegisterCreatureAI(npc_cultist_engineer);
|
||||
RegisterCreatureAI(npc_shadow_of_doom);
|
||||
RegisterCreatureAI(npc_flameshocker);
|
||||
RegisterSpellScript(spell_communique_trigger);
|
||||
RegisterSpellScript(spell_despawner_self);
|
||||
|
||||
@@ -137,10 +137,7 @@ enum ScourgeInvasionSpells
|
||||
*/
|
||||
|
||||
// Shadow of Doom
|
||||
SPELL_SPAWN_SMOKE = 10389, // Spawning Visual.
|
||||
SPELL_ZAP_CRYSTAL_CORPSE = 28056, // Casted on Shard if Shadow of Doom dies.
|
||||
SPELL_MINDFLAY = 16568,
|
||||
SPELL_FEAR = 12542,
|
||||
|
||||
// Pallid Horror - Patchwerk Terror (also uses: 28315)
|
||||
SPELL_SUMMON_CRACKED_NECROTIC_CRYSTAL = 28424, // Alliance.
|
||||
@@ -336,7 +333,6 @@ enum ScourgeInvasionTalk
|
||||
HERALD_OF_THE_LICH_KING_SAY_ATTACK_END = 1,
|
||||
HERALD_OF_THE_LICH_KING_SAY_ATTACK_RANDOM = 2,
|
||||
PALLID_HORROR_SAY_RANDOM_YELL = 0,
|
||||
SHADOW_OF_DOOM_SAY_AGGRO = 0,
|
||||
SYLVANAS_SAY_ATTACK_END = 3,
|
||||
VARIAN_SAY_ATTACK_END = 3
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user