convert Tempest Keep The Eye to new format

--HG--
branch : trunk
This commit is contained in:
Supabad
2010-08-07 21:12:35 +02:00
parent b3e6a6c5ab
commit f8fe880982
6 changed files with 2389 additions and 2178 deletions
@@ -26,21 +26,24 @@ EndScriptData */
#include "ScriptPCH.h"
#include "the_eye.h"
#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions
#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20%
#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1)
#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2
#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2
#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown
#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec
#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5.
#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown)
enum eSpells
{
SPELL_FLAME_BUFFET = 34121, // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions
SPELL_FLAME_QUILLS = 34229, // Randomly after changing position in phase after watching tonns of movies, set probability 20%
SPELL_REBIRTH = 34342, // Rebirth - beginning of second phase(after loose all health in phase 1)
SPELL_REBIRTH_2 = 35369, // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2
SPELL_MELT_ARMOR = 35410, // Melt Armor - every 60 sec in phase 2
SPELL_CHARGE = 35412, // Charge - 30 sec cooldown
SPELL_DIVE_BOMB_VISUAL = 35367, // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec
SPELL_DIVE_BOMB = 35181, // after watching tonns of movies, set cooldown to 40+rand()%5.
SPELL_BERSERK = 45078, // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown)
#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health.
#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast
CREATURE_EMBER_OF_ALAR = 19551, // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health.
SPELL_EMBER_BLAST = 34133, // When Ember of Al'ar dies, it casts Ember Blast
#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2
#define SPELL_FLAME_PATCH 35380 //
CREATURE_FLAME_PATCH_ALAR = 20602, // Flame Patch - every 30 sec in phase 2
SPELL_FLAME_PATCH = 35380, //
};
static float waypoint[6][3] =
{
@@ -67,459 +70,500 @@ enum WaitEventType
WE_SUMMON = 10
};
struct boss_alarAI : public ScriptedAI
class boss_alar : public CreatureScript
{
boss_alarAI(Creature *c) : ScriptedAI(c)
{
pInstance =c->GetInstanceData();
DefaultMoveSpeedRate = c->GetSpeedRate(MOVE_RUN);
}
public:
ScriptedInstance *pInstance;
WaitEventType WaitEvent;
uint32 WaitTimer;
bool AfterMoving;
uint32 Platforms_Move_Timer;
uint32 DiveBomb_Timer;
uint32 MeltArmor_Timer;
uint32 Charge_Timer;
uint32 FlamePatch_Timer;
uint32 Berserk_Timer;
float DefaultMoveSpeedRate;
bool Phase1;
bool ForceMove;
uint32 ForceTimer;
int8 cur_wp;
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, NOT_STARTED);
Berserk_Timer = 1200000;
Platforms_Move_Timer = 0;
Phase1 = true;
WaitEvent = WE_NONE;
WaitTimer = 0;
AfterMoving = false;
ForceMove = false;
ForceTimer = 5000;
cur_wp = 4;
me->SetDisplayId(me->GetNativeDisplayId());
me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
//me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
//me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setActive(false);
}
void EnterCombat(Unit * /*who*/)
{
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
DoZoneInCombat();
me->setActive(true);
}
void JustDied(Unit * /*victim*/)
{
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, DONE);
}
void JustSummoned(Creature *summon)
{
if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
summon->AI()->AttackStart(pTarget);
}
void MoveInLineOfSight(Unit * /*who*/) {}
void AttackStart(Unit* who)
{
if (Phase1)
AttackStartNoMove(who);
else
ScriptedAI::AttackStart(who);
}
void DamageTaken(Unit* /*pKiller*/, uint32 &damage)
{
if (damage >= me->GetHealth() && Phase1)
boss_alar()
: CreatureScript("boss_alar")
{
damage = 0;
if (!WaitEvent)
}
struct boss_alarAI : public ScriptedAI
{
boss_alarAI(Creature* pCreature) : ScriptedAI(pCreature)
{
WaitEvent = WE_DIE;
WaitTimer = 0;
me->SetHealth(0);
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop();
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetSpeed(MOVE_RUN, 5.0f);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
pInstance = pCreature->GetInstanceData();
DefaultMoveSpeedRate = pCreature->GetSpeedRate(MOVE_RUN);
}
}
}
void SpellHit(Unit*, const SpellEntry *spell)
{
if (spell->Id == SPELL_DIVE_BOMB_VISUAL)
{
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetDisplayId(11686);
//me->SendUpdateObjectToAllExcept(NULL);
}
}
ScriptedInstance *pInstance;
void MovementInform(uint32 type, uint32 /*id*/)
{
if (type == POINT_MOTION_TYPE)
{
WaitTimer = 1;
AfterMoving = true;
ForceMove = false;
}
}
WaitEventType WaitEvent;
uint32 WaitTimer;
void UpdateAI(const uint32 diff)
{
if (!me->isInCombat()) // sometimes isincombat but !incombat, faction bug?
return;
bool AfterMoving;
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
Berserk_Timer = 60000;
} else Berserk_Timer -= diff;
uint32 Platforms_Move_Timer;
uint32 DiveBomb_Timer;
uint32 MeltArmor_Timer;
uint32 Charge_Timer;
uint32 FlamePatch_Timer;
uint32 Berserk_Timer;
if (ForceMove)
{
if (ForceTimer <= diff)
float DefaultMoveSpeedRate;
bool Phase1;
bool ForceMove;
uint32 ForceTimer;
int8 cur_wp;
void Reset()
{
me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, NOT_STARTED);
Berserk_Timer = 1200000;
Platforms_Move_Timer = 0;
Phase1 = true;
WaitEvent = WE_NONE;
WaitTimer = 0;
AfterMoving = false;
ForceMove = false;
ForceTimer = 5000;
} else ForceTimer -= diff;
}
if (WaitEvent)
{
if (WaitTimer)
cur_wp = 4;
me->SetDisplayId(me->GetNativeDisplayId());
me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
//me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
//me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setActive(false);
}
void EnterCombat(Unit * /*who*/)
{
if (WaitTimer <= diff)
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS);
me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement
DoZoneInCombat();
me->setActive(true);
}
void JustDied(Unit * /*victim*/)
{
if (pInstance)
pInstance->SetData(DATA_ALAREVENT, DONE);
}
void JustSummoned(Creature *summon)
{
if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR)
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
summon->AI()->AttackStart(pTarget);
}
void MoveInLineOfSight(Unit * /*who*/) {}
void AttackStart(Unit* who)
{
if (Phase1)
AttackStartNoMove(who);
else
ScriptedAI::AttackStart(who);
}
void DamageTaken(Unit* /*pKiller*/, uint32 &damage)
{
if (damage >= me->GetHealth() && Phase1)
{
if (AfterMoving)
damage = 0;
if (!WaitEvent)
{
me->GetMotionMaster()->MoveIdle();
AfterMoving = false;
WaitEvent = WE_DIE;
WaitTimer = 0;
me->SetHealth(0);
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AttackStop();
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetSpeed(MOVE_RUN, 5.0f);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]);
}
}
}
void SpellHit(Unit*, const SpellEntry *spell)
{
if (spell->Id == SPELL_DIVE_BOMB_VISUAL)
{
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->SetDisplayId(11686);
//me->SendUpdateObjectToAllExcept(NULL);
}
}
void MovementInform(uint32 type, uint32 /*id*/)
{
if (type == POINT_MOTION_TYPE)
{
WaitTimer = 1;
AfterMoving = true;
ForceMove = false;
}
}
void UpdateAI(const uint32 diff)
{
if (!me->isInCombat()) // sometimes isincombat but !incombat, faction bug?
return;
if (Berserk_Timer <= diff)
{
DoCast(me, SPELL_BERSERK, true);
Berserk_Timer = 60000;
}
else
Berserk_Timer -= diff;
if (ForceMove)
{
if (ForceTimer <= diff)
{
me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
ForceTimer = 5000;
}
else
ForceTimer -= diff;
}
if (WaitEvent)
{
if (WaitTimer)
{
if (WaitTimer <= diff)
{
if (AfterMoving)
{
me->GetMotionMaster()->MoveIdle();
AfterMoving = false;
}
switch(WaitEvent)
{
case WE_PLATFORM:
Platforms_Move_Timer = 30000+rand()%5000;
break;
case WE_QUILL:
DoCast(me, SPELL_FLAME_QUILLS, true);
Platforms_Move_Timer = 1;
WaitTimer = 10000;
WaitEvent = WE_DUMMY;
return;
case WE_DIE:
ForceMove = false;
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
WaitTimer = 5000;
WaitEvent = WE_REVIVE;
return;
case WE_REVIVE:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
me->SetHealth(me->GetMaxHealth());
me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoZoneInCombat();
DoCast(me, SPELL_REBIRTH, true);
MeltArmor_Timer = 60000;
Charge_Timer = 7000;
DiveBomb_Timer = 40000+rand()%5000;
FlamePatch_Timer = 30000;
Phase1 = false;
break;
case WE_METEOR:
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
DoCast(me, SPELL_DIVE_BOMB_VISUAL, false);
WaitEvent = WE_DIVE;
WaitTimer = 4000;
return;
case WE_DIVE:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
DoCast(pTarget, SPELL_DIVE_BOMB, true);
float dist = 3.0f;
if (me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f))
dist = 5.0f;
WaitTimer = 1000 + floor(dist / 80 * 1000.0f);
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f);
me->StopMoving();
WaitEvent = WE_LAND;
}
else
{
EnterEvadeMode();
return;
}
case WE_LAND:
WaitEvent = WE_SUMMON;
WaitTimer = 2000;
return;
case WE_SUMMON:
for (uint8 i = 0; i < 2; ++i)
DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(me->GetNativeDisplayId());
DoCast(me, SPELL_REBIRTH_2, true);
break;
case WE_DUMMY:
default:
break;
}
WaitEvent = WE_NONE;
WaitTimer = 0;
}
else
WaitTimer -= diff;
}
return;
}
if (Phase1)
{
if (me->getThreatManager().getThreatList().empty())
{
EnterEvadeMode();
return;
}
switch(WaitEvent)
if (Platforms_Move_Timer <= diff)
{
case WE_PLATFORM:
Platforms_Move_Timer = 30000+rand()%5000;
break;
case WE_QUILL:
DoCast(me, SPELL_FLAME_QUILLS, true);
Platforms_Move_Timer = 1;
WaitTimer = 10000;
WaitEvent = WE_DUMMY;
if (cur_wp == 4)
{
cur_wp = 0;
WaitEvent = WE_PLATFORM;
}
else
{
if (urand(0,4)) // next platform
{
DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (cur_wp == 3)
cur_wp = 0;
else
++cur_wp;
WaitEvent = WE_PLATFORM;
}
else // flame quill
{
cur_wp = 4;
WaitEvent = WE_QUILL;
}
}
ForceMove = true;
ForceTimer = 5000;
me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
WaitTimer = 0;
return;
case WE_DIE:
ForceMove = false;
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
WaitTimer = 5000;
WaitEvent = WE_REVIVE;
return;
case WE_REVIVE:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
me->SetHealth(me->GetMaxHealth());
me->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
DoZoneInCombat();
DoCast(me, SPELL_REBIRTH, true);
}
else
Platforms_Move_Timer -= diff;
}
else
{
if (Charge_Timer <= diff)
{
Unit *pTarget= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (pTarget)
DoCast(pTarget, SPELL_CHARGE);
Charge_Timer = 30000;
}
else
Charge_Timer -= diff;
if (MeltArmor_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MELT_ARMOR);
MeltArmor_Timer = 60000;
Charge_Timer = 7000;
}
else
MeltArmor_Timer -= diff;
if (DiveBomb_Timer <= diff)
{
me->AttackStop();
me->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
WaitEvent = WE_METEOR;
WaitTimer = 0;
DiveBomb_Timer = 40000+rand()%5000;
FlamePatch_Timer = 30000;
Phase1 = false;
break;
case WE_METEOR:
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false);
DoCast(me, SPELL_DIVE_BOMB_VISUAL, false);
WaitEvent = WE_DIVE;
WaitTimer = 4000;
return;
case WE_DIVE:
}
else
DiveBomb_Timer -= diff;
if (FlamePatch_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
DoCast(pTarget, SPELL_DIVE_BOMB, true);
float dist = 3.0f;
if (me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f))
dist = 5.0f;
WaitTimer = 1000 + floor(dist / 80 * 1000.0f);
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f);
me->StopMoving();
WaitEvent = WE_LAND;
Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
if (Summoned)
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f);
Summoned->SetDisplayId(11686);
Summoned->setFaction(me->getFaction());
Summoned->SetLevel(me->getLevel());
Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
}
}
FlamePatch_Timer = 30000;
}
else
FlamePatch_Timer -= diff;
}
DoMeleeAttackIfReady();
}
void DoMeleeAttackIfReady()
{
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
if (me->IsWithinMeleeRange(me->getVictim()))
{
me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
else
{
Unit *pTarget = NULL;
pTarget = me->SelectNearestTargetInAttackDistance(5);
if (pTarget)
me->AI()->AttackStart(pTarget);
else
{
EnterEvadeMode();
return;
DoCast(me, SPELL_FLAME_BUFFET, true);
me->setAttackTimer(BASE_ATTACK, 1500);
}
case WE_LAND:
WaitEvent = WE_SUMMON;
WaitTimer = 2000;
return;
case WE_SUMMON:
for (uint8 i = 0; i < 2; ++i)
DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(me->GetNativeDisplayId());
DoCast(me, SPELL_REBIRTH_2, true);
break;
case WE_DUMMY:
default:
break;
}
WaitEvent = WE_NONE;
WaitTimer = 0;
} else WaitTimer -= diff;
}
}
return;
}
};
if (Phase1)
CreatureAI* GetAI(Creature* Creature) const
{
if (me->getThreatManager().getThreatList().empty())
{
EnterEvadeMode();
return;
}
if (Platforms_Move_Timer <= diff)
{
if (cur_wp == 4)
{
cur_wp = 0;
WaitEvent = WE_PLATFORM;
}
else
{
if (urand(0,4)) // next platform
{
DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (cur_wp == 3)
cur_wp = 0;
else
++cur_wp;
WaitEvent = WE_PLATFORM;
}
else // flame quill
{
cur_wp = 4;
WaitEvent = WE_QUILL;
}
}
ForceMove = true;
ForceTimer = 5000;
me->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]);
WaitTimer = 0;
return;
} else Platforms_Move_Timer -= diff;
return new boss_alarAI(Creature);
}
else
{
if (Charge_Timer <= diff)
{
Unit *pTarget= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (pTarget)
DoCast(pTarget, SPELL_CHARGE);
Charge_Timer = 30000;
} else Charge_Timer -= diff;
if (MeltArmor_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_MELT_ARMOR);
MeltArmor_Timer = 60000;
} else MeltArmor_Timer -= diff;
if (DiveBomb_Timer <= diff)
{
me->AttackStop();
me->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50);
WaitEvent = WE_METEOR;
WaitTimer = 0;
DiveBomb_Timer = 40000+rand()%5000;
return;
} else DiveBomb_Timer -= diff;
if (FlamePatch_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
{
Creature* Summoned = me->SummonCreature(CREATURE_FLAME_PATCH_ALAR, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000);
if (Summoned)
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f);
Summoned->SetDisplayId(11686);
Summoned->setFaction(me->getFaction());
Summoned->SetLevel(me->getLevel());
Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
}
}
FlamePatch_Timer = 30000;
} else FlamePatch_Timer -= diff;
}
DoMeleeAttackIfReady();
}
void DoMeleeAttackIfReady()
{
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
if (me->IsWithinMeleeRange(me->getVictim()))
{
me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
else
{
Unit *pTarget = NULL;
pTarget = me->SelectNearestTargetInAttackDistance(5);
if (pTarget)
me->AI()->AttackStart(pTarget);
else
{
DoCast(me, SPELL_FLAME_BUFFET, true);
me->setAttackTimer(BASE_ATTACK, 1500);
}
}
}
}
};
CreatureAI* GetAI_boss_alar(Creature* pCreature)
class mob_ember_of_alar : public CreatureScript
{
return new boss_alarAI(pCreature);
}
public:
struct mob_ember_of_alarAI : public ScriptedAI
{
mob_ember_of_alarAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
c->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
c->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
ScriptedInstance *pInstance;
bool toDie;
void Reset() {toDie = false;}
void EnterCombat(Unit * /*who*/) {DoZoneInCombat();}
void EnterEvadeMode() {me->setDeathState(JUST_DIED);}
void DamageTaken(Unit* pKiller, uint32 &damage)
{
if (damage >= me->GetHealth() && pKiller != me && !toDie)
mob_ember_of_alar()
: CreatureScript("mob_ember_of_alar")
{
damage = 0;
DoCast(me, SPELL_EMBER_BLAST, true);
me->SetDisplayId(11686);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2)
}
struct mob_ember_of_alarAI : public ScriptedAI
{
mob_ember_of_alarAI(Creature* pCreature) : ScriptedAI(pCreature)
{
if (Unit* Alar = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALAR)))
pInstance = pCreature->GetInstanceData();
pCreature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING);
pCreature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
ScriptedInstance *pInstance;
bool toDie;
void Reset()
{
toDie = false;
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
}
void EnterEvadeMode()
{
me->setDeathState(JUST_DIED);
}
void DamageTaken(Unit* pKiller, uint32 &damage)
{
if (damage >= me->GetHealth() && pKiller != me && !toDie)
{
int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03;
if (AlarHealth > 0)
Alar->SetHealth(AlarHealth);
else
Alar->SetHealth(1);
damage = 0;
DoCast(me, SPELL_EMBER_BLAST, true);
me->SetDisplayId(11686);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2)
{
if (Unit* Alar = Unit::GetUnit((*me), pInstance->GetData64(DATA_ALAR)))
{
int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03;
if (AlarHealth > 0)
Alar->SetHealth(AlarHealth);
else
Alar->SetHealth(1);
}
}
toDie = true;
}
}
toDie = true;
}
}
void UpdateAI(const uint32 /*diff*/)
{
if (!UpdateVictim())
return;
void UpdateAI(const uint32 /*diff*/)
{
if (!UpdateVictim())
return;
if (toDie)
if (toDie)
{
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
//me->SetVisibility(VISIBILITY_OFF);
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* Creature) const
{
return new mob_ember_of_alarAI(Creature);
}
};
class mob_flame_patch_alar : public CreatureScript
{
public:
mob_flame_patch_alar()
: CreatureScript("mob_flame_patch_alar")
{
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
//me->SetVisibility(VISIBILITY_OFF);
}
DoMeleeAttackIfReady();
}
struct mob_flame_patch_alarAI : public ScriptedAI
{
mob_flame_patch_alarAI(Creature* pCreature) : ScriptedAI(pCreature) {}
void Reset() {}
void EnterCombat(Unit * /*who*/) {}
void AttackStart(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/) {}
};
CreatureAI* GetAI(Creature* Creature) const
{
return new mob_flame_patch_alarAI(Creature);
}
};
CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature)
{
return new mob_ember_of_alarAI(pCreature);
}
struct mob_flame_patch_alarAI : public ScriptedAI
{
mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {}
void Reset() {}
void EnterCombat(Unit * /*who*/) {}
void AttackStart(Unit* /*who*/) {}
void MoveInLineOfSight(Unit* /*who*/) {}
void UpdateAI(const uint32 /*diff*/) {}
};
CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature)
{
return new mob_flame_patch_alarAI(pCreature);
}
void AddSC_boss_alar()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_alar";
newscript->GetAI = &GetAI_boss_alar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_ember_of_alar";
newscript->GetAI = &GetAI_mob_ember_of_alar;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_flame_patch_alar";
newscript->GetAI = &GetAI_mob_flame_patch_alar;
newscript->RegisterSelf();
new boss_alar();
new mob_ember_of_alar();
new mob_flame_patch_alar();
}
@@ -71,398 +71,429 @@ const float PORTAL_Z = 17.005f;
// x, y, z, o
static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421};
struct boss_high_astromancer_solarianAI : public ScriptedAI
class boss_high_astromancer_solarian : public CreatureScript
{
boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
public:
defaultarmor = c->GetArmor();
defaultsize = c->GetFloatValue(OBJECT_FIELD_SCALE_X);
}
ScriptedInstance *pInstance;
SummonList Summons;
uint8 Phase;
uint32 ArcaneMissiles_Timer;
uint32 m_uiWrathOfTheAstromancer_Timer;
uint32 BlindingLight_Timer;
uint32 Fear_Timer;
uint32 VoidBolt_Timer;
uint32 Phase1_Timer;
uint32 Phase2_Timer;
uint32 Phase3_Timer;
uint32 AppearDelay_Timer;
uint32 defaultarmor;
uint32 Wrath_Timer;
float defaultsize;
float Portals[3][3];
bool AppearDelay;
bool BlindingLight;
void Reset()
{
ArcaneMissiles_Timer = 2000;
m_uiWrathOfTheAstromancer_Timer = 15000;
BlindingLight_Timer = 41000;
Fear_Timer = 20000;
VoidBolt_Timer = 10000;
Phase1_Timer = 50000;
Phase2_Timer = 10000;
Phase3_Timer = 15000;
AppearDelay_Timer = 2000;
BlindingLight = false;
AppearDelay = false;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
Phase = 1;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
me->SetArmor(defaultarmor);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_ON);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
me->SetDisplayId(MODEL_HUMAN);
Summons.DespawnAll();
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me);
}
void JustDied(Unit * /*victim*/)
{
me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
me->SetDisplayId(MODEL_HUMAN);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
}
void SummonMinion(uint32 entry, float x, float y, float z)
{
Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (Summoned)
boss_high_astromancer_solarian()
: CreatureScript("boss_high_astromancer_solarian")
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Summoned->AI()->AttackStart(pTarget);
Summons.Summon(Summoned);
}
}
float Portal_X(float radius)
{
if (urand(0,1))
radius = -radius;
return radius * (float)(rand()%100)/100.0f + CENTER_X;
}
float Portal_Y(float x, float radius)
{
float z = RAND(1, -1);
return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (AppearDelay)
struct boss_high_astromancer_solarianAI : public ScriptedAI
{
me->StopMoving();
me->AttackStop();
if (AppearDelay_Timer <= diff)
boss_high_astromancer_solarianAI(Creature* pCreature) : ScriptedAI(pCreature), Summons(me)
{
AppearDelay = false;
if (Phase == 2)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_OFF);
}
AppearDelay_Timer = 2000;
} else AppearDelay_Timer -= diff;
}
pInstance = pCreature->GetInstanceData();
if (Phase == 1)
{
if (BlindingLight_Timer <= diff)
defaultarmor = pCreature->GetArmor();
defaultsize = pCreature->GetFloatValue(OBJECT_FIELD_SCALE_X);
}
ScriptedInstance *pInstance;
SummonList Summons;
uint8 Phase;
uint32 ArcaneMissiles_Timer;
uint32 m_uiWrathOfTheAstromancer_Timer;
uint32 BlindingLight_Timer;
uint32 Fear_Timer;
uint32 VoidBolt_Timer;
uint32 Phase1_Timer;
uint32 Phase2_Timer;
uint32 Phase3_Timer;
uint32 AppearDelay_Timer;
uint32 defaultarmor;
uint32 Wrath_Timer;
float defaultsize;
float Portals[3][3];
bool AppearDelay;
bool BlindingLight;
void Reset()
{
BlindingLight = true;
BlindingLight_Timer = 45000;
} else BlindingLight_Timer -= diff;
if (Wrath_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true);
Wrath_Timer = 20000+rand()%5000;
} else Wrath_Timer -= diff;
if (ArcaneMissiles_Timer <= diff)
{
if (BlindingLight)
{
DoCast(me->getVictim(), SPELL_BLINDING_LIGHT);
BlindingLight = false;
}else{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!me->HasInArc(2.5f, pTarget))
pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_MISSILES);
}
ArcaneMissiles_Timer = 3000;
} else ArcaneMissiles_Timer -= diff;
if (m_uiWrathOfTheAstromancer_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
//Target the tank ?
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
if (pTarget->GetTypeId() == TYPEID_PLAYER)
{
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER);
m_uiWrathOfTheAstromancer_Timer = 25000;
}
else
m_uiWrathOfTheAstromancer_Timer = 1000;
} else m_uiWrathOfTheAstromancer_Timer -= diff;
//Phase1_Timer
if (Phase1_Timer <= diff)
{
Phase = 2;
ArcaneMissiles_Timer = 2000;
m_uiWrathOfTheAstromancer_Timer = 15000;
BlindingLight_Timer = 41000;
Fear_Timer = 20000;
VoidBolt_Timer = 10000;
Phase1_Timer = 50000;
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
for (uint8 i=0; i <= 2; ++i)
{
if (!i)
{
Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS);
Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS);
Portals[i][2] = CENTER_Z;
}
else
{
Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS);
Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS);
Portals[i][2] = PORTAL_Z;
}
}
if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7))
{
int i=1;
if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
i = -1;
Portals[2][0] = Portals[2][0]+7*i;
Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS);
}
for (int i=0; i <= 2; ++i)
{
if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
}
}
AppearDelay = true;
} else Phase1_Timer-=diff;
}
else if (Phase == 2)
{
//10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
me->AttackStop();
me->StopMoving();
if (Phase2_Timer <= diff)
{
Phase = 3;
for (int i=0; i <= 2; ++i)
for (int j=1; j <= 4; j++)
SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
DoScriptText(SAY_SUMMON1, me);
Phase2_Timer = 10000;
} else Phase2_Timer -= diff;
}
else if (Phase == 3)
{
me->AttackStop();
me->StopMoving();
//Check Phase3_Timer
if (Phase3_Timer <= diff)
{
Phase3_Timer = 15000;
AppearDelay_Timer = 2000;
BlindingLight = false;
AppearDelay = false;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
Phase = 1;
Wrath_Timer = 20000+rand()%5000;//twice in phase one
//15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
int i = rand()%3;
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
for (int j=0; j <= 2; j++)
if (j != i)
SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED);
me->SetArmor(defaultarmor);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_ON);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
me->SetDisplayId(MODEL_HUMAN);
DoScriptText(SAY_SUMMON2, me);
AppearDelay = true;
Phase3_Timer = 15000;
} else Phase3_Timer -= diff;
}
else if (Phase == 4)
{
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast(me, SPELL_FEAR);
Fear_Timer = 20000;
} else Fear_Timer -= diff;
//VoidBolt_Timer
if (VoidBolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_VOID_BOLT);
VoidBolt_Timer = 10000;
} else VoidBolt_Timer -= diff;
}
//When Solarian reaches 20% she will transform into a huge void walker.
if (Phase != 4 && ((me->GetHealth()*100 / me->GetMaxHealth())<20))
{
Phase = 4;
//To make sure she wont be invisible or not selecatble
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_ON);
DoScriptText(SAY_VOIDA, me);
DoScriptText(SAY_VOIDB, me);
me->SetArmor(WV_ARMOR);
me->SetDisplayId(MODEL_VOIDWALKER);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
}
DoMeleeAttackIfReady();
}
};
struct mob_solarium_priestAI : public ScriptedAI
{
mob_solarium_priestAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
ScriptedInstance *pInstance;
uint32 healTimer;
uint32 holysmiteTimer;
uint32 aoesilenceTimer;
void Reset()
{
healTimer = 9000;
holysmiteTimer = 1;
aoesilenceTimer = 15000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (healTimer <= diff)
{
Unit *pTarget = NULL;
switch (urand(0,1))
{
case 0:
if (pInstance)
pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER));
break;
case 1:
pTarget = me;
break;
Summons.DespawnAll();
}
if (pTarget)
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2,SAY_KILL3), me);
}
void JustDied(Unit * /*victim*/)
{
me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize);
me->SetDisplayId(MODEL_HUMAN);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS);
}
void SummonMinion(uint32 entry, float x, float y, float z)
{
Creature* Summoned = me->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
if (Summoned)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
Summoned->AI()->AttackStart(pTarget);
Summons.Summon(Summoned);
}
}
float Portal_X(float radius)
{
if (urand(0,1))
radius = -radius;
return radius * (float)(rand()%100)/100.0f + CENTER_X;
}
float Portal_Y(float x, float radius)
{
float z = RAND(1, -1);
return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (AppearDelay)
{
me->StopMoving();
me->AttackStop();
if (AppearDelay_Timer <= diff)
{
AppearDelay = false;
if (Phase == 2)
{
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_OFF);
}
AppearDelay_Timer = 2000;
}
else
AppearDelay_Timer -= diff;
}
if (Phase == 1)
{
if (BlindingLight_Timer <= diff)
{
BlindingLight = true;
BlindingLight_Timer = 45000;
}
else
BlindingLight_Timer -= diff;
if (Wrath_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER, true);
Wrath_Timer = 20000+rand()%5000;
}
else
Wrath_Timer -= diff;
if (ArcaneMissiles_Timer <= diff)
{
if (BlindingLight)
{
DoCast(me->getVictim(), SPELL_BLINDING_LIGHT);
BlindingLight = false;
}
else
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!me->HasInArc(2.5f, pTarget))
pTarget = me->getVictim();
if (pTarget)
DoCast(pTarget, SPELL_ARCANE_MISSILES);
}
ArcaneMissiles_Timer = 3000;
}
else
ArcaneMissiles_Timer -= diff;
if (m_uiWrathOfTheAstromancer_Timer <= diff)
{
me->InterruptNonMeleeSpells(false);
//Target the tank ?
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1))
{
if (pTarget->GetTypeId() == TYPEID_PLAYER)
{
DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER);
m_uiWrathOfTheAstromancer_Timer = 25000;
}
else
m_uiWrathOfTheAstromancer_Timer = 1000;
}
}
else
m_uiWrathOfTheAstromancer_Timer -= diff;
//Phase1_Timer
if (Phase1_Timer <= diff)
{
Phase = 2;
Phase1_Timer = 50000;
//After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind.
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O);
for (uint8 i=0; i <= 2; ++i)
{
if (!i)
{
Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS);
Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS);
Portals[i][2] = CENTER_Z;
}
else
{
Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS);
Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS);
Portals[i][2] = PORTAL_Z;
}
}
if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7))
{
int i=1;
if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7)
i = -1;
Portals[2][0] = Portals[2][0]+7*i;
Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS);
}
for (int i=0; i <= 2; ++i)
{
if (Creature* Summoned = me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700))
{
Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false);
}
}
AppearDelay = true;
}
else
Phase1_Timer-=diff;
}
else
if (Phase == 2)
{
//10 seconds after Solarian disappears, 12 mobs spawn out of the three portals.
me->AttackStop();
me->StopMoving();
if (Phase2_Timer <= diff)
{
Phase = 3;
for (int i=0; i <= 2; ++i)
for (int j=1; j <= 4; j++)
SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]);
DoScriptText(SAY_SUMMON1, me);
Phase2_Timer = 10000;
}
else
Phase2_Timer -= diff;
}
else
if (Phase == 3)
{
me->AttackStop();
me->StopMoving();
//Check Phase3_Timer
if (Phase3_Timer <= diff)
{
Phase = 1;
//15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals.
int i = rand()%3;
me->GetMotionMaster()->Clear();
me->GetMap()->CreatureRelocation(me, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O);
for (int j=0; j <= 2; j++)
if (j != i)
SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_ON);
DoScriptText(SAY_SUMMON2, me);
AppearDelay = true;
Phase3_Timer = 15000;
}
else
Phase3_Timer -= diff;
}
else
if (Phase == 4)
{
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast(me, SPELL_FEAR);
Fear_Timer = 20000;
}
else
Fear_Timer -= diff;
//VoidBolt_Timer
if (VoidBolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_VOID_BOLT);
VoidBolt_Timer = 10000;
}
else
VoidBolt_Timer -= diff;
}
//When Solarian reaches 20% she will transform into a huge void walker.
if (Phase != 4 && ((me->GetHealth()*100 / me->GetMaxHealth())<20))
{
Phase = 4;
//To make sure she wont be invisible or not selecatble
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_ON);
DoScriptText(SAY_VOIDA, me);
DoScriptText(SAY_VOIDB, me);
me->SetArmor(WV_ARMOR);
me->SetDisplayId(MODEL_VOIDWALKER);
me->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f);
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new boss_high_astromancer_solarianAI (creature);
}
};
class mob_solarium_priest : public CreatureScript
{
public:
mob_solarium_priest()
: CreatureScript("mob_solarium_priest")
{
}
struct mob_solarium_priestAI : public ScriptedAI
{
mob_solarium_priestAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = pCreature->GetInstanceData();
}
ScriptedInstance *pInstance;
uint32 healTimer;
uint32 holysmiteTimer;
uint32 aoesilenceTimer;
void Reset()
{
DoCast(pTarget, SPELL_SOLARIUM_GREAT_HEAL);
healTimer = 9000;
holysmiteTimer = 1;
aoesilenceTimer = 15000;
}
} else healTimer -= diff;
if (holysmiteTimer <= diff)
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (healTimer <= diff)
{
Unit *pTarget = NULL;
switch (urand(0,1))
{
case 0:
if (pInstance)
pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_ASTROMANCER));
break;
case 1:
pTarget = me;
break;
}
if (pTarget)
{
DoCast(pTarget, SPELL_SOLARIUM_GREAT_HEAL);
healTimer = 9000;
}
}
else
healTimer -= diff;
if (holysmiteTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SOLARIUM_HOLY_SMITE);
holysmiteTimer = 4000;
}
else
holysmiteTimer -= diff;
if (aoesilenceTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT);
aoesilenceTimer = 13000;
}
else
aoesilenceTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* Creature)
{
DoCast(me->getVictim(), SPELL_SOLARIUM_HOLY_SMITE);
holysmiteTimer = 4000;
} else holysmiteTimer -= diff;
if (aoesilenceTimer <= diff)
{
DoCast(me->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT);
aoesilenceTimer = 13000;
} else aoesilenceTimer -= diff;
DoMeleeAttackIfReady();
}
return new mob_solarium_priestAI (Creature);
}
};
CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature)
{
return new mob_solarium_priestAI (pCreature);
}
CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature)
{
return new boss_high_astromancer_solarianAI (pCreature);
}
void AddSC_boss_high_astromancer_solarian()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_high_astromancer_solarian";
newscript->GetAI = &GetAI_boss_high_astromancer_solarian;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_solarium_priest";
newscript->GetAI = &GetAI_mob_solarium_priest;
newscript->RegisterSelf();
new boss_high_astromancer_solarian();
new mob_solarium_priest();
}
File diff suppressed because it is too large Load Diff
@@ -42,140 +42,144 @@ enum eEnums
SPELL_BERSERK = 27680
};
struct boss_void_reaverAI : public ScriptedAI
class boss_void_reaver : public CreatureScript
{
boss_void_reaverAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
public:
ScriptedInstance* pInstance;
uint32 Pounding_Timer;
uint32 ArcaneOrb_Timer;
uint32 KnockAway_Timer;
uint32 Berserk_Timer;
bool Enraged;
void Reset()
{
Pounding_Timer = 15000;
ArcaneOrb_Timer = 3000;
KnockAway_Timer = 30000;
Berserk_Timer = 600000;
Enraged = false;
if (pInstance && me->isAlive())
pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_VOIDREAVEREVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
// Pounding
if (Pounding_Timer <= diff)
boss_void_reaver()
: CreatureScript("boss_void_reaver")
{
DoCast(me->getVictim(), SPELL_POUNDING);
DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), me);
Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000)
} else Pounding_Timer -= diff;
// Arcane Orb
if (ArcaneOrb_Timer <= diff)
}
struct boss_void_reaverAI : public ScriptedAI
{
Unit *pTarget = NULL;
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
boss_void_reaverAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (!pTarget)
continue;
// exclude pets & totems
if (pTarget->GetTypeId() != TYPEID_PLAYER)
continue;
//18 yard radius minimum
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(me, 18, false))
target_list.push_back(pTarget);
pTarget = NULL;
pInstance = pCreature->GetInstanceData();
}
if (target_list.size())
pTarget = *(target_list.begin()+rand()%target_list.size());
else
pTarget = me->getVictim();
ScriptedInstance* pInstance;
if (pTarget)
me->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget);
uint32 Pounding_Timer;
uint32 ArcaneOrb_Timer;
uint32 KnockAway_Timer;
uint32 Berserk_Timer;
ArcaneOrb_Timer = 3000;
} else ArcaneOrb_Timer -= diff;
bool Enraged;
// Single Target knock back, reduces aggro
if (KnockAway_Timer <= diff)
void Reset()
{
Pounding_Timer = 15000;
ArcaneOrb_Timer = 3000;
KnockAway_Timer = 30000;
Berserk_Timer = 600000;
Enraged = false;
if (pInstance && me->isAlive())
pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED);
}
void KilledUnit(Unit * /*victim*/)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit * /*victim*/)
{
DoScriptText(SAY_DEATH, me);
DoZoneInCombat();
if (pInstance)
pInstance->SetData(DATA_VOIDREAVEREVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
// Pounding
if (Pounding_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_POUNDING);
DoScriptText(RAND(SAY_POUNDING1,SAY_POUNDING2), me);
Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000)
}
else
Pounding_Timer -= diff;
// Arcane Orb
if (ArcaneOrb_Timer <= diff)
{
Unit *pTarget = NULL;
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> target_list;
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (!pTarget)
continue;
// exclude pets & totems
if (pTarget->GetTypeId() != TYPEID_PLAYER)
continue;
//18 yard radius minimum
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive() && !pTarget->IsWithinDist(me, 18, false))
target_list.push_back(pTarget);
pTarget = NULL;
}
if (target_list.size())
pTarget = *(target_list.begin()+rand()%target_list.size());
else
pTarget = me->getVictim();
if (pTarget)
me->CastSpell(pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, pTarget);
ArcaneOrb_Timer = 3000;
}
else
ArcaneOrb_Timer -= diff;
// Single Target knock back, reduces aggro
if (KnockAway_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_KNOCK_AWAY);
//Drop 25% aggro
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-25);
KnockAway_Timer = 30000;
}
else
KnockAway_Timer -= diff;
//Berserk
if (Berserk_Timer < diff && !Enraged)
{
DoCast(me, SPELL_BERSERK);
Enraged = true;
}
else
Berserk_Timer -= diff;
DoMeleeAttackIfReady();
EnterEvadeIfOutOfCombatArea(diff);
}
};
CreatureAI* GetAI(Creature* creature) const
{
DoCast(me->getVictim(), SPELL_KNOCK_AWAY);
//Drop 25% aggro
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-25);
KnockAway_Timer = 30000;
} else KnockAway_Timer -= diff;
//Berserk
if (Berserk_Timer < diff && !Enraged)
{
DoCast(me, SPELL_BERSERK);
Enraged = true;
} else Berserk_Timer -= diff;
DoMeleeAttackIfReady();
EnterEvadeIfOutOfCombatArea(diff);
}
return new boss_void_reaverAI(creature);
}
};
CreatureAI* GetAI_boss_void_reaver(Creature* pCreature)
{
return new boss_void_reaverAI (pCreature);
}
void AddSC_boss_void_reaver()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_void_reaver";
newscript->GetAI = &GetAI_boss_void_reaver;
newscript->RegisterSelf();
new boss_void_reaver();
}
@@ -35,144 +35,172 @@ EndScriptData */
3 - Void Reaver event
*/
struct instance_the_eye : public ScriptedInstance
class instance_mechanar : public InstanceMapScript
{
instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
uint64 ThaladredTheDarkener;
uint64 LordSanguinar;
uint64 GrandAstromancerCapernian;
uint64 MasterEngineerTelonicus;
uint64 Kaelthas;
uint64 Astromancer;
uint64 Alar;
uint8 KaelthasEventPhase;
uint8 AlarEventPhase;
uint32 m_auiEncounter[MAX_ENCOUNTER];
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
ThaladredTheDarkener = 0;
LordSanguinar = 0;
GrandAstromancerCapernian = 0;
MasterEngineerTelonicus = 0;
Kaelthas = 0;
Astromancer = 0;
Alar = 0;
KaelthasEventPhase = 0;
AlarEventPhase = 0;
}
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
public:
instance_mechanar()
: InstanceMapScript("instance_mechanar")
{
case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break;
case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break;
case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break;
case 20060: LordSanguinar = pCreature->GetGUID(); break;
case 19622: Kaelthas = pCreature->GetGUID(); break;
case 18805: Astromancer = pCreature->GetGUID(); break;
case 19514: Alar = pCreature->GetGUID(); break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
struct instance_the_eye_InstanceMapScript : public ScriptedInstance
{
case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener;
case DATA_LORDSANGUINAR: return LordSanguinar;
case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian;
case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus;
case DATA_KAELTHAS: return Kaelthas;
case DATA_ASTROMANCER: return Astromancer;
case DATA_ALAR: return Alar;
}
return 0;
}
instance_the_eye_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break;
case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break;
case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break;
case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break;
}
if (data == DONE)
SaveToDB();
}
uint64 ThaladredTheDarkener;
uint64 LordSanguinar;
uint64 GrandAstromancerCapernian;
uint64 MasterEngineerTelonicus;
uint64 Kaelthas;
uint64 Astromancer;
uint64 Alar;
uint8 KaelthasEventPhase;
uint8 AlarEventPhase;
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ALAREVENT: return AlarEventPhase;
case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1];
case DATA_VOIDREAVEREVENT: return m_auiEncounter[2];
case DATA_KAELTHASEVENT: return KaelthasEventPhase;
}
return 0;
}
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)
{
OUT_SAVE_INST_DATA_COMPLETE;
return out;
}
return NULL;
}
void Initialize()
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
void Load(const char* in)
{
if (!in)
ThaladredTheDarkener = 0;
LordSanguinar = 0;
GrandAstromancerCapernian = 0;
MasterEngineerTelonicus = 0;
Kaelthas = 0;
Astromancer = 0;
Alar = 0;
KaelthasEventPhase = 0;
AlarEventPhase = 0;
}
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) return true;
return false;
}
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
{
switch(pCreature->GetEntry())
{
case 20064:
ThaladredTheDarkener = pCreature->GetGUID();
break;
case 20063:
MasterEngineerTelonicus = pCreature->GetGUID();
break;
case 20062:
GrandAstromancerCapernian = pCreature->GetGUID();
break;
case 20060:
LordSanguinar = pCreature->GetGUID();
break;
case 19622:
Kaelthas = pCreature->GetGUID();
break;
case 18805:
Astromancer = pCreature->GetGUID();
break;
case 19514:
Alar = pCreature->GetGUID();
break;
}
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener;
case DATA_LORDSANGUINAR: return LordSanguinar;
case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian;
case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus;
case DATA_KAELTHAS: return Kaelthas;
case DATA_ASTROMANCER: return Astromancer;
case DATA_ALAR: return Alar;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_ALAREVENT:
AlarEventPhase = data;
m_auiEncounter[0] = data;
break;
case DATA_HIGHASTROMANCERSOLARIANEVENT:
m_auiEncounter[1] = data;
break;
case DATA_VOIDREAVEREVENT:
m_auiEncounter[2] = data;
break;
case DATA_KAELTHASEVENT:
KaelthasEventPhase = data;
m_auiEncounter[3] = data;
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ALAREVENT: return AlarEventPhase;
case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1];
case DATA_VOIDREAVEREVENT: return m_auiEncounter[2];
case DATA_KAELTHASEVENT: return KaelthasEventPhase;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)
{
OUT_SAVE_INST_DATA_COMPLETE;
return out;
}
return NULL;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream stream(in);
stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
m_auiEncounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData(InstanceMap* pMap) const
{
OUT_LOAD_INST_DATA_FAIL;
return;
return new instance_the_eye_InstanceMapScript(pMap);
}
OUT_LOAD_INST_DATA(in);
std::istringstream stream(in);
stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3];
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead.
m_auiEncounter[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_the_eye(Map* pMap)
{
return new instance_the_eye(pMap);
}
void AddSC_instance_the_eye()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_the_eye";
newscript->GetInstanceData = &GetInstanceData_instance_the_eye;
newscript->RegisterSelf();
new instance_mechanar;
}
@@ -30,71 +30,82 @@ EndContentData */
#include "ScriptPCH.h"
#include "the_eye.h"
#define SPELL_COUNTERCHARGE 35035
#define SPELL_KNOCKAWAY 22893
struct mob_crystalcore_devastatorAI : public ScriptedAI
enum eSpells
{
mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {}
uint32 Knockaway_Timer;
uint32 Countercharge_Timer;
void Reset()
{
Countercharge_Timer = 9000;
Knockaway_Timer = 25000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Check if we have a current target
//Knockaway_Timer
if (Knockaway_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
// current aggro target is knocked away pick new target
Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
if (!pTarget || pTarget == me->getVictim())
pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
if (pTarget)
me->TauntApply(pTarget);
Knockaway_Timer = 23000;
} else Knockaway_Timer -= diff;
//Countercharge_Timer
if (Countercharge_Timer <= diff)
{
DoCast(me, SPELL_COUNTERCHARGE);
Countercharge_Timer = 45000;
} else Countercharge_Timer -= diff;
DoMeleeAttackIfReady();
}
SPELL_COUNTERCHARGE = 35035,
SPELL_KNOCKAWAY = 22893,
};
CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature)
class mob_crystalcore_devastator : public CreatureScript
{
return new mob_crystalcore_devastatorAI (pCreature);
}
public:
mob_crystalcore_devastator()
: CreatureScript("mob_crystalcore_devastator")
{
}
struct mob_crystalcore_devastatorAI : public ScriptedAI
{
mob_crystalcore_devastatorAI(Creature* pCreature) : ScriptedAI(pCreature) {}
uint32 Knockaway_Timer;
uint32 Countercharge_Timer;
void Reset()
{
Countercharge_Timer = 9000;
Knockaway_Timer = 25000;
}
void EnterCombat(Unit * /*who*/)
{
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
//Check if we have a current target
//Knockaway_Timer
if (Knockaway_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_KNOCKAWAY, true);
// current aggro target is knocked away pick new target
Unit* pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0);
if (!pTarget || pTarget == me->getVictim())
pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 1);
if (pTarget)
me->TauntApply(pTarget);
Knockaway_Timer = 23000;
}
else
Knockaway_Timer -= diff;
//Countercharge_Timer
if (Countercharge_Timer <= diff)
{
DoCast(me, SPELL_COUNTERCHARGE);
Countercharge_Timer = 45000;
}
else
Countercharge_Timer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new mob_crystalcore_devastatorAI(creature);
}
};
void AddSC_the_eye()
{
Script *newscript;
newscript = new Script;
newscript->Name = "mob_crystalcore_devastator";
newscript->GetAI = &GetAI_mob_crystalcore_devastator;
newscript->RegisterSelf();
new mob_crystalcore_devastator();
}