mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 18:13:48 +00:00
First Commit
For Azeroth!
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_SAW_BLADE = 2,
|
||||
SAY_DEATH = 3
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311,
|
||||
SPELL_SAW_BLADE = 35318,
|
||||
SPELL_SHADOW_POWER = 35322
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_STREAM_OF_MACHINE_FLUID = 1,
|
||||
EVENT_SAW_BLADE = 2,
|
||||
EVENT_SHADOW_POWER = 3
|
||||
};
|
||||
|
||||
class boss_gatewatcher_gyrokill : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") { }
|
||||
|
||||
struct boss_gatewatcher_gyrokillAI : public BossAI
|
||||
{
|
||||
boss_gatewatcher_gyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) { }
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 10000);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 20000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 30000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_STREAM_OF_MACHINE_FLUID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_STREAM_OF_MACHINE_FLUID, false);
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, urand(12000, 14000));
|
||||
break;
|
||||
case EVENT_SAW_BLADE:
|
||||
if (Unit* target= SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f))
|
||||
me->CastSpell(target, SPELL_SAW_BLADE, false);
|
||||
Talk(SAY_SAW_BLADE);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 25000);
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
me->CastSpell(me, SPELL_SHADOW_POWER, false);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 25000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_gyrokillAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_gyrokill()
|
||||
{
|
||||
new boss_gatewatcher_gyrokill();
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_HAMMER = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_DEATH = 3,
|
||||
EMOTE_HAMMER = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOW_POWER = 35322,
|
||||
SPELL_JACKHAMMER = 35327,
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_STREAM_OF_MACHINE_FLUID = 1,
|
||||
EVENT_JACKHAMMER = 2,
|
||||
EVENT_SHADOW_POWER = 3
|
||||
};
|
||||
|
||||
class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") { }
|
||||
|
||||
struct boss_gatewatcher_iron_handAI : public BossAI
|
||||
{
|
||||
boss_gatewatcher_iron_handAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_IRON_HAND) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 15000);
|
||||
events.ScheduleEvent(EVENT_JACKHAMMER, 35000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_STREAM_OF_MACHINE_FLUID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_STREAM_OF_MACHINE_FLUID, false);
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 20000);
|
||||
break;
|
||||
case EVENT_JACKHAMMER:
|
||||
Talk(EMOTE_HAMMER);
|
||||
Talk(SAY_HAMMER);
|
||||
me->CastSpell(me, SPELL_JACKHAMMER, false);
|
||||
events.ScheduleEvent(EVENT_JACKHAMMER, 40000);
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
me->CastSpell(me, SPELL_SHADOW_POWER, false);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_iron_hand()
|
||||
{
|
||||
new boss_gatewatcher_iron_hand();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "mechanar.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_HEADCRACK = 35161,
|
||||
SPELL_REFLECTIVE_MAGIC_SHIELD = 35158,
|
||||
SPELL_REFLECTIVE_DAMAGE_SHIELD = 35159,
|
||||
SPELL_POLARITY_SHIFT = 39096,
|
||||
SPELL_BERSERK = 26662
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
YELL_AGGRO = 0,
|
||||
YELL_REFLECTIVE_MAGIC_SHIELD = 1,
|
||||
YELL_REFLECTIVE_DAMAGE_SHIELD = 2,
|
||||
YELL_KILL = 3,
|
||||
YELL_DEATH = 4
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_NETHER_CHARGE = 20405
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_HEADCRACK = 1,
|
||||
EVENT_REFLECTIVE_DAMAGE_SHIELD = 2,
|
||||
EVENT_REFLECTIVE_MAGIE_SHIELD = 3,
|
||||
EVENT_POSITIVE_SHIFT = 4,
|
||||
EVENT_SUMMON_NETHER_CHARGE = 5,
|
||||
EVENT_BERSERK = 6
|
||||
};
|
||||
|
||||
class boss_mechano_lord_capacitus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_mechano_lord_capacitus() : CreatureScript("boss_mechano_lord_capacitus") { }
|
||||
|
||||
struct boss_mechano_lord_capacitusAI : public BossAI
|
||||
{
|
||||
boss_mechano_lord_capacitusAI(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(YELL_AGGRO);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 6000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 180000);
|
||||
events.ScheduleEvent(IsHeroic() ? EVENT_POSITIVE_SHIFT : EVENT_REFLECTIVE_DAMAGE_SHIELD, 15000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(YELL_DEATH);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->GetMotionMaster()->MoveRandom(30.0f);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_HEADCRACK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_HEADCRACK, false);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 20000);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_DAMAGE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
me->CastSpell(me, SPELL_REFLECTIVE_DAMAGE_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_MAGIE_SHIELD, 20000);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_MAGIE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
me->CastSpell(me, SPELL_REFLECTIVE_MAGIC_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 20000);
|
||||
break;
|
||||
case EVENT_SUMMON_NETHER_CHARGE:
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 8.0f);
|
||||
me->SummonCreature(NPC_NETHER_CHARGE, pos, TEMPSUMMON_TIMED_DESPAWN, 18000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 5000);
|
||||
break;
|
||||
case EVENT_POSITIVE_SHIFT:
|
||||
me->CastSpell(me, SPELL_POLARITY_SHIFT, true);
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 30000);
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_mechano_lord_capacitusAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum polarityShift
|
||||
{
|
||||
SPELL_POSITIVE_POLARITY = 39088,
|
||||
SPELL_POSITIVE_CHARGE_STACK = 39089,
|
||||
SPELL_POSITIVE_CHARGE = 39090,
|
||||
|
||||
SPELL_NEGATIVE_POLARITY = 39091,
|
||||
SPELL_NEGATIVE_CHARGE_STACK = 39092,
|
||||
SPELL_NEGATIVE_CHARGE = 39093
|
||||
};
|
||||
|
||||
class spell_capacitus_polarity_charge : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { }
|
||||
|
||||
class spell_capacitus_polarity_charge_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_charge_SpellScript);
|
||||
|
||||
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 = GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE ? SPELL_POSITIVE_CHARGE_STACK : SPELL_NEGATIVE_CHARGE_STACK;
|
||||
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetTriggeringSpell())
|
||||
return;
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
SetHitDamage(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
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
|
||||
{
|
||||
return new spell_capacitus_polarity_charge_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_capacitus_polarity_shift : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
|
||||
|
||||
class spell_capacitus_polarity_shift_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, GetCaster()->GetGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_capacitus_polarity_shift_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mechano_lord_capacitus()
|
||||
{
|
||||
new boss_mechano_lord_capacitus();
|
||||
new spell_capacitus_polarity_charge();
|
||||
new spell_capacitus_polarity_shift();
|
||||
}
|
||||
@@ -0,0 +1,218 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SUMMON = 1,
|
||||
SAY_DRAGONS_BREATH = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SUMMON_RAGIN_FLAMES = 35275,
|
||||
SPELL_FROST_ATTACK = 35263,
|
||||
SPELL_ARCANE_BLAST = 35314,
|
||||
SPELL_DRAGONS_BREATH = 35250,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_FROST_ATTACK = 1,
|
||||
EVENT_ARCANE_BLAST = 2,
|
||||
EVENT_DRAGONS_BREATH = 3,
|
||||
};
|
||||
|
||||
class boss_nethermancer_sepethrea : public CreatureScript
|
||||
{
|
||||
public: boss_nethermancer_sepethrea(): CreatureScript("boss_nethermancer_sepethrea") { }
|
||||
|
||||
struct boss_nethermancer_sepethreaAI : public BossAI
|
||||
{
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) { }
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 6000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 14000);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 18000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
me->CastSpell(me, SPELL_SUMMON_RAGIN_FLAMES, true);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
summon->AI()->AttackStart(victim);
|
||||
summon->AddThreat(victim, 1000.0f);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
events.Reset();
|
||||
if (instance)
|
||||
{
|
||||
instance->SetBossState(DATA_NETHERMANCER_SEPRETHREA, DONE);
|
||||
instance->SaveToDB();
|
||||
}
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
Unit::Kill(summon, summon);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_FROST_ATTACK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FROST_ATTACK, false);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 8000);
|
||||
break;
|
||||
case EVENT_ARCANE_BLAST:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_BLAST, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 12000);
|
||||
break;
|
||||
case EVENT_DRAGONS_BREATH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_DRAGONS_BREATH, true);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 16000);
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_DRAGONS_BREATH);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_nethermancer_sepethreaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum raginFlames
|
||||
{
|
||||
SPELL_INFERNO = 35268,
|
||||
SPELL_FIRE_TAIL = 35278,
|
||||
SPELL_INFERNO_DAMAGE = 35283,
|
||||
|
||||
EVENT_SPELL_FIRE_TAIL = 1,
|
||||
EVENT_SPELL_INFERNO = 2
|
||||
};
|
||||
|
||||
class npc_ragin_flames : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ragin_flames() : CreatureScript("npc_ragin_flames") { }
|
||||
|
||||
struct npc_ragin_flamesAI : public ScriptedAI
|
||||
{
|
||||
npc_ragin_flamesAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ALL, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_FIRE_TAIL, 500);
|
||||
events.ScheduleEvent(EVENT_SPELL_INFERNO, urand(10000, 20000));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_INFERNO:
|
||||
if (me->IsWithinCombatRange(me->GetVictim(), 5.0f))
|
||||
{
|
||||
me->CastSpell(me, SPELL_INFERNO, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_INFERNO, 20000);
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_SPELL_INFERNO, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_FIRE_TAIL:
|
||||
me->CastSpell(me, SPELL_FIRE_TAIL, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_FIRE_TAIL, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_ragin_flamesAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ragin_flames_inferno : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ragin_flames_inferno() : SpellScriptLoader("spell_ragin_flames_inferno") { }
|
||||
|
||||
class spell_ragin_flames_inferno_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_ragin_flames_inferno_AuraScript);
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
int32 damage = aurEff->GetAmount();
|
||||
GetUnitOwner()->CastCustomSpell(SPELL_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ragin_flames_inferno_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ragin_flames_inferno_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nethermancer_sepethrea()
|
||||
{
|
||||
new boss_nethermancer_sepethrea();
|
||||
new npc_ragin_flames();
|
||||
new spell_ragin_flames_inferno();
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_DOMINATION = 1,
|
||||
SAY_SUMMON = 2,
|
||||
SAY_ENRAGE = 3,
|
||||
SAY_SLAY = 4,
|
||||
SAY_DEATH = 5,
|
||||
SAY_APPEAR = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCANE_EXPLOSION = 15453,
|
||||
SPELL_DISGRUNTLED_ANGER = 35289,
|
||||
SPELL_ARCANE_TORRENT = 36022,
|
||||
SPELL_MANA_TAP = 36021,
|
||||
SPELL_DOMINATION = 35280,
|
||||
SPELL_SUMMON_NETHER_WRAITH_1 = 35285,
|
||||
SPELL_SUMMON_NETHER_WRAITH_2 = 35286,
|
||||
SPELL_SUMMON_NETHER_WRAITH_3 = 35287,
|
||||
SPELL_SUMMON_NETHER_WRAITH_4 = 35288,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SUMMON = 1,
|
||||
EVENT_MANA_TAP = 2,
|
||||
EVENT_ARCANE_TORRENT = 3,
|
||||
EVENT_DOMINATION = 4,
|
||||
EVENT_ARCANE_EXPLOSION = 5,
|
||||
EVENT_FRENZY = 6,
|
||||
};
|
||||
|
||||
class boss_pathaleon_the_calculator : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") { }
|
||||
|
||||
struct boss_pathaleon_the_calculatorAI : public BossAI
|
||||
{
|
||||
boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
me->SetVisible(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
me->SetVisible(true);
|
||||
me->CastSpell(me, SPELL_TELEPORT_VISUAL, true);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY1H);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
Talk(SAY_APPEAR);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30000);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 12000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 16000);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 25000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 8000);
|
||||
events.ScheduleEvent(EVENT_FRENZY, 1000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
me->CastSpell(me, SPELL_ARCANE_EXPLOSION, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 12000);
|
||||
break;
|
||||
case EVENT_ARCANE_TORRENT:
|
||||
me->RemoveAurasDueToSpell(SPELL_MANA_TAP);
|
||||
me->ModifyPower(POWER_MANA, 5000);
|
||||
me->CastSpell(me, SPELL_ARCANE_TORRENT, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 15000);
|
||||
break;
|
||||
case EVENT_MANA_TAP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 40.0f, false)))
|
||||
me->CastSpell(target, SPELL_MANA_TAP, false);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 18000);
|
||||
break;
|
||||
case EVENT_DOMINATION:
|
||||
Talk(SAY_DOMINATION);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50.0f))
|
||||
me->CastSpell(target, SPELL_DOMINATION, false);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 30000);
|
||||
break;
|
||||
case EVENT_FRENZY:
|
||||
if (me->HealthBelowPct(20))
|
||||
{
|
||||
summons.DespawnAll();
|
||||
me->CastSpell(me, SPELL_DISGRUNTLED_ANGER, true);
|
||||
Talk(SAY_ENRAGE);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_FRENZY, 1000);
|
||||
break;
|
||||
case EVENT_SUMMON:
|
||||
for (uint8 i = 0; i < DUNGEON_MODE(3, 4); ++i)
|
||||
me->CastSpell(me, SPELL_SUMMON_NETHER_WRAITH_1+i, true);
|
||||
|
||||
Talk(SAY_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, urand(30000, 45000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_pathaleon_the_calculatorAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_pathaleon_the_calculator()
|
||||
{
|
||||
new boss_pathaleon_the_calculator();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
static DoorData const doorData[] =
|
||||
{
|
||||
{ GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
};
|
||||
|
||||
class instance_mechanar : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_mechanar(): InstanceMapScript("instance_mechanar", 554) { }
|
||||
|
||||
struct instance_mechanar_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
_pathaleonGUID = 0;
|
||||
_passageEncounter = 0;
|
||||
_passageTimer = 0;
|
||||
_passageGUIDs.clear();
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameObject)
|
||||
{
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
case GO_DOOR_MOARG_2:
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
AddDoor(gameObject, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* gameObject)
|
||||
{
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
case GO_DOOR_MOARG_2:
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
AddDoor(gameObject, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
if (creature->GetEntry() == NPC_PATHALEON_THE_CALCULATOR)
|
||||
_pathaleonGUID = creature->GetGUID();
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit)
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
if (_passageEncounter > ENCOUNTER_PASSAGE_NOT_STARTED && _passageEncounter < ENCOUNTER_PASSAGE_DONE)
|
||||
if (_passageGUIDs.find(unit->GetGUID()) != _passageGUIDs.end())
|
||||
_passageGUIDs.erase(unit->GetGUID());
|
||||
}
|
||||
|
||||
Player* GetPassagePlayer(float x)
|
||||
{
|
||||
Map::PlayerList const& pl = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetPositionX() < x && player->GetPositionZ() > 24.0f && player->GetPositionY() > -30.0f)
|
||||
return player;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void DoSummonAction(Creature* summon, Player* player)
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true);
|
||||
summon->AI()->AttackStart(player);
|
||||
_passageGUIDs.insert(summon->GetGUID());
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_DONE)
|
||||
return;
|
||||
|
||||
_passageTimer += diff;
|
||||
if (_passageTimer >= 1000)
|
||||
{
|
||||
_passageTimer = 0;
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_NOT_STARTED)
|
||||
{
|
||||
if (Player* player = GetPassagePlayer(250.0f))
|
||||
{
|
||||
_passageEncounter++;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Position pos = {238.0f, -27.0f + 3.0f*i, 26.328f, 0.0f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1 || i==2 ? NPC_SUNSEEKER_ASTROMAGE : NPC_BLOODWARDER_CENTURION, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!_passageGUIDs.empty())
|
||||
return;
|
||||
|
||||
if (_passageEncounter < ENCOUNTER_PASSAGE_PHASE3)
|
||||
{
|
||||
if (Player* player = GetPassagePlayer(250.0f))
|
||||
{
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE1)
|
||||
{
|
||||
Position pos = {214.37f, -23.5f, 24.88f, 0.0f};
|
||||
if (Creature* creature = instance->SummonCreature(NPC_TEMPEST_KEEPER_DESTROYER, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE2)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Position pos = {199.76f, -26.0f + 2.5f*i, 24.88f, 0.0f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1 ? NPC_SUNSEEKER_ENGINEER : NPC_BLOODWARDER_PHYSICIAN, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
_passageEncounter++;
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Player* player = GetPassagePlayer(148.0f))
|
||||
{
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE3)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Position pos = {135.0f + 2.5f*i, 36.76f, 24.88f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1 ? NPC_SUNSEEKER_ASTROMAGE : NPC_BLOODWARDER_PHYSICIAN, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE4)
|
||||
{
|
||||
Position pos = {137.62f, 62.23f, 24.88f, M_PI*1.5f};
|
||||
if (Creature* creature = instance->SummonCreature(NPC_TEMPEST_KEEPER_DESTROYER, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE5)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Position pos = {133.0f + 3.5f*i, 92.88f, 26.38f, M_PI*1.5f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1||i==2 ? NPC_SUNSEEKER_ASTROMAGE : NPC_SUNSEEKER_ENGINEER, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE6)
|
||||
{
|
||||
if (Creature* creature = instance->GetCreature(_pathaleonGUID))
|
||||
creature->AI()->DoAction(1);
|
||||
}
|
||||
_passageEncounter++;
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
// Xinef: no space needed
|
||||
saveStream << "M E " << GetBossSaveData() << _passageEncounter;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'M' && dataHead2 == 'E')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
|
||||
loadStream >> _passageEncounter;
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_DONE)
|
||||
_passageEncounter = ENCOUNTER_PASSAGE_PHASE6;
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _pathaleonGUID;
|
||||
uint32 _passageTimer;
|
||||
uint32 _passageEncounter;
|
||||
std::set<uint64> _passageGUIDs;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_mechanar()
|
||||
{
|
||||
new instance_mechanar();
|
||||
}
|
||||
50
src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
Normal file
50
src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_MECHANAR_H
|
||||
#define DEF_MECHANAR_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_GATEWATCHER_GYROKILL = 0,
|
||||
DATA_GATEWATCHER_IRON_HAND = 1,
|
||||
DATA_MECHANOLORD_CAPACITUS = 2,
|
||||
DATA_NETHERMANCER_SEPRETHREA = 3,
|
||||
DATA_PATHALEON_THE_CALCULATOR = 4,
|
||||
MAX_ENCOUNTER = 5,
|
||||
|
||||
ENCOUNTER_PASSAGE_NOT_STARTED = 0,
|
||||
ENCOUNTER_PASSAGE_PHASE1 = 1,
|
||||
ENCOUNTER_PASSAGE_PHASE2 = 2,
|
||||
ENCOUNTER_PASSAGE_PHASE3 = 3,
|
||||
ENCOUNTER_PASSAGE_PHASE4 = 4,
|
||||
ENCOUNTER_PASSAGE_PHASE5 = 5,
|
||||
ENCOUNTER_PASSAGE_PHASE6 = 6,
|
||||
ENCOUNTER_PASSAGE_DONE = 7,
|
||||
};
|
||||
|
||||
enum NpcIds
|
||||
{
|
||||
NPC_SUNSEEKER_ASTROMAGE = 19168,
|
||||
NPC_SUNSEEKER_ENGINEER = 20988,
|
||||
NPC_BLOODWARDER_CENTURION = 19510,
|
||||
NPC_BLOODWARDER_PHYSICIAN = 20990,
|
||||
NPC_TEMPEST_KEEPER_DESTROYER = 19735,
|
||||
|
||||
NPC_PATHALEON_THE_CALCULATOR = 19220
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_DOOR_MOARG_1 = 184632,
|
||||
GO_DOOR_MOARG_2 = 184322,
|
||||
GO_DOOR_NETHERMANCER = 184449
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_TELEPORT_VISUAL = 35517
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user