*code cleanup

*totally destroyed m_creature, use "me" for future coding

--HG--
branch : trunk
This commit is contained in:
Rat
2010-04-14 23:07:41 +02:00
parent cc262e1cde
commit 6bcb297de4
403 changed files with 9851 additions and 9852 deletions
@@ -82,31 +82,31 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
{
if (!bHasAura)
{
switch(m_creature->GetEntry())
switch(me->GetEntry())
{
case NPC_NORTH_MARSHAL:
DoCast(m_creature,SPELL_NORTH_MARSHAL);
DoCast(me,SPELL_NORTH_MARSHAL);
break;
case NPC_SOUTH_MARSHAL:
DoCast(m_creature,SPELL_SOUTH_MARSHAL);
DoCast(me,SPELL_SOUTH_MARSHAL);
break;
case NPC_STONEHEARTH_MARSHAL:
DoCast(m_creature,SPELL_STONEHEARTH_MARSHAL);
DoCast(me,SPELL_STONEHEARTH_MARSHAL);
break;
case NPC_ICEWING_MARSHAL:
DoCast(m_creature,SPELL_ICEWING_MARSHAL);
DoCast(me,SPELL_ICEWING_MARSHAL);
break;
case NPC_EAST_FROSTWOLF_WARMASTER:
DoCast(m_creature,SPELL_EAST_FROSTWOLF_WARMASTER);
DoCast(me,SPELL_EAST_FROSTWOLF_WARMASTER);
break;
case NPC_WEST_FROSTWOLF_WARMASTER:
DoCast(m_creature,SPELL_WEST_FROSTWOLF_WARMASTER);
DoCast(me,SPELL_WEST_FROSTWOLF_WARMASTER);
break;
case NPC_ICEBLOOD_WARMASTER:
DoCast(m_creature,SPELL_ICEBLOOD_WARMASTER);
DoCast(me,SPELL_ICEBLOOD_WARMASTER);
break;
case NPC_TOWER_POINT_WARMASTER:
DoCast(m_creature,SPELL_TOWER_POINT_WARMASTER);
DoCast(me,SPELL_TOWER_POINT_WARMASTER);
break;
}
@@ -118,37 +118,37 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
if (uiChargeTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CHARGE);
DoCast(me->getVictim(), SPELL_CHARGE);
uiChargeTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiChargeTimer -= diff;
if (uiCleaveTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS);
} else uiCleaveTimer -= diff;
if (uiDemoralizingShoutTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DEMORALIZING_SHOUT);
DoCast(me->getVictim(), SPELL_DEMORALIZING_SHOUT);
uiDemoralizingShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiDemoralizingShoutTimer -= diff;
if (uiWhirlwind1Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1);
DoCast(me->getVictim(), SPELL_WHIRLWIND1);
uiWhirlwind1Timer = urand(6*IN_MILISECONDS,20*IN_MILISECONDS);
} else uiWhirlwind1Timer -= diff;
if (uiWhirlwind2Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiWhirlwind2Timer -= diff;
if (uiEnrageTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ENRAGE);
DoCast(me->getVictim(), SPELL_ENRAGE);
uiEnrageTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS);
}else uiEnrageTimer -= diff;
@@ -156,7 +156,7 @@ struct mob_av_marshal_or_warmasterAI : public ScriptedAI
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -61,15 +61,15 @@ struct mob_water_elementalAI : public ScriptedAI
if (uiWaterBoltTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
DoCast(me->getVictim(), SPELL_WATERBOLT);
uiWaterBoltTimer = 5*IN_MILISECONDS;
} else uiWaterBoltTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer < diff)
{
if (Creature *pBalinda = Unit::GetCreature(*m_creature, uiBalindaGUID))
if (m_creature->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID))
if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -80,7 +80,7 @@ struct mob_water_elementalAI : public ScriptedAI
struct boss_balindaAI : public ScriptedAI
{
boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(m_creature) {}
boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(me) {}
uint32 uiArcaneExplosionTimer;
uint32 uiConeOfColdTimer;
@@ -105,7 +105,7 @@ struct boss_balindaAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(YELL_AGGRO, m_creature);
DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
@@ -115,9 +115,9 @@ struct boss_balindaAI : public ScriptedAI
void JustSummoned(Creature* summoned)
{
((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = m_creature->GetGUID();
((mob_water_elementalAI*)summoned->AI())->uiBalindaGUID = me->GetGUID();
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true));
summoned->setFaction(m_creature->getFaction());
summoned->setFaction(me->getFaction());
Summons.Summon(summoned);
}
@@ -134,31 +134,31 @@ struct boss_balindaAI : public ScriptedAI
if (uiWaterElementalTimer < diff)
{
if (Summons.empty())
m_creature->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS);
me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILISECONDS);
uiWaterElementalTimer = 50*IN_MILISECONDS;
} else uiWaterElementalTimer -= diff;
if (uiArcaneExplosionTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
uiArcaneExplosionTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiArcaneExplosionTimer -= diff;
if (uiConeOfColdTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD);
DoCast(me->getVictim(), SPELL_CONE_OF_COLD);
uiConeOfColdTimer = urand(10*IN_MILISECONDS,20*IN_MILISECONDS);
} else uiConeOfColdTimer -= diff;
if (uiFireBoltTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBALL);
DoCast(me->getVictim(), SPELL_FIREBALL);
uiFireBoltTimer = urand(5*IN_MILISECONDS,9*IN_MILISECONDS);
} else uiFireBoltTimer -= diff;
if (uiFrostboltTimer < diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
DoCast(me->getVictim(), SPELL_FROSTBOLT);
uiFrostboltTimer = urand(4*IN_MILISECONDS,12*IN_MILISECONDS);
} else uiFrostboltTimer -= diff;
@@ -166,10 +166,10 @@ struct boss_balindaAI : public ScriptedAI
// check if creature is not outside of building
if (uiResetTimer < diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, m_creature);
DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -63,13 +63,13 @@ struct boss_drektharAI : public ScriptedAI
void Aggro(Unit *who)
{
DoScriptText(YELL_AGGRO, m_creature);
DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
{
Reset();
DoScriptText(YELL_RESPAWN, m_creature);
DoScriptText(YELL_RESPAWN, me);
}
void UpdateAI(const uint32 diff)
@@ -79,41 +79,41 @@ struct boss_drektharAI : public ScriptedAI
if (uiWhirlwindTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
DoCast(me->getVictim(), SPELL_WHIRLWIND);
uiWhirlwindTimer = urand(8*IN_MILISECONDS,18*IN_MILISECONDS);
} else uiWhirlwindTimer -= diff;
if (uiWhirlwind2Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
uiWhirlwind2Timer = urand(7*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiWhirlwind2Timer -= diff;
if (uiKnockdownTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
uiKnockdownTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiKnockdownTimer -= diff;
if (uiFrenzyTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FRENZY);
DoCast(me->getVictim(), SPELL_FRENZY);
uiFrenzyTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiFrenzyTimer -= diff;
if (uiYellTimer <= diff)
{
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), m_creature);
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me);
uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
} else uiYellTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, m_creature);
DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -56,7 +56,7 @@ struct boss_galvangarAI : public ScriptedAI
void Aggro(Unit *who)
{
DoScriptText(YELL_AGGRO, m_creature);
DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
@@ -71,41 +71,41 @@ struct boss_galvangarAI : public ScriptedAI
if (uiCleaveTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
uiCleaveTimer = urand(10*IN_MILISECONDS,16*IN_MILISECONDS);
} else uiCleaveTimer -= diff;
if (uiFrighteningShoutTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
uiFrighteningShoutTimer = urand(10*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiFrighteningShoutTimer -= diff;
if (uiWhirlwind1Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND1);
DoCast(me->getVictim(), SPELL_WHIRLWIND1);
uiWhirlwind1Timer = urand(6*IN_MILISECONDS,10*IN_MILISECONDS);
} else uiWhirlwind1Timer -= diff;
if (uiWhirlwind2Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND2);
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
uiWhirlwind2Timer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiWhirlwind2Timer -= diff;
if (uiMortalStrikeTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
uiMortalStrikeTimer = urand(10*IN_MILISECONDS,30*IN_MILISECONDS);
} else uiMortalStrikeTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, m_creature);
DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -61,13 +61,13 @@ struct boss_vanndarAI : public ScriptedAI
void Aggro(Unit *who)
{
DoScriptText(YELL_AGGRO, m_creature);
DoScriptText(YELL_AGGRO, me);
}
void JustRespawned()
{
Reset();
DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), m_creature);
DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), me);
}
void UpdateAI(const uint32 diff)
@@ -77,35 +77,35 @@ struct boss_vanndarAI : public ScriptedAI
if (uiAvatarTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_AVATAR);
DoCast(me->getVictim(), SPELL_AVATAR);
uiAvatarTimer = urand(15*IN_MILISECONDS,20*IN_MILISECONDS);
} else uiAvatarTimer -= diff;
if (uiThunderclapTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
uiThunderclapTimer = urand(5*IN_MILISECONDS,15*IN_MILISECONDS);
} else uiThunderclapTimer -= diff;
if (uiStormboltTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_STORMBOLT);
DoCast(me->getVictim(), SPELL_STORMBOLT);
uiStormboltTimer = urand(10*IN_MILISECONDS,25*IN_MILISECONDS);
} else uiStormboltTimer -= diff;
if (uiYellTimer <= diff)
{
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), m_creature);
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me);
uiYellTimer = urand(20*IN_MILISECONDS,30*IN_MILISECONDS); //20 to 30 seconds
} else uiYellTimer -= diff;
// check if creature is not outside of building
if (uiResetTimer <= diff)
{
if (m_creature->GetDistance2d(m_creature->GetHomePosition().GetPositionX(), m_creature->GetHomePosition().GetPositionY()) > 50)
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
{
EnterEvadeMode();
DoScriptText(YELL_EVADE, m_creature);
DoScriptText(YELL_EVADE, me);
}
uiResetTimer = 5*IN_MILISECONDS;
} else uiResetTimer -= diff;
@@ -62,38 +62,38 @@ struct npc_professor_phizzlethorpeAI : public npc_escortAI
switch(uiPointId)
{
case 4:DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer);break;
case 5:DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break;
case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break;
case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break;
case 8:DoScriptText(EMOTE_PROGRESS_4, me);break;
case 9:
{
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
break;
}
case 10:DoScriptText(SAY_PROGRESS_5, m_creature, pPlayer);break;
case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break;
case 11:
DoScriptText(SAY_PROGRESS_6, m_creature, pPlayer);
DoScriptText(SAY_PROGRESS_6, me, pPlayer);
SetRun();
break;
case 19:DoScriptText(SAY_PROGRESS_7, m_creature, pPlayer); break;
case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break;
case 20:
DoScriptText(EMOTE_PROGRESS_8, m_creature);
DoScriptText(SAY_PROGRESS_9, m_creature, pPlayer);
DoScriptText(EMOTE_PROGRESS_8, me);
DoScriptText(SAY_PROGRESS_9, me, pPlayer);
if (pPlayer)
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature);
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->AI()->AttackStart(m_creature);
pSummoned->AI()->AttackStart(me);
}
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -148,7 +148,7 @@ struct npc_grimstoneAI : public npc_escortAI
void Reset()
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
EventPhase = 0;
Event_Timer = 1000;
@@ -167,7 +167,7 @@ struct npc_grimstoneAI : public npc_escortAI
//TODO: move them to center
void SummonRingMob()
{
if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0))
if (Creature* tmp = me->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0))
RingMobGUID[MobCount] = tmp->GetGUID();
++MobCount;
@@ -179,7 +179,7 @@ struct npc_grimstoneAI : public npc_escortAI
//TODO: move them to center
void SummonRingBoss()
{
if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0))
if (Creature* tmp = me->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0))
RingBossGUID = tmp->GetGUID();
MobDeath_Timer = 2500;
@@ -190,12 +190,12 @@ struct npc_grimstoneAI : public npc_escortAI
switch(i)
{
case 0:
DoScriptText(SCRIPT_TEXT1, m_creature);//2
DoScriptText(SCRIPT_TEXT1, me);//2
CanWalk = false;
Event_Timer = 5000;
break;
case 1:
DoScriptText(SCRIPT_TEXT2, m_creature);//4
DoScriptText(SCRIPT_TEXT2, me);//4
CanWalk = false;
Event_Timer = 5000;
break;
@@ -203,10 +203,10 @@ struct npc_grimstoneAI : public npc_escortAI
CanWalk = false;
break;
case 3:
DoScriptText(SCRIPT_TEXT3, m_creature);//5
DoScriptText(SCRIPT_TEXT3, me);//5
break;
case 4:
DoScriptText(SCRIPT_TEXT4, m_creature);//6
DoScriptText(SCRIPT_TEXT4, me);//6
CanWalk = false;
Event_Timer = 5000;
break;
@@ -238,7 +238,7 @@ struct npc_grimstoneAI : public npc_escortAI
if (RingBossGUID)
{
Creature *boss = Unit::GetCreature(*m_creature,RingBossGUID);
Creature *boss = Unit::GetCreature(*me,RingBossGUID);
if (boss && !boss->isAlive() && boss->isDead())
{
RingBossGUID = 0;
@@ -251,7 +251,7 @@ struct npc_grimstoneAI : public npc_escortAI
for (uint8 i = 0; i < MAX_MOB_AMOUNT; ++i)
{
Creature *mob = Unit::GetCreature(*m_creature,RingMobGUID[i]);
Creature *mob = Unit::GetCreature(*me,RingMobGUID[i]);
if (mob && !mob->isAlive() && mob->isDead())
{
RingMobGUID[i] = 0;
@@ -275,7 +275,7 @@ struct npc_grimstoneAI : public npc_escortAI
switch(EventPhase)
{
case 0:
DoScriptText(SCRIPT_TEXT5, m_creature);//1
DoScriptText(SCRIPT_TEXT5, me);//1
HandleGameObject(DATA_ARENA4, false);
Start(false, false);
CanWalk = true;
@@ -294,7 +294,7 @@ struct npc_grimstoneAI : public npc_escortAI
break;
case 4:
CanWalk = true;
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
SummonRingMob();
Event_Timer = 8000;
break;
@@ -308,9 +308,9 @@ struct npc_grimstoneAI : public npc_escortAI
Event_Timer = 0;
break;
case 7:
m_creature->SetVisibility(VISIBILITY_ON);
me->SetVisibility(VISIBILITY_ON);
HandleGameObject(DATA_ARENA1, false);
DoScriptText(SCRIPT_TEXT6, m_creature);//4
DoScriptText(SCRIPT_TEXT6, me);//4
CanWalk = true;
Event_Timer = 0;
break;
@@ -319,7 +319,7 @@ struct npc_grimstoneAI : public npc_escortAI
Event_Timer = 5000;
break;
case 9:
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
SummonRingBoss();
Event_Timer = 0;
break;
@@ -381,16 +381,16 @@ struct mob_phalanxAI : public ScriptedAI
//ThunderClap_Timer
if (ThunderClap_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
ThunderClap_Timer = 10000;
} else ThunderClap_Timer -= diff;
//FireballVolley_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
if (FireballVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBALLVOLLEY);
DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
FireballVolley_Timer = 15000;
} else FireballVolley_Timer -= diff;
}
@@ -398,7 +398,7 @@ struct mob_phalanxAI : public ScriptedAI
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 10000;
} else MightyBlow_Timer -= diff;
@@ -579,12 +579,12 @@ struct npc_dughal_stormwingAI : public npc_escortAI
{
switch(i)
{
case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 0:me->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
case 2:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
break;
}
@@ -595,11 +595,11 @@ struct npc_dughal_stormwingAI : public npc_escortAI
void JustDied(Unit* killer)
{
if (IsBeingEscorted && killer == m_creature)
if (IsBeingEscorted && killer == me)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
}
}
@@ -609,15 +609,15 @@ struct npc_dughal_stormwingAI : public npc_escortAI
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
@@ -683,41 +683,41 @@ struct npc_marshal_windsorAI : public npc_escortAI
switch(i)
{
case 1:
m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 7:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID);
me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 10:
m_creature->setFaction(534);
me->setFaction(534);
break;
case 12:
m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS);
break;
case 13:
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break;
case 14:
pInstance->SetData(DATA_GATE_SR,0);
m_creature->setFaction(11);
me->setFaction(11);
break;
case 16:
m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
break;
case 17:
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
me->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK
break;
case 18:
pInstance->SetData(DATA_GATE_SC,0);
break;
case 19:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0);
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED);
break;
}
@@ -727,9 +727,9 @@ struct npc_marshal_windsorAI : public npc_escortAI
{
switch (urand(0,2))
{
case 0: m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
case 1: m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
case 2: m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
}
}
@@ -747,25 +747,25 @@ struct npc_marshal_windsorAI : public npc_escortAI
SetEscortPaused(false);
if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED)
{
m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
}
if (pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
{
m_creature->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
}
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
@@ -848,53 +848,53 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
switch(i)
{
case 0:
m_creature->setFaction(11);
m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
me->setFaction(11);
me->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 1:
m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 7:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID);
me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 8:
m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 11:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID);
me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 12:
m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 13:
m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID);
break;
case 20:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID);
me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 21:
m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID);
break;
case 23:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID);
me->HandleEmoteCommand(EMOTE_STATE_POINT);
me->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 24:
m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 31:
m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 32:
m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, m_creature);
me->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, me);
pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED);
break;
}
@@ -910,7 +910,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0;
if (m_creature->IsWithinDistInMap(who, Radius))
if (me->IsWithinDistInMap(who, Radius))
{
SetEscortPaused(false);
Start(true, false, who->GetGUID());
@@ -923,9 +923,9 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
{
switch (urand(0,2))
{
case 0: m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
case 1: m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
case 2: m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
case 0: me->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break;
case 1: me->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break;
case 2: me->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break;
}
}
void Reset() {}
@@ -969,7 +969,7 @@ struct npc_marshal_reginald_windsorAI : public npc_escortAI
if (!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
{
pInstance->SetData(DATA_CREATURE_CREST,1);
m_creature->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
me->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS);
}
if (pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS)
@@ -1040,11 +1040,11 @@ struct npc_tobias_seecherAI : public npc_escortAI
void JustDied(Unit* killer)
{
if (IsBeingEscorted && killer == m_creature)
if (IsBeingEscorted && killer == me)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
}
}
@@ -1053,13 +1053,13 @@ struct npc_tobias_seecherAI : public npc_escortAI
{
switch(i)
{
case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 0:me->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 2:
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
case 4:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
break;
}
@@ -1070,15 +1070,15 @@ struct npc_tobias_seecherAI : public npc_escortAI
if (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if ((pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
@@ -1174,19 +1174,19 @@ struct npc_rocknotAI : public npc_escortAI
switch(i)
{
case 1:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break;
case 2:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
break;
case 3:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED);
break;
case 4:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
break;
case 5:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
me->HandleEmoteCommand(EMOTE_ONESHOT_KICK);
BreakKeg_Timer = 2000;
break;
}
@@ -1215,7 +1215,7 @@ struct npc_rocknotAI : public npc_escortAI
DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future
//spell by trap has effect61, this indicate the bar go hostile
if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX)))
if (Unit *tmp = Unit::GetUnit(*me,pInstance->GetData64(DATA_PHALANX)))
tmp->setFaction(14);
//for later, this event(s) has alot more to it.
@@ -58,17 +58,17 @@ struct boss_ambassador_flamelashAI : public ScriptedAI
//FireBlast_Timer
if (FireBlast_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBLAST);
DoCast(me->getVictim(), SPELL_FIREBLAST);
FireBlast_Timer = 7000;
} else FireBlast_Timer -= diff;
//Spirit_Timer
if (Spirit_Timer <= diff)
{
SummonSpirits(m_creature->getVictim());
SummonSpirits(m_creature->getVictim());
SummonSpirits(m_creature->getVictim());
SummonSpirits(m_creature->getVictim());
SummonSpirits(me->getVictim());
SummonSpirits(me->getVictim());
SummonSpirits(me->getVictim());
SummonSpirits(me->getVictim());
Spirit_Timer = 30000;
} else Spirit_Timer -= diff;
@@ -64,7 +64,7 @@ struct boss_anubshiahAI : public ScriptedAI
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 7000;
} else ShadowBolt_Timer -= diff;
@@ -79,14 +79,14 @@ struct boss_anubshiahAI : public ScriptedAI
//CurseOfWeakness_Timer
if (CurseOfWeakness_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSEOFWEAKNESS);
DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
CurseOfWeakness_Timer = 45000;
} else CurseOfWeakness_Timer -= diff;
//DemonArmor_Timer
if (DemonArmor_Timer <= diff)
{
DoCast(m_creature, SPELL_DEMONARMOR);
DoCast(me, SPELL_DEMONARMOR);
DemonArmor_Timer = 300000;
} else DemonArmor_Timer -= diff;
@@ -52,13 +52,13 @@ struct boss_draganthaurissanAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
m_creature->CallForHelp(VISIBLE_RANGE);
DoScriptText(SAY_AGGRO, me);
me->CallForHelp(VISIBLE_RANGE);
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_SLAY, m_creature);
DoScriptText(SAY_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -88,7 +88,7 @@ struct boss_draganthaurissanAI : public ScriptedAI
//AvatarOfFlame_Timer
if (AvatarOfFlame_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_AVATAROFFLAME);
DoCast(me->getVictim(), SPELL_AVATAROFFLAME);
AvatarOfFlame_Timer = 18000;
} else AvatarOfFlame_Timer -= diff;
@@ -74,43 +74,43 @@ struct boss_general_angerforgeAI : public ScriptedAI
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 18000;
} else MightyBlow_Timer -= diff;
//HamString_Timer
if (HamString_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
DoCast(me->getVictim(), SPELL_HAMSTRING);
HamString_Timer = 15000;
} else HamString_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 9000;
} else Cleave_Timer -= diff;
//Adds_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
if (me->GetHealth()*100 / me->GetMaxHealth() < 21)
{
if (Adds_Timer <= diff)
{
// summon 3 Adds every 25s
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
Adds_Timer = 25000;
} else Adds_Timer -= diff;
}
//Summon Medics
if (!Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21)
if (!Medics && me->GetHealth()*100 / me->GetMaxHealth() < 21)
{
SummonMedics(m_creature->getVictim());
SummonMedics(m_creature->getVictim());
SummonMedics(me->getVictim());
SummonMedics(me->getVictim());
Medics = true;
}
@@ -55,14 +55,14 @@ struct boss_gorosh_the_dervishAI : public ScriptedAI
//WhirlWind_Timer
if (WhirlWind_Timer <= diff)
{
DoCast(m_creature, SPELL_WHIRLWIND);
DoCast(me, SPELL_WHIRLWIND);
WhirlWind_Timer = 15000;
} else WhirlWind_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
@@ -60,17 +60,17 @@ struct boss_grizzleAI : public ScriptedAI
//GroundTremor_Timer
if (GroundTremor_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GROUNDTREMOR);
DoCast(me->getVictim(), SPELL_GROUNDTREMOR);
GroundTremor_Timer = 8000;
} else GroundTremor_Timer -= diff;
//Frenzy_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
if (Frenzy_Timer <= diff)
{
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
DoCast(me, SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
Frenzy_Timer = 15000;
} else Frenzy_Timer -= diff;
@@ -77,14 +77,14 @@ struct boss_high_interrogator_gerstahnAI : public ScriptedAI
//PsychicScream_Timer
if (PsychicScream_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_PSYCHICSCREAM);
DoCast(me->getVictim(), SPELL_PSYCHICSCREAM);
PsychicScream_Timer = 30000;
} else PsychicScream_Timer -= diff;
//ShadowShield_Timer
if (ShadowShield_Timer <= diff)
{
DoCast(m_creature, SPELL_SHADOWSHIELD);
DoCast(me, SPELL_SHADOWSHIELD);
ShadowShield_Timer = 25000;
} else ShadowShield_Timer -= diff;
@@ -60,16 +60,16 @@ struct boss_magmusAI : public ScriptedAI
//FieryBurst_Timer
if (FieryBurst_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIERYBURST);
DoCast(me->getVictim(), SPELL_FIERYBURST);
FieryBurst_Timer = 6000;
} else FieryBurst_Timer -= diff;
//WarStomp_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
if (me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
if (WarStomp_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WARSTOMP);
DoCast(me->getVictim(), SPELL_WARSTOMP);
WarStomp_Timer = 8000;
} else WarStomp_Timer -= diff;
}
@@ -63,21 +63,21 @@ struct boss_moira_bronzebeardAI : public ScriptedAI
//MindBlast_Timer
if (MindBlast_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MINDBLAST);
DoCast(me->getVictim(), SPELL_MINDBLAST);
MindBlast_Timer = 14000;
} else MindBlast_Timer -= diff;
//ShadowWordPain_Timer
if (ShadowWordPain_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWWORDPAIN);
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 18000;
} else ShadowWordPain_Timer -= diff;
//Smite_Timer
if (Smite_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SMITE);
DoCast(me->getVictim(), SPELL_SMITE);
Smite_Timer = 10000;
} else Smite_Timer -= diff;
@@ -116,16 +116,16 @@ struct boss_doomrelAI : public ScriptedAI
DemonArmor_Timer = 16000;
Voidwalkers = false;
m_creature->setFaction(FACTION_FRIEND);
me->setFaction(FACTION_FRIEND);
// was set before event start, so set again
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
if (pInstance)
if (pInstance->GetData(DATA_GHOSTKILL) >= 7)
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
else
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void EnterCombat(Unit *who)
@@ -134,13 +134,13 @@ struct boss_doomrelAI : public ScriptedAI
void EnterEvadeMode()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
m_creature->LoadCreaturesAddon();
if (m_creature->isAlive())
m_creature->GetMotionMaster()->MoveTargetedHome();
m_creature->SetLootRecipient(NULL);
me->RemoveAllAuras();
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon();
if (me->isAlive())
me->GetMotionMaster()->MoveTargetedHome();
me->SetLootRecipient(NULL);
if (pInstance)
pInstance->SetData64(DATA_EVENSTARTER, 0);
}
@@ -159,7 +159,7 @@ struct boss_doomrelAI : public ScriptedAI
//ShadowVolley_Timer
if (ShadowVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWBOLTVOLLEY);
DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
ShadowVolley_Timer = 12000;
} else ShadowVolley_Timer -= diff;
@@ -175,21 +175,21 @@ struct boss_doomrelAI : public ScriptedAI
//CurseOfWeakness_Timer
if (CurseOfWeakness_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSEOFWEAKNESS);
DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS);
CurseOfWeakness_Timer = 45000;
} else CurseOfWeakness_Timer -= diff;
//DemonArmor_Timer
if (DemonArmor_Timer <= diff)
{
DoCast(m_creature, SPELL_DEMONARMOR);
DoCast(me, SPELL_DEMONARMOR);
DemonArmor_Timer = 300000;
} else DemonArmor_Timer -= diff;
//Summon Voidwalkers
if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
if (!Voidwalkers && me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
DoCast(m_creature->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
DoCast(me->getVictim(), SPELL_SUMMON_VOIDWALKERS, true);
Voidwalkers = true;
}
@@ -58,28 +58,28 @@ struct boss_drakkisathAI : public ScriptedAI
//FireNova_Timer
if (FireNova_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 10000;
} else FireNova_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 8000;
} else Cleave_Timer -= diff;
//Confliguration_Timer
if (Confliguration_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CONFLIGURATION);
DoCast(me->getVictim(), SPELL_CONFLIGURATION);
Confliguration_Timer = 18000;
} else Confliguration_Timer -= diff;
//Thunderclap_Timer
if (Thunderclap_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 20000;
} else Thunderclap_Timer -= diff;
@@ -71,8 +71,8 @@ struct boss_gythAI : public ScriptedAI
Line2Count = 2;
//Invisible for event start
m_creature->SetDisplayId(11686);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11686);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who)
@@ -81,7 +81,7 @@ struct boss_gythAI : public ScriptedAI
void SummonCreatureWithRandomTarget(uint32 creatureId)
{
Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
Unit* Summoned = me->SummonCreature(creatureId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000);
if (Summoned)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -100,8 +100,8 @@ struct boss_gythAI : public ScriptedAI
if (!RootSelf)
{
//m_creature->m_canMove = true;
DoCast(m_creature, 33356);
//me->m_canMove = true;
DoCast(me, 33356);
RootSelf = true;
}
@@ -111,9 +111,9 @@ struct boss_gythAI : public ScriptedAI
{
bAggro = true;
// Visible now!
m_creature->SetDisplayId(9723);
m_creature->setFaction(14);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(9723);
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
} else Aggro_Timer -= diff;
}
@@ -153,34 +153,34 @@ struct boss_gythAI : public ScriptedAI
// CorrosiveAcid_Timer
if (CorrosiveAcid_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
DoCast(me->getVictim(), SPELL_CORROSIVEACID);
CorrosiveAcid_Timer = 7000;
} else CorrosiveAcid_Timer -= diff;
// Freeze_Timer
if (Freeze_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FREEZE);
DoCast(me->getVictim(), SPELL_FREEZE);
Freeze_Timer = 16000;
} else Freeze_Timer -= diff;
// Flamebreath_Timer
if (Flamebreath_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
Flamebreath_Timer = 10500;
} else Flamebreath_Timer -= diff;
//Summon Rend
if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11
&& m_creature->GetHealth() > 0)
if (!SummonedRend && me->GetHealth()*100 / me->GetMaxHealth() < 11
&& me->GetHealth() > 0)
{
//summon Rend and Change model to normal Gyth
//Inturrupt any spell casting
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
//Gyth model
m_creature->SetDisplayId(9806);
m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
me->SetDisplayId(9806);
me->SummonCreature(10429, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000);
SummonedRend = true;
}
@@ -59,21 +59,21 @@ struct boss_halyconAI : public ScriptedAI
//CrowdPummel_Timer
if (CrowdPummel_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CROWDPUMMEL);
DoCast(me->getVictim(), SPELL_CROWDPUMMEL);
CrowdPummel_Timer = 14000;
} else CrowdPummel_Timer -= diff;
//MightyBlow_Timer
if (MightyBlow_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW);
DoCast(me->getVictim(), SPELL_MIGHTYBLOW);
MightyBlow_Timer = 10000;
} else MightyBlow_Timer -= diff;
//Summon Gizrul
if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25)
if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 25)
{
m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
me->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000);
Summoned = true;
}
@@ -67,49 +67,49 @@ struct boss_highlordomokkAI : public ScriptedAI
//WarStomp_Timer
if (WarStomp_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WARSTOMP);
DoCast(me->getVictim(), SPELL_WARSTOMP);
WarStomp_Timer = 14000;
} else WarStomp_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 8000;
} else Cleave_Timer -= diff;
//Strike_Timer
if (Strike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_STRIKE);
DoCast(me->getVictim(), SPELL_STRIKE);
Strike_Timer = 10000;
} else Strike_Timer -= diff;
//Rend_Timer
if (Rend_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REND);
DoCast(me->getVictim(), SPELL_REND);
Rend_Timer = 18000;
} else Rend_Timer -= diff;
//SunderArmor_Timer
if (SunderArmor_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SUNDERARMOR);
DoCast(me->getVictim(), SPELL_SUNDERARMOR);
SunderArmor_Timer = 25000;
} else SunderArmor_Timer -= diff;
//KnockAway_Timer
if (KnockAway_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 12000;
} else KnockAway_Timer -= diff;
//Slow_Timer
if (Slow_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SLOW);
DoCast(me->getVictim(), SPELL_SLOW);
Slow_Timer = 18000;
} else Slow_Timer -= diff;
@@ -44,8 +44,8 @@ struct boss_mothersmolderwebAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (m_creature->GetHealth() <= damage)
DoCast(m_creature, SPELL_SUMMON_SPIRE_SPIDERLING, true);
if (me->GetHealth() <= damage)
DoCast(me, SPELL_SUMMON_SPIRE_SPIDERLING, true);
}
void UpdateAI(const uint32 diff)
@@ -57,14 +57,14 @@ struct boss_mothersmolderwebAI : public ScriptedAI
//Crystalize_Timer
if (Crystalize_Timer <= diff)
{
DoCast(m_creature, SPELL_CRYSTALIZE);
DoCast(me, SPELL_CRYSTALIZE);
Crystalize_Timer = 15000;
} else Crystalize_Timer -= diff;
//MothersMilk_Timer
if (MothersMilk_Timer <= diff)
{
DoCast(m_creature, SPELL_MOTHERSMILK);
DoCast(me, SPELL_MOTHERSMILK);
MothersMilk_Timer = urand(5000,12500);
} else MothersMilk_Timer -= diff;
@@ -70,39 +70,39 @@ struct boss_overlordwyrmthalakAI : public ScriptedAI
//BlastWave_Timer
if (BlastWave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BLASTWAVE);
DoCast(me->getVictim(), SPELL_BLASTWAVE);
BlastWave_Timer = 20000;
} else BlastWave_Timer -= diff;
//Shout_Timer
if (Shout_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHOUT);
DoCast(me->getVictim(), SPELL_SHOUT);
Shout_Timer = 10000;
} else Shout_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//Knockaway_Timer
if (Knockaway_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
Knockaway_Timer = 14000;
} else Knockaway_Timer -= diff;
//Summon two Beserks
if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51)
if (!Summoned && me->GetHealth()*100 / me->GetMaxHealth() < 51)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM,0, 100, true);
if (Creature *SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000))
if (Creature *SummonedCreature = me->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000))
SummonedCreature->AI()->AttackStart(pTarget);
if (Creature *SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000))
if (Creature *SummonedCreature = me->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000))
SummonedCreature->AI()->AttackStart(pTarget);
Summoned = true;
}
@@ -55,14 +55,14 @@ struct boss_pyroguard_emberseerAI : public ScriptedAI
//FireNova_Timer
if (FireNova_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 6000;
} else FireNova_Timer -= diff;
//FlameBuffet_Timer
if (FlameBuffet_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET);
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
FlameBuffet_Timer = 14000;
} else FlameBuffet_Timer -= diff;
@@ -56,14 +56,14 @@ struct boss_quatermasterzigrisAI : public ScriptedAI
//Shoot_Timer
if (Shoot_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHOOT);
DoCast(me->getVictim(), SPELL_SHOOT);
Shoot_Timer = 500;
} else Shoot_Timer -= diff;
//StunBomb_Timer
if (StunBomb_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_STUNBOMB);
DoCast(me->getVictim(), SPELL_STUNBOMB);
StunBomb_Timer = 14000;
} else StunBomb_Timer -= diff;
@@ -55,21 +55,21 @@ struct boss_rend_blackhandAI : public ScriptedAI
//WhirlWind_Timer
if (WhirlWind_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
DoCast(me->getVictim(), SPELL_WHIRLWIND);
WhirlWind_Timer = 18000;
} else WhirlWind_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 10000;
} else Cleave_Timer -= diff;
//Thunderclap_Timer
if (Thunderclap_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 16000;
} else Thunderclap_Timer -= diff;
@@ -41,7 +41,7 @@ struct boss_shadowvoshAI : public ScriptedAI
Hex_Timer = 8000;
Cleave_Timer = 14000;
//DoCast(m_creature, SPELL_ICEARMOR, true);
//DoCast(me, SPELL_ICEARMOR, true);
}
void EnterCombat(Unit *who){}
@@ -55,7 +55,7 @@ struct boss_shadowvoshAI : public ScriptedAI
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSEOFBLOOD);
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 45000;
} else CurseOfBlood_Timer -= diff;
@@ -70,7 +70,7 @@ struct boss_shadowvoshAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
@@ -55,7 +55,7 @@ struct boss_thebeastAI : public ScriptedAI
//Flamebreak_Timer
if (Flamebreak_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBREAK);
DoCast(me->getVictim(), SPELL_FLAMEBREAK);
Flamebreak_Timer = 10000;
} else Flamebreak_Timer -= diff;
@@ -70,7 +70,7 @@ struct boss_thebeastAI : public ScriptedAI
//TerrifyingRoar_Timer
if (TerrifyingRoar_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TERRIFYINGROAR);
DoCast(me->getVictim(), SPELL_TERRIFYINGROAR);
TerrifyingRoar_Timer = 20000;
} else TerrifyingRoar_Timer -= diff;
@@ -64,42 +64,42 @@ struct boss_warmastervooneAI : public ScriptedAI
//Snapkick_Timer
if (Snapkick_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SNAPKICK);
DoCast(me->getVictim(), SPELL_SNAPKICK);
Snapkick_Timer = 6000;
} else Snapkick_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 12000;
} else Cleave_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 14000;
} else Uppercut_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 10000;
} else MortalStrike_Timer -= diff;
//Pummel_Timer
if (Pummel_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_PUMMEL);
DoCast(me->getVictim(), SPELL_PUMMEL);
Pummel_Timer = 16000;
} else Pummel_Timer -= diff;
//ThrowAxe_Timer
if (ThrowAxe_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THROWAXE);
DoCast(me->getVictim(), SPELL_THROWAXE);
ThrowAxe_Timer = 8000;
} else ThrowAxe_Timer -= diff;
@@ -50,7 +50,7 @@ struct boss_broodlordAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
}
@@ -62,36 +62,36 @@ struct boss_broodlordAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
// BlastWave
if (BlastWave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BLASTWAVE);
DoCast(me->getVictim(), SPELL_BLASTWAVE);
BlastWave_Timer = urand(8000,16000);
} else BlastWave_Timer -= diff;
//MortalStrike_Timer
if (MortalStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = urand(25000,35000);
} else MortalStrike_Timer -= diff;
if (KnockBack_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKBACK);
DoCast(me->getVictim(), SPELL_KNOCKBACK);
//Drop 50% aggro
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-50);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-50);
KnockBack_Timer = urand(15000,30000);
} else KnockBack_Timer -= diff;
if (EnterEvadeIfOutOfCombatArea(diff))
DoScriptText(SAY_LEASH, m_creature);
DoScriptText(SAY_LEASH, me);
DoMeleeAttackIfReady();
}
@@ -199,43 +199,43 @@ struct boss_chromaggusAI : public ScriptedAI
{
//Remove old vulnerabilty spell
if (CurrentVurln_Spell)
m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell);
me->RemoveAurasDueToSpell(CurrentVurln_Spell);
//Cast new random vulnerabilty on self
uint32 spell = RAND(SPELL_FIRE_VULNERABILITY, SPELL_FROST_VULNERABILITY,
SPELL_SHADOW_VULNERABILITY, SPELL_NATURE_VULNERABILITY, SPELL_ARCANE_VULNERABILITY);
DoCast(m_creature, spell);
DoCast(me, spell);
CurrentVurln_Spell = spell;
DoScriptText(EMOTE_SHIMMER, m_creature);
DoScriptText(EMOTE_SHIMMER, me);
Shimmer_Timer = 45000;
} else Shimmer_Timer -= diff;
//Breath1_Timer
if (Breath1_Timer <= diff)
{
DoCast(m_creature->getVictim(), Breath1_Spell);
DoCast(me->getVictim(), Breath1_Spell);
Breath1_Timer = 60000;
} else Breath1_Timer -= diff;
//Breath2_Timer
if (Breath2_Timer <= diff)
{
DoCast(m_creature->getVictim(), Breath2_Spell);
DoCast(me->getVictim(), Breath2_Spell);
Breath2_Timer = 60000;
} else Breath2_Timer -= diff;
//Affliction_Timer
if (Affliction_Timer <= diff)
{
std::list<HostileReference*> threatlist = m_creature->getThreatManager().getThreatList();
std::list<HostileReference*> threatlist = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
{
Unit* pUnit;
if ((*i) && (*i)->getSource())
{
pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit)
{
//Cast affliction
@@ -270,15 +270,15 @@ struct boss_chromaggusAI : public ScriptedAI
//Frenzy_Timer
if (Frenzy_Timer <= diff)
{
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_FRENZY, m_creature);
DoCast(me, SPELL_FRENZY);
DoScriptText(EMOTE_FRENZY, me);
Frenzy_Timer = urand(10000,15000);
} else Frenzy_Timer -= diff;
//Enrage if not already enraged and below 20%
if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
if (!Enraged && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
@@ -58,29 +58,29 @@ struct boss_ebonrocAI : public ScriptedAI
//Shadowflame Timer
if (ShadowFlame_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = urand(12000,15000);
} else ShadowFlame_Timer -= diff;
//Wing Buffet Timer
if (WingBuffet_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
DoCast(me->getVictim(), SPELL_WINGBUFFET);
WingBuffet_Timer = 25000;
} else WingBuffet_Timer -= diff;
//Shadow of Ebonroc Timer
if (ShadowOfEbonroc_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWOFEBONROC);
DoCast(me->getVictim(), SPELL_SHADOWOFEBONROC);
ShadowOfEbonroc_Timer = urand(25000,350000);
} else ShadowOfEbonroc_Timer -= diff;
if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
if (me->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
{
if (Heal_Timer <= diff)
{
DoCast(m_creature, SPELL_HEAL);
DoCast(me, SPELL_HEAL);
Heal_Timer = urand(1000,3000);
} else Heal_Timer -= diff;
}
@@ -55,16 +55,16 @@ struct boss_firemawAI : public ScriptedAI
//ShadowFlame_Timer
if (ShadowFlame_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = urand(15000,18000);
} else ShadowFlame_Timer -= diff;
//WingBuffet_Timer
if (WingBuffet_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-75);
DoCast(me->getVictim(), SPELL_WINGBUFFET);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-75);
WingBuffet_Timer = 25000;
} else WingBuffet_Timer -= diff;
@@ -72,7 +72,7 @@ struct boss_firemawAI : public ScriptedAI
//FlameBuffet_Timer
if (FlameBuffet_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET);
DoCast(me->getVictim(), SPELL_FLAMEBUFFET);
FlameBuffet_Timer = 5000;
} else FlameBuffet_Timer -= diff;
@@ -57,16 +57,16 @@ struct boss_flamegorAI : public ScriptedAI
//ShadowFlame_Timer
if (ShadowFlame_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = 15000 + rand()%7000;
} else ShadowFlame_Timer -= diff;
//WingBuffet_Timer
if (WingBuffet_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-75);
DoCast(me->getVictim(), SPELL_WINGBUFFET);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-75);
WingBuffet_Timer = 25000;
} else WingBuffet_Timer -= diff;
@@ -74,8 +74,8 @@ struct boss_flamegorAI : public ScriptedAI
//Frenzy_Timer
if (Frenzy_Timer <= diff)
{
DoScriptText(EMOTE_FRENZY, m_creature);
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_FRENZY, me);
DoCast(me, SPELL_FRENZY);
Frenzy_Timer = urand(8000, 10000);
} else Frenzy_Timer -= diff;
@@ -90,17 +90,17 @@ struct boss_nefarianAI : public ScriptedAI
if (rand()%5)
return;
DoScriptText(SAY_SLAY, m_creature, Victim);
DoScriptText(SAY_SLAY, me, Victim);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), m_creature);
DoScriptText(RAND(SAY_XHEALTH,SAY_AGGRO,SAY_SHADOWFLAME), me);
DoCast(who, SPELL_SHADOWFLAME_INITIAL);
DoZoneInCombat();
@@ -111,7 +111,7 @@ struct boss_nefarianAI : public ScriptedAI
if (DespawnTimer <= diff)
{
if (!UpdateVictim())
m_creature->ForcedDespawn();
me->ForcedDespawn();
DespawnTimer = 5000;
} else DespawnTimer -= diff;
@@ -121,28 +121,28 @@ struct boss_nefarianAI : public ScriptedAI
//ShadowFlame_Timer
if (ShadowFlame_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWFLAME);
DoCast(me->getVictim(), SPELL_SHADOWFLAME);
ShadowFlame_Timer = 12000;
} else ShadowFlame_Timer -= diff;
//BellowingRoar_Timer
if (BellowingRoar_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
BellowingRoar_Timer = 30000;
} else BellowingRoar_Timer -= diff;
//VeilOfShadow_Timer
if (VeilOfShadow_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_VEILOFSHADOW);
DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
VeilOfShadow_Timer = 15000;
} else VeilOfShadow_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
@@ -150,7 +150,7 @@ struct boss_nefarianAI : public ScriptedAI
if (TailLash_Timer <= diff)
{
//Cast NYI since we need a better check for behind target
//DoCast(m_creature->getVictim(), SPELL_TAILLASH);
//DoCast(me->getVictim(), SPELL_TAILLASH);
TailLash_Timer = 10000;
} else TailLash_Timer -= diff;
@@ -165,40 +165,40 @@ struct boss_nefarianAI : public ScriptedAI
switch (urand(0,8))
{
case 0:
DoScriptText(SAY_MAGE, m_creature);
DoCast(m_creature, SPELL_MAGE);
DoScriptText(SAY_MAGE, me);
DoCast(me, SPELL_MAGE);
break;
case 1:
DoScriptText(SAY_WARRIOR, m_creature);
DoCast(m_creature, SPELL_WARRIOR);
DoScriptText(SAY_WARRIOR, me);
DoCast(me, SPELL_WARRIOR);
break;
case 2:
DoScriptText(SAY_DRUID, m_creature);
DoCast(m_creature, SPELL_DRUID);
DoScriptText(SAY_DRUID, me);
DoCast(me, SPELL_DRUID);
break;
case 3:
DoScriptText(SAY_PRIEST, m_creature);
DoCast(m_creature, SPELL_PRIEST);
DoScriptText(SAY_PRIEST, me);
DoCast(me, SPELL_PRIEST);
break;
case 4:
DoScriptText(SAY_PALADIN, m_creature);
DoCast(m_creature, SPELL_PALADIN);
DoScriptText(SAY_PALADIN, me);
DoCast(me, SPELL_PALADIN);
break;
case 5:
DoScriptText(SAY_SHAMAN, m_creature);
DoCast(m_creature, SPELL_SHAMAN);
DoScriptText(SAY_SHAMAN, me);
DoCast(me, SPELL_SHAMAN);
break;
case 6:
DoScriptText(SAY_WARLOCK, m_creature);
DoCast(m_creature, SPELL_WARLOCK);
DoScriptText(SAY_WARLOCK, me);
DoCast(me, SPELL_WARLOCK);
break;
case 7:
DoScriptText(SAY_HUNTER, m_creature);
DoCast(m_creature, SPELL_HUNTER);
DoScriptText(SAY_HUNTER, me);
DoCast(me, SPELL_HUNTER);
break;
case 8:
DoScriptText(SAY_ROGUE, m_creature);
DoCast(m_creature, SPELL_ROGUE);
DoScriptText(SAY_ROGUE, me);
DoCast(me, SPELL_ROGUE);
break;
}
@@ -206,10 +206,10 @@ struct boss_nefarianAI : public ScriptedAI
} else ClassCall_Timer -= diff;
//Phase3 begins when we are below X health
if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)
if (!Phase3 && (me->GetHealth()*100 / me->GetMaxHealth()) < 20)
{
Phase3 = true;
DoScriptText(SAY_RAISE_SKELETONS, m_creature);
DoScriptText(SAY_RAISE_SKELETONS, me);
}
DoMeleeAttackIfReady();
@@ -59,7 +59,7 @@ struct boss_razorgoreAI : public ScriptedAI
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -70,40 +70,40 @@ struct boss_razorgoreAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = urand(7000,10000);
} else Cleave_Timer -= diff;
//WarStomp_Timer
if (WarStomp_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WARSTOMP);
DoCast(me->getVictim(), SPELL_WARSTOMP);
WarStomp_Timer = urand(15000,25000);
} else WarStomp_Timer -= diff;
//FireballVolley_Timer
if (FireballVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBALLVOLLEY);
DoCast(me->getVictim(), SPELL_FIREBALLVOLLEY);
FireballVolley_Timer = urand(12000,15000);
} else FireballVolley_Timer -= diff;
//Conflagration_Timer
if (Conflagration_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION);
DoCast(me->getVictim(), SPELL_CONFLAGRATION);
//We will remove this threat reduction and add an aura check.
//if (DoGetThreat(m_creature->getVictim()))
//DoModifyThreatPercent(m_creature->getVictim(),-50);
//if (DoGetThreat(me->getVictim()))
//DoModifyThreatPercent(me->getVictim(),-50);
Conflagration_Timer = 12000;
} else Conflagration_Timer -= diff;
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
if (m_creature->getVictim() && m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION))
if (me->getVictim() && me->getVictim()->HasAura(SPELL_CONFLAGRATION))
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true))
m_creature->TauntApply(pTarget);
me->TauntApply(pTarget);
DoMeleeAttackIfReady();
}
@@ -80,13 +80,13 @@ struct boss_vaelAI : public ScriptedAI
PlayerGUID = pTarget->GetGUID();
//10 seconds
DoScriptText(SAY_LINE1, m_creature);
DoScriptText(SAY_LINE1, me);
SpeechTimer = 10000;
SpeechNum = 0;
DoingSpeech = true;
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
void KilledUnit(Unit *victim)
@@ -94,14 +94,14 @@ struct boss_vaelAI : public ScriptedAI
if (rand()%5)
return;
DoScriptText(SAY_KILLTARGET, m_creature, victim);
DoScriptText(SAY_KILLTARGET, me, victim);
}
void EnterCombat(Unit *who)
{
DoCast(m_creature, SPELL_ESSENCEOFTHERED);
DoCast(me, SPELL_ESSENCEOFTHERED);
DoZoneInCombat();
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3));
me->SetHealth(int(me->GetMaxHealth()*.3));
}
void UpdateAI(const uint32 diff)
@@ -115,22 +115,22 @@ struct boss_vaelAI : public ScriptedAI
{
case 0:
//16 seconds till next line
DoScriptText(SAY_LINE2, m_creature);
DoScriptText(SAY_LINE2, me);
SpeechTimer = 16000;
++SpeechNum;
break;
case 1:
//This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!"
DoScriptText(SAY_LINE3, m_creature);
DoScriptText(SAY_LINE3, me);
SpeechTimer = 10000;
++SpeechNum;
break;
case 2:
m_creature->setFaction(103);
if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID))
me->setFaction(103);
if (PlayerGUID && Unit::GetUnit((*me),PlayerGUID))
{
AttackStart(Unit::GetUnit((*m_creature),PlayerGUID));
DoCast(m_creature, SPELL_ESSENCEOFTHERED);
AttackStart(Unit::GetUnit((*me),PlayerGUID));
DoCast(me, SPELL_ESSENCEOFTHERED);
}
SpeechTimer = 0;
DoingSpeech = false;
@@ -144,23 +144,23 @@ struct boss_vaelAI : public ScriptedAI
return;
// Yell if hp lower than 15%
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled)
if (me->GetHealth()*100 / me->GetMaxHealth() < 15 && !HasYelled)
{
DoScriptText(SAY_HALFLIFE, m_creature);
DoScriptText(SAY_HALFLIFE, me);
HasYelled = true;
}
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 15000;
} else Cleave_Timer -= diff;
//FlameBreath_Timer
if (FlameBreath_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
FlameBreath_Timer = urand(4000,8000);
} else FlameBreath_Timer -= diff;
@@ -188,7 +188,7 @@ struct boss_vaelAI : public ScriptedAI
{
// have the victim cast the spell on himself otherwise the third effect aura will be applied
// to Vael instead of the player
m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1);
me->getVictim()->CastSpell(me->getVictim(),SPELL_BURNINGADRENALINE,1);
BurningAdrenalineTank_Timer = 45000;
} else BurningAdrenalineTank_Timer -= diff;
@@ -196,7 +196,7 @@ struct boss_vaelAI : public ScriptedAI
//FireNova_Timer
if (FireNova_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 5000;
} else FireNova_Timer -= diff;
@@ -204,9 +204,9 @@ struct boss_vaelAI : public ScriptedAI
if (TailSwipe_Timer <= diff)
{
//Only cast if we are behind
/*if (!m_creature->HasInArc(M_PI, m_creature->getVictim()))
/*if (!me->HasInArc(M_PI, me->getVictim()))
{
DoCast(m_creature->getVictim(), SPELL_TAILSWIPE);
DoCast(me->getVictim(), SPELL_TAILSWIPE);
}*/
TailSwipe_Timer = 20000;
@@ -178,27 +178,27 @@ struct boss_victor_nefariusAI : public ScriptedAI
NefarianGUID = 0;
NefCheckTime = 2000;
m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1);
m_creature->setFaction(35);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_FLAGS,1);
me->setFaction(35);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void BeginEvent(Player *pTarget)
{
DoScriptText(SAY_GAMESBEGIN_2, m_creature);
DoScriptText(SAY_GAMESBEGIN_2, me);
//Trinity::Singleton<MapManager>::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
//Trinity::Singleton<MapManager>::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
/*
list <Player*>::const_iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin();
list <Player*>::const_iterator i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin();
for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i)
for (i = MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().begin(); i != MapManager::Instance().GetMap(me->GetMapId(), me)->GetPlayers().end(); ++i)
{
AttackStart((*i));
}
*/
m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0);
m_creature->setFaction(103);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUInt32Value(UNIT_NPC_FLAGS,0);
me->setFaction(103);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
AttackStart(pTarget);
}
@@ -210,10 +210,10 @@ struct boss_victor_nefariusAI : public ScriptedAI
{
//We simply use this function to find players until we can use pMap->GetPlayers()
if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who))
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsHostileTo(who))
{
//Add them to our threat list
m_creature->AddThreat(who, 0.0f);
me->AddThreat(who, 0.0f);
}
}
@@ -260,7 +260,7 @@ struct boss_victor_nefariusAI : public ScriptedAI
++SpawnedAdds;
//Spawn Creature and force it to start attacking a random target
Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
Spawned = me->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Spawned)
{
@@ -276,7 +276,7 @@ struct boss_victor_nefariusAI : public ScriptedAI
++SpawnedAdds;
Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
Spawned = me->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Spawned)
{
@@ -288,23 +288,23 @@ struct boss_victor_nefariusAI : public ScriptedAI
if (SpawnedAdds >= 42)
{
//Teleport Victor Nefarius way out of the map
//MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0);
//MapManager::Instance().GetMap(me->GetMapId(), me)->CreatureRelocation(me,0,0,-5000,0);
//Inturrupt any spell casting
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
//Root self
DoCast(m_creature, 33356);
DoCast(me, 33356);
//Make super invis
DoCast(m_creature, 8149);
DoCast(me, 8149);
//Teleport self to a hiding spot (this causes errors in the Trinity log but no real issues)
DoTeleportTo(HIDE_X,HIDE_Y,HIDE_Z);
m_creature->addUnitState(UNIT_STAT_FLEEING);
me->addUnitState(UNIT_STAT_FLEEING);
//Spawn nef and have him attack a random target
Creature* Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
Creature* Nefarian = me->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000);
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (pTarget && Nefarian)
{
@@ -322,14 +322,14 @@ struct boss_victor_nefariusAI : public ScriptedAI
{
if (NefCheckTime <= diff)
{
Unit* Nefarian = Unit::GetCreature((*m_creature),NefarianGUID);
Unit* Nefarian = Unit::GetCreature((*me),NefarianGUID);
//If nef is dead then we die to so the players get out of combat
//and cannot repeat the event
if (!Nefarian || !Nefarian->isAlive())
{
NefarianGUID = 0;
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
NefCheckTime = 2000;
+10 -10
View File
@@ -61,7 +61,7 @@ struct boss_kruulAI : public ScriptedAI
void KilledUnit()
{
// When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health.
DoCast(m_creature, SPELL_CAPTURESOUL);
DoCast(me, SPELL_CAPTURESOUL);
}
void SummonHounds(Unit* pVictim)
@@ -80,7 +80,7 @@ struct boss_kruulAI : public ScriptedAI
if (ShadowVolley_Timer <= diff)
{
if (urand(0,99) < 45)
DoCast(m_creature->getVictim(), SPELL_SHADOWVOLLEY);
DoCast(me->getVictim(), SPELL_SHADOWVOLLEY);
ShadowVolley_Timer = 5000;
} else ShadowVolley_Timer -= diff;
@@ -89,7 +89,7 @@ struct boss_kruulAI : public ScriptedAI
if (Cleave_Timer <= diff)
{
if (urand(0,1))
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 10000;
} else Cleave_Timer -= diff;
@@ -98,7 +98,7 @@ struct boss_kruulAI : public ScriptedAI
if (ThunderClap_Timer <= diff)
{
if (urand(0,9) < 2)
DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
ThunderClap_Timer = 12000;
} else ThunderClap_Timer -= diff;
@@ -106,7 +106,7 @@ struct boss_kruulAI : public ScriptedAI
//TwistedReflection_Timer
if (TwistedReflection_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TWISTEDREFLECTION);
DoCast(me->getVictim(), SPELL_TWISTEDREFLECTION);
TwistedReflection_Timer = 30000;
} else TwistedReflection_Timer -= diff;
@@ -114,7 +114,7 @@ struct boss_kruulAI : public ScriptedAI
if (VoidBolt_Timer <= diff)
{
if (urand(0,9) < 4)
DoCast(m_creature->getVictim(), SPELL_VOIDBOLT);
DoCast(me->getVictim(), SPELL_VOIDBOLT);
VoidBolt_Timer = 18000;
} else VoidBolt_Timer -= diff;
@@ -122,16 +122,16 @@ struct boss_kruulAI : public ScriptedAI
//Rage_Timer
if (Rage_Timer <= diff)
{
DoCast(m_creature, SPELL_RAGE);
DoCast(me, SPELL_RAGE);
Rage_Timer = 70000;
} else Rage_Timer -= diff;
//Hound_Timer
if (Hound_Timer <= diff)
{
SummonHounds(m_creature->getVictim());
SummonHounds(m_creature->getVictim());
SummonHounds(m_creature->getVictim());
SummonHounds(me->getVictim());
SummonHounds(me->getVictim());
SummonHounds(me->getVictim());
Hound_Timer = 45000;
} else Hound_Timer -= diff;
@@ -54,7 +54,7 @@ struct npc_ragged_johnAI : public ScriptedAI
{
if (who->HasAura(16468))
{
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature))
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me))
{
DoCast(who, 16472);
CAST_PLR(who)->AreaExploredOrEventHappens(4866);
@@ -72,7 +72,7 @@ struct boss_mr_smiteAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
bool bCheckChances()
@@ -93,35 +93,35 @@ struct boss_mr_smiteAI : public ScriptedAI
if (uiTrashTimer <= uiDiff)
{
if (bCheckChances())
DoCast(m_creature, SPELL_TRASH);
DoCast(me, SPELL_TRASH);
uiTrashTimer = urand(6000,15500);
} else uiTrashTimer -= uiDiff;
if (uiSlamTimer <= uiDiff)
{
if (bCheckChances())
DoCast(m_creature->getVictim(), SPELL_SMITE_SLAM);
DoCast(me->getVictim(), SPELL_SMITE_SLAM);
uiSlamTimer = 11000;
} else uiSlamTimer -= uiDiff;
if (uiNimbleReflexesTimer <= uiDiff)
{
if (bCheckChances())
DoCast(m_creature, SPELL_NIMBLE_REFLEXES);
DoCast(me, SPELL_NIMBLE_REFLEXES);
uiNimbleReflexesTimer = urand(27300,60100);
} else uiNimbleReflexesTimer -= uiDiff;
/*END ACID-AI*/
if (uiHealth == 0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66 || uiHealth == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33)
if (uiHealth == 0 && me->GetHealth()*100 / me->GetMaxHealth() <= 66 || uiHealth == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 33)
{
++uiHealth;
DoCastAOE(SPELL_SMITE_STOMP,false);
SetCombatMovement(false);
if (pInstance)
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_SMITE_CHEST)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_SMITE_CHEST)))
{
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(1,-3.00+pGo->GetPositionX(),pGo->GetPositionY(),pGo->GetPositionZ());
}
}
@@ -132,7 +132,7 @@ struct boss_mr_smiteAI : public ScriptedAI
switch(uiPhase)
{
case 1:
m_creature->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
me->HandleEmoteCommand(EMOTE_STATE_KNEEL); //dosen't work?
uiTimer = 1000;
uiPhase = 2;
break;
@@ -146,7 +146,7 @@ struct boss_mr_smiteAI : public ScriptedAI
break;
case 3:
SetCombatMovement(true);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), me->m_CombatDistance);
me->GetMotionMaster()->MoveChase(me->getVictim(), me->m_CombatDistance);
uiPhase = 0;
break;
+8 -8
View File
@@ -44,8 +44,8 @@ struct npc_narm_faulkAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->SetStandState(UNIT_STAND_STATE_DEAD);
spellHit = false;
}
@@ -60,7 +60,7 @@ struct npc_narm_faulkAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (m_creature->IsStandState())
if (me->IsStandState())
{
if (lifeTimer <= diff)
{
@@ -76,11 +76,11 @@ struct npc_narm_faulkAI : public ScriptedAI
{
if (Spellkind->Id == 8593 && !spellHit)
{
DoCast(m_creature, 32343);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//m_creature->RemoveAllAuras();
DoScriptText(SAY_HEAL, m_creature);
DoCast(me, 32343);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//me->RemoveAllAuras();
DoScriptText(SAY_HEAL, me);
spellHit = true;
}
}
+5 -5
View File
@@ -70,7 +70,7 @@ struct boss_twilight_corrupterAI : public ScriptedAI
}
void EnterCombat(Unit* who)
{
m_creature->MonsterYell("The Nightmare cannot be stopped!",0,m_creature->GetGUID());
me->MonsterYell("The Nightmare cannot be stopped!",0,me->GetGUID());
}
void KilledUnit(Unit* victim)
@@ -78,11 +78,11 @@ struct boss_twilight_corrupterAI : public ScriptedAI
if (victim->GetTypeId() == TYPEID_PLAYER)
{
++KillCount;
m_creature->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
me->MonsterTextEmote("Twilight Corrupter squeezes the last bit of life out of $N and swallows their soul.", victim->GetGUID(),true);
if (KillCount == 3)
{
DoCast(m_creature, SPELL_LEVEL_UP, true);
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
}
@@ -94,12 +94,12 @@ struct boss_twilight_corrupterAI : public ScriptedAI
return;
if (SoulCorruption_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SOUL_CORRUPTION);
DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION);
SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers
} else SoulCorruption_Timer-=diff;
if (CreatureOfNightmare_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE);
CreatureOfNightmare_Timer = 45000; //gotta confirm Timers
} else CreatureOfNightmare_Timer-=diff;
DoMeleeAttackIfReady();
@@ -45,7 +45,7 @@ struct mobs_ghoul_flayerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
}
};
@@ -89,8 +89,8 @@ struct npc_darrowshire_spiritAI : public ScriptedAI
void Reset()
{
DoCast(m_creature, SPELL_SPIRIT_SPAWNIN);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_SPIRIT_SPAWNIN);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void EnterCombat(Unit *who) {}
@@ -43,8 +43,8 @@ struct npc_henze_faulkAI : public ScriptedAI
void Reset()
{
lifeTimer = 120000;
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->SetStandState(UNIT_STAND_STATE_DEAD); // lay down
spellHit = false;
}
@@ -59,7 +59,7 @@ struct npc_henze_faulkAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (m_creature->IsStandState())
if (me->IsStandState())
{
if (lifeTimer <= diff)
{
@@ -75,11 +75,11 @@ struct npc_henze_faulkAI : public ScriptedAI
{
if (Spellkind->Id == 8593 && !spellHit)
{
DoCast(m_creature, 32343);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//m_creature->RemoveAllAuras();
DoScriptText(SAY_HEAL, m_creature);
DoCast(me, 32343);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
//me->RemoveAllAuras();
DoScriptText(SAY_HEAL, me);
spellHit = true;
}
}
+36 -36
View File
@@ -61,9 +61,9 @@ struct npc_prospector_anvilwardAI : public npc_escortAI
switch (i)
{
case 0: DoScriptText(SAY_ANVIL1, m_creature, pPlayer); break;
case 5: DoScriptText(SAY_ANVIL2, m_creature, pPlayer); break;
case 6: m_creature->setFaction(24); break;
case 0: DoScriptText(SAY_ANVIL1, me, pPlayer); break;
case 5: DoScriptText(SAY_ANVIL2, me, pPlayer); break;
case 6: me->setFaction(24); break;
}
}
@@ -191,15 +191,15 @@ struct npc_secondTrialAI : public ScriptedAI
questPhase = 0;
summonerGuid = 0;
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
m_creature->setFaction(FACTION_FRIENDLY);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL);
me->setFaction(FACTION_FRIENDLY);
spellFlashLight = false;
spellJustice = false;
spellJudLight = false;
spellCommand = false;
switch(m_creature->GetEntry())
switch(me->GetEntry())
{
case CHAMPION_BLOODWRATH:
spellFlashLight = true;
@@ -231,13 +231,13 @@ struct npc_secondTrialAI : public ScriptedAI
if (questPhase == 1)
if (timer <= diff)
{
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
m_creature->setFaction(FACTION_HOSTILE);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND);
me->setFaction(FACTION_HOSTILE);
questPhase = 0;
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
m_creature->AddThreat(pTarget, 5000000.0f);
me->AddThreat(pTarget, 5000000.0f);
AttackStart(pTarget);
}
}
@@ -249,10 +249,10 @@ struct npc_secondTrialAI : public ScriptedAI
// healer
if (spellFlashLight)
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 70)
if (me->GetHealth()*100 / me->GetMaxHealth() < 70)
if (timerFlashLight <= diff)
{
DoCast(m_creature, SPELL_FLASH_OF_LIGHT);
DoCast(me, SPELL_FLASH_OF_LIGHT);
timerFlashLight = TIMER_FLASH_OF_LIGHT + rand()%TIMER_FLASH_OF_LIGHT;
}
else
@@ -261,7 +261,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellJustice)
if (timerJustice <= diff)
{
DoCast(m_creature, SPELL_SEAL_OF_JUSTICE);
DoCast(me, SPELL_SEAL_OF_JUSTICE);
timerJustice = TIMER_SEAL_OF_JUSTICE + rand()%TIMER_SEAL_OF_JUSTICE;
}
else
@@ -270,7 +270,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellJudLight)
if (timerJudLight <= diff)
{
DoCast(m_creature, SPELL_JUDGEMENT_OF_LIGHT);
DoCast(me, SPELL_JUDGEMENT_OF_LIGHT);
timerJudLight = TIMER_JUDGEMENT_OF_LIGHT + rand()%TIMER_JUDGEMENT_OF_LIGHT;
}
else
@@ -279,7 +279,7 @@ struct npc_secondTrialAI : public ScriptedAI
if (spellCommand)
if (timerCommand <= diff)
{
DoCast(m_creature, TIMER_SEAL_OF_COMMAND);
DoCast(me, TIMER_SEAL_OF_COMMAND);
timerCommand = TIMER_SEAL_OF_COMMAND + rand()%TIMER_SEAL_OF_COMMAND;
}
else
@@ -333,23 +333,23 @@ struct master_kelerun_bloodmournAI : public ScriptedAI
{
if (timer <= diff)
{
if (Creature* paladinSpawn = Unit::GetCreature((*m_creature), paladinGuid[paladinPhase]))
if (Creature* paladinSpawn = Unit::GetCreature((*me), paladinGuid[paladinPhase]))
{
CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(m_creature->GetGUID());
CAST_AI(npc_secondTrialAI, paladinSpawn->AI())->Activate(me->GetGUID());
switch(paladinPhase)
{
case 0:
DoScriptText(TEXT_SECOND_TRIAL_1,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_1,me);
break;
case 1:
DoScriptText(TEXT_SECOND_TRIAL_2,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_2,me);
break;
case 2:
DoScriptText(TEXT_SECOND_TRIAL_3,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_3,me);
break;
case 3:
DoScriptText(TEXT_SECOND_TRIAL_4,m_creature);
DoScriptText(TEXT_SECOND_TRIAL_4,me);
break;
}
}
@@ -431,11 +431,11 @@ void npc_secondTrialAI::JustDied(Unit* Killer)
{
if (Killer->GetTypeId() == TYPEID_PLAYER)
{
if (Creature *pSummoner = Unit::GetCreature((*m_creature), summonerGuid))
if (Creature *pSummoner = Unit::GetCreature((*me), summonerGuid))
CAST_AI(master_kelerun_bloodmournAI, pSummoner->AI())->SecondTrialKill();
// last kill quest complete for group
if (m_creature->GetEntry() == CHAMPION_SUNSTRIKER)
if (me->GetEntry() == CHAMPION_SUNSTRIKER)
{
if (Group *pGroup = CAST_PLR(Killer)->GetGroup())
{
@@ -444,7 +444,7 @@ void npc_secondTrialAI::JustDied(Unit* Killer)
Player *pGroupGuy = itr->getSource();
// for any leave or dead (with not released body) group member at appropriate distance
if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(m_creature) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
if (pGroupGuy && pGroupGuy->IsAtGroupRewardDistance(me) && !pGroupGuy->GetCorpse() && pGroupGuy->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
pGroupGuy->CompleteQuest(QUEST_SECOND_TRIAL);
}
}
@@ -500,7 +500,7 @@ bool GOHello_go_second_trial(Player* pPlayer, GameObject* pGO)
struct npc_apprentice_mirvedaAI : public ScriptedAI
{
npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(m_creature) {}
npc_apprentice_mirvedaAI(Creature* c) : ScriptedAI(c), Summons(me) {}
uint32 KillCount;
uint64 PlayerGUID;
@@ -519,7 +519,7 @@ struct npc_apprentice_mirvedaAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
Summons.Summon(summoned);
}
@@ -544,9 +544,9 @@ struct npc_apprentice_mirvedaAI : public ScriptedAI
if (Summon)
{
m_creature->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
m_creature->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
me->SummonCreature(MOB_GHARZUL, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32, 35.22, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
Summon = false;
}
}
@@ -613,7 +613,7 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit* who)
{
if (!Progress && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
if (!Progress && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE)
{
@@ -627,7 +627,7 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -641,14 +641,14 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
{
if (EndTimer < diff && Progress)
{
DoScriptText(EMOTE, m_creature);
DoScriptText(EMOTE, me);
Completed = true;
if (PlayerGUID)
if (Player* pPlayer = Unit::GetPlayer(PlayerGUID))
CAST_PLR(pPlayer)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES);
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
} else EndTimer -= diff;
if (WaveTimer < diff && !Completed && Progress)
@@ -656,9 +656,9 @@ struct npc_infused_crystalAI : public Scripted_NoMovementAI
uint32 ran1 = rand()%8;
uint32 ran2 = rand()%8;
uint32 ran3 = rand()%8;
m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
m_creature->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
WaveTimer = 30000;
} else WaveTimer -= diff;
}
+17 -17
View File
@@ -166,44 +166,44 @@ struct npc_ranger_lilathaAI : public npc_escortAI
{
case 0:
{
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, m_creature, pPlayer);
DoScriptText(SAY_START, me, pPlayer);
break;
}
case 5:
DoScriptText(SAY_PROGRESS1, m_creature, pPlayer);
DoScriptText(SAY_PROGRESS1, me, pPlayer);
case 11:
DoScriptText(SAY_PROGRESS2, m_creature, pPlayer);
m_creature->SetOrientation(4.762841);
DoScriptText(SAY_PROGRESS2, me, pPlayer);
me->SetOrientation(4.762841);
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, m_creature, pPlayer);
Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0);
DoScriptText(SAY_PROGRESS3, me, pPlayer);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(m_creature, true);
Summ1->Attack(me, true);
Summ2->Attack(pPlayer, true);
}
m_creature->AI()->AttackStart(Summ1);
me->AI()->AttackStart(Summ1);
break;
}
case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 25: m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 19: me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 25: me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break;
case 30:
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,me);
break;
case 32:
m_creature->SetOrientation(2.978281);
DoScriptText(SAY_END1, m_creature, pPlayer);
me->SetOrientation(2.978281);
DoScriptText(SAY_END1, me, pPlayer);
break;
case 33:
m_creature->SetOrientation(5.858011);
DoScriptText(SAY_END2, m_creature, pPlayer);
me->SetOrientation(5.858011);
DoScriptText(SAY_END2, me, pPlayer);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, pPlayer);
@@ -133,7 +133,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
{
if (GameObject* pGo = GameObject::GetGameObject(*m_creature, *itr))
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
{
if (pGo)
{
@@ -144,7 +144,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
trigger->CastSpell(trigger,35470,true);
}
pGo->RemoveFromWorld();
//pGo->CastSpell(m_creature,12158); makes all die?!
//pGo->CastSpell(me,12158); makes all die?!
}
}
}
@@ -152,11 +152,11 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
if (bBool)
{
if (pInstance)
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
pInstance->HandleGameObject(NULL,false,pGo);
}else
if (pInstance)
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
pInstance->HandleGameObject(NULL,false,pGo);
}
@@ -167,11 +167,11 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
if (bBool)
{
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
m_creature->SetFacingToObject(pGo);
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
me->SetFacingToObject(pGo);
}else
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
m_creature->SetFacingToObject(pGo);
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
me->SetFacingToObject(pGo);
}
void RestoreAll()
@@ -179,23 +179,23 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
if (!pInstance)
return;
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
pInstance->HandleGameObject(NULL,false,pGo);
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
pInstance->HandleGameObject(NULL,false,pGo);
if (!GoSummonList.empty())
for (std::list<uint64>::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
{
if (GameObject* pGo = GameObject::GetGameObject(*m_creature, *itr))
if (GameObject* pGo = GameObject::GetGameObject(*me, *itr))
pGo->RemoveFromWorld();
}
if (!SummonList.empty())
for (std::list<uint64>::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
{
if (Creature* pSummon = Unit::GetCreature(*m_creature, *itr))
if (Creature* pSummon = Unit::GetCreature(*me, *itr))
{
if (pSummon->isAlive())
pSummon->DisappearAndDie();
@@ -207,7 +207,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
void AggroAllPlayers(Creature* pTemp)
{
Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
@@ -233,8 +233,8 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
{
//just in case
if (GetPlayerForEscort())
if (m_creature->getFaction() != GetPlayerForEscort()->getFaction())
m_creature->setFaction(GetPlayerForEscort()->getFaction());
if (me->getFaction() != GetPlayerForEscort()->getFaction())
me->setFaction(GetPlayerForEscort()->getFaction());
switch(uiPoint)
{
@@ -266,7 +266,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
break;
case 14:
SetInFace(false);
DoScriptText(SAY_BLASTMASTER_26,m_creature);
DoScriptText(SAY_BLASTMASTER_26,me);
SetEscortPaused(true);
NextStep(5000,false,20);
break;
@@ -279,7 +279,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
{
case 1:
SetEscortPaused(true);
DoScriptText(SAY_BLASTMASTER_0,m_creature);
DoScriptText(SAY_BLASTMASTER_0,me);
NextStep(1500,true);
break;
case 2:
@@ -305,19 +305,19 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
switch(uiCase)
{
case 1:
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[4], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[5], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[6], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[7], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[8], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[9], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 2:
if (GameObject* pGo = m_creature->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000))
if (GameObject* pGo = me->SummonGameObject(183410, -533.140,-105.322,-156.016, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
@@ -325,34 +325,34 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
Summon(3);
break;
case 3:
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
DoScriptText(SAY_BLASTMASTER_19,m_creature);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
DoScriptText(SAY_BLASTMASTER_19,me);
break;
case 4:
if (GameObject* pGo = m_creature->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000))
if (GameObject* pGo = me->SummonGameObject(183410, -542.199,-96.854,-155.790, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
}
break;
case 5:
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
DoScriptText(SAY_BLASTMASTER_15,m_creature);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
DoScriptText(SAY_BLASTMASTER_15,me);
break;
case 6:
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
m_creature->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[10], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[11], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[12], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[13], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CAVERNDEEP_AMBUSHER, SpawnPosition[14], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
case 7:
if (GameObject* pGo = m_creature->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000))
if (GameObject* pGo = me->SummonGameObject(183410, -507.820,-103.333,-151.353, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
@@ -360,16 +360,16 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
}
break;
case 8:
if (GameObject* pGo = m_creature->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000))
if (GameObject* pGo = me->SummonGameObject(183410, -511.829,-86.249,-151.431, 0, 0, 0, 0, 0, 1000))
{
GoSummonList.push_back(pGo->GetGUID());
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1); //We can't use it!
}
break;
case 9:
if (Creature* pGrubbis = m_creature->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
if (Creature* pGrubbis = me->SummonCreature(NPC_GRUBBIS, SpawnPosition[15], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000))
DoScriptText(SAY_GRUBBIS,pGrubbis);
m_creature->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
me->SummonCreature(NPC_CHOMPER, SpawnPosition[16], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1800000);
break;
}
}
@@ -383,7 +383,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
switch(uiPhase)
{
case 1:
DoScriptText(SAY_BLASTMASTER_1,m_creature);
DoScriptText(SAY_BLASTMASTER_1,me);
NextStep(1500,true);
break;
case 2:
@@ -391,34 +391,34 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
NextStep(0,false,0);
break;
case 3:
DoScriptText(SAY_BLASTMASTER_2,m_creature);
DoScriptText(SAY_BLASTMASTER_2,me);
SetEscortPaused(false);
NextStep(0,false,0);
break;
case 4:
DoScriptText(SAY_BLASTMASTER_3,m_creature);
DoScriptText(SAY_BLASTMASTER_3,me);
NextStep(3000,true);
break;
case 5:
DoScriptText(SAY_BLASTMASTER_4,m_creature);
DoScriptText(SAY_BLASTMASTER_4,me);
NextStep(3000,true);
break;
case 6:
SetInFace(true);
DoScriptText(SAY_BLASTMASTER_5,m_creature);
DoScriptText(SAY_BLASTMASTER_5,me);
Summon(1);
if (pInstance)
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_RIGHT)))
pInstance->HandleGameObject(NULL,true,pGo);
NextStep(3000,true);
break;
case 7:
DoScriptText(SAY_BLASTMASTER_6,m_creature);
DoScriptText(SAY_BLASTMASTER_6,me);
SetEscortPaused(false);
NextStep(0,false,0);
break;
case 8:
m_creature->HandleEmoteCommand(EMOTE_STATE_WORK);
me->HandleEmoteCommand(EMOTE_STATE_WORK);
NextStep(25000,true);
break;
case 9:
@@ -430,37 +430,37 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
NextStep(0,false);
break;
case 11:
DoScriptText(SAY_BLASTMASTER_17,m_creature);
DoScriptText(SAY_BLASTMASTER_17,me);
NextStep(5000,true);
break;
case 12:
DoScriptText(SAY_BLASTMASTER_18,m_creature);
DoScriptText(SAY_BLASTMASTER_18,me);
NextStep(5000,true);
break;
case 13:
DoScriptText(SAY_BLASTMASTER_20,m_creature);
DoScriptText(SAY_BLASTMASTER_20,me);
CaveDestruction(true);
NextStep(8000,true);
break;
case 14:
DoScriptText(SAY_BLASTMASTER_21,m_creature);
DoScriptText(SAY_BLASTMASTER_21,me);
NextStep(8500,true);
break;
case 15:
DoScriptText(SAY_BLASTMASTER_22,m_creature);
DoScriptText(SAY_BLASTMASTER_22,me);
NextStep(2000,true);
break;
case 16:
DoScriptText(SAY_BLASTMASTER_23,m_creature);
DoScriptText(SAY_BLASTMASTER_23,me);
SetInFace(false);
if (pInstance)
if (GameObject* pGo = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
if (GameObject* pGo = GameObject::GetGameObject((*me),pInstance->GetData64(DATA_GO_CAVE_IN_LEFT)))
pInstance->HandleGameObject(NULL,true,pGo);
NextStep(2000,true);
break;
case 17:
SetEscortPaused(false);
DoScriptText(SAY_BLASTMASTER_24,m_creature);
DoScriptText(SAY_BLASTMASTER_24,me);
Summon(6);
NextStep(0,false);
break;
@@ -471,11 +471,11 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
case 19:
SetInFace(false);
Summon(8);
DoScriptText(SAY_BLASTMASTER_25,m_creature);
DoScriptText(SAY_BLASTMASTER_25,me);
NextStep(0,false);
break;
case 20:
DoScriptText(SAY_BLASTMASTER_27,m_creature);
DoScriptText(SAY_BLASTMASTER_27,me);
NextStep(2000,true);
break;
case 21:
@@ -484,7 +484,7 @@ struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI
break;
case 22:
CaveDestruction(false);
DoScriptText(SAY_BLASTMASTER_20,m_creature);
DoScriptText(SAY_BLASTMASTER_20,me);
NextStep(0,false);
break;
}
@@ -545,10 +545,10 @@ struct boss_grubbisAI : public ScriptedAI
void SetDataSummoner()
{
if (!m_creature->isSummon())
if (!me->isSummon())
return;
if (Unit* pSummon = CAST_SUM(m_creature)->GetSummoner())
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2,1);
}
@@ -562,10 +562,10 @@ struct boss_grubbisAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
if (!m_creature->isSummon())
if (!me->isSummon())
return;
if (Unit* pSummon = CAST_SUM(m_creature)->GetSummoner())
if (Unit* pSummon = CAST_SUM(me)->GetSummoner())
CAST_CRE(pSummon)->AI()->SetData(2,2);
}
};
+18 -18
View File
@@ -61,15 +61,15 @@ struct npc_00x09hlAI : public npc_escortAI
switch(uiPointId)
{
case 26:
DoScriptText(SAY_OOX_AMBUSH, m_creature);
DoScriptText(SAY_OOX_AMBUSH, me);
break;
case 43:
DoScriptText(SAY_OOX_AMBUSH, m_creature);
DoScriptText(SAY_OOX_AMBUSH, me);
break;
case 64:
DoScriptText(SAY_OOX_END, m_creature);
DoScriptText(SAY_OOX_END, me);
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature);
pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, me);
break;
}
}
@@ -92,8 +92,8 @@ struct npc_00x09hlAI : public npc_escortAI
{
const Position src = {-141.151581f, -4291.213867f, 120.130f, 0};
Position dst;
m_creature->GetRandomPoint(src, 7.0f, dst);
m_creature->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
me->GetRandomPoint(src, 7.0f, dst);
me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000);
}
break;
}
@@ -105,14 +105,14 @@ struct npc_00x09hlAI : public npc_escortAI
return;
if (rand()%1)
DoScriptText(SAY_OOX_AGGRO1, m_creature);
DoScriptText(SAY_OOX_AGGRO1, me);
else
DoScriptText(SAY_OOX_AGGRO2, m_creature);
DoScriptText(SAY_OOX_AGGRO2, me);
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
pSummoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
}
};
@@ -218,7 +218,7 @@ struct npc_rinjiAI : public npc_escortAI
return;
//only if attacked and escorter is not in combat?
DoScriptText(RAND(SAY_RIN_HELP_1,SAY_RIN_HELP_2), m_creature);
DoScriptText(RAND(SAY_RIN_HELP_1,SAY_RIN_HELP_2), me);
}
}
@@ -227,13 +227,13 @@ struct npc_rinjiAI : public npc_escortAI
if (!bFirst)
m_iSpawnId = 1;
m_creature->SummonCreature(NPC_RANGER,
me->SummonCreature(NPC_RANGER,
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
for (int i = 0; i < 2; ++i)
{
m_creature->SummonCreature(NPC_OUTRUNNER,
me->SummonCreature(NPC_OUTRUNNER,
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
}
@@ -255,7 +255,7 @@ struct npc_rinjiAI : public npc_escortAI
switch(uiPointId)
{
case 1:
DoScriptText(SAY_RIN_FREE, m_creature, pPlayer);
DoScriptText(SAY_RIN_FREE, me, pPlayer);
break;
case 7:
DoSpawnAmbush(true);
@@ -264,8 +264,8 @@ struct npc_rinjiAI : public npc_escortAI
DoSpawnAmbush(false);
break;
case 17:
DoScriptText(SAY_RIN_COMPLETE, m_creature, pPlayer);
pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, m_creature);
DoScriptText(SAY_RIN_COMPLETE, me, pPlayer);
pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
SetRun();
m_uiPostEventCount = 1;
break;
@@ -288,18 +288,18 @@ struct npc_rinjiAI : public npc_escortAI
switch(m_uiPostEventCount)
{
case 1:
DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer);
DoScriptText(SAY_RIN_PROGRESS_1, me, pPlayer);
++m_uiPostEventCount;
break;
case 2:
DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer);
DoScriptText(SAY_RIN_PROGRESS_2, me, pPlayer);
m_uiPostEventCount = 0;
break;
}
}
else
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
return;
}
}
@@ -63,13 +63,13 @@ struct npc_converted_sentryAI : public ScriptedAI
{
uint32 i = urand(1,2);
if (i == 1)
DoScriptText(SAY_CONVERTED_1, m_creature);
DoScriptText(SAY_CONVERTED_1, me);
else
DoScriptText(SAY_CONVERTED_2, m_creature);
DoScriptText(SAY_CONVERTED_2, me);
DoCast(m_creature, SPELL_CONVERT_CREDIT);
if (m_creature->isPet())
CAST_PET(m_creature)->SetDuration(7500);
DoCast(me, SPELL_CONVERT_CREDIT);
if (me->isPet())
CAST_PET(me)->SetDuration(7500);
Credit = true;
} else Timer -= diff;
}
@@ -107,20 +107,20 @@ struct npc_greengill_slaveAI : public ScriptedAI
if (!caster)
return;
if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE))
if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !me->HasAura(ENRAGE))
{
PlayerGUID = caster->GetGUID();
if (PlayerGUID)
{
Unit* plr = Unit::GetUnit((*m_creature), PlayerGUID);
Unit* plr = Unit::GetUnit((*me), PlayerGUID);
if (plr && CAST_PLR(plr)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
DoCast(plr, 45110, true);
}
DoCast(m_creature, ENRAGE);
DoCast(me, ENRAGE);
Unit* Myrmidon = me->FindNearestCreature(DM, 70);
if (Myrmidon)
{
m_creature->AddThreat(Myrmidon, 100000.0f);
me->AddThreat(Myrmidon, 100000.0f);
AttackStart(Myrmidon);
}
}
@@ -60,22 +60,22 @@ struct boss_curatorAI : public ScriptedAI
Enraged = false;
Evocating = false;
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -89,17 +89,17 @@ struct boss_curatorAI : public ScriptedAI
//if evocate, then break evocate
if (Evocating)
{
if (m_creature->HasAura(SPELL_EVOCATION))
m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION);
if (me->HasAura(SPELL_EVOCATION))
me->RemoveAurasDueToSpell(SPELL_EVOCATION);
Evocating = false;
}
//may not be correct SAY (generic hard enrage)
DoScriptText(SAY_ENRAGE, m_creature);
DoScriptText(SAY_ENRAGE, me);
m_creature->InterruptNonMeleeSpells(true);
DoCast(m_creature, SPELL_BERSERK);
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_BERSERK);
//don't know if he's supposed to do summon/evocate after hard enrage (probably not)
Enraged = true;
@@ -108,7 +108,7 @@ struct boss_curatorAI : public ScriptedAI
if (Evocating)
{
//not supposed to do anything while evocate
if (m_creature->HasAura(SPELL_EVOCATION))
if (me->HasAura(SPELL_EVOCATION))
return;
else
Evocating = false;
@@ -130,17 +130,17 @@ struct boss_curatorAI : public ScriptedAI
}
//Reduce Mana by 10% of max health
if (int32 mana = m_creature->GetMaxPower(POWER_MANA))
if (int32 mana = me->GetMaxPower(POWER_MANA))
{
mana /= 10;
m_creature->ModifyPower(POWER_MANA, -mana);
me->ModifyPower(POWER_MANA, -mana);
//if this get's us below 10%, then we evocate (the 10th should be summoned now)
if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10)
if (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10)
{
DoScriptText(SAY_EVOCATE, m_creature);
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_EVOCATION);
DoScriptText(SAY_EVOCATE, me);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_EVOCATION);
Evocating = true;
//no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected
return;
@@ -149,7 +149,7 @@ struct boss_curatorAI : public ScriptedAI
{
if (urand(0,1) == 0)
{
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
}
}
}
@@ -157,11 +157,11 @@ struct boss_curatorAI : public ScriptedAI
AddTimer = 10000;
} else AddTimer -= diff;
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15)
if (me->GetHealth()*100 / me->GetMaxHealth() <= 15)
{
Enraged = true;
DoCast(m_creature, SPELL_ENRAGE);
DoScriptText(SAY_ENRAGE, m_creature);
DoCast(me, SPELL_ENRAGE);
DoScriptText(SAY_ENRAGE, me);
}
}
@@ -63,17 +63,17 @@ struct boss_maiden_of_virtueAI : public ScriptedAI
void KilledUnit(Unit* Victim)
{
if (urand(0,1) == 0)
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit* Killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -83,20 +83,20 @@ struct boss_maiden_of_virtueAI : public ScriptedAI
if (Enrage_Timer < diff && !Enraged)
{
DoCast(m_creature, SPELL_BERSERK, true);
DoCast(me, SPELL_BERSERK, true);
Enraged = true;
} else Enrage_Timer -= diff;
if (Holyground_Timer <= diff)
{
DoCast(m_creature, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
DoCast(me, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all
Holyground_Timer = 3000;
} else Holyground_Timer -= diff;
if (Repentance_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REPENTANCE);
DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), m_creature);
DoCast(me->getVictim(), SPELL_REPENTANCE);
DoScriptText(RAND(SAY_REPENTANCE1,SAY_REPENTANCE2), me);
Repentance_Timer = urand(25000,35000); //A little randomness on that spell
} else Repentance_Timer -= diff;
@@ -58,8 +58,8 @@ struct boss_midnightAI : public ScriptedAI
Attumen = 0;
Mount_Timer = 0;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_ON);
}
void EnterCombat(Unit* who) {}
@@ -68,7 +68,7 @@ struct boss_midnightAI : public ScriptedAI
{
if (Phase == 2)
{
if (Unit *pUnit = Unit::GetUnit(*m_creature, Attumen))
if (Unit *pUnit = Unit::GetUnit(*me, Attumen))
DoScriptText(SAY_MIDNIGHT_KILL, pUnit);
}
}
@@ -78,20 +78,20 @@ struct boss_midnightAI : public ScriptedAI
if (!UpdateVictim())
return;
if (Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95)
if (Phase == 1 && (me->GetHealth()*100)/me->GetMaxHealth() < 95)
{
Phase = 2;
if (Creature* pAttumen = m_creature->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
if (Creature* pAttumen = me->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000))
{
Attumen = pAttumen->GetGUID();
pAttumen->AI()->AttackStart(m_creature->getVictim());
SetMidnight(pAttumen, m_creature->GetGUID());
pAttumen->AI()->AttackStart(me->getVictim());
SetMidnight(pAttumen, me->GetGUID());
DoScriptText(RAND(SAY_APPEAR1,SAY_APPEAR2,SAY_APPEAR3), pAttumen);
}
}
else if (Phase == 2 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
else if (Phase == 2 && (me->GetHealth()*100)/me->GetMaxHealth() < 25)
{
if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen))
if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
Mount(pAttumen);
}
else if (Phase == 3)
@@ -101,9 +101,9 @@ struct boss_midnightAI : public ScriptedAI
if (Mount_Timer <= diff)
{
Mount_Timer = 0;
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->GetMotionMaster()->MoveIdle();
if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen))
me->SetVisibility(VISIBILITY_OFF);
me->GetMotionMaster()->MoveIdle();
if (Unit *pAttumen = Unit::GetUnit(*me, Attumen))
{
pAttumen->SetDisplayId(MOUNTED_DISPLAYID);
pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -126,20 +126,20 @@ struct boss_midnightAI : public ScriptedAI
{
DoScriptText(SAY_MOUNT, pAttumen);
Phase = 3;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float angle = m_creature->GetAngle(pAttumen);
float distance = m_creature->GetDistance2d(pAttumen);
float newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ;
float newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ;
float angle = me->GetAngle(pAttumen);
float distance = me->GetDistance2d(pAttumen);
float newX = me->GetPositionX() + cos(angle)*(distance/2) ;
float newY = me->GetPositionY() + sin(angle)*(distance/2) ;
float newZ = 50;
//m_creature->Relocate(newX,newY,newZ,angle);
//m_creature->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
//me->Relocate(newX,newY,newZ,angle);
//me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
distance += 10;
newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ;
newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ;
newX = me->GetPositionX() + cos(angle)*(distance/2) ;
newY = me->GetPositionY() + sin(angle)*(distance/2) ;
pAttumen->GetMotionMaster()->Clear();
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
//pAttumen->Relocate(newX,newY,newZ,-angle);
@@ -185,13 +185,13 @@ struct boss_attumenAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight))
DoScriptText(SAY_DEATH, me);
if (Unit *pMidnight = Unit::GetUnit(*me, Midnight))
pMidnight->Kill(pMidnight);
}
@@ -202,15 +202,15 @@ struct boss_attumenAI : public ScriptedAI
if (ResetTimer <= diff)
{
ResetTimer = 0;
Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight);
Unit *pMidnight = Unit::GetUnit(*me, Midnight);
if (pMidnight)
{
pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pMidnight->SetVisibility(VISIBILITY_ON);
}
Midnight = 0;
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->Kill(m_creature);
me->SetVisibility(VISIBILITY_OFF);
me->Kill(me);
}
} else ResetTimer -= diff;
@@ -218,38 +218,38 @@ struct boss_attumenAI : public ScriptedAI
if (!UpdateVictim())
return;
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))
return;
if (CleaveTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE);
DoCast(me->getVictim(), SPELL_SHADOWCLEAVE);
CleaveTimer = urand(10000,15000);
} else CleaveTimer -= diff;
if (CurseTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
CurseTimer = 30000;
} else CurseTimer -= diff;
if (RandomYellTimer <= diff)
{
DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), m_creature);
DoScriptText(RAND(SAY_RANDOM1,SAY_RANDOM2), me);
RandomYellTimer = urand(30000,60000);
} else RandomYellTimer -= diff;
if (m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
if (me->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID)
{
if (ChargeTimer <= diff)
{
Unit *pTarget;
std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
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(*m_creature, (*itr)->getUnitGuid());
if (pTarget && !pTarget->IsWithinDist(m_creature, ATTACK_DISTANCE, false))
pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && !pTarget->IsWithinDist(me, ATTACK_DISTANCE, false))
target_list.push_back(pTarget);
pTarget = NULL;
}
@@ -262,13 +262,13 @@ struct boss_attumenAI : public ScriptedAI
}
else
{
if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25)
if ((me->GetHealth()*100)/me->GetMaxHealth() < 25)
{
Creature *pMidnight = Unit::GetCreature(*m_creature, Midnight);
Creature *pMidnight = Unit::GetCreature(*me, Midnight);
if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT)
{
CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(m_creature);
m_creature->SetHealth(pMidnight->GetHealth());
CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(me);
me->SetHealth(pMidnight->GetHealth());
DoResetThreat();
}
}
@@ -280,7 +280,7 @@ struct boss_attumenAI : public ScriptedAI
void SpellHit(Unit *source, const SpellEntry *spell)
{
if (spell->Mechanic == MECHANIC_DISARM)
DoScriptText(SAY_DISARMED, m_creature);
DoScriptText(SAY_DISARMED, me);
}
};
@@ -93,7 +93,7 @@ struct boss_moroesAI : public ScriptedAI
Enrage = false;
InVanish = false;
if (m_creature->GetHealth() > 0)
if (me->GetHealth() > 0)
{
SpawnAdds();
}
@@ -114,19 +114,19 @@ struct boss_moroesAI : public ScriptedAI
{
StartEvent();
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
AddsAttack();
DoZoneInCombat();
}
void KilledUnit(Unit* victim)
{
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), m_creature);
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2,SAY_KILL_3), me);
}
void JustDied(Unit* victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_MOROES, DONE);
@@ -157,7 +157,7 @@ struct boss_moroesAI : public ScriptedAI
{
uint32 entry = *itr;
pCreature = m_creature->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
pCreature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
if (pCreature)
{
AddGUID[i] = pCreature->GetGUID();
@@ -169,7 +169,7 @@ struct boss_moroesAI : public ScriptedAI
{
for (uint8 i = 0; i < 4; ++i)
{
Creature *pCreature = m_creature->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
Creature *pCreature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
if (pCreature)
{
AddGUID[i] = pCreature->GetGUID();
@@ -195,7 +195,7 @@ struct boss_moroesAI : public ScriptedAI
Creature* Temp = NULL;
if (AddGUID[i])
{
Temp = Creature::GetCreature((*m_creature),AddGUID[i]);
Temp = Creature::GetCreature((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
Temp->DisappearAndDie();
}
@@ -209,10 +209,10 @@ struct boss_moroesAI : public ScriptedAI
Creature* Temp = NULL;
if (AddGUID[i])
{
Temp = Creature::GetCreature((*m_creature),AddGUID[i]);
Temp = Creature::GetCreature((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
{
Temp->AI()->AttackStart(m_creature->getVictim());
Temp->AI()->AttackStart(me->getVictim());
DoZoneInCombat(Temp);
} else
EnterEvadeMode();
@@ -231,9 +231,9 @@ struct boss_moroesAI : public ScriptedAI
return;
}
if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() < 30)
{
DoCast(m_creature, SPELL_FRENZY);
DoCast(me, SPELL_FRENZY);
Enrage = true;
}
@@ -244,10 +244,10 @@ struct boss_moroesAI : public ScriptedAI
Creature* Temp = NULL;
if (AddGUID[i])
{
Temp = Unit::GetCreature((*m_creature),AddGUID[i]);
Temp = Unit::GetCreature((*me),AddGUID[i]);
if (Temp && Temp->isAlive())
if (!Temp->getVictim())
Temp->AI()->AttackStart(m_creature->getVictim());
Temp->AI()->AttackStart(me->getVictim());
}
}
CheckAdds_Timer = 5000;
@@ -258,7 +258,7 @@ struct boss_moroesAI : public ScriptedAI
//Cast Vanish, then Garrote random victim
if (Vanish_Timer <= diff)
{
DoCast(m_creature, SPELL_VANISH);
DoCast(me, SPELL_VANISH);
InVanish = true;
Vanish_Timer = 30000;
Wait_Timer = 5000;
@@ -273,9 +273,9 @@ struct boss_moroesAI : public ScriptedAI
if (Blind_Timer <= diff)
{
std::list<Unit*> pTargets;
SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, m_creature->GetMeleeReach()*5, true);
SelectTargetList(pTargets, 5, SELECT_TARGET_RANDOM, me->GetMeleeReach()*5, true);
for (std::list<Unit*>::const_iterator i = pTargets.begin(); i != pTargets.end(); ++i)
if (!m_creature->IsWithinMeleeRange(*i))
if (!me->IsWithinMeleeRange(*i))
{
DoCast(*i, SPELL_BLIND);
break;
@@ -288,7 +288,7 @@ struct boss_moroesAI : public ScriptedAI
{
if (Wait_Timer <= diff)
{
DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), m_creature);
DoScriptText(RAND(SAY_SPECIAL_1,SAY_SPECIAL_2), me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
pTarget->CastSpell(pTarget, SPELL_GARROTE,true);
@@ -328,7 +328,7 @@ struct boss_moroes_guestAI : public ScriptedAI
return;
uint64 MoroesGUID = pInstance->GetData64(DATA_MOROES);
Creature* Moroes = (Unit::GetCreature((*m_creature), MoroesGUID));
Creature* Moroes = (Unit::GetCreature((*me), MoroesGUID));
if (Moroes)
{
for (uint8 i = 0; i < 4; ++i)
@@ -345,12 +345,12 @@ struct boss_moroes_guestAI : public ScriptedAI
uint64 TempGUID = GuestGUID[rand()%4];
if (TempGUID)
{
Unit* pUnit = Unit::GetUnit((*m_creature), TempGUID);
Unit* pUnit = Unit::GetUnit((*me), TempGUID);
if (pUnit && pUnit->isAlive())
return pUnit;
}
return m_creature;
return me;
}
void UpdateAI(const uint32 diff)
@@ -382,7 +382,7 @@ struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
MindFlay_Timer = 1000;
ShadowWordPain_Timer = 6000;
DoCast(m_creature, SPELL_SHADOWFORM, true);
DoCast(me, SPELL_SHADOWFORM, true);
boss_moroes_guestAI::Reset();
}
@@ -396,7 +396,7 @@ struct boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI
if (MindFlay_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MINDFLY);
DoCast(me->getVictim(), SPELL_MINDFLY);
MindFlay_Timer = 12000; // 3 sec channeled
} else MindFlay_Timer -= diff;
@@ -450,20 +450,20 @@ struct boss_baron_rafe_dreugerAI : public boss_moroes_guestAI
if (SealOfCommand_Timer <= diff)
{
DoCast(m_creature, SPELL_SEALOFCOMMAND);
DoCast(me, SPELL_SEALOFCOMMAND);
SealOfCommand_Timer = 32000;
JudgementOfCommand_Timer = 29000;
} else SealOfCommand_Timer -= diff;
if (JudgementOfCommand_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_JUDGEMENTOFCOMMAND);
DoCast(me->getVictim(), SPELL_JUDGEMENTOFCOMMAND);
JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
} else JudgementOfCommand_Timer -= diff;
if (HammerOfJustice_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMMEROFJUSTICE);
DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE);
HammerOfJustice_Timer = 12000;
} else HammerOfJustice_Timer -= diff;
}
@@ -505,7 +505,7 @@ struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
if (PowerWordShield_Timer <= diff)
{
DoCast(m_creature, SPELL_PWSHIELD);
DoCast(me, SPELL_PWSHIELD);
PowerWordShield_Timer = 15000;
} else PowerWordShield_Timer -= diff;
@@ -519,7 +519,7 @@ struct boss_lady_catriona_von_indiAI : public boss_moroes_guestAI
if (HolyFire_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HOLYFIRE);
DoCast(me->getVictim(), SPELL_HOLYFIRE);
HolyFire_Timer = 22000;
} else HolyFire_Timer -= diff;
@@ -569,7 +569,7 @@ struct boss_lady_keira_berrybuckAI : public boss_moroes_guestAI
if (DivineShield_Timer <= diff)
{
DoCast(m_creature, SPELL_DIVINESHIELD);
DoCast(me, SPELL_DIVINESHIELD);
DivineShield_Timer = 31000;
} else DivineShield_Timer -= diff;
@@ -632,19 +632,19 @@ struct boss_lord_robin_darisAI : public boss_moroes_guestAI
if (Hamstring_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
DoCast(me->getVictim(), SPELL_HAMSTRING);
Hamstring_Timer = 12000;
} else Hamstring_Timer -= diff;
if (MortalStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE);
DoCast(me->getVictim(), SPELL_MORTALSTRIKE);
MortalStrike_Timer = 18000;
} else MortalStrike_Timer -= diff;
if (WhirlWind_Timer <= diff)
{
DoCast(m_creature, SPELL_WHIRLWIND);
DoCast(me, SPELL_WHIRLWIND);
WhirlWind_Timer = 21000;
} else WhirlWind_Timer -= diff;
}
@@ -684,25 +684,25 @@ struct boss_lord_crispin_ferenceAI : public boss_moroes_guestAI
if (Disarm_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DISARM);
DoCast(me->getVictim(), SPELL_DISARM);
Disarm_Timer = 12000;
} else Disarm_Timer -= diff;
if (HeroicStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HEROICSTRIKE);
DoCast(me->getVictim(), SPELL_HEROICSTRIKE);
HeroicStrike_Timer = 10000;
} else HeroicStrike_Timer -= diff;
if (ShieldBash_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHIELDBASH);
DoCast(me->getVictim(), SPELL_SHIELDBASH);
ShieldBash_Timer = 13000;
} else ShieldBash_Timer -= diff;
if (ShieldWall_Timer <= diff)
{
DoCast(m_creature, SPELL_SHIELDWALL);
DoCast(me, SPELL_SHIELDWALL);
ShieldWall_Timer = 21000;
} else ShieldWall_Timer -= diff;
}
@@ -135,7 +135,7 @@ struct boss_netherspiteAI : public ScriptedAI
pos[BLUE_PORTAL] = (r>1 ? 1: 2); // Blue Portal not on the left side (0)
for (int i=0; i<3; ++i)
if (Creature *portal = m_creature->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
if (Creature *portal = me->SummonCreature(PortalID[i],PortalCoord[pos[i]][0],PortalCoord[pos[i]][1],PortalCoord[pos[i]][2],0,TEMPSUMMON_TIMED_DESPAWN,60000))
{
PortalGUID[i] = portal->GetGUID();
portal->AddAura(PortalVisual[i], portal);
@@ -146,9 +146,9 @@ struct boss_netherspiteAI : public ScriptedAI
{
for (int i=0; i<3; ++i)
{
if (Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[i]))
if (Creature *portal = Unit::GetCreature(*me, PortalGUID[i]))
portal->DisappearAndDie();
if (Creature *portal = Unit::GetCreature(*m_creature, BeamerGUID[i]))
if (Creature *portal = Unit::GetCreature(*me, BeamerGUID[i]))
portal->DisappearAndDie();
PortalGUID[i] = 0;
BeamTarget[i] = 0;
@@ -158,14 +158,14 @@ struct boss_netherspiteAI : public ScriptedAI
void UpdatePortals() // Here we handle the beams' behavior
{
for (int j=0; j<3; ++j) // j = color
if (Creature *portal = Unit::GetCreature(*m_creature, PortalGUID[j]))
if (Creature *portal = Unit::GetCreature(*me, PortalGUID[j]))
{
// the one who's been casted upon before
Unit *current = Unit::GetUnit(*portal, BeamTarget[j]);
// temporary store for the best suitable beam reciever
Unit *pTarget = m_creature;
Unit *pTarget = me;
if (Map* map = m_creature->GetMap())
if (Map* map = me->GetMap())
{
Map::PlayerList const& players = map->GetPlayers();
@@ -178,7 +178,7 @@ struct boss_netherspiteAI : public ScriptedAI
&& !p->HasAura(PlayerDebuff[j],0) // not exhausted
&& !p->HasAura(PlayerBuff[(j+1)%3],0) // not on another beam
&& !p->HasAura(PlayerBuff[(j+2)%3],0)
&& IsBetween(m_creature, p, portal)) // on the beam
&& IsBetween(me, p, portal)) // on the beam
pTarget = p;
}
}
@@ -207,41 +207,41 @@ struct boss_netherspiteAI : public ScriptedAI
}
}
// aggro target if Red Beam
if (j == RED_PORTAL && m_creature->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
m_creature->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(m_creature->getVictim()));
if (j == RED_PORTAL && me->getVictim() != pTarget && pTarget->GetTypeId() == TYPEID_PLAYER)
me->getThreatManager().addThreat(pTarget, 100000.0f+DoGetThreat(me->getVictim()));
}
}
void SwitchToPortalPhase()
{
m_creature->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
m_creature->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
me->RemoveAurasDueToSpell(SPELL_BANISH_ROOT);
me->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL);
SummonPortals();
PhaseTimer = 60000;
PortalPhase = true;
PortalTimer = 10000;
EmpowermentTimer = 10000;
DoScriptText(EMOTE_PHASE_PORTAL,m_creature);
DoScriptText(EMOTE_PHASE_PORTAL,me);
}
void SwitchToBanishPhase()
{
m_creature->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
m_creature->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
DoCast(m_creature, SPELL_BANISH_VISUAL, true);
DoCast(m_creature, SPELL_BANISH_ROOT, true);
me->RemoveAurasDueToSpell(SPELL_EMPOWERMENT);
me->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA);
DoCast(me, SPELL_BANISH_VISUAL, true);
DoCast(me, SPELL_BANISH_ROOT, true);
DestroyPortals();
PhaseTimer = 30000;
PortalPhase = false;
DoScriptText(EMOTE_PHASE_BANISH,m_creature);
DoScriptText(EMOTE_PHASE_BANISH,me);
for (int i=0; i<3; ++i)
m_creature->RemoveAurasDueToSpell(NetherBuff[i]);
me->RemoveAurasDueToSpell(NetherBuff[i]);
}
void HandleDoors(bool open) // Massive Door switcher
{
if (GameObject *Door = GameObject::GetGameObject(*m_creature, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
if (GameObject *Door = GameObject::GetGameObject(*me, pInstance ? pInstance->GetData64(DATA_GO_MASSIVE_DOOR) : 0))
Door->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY);
}
@@ -272,8 +272,8 @@ struct boss_netherspiteAI : public ScriptedAI
// NetherInfusion Berserk
if (!Berserk && NetherInfusionTimer <= diff)
{
m_creature->AddAura(SPELL_NETHER_INFUSION, m_creature);
DoCast(m_creature, SPELL_NETHERSPITE_ROAR);
me->AddAura(SPELL_NETHER_INFUSION, me);
DoCast(me, SPELL_NETHERSPITE_ROAR);
Berserk = true;
} else NetherInfusionTimer -= diff;
@@ -289,14 +289,14 @@ struct boss_netherspiteAI : public ScriptedAI
// Empowerment & Nether Burn
if (EmpowermentTimer <= diff)
{
DoCast(m_creature, SPELL_EMPOWERMENT);
m_creature->AddAura(SPELL_NETHERBURN_AURA, m_creature);
DoCast(me, SPELL_EMPOWERMENT);
me->AddAura(SPELL_NETHERBURN_AURA, me);
EmpowermentTimer = 90000;
} else EmpowermentTimer -= diff;
if (PhaseTimer <= diff)
{
if (!m_creature->IsNonMeleeSpellCasted(false))
if (!me->IsNonMeleeSpellCasted(false))
{
SwitchToBanishPhase();
return;
@@ -315,7 +315,7 @@ struct boss_netherspiteAI : public ScriptedAI
if (PhaseTimer <= diff)
{
if (!m_creature->IsNonMeleeSpellCasted(false))
if (!me->IsNonMeleeSpellCasted(false))
{
SwitchToPortalPhase();
return;
@@ -108,15 +108,15 @@ struct boss_nightbaneAI : public ScriptedAI
FlyCount = 0;
MovePhase = 0;
m_creature->SetSpeed(MOVE_RUN, 2.0f);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->setActive(true);
me->SetSpeed(MOVE_RUN, 2.0f);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
me->setActive(true);
if (pInstance)
{
if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS)
m_creature->DisappearAndDie();
me->DisappearAndDie();
else
pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED);
}
@@ -128,8 +128,8 @@ struct boss_nightbaneAI : public ScriptedAI
if (!Intro)
{
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
m_creature->GetMotionMaster()->MoveTargetedHome();
me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
me->GetMotionMaster()->MoveTargetedHome();
}
}
@@ -148,7 +148,7 @@ struct boss_nightbaneAI : public ScriptedAI
pInstance->SetData(TYPE_NIGHTBANE, IN_PROGRESS);
HandleTerraceDoors(false);
m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
}
void AttackStart(Unit* who)
@@ -181,7 +181,7 @@ struct boss_nightbaneAI : public ScriptedAI
if (id >= 8)
{
Intro = false;
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
me->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
return;
}
@@ -192,7 +192,7 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (id == 0)
{
m_creature->MonsterTextEmote(EMOTE_BREATH, 0, true);
me->MonsterTextEmote(EMOTE_BREATH, 0, true);
Flying = false;
Phase = 2;
return;
@@ -219,18 +219,18 @@ struct boss_nightbaneAI : public ScriptedAI
void JustSummoned(Creature *summoned)
{
summoned->AI()->AttackStart(m_creature->getVictim());
summoned->AI()->AttackStart(me->getVictim());
}
void TakeOff()
{
m_creature->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
(*m_creature).GetMotionMaster()->Clear(false);
(*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
me->InterruptSpell(CURRENT_GENERIC_SPELL);
me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
(*me).GetMotionMaster()->Clear(false);
(*me).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
Flying = true;
@@ -251,13 +251,13 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (MovePhase >= 7)
{
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
}
else
{
m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
++MovePhase;
}
}
@@ -265,13 +265,13 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (MovePhase >= 7)
{
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
me->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]);
}
else
{
m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
me->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
++MovePhase;
}
}
@@ -291,19 +291,19 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (Movement)
{
DoStartMovement(m_creature->getVictim());
DoStartMovement(me->getVictim());
Movement = false;
}
if (BellowingRoarTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR);
DoCast(me->getVictim(), SPELL_BELLOWING_ROAR);
BellowingRoarTimer = urand(30000,40000);
} else BellowingRoarTimer -= diff;
if (SmolderingBreathTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SMOLDERING_BREATH);
DoCast(me->getVictim(), SPELL_SMOLDERING_BREATH);
SmolderingBreathTimer = 20000;
} else SmolderingBreathTimer -= diff;
@@ -317,7 +317,7 @@ struct boss_nightbaneAI : public ScriptedAI
if (TailSweepTimer <= diff)
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
if (!m_creature->HasInArc(M_PI, pTarget))
if (!me->HasInArc(M_PI, pTarget))
DoCast(pTarget, SPELL_TAIL_SWEEP);
TailSweepTimer = 15000;
} else TailSweepTimer -= diff;
@@ -330,7 +330,7 @@ struct boss_nightbaneAI : public ScriptedAI
} else SearingCindersTimer -= diff;
uint32 Prozent;
Prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
Prozent = (me->GetHealth()*100) / me->GetMaxHealth();
if (Prozent < 75 && FlyCount == 0) // first take off 75%
TakeOff();
@@ -353,14 +353,14 @@ struct boss_nightbaneAI : public ScriptedAI
{
for (uint8 i = 0; i <= 3; ++i)
{
DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON);
DoCast(me->getVictim(), SPELL_SUMMON_SKELETON);
Skeletons = true;
}
}
if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
{
DoCast(m_creature->getVictim(), SPELL_RAIN_OF_BONES);
DoCast(me->getVictim(), SPELL_RAIN_OF_BONES);
RainBones = true;
SmokingBlastTimer = 20000;
} else RainofBonesTimer -= diff;
@@ -377,7 +377,7 @@ struct boss_nightbaneAI : public ScriptedAI
{
if (SmokingBlastTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SMOKING_BLAST);
DoCast(me->getVictim(), SPELL_SMOKING_BLAST);
SmokingBlastTimer = 1500; //timer wrong
} else SmokingBlastTimer -= diff;
}
@@ -391,10 +391,10 @@ struct boss_nightbaneAI : public ScriptedAI
if (FlyTimer <= diff) //landing
{
m_creature->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL);
me->MonsterYell(RAND(*YELL_LAND_PHASE_1,*YELL_LAND_PHASE_2), LANG_UNIVERSAL, NULL);
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
Flying = true;
} else FlyTimer -= diff;
@@ -113,7 +113,7 @@ struct netherspite_infernalAI : public ScriptedAI
if (HellfireTimer)
if (HellfireTimer <= diff)
{
DoCast(m_creature, SPELL_HELLFIRE);
DoCast(me, SPELL_HELLFIRE);
HellfireTimer = 0;
}
else HellfireTimer -= diff;
@@ -128,7 +128,7 @@ struct netherspite_infernalAI : public ScriptedAI
void KilledUnit(Unit *who)
{
Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
if (pMalchezaar)
CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
}
@@ -137,8 +137,8 @@ struct netherspite_infernalAI : public ScriptedAI
{
if (spell->Id == SPELL_INFERNAL_RELAY)
{
m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
HellfireTimer = 4000;
CleanupTimer = 170000;
}
@@ -212,12 +212,12 @@ struct boss_malchezaarAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
AxesCleanup();
ClearWeapons();
@@ -233,7 +233,7 @@ struct boss_malchezaarAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in
@@ -243,7 +243,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
//Infernal Cleanup
for (std::vector<uint64>::const_iterator itr = infernals.begin(); itr != infernals.end(); ++itr)
if (Unit *pInfernal = Unit::GetUnit(*m_creature, *itr))
if (Unit *pInfernal = Unit::GetUnit(*me, *itr))
if (pInfernal->isAlive())
{
pInfernal->SetVisibility(VISIBILITY_OFF);
@@ -257,7 +257,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
Unit *axe = Unit::GetUnit(*m_creature, axes[i]);
Unit *axe = Unit::GetUnit(*me, axes[i]);
if (axe && axe->isAlive())
axe->Kill(axe);
axes[i] = 0;
@@ -269,10 +269,10 @@ struct boss_malchezaarAI : public ScriptedAI
SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE);
//damage
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
m_creature->UpdateDamagePhysical(BASE_ATTACK);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg);
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg);
me->UpdateDamagePhysical(BASE_ATTACK);
}
void EnfeebleHealthEffect()
@@ -281,7 +281,7 @@ struct boss_malchezaarAI : public ScriptedAI
if (!info)
return;
std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
std::vector<Unit *> targets;
if (!t_list.size())
@@ -291,7 +291,7 @@ struct boss_malchezaarAI : public ScriptedAI
std::list<HostileReference *>::const_iterator itr = t_list.begin();
std::advance(itr, 1);
for (; itr != t_list.end(); ++itr) //store the threat list in a different container
if (Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
if (pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
@@ -306,7 +306,7 @@ struct boss_malchezaarAI : public ScriptedAI
enfeeble_targets[i] = pTarget->GetGUID();
enfeeble_health[i] = pTarget->GetHealth();
pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID());
pTarget->CastSpell(pTarget, SPELL_ENFEEBLE, true, 0, 0, me->GetGUID());
pTarget->SetHealth(1);
}
}
@@ -315,7 +315,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
for (uint8 i = 0; i < 5; ++i)
{
Unit *pTarget = Unit::GetUnit(*m_creature, enfeeble_targets[i]);
Unit *pTarget = Unit::GetUnit(*me, enfeeble_targets[i]);
if (pTarget && pTarget->isAlive())
pTarget->SetHealth(enfeeble_health[i]);
enfeeble_targets[i] = 0;
@@ -327,7 +327,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
InfernalPoint *point = NULL;
Position pos;
if ((m_creature->GetMapId() != 532) || positions.empty())
if ((me->GetMapId() != 532) || positions.empty())
me->GetRandomNearPosition(pos, 60);
else
{
@@ -337,21 +337,21 @@ struct boss_malchezaarAI : public ScriptedAI
pos.Relocate(point->x, point->y, INFERNAL_Z);
}
Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
Creature *Infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);
if (Infernal)
{
Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE);
Infernal->setFaction(m_creature->getFaction());
Infernal->setFaction(me->getFaction());
if (point)
CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point;
CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=m_creature->GetGUID();
CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=me->GetGUID();
infernals.push_back(Infernal->GetGUID());
DoCast(Infernal, SPELL_INFERNAL_RELAY);
}
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
}
void UpdateAI(const uint32 diff)
@@ -365,50 +365,50 @@ struct boss_malchezaarAI : public ScriptedAI
EnfeebleResetTimer = 0;
} else EnfeebleResetTimer -= diff;
if (m_creature->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
if (me->hasUnitState(UNIT_STAT_STUNNED)) // While shifting to phase 2 malchezaar stuns himself
return;
if (m_creature->GetUInt64Value(UNIT_FIELD_TARGET) != m_creature->getVictim()->GetGUID())
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID());
if (me->GetUInt64Value(UNIT_FIELD_TARGET) != me->getVictim()->GetGUID())
me->SetUInt64Value(UNIT_FIELD_TARGET, me->getVictim()->GetGUID());
if (phase == 1)
{
if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60)
if ((me->GetHealth()*100) / me->GetMaxHealth() < 60)
{
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
phase = 2;
//animation
DoCast(m_creature, SPELL_EQUIP_AXES);
DoCast(me, SPELL_EQUIP_AXES);
//text
DoScriptText(SAY_AXE_TOSS1, m_creature);
DoScriptText(SAY_AXE_TOSS1, me);
//passive thrash aura
DoCast(m_creature, SPELL_THRASH_AURA, true);
DoCast(me, SPELL_THRASH_AURA, true);
//models
SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE);
//damage
const CreatureInfo *cinfo = m_creature->GetCreatureInfo();
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
m_creature->UpdateDamagePhysical(BASE_ATTACK);
const CreatureInfo *cinfo = me->GetCreatureInfo();
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg);
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg);
me->UpdateDamagePhysical(BASE_ATTACK);
m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
m_creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg);
me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg);
//Sigh, updating only works on main attack, do it manually ....
m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg);
me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg);
m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100);
me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100);
}
}
else if (phase == 2)
{
if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30)
if ((me->GetHealth()*100) / me->GetMaxHealth() < 30)
{
InfernalTimer = 15000;
@@ -417,18 +417,18 @@ struct boss_malchezaarAI : public ScriptedAI
ClearWeapons();
//remove thrash
m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
me->RemoveAurasDueToSpell(SPELL_THRASH_AURA);
DoScriptText(SAY_AXE_TOSS2, m_creature);
DoScriptText(SAY_AXE_TOSS2, me);
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
for (uint8 i = 0; i < 2; ++i)
{
Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
Creature *axe = me->SummonCreature(MALCHEZARS_AXE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000);
if (axe)
{
axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
axe->setFaction(m_creature->getFaction());
axe->setFaction(me->getFaction());
axes[i] = axe->GetGUID();
if (pTarget)
{
@@ -448,14 +448,14 @@ struct boss_malchezaarAI : public ScriptedAI
if (SunderArmorTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR);
DoCast(me->getVictim(), SPELL_SUNDER_ARMOR);
SunderArmorTimer = urand(10000,18000);
} else SunderArmorTimer -= diff;
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = urand(6000,12000);
} else Cleave_Timer -= diff;
@@ -470,7 +470,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
for (uint8 i = 0; i < 2; ++i)
{
if (Unit *axe = Unit::GetUnit(*m_creature, axes[i]))
if (Unit *axe = Unit::GetUnit(*me, axes[i]))
{
if (axe->getVictim())
DoModifyThreatPercent(axe->getVictim(), -100);
@@ -500,7 +500,7 @@ struct boss_malchezaarAI : public ScriptedAI
if (ShadowNovaTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWNOVA);
DoCast(me->getVictim(), SPELL_SHADOWNOVA);
ShadowNovaTimer = phase == 3 ? 31000 : uint32(-1);
} else ShadowNovaTimer -= diff;
@@ -510,7 +510,7 @@ struct boss_malchezaarAI : public ScriptedAI
{
Unit *pTarget = NULL;
if (phase == 1)
pTarget = m_creature->getVictim(); // the tank
pTarget = me->getVictim(); // the tank
else // anyone but the tank
pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
@@ -540,19 +540,19 @@ struct boss_malchezaarAI : public ScriptedAI
void DoMeleeAttacksIfReady()
{
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()) && !m_creature->IsNonMeleeSpellCasted(false))
if (me->IsWithinMeleeRange(me->getVictim()) && !me->IsNonMeleeSpellCasted(false))
{
//Check for base attack
if (m_creature->isAttackReady() && m_creature->getVictim())
if (me->isAttackReady() && me->getVictim())
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
//Check for offhand attack
if (m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim())
if (me->isAttackReady(OFF_ATTACK) && me->getVictim())
{
m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
m_creature->resetAttackTimer(OFF_ATTACK);
me->AttackerStateUpdate(me->getVictim(), OFF_ATTACK);
me->resetAttackTimer(OFF_ATTACK);
}
}
}
@@ -572,10 +572,10 @@ struct boss_malchezaarAI : public ScriptedAI
void netherspite_infernalAI::Cleanup()
{
Unit *pMalchezaar = Unit::GetUnit(*m_creature, malchezaar);
Unit *pMalchezaar = Unit::GetUnit(*me, malchezaar);
if (pMalchezaar && pMalchezaar->isAlive())
CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, point);
CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(me, point);
}
CreatureAI* GetAI_netherspite_infernal(Creature* pCreature)
@@ -147,12 +147,12 @@ struct boss_aranAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), m_creature);
DoScriptText(RAND(SAY_KILL1,SAY_KILL2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -163,7 +163,7 @@ struct boss_aranAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
if (pInstance)
{
@@ -175,7 +175,7 @@ struct boss_aranAI : public ScriptedAI
void FlameWreathEffect()
{
std::vector<Unit*> targets;
std::list<HostileReference *> t_list = m_creature->getThreatManager().getThreatList();
std::list<HostileReference *> t_list = me->getThreatManager().getThreatList();
if (!t_list.size())
return;
@@ -183,7 +183,7 @@ struct boss_aranAI : public ScriptedAI
//store the threat list in a different container
for (std::list<HostileReference *>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
//only on alive players
if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER)
targets.push_back(pTarget);
@@ -246,19 +246,19 @@ struct boss_aranAI : public ScriptedAI
else FrostCooldown = 0;
}
if (!Drinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20)
if (!Drinking && me->GetMaxPower(POWER_MANA) && (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA)) < 20)
{
Drinking = true;
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
DoScriptText(SAY_DRINK, m_creature);
DoScriptText(SAY_DRINK, me);
if (!DrinkInturrupted)
{
DoCast(m_creature, SPELL_MASS_POLY, true);
DoCast(m_creature, SPELL_CONJURE, false);
DoCast(m_creature, SPELL_DRINK, false);
m_creature->SetStandState(UNIT_STAND_STATE_SIT);
DoCast(me, SPELL_MASS_POLY, true);
DoCast(me, SPELL_CONJURE, false);
DoCast(me, SPELL_DRINK, false);
me->SetStandState(UNIT_STAND_STATE_SIT);
DrinkInturruptTimer = 10000;
}
}
@@ -267,10 +267,10 @@ struct boss_aranAI : public ScriptedAI
if (Drinking && DrinkInturrupted)
{
Drinking = false;
m_creature->RemoveAurasDueToSpell(SPELL_DRINK);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000);
DoCast(m_creature, SPELL_POTION, false);
me->RemoveAurasDueToSpell(SPELL_DRINK);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)-32000);
DoCast(me, SPELL_POTION, false);
}
//Drink Inturrupt Timer
@@ -279,9 +279,9 @@ struct boss_aranAI : public ScriptedAI
DrinkInturruptTimer -= diff;
else
{
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(m_creature, SPELL_POTION, true);
DoCast(m_creature, SPELL_AOE_PYROBLAST, false);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(me, SPELL_POTION, true);
DoCast(me, SPELL_AOE_PYROBLAST, false);
DrinkInturrupted = true;
Drinking = false;
}
@@ -293,7 +293,7 @@ struct boss_aranAI : public ScriptedAI
//Normal casts
if (NormalCastTimer <= diff)
{
if (!m_creature->IsNonMeleeSpellCasted(false))
if (!me->IsNonMeleeSpellCasted(false))
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true);
if (!pTarget)
@@ -334,7 +334,7 @@ struct boss_aranAI : public ScriptedAI
switch (urand(0,1))
{
case 0:
DoCast(m_creature, SPELL_AOE_CS);
DoCast(me, SPELL_AOE_CS);
break;
case 1:
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
@@ -369,16 +369,16 @@ struct boss_aranAI : public ScriptedAI
switch (LastSuperSpell)
{
case SUPER_AE:
DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), m_creature);
DoScriptText(RAND(SAY_EXPLOSION1,SAY_EXPLOSION2), me);
DoCast(m_creature, SPELL_BLINK_CENTER, true);
DoCast(m_creature, SPELL_PLAYERPULL, true);
DoCast(m_creature, SPELL_MASSSLOW, true);
DoCast(m_creature, SPELL_AEXPLOSION, false);
DoCast(me, SPELL_BLINK_CENTER, true);
DoCast(me, SPELL_PLAYERPULL, true);
DoCast(me, SPELL_MASSSLOW, true);
DoCast(me, SPELL_AEXPLOSION, false);
break;
case SUPER_FLAME:
DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), m_creature);
DoScriptText(RAND(SAY_FLAMEWREATH1,SAY_FLAMEWREATH2), me);
FlameWreathTimer = 20000;
FlameWreathCheckTime = 500;
@@ -391,11 +391,11 @@ struct boss_aranAI : public ScriptedAI
break;
case SUPER_BLIZZARD:
DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), m_creature);
DoScriptText(RAND(SAY_BLIZZARD1,SAY_BLIZZARD2), me);
if (Creature* pSpawn = m_creature->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
if (Creature* pSpawn = me->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000))
{
pSpawn->setFaction(m_creature->getFaction());
pSpawn->setFaction(me->getFaction());
pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false);
}
break;
@@ -404,34 +404,34 @@ struct boss_aranAI : public ScriptedAI
SuperCastTimer = urand(35000,40000);
} else SuperCastTimer -= diff;
if (!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
if (!ElementalsSpawned && me->GetHealth()*100 / me->GetMaxHealth() < 40)
{
ElementalsSpawned = true;
for (uint32 i = 0; i < 4; ++i)
{
if (Creature* pUnit = m_creature->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
if (Creature* pUnit = me->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000))
{
pUnit->Attack(m_creature->getVictim(), true);
pUnit->setFaction(m_creature->getFaction());
pUnit->Attack(me->getVictim(), true);
pUnit->setFaction(me->getFaction());
}
}
DoScriptText(SAY_ELEMENTALS, m_creature);
DoScriptText(SAY_ELEMENTALS, me);
}
if (BerserkTimer <= diff)
{
for (uint32 i = 0; i < 5; ++i)
{
if (Creature* pUnit = m_creature->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
if (Creature* pUnit = me->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
{
pUnit->Attack(m_creature->getVictim(), true);
pUnit->setFaction(m_creature->getFaction());
pUnit->Attack(me->getVictim(), true);
pUnit->setFaction(me->getFaction());
}
}
DoScriptText(SAY_TIMEOVER, m_creature);
DoScriptText(SAY_TIMEOVER, me);
BerserkTimer = 60000;
} else BerserkTimer -= diff;
@@ -450,10 +450,10 @@ struct boss_aranAI : public ScriptedAI
if (!FlameWreathTarget[i])
continue;
Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]);
Unit* pUnit = Unit::GetUnit(*me, FlameWreathTarget[i]);
if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3))
{
pUnit->CastSpell(pUnit, 20476, true, 0, 0, m_creature->GetGUID());
pUnit->CastSpell(pUnit, 20476, true, 0, 0, me->GetGUID());
pUnit->CastSpell(pUnit, 11027, true);
FlameWreathTarget[i] = 0;
}
@@ -477,11 +477,11 @@ struct boss_aranAI : public ScriptedAI
//We only care about inturrupt effects and only if they are durring a spell currently being casted
if ((Spell->Effect[0] != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effect[1] != SPELL_EFFECT_INTERRUPT_CAST &&
Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !m_creature->IsNonMeleeSpellCasted(false))
Spell->Effect[2] != SPELL_EFFECT_INTERRUPT_CAST) || !me->IsNonMeleeSpellCasted(false))
return;
//Inturrupt effect
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
//Normally we would set the cooldown equal to the spell duration
//but we do not have access to the DurationStore
@@ -515,7 +515,7 @@ struct water_elementalAI : public ScriptedAI
if (CastTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WATERBOLT);
DoCast(me->getVictim(), SPELL_WATERBOLT);
CastTimer = urand(2000,5000);
} else CastTimer -= diff;
}
@@ -77,7 +77,7 @@ struct mob_kilrekAI : public ScriptedAI
{
if (!pInstance)
{
ERROR_INST_DATA(m_creature);
ERROR_INST_DATA(me);
return;
}
}
@@ -89,11 +89,11 @@ struct mob_kilrekAI : public ScriptedAI
uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN);
if (TerestianGUID)
{
Unit* Terestian = Unit::GetUnit((*m_creature), TerestianGUID);
Unit* Terestian = Unit::GetUnit((*me), TerestianGUID);
if (Terestian && Terestian->isAlive())
DoCast(Terestian, SPELL_BROKEN_PACT, true);
}
} else ERROR_INST_DATA(m_creature);
} else ERROR_INST_DATA(me);
}
void UpdateAI(const uint32 diff)
@@ -104,8 +104,8 @@ struct mob_kilrekAI : public ScriptedAI
if (AmplifyTimer <= diff)
{
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature->getVictim(), SPELL_AMPLIFY_FLAMES);
me->InterruptNonMeleeSpells(false);
DoCast(me->getVictim(), SPELL_AMPLIFY_FLAMES);
AmplifyTimer = urand(10000,20000);
} else AmplifyTimer -= diff;
@@ -133,7 +133,7 @@ struct mob_demon_chainAI : public ScriptedAI
{
if (SacrificeGUID)
{
Unit* Sacrifice = Unit::GetUnit((*m_creature),SacrificeGUID);
Unit* Sacrifice = Unit::GetUnit((*me),SacrificeGUID);
if (Sacrifice)
Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE);
}
@@ -142,7 +142,7 @@ struct mob_demon_chainAI : public ScriptedAI
struct mob_fiendish_portalAI : public PassiveAI
{
mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(m_creature){}
mob_fiendish_portalAI(Creature *c) : PassiveAI(c),summons(me){}
SummonList summons;
@@ -191,7 +191,7 @@ struct boss_terestianAI : public ScriptedAI
{
if (PortalGUID[i])
{
if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[i]))
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[i]))
{
CAST_AI(mob_fiendish_portalAI, pPortal->AI())->DespawnAllImp();
pPortal->ForcedDespawn();
@@ -213,22 +213,22 @@ struct boss_terestianAI : public ScriptedAI
if (pInstance)
pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED);
m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
me->RemoveAurasDueToSpell(SPELL_BROKEN_PACT);
if (Minion* Kilrek = m_creature->GetFirstMinion())
if (Minion* Kilrek = me->GetFirstMinion())
{
if (!Kilrek->isAlive())
{
Kilrek->UnSummon();
DoCast(m_creature, SPELL_SUMMON_IMP, true);
DoCast(me, SPELL_SUMMON_IMP, true);
}
}
else DoCast(m_creature, SPELL_SUMMON_IMP, true);
else DoCast(me, SPELL_SUMMON_IMP, true);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void JustSummoned(Creature* pSummoned)
@@ -240,7 +240,7 @@ struct boss_terestianAI : public ScriptedAI
if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1)
{
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), m_creature);
DoScriptText(RAND(SAY_SUMMON1,SAY_SUMMON2), me);
SummonedPortals = true;
}
}
@@ -248,7 +248,7 @@ struct boss_terestianAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *killer)
@@ -257,14 +257,14 @@ struct boss_terestianAI : public ScriptedAI
{
if (PortalGUID[i])
{
if (Creature* pPortal = Unit::GetCreature((*m_creature), PortalGUID[i]))
if (Creature* pPortal = Unit::GetCreature((*me), PortalGUID[i]))
pPortal->ForcedDespawn();
PortalGUID[i] = 0;
}
}
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_TERESTIAN, DONE);
@@ -283,11 +283,11 @@ struct boss_terestianAI : public ScriptedAI
DoCast(pTarget, SPELL_SACRIFICE, true);
DoCast(pTarget, SPELL_SUMMON_DEMONCHAINS, true);
if (Creature* Chains = m_creature->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
if (Creature* Chains = me->FindNearestCreature(CREATURE_DEMONCHAINS, 5000))
{
CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = pTarget->GetGUID();
Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true);
DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), m_creature);
DoScriptText(RAND(SAY_SACRIFICE1,SAY_SACRIFICE2), me);
SacrificeTimer = 30000;
}
}
@@ -302,15 +302,15 @@ struct boss_terestianAI : public ScriptedAI
if (SummonTimer <= diff)
{
if (!PortalGUID[0])
DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL, false);
DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL, false);
if (!PortalGUID[1])
DoCast(m_creature->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
DoCast(me->getVictim(), SPELL_FIENDISH_PORTAL_1, false);
if (PortalGUID[0] && PortalGUID[1])
{
if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[urand(0,1)]))
pPortal->CastSpell(m_creature->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
if (Creature* pPortal = Unit::GetCreature(*me, PortalGUID[urand(0,1)]))
pPortal->CastSpell(me->getVictim(), SPELL_SUMMON_FIENDISIMP, false);
SummonTimer = 5000;
}
} else SummonTimer -= diff;
@@ -319,7 +319,7 @@ struct boss_terestianAI : public ScriptedAI
{
if (BerserkTimer <= diff)
{
DoCast(m_creature, SPELL_BERSERK);
DoCast(me, SPELL_BERSERK);
Berserk = true;
} else BerserkTimer -= diff;
}
@@ -340,7 +340,7 @@ struct mob_fiendish_impAI : public ScriptedAI
{
FireboltTimer = 2000;
m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
}
void EnterCombat(Unit *who) {}
@@ -353,7 +353,7 @@ struct mob_fiendish_impAI : public ScriptedAI
if (FireboltTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBOLT);
DoCast(me->getVictim(), SPELL_FIREBOLT);
FireboltTimer = 2200;
} else FireboltTimer -= diff;
@@ -132,27 +132,27 @@ struct boss_dorotheeAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_DOROTHEE_AGGRO, m_creature);
DoScriptText(SAY_DOROTHEE_AGGRO, me);
}
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void SummonTito(); // See below
void JustDied(Unit* killer)
{
DoScriptText(SAY_DOROTHEE_DEATH, m_creature);
DoScriptText(SAY_DOROTHEE_DEATH, me);
if (pInstance)
SummonCroneIfReady(pInstance, m_creature);
SummonCroneIfReady(pInstance, me);
}
void AttackStart(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -160,7 +160,7 @@ struct boss_dorotheeAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -172,7 +172,7 @@ struct boss_dorotheeAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -188,7 +188,7 @@ struct boss_dorotheeAI : public ScriptedAI
if (FearTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SCREAM);
DoCast(me->getVictim(), SPELL_SCREAM);
FearTimer = 30000;
} else FearTimer -= diff;
@@ -222,7 +222,7 @@ struct mob_titoAI : public ScriptedAI
{
if (DorotheeGUID)
{
Creature* Dorothee = (Unit::GetCreature((*m_creature), DorotheeGUID));
Creature* Dorothee = (Unit::GetCreature((*me), DorotheeGUID));
if (Dorothee && Dorothee->isAlive())
{
CAST_AI(boss_dorotheeAI, Dorothee->AI())->TitoDied = true;
@@ -238,7 +238,7 @@ struct mob_titoAI : public ScriptedAI
if (YipTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_YIPPING);
DoCast(me->getVictim(), SPELL_YIPPING);
YipTimer = 10000;
} else YipTimer -= diff;
@@ -248,11 +248,11 @@ struct mob_titoAI : public ScriptedAI
void boss_dorotheeAI::SummonTito()
{
if (Creature* pTito = m_creature->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
if (Creature* pTito = me->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
{
DoScriptText(SAY_DOROTHEE_SUMMON, m_creature);
CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = m_creature->GetGUID();
pTito->AI()->AttackStart(m_creature->getVictim());
DoScriptText(SAY_DOROTHEE_SUMMON, me);
CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = me->GetGUID();
pTito->AI()->AttackStart(me->getVictim());
SummonedTito = true;
TitoDied = false;
}
@@ -280,7 +280,7 @@ struct boss_strawmanAI : public ScriptedAI
void AttackStart(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -288,7 +288,7 @@ struct boss_strawmanAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -296,12 +296,12 @@ struct boss_strawmanAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_STRAWMAN_AGGRO, m_creature);
DoScriptText(SAY_STRAWMAN_AGGRO, me);
}
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void SpellHit(Unit* caster, const SpellEntry *Spell)
@@ -313,21 +313,21 @@ struct boss_strawmanAI : public ScriptedAI
return;
*/
DoCast(m_creature, SPELL_BURNING_STRAW, true);
DoCast(me, SPELL_BURNING_STRAW, true);
}
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_STRAWMAN_DEATH, m_creature);
DoScriptText(SAY_STRAWMAN_DEATH, me);
if (pInstance)
SummonCroneIfReady(pInstance, m_creature);
SummonCroneIfReady(pInstance, me);
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_STRAWMAN_SLAY, m_creature);
DoScriptText(SAY_STRAWMAN_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -336,7 +336,7 @@ struct boss_strawmanAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -346,7 +346,7 @@ struct boss_strawmanAI : public ScriptedAI
if (BrainBashTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BRAIN_BASH);
DoCast(me->getVictim(), SPELL_BRAIN_BASH);
BrainBashTimer = 15000;
} else BrainBashTimer -= diff;
@@ -387,17 +387,17 @@ struct boss_tinheadAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_TINHEAD_AGGRO, m_creature);
DoScriptText(SAY_TINHEAD_AGGRO, me);
}
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void AttackStart(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -405,7 +405,7 @@ struct boss_tinheadAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -413,15 +413,15 @@ struct boss_tinheadAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_TINHEAD_DEATH, m_creature);
DoScriptText(SAY_TINHEAD_DEATH, me);
if (pInstance)
SummonCroneIfReady(pInstance, m_creature);
SummonCroneIfReady(pInstance, me);
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_TINHEAD_SLAY, m_creature);
DoScriptText(SAY_TINHEAD_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -430,7 +430,7 @@ struct boss_tinheadAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -440,7 +440,7 @@ struct boss_tinheadAI : public ScriptedAI
if (CleaveTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
CleaveTimer = 5000;
} else CleaveTimer -= diff;
@@ -449,8 +449,8 @@ struct boss_tinheadAI : public ScriptedAI
if (RustTimer <= diff)
{
++RustCount;
DoScriptText(EMOTE_RUST, m_creature);
DoCast(m_creature, SPELL_RUST);
DoScriptText(EMOTE_RUST, me);
DoCast(me, SPELL_RUST);
RustTimer = 6000;
} else RustTimer -= diff;
}
@@ -483,7 +483,7 @@ struct boss_roarAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -491,7 +491,7 @@ struct boss_roarAI : public ScriptedAI
void AttackStart(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -499,25 +499,25 @@ struct boss_roarAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_ROAR_AGGRO, m_creature);
DoScriptText(SAY_ROAR_AGGRO, me);
}
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_ROAR_DEATH, m_creature);
DoScriptText(SAY_ROAR_DEATH, me);
if (pInstance)
SummonCroneIfReady(pInstance, m_creature);
SummonCroneIfReady(pInstance, me);
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_ROAR_SLAY, m_creature);
DoScriptText(SAY_ROAR_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -526,7 +526,7 @@ struct boss_roarAI : public ScriptedAI
{
if (AggroTimer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
AggroTimer = 0;
} else AggroTimer -= diff;
}
@@ -536,19 +536,19 @@ struct boss_roarAI : public ScriptedAI
if (MangleTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MANGLE);
DoCast(me->getVictim(), SPELL_MANGLE);
MangleTimer = urand(5000,8000);
} else MangleTimer -= diff;
if (ShredTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHRED);
DoCast(me->getVictim(), SPELL_SHRED);
ShredTimer = urand(10000,15000);
} else ShredTimer -= diff;
if (ScreamTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM);
DoCast(me->getVictim(), SPELL_FRIGHTENED_SCREAM);
ScreamTimer = urand(20000,30000);
} else ScreamTimer -= diff;
@@ -576,19 +576,19 @@ struct boss_croneAI : public ScriptedAI
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void EnterCombat(Unit* who)
{
DoScriptText(RAND(SAY_CRONE_AGGRO,SAY_CRONE_AGGRO2), m_creature);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
DoScriptText(RAND(SAY_CRONE_AGGRO,SAY_CRONE_AGGRO2), me);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_CRONE_DEATH, m_creature);
DoScriptText(SAY_CRONE_DEATH, me);
if (pInstance)
{
@@ -606,8 +606,8 @@ struct boss_croneAI : public ScriptedAI
if (!UpdateVictim())
return;
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
if (CycloneTimer <= diff)
{
@@ -618,7 +618,7 @@ struct boss_croneAI : public ScriptedAI
if (ChainLightningTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
ChainLightningTimer = 15000;
} else ChainLightningTimer -= diff;
@@ -645,14 +645,14 @@ struct mob_cycloneAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->HasAura(SPELL_KNOCKBACK))
DoCast(m_creature, SPELL_KNOCKBACK, true);
if (!me->HasAura(SPELL_KNOCKBACK))
DoCast(me, SPELL_KNOCKBACK, true);
if (MoveTimer <= diff)
{
Position pos;
m_creature->GetRandomNearPosition(pos, 10);
m_creature->GetMotionMaster()->MovePoint(0, pos);
me->GetRandomNearPosition(pos, 10);
me->GetMotionMaster()->MovePoint(0, pos);
MoveTimer = urand(5000,8000);
} else MoveTimer -= diff;
}
@@ -766,17 +766,17 @@ struct boss_bigbadwolfAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_WOLF_AGGRO, m_creature);
DoScriptText(SAY_WOLF_AGGRO, me);
}
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void JustDied(Unit* killer)
{
DoPlaySoundToSet(m_creature, SOUND_WOLF_DEATH);
DoPlaySoundToSet(me, SOUND_WOLF_DEATH);
if (pInstance)
{
@@ -802,13 +802,13 @@ struct boss_bigbadwolfAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_WOLF_HOOD, m_creature);
DoScriptText(SAY_WOLF_HOOD, me);
DoCast(pTarget, SPELL_LITTLE_RED_RIDING_HOOD, true);
TempThreat = DoGetThreat(pTarget);
if (TempThreat)
DoModifyThreatPercent(pTarget, -100);
HoodGUID = pTarget->GetGUID();
m_creature->AddThreat(pTarget, 1000000.0f);
me->AddThreat(pTarget, 1000000.0f);
ChaseTimer = 20000;
IsChasing = true;
}
@@ -817,12 +817,12 @@ struct boss_bigbadwolfAI : public ScriptedAI
{
IsChasing = false;
if (Unit *pTarget = Unit::GetUnit((*m_creature), HoodGUID))
if (Unit *pTarget = Unit::GetUnit((*me), HoodGUID))
{
HoodGUID = 0;
if (DoGetThreat(pTarget))
DoModifyThreatPercent(pTarget, -100);
m_creature->AddThreat(pTarget, TempThreat);
me->AddThreat(pTarget, TempThreat);
TempThreat = 0;
}
@@ -835,13 +835,13 @@ struct boss_bigbadwolfAI : public ScriptedAI
if (FearTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL);
DoCast(me->getVictim(), SPELL_TERRIFYING_HOWL);
FearTimer = urand(25000,35000);
} else FearTimer -= diff;
if (SwipeTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WIDE_SWIPE);
DoCast(me->getVictim(), SPELL_WIDE_SWIPE);
SwipeTimer = urand(25000,30000);
} else SwipeTimer -= diff;
@@ -973,7 +973,7 @@ struct boss_julianneAI : public ScriptedAI
if (IsFakingDeath)
{
Resurrect(m_creature);
Resurrect(me);
IsFakingDeath = false;
}
@@ -985,7 +985,7 @@ struct boss_julianneAI : public ScriptedAI
void AttackStart(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::AttackStart(who);
@@ -993,7 +993,7 @@ struct boss_julianneAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -1001,14 +1001,14 @@ struct boss_julianneAI : public ScriptedAI
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void SpellHit(Unit* caster, const SpellEntry *Spell)
{
if (Spell->Id == SPELL_DRINK_POISON)
{
DoScriptText(SAY_JULIANNE_DEATH01, m_creature);
DoScriptText(SAY_JULIANNE_DEATH01, me);
DrinkPoisonTimer = 2500;
}
}
@@ -1017,7 +1017,7 @@ struct boss_julianneAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_JULIANNE_DEATH02, m_creature);
DoScriptText(SAY_JULIANNE_DEATH02, me);
if (pInstance)
{
@@ -1031,7 +1031,7 @@ struct boss_julianneAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_JULIANNE_SLAY, m_creature);
DoScriptText(SAY_JULIANNE_SLAY, me);
}
void UpdateAI(const uint32 diff);
@@ -1079,20 +1079,20 @@ struct boss_romuloAI : public ScriptedAI
void JustReachedHome()
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
}
void DamageTaken(Unit* done_by, uint32 &damage);
void EnterCombat(Unit* who)
{
DoScriptText(SAY_ROMULO_AGGRO, m_creature);
DoScriptText(SAY_ROMULO_AGGRO, me);
if (JulianneGUID)
{
Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID));
if (Julianne && Julianne->getVictim())
{
m_creature->AddThreat(Julianne->getVictim(), 1.0f);
me->AddThreat(Julianne->getVictim(), 1.0f);
AttackStart(Julianne->getVictim());
}
}
@@ -1100,7 +1100,7 @@ struct boss_romuloAI : public ScriptedAI
void MoveInLineOfSight(Unit* who)
{
if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -1108,7 +1108,7 @@ struct boss_romuloAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_ROMULO_DEATH, m_creature);
DoScriptText(SAY_ROMULO_DEATH, me);
if (pInstance)
{
@@ -1123,7 +1123,7 @@ struct boss_romuloAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_ROMULO_SLAY, m_creature);
DoScriptText(SAY_ROMULO_SLAY, me);
}
void UpdateAI(const uint32 diff);
@@ -1131,7 +1131,7 @@ struct boss_romuloAI : public ScriptedAI
void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
{
if (damage < m_creature->GetHealth())
if (damage < me->GetHealth())
return;
//anything below only used if incoming damage will kill
@@ -1144,11 +1144,11 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
if (IsFakingDeath)
return;
m_creature->InterruptNonMeleeSpells(true);
DoCast(m_creature, SPELL_DRINK_POISON);
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_DRINK_POISON);
IsFakingDeath = true;
//IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
//IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID));
return;
}
@@ -1164,7 +1164,7 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
//if this is true then we have to kill romulo too
if (RomuloDead)
{
if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)))
if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)))
{
Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Romulo->GetMotionMaster()->Clear();
@@ -1178,9 +1178,9 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
}
//if not already returned, then romulo is alive and we can pretend die
if (Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)))
if (Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID)))
{
PretendToDie(m_creature);
PretendToDie(me);
IsFakingDeath = true;
CAST_AI(boss_romuloAI, Romulo->AI())->ResurrectTimer = 10000;
CAST_AI(boss_romuloAI, Romulo->AI())->JulianneDead = true;
@@ -1193,19 +1193,19 @@ void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage)
void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
{
if (damage < m_creature->GetHealth())
if (damage < me->GetHealth())
return;
//anything below only used if incoming damage will kill
if (Phase == PHASE_ROMULO)
{
DoScriptText(SAY_ROMULO_DEATH, m_creature);
PretendToDie(m_creature);
DoScriptText(SAY_ROMULO_DEATH, me);
PretendToDie(me);
IsFakingDeath = true;
Phase = PHASE_BOTH;
if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true;
CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectSelfTimer = 10000;
@@ -1219,7 +1219,7 @@ void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
{
if (JulianneDead)
{
if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Julianne->GetMotionMaster()->Clear();
@@ -1231,9 +1231,9 @@ void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage)
return;
}
if (Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)))
if (Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID)))
{
PretendToDie(m_creature);
PretendToDie(me);
IsFakingDeath = true;
CAST_AI(boss_julianneAI, Julianne->AI())->ResurrectTimer = 10000;
CAST_AI(boss_julianneAI, Julianne->AI())->RomuloDead = true;
@@ -1251,7 +1251,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (EntryYellTimer <= diff)
{
DoScriptText(SAY_JULIANNE_ENTER, m_creature);
DoScriptText(SAY_JULIANNE_ENTER, me);
EntryYellTimer = 0;
} else EntryYellTimer -= diff;
}
@@ -1260,9 +1260,9 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (AggroYellTimer <= diff)
{
DoScriptText(SAY_JULIANNE_AGGRO, m_creature);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->setFaction(16);
DoScriptText(SAY_JULIANNE_AGGRO, me);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->setFaction(16);
AggroYellTimer = 0;
} else AggroYellTimer -= diff;
}
@@ -1272,7 +1272,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
//will do this 2secs after spell hit. this is time to display visual as expected
if (DrinkPoisonTimer <= diff)
{
PretendToDie(m_creature);
PretendToDie(me);
Phase = PHASE_ROMULO;
SummonRomuloTimer = 10000;
DrinkPoisonTimer = 0;
@@ -1283,10 +1283,10 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (SummonRomuloTimer <= diff)
{
if (Creature* pRomulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
if (Creature* pRomulo = me->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
{
RomuloGUID = pRomulo->GetGUID();
CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = m_creature->GetGUID();
CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = me->GetGUID();
CAST_AI(boss_romuloAI, pRomulo->AI())->Phase = PHASE_ROMULO;
DoZoneInCombat(pRomulo);
@@ -1300,12 +1300,12 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (ResurrectSelfTimer <= diff)
{
Resurrect(m_creature);
Resurrect(me);
Phase = PHASE_BOTH;
IsFakingDeath = false;
if (m_creature->getVictim())
AttackStart(m_creature->getVictim());
if (me->getVictim())
AttackStart(me->getVictim());
ResurrectSelfTimer = 0;
ResurrectTimer = 1000;
@@ -1319,10 +1319,10 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (ResurrectTimer <= diff)
{
Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID));
if (Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath)
{
DoScriptText(SAY_JULIANNE_RESURRECT, m_creature);
DoScriptText(SAY_JULIANNE_RESURRECT, me);
Resurrect(Romulo);
CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false;
RomuloDead = false;
@@ -1340,7 +1340,7 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
if (DevotionTimer <= diff)
{
DoCast(m_creature, SPELL_DEVOTION);
DoCast(me, SPELL_DEVOTION);
DevotionTimer = urand(15000,45000);
} else DevotionTimer -= diff;
@@ -1354,10 +1354,10 @@ void boss_julianneAI::UpdateAI(const uint32 diff)
{
if (urand(0,1) && SummonedRomulo)
{
Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID));
Creature* Romulo = (Unit::GetCreature((*me), RomuloGUID));
if (Romulo && Romulo->isAlive() && !RomuloDead)
DoCast(Romulo, SPELL_ETERNAL_AFFECTION);
} else DoCast(m_creature, SPELL_ETERNAL_AFFECTION);
} else DoCast(me, SPELL_ETERNAL_AFFECTION);
EternalAffectionTimer = urand(45000,60000);
} else EternalAffectionTimer -= diff;
@@ -1374,10 +1374,10 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
{
if (ResurrectTimer <= diff)
{
Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID));
Creature* Julianne = (Unit::GetCreature((*me), JulianneGUID));
if (Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath)
{
DoScriptText(SAY_ROMULO_RESURRECT, m_creature);
DoScriptText(SAY_ROMULO_RESURRECT, me);
Resurrect(Julianne);
CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false;
JulianneDead = false;
@@ -1389,7 +1389,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
if (BackwardLungeTimer <= diff)
{
Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true);
if (pTarget && !m_creature->HasInArc(M_PI, pTarget))
if (pTarget && !me->HasInArc(M_PI, pTarget))
{
DoCast(pTarget, SPELL_BACKWARD_LUNGE);
BackwardLungeTimer = urand(15000,30000);
@@ -1398,7 +1398,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
if (DaringTimer <= diff)
{
DoCast(m_creature, SPELL_DARING);
DoCast(me, SPELL_DARING);
DaringTimer = urand(20000,40000);
} else DaringTimer -= diff;
@@ -1411,7 +1411,7 @@ void boss_romuloAI::UpdateAI(const uint32 diff)
if (PoisonThrustTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_POISON_THRUST);
DoCast(me->getVictim(), SPELL_POISON_THRUST);
PoisonThrustTimer = urand(10000,20000);
} else PoisonThrustTimer -= diff;
@@ -159,15 +159,15 @@ struct npc_barnesAI : public npc_escortAI
switch(i)
{
case 0:
DoCast(m_creature, SPELL_TUXEDO, false);
DoCast(me, SPELL_TUXEDO, false);
pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT));
break;
case 4:
TalkCount = 0;
SetEscortPaused(true);
if (Creature* pSpotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT,
m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f,
if (Creature* pSpotlight = me->SummonCreature(CREATURE_SPOTLIGHT,
me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000))
{
pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -215,7 +215,7 @@ struct npc_barnesAI : public npc_escortAI
}
if (text)
DoScriptText(text, m_creature);
DoScriptText(text, me);
}
void PrepareEncounter()
@@ -245,7 +245,7 @@ struct npc_barnesAI : public npc_escortAI
uint32 entry = ((uint32)Spawns[index][0]);
float PosX = Spawns[index][1];
if (Creature* pCreature = m_creature->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
if (Creature* pCreature = me->SummonCreature(entry, PosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS))
{
// In case database has bad flags
pCreature->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
@@ -266,7 +266,7 @@ struct npc_barnesAI : public npc_escortAI
{
if (TalkCount > 3)
{
if (Creature* pSpotlight = Unit::GetCreature(*m_creature, m_uiSpotlightGUID))
if (Creature* pSpotlight = Unit::GetCreature(*me, m_uiSpotlightGUID))
pSpotlight->ForcedDespawn();
SetEscortPaused(false);
@@ -284,7 +284,7 @@ struct npc_barnesAI : public npc_escortAI
{
if (WipeTimer <= diff)
{
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
if (!pMap->IsDungeon())
return;
@@ -468,13 +468,13 @@ struct npc_image_of_medivhAI : public ScriptedAI
if (pInstance && pInstance->GetData64(DATA_IMAGE_OF_MEDIVH) == 0)
{
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, m_creature->GetGUID());
(*m_creature).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
pInstance->SetData64(DATA_IMAGE_OF_MEDIVH, me->GetGUID());
(*me).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]);
Step = 0;
}else
{
m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
me->DealDamage(me,me->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
}
}
void EnterCombat(Unit* who){}
@@ -486,8 +486,8 @@ struct npc_image_of_medivhAI : public ScriptedAI
if (id == 1)
{
StartEvent();
m_creature->SetOrientation(MedivPos[3]);
m_creature->SetOrientation(MedivPos[3]);
me->SetOrientation(MedivPos[3]);
me->SetOrientation(MedivPos[3]);
}
}
@@ -495,40 +495,40 @@ struct npc_image_of_medivhAI : public ScriptedAI
{
Step = 1;
EventStarted = true;
Creature* Arcanagos = m_creature->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
Creature* Arcanagos = me->SummonCreature(MOB_ARCANAGOS,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
if (!Arcanagos)
return;
ArcanagosGUID = Arcanagos->GetGUID();
Arcanagos->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
(*Arcanagos).GetMotionMaster()->MovePoint(0,ArcanagosPos[0],ArcanagosPos[1],ArcanagosPos[2]);
Arcanagos->SetOrientation(ArcanagosPos[3]);
m_creature->SetOrientation(MedivPos[3]);
me->SetOrientation(MedivPos[3]);
YellTimer = 10000;
}
uint32 NextStep(uint32 Step)
{
Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
Map* pMap = m_creature->GetMap();
Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
Map* pMap = me->GetMap();
switch(Step)
{
case 0: return 9999999;
case 1:
m_creature->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
me->MonsterYell(SAY_DIALOG_MEDIVH_1,LANG_UNIVERSAL,NULL);
return 10000;
case 2:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_2,LANG_UNIVERSAL,NULL);
return 20000;
case 3:
m_creature->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
me->MonsterYell(SAY_DIALOG_MEDIVH_3,LANG_UNIVERSAL,NULL);
return 10000;
case 4:
if (arca)
CAST_CRE(arca)->MonsterYell(SAY_DIALOG_ARCANAGOS_4, LANG_UNIVERSAL, NULL);
return 20000;
case 5:
m_creature->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
me->MonsterYell(SAY_DIALOG_MEDIVH_5, LANG_UNIVERSAL, NULL);
return 20000;
case 6:
if (arca)
@@ -539,10 +539,10 @@ struct npc_image_of_medivhAI : public ScriptedAI
return 5000;
case 8:
FireMedivhTimer = 500;
DoCast(m_creature, SPELL_MANA_SHIELD);
DoCast(me, SPELL_MANA_SHIELD);
return 10000;
case 9:
m_creature->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
me->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false);
return 10000;
case 10:
if (arca)
@@ -559,11 +559,11 @@ struct npc_image_of_medivhAI : public ScriptedAI
arca->SetSpeed(MOVE_FLIGHT, 2.0f);
return 10000;
case 13:
m_creature->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL);
return 10000;
case 14:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->ClearInCombat();
me->SetVisibility(VISIBILITY_OFF);
me->ClearInCombat();
if (pMap->IsDungeon())
{
@@ -597,12 +597,12 @@ struct npc_image_of_medivhAI : public ScriptedAI
if (Step >= 7 && Step <= 12)
{
Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID);
Unit* arca = Unit::GetUnit((*me),ArcanagosGUID);
if (FireArcanagosTimer <= diff)
{
if (arca)
arca->CastSpell(m_creature, SPELL_FIRE_BALL, false);
arca->CastSpell(me, SPELL_FIRE_BALL, false);
FireArcanagosTimer = 6000;
} else FireArcanagosTimer -= diff;
@@ -137,7 +137,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void JustDied(Unit *killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
@@ -148,7 +148,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void DamageTaken(Unit* done_by, uint32 &damage)
{
if (damage > m_creature->GetHealth())
if (damage > me->GetHealth())
RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air.
}
@@ -163,9 +163,9 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if (!HasTaunted && m_creature->IsWithinDistInMap(who, 40.0))
if (!HasTaunted && me->IsWithinDistInMap(who, 40.0))
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
HasTaunted = true;
}
@@ -177,14 +177,14 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
if (!SummonedUnit)
return;
std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
std::list<HostileReference*>::const_iterator i = m_threatlist.begin();
for (i = m_threatlist.begin(); i != m_threatlist.end(); ++i)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && pUnit->isAlive())
{
float threat = m_creature->getThreatManager().getThreat(pUnit);
float threat = me->getThreatManager().getThreat(pUnit);
SummonedUnit->AddThreat(pUnit, threat);
}
}
@@ -194,40 +194,40 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
{
float x = KaelLocations[0][0];
float y = KaelLocations[0][1];
m_creature->GetMap()->CreatureRelocation(m_creature, x, y, LOCATION_Z, 0.0f);
//m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
me->GetMap()->CreatureRelocation(me, x, y, LOCATION_Z, 0.0f);
//me->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues...
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true);
}
DoCast(m_creature, SPELL_TELEPORT_CENTER, true);
DoCast(me, SPELL_TELEPORT_CENTER, true);
}
void CastGravityLapseKnockUp()
{
std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
// Knockback into the air
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID());
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, me->GetGUID());
}
}
void CastGravityLapseFly() // Use Fly Packet hack for now as players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air...
{
std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
// Also needs an exception in spell system.
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID());
pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, me->GetGUID());
// Use packet hack
WorldPacket data(12);
data.SetOpcode(SMSG_MOVE_SET_CAN_FLY);
@@ -240,10 +240,10 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
void RemoveGravityLapse()
{
std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin();
for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i)
std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin();
for (i = me->getThreatManager().getThreatList().begin(); i!= me->getThreatManager().getThreatList().end(); ++i)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*i)->getUnitGuid());
if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER))
{
pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY);
@@ -273,17 +273,17 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
{
if (PyroblastTimer <= diff)
{
m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
DoCast(m_creature, SPELL_SHOCK_BARRIER, true);
DoCast(m_creature->getVictim(), SPELL_PYROBLAST);
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
me->InterruptSpell(CURRENT_GENERIC_SPELL);
DoCast(me, SPELL_SHOCK_BARRIER, true);
DoCast(me->getVictim(), SPELL_PYROBLAST);
PyroblastTimer = 60000;
} else PyroblastTimer -= diff;
}
if (FireballTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIREBALL_NORMAL);
DoCast(me->getVictim(), SPELL_FIREBALL_NORMAL);
FireballTimer = urand(2000,6000);
} else FireballTimer -= diff;
@@ -296,7 +296,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
float x = KaelLocations[random][0];
float y = KaelLocations[random][1];
Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
Creature* Phoenix = me->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
if (Phoenix)
{
Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
@@ -304,7 +304,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
Phoenix->AI()->AttackStart(pTarget);
}
DoScriptText(SAY_PHOENIX, m_creature);
DoScriptText(SAY_PHOENIX, me);
PhoenixTimer = 60000;
} else PhoenixTimer -= diff;
@@ -313,21 +313,21 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
me->InterruptSpell(CURRENT_GENERIC_SPELL);
DoCast(pTarget, SPELL_FLAMESTRIKE3, true);
DoScriptText(SAY_FLAMESTRIKE, m_creature);
DoScriptText(SAY_FLAMESTRIKE, me);
}
FlameStrikeTimer = urand(15000,25000);
} else FlameStrikeTimer -= diff;
// Below 50%
if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth())
if (me->GetMaxHealth() * 0.5 > me->GetHealth())
{
m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
me->StopMoving();
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
GravityLapseTimer = 0;
GravityLapsePhase = 0;
Phase = 1;
@@ -346,7 +346,7 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
case 0:
if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse
{
DoScriptText(SAY_GRAVITY_LAPSE, m_creature);
DoScriptText(SAY_GRAVITY_LAPSE, me);
FirstGravityLapse = false;
if (pInstance)
@@ -356,10 +356,10 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
}
}else
{
DoScriptText(SAY_RECAST_GRAVITY, m_creature);
DoScriptText(SAY_RECAST_GRAVITY, me);
}
DoCast(m_creature, SPELL_GRAVITY_LAPSE_INITIAL);
DoCast(me, SPELL_GRAVITY_LAPSE_INITIAL);
GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell
GravityLapsePhase = 1;
break;
@@ -396,13 +396,13 @@ struct boss_felblood_kaelthasAI : public ScriptedAI
}
DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL);
DoCast(me, SPELL_GRAVITY_LAPSE_CHANNEL);
break;
case 4:
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(SAY_TIRED, m_creature);
DoCast(m_creature, SPELL_POWER_FEEDBACK);
me->InterruptNonMeleeSpells(false);
DoScriptText(SAY_TIRED, me);
DoCast(me, SPELL_POWER_FEEDBACK);
RemoveGravityLapse();
GravityLapseTimer = 10000;
GravityLapsePhase = 0;
@@ -427,10 +427,10 @@ struct mob_felkael_flamestrikeAI : public ScriptedAI
{
FlameStrikeTimer = 5000;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->setFaction(14);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setFaction(14);
DoCast(m_creature, SPELL_FLAMESTRIKE2, true);
DoCast(me, SPELL_FLAMESTRIKE2, true);
}
void EnterCombat(Unit *who) {}
@@ -439,8 +439,8 @@ struct mob_felkael_flamestrikeAI : public ScriptedAI
{
if (FlameStrikeTimer <= diff)
{
DoCast(m_creature, SPELL_FLAMESTRIKE1_NORMAL, true);
m_creature->Kill(m_creature);
DoCast(me, SPELL_FLAMESTRIKE1_NORMAL, true);
me->Kill(me);
} else FlameStrikeTimer -= diff;
}
};
@@ -460,9 +460,9 @@ struct mob_felkael_phoenixAI : public ScriptedAI
void Reset()
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
DoCast(m_creature, SPELL_PHOENIX_BURN, true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
DoCast(me, SPELL_PHOENIX_BURN, true);
BurnTimer = 2000;
Death_Timer = 3000;
Rebirth = false;
@@ -473,7 +473,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
void DamageTaken(Unit* pKiller, uint32 &damage)
{
if (damage < m_creature->GetHealth())
if (damage < me->GetHealth())
return;
//Prevent glitch if in fake death
@@ -490,19 +490,19 @@ struct mob_felkael_phoenixAI : public ScriptedAI
damage = 0;
FakeDeath = true;
m_creature->InterruptNonMeleeSpells(false);
m_creature->SetHealth(0);
m_creature->StopMoving();
m_creature->ClearComboPointHolders();
m_creature->RemoveAllAurasOnDeath();
m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->ClearAllReactives();
m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0);
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveIdle();
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
me->InterruptNonMeleeSpells(false);
me->SetHealth(0);
me->StopMoving();
me->ClearComboPointHolders();
me->RemoveAllAurasOnDeath();
me->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false);
me->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->ClearAllReactives();
me->SetUInt64Value(UNIT_FIELD_TARGET,0);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveIdle();
me->SetStandState(UNIT_STAND_STATE_DEAD);
}
@@ -510,7 +510,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
void JustDied(Unit* slayer)
{
m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
}
void UpdateAI(const uint32 diff)
@@ -521,7 +521,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
{
if (!Rebirth)
{
DoCast(m_creature, SPELL_REBIRTH_DMG);
DoCast(me, SPELL_REBIRTH_DMG);
Rebirth = true;
}
@@ -530,8 +530,8 @@ struct mob_felkael_phoenixAI : public ScriptedAI
if (Death_Timer <= diff)
{
m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
m_creature->DisappearAndDie();
me->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
me->DisappearAndDie();
Rebirth = false;
} else Death_Timer -= diff;
}
@@ -545,7 +545,7 @@ struct mob_felkael_phoenixAI : public ScriptedAI
{
//spell Burn should possible do this, but it doesn't, so do this for now.
uint16 dmg = urand(1650,2050);
m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false);
me->DealDamage(me, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false);
BurnTimer += 2000;
} BurnTimer -= diff;
@@ -571,8 +571,8 @@ struct mob_felkael_phoenix_eggAI : public ScriptedAI
{
if (HatchTimer <= diff)
{
m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
m_creature->Kill(m_creature);
me->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
me->Kill(me);
} else HatchTimer -= diff;
}
@@ -590,10 +590,10 @@ struct mob_arcane_sphereAI : public ScriptedAI
DespawnTimer = 30000;
ChangeTargetTimer = urand(6000,12000);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
m_creature->setFaction(14);
DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->setFaction(14);
DoCast(me, SPELL_ARCANE_SPHERE_PASSIVE, true);
}
void EnterCombat(Unit* who) {}
@@ -601,7 +601,7 @@ struct mob_arcane_sphereAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (DespawnTimer <= diff)
m_creature->Kill(m_creature);
me->Kill(me);
else
DespawnTimer -= diff;
@@ -613,8 +613,8 @@ struct mob_arcane_sphereAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
m_creature->AddThreat(pTarget, 1.0f);
m_creature->TauntApply(pTarget);
me->AddThreat(pTarget, 1.0f);
me->TauntApply(pTarget);
AttackStart(pTarget);
}
@@ -131,11 +131,11 @@ struct boss_priestess_delrissaAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i]))
{
if (!pAdd->getVictim())
{
@@ -152,7 +152,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
void InitializeLackeys()
{
//can be called if Creature are dead, so avoid
if (!m_creature->isAlive())
if (!me->isAlive())
return;
uint8 j = 0;
@@ -174,7 +174,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
//summon all the remaining in vector
for (std::vector<uint32>::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
{
if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
m_auiLackeyGUID[j] = pAdd->GetGUID();
++j;
@@ -184,12 +184,12 @@ struct boss_priestess_delrissaAI : public ScriptedAI
{
for (std::vector<uint32>::const_iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr)
{
Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[j]);
Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[j]);
//object already removed, not exist
if (!pAdd)
{
if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
if (Creature* pAdd = me->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0))
m_auiLackeyGUID[j] = pAdd->GetGUID();
}
++j;
@@ -202,7 +202,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
DoScriptText(PlayerDeath[PlayersKilled].id, m_creature);
DoScriptText(PlayerDeath[PlayersKilled].id, me);
if (PlayersKilled < 4)
++PlayersKilled;
@@ -210,7 +210,7 @@ struct boss_priestess_delrissaAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
@@ -219,8 +219,8 @@ struct boss_priestess_delrissaAI : public ScriptedAI
pInstance->SetData(DATA_DELRISSA_EVENT, DONE);
else
{
if (m_creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
if (me->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE))
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
}
}
@@ -232,8 +232,8 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (ResetTimer <= diff)
{
float x, y, z, o;
m_creature->GetHomePosition(x, y, z, o);
if (m_creature->GetPositionZ() >= z+10)
me->GetHomePosition(x, y, z, o);
if (me->GetPositionZ() >= z+10)
{
EnterEvadeMode();
return;
@@ -243,11 +243,11 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (HealTimer <= diff)
{
uint32 health = m_creature->GetHealth();
Unit *pTarget = m_creature;
uint32 health = me->GetHealth();
Unit *pTarget = me;
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[i]))
{
if (pAdd->isAlive() && pAdd->GetHealth() < health)
pTarget = pAdd;
@@ -260,10 +260,10 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (RenewTimer <= diff)
{
Unit *pTarget = m_creature;
Unit *pTarget = me;
if (urand(0,1))
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive())
pTarget = pAdd;
@@ -273,10 +273,10 @@ struct boss_priestess_delrissaAI : public ScriptedAI
if (ShieldTimer <= diff)
{
Unit *pTarget = m_creature;
Unit *pTarget = me;
if (urand(0,1))
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD))
pTarget = pAdd;
@@ -296,9 +296,9 @@ struct boss_priestess_delrissaAI : public ScriptedAI
friendly = true;
if (urand(0,1))
pTarget = m_creature;
pTarget = me;
else
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY]))
if (pAdd->isAlive())
pTarget = pAdd;
}
@@ -359,7 +359,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
ResetThreatTimer = urand(5000,20000);
// in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her)
if (Creature* pDelrissa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0))
if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_DELRISSA) : 0))
{
if (!pDelrissa->isAlive())
pDelrissa->Respawn();
@@ -375,9 +375,9 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUIDs[i]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
{
if (!pAdd->getVictim() && pAdd != m_creature)
if (!pAdd->getVictim() && pAdd != me)
{
pWho->SetInCombatWith(pAdd);
pAdd->AddThreat(pWho, 0.0f);
@@ -385,7 +385,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
}
}
if (Creature* pDelrissa = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)))
if (Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
{
if (pDelrissa->isAlive() && !pDelrissa->getVictim())
{
@@ -401,7 +401,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!pInstance)
return;
Creature* pDelrissa = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA));
Creature* pDelrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA));
uint32 uiLackeyDeathCount = pInstance->GetData(DATA_DELRISSA_DEATH_COUNT);
if (!pDelrissa)
@@ -433,7 +433,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!pInstance)
return;
if (Creature* Delrissa = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA)))
if (Creature* Delrissa = Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA)))
Delrissa->AI()->KilledUnit(victim);
}
@@ -442,7 +442,7 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
if (!pInstance)
return;
if (Creature* Delrissa = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_DELRISSA))))
if (Creature* Delrissa = (Unit::GetCreature(*me, pInstance->GetData64(DATA_DELRISSA))))
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
m_auiLackeyGUIDs[i] = CAST_AI(boss_priestess_delrissaAI, Delrissa->AI())->m_auiLackeyGUID[i];
@@ -451,9 +451,9 @@ struct boss_priestess_lackey_commonAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (!UsedPotion && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)
if (!UsedPotion && (me->GetHealth()*100 / me->GetMaxHealth()) < 25)
{
DoCast(m_creature, SPELL_HEALING_POTION);
DoCast(me, SPELL_HEALING_POTION);
UsedPotion = true;
}
@@ -495,7 +495,7 @@ struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
Eviscerate_Timer = 6000;
Wait_Timer = 5000;
InVanish = false;
m_creature->SetVisibility(VISIBILITY_ON);
me->SetVisibility(VISIBILITY_ON);
boss_priestess_lackey_commonAI::Reset();
}
@@ -509,14 +509,14 @@ struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
if (Vanish_Timer <= diff)
{
DoCast(m_creature, SPELL_VANISH);
DoCast(me, SPELL_VANISH);
Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoResetThreat();
if (pUnit)
m_creature->AddThreat(pUnit, 1000.0f);
me->AddThreat(pUnit, 1000.0f);
InVanish = true;
Vanish_Timer = 30000;
@@ -527,28 +527,28 @@ struct boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI
{
if (Wait_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true);
DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true);
m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike
DoCast(me->getVictim(), SPELL_BACKSTAB, true);
DoCast(me->getVictim(), SPELL_KIDNEY_SHOT, true);
me->SetVisibility(VISIBILITY_ON); // ...? Hacklike
InVanish = false;
} else Wait_Timer -= diff;
}
if (Gouge_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GOUGE);
DoCast(me->getVictim(), SPELL_GOUGE);
Gouge_Timer = 5500;
} else Gouge_Timer -= diff;
if (Kick_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KICK);
DoCast(me->getVictim(), SPELL_KICK);
Kick_Timer = 7000;
} else Kick_Timer -= diff;
if (Eviscerate_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_EVISCERATE);
DoCast(me->getVictim(), SPELL_EVISCERATE);
Eviscerate_Timer = 4000;
} else Eviscerate_Timer -= diff;
@@ -597,7 +597,7 @@ struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI
void Aggro(Unit* pWho)
{
DoCast(m_creature, SPELL_SUMMON_IMP);
DoCast(me, SPELL_SUMMON_IMP);
}
void UpdateAI(const uint32 diff)
@@ -609,13 +609,13 @@ struct boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI
if (Immolate_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_IMMOLATE);
DoCast(me->getVictim(), SPELL_IMMOLATE);
Immolate_Timer = 6000;
} else Immolate_Timer -= diff;
if (Shadow_Bolt_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
Shadow_Bolt_Timer = 5000;
} else Shadow_Bolt_Timer -= diff;
@@ -683,13 +683,13 @@ struct boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI
if (Knockdown_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
Knockdown_Timer = 6000;
} else Knockdown_Timer -= diff;
if (Snap_Kick_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SNAP_KICK);
DoCast(me->getVictim(), SPELL_SNAP_KICK);
Snap_Kick_Timer = 4500;
} else Snap_Kick_Timer -= diff;
@@ -761,9 +761,9 @@ struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
}
} else Polymorph_Timer -= diff;
if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked)
if (((me->GetHealth()*100 / me->GetMaxHealth()) < 35) && !HasIceBlocked)
{
DoCast(m_creature, SPELL_ICE_BLOCK);
DoCast(me, SPELL_ICE_BLOCK);
HasIceBlocked = true;
}
@@ -777,32 +777,32 @@ struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
if (Ice_Lance_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ICE_LANCE);
DoCast(me->getVictim(), SPELL_ICE_LANCE);
Ice_Lance_Timer = 12000;
} else Ice_Lance_Timer -= diff;
if (Cone_of_Cold_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD);
DoCast(me->getVictim(), SPELL_CONE_OF_COLD);
Cone_of_Cold_Timer = 10000;
} else Cone_of_Cold_Timer -= diff;
if (Frostbolt_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
DoCast(me->getVictim(), SPELL_FROSTBOLT);
Frostbolt_Timer = 8000;
} else Frostbolt_Timer -= diff;
if (Blink_Timer <= diff)
{
bool InMeleeRange = false;
std::list<HostileReference*>& t_list = m_creature->getThreatManager().getThreatList();
std::list<HostileReference*>& t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
if (Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
//if in melee range
if (pTarget->IsWithinDistInMap(m_creature, 5))
if (pTarget->IsWithinDistInMap(me, 5))
{
InMeleeRange = true;
break;
@@ -812,7 +812,7 @@ struct boss_yazzaiAI : public boss_priestess_lackey_commonAI
//if anybody is in melee range than escape by blink
if (InMeleeRange)
DoCast(m_creature, SPELL_BLINK);
DoCast(me, SPELL_BLINK);
Blink_Timer = 8000;
} else Blink_Timer -= diff;
@@ -863,7 +863,7 @@ struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
void EnterCombat(Unit* who)
{
DoCast(m_creature, SPELL_BATTLE_SHOUT);
DoCast(me, SPELL_BATTLE_SHOUT);
}
void UpdateAI(const uint32 diff)
@@ -876,13 +876,13 @@ struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
if (Intercept_Stun_Timer <= diff)
{
bool InMeleeRange = false;
std::list<HostileReference*>& t_list = m_creature->getThreatManager().getThreatList();
std::list<HostileReference*>& t_list = me->getThreatManager().getThreatList();
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
{
if (Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()))
if (Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid()))
{
//if in melee range
if (pTarget->IsWithinDistInMap(m_creature, ATTACK_DISTANCE))
if (pTarget->IsWithinDistInMap(me, ATTACK_DISTANCE))
{
InMeleeRange = true;
break;
@@ -902,31 +902,31 @@ struct boss_warlord_salarisAI : public boss_priestess_lackey_commonAI
if (Disarm_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DISARM);
DoCast(me->getVictim(), SPELL_DISARM);
Disarm_Timer = 6000;
} else Disarm_Timer -= diff;
if (Hamstring_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
DoCast(me->getVictim(), SPELL_HAMSTRING);
Hamstring_Timer = 4500;
} else Hamstring_Timer -= diff;
if (Mortal_Strike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
Mortal_Strike_Timer = 4500;
} else Mortal_Strike_Timer -= diff;
if (Piercing_Howl_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_PIERCING_HOWL);
DoCast(me->getVictim(), SPELL_PIERCING_HOWL);
Piercing_Howl_Timer = 10000;
} else Piercing_Howl_Timer -= diff;
if (Frightening_Shout_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
Frightening_Shout_Timer = 18000;
} else Frightening_Shout_Timer -= diff;
@@ -974,9 +974,9 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
Wing_Clip_Timer = 4000;
Freezing_Trap_Timer = 15000;
Unit* pPet = Unit::GetUnit(*m_creature,m_uiPetGUID);
Unit* pPet = Unit::GetUnit(*me,m_uiPetGUID);
if (!pPet)
m_creature->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
boss_priestess_lackey_commonAI::Reset();
}
@@ -993,18 +993,18 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
boss_priestess_lackey_commonAI::UpdateAI(diff);
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
if (me->IsWithinDistInMap(me->getVictim(), ATTACK_DISTANCE))
{
if (Wing_Clip_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WING_CLIP);
DoCast(me->getVictim(), SPELL_WING_CLIP);
Wing_Clip_Timer = 4000;
} else Wing_Clip_Timer -= diff;
if (Freezing_Trap_Timer <= diff)
{
//attempt find go summoned from spell (casted by m_creature)
GameObject* pGo = m_creature->GetGameObject(SPELL_FREEZING_TRAP);
//attempt find go summoned from spell (casted by me)
GameObject* pGo = me->GetGameObject(SPELL_FREEZING_TRAP);
//if we have a pGo, we need to wait (only one trap at a time)
if (pGo)
@@ -1012,7 +1012,7 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
else
{
//if pGo does not exist, then we can cast
DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP);
DoCast(me->getVictim(), SPELL_FREEZING_TRAP);
Freezing_Trap_Timer = 15000;
}
} else Freezing_Trap_Timer -= diff;
@@ -1023,25 +1023,25 @@ struct boss_garaxxasAI : public boss_priestess_lackey_commonAI
{
if (Concussive_Shot_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT);
DoCast(me->getVictim(), SPELL_CONCUSSIVE_SHOT);
Concussive_Shot_Timer = 8000;
} else Concussive_Shot_Timer -= diff;
if (Multi_Shot_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT);
DoCast(me->getVictim(), SPELL_MULTI_SHOT);
Multi_Shot_Timer = 10000;
} else Multi_Shot_Timer -= diff;
if (Aimed_Shot_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_AIMED_SHOT);
DoCast(me->getVictim(), SPELL_AIMED_SHOT);
Aimed_Shot_Timer = 6000;
} else Aimed_Shot_Timer -= diff;
if (Shoot_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHOOT);
DoCast(me->getVictim(), SPELL_SHOOT);
Shoot_Timer = 2500;
} else Shoot_Timer -= diff;
}
@@ -1097,14 +1097,14 @@ struct boss_apokoAI : public boss_priestess_lackey_commonAI
if (Totem_Timer <= diff)
{
DoCast(m_creature, RAND(SPELL_WINDFURY_TOTEM,SPELL_FIRE_NOVA_TOTEM,SPELL_EARTHBIND_TOTEM));
DoCast(me, RAND(SPELL_WINDFURY_TOTEM,SPELL_FIRE_NOVA_TOTEM,SPELL_EARTHBIND_TOTEM));
++Totem_Amount;
Totem_Timer = Totem_Amount*2000;
} else Totem_Timer -= diff;
if (War_Stomp_Timer <= diff)
{
DoCast(m_creature, SPELL_WAR_STOMP);
DoCast(me, SPELL_WAR_STOMP);
War_Stomp_Timer = 10000;
} else War_Stomp_Timer -= diff;
@@ -1118,7 +1118,7 @@ struct boss_apokoAI : public boss_priestess_lackey_commonAI
if (Frost_Shock_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
DoCast(me->getVictim(), SPELL_FROST_SHOCK);
Frost_Shock_Timer = 7000;
} else Frost_Shock_Timer -= diff;
@@ -1128,10 +1128,10 @@ struct boss_apokoAI : public boss_priestess_lackey_commonAI
// uint64 guid = (*itr)->guid;
// if (guid)
// {
// Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid);
// Unit* pAdd = Unit::GetUnit(*me, (*itr)->guid);
// if (pAdd && pAdd->isAlive())
// {
DoCast(m_creature, SPELL_LESSER_HEALING_WAVE);
DoCast(me, SPELL_LESSER_HEALING_WAVE);
Healing_Wave_Timer = 5000;
// }
// }
@@ -1187,19 +1187,19 @@ struct boss_zelfanAI : public boss_priestess_lackey_commonAI
if (Goblin_Dragon_Gun_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN);
DoCast(me->getVictim(), SPELL_GOBLIN_DRAGON_GUN);
Goblin_Dragon_Gun_Timer = 10000;
} else Goblin_Dragon_Gun_Timer -= diff;
if (Rocket_Launch_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ROCKET_LAUNCH);
DoCast(me->getVictim(), SPELL_ROCKET_LAUNCH);
Rocket_Launch_Timer = 9000;
} else Rocket_Launch_Timer -= diff;
if (Fel_Iron_Bomb_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FEL_IRON_BOMB);
DoCast(me->getVictim(), SPELL_FEL_IRON_BOMB);
Fel_Iron_Bomb_Timer = 15000;
} else Fel_Iron_Bomb_Timer -= diff;
@@ -1207,7 +1207,7 @@ struct boss_zelfanAI : public boss_priestess_lackey_commonAI
{
for (uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i)
{
if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUIDs[i]))
if (Unit* pAdd = Unit::GetUnit(*me, m_auiLackeyGUIDs[i]))
{
if (pAdd->IsPolymorphed())
{
@@ -1221,7 +1221,7 @@ struct boss_zelfanAI : public boss_priestess_lackey_commonAI
if (High_Explosive_Sheep_Timer <= diff)
{
DoCast(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP);
DoCast(me, SPELL_HIGH_EXPLOSIVE_SHEEP);
High_Explosive_Sheep_Timer = 65000;
} else High_Explosive_Sheep_Timer -= diff;
@@ -1253,7 +1253,7 @@ CreatureAI* GetAI_zelfan(Creature* pCreature)
// {
// if (Explosion_Timer <= diff)
// {
// DoCast(m_creature->getVictim(), SPELL_SHEEP_EXPLOSION);
// DoCast(me->getVictim(), SPELL_SHEEP_EXPLOSION);
// }else
// Explosion_Timer -= diff;
// }
@@ -91,8 +91,8 @@ struct boss_selin_fireheartAI : public ScriptedAI
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
//Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]);
Unit* pUnit = Unit::GetUnit(*m_creature, *itr);
//Unit* pUnit = Unit::GetUnit(*me, FelCrystals[i]);
Unit* pUnit = Unit::GetUnit(*me, *itr);
if (pUnit)
{
if (!pUnit->isAlive())
@@ -135,12 +135,12 @@ struct boss_selin_fireheartAI : public ScriptedAI
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
pCrystal = NULL;
//pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]);
pCrystal = Unit::GetUnit(*m_creature, *itr);
//pCrystal = Unit::GetUnit(*me, FelCrystals[i]);
pCrystal = Unit::GetUnit(*me, *itr);
if (pCrystal && pCrystal->isAlive())
{
// select nearest
if (!CrystalChosen || m_creature->GetDistanceOrder(pCrystal, CrystalChosen, false))
if (!CrystalChosen || me->GetDistanceOrder(pCrystal, CrystalChosen, false))
{
CrystalGUID = pCrystal->GetGUID();
CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell.
@@ -149,16 +149,16 @@ struct boss_selin_fireheartAI : public ScriptedAI
}
if (CrystalChosen)
{
DoScriptText(SAY_ENERGY, m_creature);
DoScriptText(EMOTE_CRYSTAL, m_creature);
DoScriptText(SAY_ENERGY, me);
DoScriptText(EMOTE_CRYSTAL, me);
CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true);
float x, y, z; // coords that we move to, close to the crystal.
CrystalChosen->GetClosePoint(x, y, z, m_creature->GetObjectSize(), CONTACT_DISTANCE);
CrystalChosen->GetClosePoint(x, y, z, me->GetObjectSize(), CONTACT_DISTANCE);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->GetMotionMaster()->MovePoint(1, x, y, z);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
me->GetMotionMaster()->MovePoint(1, x, y, z);
DrainingCrystal = true;
}
}
@@ -171,8 +171,8 @@ struct boss_selin_fireheartAI : public ScriptedAI
//for (uint8 i = 0; i < CRYSTALS_NUMBER; ++i)
for (std::list<uint64>::const_iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr)
{
//Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i]));
Creature* pCrystal = Unit::GetCreature(*m_creature, *itr);
//Creature* pCrystal = (Unit::GetCreature(*me, FelCrystals[i]));
Creature* pCrystal = Unit::GetCreature(*me, *itr);
if (pCrystal && pCrystal->isAlive())
pCrystal->Kill(pCrystal);
}
@@ -180,7 +180,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false);
@@ -189,20 +189,20 @@ struct boss_selin_fireheartAI : public ScriptedAI
void KilledUnit(Unit* victim)
{
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), m_creature);
DoScriptText(RAND(SAY_KILL_1,SAY_KILL_2), me);
}
void MovementInform(uint32 type, uint32 id)
{
if (type == POINT_MOTION_TYPE && id == 1)
{
Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
if (CrystalChosen && CrystalChosen->isAlive())
{
// Make the crystal attackable
// We also remove NON_ATTACKABLE in case the database has it set.
CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
CrystalChosen->CastSpell(m_creature, SPELL_MANA_RAGE, true);
CrystalChosen->CastSpell(me, SPELL_MANA_RAGE, true);
IsDraining = true;
}
else
@@ -216,7 +216,7 @@ struct boss_selin_fireheartAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (!pInstance)
return;
@@ -234,8 +234,8 @@ struct boss_selin_fireheartAI : public ScriptedAI
if (!DrainingCrystal)
{
uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
uint32 maxPowerMana = me->GetMaxPower(POWER_MANA);
if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
{
if (DrainLifeTimer <= diff)
{
@@ -256,16 +256,16 @@ struct boss_selin_fireheartAI : public ScriptedAI
if (FelExplosionTimer <= diff)
{
if (!m_creature->IsNonMeleeSpellCasted(false))
if (!me->IsNonMeleeSpellCasted(false))
{
DoCast(m_creature, SPELL_FEL_EXPLOSION);
DoCast(me, SPELL_FEL_EXPLOSION);
FelExplosionTimer = 2000;
}
} else FelExplosionTimer -= diff;
// If below 10% mana, start recharging
maxPowerMana = m_creature->GetMaxPower(POWER_MANA);
if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
maxPowerMana = me->GetMaxPower(POWER_MANA);
if (maxPowerMana && ((me->GetPower(POWER_MANA)*100 / maxPowerMana) < 10))
{
if (DrainCrystalTimer <= diff)
{
@@ -286,17 +286,17 @@ struct boss_selin_fireheartAI : public ScriptedAI
IsDraining = false;
DrainingCrystal = false;
DoScriptText(SAY_EMPOWERED, m_creature);
DoScriptText(SAY_EMPOWERED, me);
Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID);
Unit* CrystalChosen = Unit::GetUnit(*me, CrystalGUID);
if (CrystalChosen && CrystalChosen->isAlive())
// Use Deal Damage to kill it, not setDeathState.
CrystalChosen->Kill(CrystalChosen);
CrystalGUID = 0;
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MoveChase(me->getVictim());
} else EmpowerTimer -= diff;
}
}
@@ -322,12 +322,12 @@ struct mob_fel_crystalAI : public ScriptedAI
void JustDied(Unit* killer)
{
if (ScriptedInstance* pInstance = m_creature->GetInstanceData())
if (ScriptedInstance* pInstance = me->GetInstanceData())
{
Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN)));
Creature* Selin = (Unit::GetCreature(*me, pInstance->GetData64(DATA_SELIN)));
if (Selin && Selin->isAlive())
{
if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == m_creature->GetGUID())
if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == me->GetGUID())
{
// Set this to false if we are the Creature that Selin is draining so his AI flows properly
CAST_AI(boss_selin_fireheartAI, Selin->AI())->DrainingCrystal = false;
@@ -86,7 +86,7 @@ struct boss_vexallusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void JustDied(Unit *victim)
@@ -97,7 +97,7 @@ struct boss_vexallusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS);
@@ -109,7 +109,7 @@ struct boss_vexallusAI : public ScriptedAI
summoned->GetMotionMaster()->MoveFollow(temp,0,0);
//spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok
summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,m_creature->GetGUID());
summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,me->GetGUID());
}
void UpdateAI(const uint32 diff)
@@ -120,7 +120,7 @@ struct boss_vexallusAI : public ScriptedAI
if (!Enraged)
{
//used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25%
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
if ((me->GetHealth()*100 / me->GetMaxHealth()) <= (100-(INTERVAL_MODIFIER*IntervalHealthAmount)))
{
//increase amount, unless we're at 10%, then we switch and return
if (IntervalHealthAmount == INTERVAL_SWITCH)
@@ -131,22 +131,22 @@ struct boss_vexallusAI : public ScriptedAI
else
++IntervalHealthAmount;
DoScriptText(SAY_ENERGY, m_creature);
DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature);
DoScriptText(SAY_ENERGY, me);
DoScriptText(EMOTE_DISCHARGE_ENERGY, me);
if (IsHeroic())
{
DoCast(m_creature, H_SPELL_SUMMON_PURE_ENERGY1, false);
DoCast(m_creature, H_SPELL_SUMMON_PURE_ENERGY2, false);
DoCast(me, H_SPELL_SUMMON_PURE_ENERGY1, false);
DoCast(me, H_SPELL_SUMMON_PURE_ENERGY2, false);
}
else
DoCast(m_creature, SPELL_SUMMON_PURE_ENERGY, false);
DoCast(me, SPELL_SUMMON_PURE_ENERGY, false);
//below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in the core
m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
if (IsHeroic())
m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
me->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
}
if (ChainLightningTimer <= diff)
@@ -170,7 +170,7 @@ struct boss_vexallusAI : public ScriptedAI
{
if (OverloadTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_OVERLOAD);
DoCast(me->getVictim(), SPELL_OVERLOAD);
OverloadTimer = 2000;
} else OverloadTimer -= diff;
@@ -193,7 +193,7 @@ struct mob_pure_energyAI : public ScriptedAI
void JustDied(Unit* slayer)
{
if (Unit *temp = m_creature->GetOwner())
if (Unit *temp = me->GetOwner())
{
if (temp && temp->isAlive())
slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID());
@@ -60,8 +60,8 @@ struct npc_kalecgosAI : public ScriptedAI
m_uiTransformTimer = 0;
// we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here
if (m_creature->GetEntry() != NPC_KAEL)
m_creature->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
if (me->GetEntry() != NPC_KAEL)
me->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]);
}
void MovementInform(uint32 uiType, uint32 uiPointId)
@@ -76,7 +76,7 @@ struct npc_kalecgosAI : public ScriptedAI
// some targeting issues with the spell, so use this workaround as temporary solution
void DoWorkaroundForQuestCredit()
{
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
if (!pMap || pMap->IsHeroic())
return;
@@ -104,12 +104,12 @@ struct npc_kalecgosAI : public ScriptedAI
{
if (m_uiTransformTimer <= uiDiff)
{
DoCast(m_creature, SPELL_ORB_KILL_CREDIT, false);
DoCast(me, SPELL_ORB_KILL_CREDIT, false);
DoWorkaroundForQuestCredit();
// Transform and update entry, now ready for quest/read gossip
DoCast(m_creature, SPELL_TRANSFORM_TO_KAEL, false);
m_creature->UpdateEntry(NPC_KAEL);
DoCast(me, SPELL_TRANSFORM_TO_KAEL, false);
me->UpdateEntry(NPC_KAEL);
m_uiTransformTimer = 0;
} else m_uiTransformTimer -= uiDiff;
@@ -55,18 +55,18 @@ struct boss_baron_geddonAI : public ScriptedAI
return;
//If we are <2% hp cast Armageddom
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2)
if (me->GetHealth()*100 / me->GetMaxHealth() <= 2)
{
m_creature->InterruptNonMeleeSpells(true);
DoCast(m_creature, SPELL_ARMAGEDDOM);
DoScriptText(EMOTE_SERVICE, m_creature);
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_ARMAGEDDOM);
DoScriptText(EMOTE_SERVICE, me);
return;
}
//Inferno_Timer
if (Inferno_Timer <= diff)
{
DoCast(m_creature, SPELL_INFERNO);
DoCast(me, SPELL_INFERNO);
Inferno_Timer = 45000;
} else Inferno_Timer -= diff;
@@ -61,14 +61,14 @@ struct boss_garrAI : public ScriptedAI
//AntiMagicPulse_Timer
if (AntiMagicPulse_Timer <= diff)
{
DoCast(m_creature, SPELL_ANTIMAGICPULSE);
DoCast(me, SPELL_ANTIMAGICPULSE);
AntiMagicPulse_Timer = 10000 + rand()%5000;
} else AntiMagicPulse_Timer -= diff;
//MagmaShackles_Timer
if (MagmaShackles_Timer <= diff)
{
DoCast(m_creature, SPELL_MAGMASHACKLES);
DoCast(me, SPELL_MAGMASHACKLES);
MagmaShackles_Timer = 8000 + rand()%4000;
} else MagmaShackles_Timer -= diff;
@@ -106,11 +106,11 @@ struct mob_fireswornAI : public ScriptedAI
} else Immolate_Timer -= diff;
//Cast Erruption and let them die
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10)
if (me->GetHealth() <= me->GetMaxHealth() * 0.10)
{
DoCast(m_creature->getVictim(), SPELL_ERUPTION);
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
DoCast(me->getVictim(), SPELL_ERUPTION);
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
}
DoMeleeAttackIfReady();
@@ -70,7 +70,7 @@ struct boss_gehennasAI : public ScriptedAI
//GehennasCurse_Timer
if (GehennasCurse_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GEHENNASCURSE);
DoCast(me->getVictim(), SPELL_GEHENNASCURSE);
GehennasCurse_Timer = urand(22000,30000);
} else GehennasCurse_Timer -= diff;
@@ -58,7 +58,7 @@ struct boss_golemaggAI : public ScriptedAI
m_uiBuffTimer = 2.5*IN_MILISECONDS;
m_bEnraged = false;
DoCast(m_creature, SPELL_MAGMASPLASH, true);
DoCast(me, SPELL_MAGMASPLASH, true);
}
void JustDied(Unit* pKiller)
@@ -84,9 +84,9 @@ struct boss_golemaggAI : public ScriptedAI
m_uiPyroblastTimer -= uiDiff;
// Enrage
if (!m_bEnraged && m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*10)
if (!m_bEnraged && me->GetHealth()*100 < me->GetMaxHealth()*10)
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
m_bEnraged = true;
}
@@ -95,7 +95,7 @@ struct boss_golemaggAI : public ScriptedAI
{
if (m_uiEarthquakeTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE);
DoCast(me->getVictim(), SPELL_EARTHQUAKE);
m_uiEarthquakeTimer = 3*IN_MILISECONDS;
}
else
@@ -106,7 +106,7 @@ struct boss_golemaggAI : public ScriptedAI
// Golemagg's Trust
if (m_uiBuffTimer <= uidiff)
{
DoCast(m_creature, SPELL_GOLEMAGG_TRUST);
DoCast(me, SPELL_GOLEMAGG_TRUST);
m_uiBuffTimer = 2.5*IN_MILISECONDS;
}
else
@@ -135,7 +135,7 @@ struct mob_core_ragerAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
{
if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*50)
if (me->GetHealth()*100 < me->GetMaxHealth()*50)
{
if (m_pInstance)
{
@@ -143,11 +143,11 @@ struct mob_core_ragerAI : public ScriptedAI
{
if (pGolemagg->isAlive())
{
DoScriptText(EMOTE_LOWHP, m_creature);
m_creature->SetHealth(m_creature->GetMaxHealth());
DoScriptText(EMOTE_LOWHP, me);
me->SetHealth(me->GetMaxHealth());
}
else
uiDamage = m_creature->GetHealth();
uiDamage = me->GetHealth();
}
}
}
@@ -161,7 +161,7 @@ struct mob_core_ragerAI : public ScriptedAI
// Mangle
if (m_uiMangleTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_MANGLE);
DoCast(me->getVictim(), SPELL_MANGLE);
m_uiMangleTimer = 10*IN_MILISECONDS;
}
else
@@ -54,21 +54,21 @@ struct boss_lucifronAI : public ScriptedAI
//Impending doom timer
if (ImpendingDoom_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_IMPENDINGDOOM);
DoCast(me->getVictim(), SPELL_IMPENDINGDOOM);
ImpendingDoom_Timer = 20000;
} else ImpendingDoom_Timer -= diff;
//Lucifron's curse timer
if (LucifronCurse_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_LUCIFRONCURSE);
DoCast(me->getVictim(), SPELL_LUCIFRONCURSE);
LucifronCurse_Timer = 15000;
} else LucifronCurse_Timer -= diff;
//Shadowshock
if (ShadowShock_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK);
DoCast(me->getVictim(), SPELL_SHADOWSHOCK);
ShadowShock_Timer = 6000;
} else ShadowShock_Timer -= diff;
@@ -45,7 +45,7 @@ struct boss_magmadarAI : public ScriptedAI
Panic_Timer = 20000;
Lavabomb_Timer = 12000;
DoCast(m_creature, SPELL_MAGMASPIT, true);
DoCast(me, SPELL_MAGMASPIT, true);
}
void EnterCombat(Unit *who)
@@ -60,15 +60,15 @@ struct boss_magmadarAI : public ScriptedAI
//Frenzy_Timer
if (Frenzy_Timer <= diff)
{
DoScriptText(EMOTE_FRENZY, m_creature);
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_FRENZY, me);
DoCast(me, SPELL_FRENZY);
Frenzy_Timer = 15000;
} else Frenzy_Timer -= diff;
//Panic_Timer
if (Panic_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_PANIC);
DoCast(me->getVictim(), SPELL_PANIC);
Panic_Timer = 35000;
} else Panic_Timer -= diff;
@@ -71,12 +71,12 @@ struct boss_majordomoAI : public ScriptedAI
if (rand()%5)
return;
DoScriptText(SAY_SLAY, m_creature);
DoScriptText(SAY_SLAY, me);
}
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -85,15 +85,15 @@ struct boss_majordomoAI : public ScriptedAI
return;
//Cast Ageis if less than 50% hp
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
DoCast(m_creature, SPELL_AEGIS);
DoCast(me, SPELL_AEGIS);
}
//MagicReflection_Timer
// if (MagicReflection_Timer <= diff)
// {
// DoCast(m_creature, SPELL_MAGICREFLECTION);
// DoCast(me, SPELL_MAGICREFLECTION);
//60 seconds until we should cast this agian
// MagicReflection_Timer = 30000;
@@ -102,7 +102,7 @@ struct boss_majordomoAI : public ScriptedAI
//DamageReflection_Timer
// if (DamageReflection_Timer <= diff)
// {
// DoCast(m_creature, SPELL_DAMAGEREFLECTION);
// DoCast(me, SPELL_DAMAGEREFLECTION);
//60 seconds until we should cast this agian
// DamageReflection_Timer = 30000;
@@ -111,7 +111,7 @@ struct boss_majordomoAI : public ScriptedAI
//Blastwave_Timer
if (Blastwave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BLASTWAVE);
DoCast(me->getVictim(), SPELL_BLASTWAVE);
Blastwave_Timer = 10000;
} else Blastwave_Timer -= diff;
@@ -118,7 +118,7 @@ struct boss_ragnarosAI : public ScriptedAI
HasSubmergedOnce = false;
WasBanished = false;
DoCast(m_creature, SPELL_MELTWEAPON, true);
DoCast(me, SPELL_MELTWEAPON, true);
HasAura = true;
}
@@ -127,7 +127,7 @@ struct boss_ragnarosAI : public ScriptedAI
if (rand()%5)
return;
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void EnterCombat(Unit *who)
@@ -139,9 +139,9 @@ struct boss_ragnarosAI : public ScriptedAI
if (WasBanished && Attack_Timer <= diff)
{
//Become unbanished again
m_creature->setFaction(14);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(m_creature, SPELL_RAGEMERGE);
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_RAGEMERGE);
WasBanished = false;
} else if (WasBanished)
{
@@ -157,10 +157,10 @@ struct boss_ragnarosAI : public ScriptedAI
//WrathOfRagnaros_Timer
if (WrathOfRagnaros_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WRATHOFRAGNAROS);
DoCast(me->getVictim(), SPELL_WRATHOFRAGNAROS);
if (urand(0,1))
DoScriptText(SAY_WRATH, m_creature);
DoScriptText(SAY_WRATH, me);
WrathOfRagnaros_Timer = 30000;
} else WrathOfRagnaros_Timer -= diff;
@@ -168,10 +168,10 @@ struct boss_ragnarosAI : public ScriptedAI
//HandOfRagnaros_Timer
if (HandOfRagnaros_Timer <= diff)
{
DoCast(m_creature, SPELL_HANDOFRAGNAROS);
DoCast(me, SPELL_HANDOFRAGNAROS);
if (urand(0,1))
DoScriptText(SAY_HAND, m_creature);
DoScriptText(SAY_HAND, me);
HandOfRagnaros_Timer = 25000;
} else HandOfRagnaros_Timer -= diff;
@@ -179,21 +179,21 @@ struct boss_ragnarosAI : public ScriptedAI
//LavaBurst_Timer
if (LavaBurst_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_LAVABURST);
DoCast(me->getVictim(), SPELL_LAVABURST);
LavaBurst_Timer = 10000;
} else LavaBurst_Timer -= diff;
//Erruption_Timer
if (LavaBurst_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ERRUPTION);
DoCast(me->getVictim(), SPELL_ERRUPTION);
Erruption_Timer = urand(20000,45000);
} else Erruption_Timer -= diff;
//ElementalFire_Timer
if (ElementalFire_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ELEMENTALFIRE);
DoCast(me->getVictim(), SPELL_ELEMENTALFIRE);
ElementalFire_Timer = urand(10000,14000);
} else ElementalFire_Timer -= diff;
@@ -204,48 +204,48 @@ struct boss_ragnarosAI : public ScriptedAI
//is not very well supported in the core
//so added normaly spawning and banish workaround and attack again after 90 secs.
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
//Root self
DoCast(m_creature, 23973);
m_creature->setFaction(35);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
DoCast(me, 23973);
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
if (!HasSubmergedOnce)
{
DoScriptText(SAY_REINFORCEMENTS1, m_creature);
DoScriptText(SAY_REINFORCEMENTS1, me);
// summon 10 elementals
for (uint8 i = 0; i < 9; ++i)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
pSummoned->AI()->AttackStart(pTarget);
}
}
HasSubmergedOnce = true;
WasBanished = true;
DoCast(m_creature, SPELL_RAGSUBMERGE);
DoCast(me, SPELL_RAGSUBMERGE);
Attack_Timer = 90000;
}
else
{
DoScriptText(SAY_REINFORCEMENTS2, m_creature);
DoScriptText(SAY_REINFORCEMENTS2, me);
for (uint8 i = 0; i < 9; ++i)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
if (Creature* pSummoned = me->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000))
pSummoned->AI()->AttackStart(pTarget);
}
}
WasBanished = true;
DoCast(m_creature, SPELL_RAGSUBMERGE);
DoCast(me, SPELL_RAGSUBMERGE);
Attack_Timer = 90000;
}
@@ -253,13 +253,13 @@ struct boss_ragnarosAI : public ScriptedAI
} else Submerge_Timer -= diff;
//If we are within range melee the target
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
if (me->IsWithinMeleeRange(me->getVictim()))
{
//Make sure our attack is ready and we arn't currently casting
if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
}
else
@@ -267,12 +267,12 @@ struct boss_ragnarosAI : public ScriptedAI
//MagmaBurst_Timer
if (MagmaBurst_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MAGMABURST);
DoCast(me->getVictim(), SPELL_MAGMABURST);
if (!HasYelledMagmaBurst)
{
//Say our dialog
DoScriptText(SAY_MAGMABURST, m_creature);
DoScriptText(SAY_MAGMABURST, me);
HasYelledMagmaBurst = true;
}
@@ -59,7 +59,7 @@ struct boss_shazzrahAI : public ScriptedAI
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANEEXPLOSION);
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 5000 + rand()%4000;
} else ArcaneExplosion_Timer -= diff;
@@ -76,14 +76,14 @@ struct boss_shazzrahAI : public ScriptedAI
//DeadenMagic_Timer
if (DeadenMagic_Timer <= diff)
{
DoCast(m_creature, SPELL_DEADENMAGIC);
DoCast(me, SPELL_DEADENMAGIC);
DeadenMagic_Timer = 35000;
} else DeadenMagic_Timer -= diff;
//Countspell_Timer
if (Countspell_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_COUNTERSPELL);
DoCast(me->getVictim(), SPELL_COUNTERSPELL);
Countspell_Timer = 16000 + rand()%4000;
} else Countspell_Timer -= diff;
@@ -66,7 +66,7 @@ struct boss_sulfuronAI : public ScriptedAI
//DemoralizingShout_Timer
if (DemoralizingShout_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DEMORALIZINGSHOUT);
DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
DemoralizingShout_Timer = 15000 + rand()%5000;
} else DemoralizingShout_Timer -= diff;
@@ -85,7 +85,7 @@ struct boss_sulfuronAI : public ScriptedAI
if (pTarget)
DoCast(pTarget, SPELL_INSPIRE);
DoCast(m_creature, SPELL_INSPIRE);
DoCast(me, SPELL_INSPIRE);
Inspire_Timer = 20000 + rand()%6000;
} else Inspire_Timer -= diff;
@@ -93,7 +93,7 @@ struct boss_sulfuronAI : public ScriptedAI
//Knockdown_Timer
if (Knockdown_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
Knockdown_Timer = 12000 + rand()%3000;
} else Knockdown_Timer -= diff;
@@ -110,7 +110,7 @@ struct boss_sulfuronAI : public ScriptedAI
//DarkStrike_Timer
if (Darkstrike_Timer <= diff)
{
DoCast(m_creature, SPELL_DARKSTRIKE);
DoCast(me, SPELL_DARKSTRIKE);
Darkstrike_Timer = 15000 + rand()%3000;
} else Darkstrike_Timer -= diff;
@@ -62,8 +62,8 @@ struct npc_corporal_keeshanAI : public npc_escortAI
if (!pPlayer)
return;
if (uiI >= 65 && m_creature->GetUnitMovementFlags() == MOVEMENTFLAG_WALK_MODE)
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (uiI >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALK_MODE)
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
switch(uiI)
{
@@ -73,7 +73,7 @@ struct npc_corporal_keeshanAI : public npc_escortAI
uiPhase = 1;
break;
case 65:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 115:
pPlayer->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION);
@@ -97,28 +97,28 @@ struct npc_corporal_keeshanAI : public npc_escortAI
switch(uiPhase)
{
case 1:
m_creature->SetStandState(UNIT_STAND_STATE_SIT);
me->SetStandState(UNIT_STAND_STATE_SIT);
uiTimer = 1000;
uiPhase = 2;
break;
case 2:
DoScriptText(SAY_CORPORAL_2,m_creature);
DoScriptText(SAY_CORPORAL_2,me);
uiTimer = 15000;
uiPhase = 3;
break;
case 3:
DoScriptText(SAY_CORPORAL_3,m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_CORPORAL_3,me);
me->SetStandState(UNIT_STAND_STATE_STAND);
SetEscortPaused(false);
uiTimer = 0;
uiPhase = 0;
break;
case 4:
DoScriptText(SAY_CORPORAL_4, m_creature);
DoScriptText(SAY_CORPORAL_4, me);
uiTimer = 2500;
uiPhase = 5;
case 5:
DoScriptText(SAY_CORPORAL_5, m_creature);
DoScriptText(SAY_CORPORAL_5, me);
uiTimer = 0;
uiPhase = 0;
}
@@ -130,13 +130,13 @@ struct npc_corporal_keeshanAI : public npc_escortAI
if (uiMockingBlowTimer <= uiDiff)
{
DoCast(m_creature->getVictim(),SPELL_MOCKING_BLOW);
DoCast(me->getVictim(),SPELL_MOCKING_BLOW);
uiMockingBlowTimer = 5000;
} else uiMockingBlowTimer -= uiDiff;
if (uiShieldBashTimer <= uiDiff)
{
DoCast(m_creature->getVictim(),SPELL_MOCKING_BLOW);
DoCast(me->getVictim(),SPELL_MOCKING_BLOW);
uiShieldBashTimer = 8000;
} else uiShieldBashTimer -= uiDiff;
@@ -355,7 +355,7 @@ struct npc_death_knight_initiateAI : public CombatAI
me->RestoreFaction();
CombatAI::Reset();
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15);
m_uiDuelerGUID = 0;
m_uiDuelTimer = 5000;
@@ -377,7 +377,7 @@ struct npc_death_knight_initiateAI : public CombatAI
{
if (pDoneBy->GetGUID() != m_uiDuelerGUID && pDoneBy->GetOwnerGUID() != m_uiDuelerGUID) // other players cannot help
uiDamage = 0;
else if (uiDamage >= m_creature->GetHealth())
else if (uiDamage >= me->GetHealth())
{
uiDamage = 0;
@@ -402,9 +402,9 @@ struct npc_death_knight_initiateAI : public CombatAI
{
if (m_uiDuelTimer <= uiDiff)
{
m_creature->setFaction(FACTION_HOSTILE);
me->setFaction(FACTION_HOSTILE);
if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiDuelerGUID))
if (Unit* pUnit = Unit::GetUnit(*me, m_uiDuelerGUID))
AttackStart(pUnit);
}
else
@@ -519,23 +519,23 @@ struct npc_dark_rider_of_acherusAI : public ScriptedAI
switch(Phase)
{
case 0:
m_creature->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0);
me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0);
PhaseTimer = 5000;
Phase = 1;
break;
case 1:
if (Unit *pTarget = Unit::GetUnit(*m_creature, TargetGUID))
if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID))
DoCast(pTarget, DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
case 2:
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
PhaseTimer = 2000;
Phase = 3;
break;
case 3:
m_creature->ForcedDespawn();
me->ForcedDespawn();
break;
default:
break;
@@ -550,10 +550,10 @@ struct npc_dark_rider_of_acherusAI : public ScriptedAI
return;
TargetGUID = who->GetGUID();
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->SetSpeed(MOVE_RUN, 0.4f);
m_creature->GetMotionMaster()->MoveChase(who);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who);
me->SetUInt64Value(UNIT_FIELD_TARGET, TargetGUID);
Intro = true;
}
@@ -593,7 +593,7 @@ struct npc_salanar_the_horsemanAI : public ScriptedAI
caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
caster->setFaction(35);
DoCast(caster, CALL_DARK_RIDER, true);
if (Creature* Dark_Rider = m_creature->FindNearestCreature(28654, 15))
if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15))
CAST_AI(npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster);
}
}
@@ -723,9 +723,9 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
{
// Ghouls should display their Birth Animation
// Crawling out of the ground
//DoCast(m_creature, 35177, true);
//m_creature->MonsterSay("Mommy?",LANG_UNIVERSAL,0);
m_creature->SetReactState(REACT_DEFENSIVE);
//DoCast(me, 35177, true);
//me->MonsterSay("Mommy?",LANG_UNIVERSAL,0);
me->SetReactState(REACT_DEFENSIVE);
}
void FindMinions(Unit *owner)
@@ -737,7 +737,7 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
{
for (std::list<Creature*>::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr)
{
if (CAST_CRE(*itr)->GetOwner()->GetGUID() == m_creature->GetOwner()->GetGUID())
if (CAST_CRE(*itr)->GetOwner()->GetGUID() == me->GetOwner()->GetGUID())
{
if (CAST_CRE(*itr)->isInCombat() && CAST_CRE(*itr)->getAttackerForHelper())
{
@@ -750,9 +750,9 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->isInCombat())
if (!me->isInCombat())
{
if (Unit *owner = m_creature->GetOwner())
if (Unit *owner = me->GetOwner())
{
if (owner->GetTypeId() == TYPEID_PLAYER && CAST_PLR(owner)->isInCombat())
{
@@ -773,15 +773,15 @@ struct npc_scarlet_ghoulAI : public ScriptedAI
//ScriptedAI::UpdateAI(diff);
//Check if we have a current target
if (m_creature->getVictim()->GetEntry() == GHOSTS)
if (me->getVictim()->GetEntry() == GHOSTS)
{
if (m_creature->isAttackReady())
if (me->isAttackReady())
{
//If we are within range melee the target
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
if (me->IsWithinMeleeRange(me->getVictim()))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();
me->AttackerStateUpdate(me->getVictim());
me->resetAttackTimer();
}
}
}
@@ -35,16 +35,16 @@ struct npc_valkyr_battle_maidenAI : public PassiveAI
void Reset()
{
me->setActive(true);
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlying(true);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlying(true);
FlyBackTimer = 500;
phase = 0;
m_creature->GetPosition(x, y, z);
me->GetPosition(x, y, z);
z += 4; x -= 3.5; y -= 5;
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f);
me->GetMotionMaster()->Clear(false);
me->GetMap()->CreatureRelocation(me, x, y, z, 0.0f);
}
void UpdateAI(const uint32 diff)
@@ -63,24 +63,24 @@ struct npc_valkyr_battle_maidenAI : public PassiveAI
switch(phase)
{
case 0:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
FlyBackTimer = 500;
break;
case 1:
plr->GetClosePoint(x,y,z, m_creature->GetObjectSize());
plr->GetClosePoint(x,y,z, me->GetObjectSize());
z += 2.5; x -= 2; y -= 1.5;
m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
m_creature->SetVisibility(VISIBILITY_ON);
me->GetMotionMaster()->MovePoint(0, x, y, z);
me->SetUInt64Value(UNIT_FIELD_TARGET, plr->GetGUID());
me->SetVisibility(VISIBILITY_ON);
FlyBackTimer = 4500;
break;
case 2:
if (!plr->isRessurectRequested())
{
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOMSPELL01);
DoCast(plr, SPELL_REVIVE, true);
m_creature->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
me->MonsterWhisper(VALK_WHISPER, plr->GetGUID());
}
FlyBackTimer = 5000;
break;
@@ -56,7 +56,7 @@ struct boss_arcanist_doanAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -66,22 +66,22 @@ struct boss_arcanist_doanAI : public ScriptedAI
if (bShielded && bCanDetonate)
{
DoCast(m_creature, SPELL_FIREAOE);
DoCast(me, SPELL_FIREAOE);
bCanDetonate = false;
}
if (m_creature->HasAura(SPELL_ARCANEBUBBLE))
if (me->HasAura(SPELL_ARCANEBUBBLE))
return;
//If we are <50% hp cast Arcane Bubble
if (!bShielded && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
if (!bShielded && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
{
//wait if we already casting
if (m_creature->IsNonMeleeSpellCasted(false))
if (me->IsNonMeleeSpellCasted(false))
return;
DoScriptText(SAY_SPECIALAE, m_creature);
DoCast(m_creature, SPELL_ARCANEBUBBLE);
DoScriptText(SAY_SPECIALAE, me);
DoCast(me, SPELL_ARCANEBUBBLE);
bCanDetonate = true;
bShielded = true;
@@ -98,14 +98,14 @@ struct boss_arcanist_doanAI : public ScriptedAI
//AoESilence_Timer
if (AoESilence_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_AOESILENCE);
DoCast(me->getVictim(), SPELL_AOESILENCE);
AoESilence_Timer = 15000 + rand()%5000;
} else AoESilence_Timer -= diff;
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANEEXPLOSION);
DoCast(me->getVictim(), SPELL_ARCANEEXPLOSION);
ArcaneExplosion_Timer = 8000;
} else ArcaneExplosion_Timer -= diff;
@@ -52,12 +52,12 @@ struct boss_azshir_the_sleeplessAI : public ScriptedAI
return;
//If we are <50% hp cast Soul Siphon rank 1
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false))
if (me->GetHealth()*100 / me->GetMaxHealth() <= 50 && !me->IsNonMeleeSpellCasted(false))
{
//SoulSiphon_Timer
if (SoulSiphon_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SOULSIPHON);
DoCast(me->getVictim(), SPELL_SOULSIPHON);
return;
SoulSiphon_Timer = 20000;
@@ -67,14 +67,14 @@ struct boss_azshir_the_sleeplessAI : public ScriptedAI
//CallOfTheGrave_Timer
if (CallOftheGrave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CALLOFTHEGRAVE);
DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE);
CallOftheGrave_Timer = 30000;
} else CallOftheGrave_Timer -= diff;
//Terrify_Timer
if (Terrify_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TERRIFY);
DoCast(me->getVictim(), SPELL_TERRIFY);
Terrify_Timer = 20000;
} else Terrify_Timer -= diff;
@@ -56,12 +56,12 @@ struct boss_bloodmage_thalnosAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit* Victim)
{
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void UpdateAI(const uint32 diff)
@@ -70,37 +70,37 @@ struct boss_bloodmage_thalnosAI : public ScriptedAI
return;
//If we are <35% hp
if (!HpYell && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 35))
if (!HpYell && ((me->GetHealth()*100) / me->GetMaxHealth() <= 35))
{
DoScriptText(SAY_HEALTH, m_creature);
DoScriptText(SAY_HEALTH, me);
HpYell = true;
}
//FlameShock_Timer
if (FlameShock_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMESHOCK);
DoCast(me->getVictim(), SPELL_FLAMESHOCK);
FlameShock_Timer = 10000 + rand()%5000;
} else FlameShock_Timer -= diff;
//FlameSpike_Timer
if (FlameSpike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMESPIKE);
DoCast(me->getVictim(), SPELL_FLAMESPIKE);
FlameSpike_Timer = 30000;
} else FlameSpike_Timer -= diff;
//FireNova_Timer
if (FireNova_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FIRENOVA);
DoCast(me->getVictim(), SPELL_FIRENOVA);
FireNova_Timer = 40000;
} else FireNova_Timer -= diff;
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 2000;
} else ShadowBolt_Timer -= diff;
@@ -173,13 +173,13 @@ struct mob_wisp_invisAI : public ScriptedAI
break;
}
if (spell)
DoCast(m_creature, spell);
DoCast(me, spell);
}
void SpellHit(Unit* caster, const SpellEntry *spell)
{
if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4)
m_creature->SetDisplayId(2027);
me->SetDisplayId(2027);
}
void MoveInLineOfSight(Unit *who)
@@ -187,7 +187,7 @@ struct mob_wisp_invisAI : public ScriptedAI
if (!who || Creaturetype != 1 || !who->isTargetableForAttack())
return;
if (m_creature->IsWithinDist(who, 0.1, false) && !who->HasAura(SPELL_SQUASH_SOUL))
if (me->IsWithinDist(who, 0.1, false) && !who->HasAura(SPELL_SQUASH_SOUL))
DoCast(who, SPELL_SQUASH_SOUL);
}
@@ -197,9 +197,9 @@ struct mob_wisp_invisAI : public ScriptedAI
{
if (delay <= diff)
{
m_creature->RemoveAurasDueToSpell(SPELL_SMOKE);
me->RemoveAurasDueToSpell(SPELL_SMOKE);
if (spell2)
DoCast(m_creature, spell2);
DoCast(me, spell2);
delay = 0;
} else delay -= diff;
}
@@ -232,8 +232,8 @@ struct mob_headAI : public ScriptedAI
void EnterCombat(Unit *who) {}
void SaySound(int32 textEntry, Unit *pTarget = 0)
{
DoScriptText(textEntry, m_creature, pTarget);
//DoCast(m_creature, SPELL_HEAD_SPEAKS, true);
DoScriptText(textEntry, me, pTarget);
//DoCast(me, SPELL_HEAD_SPEAKS, true);
Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000);
if (speaker)
speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false);
@@ -248,24 +248,24 @@ struct mob_headAI : public ScriptedAI
switch(Phase)
{
case 1:
if (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 67)
if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 67)
Disappear();
break;
case 2:
if (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 34)
if (((me->GetHealth() - damage)*100)/me->GetMaxHealth() < 34)
Disappear();
break;
case 3:
if (damage >= m_creature->GetHealth())
if (damage >= me->GetHealth())
{
die = true;
withbody = true;
wait = 300;
damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->StopMoving();
//m_creature->GetMotionMaster()->MoveIdle();
DoCast(m_creature, SPELL_HEAD_IS_DEAD);
damage = me->GetHealth() - me->GetMaxHealth()/100;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->StopMoving();
//me->GetMotionMaster()->MoveIdle();
DoCast(me, SPELL_HEAD_IS_DEAD);
}
break;
}
@@ -283,13 +283,13 @@ struct mob_headAI : public ScriptedAI
withbody = false;
if (!bodyGUID)
bodyGUID = caster->GetGUID();
m_creature->RemoveAllAuras();
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(m_creature, SPELL_HEAD_LANDS, true);
DoCast(m_creature, SPELL_HEAD, false);
me->RemoveAllAuras();
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
DoCast(me, SPELL_HEAD_LANDS, true);
DoCast(me, SPELL_HEAD, false);
SaySound(SAY_LOST_HEAD);
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveFleeing(caster->getVictim());
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveFleeing(caster->getVictim());
}
}
void Disappear();//we must set returned=true(this will prevent from "body calls head" while head flying to body), see function below
@@ -300,20 +300,20 @@ struct mob_headAI : public ScriptedAI
if (wait <= diff)
{
wait = 1000;
if (!m_creature->getVictim()) return;
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveFleeing(m_creature->getVictim());
if (!me->getVictim()) return;
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveFleeing(me->getVictim());
} else wait -= diff;
if (laugh <= diff)
{
laugh = urand(15000,30000);
DoPlaySoundToSet(m_creature, RandomLaugh[urand(0,2)]);
//DoCast(m_creature, SPELL_HEAD_SPEAKS, true); //this spell remove buff "head"
DoPlaySoundToSet(me, RandomLaugh[urand(0,2)]);
//DoCast(me, SPELL_HEAD_SPEAKS, true); //this spell remove buff "head"
Creature *speaker = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,1000);
if (speaker)
speaker->CastSpell(speaker,SPELL_HEAD_SPEAKS,false);
m_creature->MonsterTextEmote(EMOTE_LAUGHS,NULL);
me->MonsterTextEmote(EMOTE_LAUGHS,NULL);
} else laugh -= diff;
}
else
@@ -323,9 +323,9 @@ struct mob_headAI : public ScriptedAI
if (wait <= diff)
{
die = false;
if (Unit *body = Unit::GetUnit((*m_creature), bodyGUID))
if (Unit *body = Unit::GetUnit((*me), bodyGUID))
body->Kill(body);
m_creature->Kill(m_creature);
me->Kill(me);
} else wait -= diff;
}
}
@@ -397,10 +397,10 @@ struct boss_headless_horsemanAI : public ScriptedAI
returned = true;
burned = false;
IsFlying = false;
DoCast(m_creature, SPELL_HEAD);
DoCast(me, SPELL_HEAD);
if (headGUID)
{
if (Creature* Head = Unit::GetCreature((*m_creature), headGUID))
if (Creature* Head = Unit::GetCreature((*me), headGUID))
Head->DisappearAndDie();
headGUID = 0;
@@ -412,10 +412,10 @@ struct boss_headless_horsemanAI : public ScriptedAI
void FlyMode()
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
m_creature->SetSpeed(MOVE_WALK,5.0f,true);
me->SetVisibility(VISIBILITY_OFF);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
me->SetSpeed(MOVE_WALK,5.0f,true);
wp_reached = false;
count = 0;
say_timer = 3000;
@@ -433,13 +433,13 @@ struct boss_headless_horsemanAI : public ScriptedAI
switch (id)
{
case 0:
m_creature->SetVisibility(VISIBILITY_ON);
me->SetVisibility(VISIBILITY_ON);
break;
case 1:
{
if (Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000))
if (Creature *smoke = me->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000))
CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3);
DoCast(m_creature, SPELL_RHYME_BIG);
DoCast(me, SPELL_RHYME_BIG);
break;
}
case 6:
@@ -447,16 +447,16 @@ struct boss_headless_horsemanAI : public ScriptedAI
pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject
break;
case 19:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
me->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING);
break;
case 20:
{
Phase = 1;
IsFlying = false;
wp_reached = false;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
SaySound(SAY_ENTRANCE);
if (Unit *plr = Unit::GetUnit((*m_creature),PlayerGUID))
if (Unit *plr = Unit::GetUnit((*me),PlayerGUID))
DoStartMovement(plr);
break;
}
@@ -483,20 +483,20 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (withhead)
SaySound(SAY_PLAYER_DEATH);
//maybe possible when player dies from conflagration
else if (Creature *Head = Unit::GetCreature((*m_creature), headGUID))
else if (Creature *Head = Unit::GetCreature((*me), headGUID))
CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH);
}
}
void SaySound(int32 textEntry, Unit *pTarget = 0)
{
DoScriptText(textEntry, m_creature, pTarget);
DoScriptText(textEntry, me, pTarget);
laugh += 4000;
}
Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true)
{
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
if (!pMap->IsDungeon()) return NULL;
Map::PlayerList const &PlayerList = pMap->GetPlayers();
@@ -507,8 +507,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
std::list<Player*>::const_iterator j;
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if ((m_creature->IsWithinLOSInMap(i->getSource()) || !checkLoS) && m_creature->getVictim() != i->getSource() &&
m_creature->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive())
if ((me->IsWithinLOSInMap(i->getSource()) || !checkLoS) && me->getVictim() != i->getSource() &&
me->IsWithinDistInMap(i->getSource(), range) && i->getSource()->isAlive())
temp.push_back(i->getSource());
if (temp.size())
@@ -528,8 +528,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
void JustDied(Unit* killer)
{
m_creature->StopMoving();
//m_creature->GetMotionMaster()->MoveIdle();
me->StopMoving();
//me->GetMotionMaster()->MoveIdle();
SaySound(SAY_DEATH);
if (Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000))
flame->CastSpell(flame,SPELL_BODY_FLAME,false);
@@ -551,47 +551,47 @@ struct boss_headless_horsemanAI : public ScriptedAI
else
Phase = 3;
withhead = true;
m_creature->RemoveAllAuras();
m_creature->SetName("Headless Horseman");
m_creature->SetHealth(m_creature->GetMaxHealth());
me->RemoveAllAuras();
me->SetName("Headless Horseman");
me->SetHealth(me->GetMaxHealth());
SaySound(SAY_REJOINED);
DoCast(m_creature, SPELL_HEAD);
DoCast(me, SPELL_HEAD);
caster->GetMotionMaster()->Clear(false);
caster->GetMotionMaster()->MoveFollow(m_creature,6,urand(0,5));
caster->GetMotionMaster()->MoveFollow(me,6,urand(0,5));
//DoResetThreat();//not sure if need
std::list<HostileReference*>::const_iterator itr;
for (itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->isAlive() && pUnit != caster)
m_creature->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit));
me->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit));
}
}
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (damage >= m_creature->GetHealth() && withhead)
if (damage >= me->GetHealth() && withhead)
{
withhead = false;
returned = false;
damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100;
m_creature->RemoveAllAuras();
m_creature->SetName("Headless Horseman, Unhorsed");
damage = me->GetHealth() - me->GetMaxHealth()/100;
me->RemoveAllAuras();
me->SetName("Headless Horseman, Unhorsed");
if (!headGUID)
headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID();
Unit* Head = Unit::GetUnit((*m_creature), headGUID);
Unit* Head = Unit::GetUnit((*me), headGUID);
if (Head && Head->isAlive())
{
Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//Head->CastSpell(Head,SPELL_HEAD_INVIS,false);
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_IMMUNE, true);
DoCast(m_creature, SPELL_BODY_REGEN, true);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_IMMUNE, true);
DoCast(me, SPELL_BODY_REGEN, true);
DoCast(Head, SPELL_FLYING_HEAD, true);
DoCast(m_creature, SPELL_CONFUSE, false); //test
done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0);
DoCast(me, SPELL_CONFUSE, false); //test
done_by->ProcDamageAndSpell(me,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0);
whirlwind = urand(4000,8000);
regen = 0;
}
@@ -619,7 +619,7 @@ struct boss_headless_horsemanAI : public ScriptedAI
}
else
{
DoCast(m_creature, SPELL_RHYME_BIG);
DoCast(me, SPELL_RHYME_BIG);
if (plr)
{
plr->Say(Text[count].text,0);
@@ -638,8 +638,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (wp_reached)
{
wp_reached = false;
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z);
}
}
}
@@ -649,7 +649,7 @@ struct boss_headless_horsemanAI : public ScriptedAI
break;
if (burn <= diff)
{
if (Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000))
if (Creature *flame = me->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000))
CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2);
burned = true;
} else burn -= diff;
@@ -665,8 +665,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
case 3:
if (summonadds <= diff)
{
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_SUMMON_PUMPKIN);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_SUMMON_PUMPKIN);
SaySound(SAY_SPROUTING_PUMPKINS);
summonadds = urand(25000,35000);
} else summonadds -= diff;
@@ -676,8 +676,8 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (laugh <= diff)
{
laugh = urand(11000,22000);
m_creature->MonsterTextEmote(EMOTE_LAUGHS,NULL);
DoPlaySoundToSet(m_creature, RandomLaugh[rand()%3]);
me->MonsterTextEmote(EMOTE_LAUGHS,NULL);
DoPlaySoundToSet(me, RandomLaugh[rand()%3]);
} else laugh -= diff;
if (UpdateVictim())
@@ -685,7 +685,7 @@ struct boss_headless_horsemanAI : public ScriptedAI
DoMeleeAttackIfReady();
if (cleave <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
cleave = urand(2000,6000); //1 cleave per 2.0-6.0sec
} else cleave -= diff;
}
@@ -695,13 +695,13 @@ struct boss_headless_horsemanAI : public ScriptedAI
if (regen <= diff)
{
regen = 1000; //"body calls head"
if (m_creature->GetHealth()/m_creature->GetMaxHealth() == 1 && !returned)
if (me->GetHealth()/me->GetMaxHealth() == 1 && !returned)
{
if (Phase > 1)
--Phase;
else
Phase = 1;
Creature* Head = Unit::GetCreature((*m_creature), headGUID);
Creature* Head = Unit::GetCreature((*me), headGUID);
if (Head && Head->isAlive())
{
CAST_AI(mob_headAI, Head->AI())->Phase = Phase;
@@ -717,11 +717,11 @@ struct boss_headless_horsemanAI : public ScriptedAI
whirlwind = urand(4000,8000);
if (urand(0,1))
{
m_creature->RemoveAurasDueToSpell(SPELL_CONFUSE);
DoCast(m_creature, SPELL_WHIRLWIND, true);
DoCast(m_creature, SPELL_CONFUSE);
me->RemoveAurasDueToSpell(SPELL_CONFUSE);
DoCast(me, SPELL_WHIRLWIND, true);
DoCast(me, SPELL_CONFUSE);
} else
m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
me->RemoveAurasDueToSpell(SPELL_WHIRLWIND);
} else whirlwind -= diff;
}
}
@@ -733,17 +733,17 @@ void mob_headAI::Disappear()
return;
if (bodyGUID)
{
Creature *body = Unit::GetCreature((*m_creature), bodyGUID);
Creature *body = Unit::GetCreature((*me), bodyGUID);
if (body && body->isAlive())
{
withbody = true;
m_creature->RemoveAllAuras();
me->RemoveAllAuras();
body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura
DoCast(body, SPELL_FLYING_HEAD);
m_creature->SetHealth(m_creature->GetMaxHealth());
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->GetMotionMaster()->MoveIdle();
me->SetHealth(me->GetMaxHealth());
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->GetMotionMaster()->MoveIdle();
CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true;
}
}
@@ -759,21 +759,21 @@ struct mob_pulsing_pumpkinAI : public ScriptedAI
void Reset()
{
float x, y, z;
m_creature->GetPosition(x, y, z); //this visual aura some under ground
m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z + 0.35f, 0.0f);
me->GetPosition(x, y, z); //this visual aura some under ground
me->GetMap()->CreatureRelocation(me, x,y,z + 0.35f, 0.0f);
Despawn();
Creature *debuff = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,14500);
if (debuff)
{
debuff->SetDisplayId(m_creature->GetDisplayId());
debuff->SetDisplayId(me->GetDisplayId());
debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false);
CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1);
debuffGUID = debuff->GetGUID();
}
sprouted = false;
DoCast(m_creature, SPELL_PUMPKIN_AURA, true);
DoCast(m_creature, SPELL_SPROUTING);
m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
DoCast(me, SPELL_PUMPKIN_AURA, true);
DoCast(me, SPELL_SPROUTING);
me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
}
void EnterCombat(Unit *who){}
@@ -783,18 +783,18 @@ struct mob_pulsing_pumpkinAI : public ScriptedAI
if (spell->Id == SPELL_SPROUTING)
{
sprouted = true;
m_creature->RemoveAllAuras();
m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
DoCast(m_creature, SPELL_SPROUT_BODY, true);
m_creature->UpdateEntry(PUMPKIN_FIEND);
DoStartMovement(m_creature->getVictim());
me->RemoveAllAuras();
me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED);
DoCast(me, SPELL_SPROUT_BODY, true);
me->UpdateEntry(PUMPKIN_FIEND);
DoStartMovement(me->getVictim());
}
}
void Despawn()
{
if (!debuffGUID) return;
Unit *debuff = Unit::GetUnit((*m_creature),debuffGUID);
Unit *debuff = Unit::GetUnit((*me),debuffGUID);
if (debuff)
debuff->SetVisibility(VISIBILITY_OFF);
debuffGUID = 0;
@@ -804,10 +804,10 @@ struct mob_pulsing_pumpkinAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if (!who || !who->isTargetableForAttack() || !m_creature->IsHostileTo(who) || m_creature->getVictim())
if (!who || !who->isTargetableForAttack() || !me->IsHostileTo(who) || me->getVictim())
return;
m_creature->AddThreat(who,0.0f);
me->AddThreat(who,0.0f);
if (sprouted)
DoStartMovement(who);
}
@@ -56,19 +56,19 @@ struct boss_herodAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoCast(m_creature, SPELL_RUSHINGCHARGE);
DoScriptText(SAY_AGGRO, me);
DoCast(me, SPELL_RUSHINGCHARGE);
}
void KilledUnit(Unit *victim)
{
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* killer)
{
for (uint8 i = 0; i < 20; ++i)
m_creature->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
me->SummonCreature(ENTRY_SCARLET_TRAINEE, 1939.18, -431.58, 17.09, 6.22, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
}
void UpdateAI(const uint32 diff)
@@ -77,26 +77,26 @@ struct boss_herodAI : public ScriptedAI
return;
//If we are <30% hp goes Enraged
if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
if (!Enrage && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false))
{
DoScriptText(EMOTE_ENRAGE, m_creature);
DoScriptText(SAY_ENRAGE, m_creature);
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_ENRAGE, me);
DoScriptText(SAY_ENRAGE, me);
DoCast(me, SPELL_FRENZY);
Enrage = true;
}
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 12000;
} else Cleave_Timer -= diff;
// Whirlwind_Timer
if (Whirlwind_Timer <= diff)
{
DoScriptText(SAY_WHIRLWIND, m_creature);
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
DoScriptText(SAY_WHIRLWIND, me);
DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 30000;
} else Whirlwind_Timer -= diff;
@@ -66,9 +66,9 @@ struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
return;
//If we are <25% hp cast Heal
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25 && !m_creature->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
if (me->GetHealth()*100 / me->GetMaxHealth() <= 25 && !me->IsNonMeleeSpellCasted(false) && Heal_Timer <= diff)
{
DoCast(m_creature, SPELL_HEAL);
DoCast(me, SPELL_HEAL);
Heal_Timer = 30000;
} else Heal_Timer -= diff;
@@ -91,9 +91,9 @@ struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
} else Sleep_Timer -= diff;
//PowerWordShield_Timer
if (!PowerWordShield && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25)
if (!PowerWordShield && me->GetHealth()*100 / me->GetMaxHealth() <= 25)
{
DoCast(m_creature, SPELL_POWERWORDSHIELD);
DoCast(me, SPELL_POWERWORDSHIELD);
PowerWordShield = true;
}
@@ -109,7 +109,7 @@ struct boss_high_inquisitor_fairbanksAI : public ScriptedAI
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSEOFBLOOD);
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
CurseOfBlood_Timer = 25000;
} else CurseOfBlood_Timer -= diff;
@@ -43,7 +43,7 @@ struct boss_houndmaster_lokseyAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
@@ -53,7 +53,7 @@ struct boss_houndmaster_lokseyAI : public ScriptedAI
if (BloodLust_Timer <= diff)
{
DoCast(m_creature, SPELL_BLOODLUST);
DoCast(me, SPELL_BLOODLUST);
BloodLust_Timer = 20000;
} else BloodLust_Timer -= diff;
@@ -39,7 +39,7 @@ struct boss_interrogator_vishasAI : public ScriptedAI
{
boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c)
{
pInstance = m_creature->GetInstanceData();
pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -55,12 +55,12 @@ struct boss_interrogator_vishasAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit* Victim)
{
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void JustDied(Unit* Killer)
@@ -69,7 +69,7 @@ struct boss_interrogator_vishasAI : public ScriptedAI
return;
//Any other actions to do with vorrel? setStandState?
if (Unit *vorrel = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_VORREL)))
if (Unit *vorrel = Unit::GetUnit(*me,pInstance->GetData64(DATA_VORREL)))
DoScriptText(SAY_TRIGGER_VORREL, vorrel);
}
@@ -79,22 +79,22 @@ struct boss_interrogator_vishasAI : public ScriptedAI
return;
//If we are low on hp Do sayings
if (!Yell60 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 60))
if (!Yell60 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 60))
{
DoScriptText(SAY_HEALTH1, m_creature);
DoScriptText(SAY_HEALTH1, me);
Yell60 = true;
}
if (!Yell30 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 30))
if (!Yell30 && ((me->GetHealth()*100) / me->GetMaxHealth() <= 30))
{
DoScriptText(SAY_HEALTH2, m_creature);
DoScriptText(SAY_HEALTH2, me);
Yell30 = true;
}
//ShadowWordPain_Timer
if (ShadowWordPain_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWWORDPAIN);
DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN);
ShadowWordPain_Timer = 5000 + rand()%10000;
} else ShadowWordPain_Timer -= diff;
@@ -73,12 +73,12 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
m_uiHammerOfJustice_Timer = 10000;
//Incase wipe during phase that mograine fake death
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
if (m_pInstance)
if (m_creature->isAlive())
if (me->isAlive())
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT,NOT_STARTED);
m_bHasDied = false;
@@ -97,46 +97,46 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_MO_AGGRO, m_creature);
DoCast(m_creature, SPELL_RETRIBUTIONAURA);
DoScriptText(SAY_MO_AGGRO, me);
DoCast(me, SPELL_RETRIBUTIONAURA);
m_creature->CallForHelp(VISIBLE_RANGE);
me->CallForHelp(VISIBLE_RANGE);
}
void KilledUnit(Unit* pVictim)
{
DoScriptText(SAY_MO_KILL, m_creature);
DoScriptText(SAY_MO_KILL, me);
}
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
if (uiDamage < m_creature->GetHealth() || m_bHasDied || m_bFakeDeath)
if (uiDamage < me->GetHealth() || m_bHasDied || m_bFakeDeath)
return;
if (!m_pInstance)
return;
//On first death, fake death and open door, as well as initiate whitemane if exist
if (Unit* Whitemane = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE)))
if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE)))
{
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS);
Whitemane->GetMotionMaster()->MovePoint(1,1163.113370,1398.856812,32.527786);
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MoveIdle();
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
m_creature->SetHealth(0);
me->SetHealth(0);
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
m_creature->ClearComboPointHolders();
m_creature->RemoveAllAuras();
m_creature->ClearAllReactives();
me->ClearComboPointHolders();
me->RemoveAllAuras();
me->ClearAllReactives();
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_DEAD);
m_bHasDied = true;
m_bFakeDeath = true;
@@ -150,7 +150,7 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
//When hit with ressurection say text
if (pSpell->Id == SPELL_SCARLETRESURRECTION)
{
DoScriptText(SAY_MO_RESSURECTED, m_creature);
DoScriptText(SAY_MO_RESSURECTED, me);
m_bFakeDeath = false;
if (m_pInstance)
@@ -166,17 +166,17 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL)
{
//On ressurection, stop fake death and heal whitemane and resume fight
if (Unit* Whitemane = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE)))
if (Unit* Whitemane = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_WHITEMANE)))
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(Whitemane, SPELL_LAYONHANDS);
m_uiCrusaderStrike_Timer = 10000;
m_uiHammerOfJustice_Timer = 10000;
if (m_creature->getVictim())
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
if (me->getVictim())
me->GetMotionMaster()->MoveChase(me->getVictim());
m_bHeal = true;
}
@@ -189,14 +189,14 @@ struct boss_scarlet_commander_mograineAI : public ScriptedAI
//m_uiCrusaderStrike_Timer
if (m_uiCrusaderStrike_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_CRUSADERSTRIKE);
DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE);
m_uiCrusaderStrike_Timer = 10000;
} else m_uiCrusaderStrike_Timer -= uiDiff;
//m_uiHammerOfJustice_Timer
if (m_uiHammerOfJustice_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_HAMMEROFJUSTICE);
DoCast(me->getVictim(), SPELL_HAMMEROFJUSTICE);
m_uiHammerOfJustice_Timer = 60000;
} else m_uiHammerOfJustice_Timer -= uiDiff;
@@ -232,7 +232,7 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
m_bCanResurrect = false;
if (m_pInstance)
if (m_creature->isAlive())
if (me->isAlive())
m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
}
@@ -246,12 +246,12 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
void EnterCombat(Unit* pWho)
{
DoScriptText(SAY_WH_INTRO, m_creature);
DoScriptText(SAY_WH_INTRO, me);
}
void KilledUnit(Unit* pVictim)
{
DoScriptText(SAY_WH_KILL, m_creature);
DoScriptText(SAY_WH_KILL, me);
}
void UpdateAI(const uint32 uiDiff)
@@ -264,10 +264,10 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
//When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out
if (m_pInstance && m_uiWait_Timer <= uiDiff)
{
if (Unit* Mograine = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE)))
if (Unit* Mograine = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_MOGRAINE)))
{
DoCast(Mograine, SPELL_SCARLETRESURRECTION);
DoScriptText(SAY_WH_RESSURECT, m_creature);
DoScriptText(SAY_WH_RESSURECT, me);
m_bCanResurrect = false;
}
}
@@ -275,12 +275,12 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
}
//Cast Deep sleep when health is less than 50%
if (!m_bCanResurrectCheck && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50)
if (!m_bCanResurrectCheck && me->GetHealth()*100 / me->GetMaxHealth() <= 50)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoCast(m_creature->getVictim(), SPELL_DEEPSLEEP);
DoCast(me->getVictim(), SPELL_DEEPSLEEP);
m_bCanResurrectCheck = true;
m_bCanResurrect = true;
return;
@@ -295,12 +295,12 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
{
Creature* pTarget = NULL;
if (m_creature->GetHealth() <= m_creature->GetMaxHealth()*0.75f)
pTarget = m_creature;
if (me->GetHealth() <= me->GetMaxHealth()*0.75f)
pTarget = me;
if (m_pInstance)
{
if (Creature* pMograine = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE)))
if (Creature* pMograine = Unit::GetCreature((*me), m_pInstance->GetData64(DATA_MOGRAINE)))
{
// checking m_bCanResurrectCheck prevents her healing Mograine while he is "faking death"
if (m_bCanResurrectCheck && pMograine->isAlive() && pMograine->GetHealth() <= pMograine->GetMaxHealth()*0.75f)
@@ -317,14 +317,14 @@ struct boss_high_inquisitor_whitemaneAI : public ScriptedAI
//m_uiPowerWordShield_Timer
if (m_uiPowerWordShield_Timer <= uiDiff)
{
DoCast(m_creature, SPELL_POWERWORDSHIELD);
DoCast(me, SPELL_POWERWORDSHIELD);
m_uiPowerWordShield_Timer = 15000;
} else m_uiPowerWordShield_Timer -= uiDiff;
//m_uiHolySmite_Timer
if (m_uiHolySmite_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_HOLYSMITE);
DoCast(me->getVictim(), SPELL_HOLYSMITE);
m_uiHolySmite_Timer = 6000;
} else m_uiHolySmite_Timer -= uiDiff;
@@ -57,28 +57,28 @@ struct boss_scornAI : public ScriptedAI
//LichSlap_Timer
if (LichSlap_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_LICHSLAP);
DoCast(me->getVictim(), SPELL_LICHSLAP);
LichSlap_Timer = 45000;
} else LichSlap_Timer -= diff;
//FrostboltVolley_Timer
if (FrostboltVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTBOLTVOLLEY);
DoCast(me->getVictim(), SPELL_FROSTBOLTVOLLEY);
FrostboltVolley_Timer = 20000;
} else FrostboltVolley_Timer -= diff;
//MindFlay_Timer
if (MindFlay_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MINDFLAY);
DoCast(me->getVictim(), SPELL_MINDFLAY);
MindFlay_Timer = 20000;
} else MindFlay_Timer -= diff;
//FrostNova_Timer
if (FrostNova_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTNOVA);
DoCast(me->getVictim(), SPELL_FROSTNOVA);
FrostNova_Timer = 15000;
} else FrostNova_Timer -= diff;
@@ -52,7 +52,7 @@ struct boss_darkmaster_gandlingAI : public ScriptedAI
{
boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c)
{
pInstance = m_creature->GetInstanceData();
pInstance = me->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -88,27 +88,27 @@ struct boss_darkmaster_gandlingAI : public ScriptedAI
//ArcaneMissiles_Timer
if (ArcaneMissiles_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANEMISSILES);
DoCast(me->getVictim(), SPELL_ARCANEMISSILES);
ArcaneMissiles_Timer = 8000;
} else ArcaneMissiles_Timer -= diff;
//ShadowShield_Timer
if (ShadowShield_Timer <= diff)
{
DoCast(m_creature, SPELL_SHADOWSHIELD);
DoCast(me, SPELL_SHADOWSHIELD);
ShadowShield_Timer = 14000 + rand()%14000;
} else ShadowShield_Timer -= diff;
//Curse_Timer
if (Curse_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSE);
DoCast(me->getVictim(), SPELL_CURSE);
Curse_Timer = 15000 + rand()%12000;
} else Curse_Timer -= diff;
//Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer.
//We will only telport if gandling has more than 3% of hp so teleported gamers can always loot.
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3)
if (me->GetHealth()*100 / me->GetMaxHealth() > 3)
{
if (Teleport_Timer <= diff)
{
@@ -124,79 +124,79 @@ struct boss_darkmaster_gandlingAI : public ScriptedAI
{
case 0:
DoTeleportPlayer(pTarget, 250.0696,0.3921,84.8408,3.149);
Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 1:
DoTeleportPlayer(pTarget, 181.4220,-91.9481,84.8410,1.608);
Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 2:
DoTeleportPlayer(pTarget, 95.1547,-1.8173,85.2289,0.043);
Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 3:
DoTeleportPlayer(pTarget, 250.0696,0.3921,72.6722,3.149);
Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 4:
DoTeleportPlayer(pTarget, 181.4220,-91.9481,70.7734,1.608);
Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
case 5:
DoTeleportPlayer(pTarget, 106.1541,-1.8994,75.3663,0.043);
Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
Summoned = me->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000);
if (Summoned)
Summoned->AI()->AttackStart(pTarget);
break;
@@ -33,8 +33,8 @@ struct boss_death_knight_darkreaverAI : public ScriptedAI
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (m_creature->GetHealth() <= damage)
DoCast(m_creature, 23261, true); //Summon Darkreaver's Fallen Charger
if (me->GetHealth() <= damage)
DoCast(me, 23261, true); //Summon Darkreaver's Fallen Charger
}
void EnterCombat(Unit *who)
@@ -50,13 +50,13 @@ struct boss_theolenkrastinovAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
ScriptedInstance* pInstance = m_creature->GetInstanceData();
ScriptedInstance* pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -68,7 +68,7 @@ struct boss_theolenkrastinovAI : public ScriptedAI
//Rend_Timer
if (m_uiRend_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_REND);
DoCast(me->getVictim(), SPELL_REND);
m_uiRend_Timer = 10000;
}
else
@@ -77,19 +77,19 @@ struct boss_theolenkrastinovAI : public ScriptedAI
//Backhand_Timer
if (m_uiBackhand_Timer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_BACKHAND);
DoCast(me->getVictim(), SPELL_BACKHAND);
m_uiBackhand_Timer = 10000;
}
else
m_uiBackhand_Timer -= uiDiff;
//Frenzy_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26)
if (me->GetHealth()*100 / me->GetMaxHealth() < 26)
{
if (m_uiFrenzy_Timer <= uiDiff)
{
DoCast(m_creature, SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature);
DoCast(me, SPELL_FRENZY);
DoScriptText(EMOTE_GENERIC_FRENZY_KILL, me);
m_uiFrenzy_Timer = 120000;
}
@@ -48,13 +48,13 @@ struct boss_illuciabarovAI : public ScriptedAI
void JustDied(Unit *killer)
{
ScriptedInstance *pInstance = m_creature->GetInstanceData();
ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -70,7 +70,7 @@ struct boss_illuciabarovAI : public ScriptedAI
//CurseOfAgony_Timer
if (CurseOfAgony_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSEOFAGONY);
DoCast(me->getVictim(), SPELL_CURSEOFAGONY);
CurseOfAgony_Timer = 30000;
} else CurseOfAgony_Timer -= diff;
@@ -87,14 +87,14 @@ struct boss_illuciabarovAI : public ScriptedAI
//Silence_Timer
if (Silence_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SILENCE);
DoCast(me->getVictim(), SPELL_SILENCE);
Silence_Timer = 14000;
} else Silence_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FEAR);
DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 30000;
} else Fear_Timer -= diff;
@@ -55,13 +55,13 @@ struct boss_instructormaliciaAI : public ScriptedAI
void JustDied(Unit *killer)
{
ScriptedInstance *pInstance = m_creature->GetInstanceData();
ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -77,7 +77,7 @@ struct boss_instructormaliciaAI : public ScriptedAI
//CallOfGraves_Timer
if (CallOfGraves_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CALLOFGRAVES);
DoCast(me->getVictim(), SPELL_CALLOFGRAVES);
CallOfGraves_Timer = 65000;
} else CallOfGraves_Timer -= diff;
@@ -94,14 +94,14 @@ struct boss_instructormaliciaAI : public ScriptedAI
//Renew_Timer
if (Renew_Timer <= diff)
{
DoCast(m_creature, SPELL_RENEW);
DoCast(me, SPELL_RENEW);
Renew_Timer = 10000;
} else Renew_Timer -= diff;
//FlashHeal_Timer
if (FlashHeal_Timer <= diff)
{
DoCast(m_creature, SPELL_FLASHHEAL);
DoCast(me, SPELL_FLASHHEAL);
//5 Flashheals will be casted
if (FlashCounter < 2)
@@ -119,7 +119,7 @@ struct boss_instructormaliciaAI : public ScriptedAI
//HealingTouch_Timer
if (HealingTouch_Timer <= diff)
{
DoCast(m_creature, SPELL_HEALINGTOUCH);
DoCast(me, SPELL_HEALINGTOUCH);
//3 Healingtouchs will be casted
if (HealingTouch_Timer < 2)
@@ -62,9 +62,9 @@ struct boss_jandicebarovAI : public ScriptedAI
if (Invisible && Invisible_Timer <= diff)
{
//Become visible again
m_creature->setFaction(14);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetDisplayId(11073); //Jandice Model
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11073); //Jandice Model
Invisible = false;
} else if (Invisible)
{
@@ -81,7 +81,7 @@ struct boss_jandicebarovAI : public ScriptedAI
if (CurseOfBlood_Timer <= diff)
{
//Cast
DoCast(m_creature->getVictim(), SPELL_CURSEOFBLOOD);
DoCast(me->getVictim(), SPELL_CURSEOFBLOOD);
//45 seconds
CurseOfBlood_Timer = 30000;
@@ -92,11 +92,11 @@ struct boss_jandicebarovAI : public ScriptedAI
{
//Inturrupt any spell casting
m_creature->InterruptNonMeleeSpells(false);
m_creature->setFaction(35);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetDisplayId(11686); // Invisible Model
DoModifyThreatPercent(m_creature->getVictim(),-99);
me->InterruptNonMeleeSpells(false);
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11686); // Invisible Model
DoModifyThreatPercent(me->getVictim(),-99);
//Summon 10 Illusions attacking random gamers
Unit *pTarget = NULL;
@@ -117,7 +117,7 @@ struct boss_jandicebarovAI : public ScriptedAI
// if (Illusion_Timer <= diff)
// {
// //Cast
// DoCast(m_creature->getVictim(), SPELL_ILLUSION);
// DoCast(me->getVictim(), SPELL_ILLUSION);
//
// //3 Illusion will be summoned
// if (Illusioncounter < 3)
@@ -148,7 +148,7 @@ struct mob_illusionofjandicebarovAI : public ScriptedAI
void Reset()
{
Cleave_Timer = 2000 + rand()%6000;
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
void EnterCombat(Unit *who)
@@ -165,7 +165,7 @@ struct mob_illusionofjandicebarovAI : public ScriptedAI
if (Cleave_Timer <= diff)
{
//Cast
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
//5-8 seconds
Cleave_Timer = 5000 + rand()%3000;
@@ -69,14 +69,14 @@ struct boss_kormokAI : public ScriptedAI
//ShadowVolley_Timer
if (ShadowVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOWBOLTVOLLEY);
DoCast(me->getVictim(), SPELL_SHADOWBOLTVOLLEY);
ShadowVolley_Timer = 15000;
} else ShadowVolley_Timer -= diff;
//BoneShield_Timer
if (BoneShield_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BONESHIELD);
DoCast(me->getVictim(), SPELL_BONESHIELD);
BoneShield_Timer = 45000;
} else BoneShield_Timer -= diff;
@@ -84,20 +84,20 @@ struct boss_kormokAI : public ScriptedAI
if (Minion_Timer <= diff)
{
//Cast
SummonMinions(m_creature->getVictim());
SummonMinions(m_creature->getVictim());
SummonMinions(m_creature->getVictim());
SummonMinions(m_creature->getVictim());
SummonMinions(me->getVictim());
SummonMinions(me->getVictim());
SummonMinions(me->getVictim());
SummonMinions(me->getVictim());
Minion_Timer = 12000;
} else Minion_Timer -= diff;
//Summon 2 Bone Mages
if (!Mages && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26)
if (!Mages && me->GetHealth()*100 / me->GetMaxHealth() < 26)
{
//Cast
SummonMages(m_creature->getVictim());
SummonMages(m_creature->getVictim());
SummonMages(me->getVictim());
SummonMages(me->getVictim());
Mages = true;
}
@@ -39,18 +39,18 @@ struct boss_lordalexeibarovAI : public ScriptedAI
Immolate_Timer = 7000;
VeilofShadow_Timer = 15000;
m_creature->LoadCreaturesAddon();
me->LoadCreaturesAddon();
}
void JustDied(Unit *killer)
{
ScriptedInstance *pInstance = m_creature->GetInstanceData();
ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -76,7 +76,7 @@ struct boss_lordalexeibarovAI : public ScriptedAI
//VeilofShadow_Timer
if (VeilofShadow_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_VEILOFSHADOW);
DoCast(me->getVictim(), SPELL_VEILOFSHADOW);
VeilofShadow_Timer = 20000;
} else VeilofShadow_Timer -= diff;
@@ -48,13 +48,13 @@ struct boss_lorekeeperpolkeltAI : public ScriptedAI
void JustDied(Unit *killer)
{
ScriptedInstance *pInstance = m_creature->GetInstanceData();
ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -70,28 +70,28 @@ struct boss_lorekeeperpolkeltAI : public ScriptedAI
//VolatileInfection_Timer
if (VolatileInfection_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_VOLATILEINFECTION);
DoCast(me->getVictim(), SPELL_VOLATILEINFECTION);
VolatileInfection_Timer = 32000;
} else VolatileInfection_Timer -= diff;
//Darkplague_Timer
if (Darkplague_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DARKPLAGUE);
DoCast(me->getVictim(), SPELL_DARKPLAGUE);
Darkplague_Timer = 8000;
} else Darkplague_Timer -= diff;
//CorrosiveAcid_Timer
if (CorrosiveAcid_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CORROSIVEACID);
DoCast(me->getVictim(), SPELL_CORROSIVEACID);
CorrosiveAcid_Timer = 25000;
} else CorrosiveAcid_Timer -= diff;
//NoxiousCatalyst_Timer
if (NoxiousCatalyst_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_NOXIOUSCATALYST);
DoCast(me->getVictim(), SPELL_NOXIOUSCATALYST);
NoxiousCatalyst_Timer = 38000;
} else NoxiousCatalyst_Timer -= diff;
@@ -50,7 +50,7 @@ struct boss_rasfrostAI : public ScriptedAI
FrostVolley_Timer = 24000;
Fear_Timer = 45000;
DoCast(m_creature, SPELL_ICEARMOR, true);
DoCast(me, SPELL_ICEARMOR, true);
}
void EnterCombat(Unit *who){}
@@ -63,7 +63,7 @@ struct boss_rasfrostAI : public ScriptedAI
//IceArmor_Timer
if (IceArmor_Timer <= diff)
{
DoCast(m_creature, SPELL_ICEARMOR);
DoCast(me, SPELL_ICEARMOR);
IceArmor_Timer = 180000;
} else IceArmor_Timer -= diff;
@@ -79,28 +79,28 @@ struct boss_rasfrostAI : public ScriptedAI
//Freeze_Timer
if (Freeze_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FREEZE);
DoCast(me->getVictim(), SPELL_FREEZE);
Freeze_Timer = 24000;
} else Freeze_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FEAR);
DoCast(me->getVictim(), SPELL_FEAR);
Fear_Timer = 30000;
} else Fear_Timer -= diff;
//ChillNova_Timer
if (ChillNova_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CHILLNOVA);
DoCast(me->getVictim(), SPELL_CHILLNOVA);
ChillNova_Timer = 14000;
} else ChillNova_Timer -= diff;
//FrostVolley_Timer
if (FrostVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTVOLLEY);
DoCast(me->getVictim(), SPELL_FROSTVOLLEY);
FrostVolley_Timer = 15000;
} else FrostVolley_Timer -= diff;
@@ -50,13 +50,13 @@ struct boss_theravenianAI : public ScriptedAI
void JustDied(Unit *killer)
{
ScriptedInstance *pInstance = m_creature->GetInstanceData();
ScriptedInstance *pInstance = me->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_THERAVENIAN_DEATH, 0);
if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS)
m_creature->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
me->SummonCreature(1853, 180.73, -9.43856, 75.507, 1.61399, TEMPSUMMON_DEAD_DESPAWN, 0);
}
}
@@ -72,28 +72,28 @@ struct boss_theravenianAI : public ScriptedAI
//Trample_Timer
if (Trample_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TRAMPLE);
DoCast(me->getVictim(), SPELL_TRAMPLE);
Trample_Timer = 10000;
} else Trample_Timer -= diff;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
//SunderingCleave_Timer
if (SunderingCleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SUNDERINCLEAVE);
DoCast(me->getVictim(), SPELL_SUNDERINCLEAVE);
SunderingCleave_Timer = 20000;
} else SunderingCleave_Timer -= diff;
//KnockAway_Timer
if (KnockAway_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 12000;
} else KnockAway_Timer -= diff;

Some files were not shown because too many files have changed in this diff Show More