diff options
| author | Rat <none@none> | 2010-04-14 23:07:41 +0200 |
|---|---|---|
| committer | Rat <none@none> | 2010-04-14 23:07:41 +0200 |
| commit | 6bcb297de4d5231373a3e2bf2b40e527b91cdf46 (patch) | |
| tree | a5379b14ceb2ac9e7273143b334bfc693e2ef042 /src/scripts/eastern_kingdoms | |
| parent | cc262e1cde544eb7cf643df79fa00c9f34af4785 (diff) | |
*code cleanup
*totally destroyed m_creature, use "me" for future coding
--HG--
branch : trunk
Diffstat (limited to 'src/scripts/eastern_kingdoms')
152 files changed, 2860 insertions, 2860 deletions
diff --git a/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp b/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp index c908d0ace49..a61fc21d5ba 100644 --- a/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp +++ b/src/scripts/eastern_kingdoms/alterac_valley/alterac_valley.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp index 5da4bacb371..d1187748b22 100644 --- a/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_balinda.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp index 5b611666347..58caad75968 100644 --- a/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_drekthar.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp index ac0f39d6eac..5b490b06319 100644 --- a/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_galvangar.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp index 959e548f76f..989b78c8892 100644 --- a/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp +++ b/src/scripts/eastern_kingdoms/alterac_valley/boss_vanndar.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/arathi_highlands.cpp b/src/scripts/eastern_kingdoms/arathi_highlands.cpp index c33dde72dfd..8e74c3ab601 100644 --- a/src/scripts/eastern_kingdoms/arathi_highlands.cpp +++ b/src/scripts/eastern_kingdoms/arathi_highlands.cpp @@ -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) diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp index f2e7c97f251..2dbf91c72b6 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp @@ -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. diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp index acbef7f482b..be45b092590 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp index 2d13f4abc52..b15a390a871 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp index 8ea01ff5933..98fe4edfc96 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp index 1ddfa7e959a..d36990933c4 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp index 8a9ad969c72..58db7d88cb8 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp index 0014fc5fe73..70d258c7e86 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp index 0a7f380138a..4586a418a06 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp index fd654c2bdc9..0836a94f49b 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp index a24d7a4d25d..52b88318868 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp b/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp index 9914d0a282b..9acfa68fc8d 100644 --- a/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp index fab2c73dc4d..72b8f96df96 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp index 2f3858626b5..5854793f54c 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp index 62aff7322e8..8d88d0b0b17 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp index 9ec1ded5abe..e1c84b607c2 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp index 6cfd8b5ca0e..fba666349a1 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp index 548df0e314c..c93be933778 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp index 25f7a2be61d..94c5385292f 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp index 5d88df69915..09379c09cd9 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp index 342c110bdaa..eb158909f61 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp index 4a81b4cd5b2..160f883f53f 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp index bd60eab0404..e6693de3849 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp index b598b40cb8a..3ce81cb1fdb 100644 --- a/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp +++ b/src/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp index 7706ede2e1f..97f29039014 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp @@ -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(); } diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp index ccee79d83d5..5cbc819adf5 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp index 0ccdffbdb90..190c5452c7a 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp index 7bcbf72d144..9362b1e2680 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp index 8349d308c4f..09fa06cd966 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp index ae3062ea459..5d9ab125cf8 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp @@ -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(); diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp index 44ec9cb83f3..6bca046a271 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp @@ -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(); } diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp index 5fff79ad04c..982520921df 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp b/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp index c6cc0f7ad36..ee0b2c9dfef 100644 --- a/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp +++ b/src/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/boss_kruul.cpp b/src/scripts/eastern_kingdoms/boss_kruul.cpp index 94ec16b7256..b9cde621c14 100644 --- a/src/scripts/eastern_kingdoms/boss_kruul.cpp +++ b/src/scripts/eastern_kingdoms/boss_kruul.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/burning_steppes.cpp b/src/scripts/eastern_kingdoms/burning_steppes.cpp index a4e481dea83..378aa280ccc 100644 --- a/src/scripts/eastern_kingdoms/burning_steppes.cpp +++ b/src/scripts/eastern_kingdoms/burning_steppes.cpp @@ -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); diff --git a/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp b/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp index 78baa137d14..88155820b83 100644 --- a/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp +++ b/src/scripts/eastern_kingdoms/deadmines/boss_mr_smite.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/dun_morogh.cpp b/src/scripts/eastern_kingdoms/dun_morogh.cpp index bdaedb4212c..734b7be0245 100644 --- a/src/scripts/eastern_kingdoms/dun_morogh.cpp +++ b/src/scripts/eastern_kingdoms/dun_morogh.cpp @@ -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; } } diff --git a/src/scripts/eastern_kingdoms/duskwood.cpp b/src/scripts/eastern_kingdoms/duskwood.cpp index 77cd1a3bc08..45cb8dbc858 100644 --- a/src/scripts/eastern_kingdoms/duskwood.cpp +++ b/src/scripts/eastern_kingdoms/duskwood.cpp @@ -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(); diff --git a/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp b/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp index 83fe34bb572..fbd1f42a3dc 100644 --- a/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp +++ b/src/scripts/eastern_kingdoms/eastern_plaguelands.cpp @@ -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) {} diff --git a/src/scripts/eastern_kingdoms/elwynn_forest.cpp b/src/scripts/eastern_kingdoms/elwynn_forest.cpp index c4b764cb2bf..26f46800587 100644 --- a/src/scripts/eastern_kingdoms/elwynn_forest.cpp +++ b/src/scripts/eastern_kingdoms/elwynn_forest.cpp @@ -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; } } diff --git a/src/scripts/eastern_kingdoms/eversong_woods.cpp b/src/scripts/eastern_kingdoms/eversong_woods.cpp index 5ba6084a97d..0a5fa3fd920 100644 --- a/src/scripts/eastern_kingdoms/eversong_woods.cpp +++ b/src/scripts/eastern_kingdoms/eversong_woods.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/ghostlands.cpp b/src/scripts/eastern_kingdoms/ghostlands.cpp index 5087ceb8da5..ba4a27625fc 100644 --- a/src/scripts/eastern_kingdoms/ghostlands.cpp +++ b/src/scripts/eastern_kingdoms/ghostlands.cpp @@ -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); diff --git a/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp b/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp index 465ed5da357..e5a8e286948 100644 --- a/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp +++ b/src/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp @@ -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); } }; diff --git a/src/scripts/eastern_kingdoms/hinterlands.cpp b/src/scripts/eastern_kingdoms/hinterlands.cpp index 082f8895e3c..a26a10cfdb1 100644 --- a/src/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/scripts/eastern_kingdoms/hinterlands.cpp @@ -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; } } diff --git a/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp b/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp index fa36f78f636..8f44eee60d9 100644 --- a/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp +++ b/src/scripts/eastern_kingdoms/isle_of_queldanas.cpp @@ -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); } } diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp index f27203b8c75..53be3d74d63 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_curator.cpp @@ -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); } } diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp index d4b0e9c7806..e00a527f68d 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp index 4acbe9eaae2..af700bf1208 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp @@ -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); } }; diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp index 90fbfc95d9c..6024fd5580f 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp index 888d222712a..ebb51fc74cc 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp index 5554e6d700c..e9adbd7d758 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp index edca9658e5e..1ce5d61b7ba 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp @@ -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) diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp index 03b8efc1903..d5d65007398 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp b/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp index df7a5b8b2d5..ef266e4462b 100644 --- a/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp b/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp index a1322895e35..fd3442ec832 100644 --- a/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp b/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp index 754e206d778..3b0bd88d840 100644 --- a/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp +++ b/src/scripts/eastern_kingdoms/karazhan/karazhan.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp index eefc2b91355..005136249e7 100644 --- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp +++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp @@ -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); } diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp index fb78a7c7be6..6f880840a51 100644 --- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp +++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp @@ -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; // } diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp index 567a16fadae..002db4804fc 100644 --- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp +++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp index f2fba569b5b..42329f567e5 100644 --- a/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp +++ b/src/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp @@ -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()); diff --git a/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp b/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp index 96837858535..cc3959e4f29 100644 --- a/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp +++ b/src/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp index ca20931fc47..c44ab5067a3 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp index 447ebc19c98..15d2ccfb53d 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_garr.cpp @@ -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(); diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp index 5dd34a54b00..3610586cc05 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp index 4ea1f5514c6..c63e49e70a6 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp @@ -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 diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp index cf46b06f052..1835026f5f0 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp index f2a23746d10..e74e6d08c9b 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp index 35fd2dbffe6..1e014e26ef1 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp index ba2673290b5..ce541198cad 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp index 471bffa635f..5fb99e3a1ba 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp b/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp index 1948a3d57e6..302624ba170 100644 --- a/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp +++ b/src/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/redridge_mountains.cpp b/src/scripts/eastern_kingdoms/redridge_mountains.cpp index 46378353282..2f0b5821e86 100644 --- a/src/scripts/eastern_kingdoms/redridge_mountains.cpp +++ b/src/scripts/eastern_kingdoms/redridge_mountains.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp b/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp index a49ade8758f..0fc3bee28c4 100644 --- a/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp @@ -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(); } } } diff --git a/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index c59e73d6dc1..cdfd69234fb 100644 --- a/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp index 2b357367797..e51dda77ba9 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp index e8236dd7ce0..e59120d3768 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp index 6b1be49136b..13dcfdf88dc 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp index 56b012dc79c..c1d17203f77 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp @@ -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); } diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp index 9df10bd2b13..00e27d36ddb 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp index 572831eca3a..40be214d5ab 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp index 0579f007255..731e64cc7bd 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp index e614341ed04..d0a34d461c7 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp index 08ddc37a12a..a03611d1077 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp index 88adb538129..a8295cbaedd 100644 --- a/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp +++ b/src/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp index 11578a07a83..14195c9280b 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp index d0158244bba..b3ce15a80fd 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp @@ -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) diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp index 232ba904a4e..067093f9e8a 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp index 23df3ad2c59..6cfa26619ae 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp index 8c49730e919..ee151a72413 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp @@ -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) diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp index 7f45e9f1f0a..0f12567ea11 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp index d4c677e6b78..763fc0cf9e6 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp @@ -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; } diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp index b3b51a48f65..fcc5b4a692e 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp index 94cdbe300f5..f8b1ea60423 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp index a4a796f71d8..618d6f7dbde 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp index 2e0066487de..9502900b0eb 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp @@ -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; diff --git a/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp index cb0535bd0b3..a38369faab0 100644 --- a/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp +++ b/src/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp @@ -56,7 +56,7 @@ struct boss_vectusAI : public ScriptedAI //FireShield_Timer if (m_uiFireShield_Timer <= uiDiff) { - DoCast(m_creature, SPELL_FIRESHIELD); + DoCast(me, SPELL_FIRESHIELD); m_uiFireShield_Timer = 90000; } else @@ -65,19 +65,19 @@ struct boss_vectusAI : public ScriptedAI //BlastWave_Timer if (m_uiBlastWave_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE); + DoCast(me->getVictim(), SPELL_BLAST_WAVE); m_uiBlastWave_Timer = 12000; } else m_uiBlastWave_Timer -= uiDiff; //Frenzy_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) + if (me->GetHealth()*100 / me->GetMaxHealth() < 25) { 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 = 24000; } diff --git a/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp b/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp index 27d5002e9c1..c41a53cf779 100644 --- a/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp +++ b/src/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp @@ -68,32 +68,32 @@ struct npc_shadowfang_prisonerAI : public npc_escortAI { case 0: if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_FREE_AS, m_creature); + DoScriptText(SAY_FREE_AS, me); else - DoScriptText(SAY_FREE_AD, m_creature); + DoScriptText(SAY_FREE_AD, me); break; case 10: if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_OPEN_DOOR_AS, m_creature); + DoScriptText(SAY_OPEN_DOOR_AS, me); else - DoScriptText(SAY_OPEN_DOOR_AD, m_creature); + DoScriptText(SAY_OPEN_DOOR_AD, me); break; case 11: if (uiNpcEntry == NPC_ASH) - DoCast(m_creature, SPELL_UNLOCK); + DoCast(me, SPELL_UNLOCK); break; case 12: if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_POST_DOOR_AS, m_creature); + DoScriptText(SAY_POST_DOOR_AS, me); else - DoScriptText(SAY_POST1_DOOR_AD, m_creature); + DoScriptText(SAY_POST1_DOOR_AD, me); if (pInstance) pInstance->SetData(TYPE_FREE_NPC, DONE); break; case 13: if (uiNpcEntry != NPC_ASH) - DoScriptText(SAY_POST2_DOOR_AD, m_creature); + DoScriptText(SAY_POST2_DOOR_AD, me); break; } } @@ -154,13 +154,13 @@ struct npc_arugal_voidwalkerAI : public ScriptedAI if (uiDarkOffering <= uiDiff) { - if (Creature* pFriend = m_creature->FindNearestCreature(m_creature->GetEntry(),25.0f,true)) + if (Creature* pFriend = me->FindNearestCreature(me->GetEntry(),25.0f,true)) { if (pFriend) DoCast(pFriend,SPELL_DARK_OFFERING); } else - DoCast(m_creature,SPELL_DARK_OFFERING); + DoCast(me,SPELL_DARK_OFFERING); uiDarkOffering = urand(4400,12500); } else uiDarkOffering -= uiDiff; diff --git a/src/scripts/eastern_kingdoms/silvermoon_city.cpp b/src/scripts/eastern_kingdoms/silvermoon_city.cpp index 1c81d701fb0..29edc1b72a3 100644 --- a/src/scripts/eastern_kingdoms/silvermoon_city.cpp +++ b/src/scripts/eastern_kingdoms/silvermoon_city.cpp @@ -47,8 +47,8 @@ struct npc_blood_knight_stillbladeAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down + me->SetStandState(UNIT_STAND_STATE_DEAD); + me->SetUInt32Value(UNIT_FIELD_BYTES_1,7); // lay down spellHit = false; } @@ -63,10 +63,10 @@ struct npc_blood_knight_stillbladeAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (m_creature->IsStandState()) + if (me->IsStandState()) { if (lifeTimer <= diff) - m_creature->AI()->EnterEvadeMode(); + me->AI()->EnterEvadeMode(); else lifeTimer -= diff; } @@ -78,11 +78,11 @@ struct npc_blood_knight_stillbladeAI : public ScriptedAI (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) { CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); - DoCast(m_creature, SPELL_REVIVE_SELF); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - //m_creature->RemoveAllAuras(); - DoScriptText(SAY_HEAL, m_creature); + DoCast(me, SPELL_REVIVE_SELF); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //me->RemoveAllAuras(); + DoScriptText(SAY_HEAL, me); spellHit = true; } } diff --git a/src/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/scripts/eastern_kingdoms/silverpine_forest.cpp index 3294ffb223b..2213c5fab48 100644 --- a/src/scripts/eastern_kingdoms/silverpine_forest.cpp +++ b/src/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -43,7 +43,7 @@ struct npc_astor_hadrenAI : public ScriptedAI void Reset() { - m_creature->setFaction(68); + me->setFaction(68); } void EnterCombat(Unit* who) @@ -52,7 +52,7 @@ struct npc_astor_hadrenAI : public ScriptedAI void JustDied(Unit *who) { - m_creature->setFaction(68); + me->setFaction(68); } }; @@ -128,25 +128,25 @@ struct npc_deathstalker_erlandAI : public npc_escortAI switch(i) { - case 1: DoScriptText(SAY_START, m_creature, pPlayer);break; + case 1: DoScriptText(SAY_START, me, pPlayer);break; case 13: - DoScriptText(SAY_LAST, m_creature, pPlayer); - pPlayer->GroupEventHappens(QUEST_ESCORTING, m_creature); break; - case 14: DoScriptText(SAY_THANKS, m_creature, pPlayer); break; + DoScriptText(SAY_LAST, me, pPlayer); + pPlayer->GroupEventHappens(QUEST_ESCORTING, me); break; + case 14: DoScriptText(SAY_THANKS, me, pPlayer); break; case 15: { Unit* Rane = me->FindNearestCreature(NPC_RANE, 20); if (Rane) DoScriptText(SAY_RANE, Rane); break;} - case 16: DoScriptText(SAY_ANSWER, m_creature); break; - case 17: DoScriptText(SAY_MOVE_QUINN, m_creature); break; - case 24: DoScriptText(SAY_GREETINGS, m_creature); break; + case 16: DoScriptText(SAY_ANSWER, me); break; + case 17: DoScriptText(SAY_MOVE_QUINN, me); break; + case 24: DoScriptText(SAY_GREETINGS, me); break; case 25: { Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20); if (Quinn) DoScriptText(SAY_QUINN, Quinn); break;} - case 26: DoScriptText(SAY_ON_BYE, m_creature, NULL); break; + case 26: DoScriptText(SAY_ON_BYE, me, NULL); break; } } @@ -155,7 +155,7 @@ struct npc_deathstalker_erlandAI : public npc_escortAI void EnterCombat(Unit* who) { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), m_creature, who); + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me, who); } }; @@ -205,7 +205,7 @@ static float PyrewoodSpawnPoints[3][4] = struct pyrewood_ambushAI : public ScriptedAI { - pyrewood_ambushAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + pyrewood_ambushAI(Creature *c) : ScriptedAI(c), Summons(me) { QuestInProgress = false; } @@ -247,7 +247,7 @@ struct pyrewood_ambushAI : public ScriptedAI void SummonCreatureWithRandomTarget(uint32 creatureId, int position) { - if (Creature *pSummoned = m_creature->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) + if (Creature *pSummoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) { Player *pPlayer = NULL; Unit *pTarget = NULL; @@ -255,9 +255,9 @@ struct pyrewood_ambushAI : public ScriptedAI { pPlayer = Unit::GetPlayer(PlayerGUID); if (pPlayer) - pTarget = RAND((Unit*)m_creature, (Unit*)pPlayer); + pTarget = RAND((Unit*)me, (Unit*)pPlayer); } else - pTarget = m_creature; + pTarget = me; if (pTarget) { @@ -296,7 +296,7 @@ struct pyrewood_ambushAI : public ScriptedAI { case 0: if (WaitTimer == WAIT_SECS) - m_creature->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike + me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike if (WaitTimer <= diff) { @@ -326,8 +326,8 @@ struct pyrewood_ambushAI : public ScriptedAI { if (Player *pPlayer = Unit::GetPlayer(PlayerGUID)) { - m_creature->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike - pPlayer->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, m_creature); + me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike + pPlayer->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); } } QuestInProgress = false; diff --git a/src/scripts/eastern_kingdoms/stormwind_city.cpp b/src/scripts/eastern_kingdoms/stormwind_city.cpp index 80f73d2b9ba..3cfc99b67e1 100644 --- a/src/scripts/eastern_kingdoms/stormwind_city.cpp +++ b/src/scripts/eastern_kingdoms/stormwind_city.cpp @@ -86,16 +86,16 @@ struct npc_bartlebyAI : public ScriptedAI void Reset() { - if (m_creature->getFaction() != m_uiNormalFaction) - m_creature->setFaction(m_uiNormalFaction); + if (me->getFaction() != m_uiNormalFaction) + me->setFaction(m_uiNormalFaction); } void AttackedBy(Unit* pAttacker) { - if (m_creature->getVictim()) + if (me->getVictim()) return; - if (m_creature->IsFriendlyTo(pAttacker)) + if (me->IsFriendlyTo(pAttacker)) return; AttackStart(pAttacker); @@ -103,7 +103,7 @@ struct npc_bartlebyAI : public ScriptedAI void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 15)) { //Take 0 damage uiDamage = 0; @@ -151,16 +151,16 @@ struct npc_dashel_stonefistAI : public ScriptedAI void Reset() { - if (m_creature->getFaction() != m_uiNormalFaction) - m_creature->setFaction(m_uiNormalFaction); + if (me->getFaction() != m_uiNormalFaction) + me->setFaction(m_uiNormalFaction); } void AttackedBy(Unit* pAttacker) { - if (m_creature->getVictim()) + if (me->getVictim()) return; - if (m_creature->IsFriendlyTo(pAttacker)) + if (me->IsFriendlyTo(pAttacker)) return; AttackStart(pAttacker); @@ -168,7 +168,7 @@ struct npc_dashel_stonefistAI : public ScriptedAI void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 15)) { uiDamage = 0; @@ -284,9 +284,9 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI void EnterEvadeMode() { - m_creature->DisappearAndDie(); + me->DisappearAndDie(); - if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID)) + if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID)) { if (pMarzon->isAlive()) pMarzon->DisappearAndDie(); @@ -295,7 +295,7 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI void EnterCombat(Unit* pWho) { - if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID)) + if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID)) { if (pMarzon->isAlive() && !pMarzon->isInCombat()) pMarzon->AI()->AttackStart(pWho); @@ -308,13 +308,13 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI { case 14: SetEscortPaused(true); - DoScriptText(SAY_LESCOVAR_2, m_creature); + DoScriptText(SAY_LESCOVAR_2, me); uiTimer = 3000; uiPhase = 1; break; case 16: SetEscortPaused(true); - if (Creature *pMarzon = m_creature->SummonCreature(NPC_MARZON_BLADE,-8411.360352, 480.069733, 123.760895, 4.941504, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) + if (Creature *pMarzon = me->SummonCreature(NPC_MARZON_BLADE,-8411.360352, 480.069733, 123.760895, 4.941504, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) { pMarzon->GetMotionMaster()->MovePoint(0,-8408.000977, 468.611450, 123.759903); MarzonGUID = pMarzon->GetGUID(); @@ -328,7 +328,7 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI void DoGuardsDisappearAndDie() { std::list<Creature*> GuardList; - m_creature->GetCreatureListWithEntryInGrid(GuardList,NPC_STORMWIND_ROYAL,8.0f); + me->GetCreatureListWithEntryInGrid(GuardList,NPC_STORMWIND_ROYAL,8.0f); if (!GuardList.empty()) { for (std::list<Creature*>::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr) @@ -348,7 +348,7 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI switch(uiPhase) { case 1: - if (Creature* pGuard = m_creature->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) + if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) DoScriptText(SAY_GUARD_2, pGuard); uiTimer = 3000; uiPhase = 2; @@ -364,29 +364,29 @@ struct npc_lord_gregor_lescovarAI : public npc_escortAI uiPhase = 0; break; case 4: - DoScriptText(SAY_LESCOVAR_3, m_creature); + DoScriptText(SAY_LESCOVAR_3, me); uiTimer = 0; uiPhase = 0; break; case 5: - if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID)) + if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID)) DoScriptText(SAY_MARZON_1, pMarzon); uiTimer = 3000; uiPhase = 6; break; case 6: - DoScriptText(SAY_LESCOVAR_4, m_creature); + DoScriptText(SAY_LESCOVAR_4, me); if (Player* pPlayer = GetPlayerForEscort()) pPlayer->AreaExploredOrEventHappens(QUEST_THE_ATTACK); uiTimer = 2000; uiPhase = 7; break; case 7: - if (Creature* pTyrion = m_creature->FindNearestCreature(NPC_TYRION, 20.0f, true)) + if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) DoScriptText(SAY_TYRION_2, pTyrion); - if (Creature *pMarzon = Unit::GetCreature(*m_creature, MarzonGUID)) + if (Creature *pMarzon = Unit::GetCreature(*me, MarzonGUID)) pMarzon->setFaction(14); - m_creature->setFaction(14); + me->setFaction(14); uiTimer = 0; uiPhase = 0; break; @@ -415,21 +415,21 @@ struct npc_marzon_silent_bladeAI : public ScriptedAI { npc_marzon_silent_bladeAI(Creature* pCreature) : ScriptedAI(pCreature) { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); } void Reset() { - m_creature->RestoreFaction(); + me->RestoreFaction(); } void EnterCombat(Unit* pWho) { - DoScriptText(SAY_MARZON_2, m_creature); + DoScriptText(SAY_MARZON_2, me); - if (m_creature->isSummon()) + if (me->isSummon()) { - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { if (pSummoner && pSummoner->isAlive() && !pSummoner->isInCombat()) CAST_CRE(pSummoner)->AI()->AttackStart(pWho); @@ -439,11 +439,11 @@ struct npc_marzon_silent_bladeAI : public ScriptedAI void EnterEvadeMode() { - m_creature->DisappearAndDie(); + me->DisappearAndDie(); - if (m_creature->isSummon()) + if (me->isSummon()) { - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { if (pSummoner && pSummoner->isAlive()) CAST_CRE(pSummoner)->DisappearAndDie(); @@ -456,13 +456,13 @@ struct npc_marzon_silent_bladeAI : public ScriptedAI if (uiType != POINT_MOTION_TYPE) return; - if (m_creature->isSummon()) + if (me->isSummon()) { - if (Unit* pSummoner = CAST_SUM(m_creature)->GetSummoner()) + if (Unit* pSummoner = CAST_SUM(me)->GetSummoner()) { CAST_AI(npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiTimer = 2000; CAST_AI(npc_lord_gregor_lescovarAI, CAST_CRE(pSummoner)->AI())->uiPhase = 5; - //m_creature->ChangeOrient(0.0f, pSummoner); + //me->ChangeOrient(0.0f, pSummoner); } } } @@ -524,13 +524,13 @@ struct npc_tyrion_spybotAI : public npc_escortAI break; case 5: SetEscortPaused(true); - DoScriptText(SAY_SPYBOT_1, m_creature); + DoScriptText(SAY_SPYBOT_1, me); uiTimer = 2000; uiPhase = 5; break; case 17: SetEscortPaused(true); - DoScriptText(SAY_SPYBOT_3, m_creature); + DoScriptText(SAY_SPYBOT_3, me); uiTimer = 3000; uiPhase = 8; break; @@ -546,7 +546,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI switch(uiPhase) { case 1: - DoScriptText(SAY_QUEST_ACCEPT_ATTACK, m_creature); + DoScriptText(SAY_QUEST_ACCEPT_ATTACK, me); uiTimer = 3000; uiPhase = 2; break; @@ -560,7 +560,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI uiPhase = 3; break; case 3: - m_creature->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE); + me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE); uiTimer = 2000; uiPhase = 4; break; @@ -570,13 +570,13 @@ struct npc_tyrion_spybotAI : public npc_escortAI uiTimer = 0; break; case 5: - if (Creature* pGuard = m_creature->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true)) + if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true)) DoScriptText(SAY_GUARD_1, pGuard); uiTimer = 3000; uiPhase = 6; break; case 6: - DoScriptText(SAY_SPYBOT_2, m_creature); + DoScriptText(SAY_SPYBOT_2, me); uiTimer = 3000; uiPhase = 7; break; @@ -595,7 +595,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI uiPhase = 9; break; case 9: - DoScriptText(SAY_SPYBOT_4, m_creature); + DoScriptText(SAY_SPYBOT_4, me); uiTimer = 3000; uiPhase = 10; break; @@ -609,7 +609,7 @@ struct npc_tyrion_spybotAI : public npc_escortAI CAST_AI(npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); } */ - m_creature->DisappearAndDie(); + me->DisappearAndDie(); uiTimer = 0; uiPhase = 0; break; diff --git a/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp b/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp index 08893ea977f..6f1112c2ca1 100644 --- a/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp +++ b/src/scripts/eastern_kingdoms/stranglethorn_vale.cpp @@ -44,7 +44,7 @@ struct mob_yennikuAI : public ScriptedAI void Reset() { Reset_Timer = 0; - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); } void SpellHit(Unit *caster, const SpellEntry *spell) @@ -54,10 +54,10 @@ struct mob_yennikuAI : public ScriptedAI //Yenniku's Release if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - m_creature->CombatStop(); //stop combat - m_creature->DeleteThreatList(); //unsure of this - m_creature->setFaction(83); //horde generic + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + me->CombatStop(); //stop combat + me->DeleteThreatList(); //unsure of this + me->setFaction(83); //horde generic bReset = true; Reset_Timer = 60000; @@ -76,20 +76,20 @@ struct mob_yennikuAI : public ScriptedAI { EnterEvadeMode(); bReset = false; - m_creature->setFaction(28); //troll, bloodscalp + me->setFaction(28); //troll, bloodscalp return; } else Reset_Timer -= diff; - if (m_creature->isInCombat() && m_creature->getVictim()) + if (me->isInCombat() && me->getVictim()) { - if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) + if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) { - Unit *victim = m_creature->getVictim(); + Unit *victim = me->getVictim(); if (CAST_PLR(victim)->GetTeam() == HORDE) { - m_creature->CombatStop(); - m_creature->DeleteThreatList(); + me->CombatStop(); + me->DeleteThreatList(); } } } diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp index dd83e3cbc5f..f32864fccf7 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp @@ -79,7 +79,7 @@ struct boss_baron_rivendareAI : public ScriptedAI { boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } ScriptedInstance* pInstance; @@ -129,7 +129,7 @@ struct boss_baron_rivendareAI : public ScriptedAI if (ShadowBolt_Timer <= diff) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT); + DoCast(me->getVictim(), SPELL_SHADOWBOLT); ShadowBolt_Timer = 10000; } else ShadowBolt_Timer -= diff; @@ -137,7 +137,7 @@ struct boss_baron_rivendareAI : public ScriptedAI //Cleave if (Cleave_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); + DoCast(me->getVictim(), SPELL_CLEAVE); //13 seconds until we should cast this again Cleave_Timer = 7000 + (rand()%10000); } else Cleave_Timer -= diff; @@ -145,26 +145,26 @@ struct boss_baron_rivendareAI : public ScriptedAI //MortalStrike if (MortalStrike_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE); + DoCast(me->getVictim(), SPELL_MORTALSTRIKE); MortalStrike_Timer = 10000 + (rand()%15000); } else MortalStrike_Timer -= diff; //RaiseDead // if (RaiseDead_Timer <= diff) // { - // DoCast(m_creature, SPELL_RAISEDEAD); + // DoCast(me, SPELL_RAISEDEAD); // RaiseDead_Timer = 45000; // } else RaiseDead_Timer -= diff; //SummonSkeletons if (SummonSkeletons_Timer <= diff) { - m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); + me->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); //34 seconds until we should cast this again SummonSkeletons_Timer = 40000; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp index 2ae770ec5b8..e51ee03cc80 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp @@ -33,7 +33,7 @@ struct boss_baroness_anastariAI : public ScriptedAI { boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } ScriptedInstance* pInstance; @@ -70,7 +70,7 @@ struct boss_baroness_anastariAI : public ScriptedAI if (BansheeWail_Timer <= diff) { if (rand()%100 < 95) - DoCast(m_creature->getVictim(), SPELL_BANSHEEWAIL); + DoCast(me->getVictim(), SPELL_BANSHEEWAIL); //4 seconds until we should cast this again BansheeWail_Timer = 4000; } else BansheeWail_Timer -= diff; @@ -79,7 +79,7 @@ struct boss_baroness_anastariAI : public ScriptedAI if (BansheeCurse_Timer <= diff) { if (rand()%100 < 75) - DoCast(m_creature->getVictim(), SPELL_BANSHEECURSE); + DoCast(me->getVictim(), SPELL_BANSHEECURSE); //18 seconds until we should cast this again BansheeCurse_Timer = 18000; } else BansheeCurse_Timer -= diff; @@ -88,7 +88,7 @@ struct boss_baroness_anastariAI : public ScriptedAI if (Silence_Timer <= diff) { if (rand()%100 < 80) - DoCast(m_creature->getVictim(), SPELL_SILENCE); + DoCast(me->getVictim(), SPELL_SILENCE); //13 seconds until we should cast this again Silence_Timer = 13000; } else Silence_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp index f1a0a57e85c..edb64c6b917 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp @@ -93,13 +93,13 @@ struct boss_cannon_master_willeyAI : public ScriptedAI void JustDied(Unit* Victim) { - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); } void EnterCombat(Unit *who) @@ -118,7 +118,7 @@ struct boss_cannon_master_willeyAI : public ScriptedAI //Cast if (rand()%100 < 90) //90% chance to cast { - DoCast(m_creature->getVictim(), SPELL_PUMMEL); + DoCast(me->getVictim(), SPELL_PUMMEL); } //12 seconds until we should cast this again Pummel_Timer = 12000; @@ -130,7 +130,7 @@ struct boss_cannon_master_willeyAI : public ScriptedAI //Cast if (rand()%100 < 80) //80% chance to cast { - DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY); + DoCast(me->getVictim(), SPELL_KNOCKAWAY); } //14 seconds until we should cast this again KnockAway_Timer = 14000; @@ -140,7 +140,7 @@ struct boss_cannon_master_willeyAI : public ScriptedAI if (Shoot_Timer <= diff) { //Cast - DoCast(m_creature->getVictim(), SPELL_SHOOT); + DoCast(me->getVictim(), SPELL_SHOOT); //1 seconds until we should cast this again Shoot_Timer = 1000; } else Shoot_Timer -= diff; @@ -152,49 +152,49 @@ struct boss_cannon_master_willeyAI : public ScriptedAI switch (rand()%9) { case 0: - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 1: - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 2: - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 3: - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 4: - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 5: - m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 6: - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 7: - m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); break; case 8: - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + me->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); break; } //30 seconds until we should cast this again diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp index 83684cb4fe9..0fd547d393e 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp @@ -89,8 +89,8 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI m_uiMindControl_Timer = 10000; m_bTransformed = false; - if (m_creature->GetEntry() == NPC_BALNAZZAR) - m_creature->UpdateEntry(NPC_DATHROHAN); + if (me->GetEntry() == NPC_BALNAZZAR) + me->UpdateEntry(NPC_DATHROHAN); } void JustDied(Unit* Victim) @@ -98,7 +98,7 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); for (uint8 i=0; i<uiCount; ++i) - m_creature->SummonCreature(NPC_ZOMBIE, + me->SummonCreature(NPC_ZOMBIE, m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient, TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILISECONDS); } @@ -118,40 +118,40 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI //MindBlast if (m_uiMindBlast_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_MINDBLAST); + DoCast(me->getVictim(), SPELL_MINDBLAST); m_uiMindBlast_Timer = 15000 + rand()%5000; } else m_uiMindBlast_Timer -= uiDiff; //CrusadersHammer if (m_uiCrusadersHammer_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_CRUSADERSHAMMER); + DoCast(me->getVictim(), SPELL_CRUSADERSHAMMER); m_uiCrusadersHammer_Timer = 12000; } else m_uiCrusadersHammer_Timer -= uiDiff; //CrusaderStrike if (m_uiCrusaderStrike_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_CRUSADERSTRIKE); + DoCast(me->getVictim(), SPELL_CRUSADERSTRIKE); m_uiCrusaderStrike_Timer = 15000; } else m_uiCrusaderStrike_Timer -= uiDiff; //HolyStrike if (m_uiHolyStrike_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_HOLYSTRIKE); + DoCast(me->getVictim(), SPELL_HOLYSTRIKE); m_uiHolyStrike_Timer = 15000; } else m_uiHolyStrike_Timer -= uiDiff; //BalnazzarTransform - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40) + if (me->GetHealth()*100 / me->GetMaxHealth() < 40) { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); + if (me->IsNonMeleeSpellCasted(false)) + me->InterruptNonMeleeSpells(false); //restore hp, mana and stun - DoCast(m_creature, SPELL_BALNAZZARTRANSFORM); - m_creature->UpdateEntry(NPC_BALNAZZAR); + DoCast(me, SPELL_BALNAZZARTRANSFORM); + me->UpdateEntry(NPC_BALNAZZAR); m_bTransformed = true; } } @@ -160,14 +160,14 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI //MindBlast if (m_uiMindBlast_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_MINDBLAST); + DoCast(me->getVictim(), SPELL_MINDBLAST); m_uiMindBlast_Timer = 15000 + rand()%5000; } else m_uiMindBlast_Timer -= uiDiff; //ShadowShock if (m_uiShadowShock_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK); + DoCast(me->getVictim(), SPELL_SHADOWSHOCK); m_uiShadowShock_Timer = 11000; } else m_uiShadowShock_Timer -= uiDiff; @@ -192,7 +192,7 @@ struct boss_dathrohan_balnazzarAI : public ScriptedAI //MindControl if (m_uiMindControl_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_MINDCONTROL); + DoCast(me->getVictim(), SPELL_MINDCONTROL); m_uiMindControl_Timer = 15000; } else m_uiMindControl_Timer -= uiDiff; } diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp index d99e6f36044..88f8b7571d1 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp @@ -50,10 +50,10 @@ struct boss_magistrate_barthilasAI : public ScriptedAI FuriousAnger_Timer = 5000; AngerCount = 0; - if (m_creature->isAlive()) - m_creature->SetDisplayId(MODEL_NORMAL); + if (me->isAlive()) + me->SetDisplayId(MODEL_NORMAL); else - m_creature->SetDisplayId(MODEL_HUMAN); + me->SetDisplayId(MODEL_HUMAN); } void MoveInLineOfSight(Unit *who) @@ -65,7 +65,7 @@ struct boss_magistrate_barthilasAI : public ScriptedAI void JustDied(Unit* Killer) { - m_creature->SetDisplayId(MODEL_HUMAN); + me->SetDisplayId(MODEL_HUMAN); } void EnterCombat(Unit *who) @@ -85,27 +85,27 @@ struct boss_magistrate_barthilasAI : public ScriptedAI return; ++AngerCount; - DoCast(m_creature, SPELL_FURIOUS_ANGER, false); + DoCast(me, SPELL_FURIOUS_ANGER, false); } else FuriousAnger_Timer -= diff; //DrainingBlow if (DrainingBlow_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_DRAININGBLOW); + DoCast(me->getVictim(), SPELL_DRAININGBLOW); DrainingBlow_Timer = 15000; } else DrainingBlow_Timer -= diff; //CrowdPummel if (CrowdPummel_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CROWDPUMMEL); + DoCast(me->getVictim(), SPELL_CROWDPUMMEL); CrowdPummel_Timer = 15000; } else CrowdPummel_Timer -= diff; //MightyBlow if (MightyBlow_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MIGHTYBLOW); + DoCast(me->getVictim(), SPELL_MIGHTYBLOW); MightyBlow_Timer = 20000; } else MightyBlow_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp index 60e7db37da2..046412e24b8 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp @@ -33,7 +33,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI { boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } ScriptedInstance* pInstance; @@ -69,7 +69,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI if (Frostbolt_Timer <= diff) { if (rand()%100 < 90) - DoCast(m_creature->getVictim(), SPELL_FROSTBOLT); + DoCast(me->getVictim(), SPELL_FROSTBOLT); Frostbolt_Timer = 3500; } else Frostbolt_Timer -= diff; @@ -77,7 +77,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI if (IceTomb_Timer <= diff) { if (rand()%100 < 65) - DoCast(m_creature->getVictim(), SPELL_ICETOMB); + DoCast(me->getVictim(), SPELL_ICETOMB); IceTomb_Timer = 28000; } else IceTomb_Timer -= diff; @@ -85,7 +85,7 @@ struct boss_maleki_the_pallidAI : public ScriptedAI if (DrainLife_Timer <= diff) { if (rand()%100 < 55) - DoCast(m_creature->getVictim(), SPELL_DRAINLIFE); + DoCast(me->getVictim(), SPELL_DRAINLIFE); DrainLife_Timer = 31000; } else DrainLife_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp index 4f3905e8698..a3af7a702fb 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp @@ -33,7 +33,7 @@ struct boss_nerubenkanAI : public ScriptedAI { boss_nerubenkanAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } ScriptedInstance* pInstance; @@ -76,7 +76,7 @@ struct boss_nerubenkanAI : public ScriptedAI //EncasingWebs if (EncasingWebs_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_ENCASINGWEBS); + DoCast(me->getVictim(), SPELL_ENCASINGWEBS); EncasingWebs_Timer = 30000; } else EncasingWebs_Timer -= diff; @@ -84,21 +84,21 @@ struct boss_nerubenkanAI : public ScriptedAI if (PierceArmor_Timer <= diff) { if (urand(0,3) < 2) - DoCast(m_creature->getVictim(), SPELL_PIERCEARMOR); + DoCast(me->getVictim(), SPELL_PIERCEARMOR); PierceArmor_Timer = 35000; } else PierceArmor_Timer -= diff; //CryptScarabs_Timer if (CryptScarabs_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CRYPT_SCARABS); + DoCast(me->getVictim(), SPELL_CRYPT_SCARABS); CryptScarabs_Timer = 20000; } else CryptScarabs_Timer -= diff; //RaiseUndeadScarab if (RaiseUndeadScarab_Timer <= diff) { - RaiseUndeadScarab(m_creature->getVictim()); + RaiseUndeadScarab(me->getVictim()); RaiseUndeadScarab_Timer = 16000; } else RaiseUndeadScarab_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp index 6c20e18bcfb..eab460fbcd2 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp @@ -60,7 +60,7 @@ struct boss_silver_hand_bossesAI : public ScriptedAI if (pInstance) { - switch(m_creature->GetEntry()) + switch(me->GetEntry()) { case SH_AELMAR: pInstance->SetData(TYPE_SH_AELMAR, 0); @@ -89,7 +89,7 @@ struct boss_silver_hand_bossesAI : public ScriptedAI { if (pInstance) { - switch(m_creature->GetEntry()) + switch(me->GetEntry()) { case SH_AELMAR: pInstance->SetData(TYPE_SH_AELMAR, 2); @@ -108,7 +108,7 @@ struct boss_silver_hand_bossesAI : public ScriptedAI break; } if (pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,m_creature->GetGUID()); + CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,me->GetGUID()); } } @@ -120,18 +120,18 @@ struct boss_silver_hand_bossesAI : public ScriptedAI if (HolyLight_Timer <= diff) { - if (m_creature->GetHealth()*5 < m_creature->GetMaxHealth()) + if (me->GetHealth()*5 < me->GetMaxHealth()) { - DoCast(m_creature, SPELL_HOLY_LIGHT); + DoCast(me, SPELL_HOLY_LIGHT); HolyLight_Timer = 20000; } } else HolyLight_Timer -= diff; if (DivineShield_Timer <= diff) { - if (m_creature->GetHealth()*20 < m_creature->GetMaxHealth()) + if (me->GetHealth()*20 < me->GetMaxHealth()) { - DoCast(m_creature, SPELL_DIVINE_SHIELD); + DoCast(me, SPELL_DIVINE_SHIELD); DivineShield_Timer = 40000; } } else DivineShield_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp index 0aea76c10f8..2dc4e1af8b7 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp @@ -71,7 +71,7 @@ struct boss_postmaster_malownAI : public ScriptedAI //Cast if (rand()%100 < 65) //65% chance to cast { - DoCast(m_creature->getVictim(), SPELL_WAILINGDEAD); + DoCast(me->getVictim(), SPELL_WAILINGDEAD); } //19 seconds until we should cast this again WailingDead_Timer = 19000; @@ -83,7 +83,7 @@ struct boss_postmaster_malownAI : public ScriptedAI //Cast if (rand()%100 < 45) //45% chance to cast { - DoCast(m_creature->getVictim(), SPELL_BACKHAND); + DoCast(me->getVictim(), SPELL_BACKHAND); } //8 seconds until we should cast this again Backhand_Timer = 8000; @@ -95,7 +95,7 @@ struct boss_postmaster_malownAI : public ScriptedAI //Cast if (rand()%100 < 3) //3% chance to cast { - DoCast(m_creature->getVictim(), SPELL_CURSEOFWEAKNESS); + DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); } //20 seconds until we should cast this again CurseOfWeakness_Timer = 20000; @@ -107,7 +107,7 @@ struct boss_postmaster_malownAI : public ScriptedAI //Cast if (rand()%100 < 3) //3% chance to cast { - DoCast(m_creature->getVictim(), SPELL_CURSEOFTONGUES); + DoCast(me->getVictim(), SPELL_CURSEOFTONGUES); } //22 seconds until we should cast this again CurseOfTongues_Timer = 22000; @@ -119,7 +119,7 @@ struct boss_postmaster_malownAI : public ScriptedAI //Cast if (rand()%100 < 5) //5% chance to cast { - DoCast(m_creature->getVictim(), SPELL_CALLOFTHEGRAVE); + DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); } //25 seconds until we should cast this again CallOfTheGrave_Timer = 25000; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp index 5eaa4775b04..6c7cc8beec8 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp @@ -33,7 +33,7 @@ struct boss_ramstein_the_gorgerAI : public ScriptedAI { boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } ScriptedInstance* pInstance; @@ -55,8 +55,8 @@ struct boss_ramstein_the_gorgerAI : public ScriptedAI { for (uint8 i = 0; i < 30; ++i) { - if (Creature* mob = m_creature->SummonCreature(C_MINDLESS_UNDEAD,3969.35+irand(-10,10),-3391.87+irand(-10,10),119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000)) - mob->AI()->AttackStart(m_creature->SelectNearestTarget(500)); + if (Creature* mob = me->SummonCreature(C_MINDLESS_UNDEAD,3969.35+irand(-10,10),-3391.87+irand(-10,10),119.11,5.91,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000)) + mob->AI()->AttackStart(me->SelectNearestTarget(500)); } if (pInstance) @@ -72,14 +72,14 @@ struct boss_ramstein_the_gorgerAI : public ScriptedAI //Trample if (Trample_Timer <= diff) { - DoCast(m_creature, SPELL_TRAMPLE); + DoCast(me, SPELL_TRAMPLE); Trample_Timer = 7000; } else Trample_Timer -= diff; //Knockout if (Knockout_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_KNOCKOUT); + DoCast(me->getVictim(), SPELL_KNOCKOUT); Knockout_Timer = 10000; } else Knockout_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp b/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp index ccff3b32b77..78e9acb9725 100644 --- a/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp @@ -44,7 +44,7 @@ struct boss_timmy_the_cruelAI : public ScriptedAI { if (!HasYelled) { - m_creature->MonsterYell(SAY_SPAWN,LANG_UNIVERSAL,NULL); + me->MonsterYell(SAY_SPAWN,LANG_UNIVERSAL,NULL); HasYelled = true; } } @@ -59,7 +59,7 @@ struct boss_timmy_the_cruelAI : public ScriptedAI if (RavenousClaw_Timer <= diff) { //Cast - DoCast(m_creature->getVictim(), SPELL_RAVENOUSCLAW); + DoCast(me->getVictim(), SPELL_RAVENOUSCLAW); //15 seconds until we should cast this again RavenousClaw_Timer = 15000; } else RavenousClaw_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp b/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp index 6b6bbe13cbd..86690e5178a 100644 --- a/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp +++ b/src/scripts/eastern_kingdoms/stratholme/stratholme.cpp @@ -83,7 +83,7 @@ struct mob_freed_soulAI : public ScriptedAI void Reset() { - DoScriptText(RAND(SAY_ZAPPED0,SAY_ZAPPED1,SAY_ZAPPED2,SAY_ZAPPED3), m_creature); + DoScriptText(RAND(SAY_ZAPPED0,SAY_ZAPPED1,SAY_ZAPPED2,SAY_ZAPPED3), me); } void EnterCombat(Unit* who) {} @@ -141,7 +141,7 @@ struct mob_restless_soulAI : public ScriptedAI void JustDied(Unit* Killer) { if (Tagged) - m_creature->SummonCreature(ENTRY_FREED, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); + me->SummonCreature(ENTRY_FREED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 300000); } void UpdateAI(const uint32 diff) @@ -150,10 +150,10 @@ struct mob_restless_soulAI : public ScriptedAI { if (Die_Timer <= diff) { - if (Unit* pTemp = Unit::GetUnit(*m_creature,Tagger)) + if (Unit* pTemp = Unit::GetUnit(*me,Tagger)) { - CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, m_creature->GetGUID()); - m_creature->Kill(m_creature); + CAST_PLR(pTemp)->KilledMonsterCredit(ENTRY_RESTLESS, me->GetGUID()); + me->Kill(me); } } else Die_Timer -= diff; } @@ -214,7 +214,7 @@ struct mobs_spectral_ghostly_citizenAI : public ScriptedAI if (Tagged) { if (Die_Timer <= diff) - m_creature->Kill(m_creature); + me->Kill(me); else Die_Timer -= diff; } @@ -232,19 +232,19 @@ struct mobs_spectral_ghostly_citizenAI : public ScriptedAI EnterEvadeMode(); break; case TEXTEMOTE_RUDE: - if (m_creature->IsWithinDistInMap(pPlayer, 5)) + if (me->IsWithinDistInMap(pPlayer, 5)) DoCast(pPlayer, SPELL_SLAP, false); else - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); + me->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); break; case TEXTEMOTE_WAVE: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; case TEXTEMOTE_BOW: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); + me->HandleEmoteCommand(EMOTE_ONESHOT_BOW); break; case TEXTEMOTE_KISS: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); + me->HandleEmoteCommand(EMOTE_ONESHOT_FLEX); break; } } diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp index 48074a45a3e..22a360f7a88 100644 --- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp +++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp @@ -101,7 +101,7 @@ struct boss_brutallusAI : public ScriptedAI IsIntro = false; Enraged = false; - DoCast(m_creature, SPELL_DUAL_WIELD, true); + DoCast(me, SPELL_DUAL_WIELD, true); if (pInstance) pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); @@ -109,7 +109,7 @@ struct boss_brutallusAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(YELL_AGGRO, m_creature); + DoScriptText(YELL_AGGRO, me); if (pInstance) pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS); @@ -117,19 +117,19 @@ struct boss_brutallusAI : public ScriptedAI void KilledUnit(Unit* victim) { - DoScriptText(RAND(YELL_KILL1,YELL_KILL2,YELL_KILL3), m_creature); + DoScriptText(RAND(YELL_KILL1,YELL_KILL2,YELL_KILL3), me); } void JustDied(Unit* Killer) { - DoScriptText(YELL_DEATH, m_creature); + DoScriptText(YELL_DEATH, me); if (pInstance) { pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE); float x,y,z; - m_creature->GetPosition(x,y,z); - m_creature->SummonCreature(FELMYST, x,y, z+30, m_creature->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); + me->GetPosition(x,y,z); + me->SummonCreature(FELMYST, x,y, z+30, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); } } @@ -144,17 +144,17 @@ struct boss_brutallusAI : public ScriptedAI if (!Intro || IsIntro) return; error_log("Start Intro"); - Creature *Madrigosa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); + Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); if (Madrigosa) { Madrigosa->Respawn(); Madrigosa->setActive(true); IsIntro = true; - Madrigosa->SetMaxHealth(m_creature->GetMaxHealth()); - Madrigosa->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->Attack(Madrigosa, true); - Madrigosa->Attack(m_creature, true); + Madrigosa->SetMaxHealth(me->GetMaxHealth()); + Madrigosa->SetHealth(me->GetMaxHealth()); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->Attack(Madrigosa, true); + Madrigosa->Attack(me, true); }else { //Madrigosa not found, end intro @@ -165,7 +165,7 @@ struct boss_brutallusAI : public ScriptedAI void EndIntro() { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); Intro = false; IsIntro = false; error_log("End Intro"); @@ -180,7 +180,7 @@ struct boss_brutallusAI : public ScriptedAI void DoIntro() { - Creature *Madrigosa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); + Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0); if (!Madrigosa) return; @@ -192,61 +192,61 @@ struct boss_brutallusAI : public ScriptedAI ++IntroPhase; break; case 1: - m_creature->SetInFront(Madrigosa); - Madrigosa->SetInFront(m_creature); - DoScriptText(YELL_MADR_INTRO, Madrigosa, m_creature); + me->SetInFront(Madrigosa); + Madrigosa->SetInFront(me); + DoScriptText(YELL_MADR_INTRO, Madrigosa, me); IntroPhaseTimer = 9000; ++IntroPhase; break; case 2: - DoScriptText(YELL_INTRO, m_creature, Madrigosa); + DoScriptText(YELL_INTRO, me, Madrigosa); IntroPhaseTimer = 13000; ++IntroPhase; break; case 3: - DoCast(m_creature, SPELL_INTRO_FROST_BLAST); + DoCast(me, SPELL_INTRO_FROST_BLAST); Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->AttackStop(); + me->AttackStop(); Madrigosa->AttackStop(); IntroFrostBoltTimer = 3000; IntroPhaseTimer = 28000; ++IntroPhase; break; case 4: - DoScriptText(YELL_INTRO_BREAK_ICE, m_creature); + DoScriptText(YELL_INTRO_BREAK_ICE, me); IntroPhaseTimer = 6000; ++IntroPhase; break; case 5: - Madrigosa->CastSpell(m_creature, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); + Madrigosa->CastSpell(me, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); DoScriptText(YELL_MADR_TRAP, Madrigosa); - DoCast(m_creature, SPELL_INTRO_ENCAPSULATE); + DoCast(me, SPELL_INTRO_ENCAPSULATE); IntroPhaseTimer = 11000; ++IntroPhase; break; case 6: - DoScriptText(YELL_INTRO_CHARGE, m_creature); + DoScriptText(YELL_INTRO_CHARGE, me); IntroPhaseTimer = 5000; ++IntroPhase; break; case 7: - m_creature->Kill(Madrigosa); + me->Kill(Madrigosa); DoScriptText(YELL_MADR_DEATH, Madrigosa); - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->AttackStop(); + me->SetHealth(me->GetMaxHealth()); + me->AttackStop(); IntroPhaseTimer = 4000; ++IntroPhase; break; case 8: - DoScriptText(YELL_INTRO_KILL_MADRIGOSA, m_creature); - m_creature->SetOrientation(0.14f); - m_creature->StopMoving(); + DoScriptText(YELL_INTRO_KILL_MADRIGOSA, me); + me->SetOrientation(0.14f); + me->StopMoving(); Madrigosa->setDeathState(CORPSE); IntroPhaseTimer = 8000; ++IntroPhase; break; case 9: - DoScriptText(YELL_INTRO_TAUNT, m_creature); + DoScriptText(YELL_INTRO_TAUNT, me); IntroPhaseTimer = 5000; ++IntroPhase; break; @@ -258,7 +258,7 @@ struct boss_brutallusAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { - if (!who->isTargetableForAttack() || !m_creature->IsHostileTo(who)) + if (!who->isTargetableForAttack() || !me->IsHostileTo(who)) return; if (pInstance && Intro) pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); @@ -281,9 +281,9 @@ struct boss_brutallusAI : public ScriptedAI { if (IntroFrostBoltTimer <= diff) { - if (Creature *Madrigosa = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0)) + if (Creature *Madrigosa = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_MADRIGOSA) : 0)) { - Madrigosa->CastSpell(m_creature, SPELL_INTRO_FROSTBOLT, true); + Madrigosa->CastSpell(me, SPELL_INTRO_FROSTBOLT, true); IntroFrostBoltTimer = 2000; } } else IntroFrostBoltTimer -= diff; @@ -298,14 +298,14 @@ struct boss_brutallusAI : public ScriptedAI if (SlashTimer <= diff) { - DoCast(m_creature->getVictim(), SPELL_METEOR_SLASH); + DoCast(me->getVictim(), SPELL_METEOR_SLASH); SlashTimer = 11000; } else SlashTimer -= diff; if (StompTimer <= diff) { - DoScriptText(RAND(YELL_LOVE1,YELL_LOVE2,YELL_LOVE3), m_creature); - DoCast(m_creature->getVictim(), SPELL_STOMP); + DoScriptText(RAND(YELL_LOVE1,YELL_LOVE2,YELL_LOVE3), me); + DoCast(me->getVictim(), SPELL_STOMP); StompTimer = 30000; } else StompTimer -= diff; @@ -324,8 +324,8 @@ struct boss_brutallusAI : public ScriptedAI if (BerserkTimer < diff && !Enraged) { - DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature, SPELL_BERSERK); + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_BERSERK); Enraged = true; } else BerserkTimer -= diff; diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp index cbc1d861ec5..7b03d9ae52c 100644 --- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp +++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp @@ -116,7 +116,7 @@ struct boss_sacrolashAI : public ScriptedAI if (pInstance) { - Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); if (Temp) if (Temp->isDead()) { @@ -125,12 +125,12 @@ struct boss_sacrolashAI : public ScriptedAI { if (Temp->getVictim()) { - m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f); + me->getThreatManager().addThreat(Temp->getVictim(),0.0f); } } } - if (!m_creature->isInCombat()) + if (!me->isInCombat()) { ShadowbladesTimer = 10000; ShadownovaTimer = 30000; @@ -152,7 +152,7 @@ struct boss_sacrolashAI : public ScriptedAI if (pInstance) { - Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -164,7 +164,7 @@ struct boss_sacrolashAI : public ScriptedAI void KilledUnit(Unit *victim) { if (rand()%4 == 0) - DoScriptText(RAND(YELL_SAC_KILL_1,YELL_SAC_KILL_2), m_creature); + DoScriptText(RAND(YELL_SAC_KILL_1,YELL_SAC_KILL_2), me); } void JustDied(Unit* Killer) @@ -172,13 +172,13 @@ struct boss_sacrolashAI : public ScriptedAI // only if ALY death if (SisterDeath) { - DoScriptText(SAY_SAC_DEAD, m_creature); + DoScriptText(SAY_SAC_DEAD, me); if (pInstance) pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); } else - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) @@ -231,12 +231,12 @@ struct boss_sacrolashAI : public ScriptedAI if (pInstance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); + Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isDead()) { - DoScriptText(YELL_SISTER_ALYTHESS_DEAD, m_creature); - DoCast(m_creature, SPELL_EMPOWER); - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_SISTER_ALYTHESS_DEAD, me); + DoCast(me, SPELL_EMPOWER); + me->InterruptSpell(CURRENT_GENERIC_SPELL); SisterDeath = true; } } @@ -249,9 +249,9 @@ struct boss_sacrolashAI : public ScriptedAI { if (ConflagrationTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + me->InterruptSpell(CURRENT_GENERIC_SPELL); Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (pTarget) @@ -264,7 +264,7 @@ struct boss_sacrolashAI : public ScriptedAI { if (ShadownovaTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); @@ -274,8 +274,8 @@ struct boss_sacrolashAI : public ScriptedAI if (!SisterDeath) { if (pTarget) - DoScriptText(EMOTE_SHADOW_NOVA, m_creature, pTarget); - DoScriptText(YELL_SHADOW_NOVA, m_creature); + DoScriptText(EMOTE_SHADOW_NOVA, me, pTarget); + DoScriptText(YELL_SHADOW_NOVA, me); } ShadownovaTimer = 30000+(rand()%5000); } @@ -284,7 +284,7 @@ struct boss_sacrolashAI : public ScriptedAI if (ConfoundingblowTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); @@ -313,29 +313,29 @@ struct boss_sacrolashAI : public ScriptedAI if (ShadowbladesTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature, SPELL_SHADOW_BLADES); + DoCast(me, SPELL_SHADOW_BLADES); ShadowbladesTimer = 10000; } } else ShadowbladesTimer -=diff; if (EnrageTimer < diff && !Enraged) { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoScriptText(YELL_ENRAGE, m_creature); - DoCast(m_creature, SPELL_ENRAGE); + me->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_ENRAGE, me); + DoCast(me, SPELL_ENRAGE); Enraged = true; } else EnrageTimer -= diff; - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) { //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (me->IsWithinMeleeRange(me->getVictim())) { - HandleTouchedSpells(m_creature->getVictim(), SPELL_DARK_TOUCHED); - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); + HandleTouchedSpells(me->getVictim(), SPELL_DARK_TOUCHED); + me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); } } } @@ -375,7 +375,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI if (pInstance) { - Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); if (Temp) if (Temp->isDead()) { @@ -384,12 +384,12 @@ struct boss_alythessAI : public Scripted_NoMovementAI { if (Temp->getVictim()) { - m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f); + me->getThreatManager().addThreat(Temp->getVictim(),0.0f); } } } - if (!m_creature->isInCombat()) + if (!me->isInCombat()) { ConflagrationTimer = 45000; BlazeTimer = 100; @@ -412,7 +412,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI if (pInstance) { - Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + Unit* Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) CAST_CRE(Temp)->AI()->AttackStart(who); } @@ -423,7 +423,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI void AttackStart(Unit *who) { - if (!m_creature->isInCombat()) + if (!me->isInCombat()) { Scripted_NoMovementAI::AttackStart(who); } @@ -431,22 +431,22 @@ struct boss_alythessAI : public Scripted_NoMovementAI void MoveInLineOfSight(Unit *who) { - if (!who || m_creature->getVictim()) + if (!who || me->getVictim()) return; - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who)) { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && me->IsWithinLOSInMap(who)) { - if (!m_creature->isInCombat()) + if (!me->isInCombat()) { DoStartNoMovement(who); } } } - else if (IntroStepCounter == 10 && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 30)) + else if (IntroStepCounter == 10 && me->IsWithinLOSInMap(who)&& me->IsWithinDistInMap(who, 30)) { IntroStepCounter = 0; } @@ -456,7 +456,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI { if (rand()%4 == 0) { - DoScriptText(RAND(YELL_ALY_KILL_1,YELL_ALY_KILL_2), m_creature); + DoScriptText(RAND(YELL_ALY_KILL_1,YELL_ALY_KILL_2), me); } } @@ -464,13 +464,13 @@ struct boss_alythessAI : public Scripted_NoMovementAI { if (SisterDeath) { - DoScriptText(YELL_ALY_DEAD, m_creature); + DoScriptText(YELL_ALY_DEAD, me); if (pInstance) pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); } else - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); } void SpellHitTarget(Unit *pTarget,const SpellEntry* spell) @@ -522,7 +522,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI uint32 IntroStep(uint32 step) { - Creature* Sacrolash = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0); + Creature* Sacrolash = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_SACROLASH) : 0); switch (step) { case 0: return 0; @@ -530,22 +530,22 @@ struct boss_alythessAI : public Scripted_NoMovementAI if (Sacrolash) DoScriptText(YELL_INTRO_SAC_1, Sacrolash); return 1000; - case 2: DoScriptText(YELL_INTRO_ALY_2, m_creature); return 1000; + case 2: DoScriptText(YELL_INTRO_ALY_2, me); return 1000; case 3: if (Sacrolash) DoScriptText(YELL_INTRO_SAC_3, Sacrolash); return 2000; - case 4: DoScriptText(YELL_INTRO_ALY_4, m_creature); return 1000; + case 4: DoScriptText(YELL_INTRO_ALY_4, me); return 1000; case 5: if (Sacrolash) DoScriptText(YELL_INTRO_SAC_5, Sacrolash); return 2000; - case 6: DoScriptText(YELL_INTRO_ALY_6, m_creature); return 1000; + case 6: DoScriptText(YELL_INTRO_ALY_6, me); return 1000; case 7: if (Sacrolash) DoScriptText(YELL_INTRO_SAC_7, Sacrolash); return 3000; - case 8: DoScriptText(YELL_INTRO_ALY_8, m_creature); return 900000; + case 8: DoScriptText(YELL_INTRO_ALY_8, me); return 900000; } return 10000; } @@ -565,26 +565,26 @@ struct boss_alythessAI : public Scripted_NoMovementAI if (pInstance) { Unit* Temp = NULL; - Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + Temp = Unit::GetUnit((*me),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isDead()) { - DoScriptText(YELL_SISTER_SACROLASH_DEAD, m_creature); - DoCast(m_creature, SPELL_EMPOWER); - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_SISTER_SACROLASH_DEAD, me); + DoCast(me, SPELL_EMPOWER); + me->InterruptSpell(CURRENT_GENERIC_SPELL); SisterDeath = true; } } } - if (!m_creature->getVictim()) + if (!me->getVictim()) { if (pInstance) { - Creature* sisiter = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + Creature* sisiter = Unit::GetCreature((*me),pInstance->GetData64(DATA_SACROLASH)); if (sisiter && !sisiter->isDead() && sisiter->getVictim()) { - m_creature->AddThreat(sisiter->getVictim(),0.0f); + me->AddThreat(sisiter->getVictim(),0.0f); DoStartNoMovement(sisiter->getVictim()); - m_creature->Attack(sisiter->getVictim(),false); + me->Attack(sisiter->getVictim(),false); } } } @@ -596,7 +596,7 @@ struct boss_alythessAI : public Scripted_NoMovementAI { if (ShadownovaTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); @@ -610,9 +610,9 @@ struct boss_alythessAI : public Scripted_NoMovementAI { if (ConflagrationTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + me->InterruptSpell(CURRENT_GENERIC_SPELL); Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (pTarget) @@ -622,8 +622,8 @@ struct boss_alythessAI : public Scripted_NoMovementAI if (!SisterDeath) { if (pTarget) - DoScriptText(EMOTE_CONFLAGRATION, m_creature, pTarget); - DoScriptText(YELL_CANFLAGRATION, m_creature); + DoScriptText(EMOTE_CONFLAGRATION, me, pTarget); + DoScriptText(YELL_CANFLAGRATION, me); } BlazeTimer = 4000; @@ -633,36 +633,36 @@ struct boss_alythessAI : public Scripted_NoMovementAI if (FlamesearTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature, SPELL_FLAME_SEAR); + DoCast(me, SPELL_FLAME_SEAR); FlamesearTimer = 15000; } } else FlamesearTimer -=diff; if (PyrogenicsTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature, SPELL_PYROGENICS, true); + DoCast(me, SPELL_PYROGENICS, true); PyrogenicsTimer = 15000; } } else PyrogenicsTimer -= diff; if (BlazeTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature->getVictim(), SPELL_BLAZE); + DoCast(me->getVictim(), SPELL_BLAZE); BlazeTimer = 3800; } } else BlazeTimer -= diff; if (EnrageTimer < diff && !Enraged) { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature, SPELL_ENRAGE); + me->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_ENRAGE); Enraged = true; } else EnrageTimer -= diff; } @@ -683,7 +683,7 @@ struct mob_shadow_imageAI : public ScriptedAI void Reset() { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); ShadowfuryTimer = 5000 + (rand()%15000); DarkstrikeTimer = 3000; KillTimer = 15000; @@ -712,12 +712,12 @@ struct mob_shadow_imageAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if (!m_creature->HasAura(SPELL_IMAGE_VISUAL)) - DoCast(m_creature, SPELL_IMAGE_VISUAL); + if (!me->HasAura(SPELL_IMAGE_VISUAL)) + DoCast(me, SPELL_IMAGE_VISUAL); if (KillTimer <= diff) { - m_creature->Kill(m_creature); + me->Kill(me); KillTimer = 9999999; } else KillTimer -= diff; @@ -726,17 +726,17 @@ struct mob_shadow_imageAI : public ScriptedAI if (ShadowfuryTimer <= diff) { - DoCast(m_creature, SPELL_SHADOW_FURY); + DoCast(me, SPELL_SHADOW_FURY); ShadowfuryTimer = 10000; } else ShadowfuryTimer -=diff; if (DarkstrikeTimer <= diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - DoCast(m_creature->getVictim(), SPELL_DARK_STRIKE); + if (me->IsWithinMeleeRange(me->getVictim())) + DoCast(me->getVictim(), SPELL_DARK_STRIKE); } DarkstrikeTimer = 3000; } else DarkstrikeTimer -= diff; diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp index 26bdb7984c0..ed06964aef2 100644 --- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp +++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp @@ -159,12 +159,12 @@ struct boss_felmystAI : public ScriptedAI Timer[EVENT_BERSERK] = 600000; FlightCount = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + me->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); DespawnSummons(MOB_VAPOR_TRAIL); - m_creature->setActive(false); + me->setActive(false); if (pInstance) pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); @@ -172,10 +172,10 @@ struct boss_felmystAI : public ScriptedAI void EnterCombat(Unit *who) { - m_creature->setActive(true); + me->setActive(true); DoZoneInCombat(); - DoCast(m_creature, AURA_SUNWELL_RADIANCE, true); - DoCast(m_creature, AURA_NOXIOUS_FUMES, true); + DoCast(me, AURA_SUNWELL_RADIANCE, true); + DoCast(me, AURA_NOXIOUS_FUMES, true); EnterPhase(PHASE_GROUND); if (pInstance) @@ -196,17 +196,17 @@ struct boss_felmystAI : public ScriptedAI void KilledUnit(Unit* victim) { - DoScriptText(RAND(YELL_KILL1,YELL_KILL2), m_creature); + DoScriptText(RAND(YELL_KILL1,YELL_KILL2), me); } void JustRespawned() { - DoScriptText(YELL_BIRTH, m_creature); + DoScriptText(YELL_BIRTH, me); } void JustDied(Unit* Killer) { - DoScriptText(YELL_DEATH, m_creature); + DoScriptText(YELL_DEATH, me); if (pInstance) pInstance->SetData(DATA_FELMYST_EVENT, DONE); @@ -224,14 +224,14 @@ struct boss_felmystAI : public ScriptedAI { float x, y, z; caster->GetPosition(x, y, z); - if (Unit* summon = m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + if (Unit* summon = me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) { summon->SetMaxHealth(caster->GetMaxHealth()); summon->SetHealth(caster->GetMaxHealth()); summon->CastSpell(summon, SPELL_FOG_CHARM, true); summon->CastSpell(summon, SPELL_FOG_CHARM2, true); } - m_creature->DealDamage(caster, caster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + me->DealDamage(caster, caster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } } @@ -252,7 +252,7 @@ struct boss_felmystAI : public ScriptedAI void DamageTaken(Unit*, uint32 &damage) { - if (Phase != PHASE_GROUND && damage >= m_creature->GetHealth()) + if (Phase != PHASE_GROUND && damage >= me->GetHealth()) damage = 0; } @@ -285,32 +285,32 @@ struct boss_felmystAI : public ScriptedAI switch(FlightCount) { case 0: - //m_creature->AttackStop(); + //me->AttackStop(); error_log("prevent fly phase"); - m_creature->GetMotionMaster()->Clear(false); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - DoScriptText(YELL_TAKEOFF, m_creature); + me->GetMotionMaster()->Clear(false); + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->StopMoving(); + DoScriptText(YELL_TAKEOFF, me); Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 1: error_log("Move to Fly point"); - m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10); + me->GetMotionMaster()->MovePoint(0, me->GetPositionX()+1, me->GetPositionY(), me->GetPositionZ()+10); Timer[EVENT_FLIGHT_SEQUENCE] = 0; break; case 2:{ error_log("Summon Vapor case 2"); Unit *pTarget; pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!pTarget) pTarget = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + if (!pTarget) pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); if (pTarget) { - Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); if (Vapor) { Vapor->AI()->AttackStart(pTarget); - m_creature->InterruptNonMeleeSpells(false); + me->InterruptNonMeleeSpells(false); DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); } @@ -325,18 +325,18 @@ struct boss_felmystAI : public ScriptedAI case 3: { DespawnSummons(MOB_VAPOR_TRAIL); error_log("Summon Vapor case3"); - //DoCast(m_creature, SPELL_VAPOR_SELECT); need core support + //DoCast(me, SPELL_VAPOR_SELECT); need core support Unit *pTarget; pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!pTarget) pTarget = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + if (!pTarget) pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); if (pTarget) { //pTarget->CastSpell(pTarget, SPELL_VAPOR_SUMMON, true); need core support - Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + Creature* Vapor = me->SummonCreature(MOB_VAPOR, pTarget->GetPositionX()-5+rand()%10, pTarget->GetPositionY()-5+rand()%10, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); if (Vapor) { Vapor->AI()->AttackStart(pTarget); - m_creature->InterruptNonMeleeSpells(false); + me->InterruptNonMeleeSpells(false); DoCast(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); } @@ -355,14 +355,14 @@ struct boss_felmystAI : public ScriptedAI case 5:{ Unit *pTarget; pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!pTarget) pTarget = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + if (!pTarget) pTarget = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); if (pTarget) { BreathX = pTarget->GetPositionX(); BreathY = pTarget->GetPositionY(); float x, y, z; - pTarget->GetContactPoint(m_creature, x, y, z, 70); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10); + pTarget->GetContactPoint(me, x, y, z, 70); + me->GetMotionMaster()->MovePoint(0, x, y, z+10); }else { EnterEvadeMode(); @@ -371,25 +371,25 @@ struct boss_felmystAI : public ScriptedAI Timer[EVENT_FLIGHT_SEQUENCE] = 0; break;} case 6: - m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY)); - m_creature->StopMoving(); + me->SetOrientation(me->GetAngle(BreathX, BreathY)); + me->StopMoving(); //DoTextEmote("takes a deep breath.", NULL); Timer[EVENT_FLIGHT_SEQUENCE] = 10000; break; case 7: - DoCast(m_creature, SPELL_FOG_BREATH, true); + DoCast(me, SPELL_FOG_BREATH, true); { float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); x = 2 * BreathX - x; y = 2 * BreathY - y; - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + me->GetMotionMaster()->MovePoint(0, x, y, z); } Timer[EVENT_SUMMON_FOG] = 1; Timer[EVENT_FLIGHT_SEQUENCE] = 0; break; case 8: - m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH); + me->RemoveAurasDueToSpell(SPELL_FOG_BREATH); ++BreathCount; Timer[EVENT_SUMMON_FOG] = 0; Timer[EVENT_FLIGHT_SEQUENCE] = 1; @@ -399,8 +399,8 @@ struct boss_felmystAI : public ScriptedAI if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO, 0)) { float x, y, z; - pTarget->GetContactPoint(m_creature, x, y, z); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + pTarget->GetContactPoint(me, x, y, z); + me->GetMotionMaster()->MovePoint(0, x, y, z); } else { @@ -410,11 +410,11 @@ struct boss_felmystAI : public ScriptedAI Timer[EVENT_FLIGHT_SEQUENCE] = 0; break; case 10: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->StopMoving(); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); EnterPhase(PHASE_GROUND); - m_creature->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); + me->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); break; default: break; @@ -426,7 +426,7 @@ struct boss_felmystAI : public ScriptedAI { if (!UpdateVictim()) { - if (Phase == PHASE_FLIGHT && !m_creature->IsInEvadeMode()) + if (Phase == PHASE_FLIGHT && !me->IsInEvadeMode()) EnterEvadeMode(); return; } @@ -442,7 +442,7 @@ struct boss_felmystAI : public ScriptedAI } else Timer[i] -= diff; } - if (m_creature->IsNonMeleeSpellCasted(false)) + if (me->IsNonMeleeSpellCasted(false)) return; if (Phase == PHASE_GROUND) @@ -450,20 +450,20 @@ struct boss_felmystAI : public ScriptedAI switch(Event) { case EVENT_BERSERK: - DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature, SPELL_BERSERK, true); + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_BERSERK, true); Timer[EVENT_BERSERK] = 10000; break; case EVENT_CLEAVE: - DoCast(m_creature->getVictim(), SPELL_CLEAVE, false); + DoCast(me->getVictim(), SPELL_CLEAVE, false); Timer[EVENT_CLEAVE] = urand(5000,10000); break; case EVENT_CORROSION: - DoCast(m_creature->getVictim(), SPELL_CORROSION, false); + DoCast(me->getVictim(), SPELL_CORROSION, false); Timer[EVENT_CORROSION] = urand(20000,30000); break; case EVENT_GAS_NOVA: - DoCast(m_creature, SPELL_GAS_NOVA, false); + DoCast(me, SPELL_GAS_NOVA, false); Timer[EVENT_GAS_NOVA] = urand(20000,25000); break; case EVENT_ENCAPSULATE: @@ -487,8 +487,8 @@ struct boss_felmystAI : public ScriptedAI switch(Event) { case EVENT_BERSERK: - DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature, SPELL_BERSERK, true); + DoScriptText(YELL_BERSERK, me); + DoCast(me, SPELL_BERSERK, true); Timer[EVENT_BERSERK] = 0; break; case EVENT_FLIGHT_SEQUENCE: @@ -497,9 +497,9 @@ struct boss_felmystAI : public ScriptedAI case EVENT_SUMMON_FOG: { float x, y, z; - m_creature->GetPosition(x, y, z); - m_creature->UpdateGroundPositionZ(x, y, z); - if (Creature *Fog = m_creature->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) + me->GetPosition(x, y, z); + me->UpdateGroundPositionZ(x, y, z); + if (Creature *Fog = me->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) { Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER); Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true); @@ -517,7 +517,7 @@ struct boss_felmystAI : public ScriptedAI { std::list<Creature*> templist; float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); { CellPair pair(Trinity::ComputeCellPair(x, y)); @@ -525,12 +525,12 @@ struct boss_felmystAI : public ScriptedAI cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); + Trinity::AllCreaturesOfEntryInRange check(me, entry, 100); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(m_creature->GetMap())); + cell.Visit(pair, cSearcher, *(me->GetMap())); } for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i) @@ -538,7 +538,7 @@ struct boss_felmystAI : public ScriptedAI if (entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT) { (*i)->GetPosition(x, y, z); - m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + me->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); } (*i)->SetVisibility(VISIBILITY_OFF); (*i)->setDeathState(JUST_DIED); @@ -552,18 +552,18 @@ struct mob_felmyst_vaporAI : public ScriptedAI { mob_felmyst_vaporAI(Creature *c) : ScriptedAI(c) { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetSpeed(MOVE_RUN, 0.8); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetSpeed(MOVE_RUN, 0.8); } void Reset() {} void EnterCombat(Unit* who) { DoZoneInCombat(); - //DoCast(m_creature, SPELL_VAPOR_FORCE, true); core bug + //DoCast(me, SPELL_VAPOR_FORCE, true); core bug } void UpdateAI(const uint32 diff) { - if (!m_creature->getVictim()) + if (!me->getVictim()) if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) AttackStart(pTarget); } @@ -573,10 +573,10 @@ struct mob_felmyst_trailAI : public ScriptedAI { mob_felmyst_trailAI(Creature *c) : ScriptedAI(c) { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(m_creature, SPELL_TRAIL_TRIGGER, true); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_TRAIL_TRIGGER, true); + me->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID()); + me->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 0.01); // core bug } void Reset() {} void EnterCombat(Unit* who) {} diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp index f1906ce3bbf..f30cb749c37 100644 --- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp +++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp @@ -179,8 +179,8 @@ struct boss_kalecgosAI : public ScriptedAI void EnterEvadeMode() { JustReseted = true; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); ScriptedAI::EnterEvadeMode(); } @@ -327,10 +327,10 @@ struct boss_kalecgosAI : public ScriptedAI { if (JustReseted)//boss is invisible, don't attack return; - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who))) + if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who))) { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius)) + float attackRadius = me->GetAttackDistance(who); + if (me->IsWithinDistInMap(who, attackRadius)) { AttackStart(who); } @@ -616,7 +616,7 @@ struct boss_sathrovarrAI : public ScriptedAI { for (std::list<HostileReference*>::const_iterator itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) { - if (Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) + if (Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid())) { if (pUnit->GetPositionZ() > me->GetPositionZ()+5) { diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp index c2fcce96cdc..784a549d031 100644 --- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp +++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp @@ -320,9 +320,9 @@ struct boss_kalecgos_kjAI : public ScriptedAI FindOrbs(); OrbsEmpowered = 0; EmpowerCount = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setActive(true); + me->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT | MOVEMENTFLAG_LEVITATING); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->setActive(true); Searched = false; FindOrbs(); @@ -333,7 +333,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI void FindOrbs() { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + CellPair pair(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY())); Cell cell(pair); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); @@ -341,7 +341,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI AllOrbsInGrid check; Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(me, orbList, check); TypeContainerVisitor<Trinity::GameObjectListSearcher<AllOrbsInGrid>, GridTypeMapContainer> visitor(searcher); - cell.Visit(pair, visitor, *(m_creature->GetMap())); + cell.Visit(pair, visitor, *(me->GetMap())); if (orbList.empty()) return; @@ -354,9 +354,9 @@ struct boss_kalecgos_kjAI : public ScriptedAI void ResetOrbs() { - m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); for (uint8 i = 0; i < 4; ++i) - if (GameObject *pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[i])) + if (GameObject *pOrb = me->GetMap()->GetGameObject(OrbGUID[i])) pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 0); } @@ -368,14 +368,14 @@ struct boss_kalecgos_kjAI : public ScriptedAI uint8 random = urand(0,3); if (all) { - m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + me->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); for (uint8 i = 0; i < 4; ++i) { - GameObject *pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[i]); + GameObject *pOrb = me->GetMap()->GetGameObject(OrbGUID[i]); if (!pOrb) return; - pOrb->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES); + pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35); pOrb->setActive(true); pOrb->Refresh(); @@ -388,7 +388,7 @@ struct boss_kalecgos_kjAI : public ScriptedAI float x,y,z, dx,dy,dz; Orb[random]->GetPosition(x,y,z); for (uint8 i = 0; i < 4; ++i){ - DynamicObject* Dyn = m_creature->GetDynObject(SPELL_RING_OF_BLUE_FLAMES); + DynamicObject* Dyn = me->GetDynObject(SPELL_RING_OF_BLUE_FLAMES); if (Dyn){ Dyn->GetPosition(dx,dy,dz); if (x == dx && dy == y && dz == z){ @@ -399,9 +399,9 @@ struct boss_kalecgos_kjAI : public ScriptedAI }*/ if (OrbGUID[random]) { - if (GameObject* pOrb = m_creature->GetMap()->GetGameObject(OrbGUID[random])) + if (GameObject* pOrb = me->GetMap()->GetGameObject(OrbGUID[random])) { - pOrb->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES); + pOrb->CastSpell(me, SPELL_RING_OF_BLUE_FLAMES); pOrb->SetUInt32Value(GAMEOBJECT_FACTION, 35); pOrb->setActive(true); pOrb->Refresh(); @@ -413,10 +413,10 @@ struct boss_kalecgos_kjAI : public ScriptedAI switch(EmpowerCount) { - case 1: DoScriptText(SAY_KALEC_ORB_READY1, m_creature); break; - case 2: DoScriptText(SAY_KALEC_ORB_READY2, m_creature); break; - case 3: DoScriptText(SAY_KALEC_ORB_READY3, m_creature); break; - case 4: DoScriptText(SAY_KALEC_ORB_READY4, m_creature); break; + case 1: DoScriptText(SAY_KALEC_ORB_READY1, me); break; + case 2: DoScriptText(SAY_KALEC_ORB_READY2, me); break; + case 3: DoScriptText(SAY_KALEC_ORB_READY3, me); break; + case 4: DoScriptText(SAY_KALEC_ORB_READY4, me); break; } } @@ -441,7 +441,7 @@ CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature) //AI for Kil'jaeden struct boss_kiljaedenAI : public Scripted_NoMovementAI { - boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature) + boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) { pInstance = c->GetInstanceData(); } @@ -522,15 +522,15 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); }else{ - summoned->SetLevel(m_creature->getLevel()); + summoned->SetLevel(me->getLevel()); } - summoned->setFaction(m_creature->getFaction()); + summoned->setFaction(me->getFaction()); Summons.Summon(summoned); } void JustDied(Unit* killer) { - DoScriptText(SAY_KJ_DEATH, m_creature); + DoScriptText(SAY_KJ_DEATH, me); if (pInstance) pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE); @@ -538,7 +538,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI void KilledUnit(Unit* victim) { - DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), m_creature); + DoScriptText(RAND(SAY_KJ_SLAY1,SAY_KJ_SLAY2), me); } void EnterEvadeMode() @@ -548,20 +548,20 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI // Reset the controller if (pInstance) - if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))) + if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))) CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset(); } void EnterCombat(Unit* who) { DoZoneInCombat(); - DoScriptText(SAY_KJ_EMERGE, m_creature); + DoScriptText(SAY_KJ_EMERGE, me); } void CastSinisterReflection() { - DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), m_creature); - DoCast(m_creature, SPELL_SINISTER_REFLECTION, true); + DoScriptText(RAND(SAY_KJ_REFLECTION1,SAY_KJ_REFLECTION2), me); + DoCast(me, SPELL_SINISTER_REFLECTION, true); for (uint8 i = 0; i < 4; ++i) { float x,y,z; @@ -572,7 +572,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI if (!pTarget->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0))break; } pTarget->GetPosition(x,y,z); - Creature* SinisterReflection = m_creature->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0); + Creature* SinisterReflection = me->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0); if (SinisterReflection) SinisterReflection->AI()->AttackStart(pTarget); } @@ -599,7 +599,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI switch(t) { case TIMER_KALEC_JOIN: - if (Creature *pKalec = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0)) + if (Creature *pKalec = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0)) { DoScriptText(SAY_KALECGOS_JOIN, pKalec); IsKalecJoined = true; @@ -607,18 +607,18 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI } break; case TIMER_SOUL_FLAY: - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature->getVictim(), SPELL_SOUL_FLAY, false); - m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY_SLOW, true); + DoCast(me->getVictim(), SPELL_SOUL_FLAY, false); + me->getVictim()->CastSpell(me->getVictim(), SPELL_SOUL_FLAY_SLOW, true); Timer[TIMER_SOUL_FLAY] = 3500; } break; case TIMER_LEGION_LIGHTNING: - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { Unit *RandomPlayer; - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); + me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); for (uint8 z = 0; z < 6; ++z) { RandomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); @@ -633,9 +633,9 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI } break; case TIMER_FIRE_BLOOM: - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); + me->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); DoCastAOE(SPELL_FIRE_BLOOM, false); Timer[TIMER_FIRE_BLOOM] = (Phase == PHASE_SACRIFICE) ? 25000 : 40000; // 25 seconds in PHASE_SACRIFICE Timer[TIMER_SOUL_FLAY] = 1000; @@ -647,13 +647,13 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI float sx, sy; sx = ShieldOrbLocations[0][0] + sin(ShieldOrbLocations[i][0]); sy = ShieldOrbLocations[0][1] + sin(ShieldOrbLocations[i][1]); - m_creature->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + me->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); } Timer[TIMER_SUMMON_SHILEDORB] = urand(30000,60000); // 30-60seconds cooldown Timer[TIMER_SOUL_FLAY] = 2000; break; case TIMER_SHADOW_SPIKE: //Phase 3 - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { DoCastAOE(SPELL_SHADOW_SPIKE, false); Timer[TIMER_SHADOW_SPIKE] = 0; @@ -666,12 +666,12 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI Timer[TIMER_FLAME_DART] = 3000; //TODO Timer break; case TIMER_DARKNESS: //Phase 3 - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members. if (!IsInDarkness) { - DoScriptText(EMOTE_KJ_DARKNESS, m_creature); + DoScriptText(EMOTE_KJ_DARKNESS, me); DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false); ChangeTimers(true, 9000); Timer[TIMER_DARKNESS] = 8750; @@ -685,13 +685,13 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? urand(20000,35000) : urand(40000,70000); IsInDarkness = false; DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE); - DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), m_creature); + DoScriptText(RAND(SAY_KJ_DARKNESS1,SAY_KJ_DARKNESS2,SAY_KJ_DARKNESS3), me); } Timer[TIMER_SOUL_FLAY] = 9000; } break; case TIMER_ORBS_EMPOWER: //Phase 3 - if (Creature *pKalec = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0)) + if (Creature *pKalec = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0)) { switch (Phase) { @@ -718,7 +718,7 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI { float x, y, z; pTarget->GetPosition(x, y, z); - m_creature->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000); + me->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000); } Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding break; @@ -737,10 +737,10 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI //Phase 3 if (Phase <= PHASE_NORMAL) { - if (Phase == PHASE_NORMAL && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 85)) + if (Phase == PHASE_NORMAL && ((me->GetHealth()*100 / me->GetMaxHealth()) < 85)) { CastSinisterReflection(); - DoScriptText(SAY_KJ_PHASE3, m_creature); + DoScriptText(SAY_KJ_PHASE3, me); Phase = PHASE_DARKNESS; OrbActivated = false; ActiveTimers = 9; @@ -751,9 +751,9 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI //Phase 4 if (Phase <= PHASE_DARKNESS) { - if (Phase == PHASE_DARKNESS && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55)) + if (Phase == PHASE_DARKNESS && ((me->GetHealth()*100 / me->GetMaxHealth()) < 55)) { - DoScriptText(SAY_KJ_PHASE4, m_creature); + DoScriptText(SAY_KJ_PHASE4, me); Phase = PHASE_ARMAGEDDON; OrbActivated = false; ActiveTimers = 10; @@ -764,12 +764,12 @@ struct boss_kiljaedenAI : public Scripted_NoMovementAI //Phase 5 specific spells all we can if (Phase <= PHASE_ARMAGEDDON) { - if (Phase == PHASE_ARMAGEDDON && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)) + if (Phase == PHASE_ARMAGEDDON && ((me->GetHealth()*100 / me->GetMaxHealth()) < 25)) { Phase = PHASE_SACRIFICE; if (pInstance) - if (Creature* Anveena = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ANVEENA))) - Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false); + if (Creature* Anveena = Unit::GetCreature(*me, pInstance->GetData64(DATA_ANVEENA))) + Anveena->CastSpell(me, SPELL_SACRIFICE_OF_ANVEENA, false); OrbActivated = false; ChangeTimers(true, 10000); // He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script } @@ -787,7 +787,7 @@ CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature) //AI for Kil'jaeden Event Controller struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI { - mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature) + mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(me) { pInstance = c->GetInstanceData(); } @@ -804,9 +804,9 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI void InitializeAI() { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->addUnitState(UNIT_STAT_STUNNED); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->addUnitState(UNIT_STAT_STUNNED); ScriptedAI::InitializeAI(); } @@ -814,7 +814,7 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI void Reset() { Phase = PHASE_DECEIVERS; - if (Creature *pKalecKJ = Unit::GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0)) + if (Creature *pKalecKJ = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_KALECGOS_KJ) : 0)) CAST_AI(boss_kalecgos_kjAI, pKalecKJ->AI())->ResetOrbs(); DeceiverDeathCount = 0; SummonedDeceivers = false; @@ -838,7 +838,7 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI case CREATURE_KILJAEDEN: summoned->CastSpell(summoned, SPELL_REBIRTH, false); CAST_AI(boss_kiljaedenAI, summoned->AI())->Phase=PHASE_NORMAL; - summoned->AddThreat(m_creature->getVictim(), 1.0f); + summoned->AddThreat(me->getVictim(), 1.0f); break; } Summons.Summon(summoned); @@ -848,23 +848,23 @@ struct mob_kiljaeden_controllerAI : public Scripted_NoMovementAI { if (RandomSayTimer < diff && pInstance && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED) { - DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), m_creature); + DoScriptText(RAND(SAY_KJ_OFFCOMBAT1,SAY_KJ_OFFCOMBAT2,SAY_KJ_OFFCOMBAT3,SAY_KJ_OFFCOMBAT4,SAY_KJ_OFFCOMBAT5), me); RandomSayTimer = 30000; } else RandomSayTimer -= diff; if (!SummonedDeceivers) { for (uint8 i = 0; i < 3; ++i) - m_creature->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0); + me->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0); DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - DoCast(m_creature, SPELL_ANVEENA_ENERGY_DRAIN); + DoCast(me, SPELL_ANVEENA_ENERGY_DRAIN); SummonedDeceivers = true; } if (DeceiverDeathCount > 2 && Phase == PHASE_DECEIVERS) { - m_creature->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN); + me->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN); Phase = PHASE_NORMAL; DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0); } @@ -899,8 +899,8 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI void JustSummoned(Creature* summoned) { - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); + summoned->setFaction(me->getFaction()); + summoned->SetLevel(me->getLevel()); } void EnterCombat(Unit* who) @@ -908,10 +908,10 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI if (pInstance) { pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS); - if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))) + if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))) Control->AddThreat(who, 1.0f); } - m_creature->InterruptNonMeleeSpells(true); + me->InterruptNonMeleeSpells(true); } void JustDied(Unit* killer) @@ -919,25 +919,25 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI if (!pInstance) return; - if (Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))) + if (Creature* Control = CAST_CRE(Unit::GetUnit(*me, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)))) ++(CAST_AI(mob_kiljaeden_controllerAI, Control->AI())->DeceiverDeathCount); } void UpdateAI(const uint32 diff) { if (!me->isInCombat()) - DoCast(m_creature, SPELL_SHADOW_CHANNELING); + DoCast(me, SPELL_SHADOW_CHANNELING); if (!UpdateVictim()) return; // Gain Shadow Infusion at 20% health - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !m_creature->HasAura(SPELL_SHADOW_INFUSION, 0)) - DoCast(m_creature, SPELL_SHADOW_INFUSION, true); + if (((me->GetHealth()*100 / me->GetMaxHealth()) < 20) && !me->HasAura(SPELL_SHADOW_INFUSION, 0)) + DoCast(me, SPELL_SHADOW_INFUSION, true); // Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage. if (ShadowBoltVolleyTimer <= diff){ - DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); + DoCast(me->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); ShadowBoltVolleyTimer = 12000; } else ShadowBoltVolleyTimer -= diff; @@ -947,9 +947,9 @@ struct mob_hand_of_the_deceiverAI : public ScriptedAI if (Portal) { std::list<HostileReference*>::const_iterator itr; - for (itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) + for (itr = me->getThreatManager().getThreatList().begin(); itr != me->getThreatManager().getThreatList().end(); ++itr) { - Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + Unit* pUnit = Unit::GetUnit(*me, (*itr)->getUnitGuid()); if (pUnit) Portal->AddThreat(pUnit, 1.0f); } @@ -976,8 +976,8 @@ struct mob_felfire_portalAI : public Scripted_NoMovementAI void InitializeAI() { SpawnFiendTimer = 5000; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); ScriptedAI::InitializeAI(); } @@ -987,8 +987,8 @@ struct mob_felfire_portalAI : public Scripted_NoMovementAI void JustSummoned(Creature* summoned) { - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); + summoned->setFaction(me->getFaction()); + summoned->SetLevel(me->getLevel()); } void UpdateAI(const uint32 diff) @@ -1028,8 +1028,8 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI void DamageTaken(Unit *done_by, uint32 &damage) { - if (damage > m_creature->GetHealth()) - DoCast(m_creature, SPELL_FELFIRE_FISSION, true); + if (damage > me->GetHealth()) + DoCast(me, SPELL_FELFIRE_FISSION, true); } void UpdateAI(const uint32 diff) @@ -1039,7 +1039,7 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI if (!LockedTarget) { - m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); + me->AddThreat(me->getVictim(), 10000000.0f); LockedTarget = true; } @@ -1049,10 +1049,10 @@ struct mob_volatile_felfire_fiendAI : public ScriptedAI ExplodeTimer = 0; else ExplodeTimer -= diff; } - else if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) // Explode if it's close enough to it's target + else if (me->IsWithinDistInMap(me->getVictim(), 3)) // Explode if it's close enough to it's target { - DoCast(m_creature->getVictim(), SPELL_FELFIRE_FISSION); - m_creature->Kill(m_creature); + DoCast(me->getVictim(), SPELL_FELFIRE_FISSION); + me->Kill(me); } } }; @@ -1083,22 +1083,22 @@ struct mob_armageddonAI : public Scripted_NoMovementAI switch(Spell) { case 0: - DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL, true); + DoCast(me, SPELL_ARMAGEDDON_VISUAL, true); ++Spell; break; case 1: - DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL2, true); + DoCast(me, SPELL_ARMAGEDDON_VISUAL2, true); Timer = 9000; ++Spell; break; case 2: - DoCast(m_creature, SPELL_ARMAGEDDON_TRIGGER, true); + DoCast(me, SPELL_ARMAGEDDON_TRIGGER, true); ++Spell; Timer = 5000; break; case 3: - m_creature->Kill(m_creature); - m_creature->RemoveCorpse(); + me->Kill(me); + me->RemoveCorpse(); break; } } else Timer -=diff; @@ -1127,7 +1127,7 @@ struct mob_shield_orbAI : public ScriptedAI void InitializeAI() { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); PointReached = true; Timer = urand(500,1000); CheckTimer = 1000; @@ -1158,7 +1158,7 @@ struct mob_shield_orbAI : public ScriptedAI } PointReached = false; CheckTimer = 1000; - m_creature->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z); + me->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z); c += M_PI/32; if (c > 2*M_PI) c = 0; } @@ -1174,7 +1174,7 @@ struct mob_shield_orbAI : public ScriptedAI if (Timer <= diff) { - if (Unit* random = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0)) + if (Unit* random = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0)) DoCast(random, SPELL_SHADOW_BOLT, false); Timer = urand(500,1000); } else Timer -= diff; @@ -1215,7 +1215,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI if (Class == 0) { - Class = m_creature->getVictim()->getClass(); + Class = me->getVictim()->getClass(); switch (Class) { case CLASS_DRUID: @@ -1227,17 +1227,17 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_WARLOCK: break; case CLASS_WARRIOR: - m_creature->SetCanDualWield(true); + me->SetCanDualWield(true); break; case CLASS_PALADIN: break; case CLASS_PRIEST: break; case CLASS_SHAMAN: - m_creature->SetCanDualWield(true); + me->SetCanDualWield(true); break; case CLASS_ROGUE: - m_creature->SetCanDualWield(true); + me->SetCanDualWield(true); break; } } @@ -1246,7 +1246,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_DRUID: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_MOONFIRE, false); + DoCast(me->getVictim(), SPELL_SR_MOONFIRE, false); Timer[1] = 3000; } DoMeleeAttackIfReady(); @@ -1254,19 +1254,19 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_HUNTER: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false); + DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false); Timer[1] = 9000; } if (Timer[2] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_SHOOT, false); + DoCast(me->getVictim(), SPELL_SR_SHOOT, false); Timer[2] = 5000; } - if (m_creature->IsWithinMeleeRange(m_creature->getVictim(), 6)) + if (me->IsWithinMeleeRange(me->getVictim(), 6)) { if (Timer[3] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false); + DoCast(me->getVictim(), SPELL_SR_MULTI_SHOT, false); Timer[3] = 7000; } DoMeleeAttackIfReady(); @@ -1275,7 +1275,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_MAGE: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_FIREBALL, false); + DoCast(me->getVictim(), SPELL_SR_FIREBALL, false); Timer[1] = 3000; } DoMeleeAttackIfReady(); @@ -1283,7 +1283,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_WARLOCK: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_SHADOW_BOLT, false); + DoCast(me->getVictim(), SPELL_SR_SHADOW_BOLT, false); Timer[1] = 4000; } if (Timer[2] <= diff) @@ -1296,7 +1296,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_WARRIOR: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_WHIRLWIND, false); + DoCast(me->getVictim(), SPELL_SR_WHIRLWIND, false); Timer[1] = 10000; } DoMeleeAttackIfReady(); @@ -1304,12 +1304,12 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_PALADIN: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false); + DoCast(me->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false); Timer[1] = 7000; } if (Timer[2] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SHOCK, false); + DoCast(me->getVictim(), SPELL_SR_HOLY_SHOCK, false); Timer[2] = 3000; } DoMeleeAttackIfReady(); @@ -1317,12 +1317,12 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_PRIEST: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SMITE, false); + DoCast(me->getVictim(), SPELL_SR_HOLY_SMITE, false); Timer[1] = 5000; } if (Timer[2] <= diff) { - DoCast(m_creature, SPELL_SR_RENEW, false); + DoCast(me, SPELL_SR_RENEW, false); Timer[2] = 7000; } DoMeleeAttackIfReady(); @@ -1330,7 +1330,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_SHAMAN: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_EARTH_SHOCK, false); + DoCast(me->getVictim(), SPELL_SR_EARTH_SHOCK, false); Timer[1] = 5000; } DoMeleeAttackIfReady(); @@ -1338,7 +1338,7 @@ struct mob_sinster_reflectionAI : public ScriptedAI case CLASS_ROGUE: if (Timer[1] <= diff) { - DoCast(m_creature->getVictim(), SPELL_SR_HEMORRHAGE, true); + DoCast(me->getVictim(), SPELL_SR_HEMORRHAGE, true); Timer[1] = 5000; } DoMeleeAttackIfReady(); diff --git a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp index d2d3e55b285..2f284e77b09 100644 --- a/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp +++ b/src/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp @@ -115,7 +115,7 @@ float Humanoides[6][5] = uint32 EnrageTimer = 600000; struct boss_entropiusAI : public ScriptedAI { - boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(me) { pInstance = c->GetInstanceData(); } @@ -139,7 +139,7 @@ struct boss_entropiusAI : public ScriptedAI void EnterCombat(Unit *who) { DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true); - DoCast(m_creature, SPELL_ENTROPIUS_SPAWN, false); + DoCast(me, SPELL_ENTROPIUS_SPAWN, false); if (pInstance) pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS); @@ -156,7 +156,7 @@ struct boss_entropiusAI : public ScriptedAI summoned->addUnitState(UNIT_STAT_STUNNED); float x,y,z,o; summoned->GetHomePosition(x,y,z,o); - m_creature->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0); break; } summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true)); @@ -176,9 +176,9 @@ struct boss_entropiusAI : public ScriptedAI if (!UpdateVictim()) return; - if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0)) + if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0)) { - DoCast(m_creature, SPELL_ENRAGE, false); + DoCast(me, SPELL_ENRAGE, false); } else EnrageTimer -= diff; if (BlackHoleSummonTimer <= diff) @@ -208,7 +208,7 @@ CreatureAI* GetAI_boss_entropius(Creature* pCreature) struct boss_muruAI : public Scripted_NoMovementAI { - boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) + boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) { pInstance = c->GetInstanceData(); } @@ -232,8 +232,8 @@ struct boss_muruAI : public Scripted_NoMovementAI Timer[TIMER_PHASE] = 2000; Timer[TIMER_SENTINEL] = 31500; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetVisibility(VISIBILITY_ON); Summons.DespawnAll(); @@ -251,13 +251,13 @@ struct boss_muruAI : public Scripted_NoMovementAI void DamageTaken(Unit *done_by, uint32 &damage) { - if (damage > m_creature->GetHealth() && Phase == 1) + if (damage > me->GetHealth() && Phase == 1) { damage = 0; Phase = 2; - m_creature->RemoveAllAuras(); - DoCast(m_creature, SPELL_OPEN_ALL_PORTALS, false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveAllAuras(); + DoCast(me, SPELL_OPEN_ALL_PORTALS, false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } if (Phase > 1 && Phase < 4) damage = 0; @@ -268,7 +268,7 @@ struct boss_muruAI : public Scripted_NoMovementAI switch(summoned->GetEntry()) { case BOSS_ENTROPIUS: - m_creature->SetVisibility(VISIBILITY_OFF); + me->SetVisibility(VISIBILITY_OFF); break; case CREATURE_DARK_FIENDS: summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false); @@ -296,7 +296,7 @@ struct boss_muruAI : public Scripted_NoMovementAI break; case DONE: Phase = 4; - m_creature->DisappearAndDie(); + me->DisappearAndDie(); break; } Timer[TIMER_PHASE] = 3000; @@ -304,9 +304,9 @@ struct boss_muruAI : public Scripted_NoMovementAI return; } - if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0)) + if (EnrageTimer < diff && !me->HasAura(SPELL_ENRAGE, 0)) { - DoCast(m_creature, SPELL_ENRAGE, false); + DoCast(me, SPELL_ENRAGE, false); } else EnrageTimer -= diff; for (uint8 i = 0; i < 4; ++i) @@ -326,18 +326,18 @@ struct boss_muruAI : public Scripted_NoMovementAI { DarkFiend = false; for (uint8 i = 0; i < 8; ++i) - m_creature->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); Timer[TIMER_DARKNESS] = 42000; } break; case TIMER_HUMANOIDES: for (uint8 i = 0; i < 6; ++i) - m_creature->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0); Timer[TIMER_HUMANOIDES] = 60000; break; case TIMER_PHASE: - m_creature->RemoveAllAuras(); - DoCast(m_creature, SPELL_SUMMON_ENTROPIUS, false); + me->RemoveAllAuras(); + DoCast(me, SPELL_SUMMON_ENTROPIUS, false); Timer[TIMER_PHASE] = 3000; Phase = 3; return; @@ -366,7 +366,7 @@ CreatureAI* GetAI_boss_muru(Creature* pCreature) struct npc_muru_portalAI : public Scripted_NoMovementAI { - npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) + npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(me) { pInstance = c->GetInstanceData(); } @@ -387,7 +387,7 @@ struct npc_muru_portalAI : public Scripted_NoMovementAI InAction = false; SummonSentinel = false; - m_creature->addUnitState(UNIT_STAT_STUNNED); + me->addUnitState(UNIT_STAT_STUNNED); Summons.DespawnAll(); } @@ -404,7 +404,7 @@ struct npc_muru_portalAI : public Scripted_NoMovementAI void SpellHit(Unit* caster, const SpellEntry* Spell) { float x,y,z,o; - m_creature->GetHomePosition(x,y,z,o); + me->GetHomePosition(x,y,z,o); DoTeleportTo(x,y,z); InAction = true; switch(Spell->Id) @@ -453,14 +453,14 @@ struct npc_dark_fiendAI : public ScriptedAI WaitTimer = 2000; InAction = false; - m_creature->addUnitState(UNIT_STAT_STUNNED); + me->addUnitState(UNIT_STAT_STUNNED); } void SpellHit(Unit* caster, const SpellEntry* Spell) { for (uint8 i = 0; i < 3; ++i) if (Spell->Effect[i] == 38) - m_creature->DisappearAndDie(); + me->DisappearAndDie(); } void UpdateAI(const uint32 diff) @@ -472,7 +472,7 @@ struct npc_dark_fiendAI : public ScriptedAI { if (!InAction) { - m_creature->clearUnitState(UNIT_STAT_STUNNED); + me->clearUnitState(UNIT_STAT_STUNNED); DoCastAOE(SPELL_DARKFIEND_SKIN, false); AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); InAction = true; @@ -481,10 +481,10 @@ struct npc_dark_fiendAI : public ScriptedAI else { - if (m_creature->IsWithinDist(m_creature->getVictim(), 5)) + if (me->IsWithinDist(me->getVictim(), 5)) { DoCastAOE(SPELL_DARKFIEND_AOE, false); - m_creature->DisappearAndDie(); + me->DisappearAndDie(); } WaitTimer = 500; } @@ -510,14 +510,14 @@ struct npc_void_sentinelAI : public ScriptedAI VoidBlastTimer = 45000; //is this a correct timer? float x,y,z,o; - m_creature->GetHomePosition(x,y,z,o); + me->GetHomePosition(x,y,z,o); DoTeleportTo(x,y,71); } void JustDied(Unit* killer) { for (uint8 i = 0; i < 8; ++i) - m_creature->SummonCreature(CREATURE_VOID_SPAWN, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); + me->SummonCreature(CREATURE_VOID_SPAWN, me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); } void UpdateAI(const uint32 diff) @@ -533,7 +533,7 @@ struct npc_void_sentinelAI : public ScriptedAI if (VoidBlastTimer <= diff) { - DoCast(m_creature->getVictim(), SPELL_VOID_BLAST, false); + DoCast(me->getVictim(), SPELL_VOID_BLAST, false); VoidBlastTimer = 45000; } else VoidBlastTimer -= diff; @@ -566,7 +566,7 @@ struct npc_blackholeAI : public ScriptedAI SpellTimer = 5000; Phase = 0; - m_creature->addUnitState(UNIT_STAT_STUNNED); + me->addUnitState(UNIT_STAT_STUNNED); DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); } @@ -574,11 +574,11 @@ struct npc_blackholeAI : public ScriptedAI { if (SpellTimer <= diff) { - Unit* Victim = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); + Unit* Victim = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_PLAYER_GUID) : 0); switch (NeedForAHack) { case 0: - m_creature->clearUnitState(UNIT_STAT_STUNNED); + me->clearUnitState(UNIT_STAT_STUNNED); DoCastAOE(SPELL_BLACKHOLE_GROW, false); if (Victim) AttackStart(Victim); @@ -586,19 +586,19 @@ struct npc_blackholeAI : public ScriptedAI NeedForAHack = 2; break; case 1: - m_creature->AddAura(SPELL_BLACKHOLE_GROW, m_creature); + me->AddAura(SPELL_BLACKHOLE_GROW, me); NeedForAHack = 2; SpellTimer = 600; break; case 2: SpellTimer = 400; NeedForAHack = 3; - m_creature->RemoveAura(SPELL_BLACKHOLE_GROW, 1); + me->RemoveAura(SPELL_BLACKHOLE_GROW, 1); break; case 3: SpellTimer = urand(400,900); NeedForAHack = 1; - if (Unit* Temp = m_creature->getVictim()) + if (Unit* Temp = me->getVictim()) { if (Temp->GetPositionZ() > 73 && Victim) AttackStart(Victim); @@ -608,7 +608,7 @@ struct npc_blackholeAI : public ScriptedAI } else SpellTimer -= diff; if (DespawnTimer <= diff) - m_creature->DisappearAndDie(); + me->DisappearAndDie(); else DespawnTimer -= diff; } }; diff --git a/src/scripts/eastern_kingdoms/tirisfal_glades.cpp b/src/scripts/eastern_kingdoms/tirisfal_glades.cpp index 65acac15c3b..4a5280d7a3a 100644 --- a/src/scripts/eastern_kingdoms/tirisfal_glades.cpp +++ b/src/scripts/eastern_kingdoms/tirisfal_glades.cpp @@ -57,15 +57,15 @@ struct npc_calvin_montagueAI : public ScriptedAI me->RestoreFaction(); - if (!m_creature->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE)) - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); + if (!me->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE)) + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); } void EnterCombat(Unit* who) { } void AttackedBy(Unit* pAttacker) { - if (m_creature->getVictim() || m_creature->IsFriendlyTo(pAttacker)) + if (me->getVictim() || me->IsFriendlyTo(pAttacker)) return; AttackStart(pAttacker); @@ -73,13 +73,13 @@ struct npc_calvin_montagueAI : public ScriptedAI void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) { - if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 15)) { uiDamage = 0; me->RestoreFaction(); - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); - m_creature->CombatStop(true); + me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); + me->CombatStop(true); m_uiPhase = 1; @@ -103,14 +103,14 @@ struct npc_calvin_montagueAI : public ScriptedAI switch(m_uiPhase) { case 1: - DoScriptText(SAY_COMPLETE, m_creature); + DoScriptText(SAY_COMPLETE, me); ++m_uiPhase; break; case 2: if (Player *pPlayer = Unit::GetPlayer(m_uiPlayerGUID)) pPlayer->AreaExploredOrEventHappens(QUEST_590); - DoCast(m_creature, SPELL_DRINK, true); + DoCast(me, SPELL_DRINK, true); ++m_uiPhase; break; case 3: diff --git a/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp b/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp index 6eeb54f0fa7..ca9f0f3d49f 100644 --- a/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp @@ -50,7 +50,7 @@ struct boss_archaedasAI : public ScriptedAI { boss_archaedasAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } uint32 Tremor_Timer; @@ -74,15 +74,15 @@ struct boss_archaedasAI : public ScriptedAI if (pInstance) pInstance->SetData (NULL, 5); // respawn any dead minions - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } void ActivateMinion (uint64 guid, bool flag) { - Unit *minion = Unit::GetUnit(*m_creature, guid); + Unit *minion = Unit::GetUnit(*me, guid); if (minion && minion->isAlive()) { @@ -93,17 +93,17 @@ struct boss_archaedasAI : public ScriptedAI void EnterCombat(Unit *who) { - m_creature->setFaction (14); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + me->setFaction (14); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag (UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); } void SpellHit (Unit* caster, const SpellEntry *spell) { // Being woken up from the altar, start the awaken sequence if (spell == GetSpellStore()->LookupEntry(SPELL_ARCHAEDAS_AWAKEN)) { - m_creature->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); + me->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me,SOUND_AGGRO); Awaken_Timer = 4000; wakingUp = true; } @@ -111,8 +111,8 @@ struct boss_archaedasAI : public ScriptedAI void KilledUnit(Unit *victim) { - m_creature->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL); + me->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL); } void UpdateAI(const uint32 diff) @@ -125,7 +125,7 @@ struct boss_archaedasAI : public ScriptedAI return; // dont do anything until we are done } else if (wakingUp && Awaken_Timer <= 0) { wakingUp = false; - AttackStart(Unit::GetUnit(*m_creature, pInstance->GetData64(0))); + AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); return; // dont want to continue until we finish the AttackStart method } @@ -141,33 +141,33 @@ struct boss_archaedasAI : public ScriptedAI } else WallMinionTimer -= diff; //If we are <66 summon the guardians - if (!guardiansAwake && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 66) { + if (!guardiansAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 66) { ActivateMinion(pInstance->GetData64(5),true); // EarthenGuardian1 ActivateMinion(pInstance->GetData64(6),true); // EarthenGuardian2 ActivateMinion(pInstance->GetData64(7),true); // EarthenGuardian3 ActivateMinion(pInstance->GetData64(8),true); // EarthenGuardian4 ActivateMinion(pInstance->GetData64(9),true); // EarthenGuardian5 ActivateMinion(pInstance->GetData64(10),false); // EarthenGuardian6 - m_creature->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SUMMON); + me->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_SUMMON); guardiansAwake = true; } //If we are <33 summon the vault walkers - if (!vaultWalkersAwake && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 33) { + if (!vaultWalkersAwake && me->GetHealth()*100 / me->GetMaxHealth() <= 33) { ActivateMinion(pInstance->GetData64(1),true); // VaultWalker1 ActivateMinion(pInstance->GetData64(2),true); // VaultWalker2 ActivateMinion(pInstance->GetData64(3),true); // VaultWalker3 ActivateMinion(pInstance->GetData64(4),false); // VaultWalker4 - m_creature->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SUMMON2); + me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_SUMMON2); vaultWalkersAwake = true; } if (Tremor_Timer <= diff) { //Cast - DoCast(m_creature->getVictim(), SPELL_GROUND_TREMOR); + DoCast(me->getVictim(), SPELL_GROUND_TREMOR); //45 seconds until we should cast this agian Tremor_Timer = 45000; @@ -204,7 +204,7 @@ struct mob_archaedas_minionsAI : public ScriptedAI { mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c) { - pInstance = m_creature->GetInstanceData(); + pInstance = me->GetInstanceData(); } uint32 Arcing_Timer; @@ -222,18 +222,18 @@ struct mob_archaedas_minionsAI : public ScriptedAI wakingUp = false; amIAwake = false; - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - m_creature->RemoveAllAuras(); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->RemoveAllAuras(); } void EnterCombat(Unit *who) { - m_creature->setFaction (14); - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->setFaction (14); + me->RemoveAllAuras(); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); amIAwake = true; } @@ -260,7 +260,7 @@ struct mob_archaedas_minionsAI : public ScriptedAI } else if (wakingUp && Awaken_Timer <= 0) { wakingUp = false; amIAwake = true; - // AttackStart(Unit::GetUnit(*m_creature, pInstance->GetData64(0))); // whoWokeArchaedasGUID + // AttackStart(Unit::GetUnit(*me, pInstance->GetData64(0))); // whoWokeArchaedasGUID return; // dont want to continue until we finish the AttackStart method } @@ -356,24 +356,24 @@ struct mob_stonekeepersAI : public ScriptedAI { mob_stonekeepersAI(Creature *c) : ScriptedAI(c) { - pInstance = (m_creature->GetInstanceData()); + pInstance = (me->GetInstanceData()); } ScriptedInstance* pInstance; void Reset() { - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - m_creature->RemoveAllAuras(); + me->setFaction(35); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->RemoveAllAuras(); } void EnterCombat(Unit *who) { - m_creature->setFaction (14); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + me->setFaction (14); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); } void UpdateAI(const uint32 diff) @@ -388,7 +388,7 @@ struct mob_stonekeepersAI : public ScriptedAI void JustDied(Unit *attacker) { - DoCast (m_creature, SPELL_SELF_DESTRUCT,true); + DoCast (me, SPELL_SELF_DESTRUCT,true); if (pInstance) pInstance->SetData(NULL, 1); // activate next stonekeeper } diff --git a/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp b/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp index 604b3453d45..f0b7cbbba6f 100644 --- a/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp @@ -46,7 +46,7 @@ struct boss_ironayaAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void UpdateAI(const uint32 diff) @@ -56,18 +56,18 @@ struct boss_ironayaAI : public ScriptedAI return; //If we are <50% hp do knockaway ONCE - if (!hasCastedKnockaway && m_creature->GetHealth()*2 < m_creature->GetMaxHealth()) + if (!hasCastedKnockaway && me->GetHealth()*2 < me->GetMaxHealth()) { - DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY, true); + DoCast(me->getVictim(), SPELL_KNOCKAWAY, true); // current aggro target is knocked away pick new target Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - if (!Target || Target == m_creature->getVictim()) + if (!Target || Target == me->getVictim()) Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); if (Target) - m_creature->TauntApply(Target); + me->TauntApply(Target); //Shouldn't cast this agian hasCastedKnockaway = true; @@ -76,13 +76,13 @@ struct boss_ironayaAI : public ScriptedAI //Arcing_Timer if (Arcing_Timer <= diff) { - DoCast(m_creature, SPELL_ARCINGSMASH); + DoCast(me, SPELL_ARCINGSMASH); Arcing_Timer = 13000; } else Arcing_Timer -= diff; - if (!hasCastedWstomp && m_creature->GetHealth()*4 < m_creature->GetMaxHealth()) + if (!hasCastedWstomp && me->GetHealth()*4 < me->GetMaxHealth()) { - DoCast(m_creature, SPELL_WSTOMP); + DoCast(me, SPELL_WSTOMP); hasCastedWstomp = true; } diff --git a/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp b/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp index 8a9ac246d52..01862739cb7 100644 --- a/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp +++ b/src/scripts/eastern_kingdoms/uldaman/uldaman.cpp @@ -59,19 +59,19 @@ struct mob_jadespine_basiliskAI : public ScriptedAI if (Cslumber_Timer <= diff) { //Cast - // DoCast(m_creature->getVictim(), SPELL_CSLUMBER); - DoCast(m_creature->getVictim(), SPELL_CSLUMBER, true); + // DoCast(me->getVictim(), SPELL_CSLUMBER); + DoCast(me->getVictim(), SPELL_CSLUMBER, true); //Stop attacking target thast asleep and pick new target Cslumber_Timer = 28000; Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - if (!Target || Target == m_creature->getVictim()) + if (!Target || Target == me->getVictim()) Target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); if (Target) - m_creature->TauntApply(Target); + me->TauntApply(Target); } else Cslumber_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/undercity.cpp b/src/scripts/eastern_kingdoms/undercity.cpp index 4d18e08f420..da474fe6fd0 100644 --- a/src/scripts/eastern_kingdoms/undercity.cpp +++ b/src/scripts/eastern_kingdoms/undercity.cpp @@ -79,7 +79,7 @@ struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI if (Unit *pTarget = Unit::GetUnit(*summoned,targetGUID)) { pTarget->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0,0); - pTarget->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0, 0.0f); + pTarget->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), me->GetPositionZ()+15.0, 0.0f); summoned->CastSpell(pTarget, SPELL_RIBBON_OF_SOULS, false); } @@ -97,10 +97,10 @@ struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); LamentEvent_Timer = 2000; - if (!m_creature->HasAura(SPELL_SYLVANAS_CAST)) + if (!me->HasAura(SPELL_SYLVANAS_CAST)) { - DoScriptText(SAY_LAMENT_END, m_creature); - DoScriptText(EMOTE_LAMENT_END, m_creature); + DoScriptText(SAY_LAMENT_END, me); + DoScriptText(EMOTE_LAMENT_END, me); LamentEvent = false; } } else LamentEvent_Timer -= diff; @@ -161,9 +161,9 @@ struct npc_highborne_lamenterAI : public ScriptedAI { if (EventMove_Timer <= diff) { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); - m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation()); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMonsterMoveWithSpeed(me->GetPositionX(),me->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); + me->GetMap()->CreatureRelocation(me,me->GetPositionX(),me->GetPositionY(),HIGHBORNE_LOC_Y_NEW,me->GetOrientation()); EventMove = false; } else EventMove_Timer -= diff; } @@ -171,7 +171,7 @@ struct npc_highborne_lamenterAI : public ScriptedAI { if (EventCast_Timer <= diff) { - DoCast(m_creature, SPELL_HIGHBORNE_AURA); + DoCast(me, SPELL_HIGHBORNE_AURA); EventCast = false; } else EventCast_Timer -= diff; } diff --git a/src/scripts/eastern_kingdoms/western_plaguelands.cpp b/src/scripts/eastern_kingdoms/western_plaguelands.cpp index 806c7cb9169..60b158aa042 100644 --- a/src/scripts/eastern_kingdoms/western_plaguelands.cpp +++ b/src/scripts/eastern_kingdoms/western_plaguelands.cpp @@ -148,11 +148,11 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI void DoDie() { //summoner dies here - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); //override any database `spawntimesecs` to prevent duplicated summons - uint32 rTime = m_creature->GetRespawnDelay(); + uint32 rTime = me->GetRespawnDelay(); if (rTime<600) - m_creature->SetRespawnDelay(600); + me->SetRespawnDelay(600); } void MoveInLineOfSight(Unit *who) @@ -162,13 +162,13 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI if (who->GetTypeId() == TYPEID_PLAYER) { - switch(m_creature->GetAreaId()) + switch(me->GetAreaId()) { case 199: //felstone if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) { - m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); DoDie(); } break; @@ -176,7 +176,7 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) { - m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); DoDie(); } break; @@ -184,7 +184,7 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) { - m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); DoDie(); } break; @@ -192,7 +192,7 @@ struct npc_the_scourge_cauldronAI : public ScriptedAI if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) { - m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); DoDie(); } break; @@ -223,8 +223,8 @@ struct npc_andorhal_towerAI : public Scripted_NoMovementAI if (!pWho || pWho->GetTypeId() != TYPEID_PLAYER) return; - if (m_creature->FindNearestGameObject(GO_BEACON_TORCH, 10.0f)) - CAST_PLR(pWho)->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetGUID()); + if (me->FindNearestGameObject(GO_BEACON_TORCH, 10.0f)) + CAST_PLR(pWho)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); } }; diff --git a/src/scripts/eastern_kingdoms/westfall.cpp b/src/scripts/eastern_kingdoms/westfall.cpp index 82d49e09851..6f2f439f7fb 100644 --- a/src/scripts/eastern_kingdoms/westfall.cpp +++ b/src/scripts/eastern_kingdoms/westfall.cpp @@ -60,9 +60,9 @@ struct npc_daphne_stilwellAI : public npc_escortAI { switch(uiWPHolder) { - case 7: DoScriptText(SAY_DS_DOWN_1, m_creature); break; - case 8: DoScriptText(SAY_DS_DOWN_2, m_creature); break; - case 9: DoScriptText(SAY_DS_DOWN_3, m_creature); break; + case 7: DoScriptText(SAY_DS_DOWN_1, me); break; + case 8: DoScriptText(SAY_DS_DOWN_2, me); break; + case 9: DoScriptText(SAY_DS_DOWN_3, me); break; } } else @@ -84,42 +84,42 @@ struct npc_daphne_stilwellAI : public npc_escortAI { case 4: SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); - m_creature->SetSheath(SHEATH_STATE_RANGED); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); + me->SetSheath(SHEATH_STATE_RANGED); + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); break; case 7: - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 8: - m_creature->SetSheath(SHEATH_STATE_RANGED); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SetSheath(SHEATH_STATE_RANGED); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 9: - m_creature->SetSheath(SHEATH_STATE_RANGED); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018, 1570.738, 54.828, 4.220, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SetSheath(SHEATH_STATE_RANGED); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836, 1569.755, 54.267, 4.230, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697, 1569.124, 54.421, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237, 1568.307, 54.620, 4.206, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037, 1570.213, 54.961, 4.283, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018, 1570.738, 54.828, 4.220, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 10: SetRun(false); break; case 11: - DoScriptText(SAY_DS_PROLOGUE, m_creature); + DoScriptText(SAY_DS_PROLOGUE, me); break; case 13: SetEquipmentSlots(true); - m_creature->SetSheath(SHEATH_STATE_UNARMED); - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); + me->SetSheath(SHEATH_STATE_UNARMED); + me->HandleEmoteCommand(EMOTE_STATE_USESTANDING_NOSHEATHE); break; case 17: - pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature); + pPlayer->GroupEventHappens(QUEST_TOME_VALOR, me); break; } } @@ -129,19 +129,19 @@ struct npc_daphne_stilwellAI : public npc_escortAI if (!pWho) return; - if (m_creature->Attack(pWho, false)) + if (me->Attack(pWho, false)) { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); + me->AddThreat(pWho, 0.0f); + me->SetInCombatWith(pWho); + pWho->SetInCombatWith(me); - m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); + me->GetMotionMaster()->MoveChase(pWho, 30.0f); } } void JustSummoned(Creature* pSummoned) { - pSummoned->AI()->AttackStart(m_creature); + pSummoned->AI()->AttackStart(me); } void Update(const uint32 diff) @@ -155,8 +155,8 @@ struct npc_daphne_stilwellAI : public npc_escortAI { uiShootTimer = 1500; - if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) - DoCast(m_creature->getVictim(), SPELL_SHOOT); + if (!me->IsWithinDist(me->getVictim(), ATTACK_DISTANCE)) + DoCast(me->getVictim(), SPELL_SHOOT); } else uiShootTimer -= diff; } }; @@ -208,20 +208,20 @@ struct npc_defias_traitorAI : public npc_escortAI SetRun(false); break; case 36: - DoScriptText(SAY_PROGRESS, m_creature, pPlayer); + DoScriptText(SAY_PROGRESS, me, pPlayer); break; case 44: - DoScriptText(SAY_END, m_creature, pPlayer); + DoScriptText(SAY_END, me, pPlayer); { if (pPlayer) - pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,m_creature); + pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD,me); } break; } } void EnterCombat(Unit* who) { - DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), m_creature, who); + DoScriptText(RAND(SAY_AGGRO_1,SAY_AGGRO_2), me, who); } void Reset() {} diff --git a/src/scripts/eastern_kingdoms/wetlands.cpp b/src/scripts/eastern_kingdoms/wetlands.cpp index a7a4b247da9..21120d31023 100644 --- a/src/scripts/eastern_kingdoms/wetlands.cpp +++ b/src/scripts/eastern_kingdoms/wetlands.cpp @@ -60,11 +60,11 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI switch(uiPointId) { case 2: - if (m_creature->HasStealthAura()) - m_creature->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + if (me->HasStealthAura()) + me->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); SetRun(); - m_creature->setFaction(FACTION_ENEMY); + me->setFaction(FACTION_ENEMY); break; } } @@ -76,7 +76,7 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_bFriendSummoned && pPlayer) { for (uint8 i = 0; i < 3; ++i) - DoCast(m_creature, SPELL_CALL_FRIENDS, true); + DoCast(me, SPELL_CALL_FRIENDS, true); m_bFriendSummoned = true; } @@ -90,10 +90,10 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI void AttackedBy(Unit* pAttacker) { - if (m_creature->getVictim()) + if (me->getVictim()) return; - if (m_creature->IsFriendlyTo(pAttacker)) + if (me->IsFriendlyTo(pAttacker)) return; AttackStart(pAttacker); @@ -101,19 +101,19 @@ struct npc_tapoke_slim_jahnAI : public npc_escortAI void DamageTaken(Unit* pDoneBy, uint32& uiDamage) { - if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20) + if (me->GetHealth()*100 < me->GetMaxHealth()*20) { if (Player* pPlayer = GetPlayerForEscort()) { if (pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me); uiDamage = 0; me->RestoreFaction(); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); SetRun(false); } diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp index 394e61e7785..74b6a391be2 100644 --- a/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp @@ -114,8 +114,8 @@ struct boss_akilzonAI : public ScriptedAI void EnterCombat(Unit *who) { - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONAGGRO); //DoZoneInCombat(); if (pInstance) pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); @@ -123,8 +123,8 @@ struct boss_akilzonAI : public ScriptedAI void JustDied(Unit* Killer) { - m_creature->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + me->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me, SOUND_ONDEATH); if (pInstance) pInstance->SetData(DATA_AKILZONEVENT, DONE); DespawnSummons(); @@ -135,12 +135,12 @@ struct boss_akilzonAI : public ScriptedAI switch (urand(0,1)) { case 0: - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONSLAY1); break; case 1: - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONSLAY2); break; } } @@ -149,7 +149,7 @@ struct boss_akilzonAI : public ScriptedAI { for (uint8 i = 0; i < 8; ++i) { - Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); + Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); if (bird && bird->isAlive()) { bird->SetVisibility(VISIBILITY_OFF); @@ -160,7 +160,7 @@ struct boss_akilzonAI : public ScriptedAI void SetWeather(uint32 weather, float grade) { - Map* pMap = m_creature->GetMap(); + Map* pMap = me->GetMap(); if (!pMap->IsDungeon()) return; @@ -179,7 +179,7 @@ struct boss_akilzonAI : public ScriptedAI for (uint8 i = 2; i < StormCount; ++i) bp0 *= 2; - CellPair p(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + CellPair p(Trinity::ComputeCellPair(me->GetPositionX(), me->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); @@ -187,31 +187,31 @@ struct boss_akilzonAI : public ScriptedAI std::list<Unit *> tempUnitMap; { - Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999); - Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(m_creature, tempUnitMap, u_check); + Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, 999); + Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check); TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher); TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher); - cell.Visit(p, world_unit_searcher, *(m_creature->GetMap())); - cell.Visit(p, grid_unit_searcher, *(m_creature->GetMap())); + cell.Visit(p, world_unit_searcher, *(me->GetMap())); + cell.Visit(p, grid_unit_searcher, *(me->GetMap())); } //dealdamege for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) { if (!Cloud->IsWithinDist(*i, 6, false)) { - Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); + Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, me->GetGUID()); } } // visual float x,y,z; - z = m_creature->GetPositionZ(); + z = me->GetPositionZ(); for (uint8 i = 0; i < 5+rand()%5; ++i) { x = 343+rand()%60; y = 1380+rand()%60; - if (Unit *trigger = m_creature->SummonTrigger(x, y, z, 0, 2000)) + if (Unit *trigger = me->SummonTrigger(x, y, z, 0, 2000)) { trigger->setFaction(35); trigger->SetMaxHealth(100000); @@ -227,7 +227,7 @@ struct boss_akilzonAI : public ScriptedAI { StormCount = 0; // finish SummonEagles_Timer = 5000; - m_creature->InterruptNonMeleeSpells(false); + me->InterruptNonMeleeSpells(false); CloudGUID = 0; if (Cloud) Cloud->DealDamage(Cloud, Cloud->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); @@ -244,13 +244,13 @@ struct boss_akilzonAI : public ScriptedAI if (StormCount) { - Unit *pTarget = Unit::GetUnit(*m_creature, CloudGUID); + Unit *pTarget = Unit::GetUnit(*me, CloudGUID); if (!pTarget || !pTarget->isAlive()) { EnterEvadeMode(); return; } - else if (Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID)) + else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID)) Cyclone->CastSpell(pTarget, 25160, true); // keep casting or... if (StormSequenceTimer <= diff) @@ -263,36 +263,36 @@ struct boss_akilzonAI : public ScriptedAI if (Enrage_Timer <= diff) { - m_creature->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONENRAGE); - DoCast(m_creature, SPELL_BERSERK, true); + me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONENRAGE); + DoCast(me, SPELL_BERSERK, true); Enrage_Timer = 600000; } else Enrage_Timer -= diff; if (StaticDisruption_Timer <= diff) { Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) pTarget = m_creature->getVictim(); + if (!pTarget) pTarget = me->getVictim(); TargetGUID = pTarget->GetGUID(); DoCast(pTarget, SPELL_STATIC_DISRUPTION, false); - m_creature->SetInFront(m_creature->getVictim()); + me->SetInFront(me->getVictim()); StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s - /*if (float dist = m_creature->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f; + /*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f; SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ } else StaticDisruption_Timer -= diff; if (GustOfWind_Timer <= diff) { Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!pTarget) pTarget = m_creature->getVictim(); + if (!pTarget) pTarget = me->getVictim(); DoCast(pTarget, SPELL_GUST_OF_WIND); GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) } else GustOfWind_Timer -= diff; if (CallLighting_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CALL_LIGHTNING); + DoCast(me->getVictim(), SPELL_CALL_LIGHTNING); CallLighting_Timer = (12 + rand()%5)*1000; //totaly random timer. can't find any info on this } else CallLighting_Timer -= diff; @@ -316,9 +316,9 @@ struct boss_akilzonAI : public ScriptedAI if (pTarget) { pTarget->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - pTarget->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0); + pTarget->SendMonsterMove(x,y,me->GetPositionZ()+15,0); } - Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->GetPositionZ()+16, 0, 15000); + Unit *Cloud = me->SummonTrigger(x, y, me->GetPositionZ()+16, 0, 15000); if (Cloud) { CloudGUID = Cloud->GetGUID(); @@ -337,15 +337,15 @@ struct boss_akilzonAI : public ScriptedAI if (SummonEagles_Timer <= diff) { - m_creature->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONSUMMON); + me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_ONSUMMON); float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); for (uint8 i = 0; i < 8; ++i) { - Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); + Unit* bird = Unit::GetUnit(*me,BirdGUIDs[i]); if (!bird) //they despawned on die { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) @@ -356,11 +356,11 @@ struct boss_akilzonAI : public ScriptedAI if (z > 95) z = 95 - urand(0,5); } - Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + Creature *pCreature = me->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); if (pCreature) { - pCreature->AddThreat(m_creature->getVictim(), 1.0f); - pCreature->AI()->AttackStart(m_creature->getVictim()); + pCreature->AddThreat(me->getVictim(), 1.0f); + pCreature->AI()->AttackStart(me->getVictim()); BirdGUIDs[i] = pCreature->GetGUID(); } } @@ -385,7 +385,7 @@ struct mob_soaring_eagleAI : public ScriptedAI EagleSwoop_Timer = 5000 + rand()%5000; arrived = true; TargetGUID = 0; - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); } void EnterCombat(Unit *who) {DoZoneInCombat();} @@ -397,10 +397,10 @@ struct mob_soaring_eagleAI : public ScriptedAI arrived = true; if (TargetGUID) { - if (Unit *pTarget = Unit::GetUnit(*m_creature, TargetGUID)) + if (Unit *pTarget = Unit::GetUnit(*me, TargetGUID)) DoCast(pTarget, SPELL_EAGLE_SWOOP, true); TargetGUID = 0; - m_creature->SetSpeed(MOVE_RUN, 1.2f); + me->SetSpeed(MOVE_RUN, 1.2f); EagleSwoop_Timer = 5000 + rand()%5000; } } @@ -427,12 +427,12 @@ struct mob_soaring_eagleAI : public ScriptedAI } else { - pTarget->GetContactPoint(m_creature, x, y, z); + pTarget->GetContactPoint(me, x, y, z); z += 2; - m_creature->SetSpeed(MOVE_RUN, 5.0f); + me->SetSpeed(MOVE_RUN, 5.0f); TargetGUID = pTarget->GetGUID(); } - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + me->GetMotionMaster()->MovePoint(0, x, y, z); arrived = false; } } diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp index 809de7631d3..1baaf524531 100644 --- a/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp @@ -106,7 +106,7 @@ struct boss_halazziAI : public ScriptedAI BerserkTimer = 600000; CheckTimer = 1000; - DoCast(m_creature, SPELL_DUAL_WIELD, true); + DoCast(me, SPELL_DUAL_WIELD, true); Phase = PHASE_NONE; EnterPhase(PHASE_LYNX); @@ -117,22 +117,22 @@ struct boss_halazziAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_AGGRO); EnterPhase(PHASE_LYNX); } void JustSummoned(Creature* summon) { - summon->AI()->AttackStart(m_creature->getVictim()); + summon->AI()->AttackStart(me->getVictim()); if (summon->GetEntry() == MOB_SPIRIT_LYNX) LynxGUID = summon->GetGUID(); } void DamageTaken(Unit *done_by, uint32 &damage) { - if (damage >= m_creature->GetHealth() && Phase != PHASE_ENRAGE) + if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE) damage = 0; } @@ -155,42 +155,42 @@ struct boss_halazziAI : public ScriptedAI case PHASE_ENRAGE: if (Phase == PHASE_MERGE) { - DoCast(m_creature, SPELL_TRANSFORM_MERGE, true); - m_creature->Attack(m_creature->getVictim(), true); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + DoCast(me, SPELL_TRANSFORM_MERGE, true); + me->Attack(me->getVictim(), true); + me->GetMotionMaster()->MoveChase(me->getVictim()); } - if (Creature *Lynx = Unit::GetCreature(*m_creature, LynxGUID)) + if (Creature *Lynx = Unit::GetCreature(*me, LynxGUID)) Lynx->DisappearAndDie(); - m_creature->SetMaxHealth(600000); - m_creature->SetHealth(600000 - 150000 * TransformCount); + me->SetMaxHealth(600000); + me->SetHealth(600000 - 150000 * TransformCount); FrenzyTimer = 16000; SaberlashTimer = 20000; ShockTimer = 10000; TotemTimer = 12000; break; case PHASE_SPLIT: - m_creature->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SPLIT); - DoCast(m_creature, SPELL_TRANSFORM_SPLIT, true); + me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_SPLIT); + DoCast(me, SPELL_TRANSFORM_SPLIT, true); break; case PHASE_HUMAN: - //DoCast(m_creature, SPELL_SUMMON_LYNX, true); + //DoCast(me, SPELL_SUMMON_LYNX, true); DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); - m_creature->SetMaxHealth(400000); - m_creature->SetHealth(400000); + me->SetMaxHealth(400000); + me->SetHealth(400000); ShockTimer = 10000; TotemTimer = 12000; break; case PHASE_MERGE: - if (Unit *pLynx = Unit::GetUnit(*m_creature, LynxGUID)) + if (Unit *pLynx = Unit::GetUnit(*me, LynxGUID)) { - m_creature->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_MERGE); + me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_MERGE); pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pLynx->GetMotionMaster()->Clear(); - pLynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveFollow(pLynx, 0, 0); + pLynx->GetMotionMaster()->MoveFollow(me, 0, 0); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MoveFollow(pLynx, 0, 0); ++TransformCount; } break; @@ -207,9 +207,9 @@ struct boss_halazziAI : public ScriptedAI if (BerserkTimer <= diff) { - m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_BERSERK); - DoCast(m_creature, SPELL_BERSERK, true); + me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_BERSERK); + DoCast(me, SPELL_BERSERK, true); BerserkTimer = 60000; } else BerserkTimer -= diff; @@ -218,22 +218,22 @@ struct boss_halazziAI : public ScriptedAI if (SaberlashTimer <= diff) { // A tank with more than 490 defense skills should receive no critical hit - //DoCast(m_creature, 41296, true); - DoCast(m_creature->getVictim(), SPELL_SABER_LASH, true); - //m_creature->RemoveAurasDueToSpell(41296); + //DoCast(me, 41296, true); + DoCast(me->getVictim(), SPELL_SABER_LASH, true); + //me->RemoveAurasDueToSpell(41296); SaberlashTimer = 30000; } else SaberlashTimer -= diff; if (FrenzyTimer <= diff) { - DoCast(m_creature, SPELL_FRENZY); + DoCast(me, SPELL_FRENZY); FrenzyTimer = urand(10000,15000); } else FrenzyTimer -= diff; if (Phase == PHASE_LYNX) if (CheckTimer <= diff) { - if (m_creature->GetHealth() * 4 < m_creature->GetMaxHealth() * (3 - TransformCount)) + if (me->GetHealth() * 4 < me->GetMaxHealth() * (3 - TransformCount)) EnterPhase(PHASE_SPLIT); CheckTimer = 1000; } else CheckTimer -= diff; @@ -243,7 +243,7 @@ struct boss_halazziAI : public ScriptedAI { if (TotemTimer <= diff) { - DoCast(m_creature, SPELL_SUMMON_TOTEM); + DoCast(me, SPELL_SUMMON_TOTEM); TotemTimer = 20000; } else TotemTimer -= diff; @@ -262,11 +262,11 @@ struct boss_halazziAI : public ScriptedAI if (Phase == PHASE_HUMAN) if (CheckTimer <= diff) { - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)/*m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()*/) + if (((me->GetHealth()*100) / me->GetMaxHealth() <= 20)/*me->GetHealth() * 10 < me->GetMaxHealth()*/) EnterPhase(PHASE_MERGE); else { - Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); + Unit *Lynx = Unit::GetUnit(*me, LynxGUID); if (Lynx && ((Lynx->GetHealth()*100) / Lynx->GetMaxHealth() <= 20)/*Lynx->GetHealth() * 10 < Lynx->GetMaxHealth()*/) EnterPhase(PHASE_MERGE); } @@ -278,12 +278,12 @@ struct boss_halazziAI : public ScriptedAI { if (CheckTimer <= diff) { - Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID); + Unit *Lynx = Unit::GetUnit(*me, LynxGUID); if (Lynx) { - Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); - if (m_creature->IsWithinDistInMap(Lynx, 6.0f)) + Lynx->GetMotionMaster()->MoveFollow(me, 0, 0); + me->GetMotionMaster()->MoveFollow(Lynx, 0, 0); + if (me->IsWithinDistInMap(Lynx, 6.0f)) { if (TransformCount < 3) EnterPhase(PHASE_LYNX); @@ -303,13 +303,13 @@ struct boss_halazziAI : public ScriptedAI switch (urand(0,1)) { case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_ONE); + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_ONE); break; case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_TWO); + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_TWO); break; } } @@ -319,8 +319,8 @@ struct boss_halazziAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_HALAZZIEVENT, DONE); - m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); + me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_DEATH); } }; @@ -341,13 +341,13 @@ struct boss_spiritlynxAI : public ScriptedAI void DamageTaken(Unit *done_by, uint32 &damage) { - if (damage >= m_creature->GetHealth()) + if (damage >= me->GetHealth()) damage = 0; } 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)) ScriptedAI::AttackStart(who); } @@ -360,13 +360,13 @@ struct boss_spiritlynxAI : public ScriptedAI if (FrenzyTimer <= diff) { - DoCast(m_creature, SPELL_LYNX_FRENZY); + DoCast(me, SPELL_LYNX_FRENZY); FrenzyTimer = urand(30000,50000); //frenzy every 30-50 seconds } else FrenzyTimer -= diff; if (shredder_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SHRED_ARMOR); + DoCast(me->getVictim(), SPELL_SHRED_ARMOR); shredder_timer = 4000; } else shredder_timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp index bfd3ed51d17..73a18a97a50 100644 --- a/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp @@ -238,8 +238,8 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI SpawnAdds(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); } void EnterCombat(Unit* who) @@ -248,14 +248,14 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); DoZoneInCombat(); - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO); + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_AGGRO); for (uint8 i = 0; i < 4; ++i) { - Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); + Unit* Temp = Unit::GetUnit((*me),AddGUID[i]); if (Temp && Temp->isAlive()) - CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); + CAST_CRE(Temp)->AI()->AttackStart(me->getVictim()); else { EnterEvadeMode(); @@ -269,12 +269,12 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI switch (urand(0,1)) { case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE); + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE); break; case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO); + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO); break; } } @@ -284,12 +284,12 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_HEXLORDEVENT, DONE); - m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH); + me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_DEATH); for (uint8 i = 0; i < 4 ; ++i) { - Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); + Unit* Temp = Unit::GetUnit((*me),AddGUID[i]); if (Temp && Temp->isAlive()) Temp->DealDamage(Temp, Temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); } @@ -314,17 +314,17 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI { for (uint8 i = 0; i < 4; ++i) { - Creature *pCreature = (Unit::GetCreature((*m_creature), AddGUID[i])); + Creature *pCreature = (Unit::GetCreature((*me), AddGUID[i])); if (!pCreature || !pCreature->isAlive()) { if (pCreature) pCreature->setDeathState(DEAD); - pCreature = m_creature->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); + pCreature = me->SummonCreature(AddEntry[i], Pos_X[i], POS_Y, POS_Z, ORIENT, TEMPSUMMON_DEAD_DESPAWN, 0); if (pCreature) AddGUID[i] = pCreature->GetGUID(); } else { pCreature->AI()->EnterEvadeMode(); - pCreature->GetMap()->CreatureRelocation(m_creature, Pos_X[i], POS_Y, POS_Z, ORIENT); + pCreature->GetMap()->CreatureRelocation(me, Pos_X[i], POS_Y, POS_Z, ORIENT); pCreature->StopMoving(); } } @@ -337,7 +337,7 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI if (ResetTimer <= diff) { - if (m_creature->IsWithinDist3d(119.223, 1035.45, 29.4481, 10)) + if (me->IsWithinDist3d(119.223, 1035.45, 29.4481, 10)) { EnterEvadeMode(); return; @@ -348,18 +348,18 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI if (CheckAddState_Timer <= diff) { for (uint8 i = 0; i < 4; ++i) - if (Creature *pTemp = Unit::GetCreature(*m_creature, AddGUID[i])) + if (Creature *pTemp = Unit::GetCreature(*me, AddGUID[i])) if (pTemp->isAlive() && !pTemp->getVictim()) - pTemp->AI()->AttackStart(m_creature->getVictim()); + pTemp->AI()->AttackStart(me->getVictim()); CheckAddState_Timer = 5000; } else CheckAddState_Timer -= diff; if (DrainPower_Timer <= diff) { - DoCast(m_creature, SPELL_DRAIN_POWER, true); - m_creature->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_DRAIN_POWER); + DoCast(me, SPELL_DRAIN_POWER, true); + me->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_DRAIN_POWER); DrainPower_Timer = urand(40000,55000); // must cast in 60 sec, or buff/debuff will disappear } else DrainPower_Timer -= diff; @@ -369,9 +369,9 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI SpiritBolts_Timer = 13000; // cast drain power first else { - DoCast(m_creature, SPELL_SPIRIT_BOLTS, false); - m_creature->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_SPIRIT_BOLTS); + DoCast(me, SPELL_SPIRIT_BOLTS, false); + me->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_SPIRIT_BOLTS); SpiritBolts_Timer = 40000; SiphonSoul_Timer = 10000; // ready to drain PlayerAbility_Timer = 99999; @@ -392,11 +392,11 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI trigger->SetDisplayId(11686); trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); trigger->CastSpell(pTarget, SPELL_SIPHON_SOUL, true); - trigger->GetMotionMaster()->MoveChase(m_creature); + trigger->GetMotionMaster()->MoveChase(me); //DoCast(pTarget, SPELL_SIPHON_SOUL, true); - //m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID()); - //m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL); + //me->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pTarget->GetGUID()); + //me->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL); PlayerGUID = pTarget->GetGUID(); PlayerAbility_Timer = urand(8000,10000); @@ -413,7 +413,7 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI if (PlayerAbility_Timer <= diff) { - //Unit *pTarget = Unit::GetUnit(*m_creature, PlayerGUID); + //Unit *pTarget = Unit::GetUnit(*me, PlayerGUID); //if (pTarget && pTarget->isAlive()) //{ UseAbility(); @@ -431,10 +431,10 @@ struct boss_hex_lord_malacrassAI : public ScriptedAI switch(PlayerAbility[PlayerClass][random].target) { case ABILITY_TARGET_SELF: - pTarget = m_creature; + pTarget = me; break; case ABILITY_TARGET_VICTIM: - pTarget = m_creature->getVictim(); + pTarget = me->getVictim(); break; case ABILITY_TARGET_ENEMY: default: @@ -493,7 +493,7 @@ struct boss_thurgAI : public boss_hexlord_addAI if (cleave_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CLEAVE, false); + DoCast(me->getVictim(), SPELL_CLEAVE, false); cleave_timer = 12000; //3 sec cast } else cleave_timer -= diff; @@ -529,10 +529,10 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI if (who->isTargetableForAttack()) { - if (m_creature->Attack(who, false)) + if (me->Attack(who, false)) { - m_creature->GetMotionMaster()->MoveChase(who, 20); - m_creature->AddThreat(who, 0.0f); + me->GetMotionMaster()->MoveChase(who, 20); + me->AddThreat(who, 0.0f); } } } @@ -547,13 +547,13 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI Unit *pTarget = DoSelectLowestHpFriendly(99, 30000); if (pTarget) { - if (pTarget->IsWithinDistInMap(m_creature, 50)) + if (pTarget->IsWithinDistInMap(me, 50)) DoCast(pTarget, SPELL_FLASH_HEAL, false); else { // bugged - //m_creature->GetMotionMaster()->Clear(); - //m_creature->GetMotionMaster()->MoveChase(pTarget, 20); + //me->GetMotionMaster()->Clear(); + //me->GetMotionMaster()->MoveChase(pTarget, 20); } } else @@ -578,7 +578,7 @@ struct boss_alyson_antilleAI : public boss_hexlord_addAI DoCast(pTarget, SPELL_DISPEL_MAGIC, false); } else - m_creature->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false); + me->CastSpell(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DISPEL_MAGIC, false); dispelmagic_timer = 12000; } else dispelmagic_timer -= diff;*/ @@ -608,10 +608,10 @@ struct boss_gazakrothAI : public boss_hexlord_addAI if (who->isTargetableForAttack()) { - if (m_creature->Attack(who, false)) + if (me->Attack(who, false)) { - m_creature->GetMotionMaster()->MoveChase(who, 20); - m_creature->AddThreat(who, 0.0f); + me->GetMotionMaster()->MoveChase(who, 20); + me->AddThreat(who, 0.0f); } } } @@ -623,7 +623,7 @@ struct boss_gazakrothAI : public boss_hexlord_addAI if (firebolt_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_FIREBOLT, false); + DoCast(me->getVictim(), SPELL_FIREBOLT, false); firebolt_timer = 700; } else firebolt_timer -= diff; @@ -656,13 +656,13 @@ struct boss_lord_raadanAI : public boss_hexlord_addAI if (thunderclap_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP, false); + DoCast(me->getVictim(), SPELL_THUNDERCLAP, false); thunderclap_timer = 12000; } else thunderclap_timer -= diff; if (flamebreath_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_FLAME_BREATH, false); + DoCast(me->getVictim(), SPELL_FLAME_BREATH, false); flamebreath_timer = 12000; } else flamebreath_timer -= diff; @@ -690,7 +690,7 @@ struct boss_darkheartAI : public boss_hexlord_addAI if (psychicwail_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_PSYCHIC_WAIL, false); + DoCast(me->getVictim(), SPELL_PSYCHIC_WAIL, false); psychicwail_timer = 12000; } else psychicwail_timer -= diff; @@ -719,10 +719,10 @@ struct boss_slitherAI : public boss_hexlord_addAI if (who->isTargetableForAttack()) { - if (m_creature->Attack(who, false)) + if (me->Attack(who, false)) { - m_creature->GetMotionMaster()->MoveChase(who, 20); - m_creature->AddThreat(who, 0.0f); + me->GetMotionMaster()->MoveChase(who, 20); + me->AddThreat(who, 0.0f); } } } @@ -766,7 +766,7 @@ struct boss_fenstalkerAI : public boss_hexlord_addAI if (volatileinf_timer <= diff) { // core bug - m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_VOLATILE_INFECTION, false); + me->getVictim()->CastSpell(me->getVictim(),SPELL_VOLATILE_INFECTION, false); volatileinf_timer = 12000; } else volatileinf_timer -= diff; @@ -799,7 +799,7 @@ struct boss_koraggAI : public boss_hexlord_addAI if (mightyblow_timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW, false); + DoCast(me->getVictim(), SPELL_MIGHTY_BLOW, false); mightyblow_timer = 12000; } if (coldstare_timer <= diff) diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp index d833a884e02..7768c8f05cf 100644 --- a/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp @@ -157,7 +157,7 @@ struct boss_janalaiAI : public ScriptedAI void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, me); if (pInstance) pInstance->SetData(DATA_JANALAIEVENT, DONE); @@ -165,7 +165,7 @@ struct boss_janalaiAI : public ScriptedAI void KilledUnit(Unit* victim) { - DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature); + DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), me); } void EnterCombat(Unit *who) @@ -173,7 +173,7 @@ struct boss_janalaiAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); // DoZoneInCombat(); } @@ -181,7 +181,7 @@ struct boss_janalaiAI : public ScriptedAI { if (isFlameBreathing) { - if (!m_creature->HasInArc(M_PI/6, pTarget)) + if (!me->HasInArc(M_PI/6, pTarget)) damage = 0; } } @@ -200,9 +200,9 @@ struct boss_janalaiAI : public ScriptedAI for (uint8 j = 0; j < WallNum; j++) { if (WallNum == 3) - wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); + wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0],FireWallCoords[i][1]+5*(j-1),FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); else - wall = m_creature->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); + wall = me->SummonCreature(MOB_FIRE_BOMB, FireWallCoords[i][0]-2+4*j,FireWallCoords[i][1],FireWallCoords[i][2],FireWallCoords[i][3],TEMPSUMMON_TIMED_DESPAWN,15000); if (wall) wall->CastSpell(wall, SPELL_FIRE_WALL, true); } } @@ -226,7 +226,7 @@ struct boss_janalaiAI : public ScriptedAI { std::list<Creature*> templist; float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); { CellPair pair(Trinity::ComputeCellPair(x, y)); @@ -234,12 +234,12 @@ struct boss_janalaiAI : public ScriptedAI cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); + Trinity::AllCreaturesOfEntryInRange check(me, MOB_EGG, 100); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(m_creature->GetMap())); + cell.Visit(pair, cSearcher, *(me->GetMap())); } //error_log("Eggs %d at middle", templist.size()); @@ -260,7 +260,7 @@ struct boss_janalaiAI : public ScriptedAI { std::list<Creature*> templist; float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); { CellPair pair(Trinity::ComputeCellPair(x, y)); @@ -268,12 +268,12 @@ struct boss_janalaiAI : public ScriptedAI cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); + Trinity::AllCreaturesOfEntryInRange check(me, MOB_FIRE_BOMB, 100); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(m_creature->GetMap())); + cell.Visit(pair, cSearcher, *(me->GetMap())); } for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i) { @@ -286,7 +286,7 @@ struct boss_janalaiAI : public ScriptedAI { if (BombCount < 40) { - if (Unit *FireBomb = Unit::GetUnit((*m_creature), FireBombGUIDs[BombCount])) + if (Unit *FireBomb = Unit::GetUnit((*me), FireBombGUIDs[BombCount])) { FireBomb->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); DoCast(FireBomb, SPELL_FIRE_BOMB_THROW, true); @@ -303,7 +303,7 @@ struct boss_janalaiAI : public ScriptedAI Boom(); isBombing = false; BombTimer = urand(20000,40000); - m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); + me->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); if (EnrageTimer <= 10000) EnrageTimer = 0; else @@ -315,7 +315,7 @@ struct boss_janalaiAI : public ScriptedAI { if (isFlameBreathing) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) isFlameBreathing = false; else return; @@ -334,36 +334,36 @@ struct boss_janalaiAI : public ScriptedAI return; //enrage if under 25% hp before 5 min. - if (!enraged && m_creature->GetHealth() * 4 < m_creature->GetMaxHealth()) + if (!enraged && me->GetHealth() * 4 < me->GetMaxHealth()) EnrageTimer = 0; if (EnrageTimer <= diff) { if (!enraged) { - DoCast(m_creature, SPELL_ENRAGE, true); + DoCast(me, SPELL_ENRAGE, true); enraged = true; EnrageTimer = 300000; } else { - DoScriptText(SAY_BERSERK, m_creature); - DoCast(m_creature, SPELL_BERSERK, true); + DoScriptText(SAY_BERSERK, me); + DoCast(me, SPELL_BERSERK, true); EnrageTimer = 300000; } } else EnrageTimer -= diff; if (BombTimer <= diff) { - DoScriptText(SAY_FIRE_BOMBS, m_creature); + DoScriptText(SAY_FIRE_BOMBS, me); - m_creature->AttackStop(); - m_creature->GetMotionMaster()->Clear(); + me->AttackStop(); + me->GetMotionMaster()->Clear(); DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); - m_creature->StopMoving(); - DoCast(m_creature, SPELL_FIRE_BOMB_CHANNEL, false); - //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); - //DoCast(m_creature, SPELL_TELE_TO_CENTER, true); + me->StopMoving(); + DoCast(me, SPELL_FIRE_BOMB_CHANNEL, false); + //DoTeleportPlayer(me, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); + //DoCast(me, SPELL_TELE_TO_CENTER, true); FireWall(); SpawnBombs(); @@ -371,7 +371,7 @@ struct boss_janalaiAI : public ScriptedAI BombSequenceTimer = 100; //Teleport every Player into the middle - Map* pMap = m_creature->GetMap(); + Map* pMap = me->GetMap(); if (!pMap->IsDungeon()) return; Map::PlayerList const &PlayerList = pMap->GetPlayers(); for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) @@ -384,15 +384,15 @@ struct boss_janalaiAI : public ScriptedAI if (!noeggs) { - if (100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth()) + if (100 * me->GetHealth() < 35 * me->GetMaxHealth()) { - DoScriptText(SAY_ALL_EGGS, m_creature); + DoScriptText(SAY_ALL_EGGS, me); - m_creature->AttackStop(); - m_creature->GetMotionMaster()->Clear(); + me->AttackStop(); + me->GetMotionMaster()->Clear(); DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); - m_creature->StopMoving(); - DoCast(m_creature, SPELL_HATCH_ALL, false); + me->StopMoving(); + DoCast(me, SPELL_HATCH_ALL, false); HatchAllEggs(2); noeggs = true; } @@ -400,9 +400,9 @@ struct boss_janalaiAI : public ScriptedAI { if (HatchAllEggs(0)) { - DoScriptText(SAY_SUMMON_HATCHER, m_creature); - m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); + DoScriptText(SAY_SUMMON_HATCHER, me); + me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); + me->SummonCreature(MOB_AMANI_HATCHER,hatcherway[1][0][0],hatcherway[1][0][1],hatcherway[1][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); HatcherTimer = 90000; } else @@ -418,10 +418,10 @@ struct boss_janalaiAI : public ScriptedAI { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) { - m_creature->AttackStop(); - m_creature->GetMotionMaster()->Clear(); + me->AttackStop(); + me->GetMotionMaster()->Clear(); DoCast(pTarget, SPELL_FLAME_BREATH, false); - m_creature->StopMoving(); + me->StopMoving(); isFlameBreathing = true; } FireBreathTimer = 8000; @@ -443,7 +443,7 @@ struct mob_janalai_firebombAI : public ScriptedAI void SpellHit(Unit *caster, const SpellEntry *spell) { if (spell->Id == SPELL_FIRE_BOMB_THROW) - DoCast(m_creature, SPELL_FIRE_BOMB_DUMMY, true); + DoCast(me, SPELL_FIRE_BOMB_DUMMY, true); } void EnterCombat(Unit* who) {} @@ -480,7 +480,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI void Reset() { me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - side =(m_creature->GetPositionY() < 1150); + side =(me->GetPositionY() < 1150); waypoint = 0; isHatching = false; hasChangedSide = false; @@ -492,7 +492,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI { std::list<Creature*> templist; float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); { CellPair pair(Trinity::ComputeCellPair(x, y)); @@ -500,12 +500,12 @@ struct mob_amanishi_hatcherAI : public ScriptedAI cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(m_creature, templist, check); + Trinity::AllCreaturesOfEntryInRange check(me, 23817, 50); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(me, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(m_creature->GetMap())); + cell.Visit(pair, cSearcher, *(me->GetMap())); } //error_log("Eggs %d at %d", templist.size(), side); @@ -539,7 +539,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI { if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) { - m_creature->DisappearAndDie(); + me->DisappearAndDie(); return; } @@ -547,8 +547,8 @@ struct mob_amanishi_hatcherAI : public ScriptedAI { if (WaitTimer) { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]); + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0,hatcherway[side][waypoint][0],hatcherway[side][waypoint][1],hatcherway[side][waypoint][2]); ++waypoint; WaitTimer = 0; } @@ -571,7 +571,7 @@ struct mob_amanishi_hatcherAI : public ScriptedAI hasChangedSide = true; } else - m_creature->DisappearAndDie(); + me->DisappearAndDie(); } else WaitTimer -= diff; } @@ -596,12 +596,12 @@ struct mob_hatchlingAI : public ScriptedAI void Reset() { BuffetTimer = 7000; - if (m_creature->GetPositionY() > 1150) - m_creature->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]); + if (me->GetPositionY() > 1150) + me->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]); else - m_creature->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]); + me->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + me->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); } void EnterCombat(Unit *who) {/*DoZoneInCombat();*/} @@ -610,7 +610,7 @@ struct mob_hatchlingAI : public ScriptedAI { if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) { - m_creature->DisappearAndDie(); + me->DisappearAndDie(); return; } @@ -619,7 +619,7 @@ struct mob_hatchlingAI : public ScriptedAI if (BuffetTimer <= diff) { - DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET, false); + DoCast(me->getVictim(), SPELL_FLAMEBUFFET, false); BuffetTimer = 10000; } else BuffetTimer -= diff; @@ -646,7 +646,7 @@ struct mob_eggAI : public ScriptedAI if (spell->Id == SPELL_HATCH_EGG) { DoSpawnCreature(MOB_HATCHLING, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - m_creature->SetDisplayId(11686); + me->SetDisplayId(11686); } } }; diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp index 3c3cecc9fce..64d9adf8e35 100644 --- a/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp @@ -120,15 +120,15 @@ struct boss_nalorakkAI : public ScriptedAI { if (MoveEvent) { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); inMove = false; waitTimer = 0; - m_creature->SetSpeed(MOVE_RUN,2); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + me->SetSpeed(MOVE_RUN,2); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); }else { - (*m_creature).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]); + (*me).GetMotionMaster()->MovePoint(0,NalorakkWay[7][0],NalorakkWay[7][1],NalorakkWay[7][2]); } if (pInstance) @@ -141,14 +141,14 @@ struct boss_nalorakkAI : public ScriptedAI Berserk_Timer = 600000; inBearForm = false; - // m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id + // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); // TODO: find the correct equipment id } void SendAttacker(Unit *pTarget) { std::list<Creature*> templist; float x, y, z; - m_creature->GetPosition(x, y, z); + me->GetPosition(x, y, z); { CellPair pair(Trinity::ComputeCellPair(x, y)); @@ -156,12 +156,12 @@ struct boss_nalorakkAI : public ScriptedAI cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::AllFriendlyCreaturesInGrid check(m_creature); - Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(m_creature, templist, check); + Trinity::AllFriendlyCreaturesInGrid check(me); + Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> searcher(me, templist, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>, GridTypeMapContainer> cSearcher(searcher); - cell.Visit(pair, cSearcher, *(m_creature->GetMap())); + cell.Visit(pair, cSearcher, *(me->GetMap())); } if (!templist.size()) @@ -169,7 +169,7 @@ struct boss_nalorakkAI : public ScriptedAI for (std::list<Creature*>::const_iterator i = templist.begin(); i != templist.end(); ++i) { - if ((*i) && m_creature->IsWithinDistInMap((*i),25)) + if ((*i) && me->IsWithinDistInMap((*i),25)) { (*i)->SetNoCallAssistance(true); (*i)->AI()->AttackStart(pTarget); @@ -191,19 +191,19 @@ struct boss_nalorakkAI : public ScriptedAI } else { - if (m_creature->IsHostileTo(who)) + if (me->IsHostileTo(who)) { if (!inMove) { switch(MovePhase) { case 0: - if (m_creature->IsWithinDistInMap(who, 50)) + if (me->IsWithinDistInMap(who, 50)) { - m_creature->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE1); + me->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE1); - (*m_creature).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]); + (*me).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]); MovePhase ++; inMove = true; @@ -211,12 +211,12 @@ struct boss_nalorakkAI : public ScriptedAI } break; case 2: - if (m_creature->IsWithinDistInMap(who, 40)) + if (me->IsWithinDistInMap(who, 40)) { - m_creature->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE2); + me->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE2); - (*m_creature).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]); + (*me).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]); MovePhase ++; inMove = true; @@ -224,12 +224,12 @@ struct boss_nalorakkAI : public ScriptedAI } break; case 5: - if (m_creature->IsWithinDistInMap(who, 40)) + if (me->IsWithinDistInMap(who, 40)) { - m_creature->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE3); + me->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE3); - (*m_creature).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]); + (*me).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]); MovePhase ++; inMove = true; @@ -237,15 +237,15 @@ struct boss_nalorakkAI : public ScriptedAI } break; case 7: - if (m_creature->IsWithinDistInMap(who, 50)) + if (me->IsWithinDistInMap(who, 50)) { SendAttacker(who); - m_creature->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE4); + me->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_NALORAKK_WAVE4); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); MoveEvent = false; } @@ -261,8 +261,8 @@ struct boss_nalorakkAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS); - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO); + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_AGGRO); DoZoneInCombat(); } @@ -271,8 +271,8 @@ struct boss_nalorakkAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_NALORAKKEVENT, DONE); - m_creature->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH); + me->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me, SOUND_YELL_DEATH); } void KilledUnit(Unit* victim) @@ -280,12 +280,12 @@ struct boss_nalorakkAI : public ScriptedAI switch (urand(0,1)) { case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE); + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_ONE); break; case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO); + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_KILL_TWO); break; } } @@ -306,7 +306,7 @@ struct boss_nalorakkAI : public ScriptedAI switch(MovePhase) { case 2: - m_creature->SetOrientation(3.1415*2); + me->SetOrientation(3.1415*2); inMove = false; return; case 1: @@ -318,11 +318,11 @@ struct boss_nalorakkAI : public ScriptedAI inMove = true; return; case 5: - m_creature->SetOrientation(3.1415*0.5); + me->SetOrientation(3.1415*0.5); inMove = false; return; case 7: - m_creature->SetOrientation(3.1415*0.5); + me->SetOrientation(3.1415*0.5); inMove = false; return; } @@ -337,8 +337,8 @@ struct boss_nalorakkAI : public ScriptedAI if (inMove) if (waitTimer <= diff) { - (*m_creature).GetMotionMaster()->MovementExpired(); - (*m_creature).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]); + (*me).GetMotionMaster()->MovementExpired(); + (*me).GetMotionMaster()->MovePoint(MovePhase,NalorakkWay[MovePhase][0],NalorakkWay[MovePhase][1],NalorakkWay[MovePhase][2]); waitTimer = 0; } else waitTimer -= diff; } @@ -348,9 +348,9 @@ struct boss_nalorakkAI : public ScriptedAI if (Berserk_Timer <= diff) { - DoCast(m_creature, SPELL_BERSERK, true); - m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_BERSERK); + DoCast(me, SPELL_BERSERK, true); + me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_BERSERK); Berserk_Timer = 600000; } else Berserk_Timer -= diff; @@ -358,10 +358,10 @@ struct boss_nalorakkAI : public ScriptedAI { if (inBearForm) { - // m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); - m_creature->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL); - m_creature->RemoveAurasDueToSpell(SPELL_BEARFORM); + // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); + me->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_TOTROLL); + me->RemoveAurasDueToSpell(SPELL_BEARFORM); Surge_Timer = 15000 + rand()%5000; BrutalSwipe_Timer = 7000 + rand()%5000; Mangle_Timer = 10000 + rand()%5000; @@ -370,10 +370,10 @@ struct boss_nalorakkAI : public ScriptedAI } else { - // m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); - m_creature->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR); - DoCast(m_creature, SPELL_BEARFORM, true); + // me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); + me->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_TOBEAR); + DoCast(me, SPELL_BEARFORM, true); LaceratingSlash_Timer = 2000; // dur 18s RendFlesh_Timer = 3000; // dur 5s DeafeningRoar_Timer = 5000 + rand()%5000; // dur 2s @@ -386,15 +386,15 @@ struct boss_nalorakkAI : public ScriptedAI { if (BrutalSwipe_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_BRUTALSWIPE); + DoCast(me->getVictim(), SPELL_BRUTALSWIPE); BrutalSwipe_Timer = 7000 + rand()%5000; } else BrutalSwipe_Timer -= diff; if (Mangle_Timer <= diff) { - if (m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT)) + if (me->getVictim() && !me->getVictim()->HasAura(SPELL_MANGLEEFFECT)) { - DoCast(m_creature->getVictim(), SPELL_MANGLE); + DoCast(me->getVictim(), SPELL_MANGLE); Mangle_Timer = 1000; } else Mangle_Timer = 10000 + rand()%5000; @@ -402,8 +402,8 @@ struct boss_nalorakkAI : public ScriptedAI if (Surge_Timer <= diff) { - m_creature->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE); + me->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_YELL_SURGE); Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); if (pTarget) DoCast(pTarget, SPELL_SURGE); @@ -414,19 +414,19 @@ struct boss_nalorakkAI : public ScriptedAI { if (LaceratingSlash_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH); + DoCast(me->getVictim(), SPELL_LACERATINGSLASH); LaceratingSlash_Timer = 18000 + rand()%5000; } else LaceratingSlash_Timer -= diff; if (RendFlesh_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_RENDFLESH); + DoCast(me->getVictim(), SPELL_RENDFLESH); RendFlesh_Timer = 5000 + rand()%5000; } else RendFlesh_Timer -= diff; if (DeafeningRoar_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_DEAFENINGROAR); + DoCast(me->getVictim(), SPELL_DEAFENINGROAR); DeafeningRoar_Timer = 15000 + rand()%5000; } else DeafeningRoar_Timer -= diff; } diff --git a/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp b/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp index 15e7c080968..b787dcc7f9b 100644 --- a/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp @@ -140,7 +140,7 @@ static TransformStruct Transform[] = struct boss_zuljinAI : public ScriptedAI { - boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(me) { pInstance = c->GetInstanceData(); } @@ -180,7 +180,7 @@ struct boss_zuljinAI : public ScriptedAI Phase = 0; - health_20 = m_creature->GetMaxHealth()*0.2; + health_20 = me->GetMaxHealth()*0.2; Intro_Timer = 37000; Berserk_Timer = 600000; @@ -205,9 +205,9 @@ struct boss_zuljinAI : public ScriptedAI Summons.DespawnAll(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); - //m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); + //me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); + //me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); } void EnterCombat(Unit *who) @@ -217,8 +217,8 @@ struct boss_zuljinAI : public ScriptedAI DoZoneInCombat(); - m_creature->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_INTRO); + me->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(me, SOUND_INTRO); SpawnAdds(); EnterPhase(0); } @@ -231,12 +231,12 @@ struct boss_zuljinAI : public ScriptedAI switch (urand(0,1)) { case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_ONE); + me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_ONE); break; case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_TWO); + me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_KILL_TWO); break; } } @@ -246,11 +246,11 @@ struct boss_zuljinAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_ZULJINEVENT, DONE); - m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); + me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_DEATH); Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); - if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[3])) + if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[3])) Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } @@ -264,21 +264,21 @@ struct boss_zuljinAI : public ScriptedAI void DoMeleeAttackIfReady() { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if (!me->IsNonMeleeSpellCasted(false)) { - if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (me->isAttackReady() && me->IsWithinMeleeRange(me->getVictim())) { if (Phase == 1 && !Overpower_Timer) { - uint32 health = m_creature->getVictim()->GetHealth(); - m_creature->AttackerStateUpdate(m_creature->getVictim()); - if (m_creature->getVictim() && health == m_creature->getVictim()->GetHealth()) + uint32 health = me->getVictim()->GetHealth(); + me->AttackerStateUpdate(me->getVictim()); + if (me->getVictim() && health == me->getVictim()->GetHealth()) { - DoCast(m_creature->getVictim(), SPELL_OVERPOWER, false); + DoCast(me->getVictim(), SPELL_OVERPOWER, false); Overpower_Timer = 5000; } - } else m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); + } else me->AttackerStateUpdate(me->getVictim()); + me->resetAttackTimer(); } } } @@ -288,7 +288,7 @@ struct boss_zuljinAI : public ScriptedAI Creature *pCreature = NULL; for (uint8 i = 0; i < 4; ++i) { - pCreature = m_creature->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0); + pCreature = me->SummonCreature(SpiritInfo[i].entry, SpiritInfo[i].x, SpiritInfo[i].y, SpiritInfo[i].z, SpiritInfo[i].orient, TEMPSUMMON_DEAD_DESPAWN, 0); if (pCreature) { pCreature->CastSpell(pCreature, SPELL_SPIRIT_AURA, true); @@ -306,7 +306,7 @@ struct boss_zuljinAI : public ScriptedAI Unit* Temp = NULL; if (SpiritGUID[i]) { - if (Temp = Unit::GetUnit(*m_creature, SpiritGUID[i])) + if (Temp = Unit::GetUnit(*me, SpiritGUID[i])) { Temp->SetVisibility(VISIBILITY_OFF); Temp->setDeathState(DEAD); @@ -338,22 +338,22 @@ struct boss_zuljinAI : public ScriptedAI case 4: DoTeleportTo(CENTER_X, CENTER_Y, CENTER_Z, 100); DoResetThreat(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura); - DoCast(m_creature, Transform[Phase].spell); - m_creature->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, Transform[Phase].sound); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + me->RemoveAurasDueToSpell(Transform[Phase].unaura); + DoCast(me, Transform[Phase].spell); + me->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, Transform[Phase].sound); if (Phase > 0) { - if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1])) + if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); } - if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1])) - Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp + if (Unit *Temp = Unit::GetUnit(*me, SpiritGUID[NextPhase - 1])) + Temp->CastSpell(me, SPELL_SIPHON_SOUL, false); // should m cast on temp if (NextPhase == 2) { - m_creature->GetMotionMaster()->Clear(); - DoCast(m_creature, SPELL_ENERGY_STORM, true); // enemy aura + me->GetMotionMaster()->Clear(); + DoCast(me, SPELL_ENERGY_STORM, true); // enemy aura for (uint8 i = 0; i < 4; ++i) { Creature* Vortex = DoSpawnCreature(CREATURE_FEATHER_VORTEX, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); @@ -369,12 +369,12 @@ struct boss_zuljinAI : public ScriptedAI } } else - m_creature->AI()->AttackStart(m_creature->getVictim()); + me->AI()->AttackStart(me->getVictim()); if (NextPhase == 3) { - m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); + me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); Summons.DespawnEntry(CREATURE_FEATHER_VORTEX); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + me->GetMotionMaster()->MoveChase(me->getVictim()); } break; default: @@ -390,15 +390,15 @@ struct boss_zuljinAI : public ScriptedAI if (!UpdateVictim()) return; - if (m_creature->GetHealth() < health_20 * (4 - Phase)) + if (me->GetHealth() < health_20 * (4 - Phase)) EnterPhase(Phase + 1); } if (Berserk_Timer <= diff) { - DoCast(m_creature, SPELL_BERSERK, true); - m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_BERSERK); + DoCast(me, SPELL_BERSERK, true); + me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_BERSERK); Berserk_Timer = 60000; } else Berserk_Timer -= diff; @@ -409,15 +409,15 @@ struct boss_zuljinAI : public ScriptedAI { if (Intro_Timer <= diff) { - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); + me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(me, SOUND_AGGRO); Intro_Timer = 0; } else Intro_Timer -= diff; } if (Whirlwind_Timer <= diff) { - DoCast(m_creature, SPELL_WHIRLWIND); + DoCast(me, SPELL_WHIRLWIND); Whirlwind_Timer = 15000 + rand()%5000; } else Whirlwind_Timer -= diff; @@ -432,7 +432,7 @@ struct boss_zuljinAI : public ScriptedAI case 1: if (Creeping_Paralysis_Timer <= diff) { - DoCast(m_creature, SPELL_CREEPING_PARALYSIS); + DoCast(me, SPELL_CREEPING_PARALYSIS); Creeping_Paralysis_Timer = 20000; } else Creeping_Paralysis_Timer -= diff; @@ -453,8 +453,8 @@ struct boss_zuljinAI : public ScriptedAI { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - TankGUID = m_creature->getVictim()->GetGUID(); - m_creature->SetSpeed(MOVE_RUN, 5.0f); + TankGUID = me->getVictim()->GetGUID(); + me->SetSpeed(MOVE_RUN, 5.0f); AttackStart(pTarget); // change victim Claw_Rage_Timer = 0; Claw_Loop_Timer = 500; @@ -465,21 +465,21 @@ struct boss_zuljinAI : public ScriptedAI { if (Claw_Loop_Timer <= diff) { - Unit *pTarget = m_creature->getVictim(); - if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*m_creature, TankGUID); + Unit *pTarget = me->getVictim(); + if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = Unit::GetUnit(*me, TankGUID); if (!pTarget || !pTarget->isTargetableForAttack()) pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); if (pTarget) { AttackStart(pTarget); - if (m_creature->IsWithinMeleeRange(pTarget)) + if (me->IsWithinMeleeRange(pTarget)) { DoCast(pTarget, SPELL_CLAW_RAGE_DAMAGE, true); ++Claw_Counter; if (Claw_Counter == 12) { Claw_Rage_Timer = 15000 + rand()%5000; - m_creature->SetSpeed(MOVE_RUN, 1.2f); - AttackStart(Unit::GetUnit(*m_creature, TankGUID)); + me->SetSpeed(MOVE_RUN, 1.2f); + AttackStart(Unit::GetUnit(*me, TankGUID)); TankGUID = 0; return; } @@ -502,8 +502,8 @@ struct boss_zuljinAI : public ScriptedAI { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) { - TankGUID = m_creature->getVictim()->GetGUID(); - m_creature->SetSpeed(MOVE_RUN, 5.0f); + TankGUID = me->getVictim()->GetGUID(); + me->SetSpeed(MOVE_RUN, 5.0f); AttackStart(pTarget); // change victim Lynx_Rush_Timer = 0; Claw_Counter = 0; @@ -511,7 +511,7 @@ struct boss_zuljinAI : public ScriptedAI } else if (!Lynx_Rush_Timer) { - Unit *pTarget = m_creature->getVictim(); + Unit *pTarget = me->getVictim(); if (!pTarget || !pTarget->isTargetableForAttack()) { pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); @@ -519,15 +519,15 @@ struct boss_zuljinAI : public ScriptedAI } if (pTarget) { - if (m_creature->IsWithinMeleeRange(pTarget)) + if (me->IsWithinMeleeRange(pTarget)) { DoCast(pTarget, SPELL_LYNX_RUSH_DAMAGE, true); ++Claw_Counter; if (Claw_Counter == 9) { Lynx_Rush_Timer = 15000 + rand()%5000; - m_creature->SetSpeed(MOVE_RUN, 1.2f); - AttackStart(Unit::GetUnit(*m_creature, TankGUID)); + me->SetSpeed(MOVE_RUN, 1.2f); + AttackStart(Unit::GetUnit(*me, TankGUID)); TankGUID = 0; } else @@ -546,7 +546,7 @@ struct boss_zuljinAI : public ScriptedAI case 4: if (Flame_Whirl_Timer <= diff) { - DoCast(m_creature, SPELL_FLAME_WHIRL); + DoCast(me, SPELL_FLAME_WHIRL); Flame_Whirl_Timer = 12000; }Flame_Whirl_Timer -= diff; @@ -560,8 +560,8 @@ struct boss_zuljinAI : public ScriptedAI if (Flame_Breath_Timer <= diff) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->SetInFront(pTarget); - DoCast(m_creature, SPELL_FLAME_BREATH); + me->SetInFront(pTarget); + DoCast(me, SPELL_FLAME_BREATH); Flame_Breath_Timer = 10000; } else Flame_Breath_Timer -= diff; break; @@ -597,7 +597,7 @@ struct feather_vortexAI : public ScriptedAI void UpdateAI(const uint32 diff) { //if the vortex reach the target, it change his target to another player - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (me->IsWithinMeleeRange(me->getVictim())) AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); } }; diff --git a/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp b/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp index c87c2c9a358..7d44fe05670 100644 --- a/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp +++ b/src/scripts/eastern_kingdoms/zulaman/zulaman.cpp @@ -73,7 +73,7 @@ struct npc_forest_frogAI : public ScriptedAI if (!pInstance->GetData(TYPE_RAND_VENDOR_2)) if (rand()%10 == 1) cEntry = 24409; //Kyren - if (cEntry) m_creature->UpdateEntry(cEntry); + if (cEntry) me->UpdateEntry(cEntry); if (cEntry == 24408) pInstance->SetData(TYPE_RAND_VENDOR_1,DONE); if (cEntry == 24409) pInstance->SetData(TYPE_RAND_VENDOR_2,DONE); @@ -82,7 +82,7 @@ struct npc_forest_frogAI : public ScriptedAI void SpellHit(Unit *caster, const SpellEntry *spell) { - if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && m_creature->GetEntry() == ENTRY_FOREST_FROG) + if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && me->GetEntry() == ENTRY_FOREST_FROG) { //increase or decrease chance of mojo? if (rand()%99 == 50) DoCast(caster, SPELL_PUSH_MOJO, true); @@ -114,12 +114,12 @@ struct npc_zulaman_hostageAI : public ScriptedAI void JustDied(Unit* who) { Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer) pPlayer->SendLoot(m_creature->GetGUID(), LOOT_CORPSE); + if (pPlayer) pPlayer->SendLoot(me->GetGUID(), LOOT_CORPSE); } void UpdateAI(const uint32 diff) { if (IsLoot) - DoCast(m_creature, 7, false); + DoCast(me, 7, false); } }; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp index 87946d0cac2..334108d5d95 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp @@ -99,13 +99,13 @@ struct boss_arlokkAI : public ScriptedAI MarkedTargetGUID = 0; - m_creature->SetDisplayId(MODEL_ID_NORMAL); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(MODEL_ID_NORMAL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } void EnterCombat(Unit* pWho) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void JustReachedHome() @@ -114,15 +114,15 @@ struct boss_arlokkAI : public ScriptedAI m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED); //we should be summoned, so despawn - m_creature->ForcedDespawn(); + me->ForcedDespawn(); } void JustDied(Unit* pKiller) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, me); - m_creature->SetDisplayId(MODEL_ID_NORMAL); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(MODEL_ID_NORMAL); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); if (m_pInstance) m_pInstance->SetData(TYPE_ARLOKK, DONE); @@ -130,16 +130,16 @@ struct boss_arlokkAI : public ScriptedAI void DoSummonPhanters() { - if (Unit *pMarkedTarget = Unit::GetUnit(*m_creature, MarkedTargetGUID)) - DoScriptText(SAY_FEAST_PANTHER, m_creature, pMarkedTarget); + if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) + DoScriptText(SAY_FEAST_PANTHER, me, pMarkedTarget); - m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + me->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); } void JustSummoned(Creature* pSummoned) { - if (Unit *pMarkedTarget = Unit::GetUnit(*m_creature, MarkedTargetGUID)) + if (Unit *pMarkedTarget = Unit::GetUnit(*me, MarkedTargetGUID)) pSummoned->AI()->AttackStart(pMarkedTarget); ++m_uiSummonCount; @@ -154,7 +154,7 @@ struct boss_arlokkAI : public ScriptedAI { if (m_uiShadowWordPain_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_SHADOWWORDPAIN); + DoCast(me->getVictim(), SPELL_SHADOWWORDPAIN); m_uiShadowWordPain_Timer = 15000; } else @@ -182,7 +182,7 @@ struct boss_arlokkAI : public ScriptedAI //Cleave_Timer if (m_uiCleave_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); + DoCast(me->getVictim(), SPELL_CLEAVE); m_uiCleave_Timer = 16000; } else @@ -191,9 +191,9 @@ struct boss_arlokkAI : public ScriptedAI //Gouge_Timer if (m_uiGouge_Timer <= uiDiff) { - DoCast(m_creature->getVictim(), SPELL_GOUGE); + DoCast(me->getVictim(), SPELL_GOUGE); - DoModifyThreatPercent(m_creature->getVictim(),-80); + DoModifyThreatPercent(me->getVictim(),-80); m_uiGouge_Timer = 17000+rand()%10000; } @@ -215,10 +215,10 @@ struct boss_arlokkAI : public ScriptedAI if (m_uiVanish_Timer <= uiDiff) { //Invisble Model - m_creature->SetDisplayId(MODEL_ID_BLANK); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(MODEL_ID_BLANK); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->AttackStop(); + me->AttackStop(); DoResetThreat(); m_bIsVanished = true; @@ -234,13 +234,13 @@ struct boss_arlokkAI : public ScriptedAI if (m_uiVisible_Timer <= uiDiff) { //The Panther Model - m_creature->SetDisplayId(MODEL_ID_PANTHER); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetDisplayId(MODEL_ID_PANTHER); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + me->UpdateDamagePhysical(BASE_ATTACK); if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) AttackStart(pTarget); diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp index cd3a6b47560..1e6827d3d3c 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp @@ -54,14 +54,14 @@ struct boss_gahzrankaAI : public ScriptedAI //Frostbreath_Timer if (Frostbreath_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_FROSTBREATH); + DoCast(me->getVictim(), SPELL_FROSTBREATH); Frostbreath_Timer = 7000 + rand()%4000; } else Frostbreath_Timer -= diff; //MassiveGeyser_Timer if (MassiveGeyser_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MASSIVEGEYSER); + DoCast(me->getVictim(), SPELL_MASSIVEGEYSER); DoResetThreat(); MassiveGeyser_Timer = 22000 + rand()%10000; @@ -70,7 +70,7 @@ struct boss_gahzrankaAI : public ScriptedAI //Slam_Timer if (Slam_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SLAM); + DoCast(me->getVictim(), SPELL_SLAM); Slam_Timer = 12000 + rand()%8000; } else Slam_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp index e53e05d4682..a2694f5f354 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp @@ -54,13 +54,13 @@ struct boss_grilekAI : public ScriptedAI if (Avartar_Timer <= diff) { - DoCast(m_creature, SPELL_AVARTAR); + DoCast(me, SPELL_AVARTAR); Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-50); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-50); if (pTarget) AttackStart(pTarget); @@ -70,7 +70,7 @@ struct boss_grilekAI : public ScriptedAI //GroundTremor_Timer if (GroundTremor_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_GROUNDTREMOR); + DoCast(me->getVictim(), SPELL_GROUNDTREMOR); GroundTremor_Timer = 12000 + rand()%4000; } else GroundTremor_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp index 134a081b95b..b1def2d619e 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp @@ -96,7 +96,7 @@ struct boss_hakkarAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void UpdateAI(const uint32 diff) @@ -107,14 +107,14 @@ struct boss_hakkarAI : public ScriptedAI //BloodSiphon_Timer if (BloodSiphon_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_BLOODSIPHON); + DoCast(me->getVictim(), SPELL_BLOODSIPHON); BloodSiphon_Timer = 90000; } else BloodSiphon_Timer -= diff; //CorruptedBlood_Timer if (CorruptedBlood_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CORRUPTEDBLOOD); + DoCast(me->getVictim(), SPELL_CORRUPTEDBLOOD); CorruptedBlood_Timer = 30000 + rand()%15000; } else CorruptedBlood_Timer -= diff; @@ -138,7 +138,7 @@ struct boss_hakkarAI : public ScriptedAI if (!Enraged && Enrage_Timer <= diff) { - DoCast(m_creature, SPELL_ENRAGE); + DoCast(me, SPELL_ENRAGE); Enraged = true; } else Enrage_Timer -= diff; @@ -151,7 +151,7 @@ struct boss_hakkarAI : public ScriptedAI { if (AspectOfJeklik_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_JEKLIK); + DoCast(me->getVictim(), SPELL_ASPECT_OF_JEKLIK); AspectOfJeklik_Timer = 10000 + rand()%4000; } else AspectOfJeklik_Timer -= diff; } @@ -168,7 +168,7 @@ struct boss_hakkarAI : public ScriptedAI { if (AspectOfVenoxis_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_VENOXIS); + DoCast(me->getVictim(), SPELL_ASPECT_OF_VENOXIS); AspectOfVenoxis_Timer = 8000; } else AspectOfVenoxis_Timer -= diff; } @@ -185,7 +185,7 @@ struct boss_hakkarAI : public ScriptedAI { if (AspectOfMarli_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_MARLI); + DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); AspectOfMarli_Timer = 10000; } else AspectOfMarli_Timer -= diff; @@ -203,7 +203,7 @@ struct boss_hakkarAI : public ScriptedAI { if (AspectOfThekal_Timer <= diff) { - DoCast(m_creature, SPELL_ASPECT_OF_THEKAL); + DoCast(me, SPELL_ASPECT_OF_THEKAL); AspectOfThekal_Timer = 15000; } else AspectOfThekal_Timer -= diff; } @@ -220,7 +220,7 @@ struct boss_hakkarAI : public ScriptedAI { if (AspectOfArlokk_Timer <= diff) { - DoCast(m_creature, SPELL_ASPECT_OF_ARLOKK); + DoCast(me, SPELL_ASPECT_OF_ARLOKK); DoResetThreat(); AspectOfArlokk_Timer = 10000 + rand()%5000; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp index e1e0c0788a1..6107607f8f0 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp @@ -54,14 +54,14 @@ struct boss_hazzarahAI : public ScriptedAI //ManaBurn_Timer if (ManaBurn_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MANABURN); + DoCast(me->getVictim(), SPELL_MANABURN); ManaBurn_Timer = 8000 + rand()%8000; } else ManaBurn_Timer -= diff; //Sleep_Timer if (Sleep_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SLEEP); + DoCast(me->getVictim(), SPELL_SLEEP); Sleep_Timer = 12000 + rand()%8000; } else Sleep_Timer -= diff; @@ -77,7 +77,7 @@ struct boss_hazzarahAI : public ScriptedAI if (!pTarget) return; - Creature *Illusion = m_creature->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); + Creature *Illusion = me->SummonCreature(15163,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); if (Illusion) Illusion->AI()->AttackStart(pTarget); } diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp index 3a0302efebd..25d0679081f 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp @@ -79,13 +79,13 @@ struct boss_jeklikAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); - DoCast(m_creature, SPELL_BAT_FORM); + DoScriptText(SAY_AGGRO, me); + DoCast(me, SPELL_BAT_FORM); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, me); if (m_pInstance) m_pInstance->SetData(TYPE_JEKLIK, DONE); @@ -96,9 +96,9 @@ struct boss_jeklikAI : public ScriptedAI if (!UpdateVictim()) return; - if (m_creature->getVictim() && m_creature->isAlive()) + if (me->getVictim() && me->isAlive()) { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50)) + if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) { if (Charge_Timer <= diff) { @@ -113,13 +113,13 @@ struct boss_jeklikAI : public ScriptedAI if (SonicBurst_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SONICBURST); + DoCast(me->getVictim(), SPELL_SONICBURST); SonicBurst_Timer = 8000 + rand()%5000; } else SonicBurst_Timer -= diff; if (Screech_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SCREECH); + DoCast(me->getVictim(), SPELL_SCREECH); Screech_Timer = 18000 + rand()%8000; } else Screech_Timer -= diff; @@ -128,21 +128,21 @@ struct boss_jeklikAI : public ScriptedAI Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); Creature* Bat = NULL; - Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Bat = me->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Bat = me->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); - Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Bat = me->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (pTarget && Bat) Bat ->AI()->AttackStart(pTarget); SpawnBats_Timer = 60000; @@ -163,21 +163,21 @@ struct boss_jeklikAI : public ScriptedAI if (MindFlay_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + DoCast(me->getVictim(), SPELL_MIND_FLAY); MindFlay_Timer = 16000; }MindFlay_Timer -=diff; if (ChainMindFlay_Timer <= diff) { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(), SPELL_CHAIN_MIND_FLAY); + me->InterruptNonMeleeSpells(false); + DoCast(me->getVictim(), SPELL_CHAIN_MIND_FLAY); ChainMindFlay_Timer = 15000 + rand()%15000; }ChainMindFlay_Timer -=diff; if (GreaterHeal_Timer <= diff) { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_GREATERHEAL); + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_GREATERHEAL); GreaterHeal_Timer = 25000 + rand()%10000; }GreaterHeal_Timer -=diff; @@ -187,7 +187,7 @@ struct boss_jeklikAI : public ScriptedAI if (!pTarget) return; - Creature* FlyingBat = m_creature->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Creature* FlyingBat = me->SummonCreature(14965, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (FlyingBat) FlyingBat->AI()->AttackStart(pTarget); @@ -196,7 +196,7 @@ struct boss_jeklikAI : public ScriptedAI } else { - m_creature->SetDisplayId(15219); + me->SetDisplayId(15219); DoResetThreat(); PhaseTwo = true; } @@ -225,7 +225,7 @@ struct mob_batriderAI : public ScriptedAI Bomb_Timer = 2000; Check_Timer = 1000; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } void EnterCombat(Unit *who) {} @@ -252,8 +252,8 @@ struct mob_batriderAI : public ScriptedAI { if (m_pInstance->GetData(TYPE_JEKLIK) == DONE) { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); + me->setDeathState(JUST_DIED); + me->RemoveCorpse(); return; } } diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp index 5673fbfc4a8..77475ae3d41 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp @@ -60,7 +60,7 @@ struct boss_jindoAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void UpdateAI(const uint32 diff) @@ -71,25 +71,25 @@ struct boss_jindoAI : public ScriptedAI //BrainWashTotem_Timer if (BrainWashTotem_Timer <= diff) { - DoCast(m_creature, SPELL_BRAINWASHTOTEM); + DoCast(me, SPELL_BRAINWASHTOTEM); BrainWashTotem_Timer = 18000 + rand()%8000; } else BrainWashTotem_Timer -= diff; //HealingWard_Timer if (HealingWard_Timer <= diff) { - //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD); - m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); + //DoCast(me, SPELL_POWERFULLHEALINGWARD); + me->SummonCreature(14987, me->GetPositionX()+3, me->GetPositionY()-2, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); HealingWard_Timer = 14000 + rand()%6000; } else HealingWard_Timer -= diff; //Hex_Timer if (Hex_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_HEX); + DoCast(me->getVictim(), SPELL_HEX); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-80); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-80); Hex_Timer = 12000 + rand()%8000; } else Hex_Timer -= diff; @@ -101,7 +101,7 @@ struct boss_jindoAI : public ScriptedAI { DoCast(pTarget, SPELL_DELUSIONSOFJINDO); - Creature *Shade = m_creature->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Creature *Shade = me->SummonCreature(14986, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Shade) Shade->AI()->AttackStart(pTarget); } @@ -118,35 +118,35 @@ struct boss_jindoAI : public ScriptedAI { DoTeleportPlayer(pTarget, -11583.7783,-1249.4278,77.5471,4.745); - if (DoGetThreat(m_creature->getVictim())) + if (DoGetThreat(me->getVictim())) DoModifyThreatPercent(pTarget,-100); Creature *Skeletons; - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-2, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()-4, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-2, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()+4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX(), pTarget->GetPositionY()-4, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); - Skeletons = m_creature->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Skeletons = me->SummonCreature(14826, pTarget->GetPositionX()+3, pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Skeletons) Skeletons->AI()->AttackStart(pTarget); } @@ -186,7 +186,7 @@ struct mob_healing_wardAI : public ScriptedAI { if (pInstance) { - Unit *pJindo = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JINDO)); + Unit *pJindo = Unit::GetUnit((*me), pInstance->GetData64(DATA_JINDO)); if (pJindo) DoCast(pJindo, SPELL_HEAL); } @@ -207,7 +207,7 @@ struct mob_shade_of_jindoAI : public ScriptedAI void Reset() { ShadowShock_Timer = 1000; - DoCast(m_creature, SPELL_INVISIBLE, true); + DoCast(me, SPELL_INVISIBLE, true); } void EnterCombat(Unit *who){} @@ -218,7 +218,7 @@ struct mob_shade_of_jindoAI : public ScriptedAI //ShadowShock_Timer if (ShadowShock_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SHADOWSHOCK); + DoCast(me->getVictim(), SPELL_SHADOWSHOCK); ShadowShock_Timer = 2000; } else ShadowShock_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp index 56ebe4a5c4b..4d982147557 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp @@ -92,7 +92,7 @@ struct boss_mandokirAI : public ScriptedAI RaptorDead = false; CombatStart = false; - DoCast(m_creature, 23243); + DoCast(me, 23243); } void KilledUnit(Unit* victim) @@ -103,21 +103,21 @@ struct boss_mandokirAI : public ScriptedAI if (KillCount == 3) { - DoScriptText(SAY_DING_KILL, m_creature); + DoScriptText(SAY_DING_KILL, me); if (m_pInstance) { uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO); if (JindoGUID) { - if (Unit* jTemp = Unit::GetUnit(*m_creature,JindoGUID)) + if (Unit* jTemp = Unit::GetUnit(*me,JindoGUID)) { if (jTemp->isAlive()) DoScriptText(SAY_GRATS_JINDO, jTemp); } } } - DoCast(m_creature, SPELL_LEVEL_UP, true); + DoCast(me, SPELL_LEVEL_UP, true); KillCount = 0; } } @@ -125,7 +125,7 @@ struct boss_mandokirAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void UpdateAI(const uint32 diff) @@ -133,15 +133,15 @@ struct boss_mandokirAI : public ScriptedAI if (!UpdateVictim()) return; - if (m_creature->getVictim() && m_creature->isAlive()) + if (me->getVictim() && me->isAlive()) { if (!CombatStart) { //At combat Start Mandokir is mounted so we must unmount it first - m_creature->Unmount(); + me->Unmount(); //And summon his raptor - m_creature->SummonCreature(14988, m_creature->getVictim()->GetPositionX(), m_creature->getVictim()->GetPositionY(), m_creature->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); + me->SummonCreature(14988, me->getVictim()->GetPositionX(), me->getVictim()->GetPositionY(), me->getVictim()->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); CombatStart = true; } @@ -149,7 +149,7 @@ struct boss_mandokirAI : public ScriptedAI { if (WatchTarget) //If someone is watched and If the Position of the watched target is different from the one stored, or are attacking, mandokir will charge him { - Unit* pUnit = Unit::GetUnit(*m_creature, WatchTarget); + Unit* pUnit = Unit::GetUnit(*me, WatchTarget); if (pUnit && ( targetX != pUnit->GetPositionX() || @@ -157,14 +157,14 @@ struct boss_mandokirAI : public ScriptedAI targetZ != pUnit->GetPositionZ() || pUnit->isInCombat())) { - if (m_creature->IsWithinMeleeRange(pUnit)) + if (me->IsWithinMeleeRange(pUnit)) { DoCast(pUnit, 24316); } else { DoCast(pUnit, SPELL_CHARGE); - //m_creature->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1); + //me->SendMonsterMove(pUnit->GetPositionX(), pUnit->GetPositionY(), pUnit->GetPositionZ(), 0, true,1); AttackStart(pUnit); } } @@ -177,7 +177,7 @@ struct boss_mandokirAI : public ScriptedAI { if (Unit* p = SelectUnit(SELECT_TARGET_RANDOM,0)) { - DoScriptText(SAY_WATCH, m_creature, p); + DoScriptText(SAY_WATCH, me, p); DoCast(p, SPELL_WATCH); WatchTarget = p->GetGUID(); someWatched = true; @@ -187,7 +187,7 @@ struct boss_mandokirAI : public ScriptedAI if ((Watch_Timer < 1000) && endWatch) //1 sec before the debuf expire, store the target position { - Unit* pUnit = Unit::GetUnit(*m_creature, WatchTarget); + Unit* pUnit = Unit::GetUnit(*me, WatchTarget); if (pUnit) { targetX = pUnit->GetPositionX(); @@ -202,14 +202,14 @@ struct boss_mandokirAI : public ScriptedAI //Cleave if (Cleave_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); + DoCast(me->getVictim(), SPELL_CLEAVE); Cleave_Timer = 7000; } else Cleave_Timer -= diff; //Whirlwind if (Whirlwind_Timer <= diff) { - DoCast(m_creature, SPELL_WHIRLWIND); + DoCast(me, SPELL_WHIRLWIND); Whirlwind_Timer = 18000; } else Whirlwind_Timer -= diff; @@ -218,26 +218,26 @@ struct boss_mandokirAI : public ScriptedAI { TargetInRange = 0; - std::list<HostileReference*>::const_iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) + std::list<HostileReference*>::const_iterator i = me->getThreatManager().getThreatList().begin(); + for (; i != me->getThreatManager().getThreatList().end(); ++i) { - Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid()); - if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) + Unit* pUnit = Unit::GetUnit(*me, (*i)->getUnitGuid()); + if (pUnit && me->IsWithinMeleeRange(pUnit)) ++TargetInRange; } if (TargetInRange > 3) - DoCast(m_creature->getVictim(), SPELL_FEAR); + DoCast(me->getVictim(), SPELL_FEAR); Fear_Timer = 4000; } else Fear_Timer -=diff; //Mortal Strike if target below 50% hp - if (m_creature->getVictim() && m_creature->getVictim()->GetHealth() < m_creature->getVictim()->GetMaxHealth()*0.5) + if (me->getVictim() && me->getVictim()->GetHealth() < me->getVictim()->GetMaxHealth()*0.5) { if (MortalStrike_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); MortalStrike_Timer = 15000; } else MortalStrike_Timer -= diff; } @@ -251,7 +251,7 @@ struct boss_mandokirAI : public ScriptedAI { if (!RaptorDead) { - DoCast(m_creature, SPELL_ENRAGE); + DoCast(me, SPELL_ENRAGE); RaptorDead = true; } } @@ -298,7 +298,7 @@ struct mob_ohganAI : public ScriptedAI //SunderArmor_Timer if (SunderArmor_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SUNDERARMOR); + DoCast(me->getVictim(), SPELL_SUNDERARMOR); SunderArmor_Timer = 10000 + rand()%5000; } else SunderArmor_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp index 7be13a76c45..608bc028b2d 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp @@ -74,12 +74,12 @@ struct boss_marliAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, me); if (m_pInstance) m_pInstance->SetData(TYPE_MARLI, DONE); } @@ -89,23 +89,23 @@ struct boss_marliAI : public ScriptedAI if (!UpdateVictim()) return; - if (m_creature->getVictim() && m_creature->isAlive()) + if (me->getVictim() && me->isAlive()) { if (PoisonVolley_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_POISONVOLLEY); + DoCast(me->getVictim(), SPELL_POISONVOLLEY); PoisonVolley_Timer = 10000 + rand()%10000; } else PoisonVolley_Timer -= diff; if (!PhaseTwo && Aspect_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_ASPECT_OF_MARLI); + DoCast(me->getVictim(), SPELL_ASPECT_OF_MARLI); Aspect_Timer = 13000 + rand()%5000; } else Aspect_Timer -= diff; if (!Spawned && SpawnStartSpiders_Timer <= diff) { - DoScriptText(SAY_SPIDER_SPAWN, m_creature); + DoScriptText(SAY_SPIDER_SPAWN, me); Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0); if (!pTarget) @@ -113,16 +113,16 @@ struct boss_marliAI : public ScriptedAI Creature *Spider = NULL; - Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(pTarget); - Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(pTarget); - Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(pTarget); - Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(pTarget); @@ -135,7 +135,7 @@ struct boss_marliAI : public ScriptedAI if (!pTarget) return; - Creature *Spider = m_creature->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Creature *Spider = me->SummonCreature(15041,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Spider) Spider->AI()->AttackStart(pTarget); SpawnSpider_Timer = 12000 + rand()%5000; @@ -143,16 +143,16 @@ struct boss_marliAI : public ScriptedAI if (!PhaseTwo && Transform_Timer <= diff) { - DoScriptText(SAY_TRANSFORM, m_creature); - DoCast(m_creature, SPELL_SPIDER_FORM); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - DoCast(m_creature->getVictim(), SPELL_ENVOLWINGWEB); + DoScriptText(SAY_TRANSFORM, me); + DoCast(me, SPELL_SPIDER_FORM); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + me->UpdateDamagePhysical(BASE_ATTACK); + DoCast(me->getVictim(), SPELL_ENVOLWINGWEB); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-100); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-100); PhaseTwo = true; Transform_Timer = urand(35000,60000); @@ -174,8 +174,8 @@ struct boss_marliAI : public ScriptedAI if (pTarget) { DoCast(pTarget, SPELL_CHARGE); - //m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0); - //m_creature->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1); + //me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0); + //me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1); AttackStart(pTarget); } @@ -184,11 +184,11 @@ struct boss_marliAI : public ScriptedAI if (TransformBack_Timer <= diff) { - m_creature->SetDisplayId(15220); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); + me->SetDisplayId(15220); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); + me->UpdateDamagePhysical(BASE_ATTACK); PhaseTwo = false; TransformBack_Timer = urand(25000,40000); @@ -226,7 +226,7 @@ struct mob_spawn_of_marliAI : public ScriptedAI //LevelUp_Timer if (LevelUp_Timer <= diff) { - DoCast(m_creature, SPELL_LEVELUP); + DoCast(me, SPELL_LEVELUP); LevelUp_Timer = 3000; } else LevelUp_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp index 1bc15936035..706d751e881 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp @@ -66,12 +66,12 @@ struct boss_renatakiAI : public ScriptedAI //Invisible_Timer if (Invisible_Timer <= diff) { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + me->InterruptSpell(CURRENT_GENERIC_SPELL); SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - m_creature->SetDisplayId(11686); + me->SetDisplayId(11686); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = true; Invisible_Timer = 15000 + rand()%15000; @@ -98,12 +98,12 @@ struct boss_renatakiAI : public ScriptedAI { if (Visible_Timer <= diff) { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + me->InterruptSpell(CURRENT_GENERIC_SPELL); - m_creature->SetDisplayId(15268); + me->SetDisplayId(15268); SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Invisible = false; Visible_Timer = 4000; @@ -117,8 +117,8 @@ struct boss_renatakiAI : public ScriptedAI Unit *pTarget = NULL; pTarget = SelectUnit(SELECT_TARGET_RANDOM,1); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-50); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-50); if (pTarget) AttackStart(pTarget); @@ -129,7 +129,7 @@ struct boss_renatakiAI : public ScriptedAI if (!Invisible) if (ThousandBlades_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_THOUSANDBLADES); + DoCast(me->getVictim(), SPELL_THOUSANDBLADES); ThousandBlades_Timer = 7000 + rand()%5000; } else ThousandBlades_Timer -= diff; diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp index 85a03475569..0fe6e2570ee 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp @@ -91,12 +91,12 @@ struct boss_thekalAI : public ScriptedAI void EnterCombat(Unit *who) { - DoScriptText(SAY_AGGRO, m_creature); + DoScriptText(SAY_AGGRO, me); } void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, me); if (m_pInstance) m_pInstance->SetData(TYPE_THEKAL, DONE); } @@ -120,7 +120,7 @@ struct boss_thekalAI : public ScriptedAI if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit *pLorKhan = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_LORKHAN))) + if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->setFaction(14); @@ -134,7 +134,7 @@ struct boss_thekalAI : public ScriptedAI if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) { //Resurrect Zath - Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH)); + Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)); if (pZath) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); @@ -152,21 +152,21 @@ struct boss_thekalAI : public ScriptedAI if (!PhaseTwo && MortalCleave_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_MORTALCLEAVE); + DoCast(me->getVictim(), SPELL_MORTALCLEAVE); MortalCleave_Timer = 15000 + rand()%5000; } else MortalCleave_Timer -= diff; if (!PhaseTwo && Silence_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SILENCE); + DoCast(me->getVictim(), SPELL_SILENCE); Silence_Timer = 20000 + rand()%5000; } else Silence_Timer -= diff; - if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) + if (!PhaseTwo && !WasDead && me->GetHealth() <= me->GetMaxHealth() * 0.05) { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - m_creature->AttackStop(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->AttackStop(); if (m_pInstance) m_pInstance->SetData(TYPE_THEKAL, SPECIAL); @@ -179,21 +179,21 @@ struct boss_thekalAI : public ScriptedAI { if (Resurrect_Timer <= diff) { - DoCast(m_creature, SPELL_TIGER_FORM); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0)); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoCast(me, SPELL_TIGER_FORM); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetHealth(int(me->GetMaxHealth()*1.0)); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); + me->UpdateDamagePhysical(BASE_ATTACK); DoResetThreat(); PhaseTwo = true; } else Resurrect_Timer -= diff; } - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() == 100) && WasDead) + if ((me->GetHealth()*100 / me->GetMaxHealth() == 100) && WasDead) { WasDead = false; } @@ -214,25 +214,25 @@ struct boss_thekalAI : public ScriptedAI if (Frenzy_Timer <= diff) { - DoCast(m_creature, SPELL_FRENZY); + DoCast(me, SPELL_FRENZY); Frenzy_Timer = 30000; } else Frenzy_Timer -= diff; if (ForcePunch_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SILENCE); + DoCast(me->getVictim(), SPELL_SILENCE); ForcePunch_Timer = 16000 + rand()%5000; } else ForcePunch_Timer -= diff; if (SummonTigers_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SUMMONTIGERS); + DoCast(me->getVictim(), SPELL_SUMMONTIGERS); SummonTigers_Timer = 10000 + rand()%4000; } else SummonTigers_Timer -= diff; - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) && !Enraged) + if ((me->GetHealth()*100 / me->GetMaxHealth() < 11) && !Enraged) { - DoCast(m_creature, SPELL_ENRAGE); + DoCast(me, SPELL_ENRAGE); Enraged = true; } } @@ -273,8 +273,8 @@ struct mob_zealot_lorkhanAI : public ScriptedAI if (m_pInstance) m_pInstance->SetData(TYPE_LORKHAN, NOT_STARTED); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } void EnterCombat(Unit *who) @@ -289,14 +289,14 @@ struct mob_zealot_lorkhanAI : public ScriptedAI //Shield_Timer if (Shield_Timer <= diff) { - DoCast(m_creature, SPELL_SHIELD); + DoCast(me, SPELL_SHIELD); Shield_Timer = 61000; } else Shield_Timer -= diff; //BloodLust_Timer if (BloodLust_Timer <= diff) { - DoCast(m_creature, SPELL_BLOODLUST); + DoCast(me, SPELL_BLOODLUST); BloodLust_Timer = 20000+rand()%8000; } else BloodLust_Timer -= diff; @@ -305,8 +305,8 @@ struct mob_zealot_lorkhanAI : public ScriptedAI { if (m_pInstance) { - Unit *pThekal = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_THEKAL)); - Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH)); + Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL)); + Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH)); if (!pThekal || !pZath) return; @@ -314,11 +314,11 @@ struct mob_zealot_lorkhanAI : public ScriptedAI switch (urand(0,1)) { case 0: - if (m_creature->IsWithinMeleeRange(pThekal)) + if (me->IsWithinMeleeRange(pThekal)) DoCast(pThekal, SPELL_GREATERHEAL); break; case 1: - if (m_creature->IsWithinMeleeRange(pZath)) + if (me->IsWithinMeleeRange(pZath)) DoCast(pZath, SPELL_GREATERHEAL); break; } @@ -330,7 +330,7 @@ struct mob_zealot_lorkhanAI : public ScriptedAI //Disarm_Timer if (Disarm_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_DISARM); + DoCast(me->getVictim(), SPELL_DISARM); Disarm_Timer = 15000+rand()%10000; } else Disarm_Timer -= diff; @@ -342,7 +342,7 @@ struct mob_zealot_lorkhanAI : public ScriptedAI if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit *pThekal = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_THEKAL))) + if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -354,7 +354,7 @@ struct mob_zealot_lorkhanAI : public ScriptedAI if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) { //Resurrect Zath - if (Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH))) + if (Unit *pZath = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_ZATH))) { pZath->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -367,12 +367,12 @@ struct mob_zealot_lorkhanAI : public ScriptedAI Check_Timer = 5000; } else Check_Timer -= diff; - if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) + if (me->GetHealth() <= me->GetMaxHealth() * 0.05) { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - m_creature->setFaction(35); - m_creature->AttackStop(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->setFaction(35); + me->AttackStop(); if (m_pInstance) m_pInstance->SetData(TYPE_LORKHAN, SPECIAL); @@ -417,8 +417,8 @@ struct mob_zealot_zathAI : public ScriptedAI if (m_pInstance) m_pInstance->SetData(TYPE_ZATH, NOT_STARTED); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } void EnterCombat(Unit *who) @@ -433,24 +433,24 @@ struct mob_zealot_zathAI : public ScriptedAI //SweepingStrikes_Timer if (SweepingStrikes_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SWEEPINGSTRIKES); + DoCast(me->getVictim(), SPELL_SWEEPINGSTRIKES); SweepingStrikes_Timer = 22000+rand()%4000; } else SweepingStrikes_Timer -= diff; //SinisterStrike_Timer if (SinisterStrike_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_SINISTERSTRIKE); + DoCast(me->getVictim(), SPELL_SINISTERSTRIKE); SinisterStrike_Timer = 8000+rand()%8000; } else SinisterStrike_Timer -= diff; //Gouge_Timer if (Gouge_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_GOUGE); + DoCast(me->getVictim(), SPELL_GOUGE); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-100); + if (DoGetThreat(me->getVictim())) + DoModifyThreatPercent(me->getVictim(),-100); Gouge_Timer = 17000+rand()%10000; } else Gouge_Timer -= diff; @@ -458,14 +458,14 @@ struct mob_zealot_zathAI : public ScriptedAI //Kick_Timer if (Kick_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_KICK); + DoCast(me->getVictim(), SPELL_KICK); Kick_Timer = 15000+rand()%10000; } else Kick_Timer -= diff; //Blind_Timer if (Blind_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_BLIND); + DoCast(me->getVictim(), SPELL_BLIND); Blind_Timer = 10000+rand()%10000; } else Blind_Timer -= diff; @@ -477,7 +477,7 @@ struct mob_zealot_zathAI : public ScriptedAI if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) { //Resurrect LorKhan - if (Unit *pLorKhan = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_LORKHAN))) + if (Unit *pLorKhan = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_LORKHAN))) { pLorKhan->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -489,7 +489,7 @@ struct mob_zealot_zathAI : public ScriptedAI if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) { //Resurrect Thekal - if (Unit *pThekal = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_THEKAL))) + if (Unit *pThekal = Unit::GetUnit((*me), m_pInstance->GetData64(DATA_THEKAL))) { pThekal->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -502,12 +502,12 @@ struct mob_zealot_zathAI : public ScriptedAI Check_Timer = 5000; } else Check_Timer -= diff; - if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) + if (me->GetHealth() <= me->GetMaxHealth() * 0.05) { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - m_creature->setFaction(35); - m_creature->AttackStop(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + me->setFaction(35); + me->AttackStop(); if (m_pInstance) m_pInstance->SetData(TYPE_ZATH, SPECIAL); diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp index bcfa15d97af..e1778a107f2 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp @@ -79,7 +79,7 @@ struct boss_venoxisAI : public ScriptedAI void JustDied(Unit* Killer) { - DoScriptText(SAY_DEATH, m_creature); + DoScriptText(SAY_DEATH, me); if (m_pInstance) m_pInstance->SetData(TYPE_VENOXIS, DONE); } @@ -89,23 +89,23 @@ struct boss_venoxisAI : public ScriptedAI if (!UpdateVictim()) return; - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50)) + if ((me->GetHealth()*100 / me->GetMaxHealth() > 50)) { if (Dispell_Timer <= diff) { - DoCast(m_creature, SPELL_DISPELL); + DoCast(me, SPELL_DISPELL); Dispell_Timer = 15000 + rand()%15000; } else Dispell_Timer -= diff; if (Renew_Timer <= diff) { - DoCast(m_creature, SPELL_RENEW); + DoCast(me, SPELL_RENEW); Renew_Timer = 20000 + rand()%10000; } else Renew_Timer -= diff; if (HolyWrath_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_HOLY_WRATH); + DoCast(me->getVictim(), SPELL_HOLY_WRATH); HolyWrath_Timer = 15000 + rand()%10000; } else HolyWrath_Timer -= diff; @@ -115,13 +115,13 @@ struct boss_venoxisAI : public ScriptedAI for (uint8 i = 0; i < 10; ++i) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) - if (m_creature->IsWithinMeleeRange(pTarget)) + if (me->IsWithinMeleeRange(pTarget)) ++TargetInRange; } if (TargetInRange > 1) { - DoCast(m_creature->getVictim(), SPELL_HOLY_NOVA); + DoCast(me->getVictim(), SPELL_HOLY_NOVA); HolyNova_Timer = 1000; } else @@ -143,21 +143,21 @@ struct boss_venoxisAI : public ScriptedAI { if (!PhaseTwo) { - DoScriptText(SAY_TRANSFORM, m_creature); - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_SNAKE_FORM); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoScriptText(SAY_TRANSFORM, me); + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_SNAKE_FORM); + me->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + const CreatureInfo *cinfo = me->GetCreatureInfo(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); + me->UpdateDamagePhysical(BASE_ATTACK); DoResetThreat(); PhaseTwo = true; } if (PhaseTwo && PoisonCloud_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD); + DoCast(me->getVictim(), SPELL_POISON_CLOUD); PoisonCloud_Timer = 15000; }PoisonCloud_Timer -=diff; @@ -169,12 +169,12 @@ struct boss_venoxisAI : public ScriptedAI VenomSpit_Timer = 15000 + rand()%5000; } else VenomSpit_Timer -= diff; - if (PhaseTwo && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)) + if (PhaseTwo && (me->GetHealth()*100 / me->GetMaxHealth() < 11)) { if (!InBerserk) { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_BERSERK); + me->InterruptNonMeleeSpells(false); + DoCast(me, SPELL_BERSERK); InBerserk = true; } } diff --git a/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp b/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp index c9fc61394b5..ee4dda504b9 100644 --- a/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp +++ b/src/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp @@ -52,7 +52,7 @@ struct boss_wushoolayAI : public ScriptedAI //LightningCloud_Timer if (LightningCloud_Timer <= diff) { - DoCast(m_creature->getVictim(), SPELL_LIGHTNINGCLOUD); + DoCast(me->getVictim(), SPELL_LIGHTNINGCLOUD); LightningCloud_Timer = 15000 + rand()%5000; } else LightningCloud_Timer -= diff; |
