mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Temple of AhnQiraj): Moved Anubisath Warder script from D… (#12951)
…B to C++.
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `AiName`='', `ScriptName`='npc_anubisath_warder' WHERE `entry`=15311;
|
||||||
|
DELETE FROM `smart_scripts` WHERE `entryorguid`=15311 AND `source_type`=0;
|
||||||
@@ -38,6 +38,12 @@ enum Spells
|
|||||||
SPELL_SUMMON_WARRIOR = 17431,
|
SPELL_SUMMON_WARRIOR = 17431,
|
||||||
SPELL_SUMMON_SWARMGUARD = 17430,
|
SPELL_SUMMON_SWARMGUARD = 17430,
|
||||||
|
|
||||||
|
SPELL_FEAR = 26070,
|
||||||
|
SPELL_ENTAGLING_ROOTS = 26071,
|
||||||
|
SPELL_SILENCE = 26069,
|
||||||
|
SPELL_DUST_CLOUD = 26072,
|
||||||
|
SPELL_FIRE_NOVA = 26073,
|
||||||
|
|
||||||
SPELL_SUMMON_LARGE_OBSIDIAN_CHUNK = 27630, // Server-side
|
SPELL_SUMMON_LARGE_OBSIDIAN_CHUNK = 27630, // Server-side
|
||||||
|
|
||||||
SPELL_SHOCK_BLAST = 26458,
|
SPELL_SHOCK_BLAST = 26458,
|
||||||
@@ -274,10 +280,80 @@ class spell_drain_mana : public SpellScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct npc_anubisath_warder : public ScriptedAI
|
||||||
|
{
|
||||||
|
npc_anubisath_warder(Creature* creature) : ScriptedAI(creature)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void Reset() override
|
||||||
|
{
|
||||||
|
_scheduler.CancelAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnterCombat(Unit* /*who*/) override
|
||||||
|
{
|
||||||
|
if (urand(0, 1))
|
||||||
|
{
|
||||||
|
_scheduler.Schedule(5s, 5s, [this](TaskContext context)
|
||||||
|
{
|
||||||
|
DoCastAOE(SPELL_FEAR, true);
|
||||||
|
context.Repeat(20s, 20s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scheduler.Schedule(5s, 5s, [this](TaskContext context)
|
||||||
|
{
|
||||||
|
DoCastAOE(SPELL_ENTAGLING_ROOTS, true);
|
||||||
|
context.Repeat(20s, 20s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (urand(0, 1))
|
||||||
|
{
|
||||||
|
_scheduler.Schedule(4s, 4s, [this](TaskContext context)
|
||||||
|
{
|
||||||
|
DoCastAOE(SPELL_SILENCE, true);
|
||||||
|
context.Repeat(15s, 15s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_scheduler.Schedule(4s, 4s, [this](TaskContext context)
|
||||||
|
{
|
||||||
|
DoCastAOE(SPELL_DUST_CLOUD, true);
|
||||||
|
context.Repeat(15s, 15s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
_scheduler.Schedule(2s, 2s, [this](TaskContext context)
|
||||||
|
{
|
||||||
|
DoCastAOE(SPELL_FIRE_NOVA, true);
|
||||||
|
context.Repeat(8s, 15s);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateAI(uint32 diff) override
|
||||||
|
{
|
||||||
|
if (!UpdateVictim())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_scheduler.Update(diff,
|
||||||
|
std::bind(&ScriptedAI::DoMeleeAttackIfReady, this));
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
TaskScheduler _scheduler;
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_temple_of_ahnqiraj()
|
void AddSC_temple_of_ahnqiraj()
|
||||||
{
|
{
|
||||||
RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_defender);
|
RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_defender);
|
||||||
RegisterSpellScript(spell_aggro_drones);
|
RegisterSpellScript(spell_aggro_drones);
|
||||||
RegisterTempleOfAhnQirajCreatureAI(npc_obsidian_eradicator);
|
RegisterTempleOfAhnQirajCreatureAI(npc_obsidian_eradicator);
|
||||||
RegisterSpellScript(spell_drain_mana);
|
RegisterSpellScript(spell_drain_mana);
|
||||||
|
RegisterTempleOfAhnQirajCreatureAI(npc_anubisath_warder);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user