mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Scripts/Instances: Update Mechanar scripts to new register model (#26569)
This commit is contained in:
@@ -72,209 +72,176 @@ enum Events
|
||||
EVENT_BERSERK = 6
|
||||
};
|
||||
|
||||
class boss_mechano_lord_capacitus : public CreatureScript
|
||||
struct boss_mechano_lord_capacitus : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_mechano_lord_capacitus() : CreatureScript("boss_mechano_lord_capacitus") { }
|
||||
boss_mechano_lord_capacitus(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { }
|
||||
|
||||
struct boss_mechano_lord_capacitusAI : public BossAI
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(YELL_AGGRO);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 10s);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 15s);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10s);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 3min);
|
||||
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 15s);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(YELL_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
boss_mechano_lord_capacitusAI(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
switch (eventId)
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
Talk(YELL_AGGRO);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 10s);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 15s);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10s);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 3min);
|
||||
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 15s);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(YELL_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
case EVENT_HEADCRACK:
|
||||
DoCastVictim(SPELL_HEADCRACK);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 10s);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_DAMAGE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
DoCast(me, SPELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_MAGIE_SHIELD, 30s);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_MAGIE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
DoCast(me, SPELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 30s);
|
||||
break;
|
||||
case EVENT_POSITIVE_SHIFT:
|
||||
DoCastAOE(SPELL_POLARITY_SHIFT);
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 45s, 60s);
|
||||
break;
|
||||
case EVENT_SUMMON_NETHER_CHARGE:
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_HEADCRACK:
|
||||
DoCastVictim(SPELL_HEADCRACK);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 10s);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_DAMAGE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
DoCast(me, SPELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_MAGIE_SHIELD, 30s);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_MAGIE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
DoCast(me, SPELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 30s);
|
||||
break;
|
||||
case EVENT_POSITIVE_SHIFT:
|
||||
DoCastAOE(SPELL_POLARITY_SHIFT);
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 45s, 60s);
|
||||
break;
|
||||
case EVENT_SUMMON_NETHER_CHARGE:
|
||||
{
|
||||
uint32 spellId = RAND(SPELL_SUMMON_NETHER_CHARGE_NE,
|
||||
SPELL_SUMMON_NETHER_CHARGE_NW,
|
||||
SPELL_SUMMON_NETHER_CHARGE_SE,
|
||||
SPELL_SUMMON_NETHER_CHARGE_SW);
|
||||
Milliseconds netherChargeTimer = DUNGEON_MODE(randtime(9s, 11s), randtime(2s, 5s));
|
||||
DoCastSelf(spellId);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, netherChargeTimer);
|
||||
break;
|
||||
}
|
||||
case EVENT_BERSERK:
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
uint32 spellId = RAND(SPELL_SUMMON_NETHER_CHARGE_NE,
|
||||
SPELL_SUMMON_NETHER_CHARGE_NW,
|
||||
SPELL_SUMMON_NETHER_CHARGE_SE,
|
||||
SPELL_SUMMON_NETHER_CHARGE_SW);
|
||||
Milliseconds netherChargeTimer = DUNGEON_MODE(randtime(9s, 11s), randtime(2s, 5s));
|
||||
DoCastSelf(spellId);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, netherChargeTimer);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
case EVENT_BERSERK:
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetMechanarAI<boss_mechano_lord_capacitusAI>(creature);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
// 39090 - Positive Charge
|
||||
// 39093 - Negative Charge
|
||||
class spell_capacitus_polarity_charge : public SpellScriptLoader
|
||||
class spell_capacitus_polarity_charge : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { }
|
||||
PrepareSpellScript(spell_capacitus_polarity_charge);
|
||||
|
||||
class spell_capacitus_polarity_charge_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_charge_SpellScript);
|
||||
SPELL_POSITIVE_CHARGE,
|
||||
SPELL_POSITIVE_CHARGE_STACK,
|
||||
SPELL_NEGATIVE_CHARGE,
|
||||
SPELL_NEGATIVE_CHARGE_STACK
|
||||
});
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_POSITIVE_CHARGE,
|
||||
SPELL_POSITIVE_CHARGE_STACK,
|
||||
SPELL_NEGATIVE_CHARGE,
|
||||
SPELL_NEGATIVE_CHARGE_STACK
|
||||
});
|
||||
}
|
||||
void HandleTargets(std::list<WorldObject*>& targetList)
|
||||
{
|
||||
uint8 count = 0;
|
||||
for (std::list<WorldObject*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
|
||||
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
|
||||
if (Player* target = (*ihit)->ToPlayer())
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
++count;
|
||||
|
||||
void HandleTargets(std::list<WorldObject*>& targetList)
|
||||
{
|
||||
uint8 count = 0;
|
||||
for (std::list<WorldObject*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
|
||||
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
|
||||
if (Player* target = (*ihit)->ToPlayer())
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
++count;
|
||||
|
||||
if (count)
|
||||
{
|
||||
uint32 spellId = 0;
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
|
||||
spellId = SPELL_POSITIVE_CHARGE_STACK;
|
||||
else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
|
||||
spellId = SPELL_NEGATIVE_CHARGE_STACK;
|
||||
|
||||
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetTriggeringSpell())
|
||||
return;
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
PreventHitDamage();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
if (count)
|
||||
{
|
||||
return new spell_capacitus_polarity_charge_SpellScript();
|
||||
uint32 spellId = 0;
|
||||
|
||||
if (GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE)
|
||||
spellId = SPELL_POSITIVE_CHARGE_STACK;
|
||||
else // if (GetSpellInfo()->Id == SPELL_NEGATIVE_CHARGE)
|
||||
spellId = SPELL_NEGATIVE_CHARGE_STACK;
|
||||
|
||||
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetTriggeringSpell())
|
||||
return;
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
PreventHitDamage();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_capacitus_polarity_charge::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
// 39096 - Polarity Shift
|
||||
class spell_capacitus_polarity_shift : public SpellScriptLoader
|
||||
class spell_capacitus_polarity_shift : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
|
||||
PrepareSpellScript(spell_capacitus_polarity_shift);
|
||||
|
||||
class spell_capacitus_polarity_shift_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_POSITIVE_POLARITY, SPELL_NEGATIVE_POLARITY });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_POSITIVE_POLARITY, SPELL_NEGATIVE_POLARITY });
|
||||
}
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
Unit* caster = GetCaster();
|
||||
target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, caster->GetGUID());
|
||||
}
|
||||
|
||||
target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, caster->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_capacitus_polarity_shift_SpellScript();
|
||||
}
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mechano_lord_capacitus()
|
||||
{
|
||||
new boss_mechano_lord_capacitus();
|
||||
new spell_capacitus_polarity_charge();
|
||||
new spell_capacitus_polarity_shift();
|
||||
RegisterMechanarCreatureAI(boss_mechano_lord_capacitus);
|
||||
RegisterSpellScript(spell_capacitus_polarity_charge);
|
||||
RegisterSpellScript(spell_capacitus_polarity_shift);
|
||||
}
|
||||
|
||||
@@ -60,178 +60,157 @@ enum Events
|
||||
EVENT_SOLARBURN = 5
|
||||
};
|
||||
|
||||
class boss_nethermancer_sepethrea : public CreatureScript
|
||||
struct boss_nethermancer_sepethrea : public BossAI
|
||||
{
|
||||
public: boss_nethermancer_sepethrea(): CreatureScript("boss_nethermancer_sepethrea") { }
|
||||
boss_nethermancer_sepethrea(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) { }
|
||||
|
||||
struct boss_nethermancer_sepethreaAI : public BossAI
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 7s, 10s);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 12s, 18s);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 18s, 22s);
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, 22s, 28s);
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30s);
|
||||
Talk(SAY_AGGRO);
|
||||
DoCast(who, SPELL_SUMMON_RAGIN_FLAMES);
|
||||
Talk(SAY_SUMMON);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
switch (eventId)
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 7s, 10s);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 12s, 18s);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 18s, 22s);
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, 22s, 28s);
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30s);
|
||||
Talk(SAY_AGGRO);
|
||||
DoCast(who, SPELL_SUMMON_RAGIN_FLAMES);
|
||||
Talk(SAY_SUMMON);
|
||||
case EVENT_FROST_ATTACK:
|
||||
DoCastVictim(SPELL_FROST_ATTACK, true);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 7s, 10s);
|
||||
break;
|
||||
case EVENT_ARCANE_BLAST:
|
||||
DoCastVictim(SPELL_ARCANE_BLAST, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 15s);
|
||||
break;
|
||||
case EVENT_DRAGONS_BREATH:
|
||||
DoCastVictim(SPELL_DRAGONS_BREATH, true);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 12s, 22s);
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_DRAGONS_BREATH);
|
||||
break;
|
||||
case EVENT_KNOCKBACK:
|
||||
DoCastVictim(SPELL_KNOCKBACK, true);
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, 15s, 25s);
|
||||
break;
|
||||
case EVENT_SOLARBURN:
|
||||
DoCastVictim(SPELL_SOLARBURN, true);
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_FROST_ATTACK:
|
||||
DoCastVictim(SPELL_FROST_ATTACK, true);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 7s, 10s);
|
||||
break;
|
||||
case EVENT_ARCANE_BLAST:
|
||||
DoCastVictim(SPELL_ARCANE_BLAST, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 15s);
|
||||
break;
|
||||
case EVENT_DRAGONS_BREATH:
|
||||
DoCastVictim(SPELL_DRAGONS_BREATH, true);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 12s, 22s);
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_DRAGONS_BREATH);
|
||||
break;
|
||||
case EVENT_KNOCKBACK:
|
||||
DoCastVictim(SPELL_KNOCKBACK, true);
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, 15s, 25s);
|
||||
break;
|
||||
case EVENT_SOLARBURN:
|
||||
DoCastVictim(SPELL_SOLARBURN, true);
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetMechanarAI<boss_nethermancer_sepethreaAI>(creature);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
class npc_ragin_flames : public CreatureScript
|
||||
struct npc_ragin_flames : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_ragin_flames() : CreatureScript("npc_ragin_flames") { }
|
||||
npc_ragin_flames(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
struct npc_ragin_flamesAI : public ScriptedAI
|
||||
void Initialize()
|
||||
{
|
||||
inferno_Timer = 10000;
|
||||
flame_timer = 500;
|
||||
Check_Timer = 2000;
|
||||
onlyonce = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 inferno_Timer;
|
||||
uint32 flame_timer;
|
||||
uint32 Check_Timer;
|
||||
|
||||
bool onlyonce;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
//Check_Timer
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
if (instance->GetBossState(DATA_NETHERMANCER_SEPRETHREA) != IN_PROGRESS)
|
||||
{
|
||||
npc_ragin_flamesAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
inferno_Timer = 10000;
|
||||
flame_timer = 500;
|
||||
Check_Timer = 2000;
|
||||
onlyonce = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 inferno_Timer;
|
||||
uint32 flame_timer;
|
||||
uint32 Check_Timer;
|
||||
|
||||
bool onlyonce;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
//Check_Timer
|
||||
if (Check_Timer <= diff)
|
||||
{
|
||||
if (instance->GetBossState(DATA_NETHERMANCER_SEPRETHREA) != IN_PROGRESS)
|
||||
{
|
||||
//remove
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
Check_Timer = 1000;
|
||||
} else Check_Timer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!onlyonce)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
onlyonce = true;
|
||||
}
|
||||
|
||||
if (inferno_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_INFERNO);
|
||||
inferno_Timer = 10000;
|
||||
} else inferno_Timer -= diff;
|
||||
|
||||
if (flame_timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FIRE_TAIL);
|
||||
flame_timer = 500;
|
||||
} else flame_timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetMechanarAI<npc_ragin_flamesAI>(creature);
|
||||
//remove
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
Check_Timer = 1000;
|
||||
} else Check_Timer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!onlyonce)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
me->GetMotionMaster()->MoveChase(target);
|
||||
onlyonce = true;
|
||||
}
|
||||
|
||||
if (inferno_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_INFERNO);
|
||||
inferno_Timer = 10000;
|
||||
} else inferno_Timer -= diff;
|
||||
|
||||
if (flame_timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FIRE_TAIL);
|
||||
flame_timer = 500;
|
||||
} else flame_timer -=diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nethermancer_sepethrea()
|
||||
{
|
||||
new boss_nethermancer_sepethrea();
|
||||
new npc_ragin_flames();
|
||||
RegisterMechanarCreatureAI(boss_nethermancer_sepethrea);
|
||||
RegisterMechanarCreatureAI(npc_ragin_flames);
|
||||
}
|
||||
|
||||
@@ -66,189 +66,166 @@ enum Creatures
|
||||
NPC_NETHER_WRAITH = 21062
|
||||
};
|
||||
|
||||
class boss_pathaleon_the_calculator : public CreatureScript
|
||||
struct boss_pathaleon_the_calculator : public BossAI
|
||||
{
|
||||
public:
|
||||
boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") { }
|
||||
boss_pathaleon_the_calculator(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }
|
||||
|
||||
struct boss_pathaleon_the_calculatorAI : public BossAI
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30s);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 12s, 20s);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 16s, 25s);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 25s, 40s);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 8s, 13s);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
{
|
||||
if (me->HealthBelowPctDamaged(20, damage) && !me->HasAura(SPELL_FRENZY))
|
||||
{
|
||||
boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30s);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 12s, 20s);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 16s, 25s);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 25s, 40s);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 8s, 13s);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/) override
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
{
|
||||
if (me->HealthBelowPctDamaged(20, damage) && !me->HasAura(SPELL_FRENZY))
|
||||
{
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Talk(SAY_ENRAGE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUMMON:
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
{
|
||||
if (Creature* Wraith = me->SummonCreature(NPC_NETHER_WRAITH, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25s))
|
||||
Wraith->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
Talk(SAY_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30s, 45s);
|
||||
break;
|
||||
case EVENT_MANA_TAP:
|
||||
DoCastVictim(SPELL_MANA_TAP, true);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 14s, 22s);
|
||||
break;
|
||||
case EVENT_ARCANE_TORRENT:
|
||||
DoCastVictim(SPELL_ARCANE_TORRENT, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 12s, 18s);
|
||||
break;
|
||||
case EVENT_DOMINATION:
|
||||
Talk(SAY_DOMINATION);
|
||||
DoCastVictim(SPELL_DOMINATION, true);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 25s, 30s);
|
||||
break;
|
||||
case EVENT_ARCANE_EXPLOSION: // Heroic only
|
||||
DoCastVictim(H_SPELL_ARCANE_EXPLOSION, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 10s, 14s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetMechanarAI<boss_pathaleon_the_calculatorAI>(creature);
|
||||
DoCast(me, SPELL_FRENZY);
|
||||
Talk(SAY_ENRAGE);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUMMON:
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0))
|
||||
{
|
||||
if (Creature* Wraith = me->SummonCreature(NPC_NETHER_WRAITH, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25s))
|
||||
Wraith->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
Talk(SAY_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30s, 45s);
|
||||
break;
|
||||
case EVENT_MANA_TAP:
|
||||
DoCastVictim(SPELL_MANA_TAP, true);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 14s, 22s);
|
||||
break;
|
||||
case EVENT_ARCANE_TORRENT:
|
||||
DoCastVictim(SPELL_ARCANE_TORRENT, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 12s, 18s);
|
||||
break;
|
||||
case EVENT_DOMINATION:
|
||||
Talk(SAY_DOMINATION);
|
||||
DoCastVictim(SPELL_DOMINATION, true);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 25s, 30s);
|
||||
break;
|
||||
case EVENT_ARCANE_EXPLOSION: // Heroic only
|
||||
DoCastVictim(H_SPELL_ARCANE_EXPLOSION, true);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 10s, 14s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
class npc_nether_wraith : public CreatureScript
|
||||
struct npc_nether_wraith : public ScriptedAI
|
||||
{
|
||||
public:
|
||||
npc_nether_wraith(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
npc_nether_wraith() : CreatureScript("npc_nether_wraith") { }
|
||||
void Initialize()
|
||||
{
|
||||
ArcaneMissiles_Timer = urand(1000, 4000);
|
||||
Detonation_Timer = 20000;
|
||||
Die_Timer = 2200;
|
||||
Detonation = false;
|
||||
}
|
||||
|
||||
struct npc_nether_wraithAI : public ScriptedAI
|
||||
uint32 ArcaneMissiles_Timer;
|
||||
uint32 Detonation_Timer;
|
||||
uint32 Die_Timer;
|
||||
bool Detonation;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override { }
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (ArcaneMissiles_Timer <= diff)
|
||||
{
|
||||
npc_nether_wraithAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
ArcaneMissiles_Timer = urand(1000, 4000);
|
||||
Detonation_Timer = 20000;
|
||||
Die_Timer = 2200;
|
||||
Detonation = false;
|
||||
}
|
||||
|
||||
uint32 ArcaneMissiles_Timer;
|
||||
uint32 Detonation_Timer;
|
||||
uint32 Die_Timer;
|
||||
bool Detonation;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override { }
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (ArcaneMissiles_Timer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
|
||||
DoCast(target, SPELL_ARCANE_MISSILES);
|
||||
else
|
||||
DoCastVictim(SPELL_ARCANE_MISSILES);
|
||||
ArcaneMissiles_Timer = urand(5000, 10000);
|
||||
}
|
||||
else
|
||||
ArcaneMissiles_Timer -=diff;
|
||||
|
||||
if (!Detonation)
|
||||
{
|
||||
if (Detonation_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DETONATION);
|
||||
Detonation = true;
|
||||
}
|
||||
else
|
||||
Detonation_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Detonation)
|
||||
{
|
||||
if (Die_Timer <= diff)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
else
|
||||
Die_Timer -= diff;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetMechanarAI<npc_nether_wraithAI>(creature);
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 1))
|
||||
DoCast(target, SPELL_ARCANE_MISSILES);
|
||||
else
|
||||
DoCastVictim(SPELL_ARCANE_MISSILES);
|
||||
ArcaneMissiles_Timer = urand(5000, 10000);
|
||||
}
|
||||
else
|
||||
ArcaneMissiles_Timer -=diff;
|
||||
|
||||
if (!Detonation)
|
||||
{
|
||||
if (Detonation_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_DETONATION);
|
||||
Detonation = true;
|
||||
}
|
||||
else
|
||||
Detonation_Timer -= diff;
|
||||
}
|
||||
|
||||
if (Detonation)
|
||||
{
|
||||
if (Die_Timer <= diff)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
else
|
||||
Die_Timer -= diff;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_pathaleon_the_calculator()
|
||||
{
|
||||
new boss_pathaleon_the_calculator();
|
||||
new npc_nether_wraith();
|
||||
RegisterMechanarCreatureAI(boss_pathaleon_the_calculator);
|
||||
RegisterMechanarCreatureAI(npc_nether_wraith);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user