*code cleanup

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

--HG--
branch : trunk
This commit is contained in:
Rat
2010-04-14 23:07:41 +02:00
parent cc262e1cde
commit 6bcb297de4
403 changed files with 9851 additions and 9852 deletions
+22 -22
View File
@@ -67,25 +67,25 @@ struct npc_torekAI : public npc_escortAI
switch (i)
{
case 1:
DoScriptText(SAY_MOVE, m_creature, pPlayer);
DoScriptText(SAY_MOVE, me, pPlayer);
break;
case 8:
DoScriptText(SAY_PREPARE, m_creature, pPlayer);
DoScriptText(SAY_PREPARE, me, pPlayer);
break;
case 19:
//TODO: verify location and creatures amount.
m_creature->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
m_creature->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
m_creature->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
me->SummonCreature(ENTRY_DURIEL,1776.73,-2049.06,109.83,1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
me->SummonCreature(ENTRY_SILVERWING_SENTINEL,1774.64,-2049.41,109.83,1.40,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
me->SummonCreature(ENTRY_SILVERWING_WARRIOR,1778.73,-2049.50,109.83,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000);
break;
case 20:
DoScriptText(SAY_WIN, m_creature, pPlayer);
DoScriptText(SAY_WIN, me, pPlayer);
Completed = true;
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, m_creature);
pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
DoScriptText(SAY_END, m_creature, pPlayer);
DoScriptText(SAY_END, me, pPlayer);
break;
}
}
@@ -103,7 +103,7 @@ struct npc_torekAI : public npc_escortAI
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void UpdateAI(const uint32 diff)
@@ -115,13 +115,13 @@ struct npc_torekAI : public npc_escortAI
if (Rend_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REND);
DoCast(me->getVictim(), SPELL_REND);
Rend_Timer = 20000;
} else Rend_Timer -= diff;
if (Thunderclap_Timer <= diff)
{
DoCast(m_creature, SPELL_THUNDERCLAP);
DoCast(me, SPELL_THUNDERCLAP);
Thunderclap_Timer = 30000;
} else Thunderclap_Timer -= diff;
}
@@ -168,25 +168,25 @@ struct npc_ruul_snowhoofAI : public npc_escortAI
switch(i)
{
case 0: {
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20);
if (Cage)
Cage->SetGoState(GO_STATE_ACTIVE);
break;}
case 13:
m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 19:
m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 21:{
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, m_creature);
pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break; }
}
@@ -196,14 +196,14 @@ struct npc_ruul_snowhoofAI : public npc_escortAI
void Reset()
{
GameObject* Cage = m_creature->FindNearestGameObject(GO_CAGE, 20);
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20);
if (Cage)
Cage->SetGoState(GO_STATE_READY);
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void UpdateAI(const uint32 diff)
+29 -29
View File
@@ -59,7 +59,7 @@ struct mobs_spitelashesAI : public ScriptedAI
(Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826))
{
spellhit=true;
DoCast(m_creature, 29124); //become a sheep
DoCast(me, 29124); //become a sheep
}
}
@@ -68,7 +68,7 @@ struct mobs_spitelashesAI : public ScriptedAI
// we mustn't remove the Creature in the same round in which we cast the summon spell, otherwise there will be no summons
if (spellhit && morphtimer >= 5000)
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
return;
}
// walk 5 seconds before summoning
@@ -77,8 +77,8 @@ struct mobs_spitelashesAI : public ScriptedAI
morphtimer+=diff;
if (morphtimer >= 5000)
{
DoCast(m_creature, 28406); //summon copies
DoCast(m_creature, 6924); //visual explosion
DoCast(me, 28406); //summon copies
DoCast(me, 6924); //visual explosion
}
}
if (!UpdateVictim())
@@ -282,7 +282,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (Must_Die)
if (Must_Die_Timer <= diff)
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
return;
} else Must_Die_Timer -= diff;
@@ -293,27 +293,27 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (spellEscape_Timer <= diff)
{
DoCast(m_creature, SPELL_RIZZLE_ESCAPE, false);
DoCast(me, SPELL_RIZZLE_ESCAPE, false);
spellEscape_Timer = 10000;
} else spellEscape_Timer -= diff;
if (Teleport_Timer <= diff)
{
//temp solution - unit can't be teleported by core using spelleffect 5, only players
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
if (pMap)
{
pMap->CreatureRelocation(m_creature, 3706.39, -3969.15, 35.9118, 0);
m_creature->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0);
pMap->CreatureRelocation(me, 3706.39, -3969.15, 35.9118, 0);
me->AI_SendMoveToPacket(3706.39, -3969.15, 35.9118, 0, 0, 0);
}
//begin swimming and summon depth charges
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
SendText(MSG_ESCAPE_NOTICE, pPlayer);
DoCast(m_creature, SPELL_PERIODIC_DEPTH_CHARGE);
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
m_creature->SetSpeed(MOVE_RUN, 0.85f, true);
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
DoCast(me, SPELL_PERIODIC_DEPTH_CHARGE);
me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
me->SetSpeed(MOVE_RUN, 0.85f, true);
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
Escape = true;
} else Teleport_Timer -= diff;
@@ -322,7 +322,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (ContinueWP)
{
m_creature->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP][0], WPs[CurrWP][1], WPs[CurrWP][2]);
ContinueWP = false;
}
@@ -331,7 +331,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (pPlayer)
{
DoScriptText(SAY_RIZZLE_GRENADE, m_creature, pPlayer);
DoScriptText(SAY_RIZZLE_GRENADE, me, pPlayer);
DoCast(pPlayer, SPELL_RIZZLE_FROST_GRENADE, true);
}
Grenade_Timer = 30000;
@@ -342,17 +342,17 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!pPlayer)
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
return;
}
if (m_creature->IsWithinDist(pPlayer, 10) && m_creature->GetPositionX() > pPlayer->GetPositionX() && !Reached)
if (me->IsWithinDist(pPlayer, 10) && me->GetPositionX() > pPlayer->GetPositionX() && !Reached)
{
DoScriptText(SAY_RIZZLE_FINAL, m_creature);
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 1);
m_creature->setFaction(35);
m_creature->GetMotionMaster()->MoveIdle();
m_creature->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
DoScriptText(SAY_RIZZLE_FINAL, me);
me->SetUInt32Value(UNIT_NPC_FLAGS, 1);
me->setFaction(35);
me->GetMotionMaster()->MoveIdle();
me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE);
Reached = true;
}
@@ -377,7 +377,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->GetQuestStatus(10994) == QUEST_STATUS_INCOMPLETE)
{
PlayerGUID = who->GetGUID();
DoScriptText(SAY_RIZZLE_START, m_creature);
DoScriptText(SAY_RIZZLE_START, me);
DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
return;
}
@@ -392,7 +392,7 @@ struct mob_rizzle_sprysprocketAI : public ScriptedAI
if (id == 57)
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
return;
}
@@ -441,8 +441,8 @@ struct mob_depth_chargeAI : public ScriptedAI
void Reset()
{
m_creature->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
we_must_die = false;
must_die_timer = 1000;
}
@@ -452,7 +452,7 @@ struct mob_depth_chargeAI : public ScriptedAI
if (we_must_die)
if (must_die_timer <= diff)
{
m_creature->ForcedDespawn();
me->ForcedDespawn();
} else must_die_timer -= diff;
return;
}
@@ -462,7 +462,7 @@ struct mob_depth_chargeAI : public ScriptedAI
if (!who)
return;
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 5))
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5))
{
DoCast(who, SPELL_DEPTH_CHARGE_TRAP);
we_must_die = true;
+53 -53
View File
@@ -78,22 +78,22 @@ struct npc_draenei_survivorAI : public ScriptedAI
CanSayHelp = true;
DoCast(m_creature, SPELL_IRRIDATION, true);
DoCast(me, SPELL_IRRIDATION, true);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1));
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
me->SetHealth(int(me->GetMaxHealth()*.1));
me->SetStandState(UNIT_STAND_STATE_SLEEP);
}
void EnterCombat(Unit *who) {}
void MoveInLineOfSight(Unit *who)
{
if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(who) && m_creature->IsWithinDistInMap(who, 25.0f))
if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 25.0f))
{
//Random switch between 4 texts
DoScriptText(RAND(SAY_HELP1, SAY_HELP2, SAY_HELP3, SAY_HELP4), m_creature, who);
DoScriptText(RAND(SAY_HELP1, SAY_HELP2, SAY_HELP3, SAY_HELP4), me, who);
SayHelpTimer = 20000;
CanSayHelp = false;
@@ -104,10 +104,10 @@ struct npc_draenei_survivorAI : public ScriptedAI
{
if (Spell->SpellFamilyFlags[2] & 0x080000000)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoCast(m_creature, SPELL_STUNNED, true);
DoCast(me, SPELL_STUNNED, true);
pCaster = Caster->GetGUID();
@@ -121,17 +121,17 @@ struct npc_draenei_survivorAI : public ScriptedAI
{
if (SayThanksTimer <= diff)
{
m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION);
me->RemoveAurasDueToSpell(SPELL_IRRIDATION);
if (Player* pPlayer = Unit::GetPlayer(pCaster))
{
DoScriptText(RAND(SAY_HEAL1, SAY_HEAL2, SAY_HEAL3, SAY_HEAL4), m_creature, pPlayer);
DoScriptText(RAND(SAY_HEAL1, SAY_HEAL2, SAY_HEAL3, SAY_HEAL4), me, pPlayer);
pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID());
pPlayer->TalkedToCreature(me->GetEntry(),me->GetGUID());
}
m_creature->GetMotionMaster()->Clear();
m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f);
RunAwayTimer = 10000;
SayThanksTimer = 0;
@@ -143,7 +143,7 @@ struct npc_draenei_survivorAI : public ScriptedAI
if (RunAwayTimer)
{
if (RunAwayTimer <= diff)
m_creature->ForcedDespawn();
me->ForcedDespawn();
else
RunAwayTimer -= diff;
@@ -205,25 +205,25 @@ struct npc_engineer_spark_overgrindAI : public ScriptedAI
Dynamite_Timer = 8000;
Emote_Timer = 120000 + rand()%30000;
m_creature->setFaction(NormFaction);
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags);
me->setFaction(NormFaction);
me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags);
IsTreeEvent = false;
}
void EnterCombat(Unit* who)
{
DoScriptText(ATTACK_YELL, m_creature, who);
DoScriptText(ATTACK_YELL, me, who);
}
void UpdateAI(const uint32 diff)
{
if (!m_creature->isInCombat() && !IsTreeEvent)
if (!me->isInCombat() && !IsTreeEvent)
{
if (Emote_Timer <= diff)
{
DoScriptText(SAY_TEXT, m_creature);
DoScriptText(SAY_EMOTE, m_creature);
DoScriptText(SAY_TEXT, me);
DoScriptText(SAY_EMOTE, me);
Emote_Timer = 120000 + rand()%30000;
} else Emote_Timer -= diff;
}
@@ -235,7 +235,7 @@ struct npc_engineer_spark_overgrindAI : public ScriptedAI
if (Dynamite_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DYNAMITE);
DoCast(me->getVictim(), SPELL_DYNAMITE);
Dynamite_Timer = 8000;
} else Dynamite_Timer -= diff;
@@ -278,12 +278,12 @@ struct npc_injured_draeneiAI : public ScriptedAI
void Reset()
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15));
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
me->SetHealth(int(me->GetMaxHealth()*.15));
switch (rand()%2)
{
case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break;
case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break;
case 0: me->SetStandState(UNIT_STAND_STATE_SIT); break;
case 1: me->SetStandState(UNIT_STAND_STATE_SLEEP); break;
}
}
@@ -335,25 +335,25 @@ struct npc_magwinAI : public npc_escortAI
switch(i)
{
case 0:
DoScriptText(SAY_START, m_creature, pPlayer);
DoScriptText(SAY_START, me, pPlayer);
break;
case 17:
DoScriptText(SAY_PROGRESS, m_creature, pPlayer);
DoScriptText(SAY_PROGRESS, me, pPlayer);
break;
case 28:
DoScriptText(SAY_END1, m_creature, pPlayer);
DoScriptText(SAY_END1, me, pPlayer);
break;
case 29:
DoScriptText(EMOTE_HUG, m_creature, pPlayer);
DoScriptText(SAY_END2, m_creature, pPlayer);
pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,m_creature);
DoScriptText(EMOTE_HUG, me, pPlayer);
DoScriptText(SAY_END2, me, pPlayer);
pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP,me);
break;
}
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature, who);
DoScriptText(SAY_AGGRO, me, who);
}
void Reset() { }
@@ -425,7 +425,7 @@ struct npc_geezleAI : public ScriptedAI
{
Step = 0;
EventStarted = true;
Creature* Spark = m_creature->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos[0], SparkPos[1], SparkPos[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
if (Spark)
{
SparkGUID = Spark->GetGUID();
@@ -437,35 +437,35 @@ struct npc_geezleAI : public ScriptedAI
uint32 NextStep(uint32 Step)
{
Creature* Spark = Unit::GetCreature(*m_creature, SparkGUID);
Creature* Spark = Unit::GetCreature(*me, SparkGUID);
switch(Step)
{
case 0:
if (Spark)
Spark->GetMotionMaster()->MovePoint(0, -5080.70, -11253.61, 0.56);
m_creature->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71);
me->GetMotionMaster()->MovePoint(0, -5092.26, -11252, 0.71);
return 9000; // NPCs are walking up to fire
case 1:
DespawnNagaFlag(true);
DoScriptText(EMOTE_SPARK, Spark);
return 1000;
case 2:
DoScriptText(GEEZLE_SAY_1, m_creature, Spark);
DoScriptText(GEEZLE_SAY_1, me, Spark);
if (Spark)
{
Spark->SetInFront(m_creature);
m_creature->SetInFront(Spark);
Spark->SetInFront(me);
me->SetInFront(Spark);
}
return 5000;
case 3: DoScriptText(SPARK_SAY_2, Spark); return 7000;
case 4: DoScriptText(SPARK_SAY_3, Spark); return 8000;
case 5: DoScriptText(GEEZLE_SAY_4, m_creature, Spark); return 8000;
case 5: DoScriptText(GEEZLE_SAY_4, me, Spark); return 8000;
case 6: DoScriptText(SPARK_SAY_5, Spark); return 9000;
case 7: DoScriptText(SPARK_SAY_6, Spark); return 8000;
case 8: DoScriptText(GEEZLE_SAY_7, m_creature, Spark); return 2000;
case 8: DoScriptText(GEEZLE_SAY_7, me, Spark); return 2000;
case 9:
m_creature->GetMotionMaster()->MoveTargetedHome();
me->GetMotionMaster()->MoveTargetedHome();
if (Spark)
Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]);
CompleteQuest();
@@ -474,7 +474,7 @@ struct npc_geezleAI : public ScriptedAI
if (Spark)
Spark->DisappearAndDie();
DespawnNagaFlag(false);
m_creature->DisappearAndDie();
me->DisappearAndDie();
default: return 99999999;
}
}
@@ -484,9 +484,9 @@ struct npc_geezleAI : public ScriptedAI
{
float radius = 50.0f;
std::list<Player*> players;
Trinity::AnyPlayerInObjectRangeCheck checker(m_creature, radius);
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(m_creature, players, checker);
m_creature->VisitNearbyWorldObject(radius, searcher);
Trinity::AnyPlayerInObjectRangeCheck checker(me, radius);
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
me->VisitNearbyWorldObject(radius, searcher);
for (std::list<Player*>::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
@@ -501,7 +501,7 @@ struct npc_geezleAI : public ScriptedAI
void DespawnNagaFlag(bool despawn)
{
std::list<GameObject*> FlagList;
m_creature->GetGameObjectListWithEntryInGrid(FlagList,GO_NAGA_FLAG, 100.0f);
me->GetGameObjectListWithEntryInGrid(FlagList,GO_NAGA_FLAG, 100.0f);
if (!FlagList.empty())
{
@@ -564,7 +564,7 @@ struct npc_nestlewood_owlkinAI : public ScriptedAI
if (DespawnTimer <= diff)
{
//once we are able to, despawn us
m_creature->ForcedDespawn();
me->ForcedDespawn();
return;
} else DespawnTimer -= diff;
}
@@ -637,8 +637,8 @@ struct npc_death_ravagerAI : public ScriptedAI
RendTimer = 30000;
EnragingBiteTimer = 20000;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
}
void UpdateAI(const uint32 diff)
@@ -648,14 +648,14 @@ struct npc_death_ravagerAI : public ScriptedAI
if (RendTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REND);
DoCast(me->getVictim(), SPELL_REND);
RendTimer = 30000;
}
else RendTimer -= diff;
if (EnragingBiteTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ENRAGING_BITE);
DoCast(me->getVictim(), SPELL_ENRAGING_BITE);
EnragingBiteTimer = 15000;
}
else EnragingBiteTimer -= diff;
@@ -86,7 +86,7 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
void AttackPlayer()
{
Map::PlayerList const &PlList = m_creature->GetMap()->GetPlayers();
Map::PlayerList const &PlList = me->GetMap()->GetPlayers();
if (PlList.isEmpty())
return;
@@ -100,9 +100,9 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
if (pPlayer->isAlive())
{
m_creature->SetInCombatWith(pPlayer);
pPlayer->SetInCombatWith(m_creature);
m_creature->AddThreat(pPlayer, 0.0f);
me->SetInCombatWith(pPlayer);
pPlayer->SetInCombatWith(me);
me->AddThreat(pPlayer, 0.0f);
}
}
}
@@ -113,13 +113,13 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
if (!UpdateVictim())
return;
switch (m_creature->GetEntry())
switch (me->GetEntry())
{
case NPC_AKU_MAI_SNAPJAW:
{
if (uiRavageTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_RAVAGE);
DoCast(me->getVictim(), SPELL_RAVAGE);
uiRavageTimer = urand(9000,14000);
} else uiRavageTimer -= uiDiff;
break;
@@ -130,7 +130,7 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
if (!bFlee && HealthBelowPct(15))
{
bFlee = true;
m_creature->DoFleeToGetAssistance();
me->DoFleeToGetAssistance();
}
break;
}
@@ -159,7 +159,7 @@ struct npc_blackfathom_deeps_eventAI : public ScriptedAI
void JustDied(Unit* pKiller)
{
if (m_creature->isSummon()) //we are not a normal spawn.
if (me->isSummon()) //we are not a normal spawn.
if (pInstance)
pInstance->SetData(DATA_EVENT, pInstance->GetData(DATA_EVENT) + 1);
}
@@ -181,7 +181,7 @@ struct npc_morriduneAI : public npc_escortAI
npc_morriduneAI(Creature* pCreature) : npc_escortAI(pCreature)
{
DoScriptText(SAY_MORRIDUNE_1,pCreature);
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
Start(false,false,NULL);
}
@@ -191,10 +191,10 @@ struct npc_morriduneAI : public npc_escortAI
{
case 4:
SetEscortPaused(true);
m_creature->SetOrientation(1.775791);
m_creature->SendMovementFlagUpdate();
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoScriptText(SAY_MORRIDUNE_2,m_creature);
me->SetOrientation(1.775791);
me->SendMovementFlagUpdate();
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoScriptText(SAY_MORRIDUNE_2,me);
break;
}
}
@@ -70,7 +70,7 @@ struct boss_aku_maiAI : public ScriptedAI
if (!bIsEnraged && HealthBelowPct(30))
{
DoCast(m_creature,SPELL_FRENZIED_RAGE);
DoCast(me,SPELL_FRENZIED_RAGE);
bIsEnraged = true;
}
@@ -55,14 +55,14 @@ struct boss_kelrisAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(TYPE_KELRIS, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_KELRIS, DONE);
}
@@ -82,7 +82,7 @@ struct boss_kelrisAI : public ScriptedAI
{
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
DoScriptText(SAY_SLEEP, m_creature);
DoScriptText(SAY_SLEEP, me);
DoCast(pTarget, SPELL_SLEEP);
}
uiSleepTimer = urand(15000,20000);
+2 -2
View File
@@ -56,7 +56,7 @@ struct mob_webbed_creatureAI : public ScriptedAI
case 0:
spawnCreatureID = 17681;
if (Killer->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID());
CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, me->GetGUID());
break;
case 1:
case 2:
@@ -65,7 +65,7 @@ struct mob_webbed_creatureAI : public ScriptedAI
}
if (spawnCreatureID)
m_creature->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
}
};
CreatureAI* GetAI_mob_webbed_creature(Creature* pCreature)
+11 -11
View File
@@ -70,15 +70,15 @@ struct boss_azuregosAI : public ScriptedAI
if (Teleport_Timer <= diff)
{
DoScriptText(SAY_TELEPORT, m_creature);
std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
DoScriptText(SAY_TELEPORT, me);
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->GetTypeId() == TYPEID_PLAYER))
{
DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation());
DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+3, pUnit->GetOrientation());
}
}
@@ -89,21 +89,21 @@ struct boss_azuregosAI : public ScriptedAI
// //MarkOfFrost_Timer
// if (MarkOfFrost_Timer <= diff)
// {
// DoCast(m_creature->getVictim(), SPELL_MARKOFFROST);
// DoCast(me->getVictim(), SPELL_MARKOFFROST);
// MarkOfFrost_Timer = 25000;
// } else MarkOfFrost_Timer -= diff;
//Chill_Timer
if (Chill_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CHILL);
DoCast(me->getVictim(), SPELL_CHILL);
Chill_Timer = 13000 + rand()%12000;
} else Chill_Timer -= diff;
//Breath_Timer
if (Breath_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTBREATH);
DoCast(me->getVictim(), SPELL_FROSTBREATH);
Breath_Timer = 10000 + rand()%5000;
} else Breath_Timer -= diff;
@@ -118,21 +118,21 @@ struct boss_azuregosAI : public ScriptedAI
//Reflect_Timer
if (Reflect_Timer <= diff)
{
DoCast(m_creature, SPELL_REFLECT);
DoCast(me, SPELL_REFLECT);
Reflect_Timer = 20000 + rand()%15000;
} else Reflect_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;
//Enrage_Timer
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26 && !Enraged)
if (me->GetHealth()*100 / me->GetMaxHealth() < 26 && !Enraged)
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
@@ -82,7 +82,7 @@ struct boss_epochAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, IN_PROGRESS);
@@ -115,7 +115,7 @@ struct boss_epochAI : public ScriptedAI
if (uiTimeWarpTimer < diff)
{
DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), m_creature);
DoScriptText(RAND(SAY_TIME_WARP_1,SAY_TIME_WARP_2,SAY_TIME_WARP_3), me);
DoCastAOE(SPELL_TIME_WARP);
uiTimeWarpTimer = 25300;
} else uiTimeWarpTimer -= diff;
@@ -125,7 +125,7 @@ struct boss_epochAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_EPOCH_EVENT, DONE);
@@ -133,10 +133,10 @@ struct boss_epochAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
@@ -107,15 +107,15 @@ struct boss_mal_ganisAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, IN_PROGRESS);
}
void DamageTaken(Unit *done_by, uint32 &damage)
{
if (damage >= m_creature->GetHealth() && done_by != m_creature)
damage = m_creature->GetHealth()-1;
if (damage >= me->GetHealth() && done_by != me)
damage = me->GetHealth()-1;
}
void UpdateAI(const uint32 diff)
@@ -129,30 +129,30 @@ struct boss_mal_ganisAI : public ScriptedAI
if (!bYelled && HealthBelowPct(30))
{
DoScriptText(SAY_30HEALTH, m_creature);
DoScriptText(SAY_30HEALTH, me);
bYelled = true;
}
if (!bYelled2 && HealthBelowPct(15))
{
DoScriptText(SAY_15HEALTH, m_creature);
DoScriptText(SAY_15HEALTH, me);
bYelled2 = true;
}
if (HealthBelowPct(1))
{
//Handle Escape Event: Don't forget to add Player::RewardPlayerAndGroupAtEvent
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
uiOutroStep = 1;
Phase = OUTRO;
return;
}
if (Creature* pArthas = m_creature->GetCreature(*m_creature, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
if (Creature* pArthas = me->GetCreature(*me, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0))
if (pArthas->isDead())
{
EnterEvadeMode();
m_creature->DisappearAndDie();
me->DisappearAndDie();
if (pInstance)
pInstance->SetData(DATA_MAL_GANIS_EVENT, FAIL);
}
@@ -172,13 +172,13 @@ struct boss_mal_ganisAI : public ScriptedAI
if (uiVampiricTouchTimer < diff)
{
DoCast(m_creature, SPELL_VAMPIRIC_TOUCH);
DoCast(me, SPELL_VAMPIRIC_TOUCH);
uiVampiricTouchTimer = 32000;
} else uiVampiricTouchTimer -= diff;
if (uiSleepTimer < diff)
{
DoScriptText(RAND(SAY_SLEEP_1,SAY_SLEEP_2), m_creature);
DoScriptText(RAND(SAY_SLEEP_1,SAY_SLEEP_2), me);
if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(pTarget, SPELL_SLEEP);
uiSleepTimer = urand(15000,20000);
@@ -192,31 +192,31 @@ struct boss_mal_ganisAI : public ScriptedAI
switch(uiOutroStep)
{
case 1:
DoScriptText(SAY_ESCAPE_SPEECH_1, m_creature);
DoScriptText(SAY_ESCAPE_SPEECH_1, me);
me->GetMotionMaster()->MoveTargetedHome();
++uiOutroStep;
uiOutroTimer = 8000;
break;
case 2:
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
m_creature->HandleEmoteCommand(29);
DoScriptText(SAY_ESCAPE_SPEECH_2, m_creature);
me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance ? pInstance->GetData64(DATA_ARTHAS) : 0);
me->HandleEmoteCommand(29);
DoScriptText(SAY_ESCAPE_SPEECH_2, me);
++uiOutroStep;
uiOutroTimer = 9000;
break;
case 3:
DoScriptText(SAY_OUTRO, m_creature);
DoScriptText(SAY_OUTRO, me);
++uiOutroStep;
uiOutroTimer = 16000;
break;
case 4:
m_creature->HandleEmoteCommand(33);
me->HandleEmoteCommand(33);
++uiOutroStep;
uiOutroTimer = 500;
break;
case 5:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->Kill(m_creature);
me->SetVisibility(VISIBILITY_OFF);
me->Kill(me);
break;
}
@@ -239,10 +239,10 @@ struct boss_mal_ganisAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), m_creature);
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3,SAY_SLAY_4), me);
}
};
@@ -52,7 +52,7 @@ struct boss_meathookAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
if (pInstance)
DoScriptText(SAY_SPAWN,m_creature);
DoScriptText(SAY_SPAWN,me);
}
uint32 uiChainTimer;
@@ -73,7 +73,7 @@ struct boss_meathookAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, IN_PROGRESS);
@@ -93,7 +93,7 @@ struct boss_meathookAI : public ScriptedAI
if (uiFrenzyTimer <= diff)
{
DoCast(m_creature, SPELL_FRENZY);
DoCast(me, SPELL_FRENZY);
uiFrenzyTimer = urand(21000,26000);
} else uiFrenzyTimer -= diff;
@@ -109,7 +109,7 @@ struct boss_meathookAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_MEATHOOK_EVENT, DONE);
@@ -117,10 +117,10 @@ struct boss_meathookAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
@@ -64,7 +64,7 @@ struct boss_salrammAI : public ScriptedAI
{
pInstance = c->GetInstanceData();
if (pInstance)
DoScriptText(SAY_SPAWN,m_creature);
DoScriptText(SAY_SPAWN,me);
}
uint32 uiCurseFleshTimer;
@@ -89,7 +89,7 @@ struct boss_salrammAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, IN_PROGRESS);
@@ -104,7 +104,7 @@ struct boss_salrammAI : public ScriptedAI
//Curse of twisted flesh timer
if (uiCurseFleshTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CURSE_OF_TWISTED_FLESH);
DoCast(me->getVictim(), SPELL_CURSE_OF_TWISTED_FLESH);
uiCurseFleshTimer = 37000;
} else uiCurseFleshTimer -= diff;
@@ -119,7 +119,7 @@ struct boss_salrammAI : public ScriptedAI
//Steal Flesh timer
if (uiStealFleshTimer <= diff)
{
DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), m_creature);
DoScriptText(RAND(SAY_STEAL_FLESH_1,SAY_STEAL_FLESH_2,SAY_STEAL_FLESH_3), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_STEAL_FLESH);
uiStealFleshTimer = 10000;
@@ -128,7 +128,7 @@ struct boss_salrammAI : public ScriptedAI
//Summon ghouls timer
if (uiSummonGhoulsTimer <= diff)
{
DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), m_creature);
DoScriptText(RAND(SAY_SUMMON_GHOULS_1,SAY_SUMMON_GHOULS_2), me);
if (Unit* random_pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(random_pTarget, SPELL_SUMMON_GHOULS);
uiSummonGhoulsTimer = 10000;
@@ -139,7 +139,7 @@ struct boss_salrammAI : public ScriptedAI
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_SALRAMM_EVENT, DONE);
@@ -147,10 +147,10 @@ struct boss_salrammAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
if (victim == me)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), me);
}
};
@@ -278,7 +278,7 @@ struct npc_arthasAI : public npc_escortAI
case NOT_STARTED:
bStepping = true;
uiStep = 0;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
uiBossEvent = DATA_MEATHOOK_EVENT;
uiGossipStep = 0;
break;
@@ -291,7 +291,7 @@ struct npc_arthasAI : public npc_escortAI
void EnterCombat(Unit* who)
{
DoCast(m_creature, SPELL_ARTHAS_AURA);
DoCast(me, SPELL_ARTHAS_AURA);
}
void JustDied(Unit *killer)
@@ -302,12 +302,12 @@ struct npc_arthasAI : public npc_escortAI
void SpawnTimeRift(uint32 timeRiftID, uint64* guidVector)
{
m_creature->SummonCreature((uint32)RiftAndSpawnsLocations[timeRiftID][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_DESPAWN,11000);
me->SummonCreature((uint32)RiftAndSpawnsLocations[timeRiftID][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_DESPAWN,11000);
for (uint32 i = timeRiftID+1; i < ENCOUNTER_CHRONO_SPAWNS; ++i)
{
if ((uint32)RiftAndSpawnsLocations[i][0] == NPC_TIME_RIFT) break;
if (Creature* pTemp = m_creature->SummonCreature((uint32)RiftAndSpawnsLocations[i][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
if (Creature* pTemp = me->SummonCreature((uint32)RiftAndSpawnsLocations[i][0],RiftAndSpawnsLocations[timeRiftID][1],RiftAndSpawnsLocations[timeRiftID][2],RiftAndSpawnsLocations[timeRiftID][3],RiftAndSpawnsLocations[timeRiftID][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
guidVector[i-timeRiftID-1] = pTemp->GetGUID();
pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE | UNIT_FLAG_UNK_9);
@@ -324,7 +324,7 @@ struct npc_arthasAI : public npc_escortAI
for (uint32 i = 0; i < ENCOUNTER_WAVES_MAX_SPAWNS; ++i)
{
if ((uint32)WavesLocations[waveID][i][0] == 0) break;
if (Creature* pTemp = m_creature->SummonCreature((uint32)WavesLocations[waveID][i][0],WavesLocations[waveID][i][1],WavesLocations[waveID][i][2],WavesLocations[waveID][i][3],WavesLocations[waveID][i][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
if (Creature* pTemp = me->SummonCreature((uint32)WavesLocations[waveID][i][0],WavesLocations[waveID][i][1],WavesLocations[waveID][i][2],WavesLocations[waveID][i][3],WavesLocations[waveID][i][4],TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
guidVector[i] = pTemp->GetGUID();
}
@@ -361,27 +361,27 @@ struct npc_arthasAI : public npc_escortAI
bStepping = true;
break;
case 7:
if (Unit* pCityman0 = m_creature->SummonCreature(NPC_CITY_MAN,2091.977f,1275.021f,140.757f,0.558f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
if (Unit* pCityman0 = me->SummonCreature(NPC_CITY_MAN,2091.977f,1275.021f,140.757f,0.558f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
uiCitymenGUID[0] = pCityman0->GetGUID();
if (Unit* pCityman1 = m_creature->SummonCreature(NPC_CITY_MAN2,2093.514f,1275.842f,140.408f,3.801f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
if (Unit* pCityman1 = me->SummonCreature(NPC_CITY_MAN2,2093.514f,1275.842f,140.408f,3.801f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000))
uiCitymenGUID[1] = pCityman1->GetGUID();
break;
case 8:
uiGossipStep = 1;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetHoldState(true);
break;
case 12:
SetRun(true);
DoScriptText(SAY_PHASE210, m_creature);
if (Unit* pDisguised0 = m_creature->SummonCreature(NPC_CITY_MAN3,2398.14f,1207.81f,134.04f,5.155249f,TEMPSUMMON_DEAD_DESPAWN,180000))
DoScriptText(SAY_PHASE210, me);
if (Unit* pDisguised0 = me->SummonCreature(NPC_CITY_MAN3,2398.14f,1207.81f,134.04f,5.155249f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiInfiniteDraconianGUID[0] = pDisguised0->GetGUID();
if (Unit* pDisguised1 = m_creature->SummonCreature(NPC_CITY_MAN4,2403.22f,1205.54f,134.04f,3.311264f,TEMPSUMMON_DEAD_DESPAWN,180000))
if (Unit* pDisguised1 = me->SummonCreature(NPC_CITY_MAN4,2403.22f,1205.54f,134.04f,3.311264f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiInfiniteDraconianGUID[1] = pDisguised1->GetGUID();
if (Unit* pDisguised2 = m_creature->SummonCreature(NPC_CITY_MAN,2400.82f,1201.69f,134.01f,1.534082f,TEMPSUMMON_DEAD_DESPAWN,180000))
if (Unit* pDisguised2 = me->SummonCreature(NPC_CITY_MAN,2400.82f,1201.69f,134.01f,1.534082f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiInfiniteDraconianGUID[2] = pDisguised2->GetGUID();
pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, uiInfiniteDraconianGUID[1]);
@@ -393,23 +393,23 @@ struct npc_arthasAI : public npc_escortAI
break;
case 20:
uiGossipStep = 2;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
SetHoldState(true);
break;
case 21:
DoScriptText(SAY_PHASE301, m_creature);
DoScriptText(SAY_PHASE301, me);
break;
case 25:
SetRun(false);
SpawnTimeRift(0,&uiInfiniteDraconianGUID[0]);
DoScriptText(SAY_PHASE307,m_creature);
DoScriptText(SAY_PHASE307,me);
break;
case 29:
SetRun(false);
SpawnTimeRift(5,&uiInfiniteDraconianGUID[0]);
SpawnTimeRift(8,&uiInfiniteDraconianGUID[2]);
DoScriptText(SAY_PHASE309,m_creature);
DoScriptText(SAY_PHASE309,me);
SetHoldState(true);
bStepping = true;
break;
@@ -417,18 +417,18 @@ struct npc_arthasAI : public npc_escortAI
SetRun(false);
SpawnTimeRift(11,&uiInfiniteDraconianGUID[0]);
SpawnTimeRift(14,&uiInfiniteDraconianGUID[2]);
DoScriptText(SAY_PHASE311,m_creature);
DoScriptText(SAY_PHASE311,me);
SetHoldState(true);
bStepping = true;
break;
case 32:
DoScriptText(SAY_PHASE401,m_creature);
DoScriptText(SAY_PHASE401,me);
break;
case 34:
DoScriptText(SAY_PHASE402,m_creature);
DoScriptText(SAY_PHASE402,me);
break;
case 35:
DoScriptText(SAY_PHASE403,m_creature);
DoScriptText(SAY_PHASE403,me);
break;
case 36:
if (pInstance)
@@ -441,23 +441,23 @@ struct npc_arthasAI : public npc_escortAI
SetRun(true);
SetDespawnAtFar(false);
uiGossipStep = 4;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetHoldState(true);
break;
case 47:
SetRun(false);
DoScriptText(SAY_PHASE405,m_creature);
DoScriptText(SAY_PHASE405,me);
break;
case 48:
SetRun(true);
DoScriptText(SAY_PHASE406,m_creature);
DoScriptText(SAY_PHASE406,me);
break;
case 53:
DoScriptText(SAY_PHASE407,m_creature);
DoScriptText(SAY_PHASE407,me);
break;
case 54:
uiGossipStep = 5;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetHoldState(true);
break;
}
@@ -477,28 +477,28 @@ struct npc_arthasAI : public npc_escortAI
{
//After reset
case 0:
if (Unit* pJaina = GetClosestCreatureWithEntry(m_creature, NPC_JAINA, 50.0f))
if (Unit* pJaina = GetClosestCreatureWithEntry(me, NPC_JAINA, 50.0f))
uiJainaGUID = pJaina->GetGUID();
else if (Unit* pJaina = m_creature->SummonCreature(NPC_JAINA,1895.48f,1292.66f,143.706f,0.023475f,TEMPSUMMON_DEAD_DESPAWN,180000))
else if (Unit* pJaina = me->SummonCreature(NPC_JAINA,1895.48f,1292.66f,143.706f,0.023475f,TEMPSUMMON_DEAD_DESPAWN,180000))
uiJainaGUID = pJaina->GetGUID();
bStepping = false;
JumpToNextStep(0);
break;
//After waypoint 0
case 1:
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (Unit* pUther = m_creature->SummonCreature(NPC_UTHER,1794.357f,1272.183f,140.558f,1.37f,TEMPSUMMON_DEAD_DESPAWN,180000))
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
if (Unit* pUther = me->SummonCreature(NPC_UTHER,1794.357f,1272.183f,140.558f,1.37f,TEMPSUMMON_DEAD_DESPAWN,180000))
{
uiUtherGUID = pUther->GetGUID();
pUther->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pUther->GetMotionMaster()->MovePoint(0, 1897.018f, 1287.487f, 143.481f);
pUther->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiUtherGUID);
pUther->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
me->SetUInt64Value(UNIT_FIELD_TARGET, uiUtherGUID);
}
JumpToNextStep(17000);
break;
case 2:
DoScriptText(SAY_PHASE101, m_creature);
DoScriptText(SAY_PHASE101, me);
JumpToNextStep(2000);
break;
case 3:
@@ -512,14 +512,14 @@ struct npc_arthasAI : public npc_escortAI
SetEscortPaused(false);
bStepping = false;
SetRun(false);
DoScriptText(SAY_PHASE103, m_creature);
DoScriptText(SAY_PHASE103, me);
JumpToNextStep(0);
break;
//After waypoint 1
case 5:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
pJaina->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
DoScriptText(SAY_PHASE104, m_creature);
pJaina->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
DoScriptText(SAY_PHASE104, me);
JumpToNextStep(10000);
break;
case 6:
@@ -528,7 +528,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(1000);
break;
case 7:
DoScriptText(SAY_PHASE106, m_creature);
DoScriptText(SAY_PHASE106, me);
JumpToNextStep(4000);
break;
case 8:
@@ -537,7 +537,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(6000);
break;
case 9:
DoScriptText(SAY_PHASE108, m_creature);
DoScriptText(SAY_PHASE108, me);
JumpToNextStep(4000);
break;
case 10:
@@ -546,7 +546,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(8000);
break;
case 11:
DoScriptText(SAY_PHASE110, m_creature);
DoScriptText(SAY_PHASE110, me);
JumpToNextStep(4000);
break;
case 12:
@@ -555,7 +555,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(4000);
break;
case 13:
DoScriptText(SAY_PHASE112, m_creature);
DoScriptText(SAY_PHASE112, me);
JumpToNextStep(11000);
break;
case 14:
@@ -564,7 +564,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(3000);
break;
case 15:
DoScriptText(SAY_PHASE114, m_creature);
DoScriptText(SAY_PHASE114, me);
JumpToNextStep(9000);
break;
case 16:
@@ -583,14 +583,14 @@ struct npc_arthasAI : public npc_escortAI
case 18:
if (Creature* pJaina = Unit::GetCreature(*me, uiJainaGUID))
{
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
pJaina->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pJaina->GetMotionMaster()->MovePoint(0, 1794.357f,1272.183f,140.558f);
}
JumpToNextStep(1000);
break;
case 19:
DoScriptText(SAY_PHASE116, m_creature);
DoScriptText(SAY_PHASE116, me);
JumpToNextStep(1000);
break;
case 20:
@@ -601,13 +601,13 @@ struct npc_arthasAI : public npc_escortAI
case 21:
SetEscortPaused(false);
bStepping = false;
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
JumpToNextStep(0);
break;
//After waypoint 3
case 22:
DoScriptText(SAY_PHASE118, m_creature);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
DoScriptText(SAY_PHASE118, me);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiJainaGUID);
JumpToNextStep(10000);
break;
case 23:
@@ -621,35 +621,35 @@ struct npc_arthasAI : public npc_escortAI
if (Creature* pUther = Unit::GetCreature(*me, uiUtherGUID))
pUther->DisappearAndDie();
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
JumpToNextStep(0);
break;
//After Gossip 1 (waypoint 8)
case 24:
if (Unit* pStalker = m_creature->SummonCreature(NPC_INVIS_TARGET,2026.469f,1287.088f,143.596f,1.37f,TEMPSUMMON_TIMED_DESPAWN,14000))
if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET,2026.469f,1287.088f,143.596f,1.37f,TEMPSUMMON_TIMED_DESPAWN,14000))
{
uiStalkerGUID = pStalker->GetGUID();
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
JumpToNextStep(1000);
break;
case 25:
DoScriptText(SAY_PHASE201, m_creature);
DoScriptText(SAY_PHASE201, me);
JumpToNextStep(12000);
break;
case 26:
SetEscortPaused(false);
bStepping = false;
SetRun(false);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
JumpToNextStep(0);
break;
//After waypoint 9
case 27:
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[0]);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[0]);
if (Creature* pCityman = Unit::GetCreature(*me, uiCitymenGUID[0]))
{
pCityman->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
pCityman->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
pCityman->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
pCityman->GetMotionMaster()->MovePoint(0, 2088.625f,1279.191f,140.743f);
}
@@ -663,12 +663,12 @@ struct npc_arthasAI : public npc_escortAI
case 29:
SetEscortPaused(false);
bStepping = false;
DoScriptText(SAY_PHASE203, m_creature);
DoScriptText(SAY_PHASE203, me);
JumpToNextStep(0);
break;
//After waypoint 10
case 30:
m_creature->HandleEmoteCommand(37);
me->HandleEmoteCommand(37);
JumpToNextStep(1000);
break;
case 31:
@@ -677,16 +677,16 @@ struct npc_arthasAI : public npc_escortAI
if (Creature* pCityman1 = Unit::GetCreature(*me, uiCitymenGUID[1]))
{
DoScriptText(SAY_PHASE204, pCityman1);
pCityman1->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
pCityman1->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (Creature* pCityman0 = Unit::GetCreature(*me, uiCitymenGUID[0]))
pCityman0->Kill(pCityman0);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[1]);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiCitymenGUID[1]);
}
JumpToNextStep(0);
break;
//After waypoint 11
case 32:
m_creature->HandleEmoteCommand(37);
me->HandleEmoteCommand(37);
JumpToNextStep(1000);
break;
case 33:
@@ -695,31 +695,31 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(1000);
break;
case 34:
if (Unit* pStalker = m_creature->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
{
uiStalkerGUID = pStalker->GetGUID();
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
DoScriptText(SAY_PHASE205, m_creature);
DoScriptText(SAY_PHASE205, me);
JumpToNextStep(3000);
break;
case 35:
if (Unit* pStalkerM = m_creature->SummonCreature(NPC_INVIS_TARGET,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
if (Unit* pStalkerM = me->SummonCreature(NPC_INVIS_TARGET,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
{
uiStalkerGUID = pStalkerM->GetGUID();
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
JumpToNextStep(1000);
break;
case 36:
if (Creature* pMalganis = m_creature->SummonCreature(NPC_MAL_GANIS,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
if (Creature* pMalganis = me->SummonCreature(NPC_MAL_GANIS,2117.349f,1288.624f,136.271f,1.37f,TEMPSUMMON_TIMED_DESPAWN,60000))
{
if (Creature* pStalkerM = Unit::GetCreature(*me, uiStalkerGUID))
pMalganis->CastSpell(pStalkerM,63793,false);
uiMalganisGUID = pMalganis->GetGUID();
DoScriptText(SAY_PHASE206, pMalganis);
pMalganis->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
pMalganis->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
pMalganis->SetReactState(REACT_PASSIVE);
}
JumpToNextStep(11000);
@@ -746,22 +746,22 @@ struct npc_arthasAI : public npc_escortAI
case 39:
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
pMalganis->SetVisibility(VISIBILITY_OFF);
DoScriptText(SAY_PHASE208, m_creature);
DoScriptText(SAY_PHASE208, me);
JumpToNextStep(7000);
break;
case 40:
if (Unit* pStalker = m_creature->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
if (Unit* pStalker = me->SummonCreature(NPC_INVIS_TARGET,2081.447f,1287.770f,141.3241f,1.37f,TEMPSUMMON_TIMED_DESPAWN,10000))
{
uiStalkerGUID = pStalker->GetGUID();
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiStalkerGUID);
}
DoScriptText(SAY_PHASE209, m_creature);
DoScriptText(SAY_PHASE209, me);
uiBossEvent = DATA_MEATHOOK_EVENT;
if (pInstance)
pInstance->SetData(DATA_ARTHAS_EVENT, IN_PROGRESS);
m_creature->SetReactState(REACT_DEFENSIVE);
me->SetReactState(REACT_DEFENSIVE);
SetDespawnAtFar(false);
JumpToNextStep(5000);
break;
@@ -820,7 +820,7 @@ struct npc_arthasAI : public npc_escortAI
else if (uiBossEvent == DATA_SALRAMM_EVENT)
uiBossID = NPC_SALRAMM;
if (Unit* pBoss = m_creature->SummonCreature(uiBossID,2232.19f,1331.933f,126.662f,3.15f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
if (Unit* pBoss = me->SummonCreature(uiBossID,2232.19f,1331.933f,126.662f,3.15f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
uiBossGUID = pBoss->GetGUID();
pBoss->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
@@ -853,13 +853,13 @@ struct npc_arthasAI : public npc_escortAI
break;
//After Gossip 2 (waypoint 22)
case 61:
m_creature->SetReactState(REACT_AGGRESSIVE);
me->SetReactState(REACT_AGGRESSIVE);
if (Creature* pDisguised0 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[0]))
pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
pDisguised0->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (Creature* pDisguised1 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[1]))
pDisguised1->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
pDisguised1->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
if (Creature* pDisguised2 = Unit::GetCreature(*me, uiInfiniteDraconianGUID[2]))
pDisguised2->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
pDisguised2->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
JumpToNextStep(1000);
break;
case 62:
@@ -868,14 +868,14 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(7000);
break;
case 63:
DoScriptText(SAY_PHASE303, m_creature);
DoScriptText(SAY_PHASE303, me);
SetHoldState(false);
bStepping = false;
JumpToNextStep(0);
break;
//After waypoint 23
case 64:
m_creature->HandleEmoteCommand(54);
me->HandleEmoteCommand(54);
JumpToNextStep(1000);
break;
case 65:
@@ -884,7 +884,7 @@ struct npc_arthasAI : public npc_escortAI
JumpToNextStep(1000);
break;
case 66:
DoScriptText(SAY_PHASE304,m_creature);
DoScriptText(SAY_PHASE304,me);
JumpToNextStep(2000);
break;
case 67:
@@ -939,13 +939,13 @@ struct npc_arthasAI : public npc_escortAI
case 72:
case 74:
case 76:
if (m_creature->isInCombat())
if (me->isInCombat())
uiPhaseTimer = 1000;
else
{
if (uiStep == 72) DoScriptText(SAY_PHASE308,m_creature);
if (uiStep == 74) DoScriptText(SAY_PHASE308,m_creature);
if (uiStep == 76) DoScriptText(SAY_PHASE310,m_creature);
if (uiStep == 72) DoScriptText(SAY_PHASE308,me);
if (uiStep == 74) DoScriptText(SAY_PHASE308,me);
if (uiStep == 76) DoScriptText(SAY_PHASE310,me);
SetHoldState(false);
bStepping = false;
SetRun(true);
@@ -953,16 +953,16 @@ struct npc_arthasAI : public npc_escortAI
}
break;
case 78:
if (m_creature->isInCombat())
if (me->isInCombat())
uiPhaseTimer = 1000;
else
{
DoScriptText(SAY_PHASE312,m_creature);
DoScriptText(SAY_PHASE312,me);
JumpToNextStep(5000);
}
break;
case 79:
DoScriptText(SAY_PHASE313,m_creature);
DoScriptText(SAY_PHASE313,me);
JumpToNextStep(1000);
break;
case 80:
@@ -972,14 +972,14 @@ struct npc_arthasAI : public npc_escortAI
SpawnTimeRift(17,&uiEpochGUID);
if (Creature* pEpoch = Unit::GetCreature(*me, uiEpochGUID))
DoScriptText(SAY_PHASE314,pEpoch);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiEpochGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiEpochGUID);
}
JumpToNextStep(18000);
break;
case 81:
if (pInstance)
if (pInstance->GetData(DATA_EPOCH_EVENT) != DONE)
DoScriptText(SAY_PHASE315, m_creature);
DoScriptText(SAY_PHASE315, me);
JumpToNextStep(6000);
break;
case 82:
@@ -1003,7 +1003,7 @@ struct npc_arthasAI : public npc_escortAI
if (pInstance->GetData(DATA_EPOCH_EVENT) == DONE)
{
uiGossipStep = 3;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
bStepping = false;
uiBossEvent = DATA_MAL_GANIS_EVENT;
JumpToNextStep(15000);
@@ -1016,14 +1016,14 @@ struct npc_arthasAI : public npc_escortAI
break;
//After Gossip 4
case 84:
DoScriptText(SAY_PHASE404,m_creature);
DoScriptText(SAY_PHASE404,me);
SetHoldState(false);
bStepping = false;
break;
//After Gossip 5
case 85:
DoScriptText(SAY_PHASE501, m_creature);
if (Creature* pMalganis = m_creature->SummonCreature(NPC_MAL_GANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
DoScriptText(SAY_PHASE501, me);
if (Creature* pMalganis = me->SummonCreature(NPC_MAL_GANIS,2296.665f,1502.362f,128.362f,4.961f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,900000))
{
uiMalganisGUID = pMalganis->GetGUID();
pMalganis->SetReactState(REACT_PASSIVE);
@@ -1039,9 +1039,9 @@ struct npc_arthasAI : public npc_escortAI
break;
//After waypoint 55
case 86:
DoScriptText(SAY_PHASE502, m_creature);
DoScriptText(SAY_PHASE502, me);
JumpToNextStep(6000);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
break;
case 87:
if (Creature* pMalganis = Unit::GetCreature(*me, uiMalganisGUID))
@@ -1068,17 +1068,17 @@ struct npc_arthasAI : public npc_escortAI
//After waypoint 56
case 89:
SetRun(true);
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
DoScriptText(SAY_PHASE503, m_creature);
me->SetUInt64Value(UNIT_FIELD_TARGET, uiMalganisGUID);
DoScriptText(SAY_PHASE503, me);
JumpToNextStep(7000);
break;
case 90:
if (pInstance)
{
pInstance->SetData(DATA_ARTHAS_EVENT, DONE); //Rewards: Achiev & Chest ;D
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pInstance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
me->SetUInt64Value(UNIT_FIELD_TARGET, pInstance->GetData64(DATA_MAL_GANIS_GATE_2)); //Look behind
}
DoScriptText(SAY_PHASE504, m_creature);
DoScriptText(SAY_PHASE504, me);
bStepping = false;
break;
}
@@ -1086,7 +1086,7 @@ struct npc_arthasAI : public npc_escortAI
}
//Battling skills
if (!m_creature->getVictim())
if (!me->getVictim())
return;
if (uiExorcismTimer < diff)
@@ -1097,7 +1097,7 @@ struct npc_arthasAI : public npc_escortAI
} else uiExorcismTimer -= diff;
if (HealthBelowPct(40))
DoCast(m_creature, SPELL_HOLY_LIGHT);
DoCast(me, SPELL_HOLY_LIGHT);
}
};
@@ -63,7 +63,7 @@ struct boss_aeonusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
@@ -71,10 +71,10 @@ struct boss_aeonusAI : public ScriptedAI
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (m_creature->IsWithinDistInMap(who,20.0f))
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, m_creature);
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -83,7 +83,7 @@ struct boss_aeonusAI : public ScriptedAI
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
{
@@ -94,7 +94,7 @@ struct boss_aeonusAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void UpdateAI(const uint32 diff)
@@ -106,22 +106,22 @@ struct boss_aeonusAI : public ScriptedAI
//Sand Breath
if (SandBreath_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SAND_BREATH);
DoCast(me->getVictim(), SPELL_SAND_BREATH);
SandBreath_Timer = 15000+rand()%10000;
} else SandBreath_Timer -= diff;
//Time Stop
if (TimeStop_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TIME_STOP);
DoCast(me->getVictim(), SPELL_TIME_STOP);
TimeStop_Timer = 20000+rand()%15000;
} else TimeStop_Timer -= diff;
//Frenzy
if (Frenzy_Timer <= diff)
{
DoScriptText(EMOTE_FRENZY, m_creature);
DoCast(m_creature, SPELL_ENRAGE);
DoScriptText(EMOTE_FRENZY, me);
DoCast(me, SPELL_ENRAGE);
Frenzy_Timer = 20000+rand()%15000;
} else Frenzy_Timer -= diff;
@@ -65,7 +65,7 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void MoveInLineOfSight(Unit *who)
@@ -73,10 +73,10 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (m_creature->IsWithinDistInMap(who,20.0f))
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, m_creature);
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
DoScriptText(SAY_BANISH, me);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -85,12 +85,12 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
@@ -105,7 +105,7 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
//Arcane Blast
if (ArcaneBlast_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST);
DoCast(me->getVictim(), SPELL_ARCANE_BLAST);
ArcaneBlast_Timer = 15000+rand()%10000;
} else ArcaneBlast_Timer -= diff;
@@ -120,8 +120,8 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
//Time Lapse
if (TimeLapse_Timer <= diff)
{
DoScriptText(SAY_BANISH, m_creature);
DoCast(m_creature, SPELL_TIME_LAPSE);
DoScriptText(SAY_BANISH, me);
DoCast(me, SPELL_TIME_LAPSE);
TimeLapse_Timer = 15000+rand()%10000;
} else TimeLapse_Timer -= diff;
@@ -129,7 +129,7 @@ struct boss_chrono_lord_dejaAI : public ScriptedAI
{
if (Attraction_Timer <= diff)
{
DoCast(m_creature, SPELL_ATTRACTION);
DoCast(me, SPELL_ATTRACTION);
Attraction_Timer = 25000+rand()%10000;
} else Attraction_Timer -= diff;
}
@@ -64,17 +64,17 @@ struct boss_temporusAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(TYPE_RIFT,SPECIAL);
@@ -85,11 +85,11 @@ struct boss_temporusAI : public ScriptedAI
//Despawn Time Keeper
if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER)
{
if (m_creature->IsWithinDistInMap(who,20.0f))
if (me->IsWithinDistInMap(who,20.0f))
{
DoScriptText(SAY_BANISH, m_creature);
DoScriptText(SAY_BANISH, me);
m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
}
@@ -105,21 +105,21 @@ struct boss_temporusAI : public ScriptedAI
//Attack Haste
if (Haste_Timer <= diff)
{
DoCast(m_creature, SPELL_HASTE);
DoCast(me, SPELL_HASTE);
Haste_Timer = 20000+rand()%5000;
} else Haste_Timer -= diff;
//MortalWound_Timer
if (MortalWound_Timer <= diff)
{
DoCast(m_creature, SPELL_MORTAL_WOUND);
DoCast(me, SPELL_MORTAL_WOUND);
MortalWound_Timer = 10000+rand()%10000;
} else MortalWound_Timer -= diff;
//Wing ruffet
if (WingBuffet_Timer <= diff)
{
DoCast(m_creature, SPELL_WING_BUFFET);
DoCast(me, SPELL_WING_BUFFET);
WingBuffet_Timer = 20000+rand()%10000;
} else WingBuffet_Timer -= diff;
@@ -127,7 +127,7 @@ struct boss_temporusAI : public ScriptedAI
{
if (SpellReflection_Timer <= diff)
{
DoCast(m_creature, SPELL_REFLECT);
DoCast(me, SPELL_REFLECT);
SpellReflection_Timer = 25000+rand()%10000;
} else SpellReflection_Timer -= diff;
}
@@ -78,11 +78,11 @@ struct npc_medivh_bmAI : public ScriptedAI
return;
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
DoCast(m_creature, SPELL_CHANNEL, true);
else if (m_creature->HasAura(SPELL_CHANNEL))
m_creature->RemoveAura(SPELL_CHANNEL);
DoCast(me, SPELL_CHANNEL, true);
else if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
DoCast(m_creature, SPELL_PORTAL_RUNE, true);
DoCast(me, SPELL_PORTAL_RUNE, true);
}
void MoveInLineOfSight(Unit *who)
@@ -90,17 +90,17 @@ struct npc_medivh_bmAI : public ScriptedAI
if (!pInstance)
return;
if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f))
if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE)
return;
DoScriptText(SAY_INTRO, m_creature);
DoScriptText(SAY_INTRO, me);
pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS);
DoCast(m_creature, SPELL_CHANNEL, false);
DoCast(me, SPELL_CHANNEL, false);
Check_Timer = 5000;
}
else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f))
else if (who->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(who, 15.0f))
{
if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
return;
@@ -109,12 +109,12 @@ struct npc_medivh_bmAI : public ScriptedAI
if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU)
{
who->StopMoving();
who->CastSpell(m_creature,SPELL_CORRUPT,false);
who->CastSpell(me,SPELL_CORRUPT,false);
}
else if (entry == C_AEONUS)
{
who->StopMoving();
who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false);
who->CastSpell(me,SPELL_CORRUPT_AEONUS,false);
}
}
}
@@ -143,10 +143,10 @@ struct npc_medivh_bmAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Killer->GetEntry() == m_creature->GetEntry())
if (Killer->GetEntry() == me->GetEntry())
return;
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -160,9 +160,9 @@ struct npc_medivh_bmAI : public ScriptedAI
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
if (m_creature->HasAura(SPELL_CORRUPT_AEONUS))
if (me->HasAura(SPELL_CORRUPT_AEONUS))
SpellCorrupt_Timer = 1000;
else if (m_creature->HasAura(SPELL_CORRUPT))
else if (me->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
@@ -179,36 +179,36 @@ struct npc_medivh_bmAI : public ScriptedAI
if (Life25 && pct <= 25)
{
DoScriptText(SAY_WEAK25, m_creature);
DoScriptText(SAY_WEAK25, me);
Life25 = false;
}
else if (Life50 && pct <= 50)
{
DoScriptText(SAY_WEAK50, m_creature);
DoScriptText(SAY_WEAK50, me);
Life50 = false;
}
else if (Life75 && pct <= 75)
{
DoScriptText(SAY_WEAK75, m_creature);
DoScriptText(SAY_WEAK75, me);
Life75 = false;
}
//if we reach this it means event was running but at some point reset.
if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED)
{
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
m_creature->RemoveCorpse();
m_creature->Respawn();
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
me->Respawn();
return;
}
if (pInstance->GetData(TYPE_RIFT) == DONE)
{
DoScriptText(SAY_WIN, m_creature);
DoScriptText(SAY_WIN, me);
Check_Timer = 0;
if (m_creature->HasAura(SPELL_CHANNEL))
m_creature->RemoveAura(SPELL_CHANNEL);
if (me->HasAura(SPELL_CHANNEL))
me->RemoveAura(SPELL_CHANNEL);
//TODO: start the post-event here
pInstance->SetData(TYPE_MEDIVH,DONE);
@@ -281,19 +281,19 @@ struct npc_time_riftAI : public ScriptedAI
if (pInstance && pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS)
{
m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveAllAuras();
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
return;
}
Position pos;
m_creature->GetRandomNearPosition(pos, 10.0f);
me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if (Unit *Summon = DoSummon(creature_entry, pos, 30000, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT))
if (Unit *temp = Unit::GetUnit(*m_creature, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
if (Unit *temp = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_MEDIVH) : 0))
Summon->AddThreat(temp,0.0f);
}
@@ -327,11 +327,11 @@ struct npc_time_riftAI : public ScriptedAI
TimeRiftWave_Timer = 15000;
} else TimeRiftWave_Timer -= diff;
if (m_creature->IsNonMeleeSpellCasted(false))
if (me->IsNonMeleeSpellCasted(false))
return;
debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die.");
m_creature->setDeathState(JUST_DIED);
me->setDeathState(JUST_DIED);
if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS)
pInstance->SetData(TYPE_RIFT,SPECIAL);
@@ -245,7 +245,7 @@ struct instance_dark_portal : public ScriptedInstance
return 0;
}
Creature* SummonedPortalBoss(Creature* m_creature)
Creature* SummonedPortalBoss(Creature* me)
{
uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss;
@@ -255,12 +255,12 @@ struct instance_dark_portal : public ScriptedInstance
debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry);
Position pos;
m_creature->GetRandomNearPosition(pos, 10.0f);
me->GetRandomNearPosition(pos, 10.0f);
//normalize Z-level if we can, if rift is not at ground level.
pos.m_positionZ = std::max(m_creature->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
pos.m_positionZ = std::max(me->GetMap()->GetHeight(pos.m_positionX, pos.m_positionY, MAX_HEIGHT), me->GetMap()->GetWaterLevel(pos.m_positionX, pos.m_positionY));
if (Creature *summon = m_creature->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
if (Creature *summon = me->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000))
return summon;
debug_log("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun...");
@@ -74,8 +74,8 @@ struct boss_anetheronAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS);
DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit *victim)
@@ -83,16 +83,16 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0);
break;
case 2:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY3);
m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0);
break;
}
}
@@ -102,9 +102,9 @@ struct boss_anetheronAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
@@ -113,8 +113,8 @@ struct boss_anetheronAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_ANETHERONEVENT, DONE);
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONDEATH);
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0);
}
void UpdateAI(const uint32 diff)
@@ -155,12 +155,12 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_SWARM1);
m_creature->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_SWARM1);
me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_SWARM2);
m_creature->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_SWARM2);
me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
break;
}
} else SwarmTimer -= diff;
@@ -176,18 +176,18 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_SLEEP1);
m_creature->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_SLEEP1);
me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_SLEEP2);
m_creature->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_SLEEP2);
me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
break;
}
} else SleepTimer -= diff;
if (AuraTimer <= diff)
{
DoCast(m_creature, SPELL_VAMPIRIC_AURA, true);
DoCast(me, SPELL_VAMPIRIC_AURA, true);
AuraTimer = urand(10000,20000);
} else AuraTimer -= diff;
if (InfernoTimer <= diff)
@@ -197,12 +197,12 @@ struct boss_anetheronAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_INFERNO1);
m_creature->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_INFERNO1);
me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_INFERNO2);
m_creature->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_INFERNO2);
me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
break;
}
} else InfernoTimer -= diff;
@@ -235,7 +235,7 @@ struct mob_towering_infernalAI : public ScriptedAI
void Reset()
{
DoCast(m_creature, SPELL_INFERNO_EFFECT);
DoCast(me, SPELL_INFERNO_EFFECT);
ImmolationTimer = 5000;
CheckTimer = 5000;
}
@@ -254,7 +254,7 @@ struct mob_towering_infernalAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who))
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
@@ -264,11 +264,11 @@ struct mob_towering_infernalAI : public ScriptedAI
{
if (AnetheronGUID)
{
Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID);
Creature* boss = Unit::GetCreature((*me),AnetheronGUID);
if (!boss || (boss && boss->isDead()))
{
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
@@ -281,7 +281,7 @@ struct mob_towering_infernalAI : public ScriptedAI
if (ImmolationTimer <= diff)
{
DoCast(m_creature, SPELL_IMMOLATION);
DoCast(me, SPELL_IMMOLATION);
ImmolationTimer = 5000;
} else ImmolationTimer -= diff;
@@ -91,7 +91,7 @@ struct mob_ancient_wispAI : public ScriptedAI
if (pInstance)
ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void EnterCombat(Unit* who) {}
@@ -102,10 +102,10 @@ struct mob_ancient_wispAI : public ScriptedAI
{
if (CheckTimer <= diff)
{
if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID))
if (Unit* Archimonde = Unit::GetUnit((*me), ArchimondeGUID))
{
if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive())
DoCast(m_creature, SPELL_DENOUEMENT_WISP);
DoCast(me, SPELL_DENOUEMENT_WISP);
else
DoCast(Archimonde, SPELL_ANCIENT_SPARK);
}
@@ -158,16 +158,16 @@ struct mob_doomfire_targettingAI : public ScriptedAI
{
if (ChangeTargetTimer <= diff)
{
if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID))
if (Unit *temp = Unit::GetUnit(*me,TargetGUID))
{
m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f);
me->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f);
TargetGUID = 0;
}
else
{
Position pos;
m_creature->GetRandomNearPosition(pos, 40);
m_creature->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
me->GetRandomNearPosition(pos, 40);
me->GetMotionMaster()->MovePoint(0, pos.m_positionX, pos.m_positionY, pos.m_positionZ);
}
ChangeTargetTimer = 5000;
@@ -245,8 +245,8 @@ struct boss_archimondeAI : public hyjal_trashAI
void EnterCombat(Unit *who)
{
m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL);
DoScriptText(SAY_AGGRO, m_creature);
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
DoScriptText(SAY_AGGRO, me);
DoZoneInCombat();
if (pInstance)
@@ -255,7 +255,7 @@ struct boss_archimondeAI : public hyjal_trashAI
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2,SAY_SLAY3), me);
if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
GainSoulCharge(CAST_PLR(victim));
@@ -268,17 +268,17 @@ struct boss_archimondeAI : public hyjal_trashAI
case CLASS_PRIEST:
case CLASS_PALADIN:
case CLASS_WARLOCK:
victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true);
victim->CastSpell(me, SPELL_SOUL_CHARGE_RED, true);
break;
case CLASS_MAGE:
case CLASS_ROGUE:
case CLASS_WARRIOR:
victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true);
victim->CastSpell(me, SPELL_SOUL_CHARGE_YELLOW, true);
break;
case CLASS_DRUID:
case CLASS_SHAMAN:
case CLASS_HUNTER:
victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true);
victim->CastSpell(me, SPELL_SOUL_CHARGE_GREEN, true);
break;
}
@@ -289,7 +289,7 @@ struct boss_archimondeAI : public hyjal_trashAI
void JustDied(Unit *victim)
{
hyjal_trashAI::JustDied(victim);
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance)
pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE);
@@ -298,11 +298,11 @@ struct boss_archimondeAI : public hyjal_trashAI
bool CanUseFingerOfDeath()
{
// First we check if our current victim is in melee range or not.
Unit* victim = m_creature->getVictim();
if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim)))
Unit* victim = me->getVictim();
if (victim && me->IsWithinDistInMap(victim, me->GetAttackDistance(victim)))
return false;
std::list<HostileReference*>& m_threatlist = m_creature->getThreatManager().getThreatList();
std::list<HostileReference*>& m_threatlist = me->getThreatManager().getThreatList();
if (m_threatlist.empty())
return false;
@@ -310,7 +310,7 @@ struct boss_archimondeAI : public hyjal_trashAI
std::list<HostileReference*>::const_iterator itr = m_threatlist.begin();
for (; itr != m_threatlist.end(); ++itr)
{
Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid());
Unit* pUnit = Unit::GetUnit((*me), (*itr)->getUnitGuid());
if (pUnit && pUnit->isAlive())
targets.push_back(pUnit);
}
@@ -318,14 +318,14 @@ struct boss_archimondeAI : public hyjal_trashAI
if (targets.empty())
return false;
targets.sort(ObjectDistanceOrder(m_creature));
targets.sort(ObjectDistanceOrder(me));
Unit *pTarget = targets.front();
if (pTarget)
{
if (!m_creature->IsWithinDistInMap(pTarget, m_creature->GetAttackDistance(pTarget)))
if (!me->IsWithinDistInMap(pTarget, me->GetAttackDistance(pTarget)))
return true; // Cast Finger of Death
else // This target is closest, he is our new tank
m_creature->AddThreat(pTarget, m_creature->getThreatManager().getThreat(m_creature->getVictim()));
me->AddThreat(pTarget, me->getThreatManager().getThreat(me->getVictim()));
}
return false;
@@ -334,10 +334,10 @@ struct boss_archimondeAI : public hyjal_trashAI
void JustSummoned(Creature *summoned)
{
if (summoned->GetEntry() == CREATURE_ANCIENT_WISP)
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
else
{
summoned->setFaction(m_creature->getFaction());
summoned->setFaction(me->getFaction());
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
@@ -350,9 +350,9 @@ struct boss_archimondeAI : public hyjal_trashAI
if (summoned->GetEntry() == CREATURE_DOOMFIRE)
{
summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false);
summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID());
summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,me->GetGUID());
if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID))
if (Unit *DoomfireSpirit = Unit::GetUnit(*me, DoomfireSpiritGUID))
{
summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f);
DoomfireSpiritGUID = 0;
@@ -363,18 +363,18 @@ struct boss_archimondeAI : public hyjal_trashAI
//this is code doing close to what the summoning spell would do (spell 31903)
void SummonDoomfire(Unit *pTarget)
{
m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT,
pTarget->GetPositionX()+15.0,pTarget->GetPositionY()+15.0,pTarget->GetPositionZ(),0,
TEMPSUMMON_TIMED_DESPAWN, 27000);
m_creature->SummonCreature(CREATURE_DOOMFIRE,
me->SummonCreature(CREATURE_DOOMFIRE,
pTarget->GetPositionX()-15.0,pTarget->GetPositionY()-15.0,pTarget->GetPositionZ(),0,
TEMPSUMMON_TIMED_DESPAWN, 27000);
}
void UnleashSoulCharge()
{
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
bool HasCast = false;
uint32 chargeSpell = 0;
@@ -396,10 +396,10 @@ struct boss_archimondeAI : public hyjal_trashAI
break;
}
if (m_creature->HasAura(chargeSpell))
if (me->HasAura(chargeSpell))
{
m_creature->RemoveAuraFromStack(chargeSpell);
DoCast(m_creature->getVictim(), unleashSpell);
me->RemoveAuraFromStack(chargeSpell);
DoCast(me->getVictim(), unleashSpell);
HasCast = true;
SoulChargeCount--;
}
@@ -410,20 +410,20 @@ struct boss_archimondeAI : public hyjal_trashAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->isInCombat())
if (!me->isInCombat())
{
if (pInstance)
{
// Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished.
if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35)))
if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((me->GetVisibility() != VISIBILITY_OFF) || (me->getFaction() != 35)))
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->setFaction(35);
me->SetVisibility(VISIBILITY_OFF);
me->setFaction(35);
}
else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35)))
else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((me->GetVisibility() != VISIBILITY_ON) || (me->getFaction() == 35)))
{
m_creature->setFaction(1720);
m_creature->SetVisibility(VISIBILITY_ON);
me->setFaction(1720);
me->SetVisibility(VISIBILITY_ON);
}
}
@@ -431,12 +431,12 @@ struct boss_archimondeAI : public hyjal_trashAI
{
if (!IsChanneling)
{
Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
Creature *temp = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000);
if (temp)
WorldTreeGUID = temp->GetGUID();
if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID))
if (Unit *Nordrassil = Unit::GetUnit(*me, WorldTreeGUID))
{
Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Nordrassil->SetDisplayId(11686);
@@ -445,9 +445,9 @@ struct boss_archimondeAI : public hyjal_trashAI
}
}
if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID))
if (Unit *Nordrassil = Unit::GetUnit(*me, WorldTreeGUID))
{
Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true);
Nordrassil->CastSpell(me, SPELL_DRAIN_WORLD_TREE_2, true);
DrainNordrassilTimer = 1000;
}
} else DrainNordrassilTimer -= diff;
@@ -456,36 +456,36 @@ struct boss_archimondeAI : public hyjal_trashAI
if (!UpdateVictim())
return;
if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
if (((me->GetHealth()*100 / me->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged)
BelowTenPercent = true;
if (!Enraged)
{
if (EnrageTimer <= diff)
{
if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10)
if ((me->GetHealth()*100 / me->GetMaxHealth()) > 10)
{
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
Enraged = true;
DoScriptText(SAY_ENRAGE, m_creature);
DoScriptText(SAY_ENRAGE, me);
}
} else EnrageTimer -= diff;
if (CheckDistanceTimer <= diff)
{
// To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature
Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
Creature* Check = me->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000);
if (Check)
{
Check->SetVisibility(VISIBILITY_OFF);
if (m_creature->IsWithinDistInMap(Check, 75))
if (me->IsWithinDistInMap(Check, 75))
{
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
Enraged = true;
DoScriptText(SAY_ENRAGE, m_creature);
DoScriptText(SAY_ENRAGE, me);
}
}
CheckDistanceTimer = 5000;
@@ -496,11 +496,11 @@ struct boss_archimondeAI : public hyjal_trashAI
{
if (!HasProtected)
{
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
//all members of raid must get this buff
DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE);
DoCast(me->getVictim(), SPELL_PROTECTION_OF_ELUNE);
HasProtected = true;
Enraged = true;
}
@@ -513,14 +513,14 @@ struct boss_archimondeAI : public hyjal_trashAI
} else SummonWispTimer -= diff;
if (WispCount >= 30)
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);
}
if (Enraged)
{
if (HandOfDeathTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH);
DoCast(me->getVictim(), SPELL_HAND_OF_DEATH);
HandOfDeathTimer = 2000;
} else HandOfDeathTimer -= diff;
return; // Don't do anything after this point.
@@ -542,9 +542,9 @@ struct boss_archimondeAI : public hyjal_trashAI
if (AirBurstTimer <= diff)
{
if (urand(0,1))
DoScriptText(SAY_AIR_BURST1, m_creature);
DoScriptText(SAY_AIR_BURST1, me);
else
DoScriptText(SAY_AIR_BURST2, m_creature);
DoScriptText(SAY_AIR_BURST2, me);
DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank
AirBurstTimer = urand(25000,40000);
@@ -552,20 +552,20 @@ struct boss_archimondeAI : public hyjal_trashAI
if (FearTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FEAR);
DoCast(me->getVictim(), SPELL_FEAR);
FearTimer = 42000;
} else FearTimer -= diff;
if (DoomfireTimer <= diff)
{
if (urand(0,1))
DoScriptText(SAY_DOOMFIRE1, m_creature);
DoScriptText(SAY_DOOMFIRE1, me);
else
DoScriptText(SAY_DOOMFIRE2, m_creature);
DoScriptText(SAY_DOOMFIRE2, me);
Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!temp)
temp = m_creature->getVictim();
temp = me->getVictim();
//replace with spell cast 31903 once implicitTarget 73 implemented
SummonDoomfire(temp);
@@ -67,8 +67,8 @@ struct boss_azgalorAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS);
DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit *victim)
@@ -76,16 +76,16 @@ struct boss_azgalorAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY3);
m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
}
@@ -95,9 +95,9 @@ struct boss_azgalorAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
@@ -106,7 +106,7 @@ struct boss_azgalorAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_AZGALOREVENT, DONE);
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -152,20 +152,20 @@ struct boss_azgalorAI : public hyjal_trashAI
if (HowlTimer <= diff)
{
DoCast(m_creature, SPELL_HOWL_OF_AZGALOR);
DoCast(me, SPELL_HOWL_OF_AZGALOR);
HowlTimer = 30000;
} else HowlTimer -= diff;
if (CleaveTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
CleaveTimer = 10000+rand()%5000;
} else CleaveTimer -= diff;
if (EnrageTimer < diff && !enraged)
{
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_BERSERK, true);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_BERSERK, true);
enraged = true;
EnrageTimer = 600000;
} else EnrageTimer -= diff;
@@ -202,7 +202,7 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
{
CrippleTimer = 50000;
WarstompTimer = 10000;
DoCast(m_creature, SPELL_THRASH);
DoCast(me, SPELL_THRASH);
CheckTimer = 5000;
}
@@ -222,7 +222,7 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
void MoveInLineOfSight(Unit *who)
{
if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who))
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
AttackStart(who);
}
@@ -237,11 +237,11 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
{
if (AzgalorGUID)
{
Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID);
Creature* boss = Unit::GetCreature((*me),AzgalorGUID);
if (!boss || (boss && boss->isDead()))
{
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
return;
}
}
@@ -254,7 +254,7 @@ struct mob_lesser_doomguardAI : public hyjal_trashAI
if (WarstompTimer <= diff)
{
DoCast(m_creature, SPELL_WARSTOMP);
DoCast(me, SPELL_WARSTOMP);
WarstompTimer = 10000+rand()%5000;
} else WarstompTimer -= diff;
@@ -62,8 +62,8 @@ struct boss_kazrogalAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS);
DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL);
}
void KilledUnit(Unit *victim)
@@ -71,16 +71,16 @@ struct boss_kazrogalAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
case 2:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY3);
m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY3);
me->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL);
break;
}
}
@@ -90,9 +90,9 @@ struct boss_kazrogalAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
@@ -101,7 +101,7 @@ struct boss_kazrogalAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_KAZROGALEVENT, DONE);
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
DoPlaySoundToSet(me, SOUND_ONDEATH);
}
void UpdateAI(const uint32 diff)
@@ -135,27 +135,27 @@ struct boss_kazrogalAI : public hyjal_trashAI
if (CleaveTimer <= diff)
{
DoCast(m_creature, SPELL_CLEAVE);
DoCast(me, SPELL_CLEAVE);
CleaveTimer = 6000+rand()%15000;
} else CleaveTimer -= diff;
if (WarStompTimer <= diff)
{
DoCast(m_creature, SPELL_WARSTOMP);
DoCast(me, SPELL_WARSTOMP);
WarStompTimer = 60000;
} else WarStompTimer -= diff;
if (m_creature->HasAura(SPELL_MARK))
m_creature->RemoveAurasDueToSpell(SPELL_MARK);
if (me->HasAura(SPELL_MARK))
me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
{
//cast dummy, useful for bos addons
m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());
me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
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)
{
Unit *pTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
Unit *pTarget = Unit::GetUnit(*me, (*itr)->getUnitGuid());
if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->getPowerType() == POWER_MANA)
{
pTarget->CastSpell(pTarget, SPELL_MARK,true);//only cast on mana users
@@ -168,12 +168,12 @@ struct boss_kazrogalAI : public hyjal_trashAI
switch (urand(0,2))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_MARK1);
m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_MARK1);
me->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_MARK2);
m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_MARK2);
me->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
break;
}
} else MarkTimer -= diff;
@@ -62,8 +62,8 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
{
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS);
DoPlaySoundToSet(m_creature, SOUND_ONAGGRO);
m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONAGGRO);
me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0);
}
void KilledUnit(Unit *victim)
@@ -71,12 +71,12 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY1);
m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY1);
me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_ONSLAY2);
m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONSLAY2);
me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL);
break;
}
}
@@ -86,9 +86,9 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
pos = i;
if (i == 7 && pInstance)
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0f);
me->AddThreat(pTarget,0.0f);
}
}
@@ -97,8 +97,8 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
hyjal_trashAI::JustDied(victim);
if (pInstance && IsEvent)
pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE);
DoPlaySoundToSet(m_creature, SOUND_ONDEATH);
m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_ONDEATH);
me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL);
}
void UpdateAI(const uint32 diff)
@@ -132,38 +132,38 @@ struct boss_rage_winterchillAI : public hyjal_trashAI
if (FrostArmorTimer <= diff)
{
DoCast(m_creature, SPELL_FROST_ARMOR);
DoCast(me, SPELL_FROST_ARMOR);
FrostArmorTimer = 40000+rand()%20000;
} else FrostArmorTimer -= diff;
if (DecayTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY);
DoCast(me->getVictim(), SPELL_DEATH_AND_DECAY);
DecayTimer = 60000+rand()%20000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_DECAY1);
m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DECAY1);
me->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_DECAY2);
m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_DECAY2);
me->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
break;
}
} else DecayTimer -= diff;
if (NovaTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROST_NOVA);
DoCast(me->getVictim(), SPELL_FROST_NOVA);
NovaTimer = 30000+rand()%15000;
switch (urand(0,1))
{
case 0:
DoPlaySoundToSet(m_creature, SOUND_NOVA1);
m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NOVA1);
me->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
break;
case 1:
DoPlaySoundToSet(m_creature, SOUND_NOVA2);
m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
DoPlaySoundToSet(me, SOUND_NOVA2);
me->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
break;
}
} else NovaTimer -= diff;
@@ -308,7 +308,7 @@ float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde
{5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596}
};
hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature)
hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(me)
{
pInstance = c->GetInstanceData();
VeinsSpawned[0] = false;
@@ -343,7 +343,7 @@ void hyjalAI::SummonedCreatureDespawn(Creature* summoned)
void hyjalAI::Reset()
{
IsDummy = false;
m_creature->setActive(true);
me->setActive(true);
// GUIDs
PlayerGUID = 0;
BossGUID[0] = 0;
@@ -359,11 +359,11 @@ void hyjalAI::Reset()
EnemyCount = 0;
// Set faction properly based on Creature entry
switch(m_creature->GetEntry())
switch(me->GetEntry())
{
case JAINA:
Faction = 0;
DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
DoCast(me, SPELL_BRILLIANCE_AURA, true);
break;
case THRALL:
@@ -384,7 +384,7 @@ void hyjalAI::Reset()
Debug = false;
//Flags
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
//Initialize spells
memset(Spell, 0, sizeof(Spell));
@@ -392,7 +392,7 @@ void hyjalAI::Reset()
//Reset Instance Data for trash count
if (pInstance)
{
if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == THRALL))
if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && me->GetEntry() == THRALL))
{
//Reset World States
pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
@@ -408,16 +408,16 @@ void hyjalAI::Reset()
void hyjalAI::EnterEvadeMode()
{
if (m_creature->GetEntry() != JAINA)
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
m_creature->LoadCreaturesAddon();
if (me->GetEntry() != JAINA)
me->RemoveAllAuras();
me->DeleteThreatList();
me->CombatStop(true);
me->LoadCreaturesAddon();
if (m_creature->isAlive())
m_creature->GetMotionMaster()->MoveTargetedHome();
if (me->isAlive())
me->GetMotionMaster()->MoveTargetedHome();
m_creature->SetLootRecipient(NULL);
me->SetLootRecipient(NULL);
}
void hyjalAI::EnterCombat(Unit *who)
@@ -454,19 +454,19 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3))
{//summon at tower
pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
if (pCreature)
CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true;
}else{//summon at gate
pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
}
break;
case 17907: //FROST_WYRM ,
if (FirstBossDead && WaveCount == 1) //summon at gate
pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
else
{
pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
pCreature = me->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
if (pCreature)
CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true;
}
@@ -475,10 +475,10 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
++InfernalCount;
if (InfernalCount > 7)
InfernalCount = 0;
pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
pCreature = me->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
break;
default:
pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
pCreature = me->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);
break;
}
@@ -592,7 +592,7 @@ void hyjalAI::StartEvent(Player* pPlayer)
CheckTimer = 5000;
PlayerGUID = pPlayer->GetGUID();
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0);
pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0);
@@ -643,7 +643,7 @@ void hyjalAI::Talk(uint32 id)
}
if (YellId)
DoScriptText(YellId, m_creature);
DoScriptText(YellId, me);
}
void hyjalAI::Retreat()
@@ -663,7 +663,7 @@ void hyjalAI::Retreat()
if (Faction == 1)
{
pInstance->SetData(DATA_HORDE_RETREAT, 1);
Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000);
Creature* JainaDummy = me->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000);
if (JainaDummy)
{
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
@@ -677,7 +677,7 @@ void hyjalAI::Retreat()
}
SpawnVeins();
Overrun = true;
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
}
void hyjalAI::SpawnVeins()
@@ -688,7 +688,7 @@ void hyjalAI::SpawnVeins()
return;
for (uint8 i = 0; i<7; ++i)
{
GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
GameObject* gem = me->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
if (gem)
VeinGUID[i]=gem->GetGUID();
}
@@ -698,7 +698,7 @@ void hyjalAI::SpawnVeins()
return;
for (uint8 i = 7; i<14; ++i)
{
GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
GameObject* gem = me->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0);
if (gem)
VeinGUID[i]=gem->GetGUID();
}
@@ -712,7 +712,7 @@ void hyjalAI::DeSpawnVeins()
return;
if (Faction == 1)
{
Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE));
Creature* pUnit=Unit::GetCreature((*me),pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (!pUnit)return;
hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI());
if (!ai)return;
@@ -723,7 +723,7 @@ void hyjalAI::DeSpawnVeins()
}
} else if (Faction)
{
Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL));
Creature* pUnit=Unit::GetCreature((*me),pInstance->GetData64(DATA_THRALL));
if (!pUnit)return;
hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI());
if (!ai)return;
@@ -741,7 +741,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
if (MassTeleportTimer < diff && DoMassTeleport)
{
DoCast(m_creature, SPELL_MASS_TELEPORT, false);
DoCast(me, SPELL_MASS_TELEPORT, false);
DoMassTeleport = false;
} else MassTeleportTimer -= diff;
return;
@@ -749,32 +749,32 @@ void hyjalAI::UpdateAI(const uint32 diff)
if (DoHide)
{
DoHide = false;
switch(m_creature->GetEntry())
switch(me->GetEntry())
{
case JAINA:
if (pInstance && pInstance->GetData(DATA_ALLIANCE_RETREAT))
{
m_creature->SetVisibility(VISIBILITY_OFF);
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
me->SetVisibility(VISIBILITY_OFF);
HideNearPos(me->GetPositionX(), me->GetPositionY());
HideNearPos(5037.76, -1889.71);
for (uint8 i = 0; i < 92; ++i)//summon fires
m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
me->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
}
else m_creature->SetVisibility(VISIBILITY_ON);
else me->SetVisibility(VISIBILITY_ON);
break;
case THRALL: //thrall
if (pInstance && pInstance->GetData(DATA_HORDE_RETREAT))
{
m_creature->SetVisibility(VISIBILITY_OFF);
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
me->SetVisibility(VISIBILITY_OFF);
HideNearPos(me->GetPositionX(), me->GetPositionY());
HideNearPos(5563, -2763.19);
HideNearPos(5542.2, -2629.36);
for (uint8 i = 0; i < 65; ++i)//summon fires
m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
me->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
}
else m_creature->SetVisibility(VISIBILITY_ON);
else me->SetVisibility(VISIBILITY_ON);
break;
}
}
@@ -783,7 +783,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
if (RespawnTimer <= diff)
{
DoRespawn = false;
RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
RespawnNearPos(me->GetPositionX(), me->GetPositionY());
if (Faction == 0)
{
RespawnNearPos(5037.76, -1889.71);
@@ -792,10 +792,10 @@ void hyjalAI::UpdateAI(const uint32 diff)
RespawnNearPos(5563, -2763.19);
RespawnNearPos(5542.2, -2629.36);
}
m_creature->SetVisibility(VISIBILITY_ON);
me->SetVisibility(VISIBILITY_ON);
}else{
RespawnTimer -= diff;
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
}
return;
}
@@ -807,8 +807,8 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
IsDummy = true;
bRetreat = false;
HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY());
switch(m_creature->GetEntry())
HideNearPos(me->GetPositionX(), me->GetPositionY());
switch(me->GetEntry())
{
case JAINA://jaina
HideNearPos(5037.76, -1889.71);
@@ -819,7 +819,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
HideNearPos(5603.75, -2853.12);
break;
}
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
} else RetreatTimer -= diff;
}
@@ -851,7 +851,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
if (BossGUID[i])
{
Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]);
Unit* pUnit = Unit::GetUnit((*me), BossGUID[i]);
if (pUnit && (!pUnit->isAlive()))
{
if (BossGUID[i] == BossGUID[0])
@@ -866,7 +866,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
}
EventBegun = false;
CheckTimer = 0;
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
BossGUID[i] = 0;
if (pInstance)
pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it
@@ -885,16 +885,16 @@ void hyjalAI::UpdateAI(const uint32 diff)
{
if (SpellTimer[i] <= diff)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
Unit *pTarget = NULL;
switch(Spell[i].TargetType)
{
case TARGETTYPE_SELF: pTarget = m_creature; break;
case TARGETTYPE_SELF: pTarget = me; break;
case TARGETTYPE_RANDOM: pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); break;
case TARGETTYPE_VICTIM: pTarget = m_creature->getVictim(); break;
case TARGETTYPE_VICTIM: pTarget = me->getVictim(); break;
}
if (pTarget && pTarget->isAlive())
@@ -911,8 +911,8 @@ void hyjalAI::UpdateAI(const uint32 diff)
void hyjalAI::JustDied(Unit* killer)
{
if (IsDummy)return;
m_creature->Respawn();
m_creature->SetVisibility(VISIBILITY_OFF);
me->Respawn();
me->SetVisibility(VISIBILITY_OFF);
DoRespawn = true;
RespawnTimer = 120000;
Talk(DEATH);
@@ -939,14 +939,14 @@ void hyjalAI::HideNearPos(float x, float y)
// First get all creatures.
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
Trinity::AllFriendlyCreaturesInGrid creature_check(me);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
// Get Creatures
cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
cell.Visit(pair, creature_visitor, *(me->GetMap()));
if (!creatures.empty())
{
@@ -965,61 +965,61 @@ void hyjalAI::RespawnNearPos(float x, float y)
cell.SetNoCreate();
Trinity::RespawnDo u_do;
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(m_creature, u_do);
Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(me, u_do);
TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker);
cell.Visit(p, obj_worker, *m_creature->GetMap());
cell.Visit(p, obj_worker, *me->GetMap());
}
void hyjalAI::WaypointReached(uint32 i)
{
if (i == 1 || (i == 0 && m_creature->GetEntry() == THRALL))
if (i == 1 || (i == 0 && me->GetEntry() == THRALL))
{
m_creature->MonsterYell(YELL_HURRY,0,0);
me->MonsterYell(YELL_HURRY,0,0);
WaitForTeleport = true;
TeleportTimer = 20000;
if (m_creature->GetEntry() == JAINA)
DoCast(m_creature, SPELL_MASS_TELEPORT, false);
if (m_creature->GetEntry() == THRALL && DummyGuid)
if (me->GetEntry() == JAINA)
DoCast(me, SPELL_MASS_TELEPORT, false);
if (me->GetEntry() == THRALL && DummyGuid)
{
Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid);
Unit* Dummy = Unit::GetUnit((*me),DummyGuid);
if (Dummy)
{
CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true;
CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000;
Dummy->CastSpell(m_creature, SPELL_MASS_TELEPORT, false);
Dummy->CastSpell(me, SPELL_MASS_TELEPORT, false);
}
}
//do some talking
//all alive guards walk near here
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();
// First get all creatures.
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
Trinity::AllFriendlyCreaturesInGrid creature_check(me);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
cell.Visit(pair, creature_visitor, *(me->GetMap()));
if (!creatures.empty())
{
for (std::list<Creature*>::const_iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
{
if ((*itr) && (*itr)->isAlive() && (*itr) != m_creature && (*itr)->GetEntry() != JAINA)
if ((*itr) && (*itr)->isAlive() && (*itr) != me && (*itr)->GetEntry() != JAINA)
{
if (!(*itr)->IsWithinDist(m_creature, 60))
if (!(*itr)->IsWithinDist(me, 60))
(*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
float x, y, z;
(*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE);
(*itr)->GetMotionMaster()->Initialize();
float range = 10;
if (m_creature->GetEntry() == THRALL)range = 20;
m_creature->GetNearPoint(m_creature, x, y, z, range, 0, m_creature->GetAngle((*itr)));
(*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), m_creature->GetPositionZ());
if (me->GetEntry() == THRALL)range = 20;
me->GetNearPoint(me, x, y, z, range, 0, me->GetAngle((*itr)));
(*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), me->GetPositionZ());
}
}
}
@@ -1032,19 +1032,19 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
if (TeleportTimer <= diff)
{
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();
std::list<Creature*> creatures;
Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
Trinity::AllFriendlyCreaturesInGrid creature_check(me);
Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(me, creatures, creature_check);
TypeContainerVisitor
<Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
GridTypeMapContainer> creature_visitor(creature_searcher);
cell.Visit(pair, creature_visitor, *(m_creature->GetMap()));
cell.Visit(pair, creature_visitor, *(me->GetMap()));
if (!creatures.empty())
{
@@ -1057,7 +1057,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
(*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
}
DoCast(m_creature, SPELL_TELEPORT_VISUAL);
DoCast(me, SPELL_TELEPORT_VISUAL);
bRetreat = true;
RetreatTimer = 1000;
}
@@ -1073,12 +1073,12 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
{
case 0://alliance
for (uint8 i = 0; i < 92; ++i)//summon fires
m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
me->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0);
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
{
uint8 r = rand()%4;
Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
Creature* pUnit = me->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -1090,7 +1090,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
for (uint8 i = 0; i < 3; ++i)//summon 3 abominations
{
uint8 r = rand()%4;
Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
Creature* pUnit = me->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -1101,7 +1101,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
}
for (uint8 i = 0; i < 5; ++i)//summon 5 gargoyles
{
Creature* pUnit = m_creature->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
Creature* pUnit = me->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]);
@@ -1114,11 +1114,11 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
break;
case 1://horde
for (uint8 i = 0; i < 65; ++i)//summon fires
m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
me->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0);
for (uint8 i = 0; i < 26; ++i)//summon infernals
{
Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
Creature* pUnit = me->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]);
@@ -1131,7 +1131,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
for (uint8 i = 0; i < 25; ++i)//summon 25 ghouls
{
uint8 r = rand()%4;
Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
Creature* pUnit = me->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -1143,7 +1143,7 @@ void hyjalAI::DoOverrun(uint32 faction, const uint32 diff)
for (uint8 i = 0; i < 5; ++i)//summon 5 abominations
{
uint8 r = rand()%4;
Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
Creature* pUnit = me->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
if (pUnit)
{
CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction;
@@ -171,13 +171,13 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
SetupOverrun = true;
if (faction == 0)
{
if (m_creature->GetEntry() == GARGOYLE)
if (me->GetEntry() == GARGOYLE)
{
DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4
DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1];
DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2];
}
if (m_creature->GetEntry() == ABOMINATION)
if (me->GetEntry() == ABOMINATION)
{
for (uint8 i = 0; i < 4; ++i)
AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]);
@@ -200,7 +200,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]);
AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]);
AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2]);
m_creature->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0);
me->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 18;
Start(true, true);
@@ -222,7 +222,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]);
AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]);
AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2]);
m_creature->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0);
me->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 18;
Start(true, true);
@@ -237,7 +237,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
break;
}
}
if (m_creature->GetEntry() == GHOUL)
if (me->GetEntry() == GHOUL)
{
for (uint8 i = 0; i < 4; ++i)
AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]);
@@ -246,7 +246,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
case 0:
AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3,3), AllianceOverrunWP[1][1]+irand(-3,3), AllianceOverrunWP[1][2]);
AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2]);
m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0);
me->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 5;
Start(true, true);
@@ -255,7 +255,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3,3), AllianceOverrunWP[3][1]+irand(-3,3), AllianceOverrunWP[3][2]);
AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3,3), AllianceOverrunWP[4][1]+irand(-3,3), AllianceOverrunWP[4][2]);
AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2]);
m_creature->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0);
me->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 6;
Start(true, true);
@@ -265,7 +265,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3,3), AllianceOverrunWP[7][1]+irand(-3,3), AllianceOverrunWP[7][2]);
AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3,3), AllianceOverrunWP[8][1]+irand(-3,3), AllianceOverrunWP[8][2]);
AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2]);
m_creature->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0);
me->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 7;
Start(true, true);
@@ -274,7 +274,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3,3), AllianceOverrunWP[10][1]+irand(-3,3), AllianceOverrunWP[10][2]);
AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3,3), AllianceOverrunWP[11][1]+irand(-3,3), AllianceOverrunWP[11][2]);
AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2]);
m_creature->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0);
me->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 6;
Start(true, true);
@@ -283,7 +283,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3,3), AllianceOverrunWP[13][1]+irand(-3,3), AllianceOverrunWP[13][2]);
AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3,3), AllianceOverrunWP[14][1]+irand(-3,3), AllianceOverrunWP[14][2]);
AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2]);
m_creature->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0);
me->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 6;
Start(true, true);
@@ -295,7 +295,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3,3), AllianceOverrunWP[19][1]+irand(-3,3), AllianceOverrunWP[19][2]);
AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3,3), AllianceOverrunWP[20][1]+irand(-3,3), AllianceOverrunWP[20][2]);
AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2]);
m_creature->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0);
me->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 9;
Start(true, true);
@@ -312,7 +312,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
}
if (faction == 1)
{
if (m_creature->GetEntry() == GHOUL)
if (me->GetEntry() == GHOUL)
{
for (uint8 i = 0; i < 6; ++i)
AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]);
@@ -323,7 +323,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]);
AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]);
AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]);
m_creature->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0);
me->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 8;
Start(true, true);
@@ -333,7 +333,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]);
AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]);
AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]);
m_creature->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0);
me->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0);
SetDespawnAtEnd(false);
LastOverronPos = 8;
Start(true, true);
@@ -347,7 +347,7 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
break;
}
}
if (m_creature->GetEntry() == ABOMINATION)
if (me->GetEntry() == ABOMINATION)
{
for (uint8 i = 0; i < 6; ++i)
AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]);
@@ -365,11 +365,11 @@ void hyjal_trashAI::JustDied(Unit *victim)
{
if (!pInstance)
return;
if (IsEvent && !m_creature->isWorldBoss())
if (IsEvent && !me->isWorldBoss())
pInstance->SetData(DATA_TRASH, 0);//signal trash is dead
if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss()))
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !me->isWorldBoss()) || (damageTaken < me->GetMaxHealth()/4 && me->isWorldBoss()))
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
}
struct mob_giant_infernalAI : public hyjal_trashAI
@@ -380,9 +380,9 @@ struct mob_giant_infernalAI : public hyjal_trashAI
meteor = false;//call once!
CanMove = false;
Delay = rand()%30000;
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetDisplayId(MODEL_INVIS);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(MODEL_INVIS);
pGo = false;
pos = 0;
Reset();
@@ -413,9 +413,9 @@ struct mob_giant_infernalAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
}
@@ -432,31 +432,31 @@ struct mob_giant_infernalAI : public hyjal_trashAI
if (!meteor)
{
float x,y,z;
m_creature->GetPosition(x,y,z);
Creature* trigger = m_creature->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000);
me->GetPosition(x,y,z);
Creature* trigger = me->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,me->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000);
if (trigger)
{
trigger->SetVisibility(VISIBILITY_OFF);
trigger->setFaction(m_creature->getFaction());
trigger->setFaction(me->getFaction());
trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
trigger->CastSpell(m_creature,SPELL_METEOR,true);
trigger->CastSpell(me,SPELL_METEOR,true);
}
m_creature->GetMotionMaster()->Clear();
me->GetMotionMaster()->Clear();
meteor = true;
} else if (!CanMove){
if (spawnTimer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(me->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
CanMove = true;
if (pInstance)
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT))
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
} else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){
//do overrun
}
@@ -485,12 +485,12 @@ struct mob_giant_infernalAI : public hyjal_trashAI
return;
if (!imol)
{
DoCast(m_creature, SPELL_IMMOLATION);
DoCast(me, SPELL_IMMOLATION);
imol=true;
}
if (FlameBuffetTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FLAME_BUFFET, true);
DoCast(me->getVictim(), SPELL_FLAME_BUFFET, true);
FlameBuffetTimer = 7000;
} else FlameBuffetTimer -= diff;
DoMeleeAttackIfReady();
@@ -530,21 +530,21 @@ struct mob_abominationAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}else{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
if (i == LastOverronPos && IsOverrun)
{
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
m_creature->setDeathState(DEAD);
m_creature->RemoveCorpse();
me->setDeathState(DEAD);
me->RemoveCorpse();
}
}
}
@@ -579,13 +579,13 @@ struct mob_abominationAI : public hyjal_trashAI
}
}
}
if (!m_creature->HasAura(SPELL_DISEASE_CLOUD))
DoCast(m_creature, SPELL_DISEASE_CLOUD);
if (!me->HasAura(SPELL_DISEASE_CLOUD))
DoCast(me, SPELL_DISEASE_CLOUD);
if (!UpdateVictim())
return;
if (KnockDownTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKDOWN);
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
KnockDownTimer = 15000+rand()%10000;
} else KnockDownTimer -= diff;
DoMeleeAttackIfReady();
@@ -628,22 +628,22 @@ struct mob_ghoulAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}else{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
if (i == LastOverronPos && IsOverrun)
{
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
m_creature->setDeathState(DEAD);
m_creature->RemoveCorpse();
me->setDeathState(DEAD);
me->RemoveCorpse();
}
}
@@ -681,7 +681,7 @@ struct mob_ghoulAI : public hyjal_trashAI
}
if (FrenzyTimer <= diff)
{
DoCast(m_creature, SPELL_FRENZY);
DoCast(me, SPELL_FRENZY);
FrenzyTimer = 15000+rand()%15000;
} else FrenzyTimer -= diff;
if (!UpdateVictim())
@@ -703,7 +703,7 @@ CreatureAI* GetAI_mob_ghoul(Creature* pCreature)
struct mob_necromancerAI : public hyjal_trashAI
{
mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(m_creature)
mob_necromancerAI(Creature* c) : hyjal_trashAI(c), summons(me)
{
pInstance = c->GetInstanceData();
pGo = false;
@@ -735,13 +735,13 @@ struct mob_necromancerAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}else{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
}
@@ -798,7 +798,7 @@ struct mob_necromancerAI : public hyjal_trashAI
return;
if (ShadowBoltTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT);
DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
ShadowBoltTimer = 20000+rand()%10000;
} else ShadowBoltTimer -= diff;
@@ -844,13 +844,13 @@ struct mob_bansheeAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}else{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
}
@@ -889,17 +889,17 @@ struct mob_bansheeAI : public hyjal_trashAI
return;
if (CourseTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BANSHEE_CURSE);
DoCast(me->getVictim(), SPELL_BANSHEE_CURSE);
CourseTimer = 20000+rand()%5000;
} else CourseTimer -= diff;
if (WailTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_BANSHEE_WAIL);
DoCast(me->getVictim(), SPELL_BANSHEE_WAIL);
WailTimer = 15000+rand()%5000;
} else WailTimer -= diff;
if (ShellTimer <= diff)
{
DoCast(m_creature, SPELL_ANTI_MAGIC_SHELL);
DoCast(me, SPELL_ANTI_MAGIC_SHELL);
ShellTimer = 50000+rand()%10000;
} else ShellTimer -= diff;
DoMeleeAttackIfReady();
@@ -938,13 +938,13 @@ struct mob_crypt_fiendAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}else{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
}
@@ -984,7 +984,7 @@ struct mob_crypt_fiendAI : public hyjal_trashAI
return;
if (WebTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WEB);
DoCast(me->getVictim(), SPELL_WEB);
WebTimer = 20000+rand()%5000;
} else WebTimer -= diff;
DoMeleeAttackIfReady();
@@ -1023,13 +1023,13 @@ struct mob_fel_stalkerAI : public hyjal_trashAI
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}else{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_JAINAPROUDMOORE));
if (pTarget && pTarget->isAlive())
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
}
}
}
@@ -1069,7 +1069,7 @@ struct mob_fel_stalkerAI : public hyjal_trashAI
return;
if (ManaBurnTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MANA_BURN);
DoCast(me->getVictim(), SPELL_MANA_BURN);
ManaBurnTimer = 9000+rand()%5000;
} else ManaBurnTimer -= diff;
DoMeleeAttackIfReady();
@@ -1102,7 +1102,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
{
FrostBreathTimer = 5000;
MoveTimer = 0;
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
}
void WaypointReached(uint32 i)
@@ -1110,10 +1110,10 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
pos = i;
if (i == 2 && pInstance && !IsOverrun)
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
{
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
DoCast(pTarget, SPELL_FROST_BREATH, true);
}
}
@@ -1125,10 +1125,10 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
pInstance->SetData(DATA_TRASH, 0);//signal trash is dead
float x,y,z;
m_creature->GetPosition(x,y,z);
z = m_creature->GetMap()->GetVmapHeight(x, y, z);
m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0);
me->GetPosition(x,y,z);
z = me->GetMap()->GetVmapHeight(x, y, z);
me->GetMotionMaster()->MovePoint(0,x,y,z);
me->GetMap()->CreatureRelocation(me, x,y,z,0);
}
void EnterCombat(Unit* who) {}
@@ -1138,7 +1138,7 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
hyjal_trashAI::UpdateAI(diff);
if (IsEvent || IsOverrun)
{
CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanAttack(false);
CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false);
npc_escortAI::UpdateAI(diff);
}
if (IsEvent)
@@ -1165,21 +1165,21 @@ struct mob_frost_wyrmAI : public hyjal_trashAI
}
if (!UpdateVictim())
return;
if (!m_creature->IsWithinDist(m_creature->getVictim(), 25)){
if (!me->IsWithinDist(me->getVictim(), 25)){
if (MoveTimer <= diff)
{
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
me->GetMotionMaster()->MoveChase(me->getVictim());
MoveTimer = 2000;
} else MoveTimer-=diff;
}
if (FrostBreathTimer <= diff)
{
if (!m_creature->IsWithinDist(m_creature->getVictim(), 25))
if (!me->IsWithinDist(me->getVictim(), 25))
{
DoCast(m_creature->getVictim(), SPELL_FROST_BREATH);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
DoCast(me->getVictim(), SPELL_FROST_BREATH);
me->StopMoving();
me->GetMotionMaster()->Clear();
FrostBreathTimer = 4000;
}
} else FrostBreathTimer -= diff;
@@ -1217,7 +1217,7 @@ struct mob_gargoyleAI : public hyjal_trashAI
Zpos = 10.0;
StrikeTimer = 2000+rand()%5000;
MoveTimer = 0;
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
}
void WaypointReached(uint32 i)
@@ -1225,10 +1225,10 @@ struct mob_gargoyleAI : public hyjal_trashAI
pos = i;
if (i == 2 && pInstance && !IsOverrun)
{
Unit *pTarget = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL));
Unit *pTarget = Unit::GetUnit((*me), pInstance->GetData64(DATA_THRALL));
if (pTarget && pTarget->isAlive())
{
m_creature->AddThreat(pTarget,0.0);
me->AddThreat(pTarget,0.0);
DoCast(pTarget, SPELL_GARGOYLE_STRIKE, true);
}
}
@@ -1237,10 +1237,10 @@ struct mob_gargoyleAI : public hyjal_trashAI
void JustDied(Unit *victim)
{
float x,y,z;
m_creature->GetPosition(x,y,z);
z = m_creature->GetMap()->GetVmapHeight(x, y, z);
m_creature->GetMotionMaster()->MovePoint(0,x,y,z);
m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0);
me->GetPosition(x,y,z);
z = me->GetMap()->GetVmapHeight(x, y, z);
me->GetMotionMaster()->MovePoint(0,x,y,z);
me->GetMap()->CreatureRelocation(me, x,y,z,0);
hyjal_trashAI::JustDied(victim);
}
@@ -1249,7 +1249,7 @@ struct mob_gargoyleAI : public hyjal_trashAI
hyjal_trashAI::UpdateAI(diff);
if (IsEvent || IsOverrun)
{
CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanAttack(false);
CAST_AI(hyjal_trashAI, me->AI())->SetCanAttack(false);
npc_escortAI::UpdateAI(diff);
}
if (IsEvent)
@@ -1280,27 +1280,27 @@ struct mob_gargoyleAI : public hyjal_trashAI
{
if (StrikeTimer <= diff)
{
m_creature->CastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false);
me->CastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false);
StrikeTimer = 2000+rand()%1000;
} else StrikeTimer -= diff;
}
}
if (!UpdateVictim())
return;
if (!m_creature->IsWithinDist(m_creature->getVictim(), 20) || forcemove)
if (!me->IsWithinDist(me->getVictim(), 20) || forcemove)
{
forcemove = false;
if (forcemove)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
m_creature->Attack(pTarget,false);
me->Attack(pTarget,false);
}
if (MoveTimer <= diff)
{
float x,y,z;
m_creature->getVictim()->GetPosition(x,y,z);
m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos);
me->getVictim()->GetPosition(x,y,z);
me->GetMotionMaster()->MovePoint(0,x,y,z+Zpos);
Zpos-=1.0;
if (Zpos <= 0)Zpos=0;
MoveTimer = 2000;
@@ -1308,11 +1308,11 @@ struct mob_gargoyleAI : public hyjal_trashAI
}
if (StrikeTimer <= diff)
{
if (m_creature->IsWithinDist(m_creature->getVictim(), 20))
if (me->IsWithinDist(me->getVictim(), 20))
{
DoCast(m_creature->getVictim(), SPELL_GARGOYLE_STRIKE);
m_creature->StopMoving();
m_creature->GetMotionMaster()->Clear();
DoCast(me->getVictim(), SPELL_GARGOYLE_STRIKE);
me->StopMoving();
me->GetMotionMaster()->Clear();
StrikeTimer = 2000+rand()%1000;
} else StrikeTimer=0;
} else StrikeTimer -= diff;
@@ -1346,13 +1346,13 @@ struct alliance_riflemanAI : public Scripted_NoMovementAI
void MoveInLineOfSight(Unit *who)
{
if (!who || m_creature->getVictim())
if (!who || me->getVictim())
return;
if (who->isTargetableForAttack() && m_creature->IsHostileTo(who))
if (who->isTargetableForAttack() && me->IsHostileTo(who))
{
float attackRadius = m_creature->GetAttackDistance(who);
if (m_creature->IsWithinDistInMap(who, 30))
float attackRadius = me->GetAttackDistance(who);
if (me->IsWithinDistInMap(who, 30))
{
AttackStart(who);
}
@@ -1370,13 +1370,13 @@ struct alliance_riflemanAI : public Scripted_NoMovementAI
return;
if (ExplodeTimer <= diff)
{
if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 30))
if (!me->IsWithinDistInMap(me->getVictim(), 30))
{
EnterEvadeMode();
return;
}
int dmg = 500+rand()%700;
m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false);
me->CastCustomSpell(me->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false);
ExplodeTimer = 5000+rand()%5000;
} else ExplodeTimer -= diff;
DoMeleeAttackIfReady();
@@ -67,18 +67,18 @@ struct boss_captain_skarlocAI : public ScriptedAI
void EnterCombat(Unit *who)
{
//This is not correct. Should taunt Thrall before engage in combat
DoScriptText(SAY_TAUNT1, m_creature);
DoScriptText(SAY_TAUNT2, m_creature);
DoScriptText(SAY_TAUNT1, me);
DoScriptText(SAY_TAUNT2, me);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART1, DONE);
@@ -93,42 +93,42 @@ struct boss_captain_skarlocAI : public ScriptedAI
//Holy_Light
if (Holy_Light_Timer <= diff)
{
DoCast(m_creature, SPELL_HOLY_LIGHT);
DoCast(me, SPELL_HOLY_LIGHT);
Holy_Light_Timer = 30000;
} else Holy_Light_Timer -= diff;
//Cleanse
if (Cleanse_Timer <= diff)
{
DoCast(m_creature, SPELL_CLEANSE);
DoCast(me, SPELL_CLEANSE);
Cleanse_Timer = 10000;
} else Cleanse_Timer -= diff;
//Hammer of Justice
if (HammerOfJustice_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE);
DoCast(me->getVictim(), SPELL_HAMMER_OF_JUSTICE);
HammerOfJustice_Timer = 60000;
} else HammerOfJustice_Timer -= diff;
//Holy Shield
if (HolyShield_Timer <= diff)
{
DoCast(m_creature, SPELL_HOLY_SHIELD);
DoCast(me, SPELL_HOLY_SHIELD);
HolyShield_Timer = 240000;
} else HolyShield_Timer -= diff;
//Devotion_Aura
if (DevotionAura_Timer <= diff)
{
DoCast(m_creature, SPELL_DEVOTION_AURA);
DoCast(me, SPELL_DEVOTION_AURA);
DevotionAura_Timer = 45000 + rand()%10000;
} else DevotionAura_Timer -= diff;
//Consecration
if (Consecration_Timer <= diff)
{
//DoCast(m_creature->getVictim(), SPELL_CONSECRATION);
//DoCast(me->getVictim(), SPELL_CONSECRATION);
Consecration_Timer = 5000 + rand()%5000;
} else Consecration_Timer -= diff;
@@ -64,17 +64,17 @@ struct boss_epoch_hunterAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), m_creature);
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2), me);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
pInstance->SetData(TYPE_THRALL_PART4, DONE);
@@ -89,19 +89,19 @@ struct boss_epoch_hunterAI : public ScriptedAI
//Sand Breath
if (SandBreath_Timer <= diff)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoCast(m_creature->getVictim(), SPELL_SAND_BREATH);
DoCast(me->getVictim(), SPELL_SAND_BREATH);
DoScriptText(RAND(SAY_BREATH1,SAY_BREATH2), m_creature);
DoScriptText(RAND(SAY_BREATH1,SAY_BREATH2), me);
SandBreath_Timer = 10000 + rand()%10000;
} else SandBreath_Timer -= diff;
if (ImpendingDeath_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_IMPENDING_DEATH);
DoCast(me->getVictim(), SPELL_IMPENDING_DEATH);
ImpendingDeath_Timer = 25000+rand()%5000;
} else ImpendingDeath_Timer -= diff;
@@ -114,7 +114,7 @@ struct boss_epoch_hunterAI : public ScriptedAI
if (Mda_Timer <= diff)
{
DoCast(m_creature, SPELL_MAGIC_DISRUPTION_AURA);
DoCast(me, SPELL_MAGIC_DISRUPTION_AURA);
Mda_Timer = 15000;
} else Mda_Timer -= diff;
@@ -115,17 +115,17 @@ struct boss_lieutenant_drakeAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), m_creature);
DoScriptText(RAND(SAY_SLAY1,SAY_SLAY2), me);
}
void JustDied(Unit *victim)
{
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void UpdateAI(const uint32 diff)
@@ -133,7 +133,7 @@ struct boss_lieutenant_drakeAI : public ScriptedAI
//TODO: make this work
if (CanPatrol && wpId == 0)
{
m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
me->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z);
++wpId;
}
@@ -144,23 +144,23 @@ struct boss_lieutenant_drakeAI : public ScriptedAI
//Whirlwind
if (Whirlwind_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WHIRLWIND);
DoCast(me->getVictim(), SPELL_WHIRLWIND);
Whirlwind_Timer = 20000+rand()%5000;
} else Whirlwind_Timer -= diff;
//Fear
if (Fear_Timer <= diff)
{
DoScriptText(SAY_SHOUT, m_creature);
DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT);
DoScriptText(SAY_SHOUT, me);
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
Fear_Timer = 25000+rand()%10000;
} else Fear_Timer -= diff;
//Mortal Strike
if (MortalStrike_Timer <= diff)
{
DoScriptText(SAY_MORTAL, m_creature);
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
DoScriptText(SAY_MORTAL, me);
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 20000+rand()%10000;
} else MortalStrike_Timer -= diff;
@@ -184,7 +184,7 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
pInstance = c->GetInstanceData();
HadMount = false;
m_creature->setActive(true);
me->setActive(true);
}
ScriptedInstance *pInstance;
@@ -203,73 +203,73 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
case 8:
SetRun(false);
m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 9:
DoScriptText(SAY_TH_ARMORY, m_creature);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
//m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
//m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
//m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
//m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
DoScriptText(SAY_TH_ARMORY, me);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO);
//me->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038);
break;
case 10:
m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED);
me->SetDisplayId(THRALL_MODEL_EQUIPPED);
break;
case 11:
SetRun();
break;
case 15:
m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 21:
m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 25:
m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 29:
DoScriptText(SAY_TH_SKARLOC_MEET, m_creature);
m_creature->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
DoScriptText(SAY_TH_SKARLOC_MEET, me);
me->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
//temporary,skarloc should rather be triggered to walk up to thrall
break;
case 30:
SetEscortPaused(true);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetRun(false);
break;
case 31:
DoScriptText(SAY_TH_MOUNTS_UP, m_creature);
DoScriptText(SAY_TH_MOUNTS_UP, me);
DoMount();
SetRun();
break;
case 37:
//possibly regular patrollers? If so, remove this and let database handle them
m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 59:
m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
me->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000);
DoUnmount();
HadMount = false;
SetRun(false);
break;
case 60:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
//make horsie run off
SetEscortPaused(true);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(TYPE_THRALL_PART2, DONE);
SetRun();
break;
@@ -277,10 +277,10 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
SetRun(false);
break;
case 68:
m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 71:
SetRun();
@@ -289,42 +289,42 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
SetRun(false);
break;
case 83:
m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
me->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000);
break;
case 84:
DoScriptText(SAY_TH_CHURCH_END, m_creature);
DoScriptText(SAY_TH_CHURCH_END, me);
SetRun();
break;
case 91:
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
SetRun(false);
break;
case 93:
m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
me->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000);
break;
case 94:
if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA))
{
if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID))
DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature);
if (Unit* Taretha = Unit::GetUnit((*me), TarethaGUID))
DoScriptText(SAY_TA_ESCAPED, Taretha, me);
}
break;
case 95:
DoScriptText(SAY_TH_MEET_TARETHA, m_creature);
DoScriptText(SAY_TH_MEET_TARETHA, me);
pInstance->SetData(TYPE_THRALL_PART3,DONE);
SetEscortPaused(true);
break;
case 96:
DoScriptText(SAY_TH_EPOCH_WONDER, m_creature);
DoScriptText(SAY_TH_EPOCH_WONDER, me);
break;
case 97:
DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature);
DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, me);
SetRun();
break;
case 98:
@@ -342,24 +342,24 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
}
//kill credit Creature for quest
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
Map::PlayerList const& players = pMap->GetPlayers();
if (!players.isEmpty() && pMap->IsDungeon())
{
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
{
if (Player* pPlayer = itr->getSource())
pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID());
pPlayer->KilledMonsterCredit(20156,me->GetGUID());
}
}
//alot will happen here, thrall and taretha talk, erozion appear at spot to explain
m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
me->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000);
}
break;
case 108:
//last waypoint, just set Thrall invisible, respawn is turned off
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
break;
}
}
@@ -375,34 +375,34 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
{
DoUnmount();
HadMount = false;
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
m_creature->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0);
me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0);
me->SetDisplayId(THRALL_MODEL_UNEQUIPPED);
}
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
DoScriptText(RAND(SAY_TH_LEAVE_COMBAT1,SAY_TH_LEAVE_COMBAT2,SAY_TH_LEAVE_COMBAT3), m_creature);
DoScriptText(RAND(SAY_TH_LEAVE_COMBAT1,SAY_TH_LEAVE_COMBAT2,SAY_TH_LEAVE_COMBAT3), me);
}
}
void StartWP()
{
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
SetEscortPaused(false);
}
void DoMount()
{
m_creature->Mount(SKARLOC_MOUNT_MODEL);
m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT);
me->Mount(SKARLOC_MOUNT_MODEL);
me->SetSpeed(MOVE_RUN,SPEED_MOUNT);
}
void DoUnmount()
{
m_creature->Unmount();
m_creature->SetSpeed(MOVE_RUN,SPEED_RUN);
me->Unmount();
me->SetSpeed(MOVE_RUN,SPEED_RUN);
}
void EnterCombat(Unit* who)
{
DoScriptText(RAND(SAY_TH_RANDOM_AGGRO1,SAY_TH_RANDOM_AGGRO2,SAY_TH_RANDOM_AGGRO3,SAY_TH_RANDOM_AGGRO4), m_creature);
if (m_creature->IsMounted())
DoScriptText(RAND(SAY_TH_RANDOM_AGGRO1,SAY_TH_RANDOM_AGGRO2,SAY_TH_RANDOM_AGGRO3,SAY_TH_RANDOM_AGGRO4), me);
if (me->IsMounted())
{
DoUnmount();
HadMount = true;
@@ -421,14 +421,14 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
case EROZION_ENTRY:
break;
default:
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
break;
}
}
void KilledUnit(Unit *victim)
{
DoScriptText(RAND(SAY_TH_RANDOM_KILL1,SAY_TH_RANDOM_KILL2,SAY_TH_RANDOM_KILL3), m_creature);
DoScriptText(RAND(SAY_TH_RANDOM_KILL1,SAY_TH_RANDOM_KILL2,SAY_TH_RANDOM_KILL3), me);
}
void JustDied(Unit *slayer)
{
@@ -436,10 +436,10 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
pInstance->SetData(TYPE_THRALL_EVENT,FAIL);
// Don't do a yell if he kills self (if player goes too far or at the end).
if (slayer == m_creature)
if (slayer == me)
return;
DoScriptText(RAND(SAY_TH_RANDOM_DIE1,SAY_TH_RANDOM_DIE2), m_creature);
DoScriptText(RAND(SAY_TH_RANDOM_DIE1,SAY_TH_RANDOM_DIE2), me);
}
void UpdateAI(const uint32 diff)
@@ -450,9 +450,9 @@ struct npc_thrall_old_hillsbradAI : public npc_escortAI
return;
//TODO: add his abilities'n-crap here
if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20))
if (!LowHp && ((me->GetHealth()*100 / me->GetMaxHealth()) < 20))
{
DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), m_creature);
DoScriptText(RAND(SAY_TH_RANDOM_LOW_HP1,SAY_TH_RANDOM_LOW_HP2), me);
LowHp = true;
}
}
@@ -567,10 +567,10 @@ struct npc_tarethaAI : public npc_escortAI
switch(i)
{
case 6:
DoScriptText(SAY_TA_FREE, m_creature);
DoScriptText(SAY_TA_FREE, me);
break;
case 7:
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
me->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
break;
}
}
+14 -14
View File
@@ -78,16 +78,16 @@ struct npc_kerlonianAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_LILADRIS)
if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_LILADRIS)
{
if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*5))
if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*5))
{
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE)
pPlayer->GroupEventHappens(QUEST_SLEEPER_AWAKENED, m_creature);
pPlayer->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me);
DoScriptText(SAY_KER_END, m_creature);
DoScriptText(SAY_KER_END, me);
}
SetFollowComplete();
@@ -105,20 +105,20 @@ struct npc_kerlonianAI : public FollowerAI
{
SetFollowPaused(true);
DoScriptText(RAND(EMOTE_KER_SLEEP_1,EMOTE_KER_SLEEP_2,EMOTE_KER_SLEEP_3), m_creature);
DoScriptText(RAND(EMOTE_KER_SLEEP_1,EMOTE_KER_SLEEP_2,EMOTE_KER_SLEEP_3), me);
DoScriptText(RAND(SAY_KER_SLEEP_1,SAY_KER_SLEEP_2,SAY_KER_SLEEP_3,SAY_KER_SLEEP_4), m_creature);
DoScriptText(RAND(SAY_KER_SLEEP_1,SAY_KER_SLEEP_2,SAY_KER_SLEEP_3,SAY_KER_SLEEP_4), me);
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
DoCast(m_creature, SPELL_SLEEP_VISUAL, false);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
DoCast(me, SPELL_SLEEP_VISUAL, false);
}
void ClearSleeping()
{
m_creature->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL);
me->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(EMOTE_KER_AWAKEN, m_creature);
DoScriptText(EMOTE_KER_AWAKEN, me);
SetFollowPaused(false);
}
@@ -273,7 +273,7 @@ struct npc_prospector_remtravelAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
//unsure if it should be any
//pSummoned->AI()->AttackStart(m_creature);
//pSummoned->AI()->AttackStart(me);
}
};
@@ -320,9 +320,9 @@ struct npc_threshwackonatorAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_GELKAK)
if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_GELKAK)
{
if (m_creature->IsWithinDistInMap(pWho, 10.0f))
if (me->IsWithinDistInMap(pWho, 10.0f))
{
DoScriptText(SAY_AT_CLOSE, pWho);
DoAtEnd();
+7 -7
View File
@@ -64,15 +64,15 @@ struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
if (pWho->GetEntry() == NPC_SMEED)
{
if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return;
if (m_creature->IsWithinDistInMap(pWho, 10.0f))
if (me->IsWithinDistInMap(pWho, 10.0f))
{
DoScriptText(RAND(SAY_SMEED_HOME_1,SAY_SMEED_HOME_2,SAY_SMEED_HOME_3), pWho);
//spell have no implemented effect (dummy), so useful to notify spellHit
DoCast(m_creature, SPELL_KODO_KOMBO_GOSSIP, true);
DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true);
}
}
}
@@ -81,7 +81,7 @@ struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
{
if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP)
{
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_uiDespawnTimer = 60000;
}
}
@@ -91,11 +91,11 @@ struct npc_aged_dying_ancient_kodoAI : public ScriptedAI
//timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat.
if (m_uiDespawnTimer && m_uiDespawnTimer <= diff)
{
if (!m_creature->getVictim() && m_creature->isAlive())
if (!me->getVictim() && me->isAlive())
{
Reset();
m_creature->setDeathState(JUST_DIED);
m_creature->Respawn();
me->setDeathState(JUST_DIED);
me->Respawn();
return;
}
} else m_uiDespawnTimer -= diff;
+7 -7
View File
@@ -62,21 +62,21 @@ struct npc_lazy_peonAI : public ScriptedAI
if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER
&& CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE)
{
caster->ToPlayer()->KilledMonsterCredit(m_creature->GetEntry(),m_creature->GetGUID());
DoScriptText(SAY_SPELL_HIT, m_creature, caster);
m_creature->RemoveAllAuras();
if (GameObject* Lumberpile = m_creature->FindNearestGameObject(GO_LUMBERPILE, 20))
m_creature->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(),me->GetGUID());
DoScriptText(SAY_SPELL_HIT, me, caster);
me->RemoveAllAuras();
if (GameObject* Lumberpile = me->FindNearestGameObject(GO_LUMBERPILE, 20))
me->GetMotionMaster()->MovePoint(1,Lumberpile->GetPositionX()-1,Lumberpile->GetPositionY(),Lumberpile->GetPositionZ());
}
}
void UpdateAI(const uint32 uiDiff)
{
if (work = true)
m_creature->HandleEmoteCommand(466);
me->HandleEmoteCommand(466);
if (m_uiRebuffTimer <= uiDiff)
{
DoCast(m_creature, SPELL_BUFF_SLEEP);
DoCast(me, SPELL_BUFF_SLEEP);
m_uiRebuffTimer = 300000; //Rebuff agian in 5 minutes
}
else
+22 -22
View File
@@ -70,8 +70,8 @@ struct mobs_risen_husk_spiritAI : public ScriptedAI
if (m_uiConsumeFlesh_Timer <= uiDiff)
{
if (m_creature->GetEntry() == NPC_RISEN_HUSK)
DoCast(m_creature->getVictim(), SPELL_CONSUME_FLESH);
if (me->GetEntry() == NPC_RISEN_HUSK)
DoCast(me->getVictim(), SPELL_CONSUME_FLESH);
m_uiConsumeFlesh_Timer = 15000;
}
@@ -80,8 +80,8 @@ struct mobs_risen_husk_spiritAI : public ScriptedAI
if (m_uiIntangiblePresence_Timer <= uiDiff)
{
if (m_creature->GetEntry() == NPC_RISEN_SPIRIT)
DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE);
if (me->GetEntry() == NPC_RISEN_SPIRIT)
DoCast(me->getVictim(), SPELL_INTANGIBLE_PRESENCE);
m_uiIntangiblePresence_Timer = 20000;
}
@@ -124,7 +124,7 @@ struct npc_restless_apparitionAI : public ScriptedAI
void Reset()
{
DoScriptText(RAND(SAY_RESTLESS_1,SAY_RESTLESS_2,SAY_RESTLESS_3), m_creature);
DoScriptText(RAND(SAY_RESTLESS_1,SAY_RESTLESS_2,SAY_RESTLESS_3), me);
}
};
@@ -272,10 +272,10 @@ struct npc_private_hendelAI : public ScriptedAI
void AttackedBy(Unit* pAttacker)
{
if (m_creature->getVictim())
if (me->getVictim())
return;
if (m_creature->IsFriendlyTo(pAttacker))
if (me->IsFriendlyTo(pAttacker))
return;
AttackStart(pAttacker);
@@ -283,14 +283,14 @@ struct npc_private_hendelAI : public ScriptedAI
void DamageTaken(Unit* pDoneBy, uint32 &uiDamage)
{
if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 20))
if (uiDamage > me->GetHealth() || ((me->GetHealth() - uiDamage)*100 / me->GetMaxHealth() < 20))
{
uiDamage = 0;
if (Player* pPlayer = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself())
pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, m_creature);
pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me);
DoScriptText(EMOTE_SURRENDER, m_creature);
DoScriptText(EMOTE_SURRENDER, me);
EnterEvadeMode();
}
}
@@ -333,13 +333,13 @@ struct npc_zelfraxAI : public ScriptedAI
if (!pWho)
return;
if (m_creature->Attack(pWho, true))
if (me->Attack(pWho, true))
{
m_creature->SetInCombatWith(pWho);
pWho->SetInCombatWith(m_creature);
me->SetInCombatWith(pWho);
pWho->SetInCombatWith(me);
if (IsCombatMovement())
m_creature->GetMotionMaster()->MoveChase(pWho);
me->GetMotionMaster()->MoveChase(pWho);
}
}
@@ -348,21 +348,21 @@ struct npc_zelfraxAI : public ScriptedAI
if (uiType != POINT_MOTION_TYPE)
return;
m_creature->SetHomePosition(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation());
m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->SetHomePosition(me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation());
me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE);
SetCombatMovement(true);
if (m_creature->isInCombat())
if (Unit* pUnit = m_creature->getVictim())
m_creature->GetMotionMaster()->MoveChase(pUnit);
if (me->isInCombat())
if (Unit* pUnit = me->getVictim())
me->GetMotionMaster()->MoveChase(pUnit);
}
void MoveToDock()
{
SetCombatMovement(false);
m_creature->GetMotionMaster()->MovePoint(0,MovePosition);
DoScriptText(SAY_ZELFRAX,m_creature);
DoScriptText(SAY_ZELFRAX_2,m_creature);
me->GetMotionMaster()->MovePoint(0,MovePosition);
DoScriptText(SAY_ZELFRAX,me);
DoScriptText(SAY_ZELFRAX_2,me);
}
void UpdateAI(uint32 const uiDiff)
+18 -18
View File
@@ -89,32 +89,32 @@ struct npc_oox22feAI : public npc_escortAI
{
// First Ambush(3 Yetis)
case 11:
DoScriptText(SAY_OOX_AMBUSH, m_creature);
m_creature->SummonCreature(NPC_YETI, -4841.01, 1593.91, 73.42, 3.98, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_YETI, -4837.61, 1568.58, 78.21, 3.13, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_YETI, -4841.89, 1569.95, 76.53, 0.68, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
DoScriptText(SAY_OOX_AMBUSH, me);
me->SummonCreature(NPC_YETI, -4841.01, 1593.91, 73.42, 3.98, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_YETI, -4837.61, 1568.58, 78.21, 3.13, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_YETI, -4841.89, 1569.95, 76.53, 0.68, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
break;
//Second Ambush(3 Gorillas)
case 21:
DoScriptText(SAY_OOX_AMBUSH, m_creature);
m_creature->SummonCreature(NPC_GORILLA, -4595.81, 2005.99, 53.08, 3.74, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_GORILLA, -4597.53, 2008.31, 52.70, 3.78, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_GORILLA, -4599.37, 2010.59, 52.77, 3.84, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
DoScriptText(SAY_OOX_AMBUSH, me);
me->SummonCreature(NPC_GORILLA, -4595.81, 2005.99, 53.08, 3.74, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_GORILLA, -4597.53, 2008.31, 52.70, 3.78, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_GORILLA, -4599.37, 2010.59, 52.77, 3.84, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
break;
//Third Ambush(4 Gnolls)
case 30:
DoScriptText(SAY_OOX_AMBUSH, m_creature);
m_creature->SummonCreature(NPC_WOODPAW_REAVER, -4425.14, 2075.87, 47.77, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68, 2077.98, 47.57, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33, 2080.24, 47.43, 3.87, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
m_creature->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04, 2075.54, 46.83, 3.81, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
DoScriptText(SAY_OOX_AMBUSH, me);
me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14, 2075.87, 47.77, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68, 2077.98, 47.57, 3.77, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33, 2080.24, 47.43, 3.87, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
me->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04, 2075.54, 46.83, 3.81, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
break;
case 37:
DoScriptText(SAY_OOX_END, m_creature);
DoScriptText(SAY_OOX_END, me);
// Award quest credit
if (Player* pPlayer = GetPlayerForEscort())
{
pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature);
pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
}
break;
}
@@ -123,19 +123,19 @@ struct npc_oox22feAI : public npc_escortAI
void Reset()
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetStandState(UNIT_STAND_STATE_DEAD);
}
void EnterCombat(Unit* who)
{
//For an small probability the npc says something when he get aggro
if (urand(0,9) > 7)
DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), m_creature);
DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), me);
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
};
@@ -46,7 +46,7 @@ struct celebras_the_cursedAI : public ScriptedAI
void JustDied(Unit* Killer)
{
m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000);
me->SummonCreature(13716, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000);
}
void UpdateAI(const uint32 diff)
@@ -67,15 +67,15 @@ struct celebras_the_cursedAI : public ScriptedAI
//EntanglingRoots
if (EntanglingRoots_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ENTANGLINGROOTS);
DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS);
EntanglingRoots_Timer = 20000;
} else EntanglingRoots_Timer -= diff;
//CorruptForces
if (CorruptForces_Timer <= diff)
{
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_CORRUPT_FORCES);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_CORRUPT_FORCES);
CorruptForces_Timer = 20000;
} else CorruptForces_Timer -= diff;
@@ -54,24 +54,24 @@ struct boss_landslideAI : public ScriptedAI
//KnockAway_Timer
if (KnockAway_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKAWAY);
DoCast(me->getVictim(), SPELL_KNOCKAWAY);
KnockAway_Timer = 15000;
} else KnockAway_Timer -= diff;
//Trample_Timer
if (Trample_Timer <= diff)
{
DoCast(m_creature, SPELL_TRAMPLE);
DoCast(me, SPELL_TRAMPLE);
Trample_Timer = 8000;
} else Trample_Timer -= diff;
//Landslide
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
if (me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
if (Landslide_Timer <= diff)
{
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_LANDSLIDE);
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_LANDSLIDE);
Landslide_Timer = 60000;
} else Landslide_Timer -= diff;
}
+16 -16
View File
@@ -60,12 +60,12 @@ struct boss_noxxionAI : public ScriptedAI
if (Invisible && Invisible_Timer <= diff)
{
//Become visible again
m_creature->setFaction(14);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//Noxxion model
m_creature->SetDisplayId(11172);
me->SetDisplayId(11172);
Invisible = false;
//m_creature->m_canMove = true;
//me->m_canMove = true;
} else if (Invisible)
{
Invisible_Timer -= diff;
@@ -80,14 +80,14 @@ struct boss_noxxionAI : public ScriptedAI
//ToxicVolley_Timer
if (ToxicVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TOXICVOLLEY);
DoCast(me->getVictim(), SPELL_TOXICVOLLEY);
ToxicVolley_Timer = 9000;
} else ToxicVolley_Timer -= diff;
//Uppercut_Timer
if (Uppercut_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 12000;
} else Uppercut_Timer -= diff;
@@ -95,17 +95,17 @@ struct boss_noxxionAI : public ScriptedAI
if (!Invisible && Adds_Timer <= diff)
{
//Inturrupt any spell casting
//m_creature->m_canMove = true;
m_creature->InterruptNonMeleeSpells(false);
m_creature->setFaction(35);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
//me->m_canMove = true;
me->InterruptNonMeleeSpells(false);
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
// Invisible Model
m_creature->SetDisplayId(11686);
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
SummonAdds(m_creature->getVictim());
me->SetDisplayId(11686);
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
Invisible = true;
Invisible_Timer = 15000;
@@ -51,7 +51,7 @@ struct boss_ptheradrasAI : public ScriptedAI
void JustDied(Unit* Killer)
{
m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000);
me->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000);
}
void UpdateAI(const uint32 diff)
@@ -62,7 +62,7 @@ struct boss_ptheradrasAI : public ScriptedAI
//Dustfield_Timer
if (Dustfield_Timer <= diff)
{
DoCast(m_creature, SPELL_DUSTFIELD);
DoCast(me, SPELL_DUSTFIELD);
Dustfield_Timer = 14000;
} else Dustfield_Timer -= diff;
@@ -79,14 +79,14 @@ struct boss_ptheradrasAI : public ScriptedAI
//RepulsiveGaze_Timer
if (RepulsiveGaze_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REPULSIVEGAZE);
DoCast(me->getVictim(), SPELL_REPULSIVEGAZE);
RepulsiveGaze_Timer = 20000;
} else RepulsiveGaze_Timer -= diff;
//Thrash_Timer
if (Thrash_Timer <= diff)
{
DoCast(m_creature, SPELL_THRASH);
DoCast(me, SPELL_THRASH);
Thrash_Timer = 18000;
} else Thrash_Timer -= diff;
+23 -23
View File
@@ -314,8 +314,8 @@ public:
uint32 rnd = rand()%2;
switch(rnd)
{
case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, m_creature, who); break;
case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, m_creature, who); break;
case 0: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_1, me, who); break;
case 1: DoScriptText(CLINTAR_SPIRIT_SAY_UNDER_ATTACK_2, me, who); break;
}
}
@@ -341,11 +341,11 @@ public:
if (!PlayerGUID)
{
m_creature->setDeathState(JUST_DIED);
me->setDeathState(JUST_DIED);
return;
}
if (!m_creature->isInCombat() && !Event_onWait)
if (!me->isInCombat() && !Event_onWait)
{
if (checkPlayer_Timer <= diff)
{
@@ -362,7 +362,7 @@ public:
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
if (!pPlayer || (pPlayer && pPlayer->GetQuestStatus(10965) == QUEST_STATUS_NONE))
{
m_creature->setDeathState(JUST_DIED);
me->setDeathState(JUST_DIED);
return;
}
@@ -372,7 +372,7 @@ public:
switch(Step)
{
case 0:
m_creature->Say(CLINTAR_SPIRIT_SAY_START,0,PlayerGUID);
me->Say(CLINTAR_SPIRIT_SAY_START,0,PlayerGUID);
Event_Timer = 8000;
Step = 1;
break;
@@ -385,13 +385,13 @@ public:
switch(Step)
{
case 0:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000;
Step = 1;
break;
case 1:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, m_creature, pPlayer);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_ONE, me, pPlayer);
Event_onWait = false;
break;
}
@@ -400,12 +400,12 @@ public:
switch(Step)
{
case 0:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000;
Step = 1;
break;
case 1:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_onWait = false;
break;
}
@@ -414,7 +414,7 @@ public:
switch(Step)
{
case 0:
DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, m_creature, pPlayer);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_TWO, me, pPlayer);
Event_Timer = 15000;
Step = 1;
break;
@@ -428,11 +428,11 @@ public:
{
case 0:
{
Creature *mob = m_creature->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);
Creature *mob = me->SummonCreature(ASPECT_RAVEN, ASPECT_RAVEN_SUMMON_X, ASPECT_RAVEN_SUMMON_Y, ASPECT_RAVEN_SUMMON_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000);
if (mob)
{
mob->AddThreat(m_creature,10000.0f);
mob->AI()->AttackStart(m_creature);
mob->AddThreat(me,10000.0f);
mob->AI()->AttackStart(me);
}
Event_Timer = 2000;
Step = 1;
@@ -447,12 +447,12 @@ public:
switch(Step)
{
case 0:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133);
Event_Timer = 5000;
Step = 1;
break;
case 1:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_onWait = false;
break;
}
@@ -461,7 +461,7 @@ public:
switch(Step)
{
case 0:
DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, m_creature, pPlayer);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_THREE, me, pPlayer);
Event_Timer = 4000;
Step = 1;
break;
@@ -474,22 +474,22 @@ public:
switch(Step)
{
case 0:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, m_creature, pPlayer);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2);
DoScriptText(CLINTAR_SPIRIT_SAY_GET_FINAL, me, pPlayer);
pPlayer->CompleteQuest(10965);
Event_Timer = 1500;
Step = 1;
break;
case 1:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
Event_Timer = 3000;
Step = 2;
break;
case 2:
pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID());
pPlayer->TalkedToCreature(me->GetEntry(), me->GetGUID());
PlayerGUID = 0;
Reset();
m_creature->setDeathState(JUST_DIED);
me->setDeathState(JUST_DIED);
break;
}
break;
+22 -22
View File
@@ -92,27 +92,27 @@ struct npc_kyle_frenziedAI : public ScriptedAI
uiEventTimer = 5000;
uiEventPhase = 0;
if (m_creature->GetEntry() == NPC_KYLE_FRIENDLY)
m_creature->UpdateEntry(NPC_KYLE_FRENZIED);
if (me->GetEntry() == NPC_KYLE_FRIENDLY)
me->UpdateEntry(NPC_KYLE_FRENZIED);
}
void SpellHit(Unit* pCaster, SpellEntry const* pSpell)
{
if (!m_creature->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH)
if (!me->getVictim() && !bEvent && pSpell->Id == SPELL_LUNCH)
{
if (pCaster->GetTypeId() == TYPEID_PLAYER)
uiPlayerGUID = pCaster->GetGUID();
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE)
{
m_creature->GetMotionMaster()->MovementExpired();
m_creature->GetMotionMaster()->MoveIdle();
m_creature->StopMoving();
me->GetMotionMaster()->MovementExpired();
me->GetMotionMaster()->MoveIdle();
me->StopMoving();
}
bEvent = true;
DoScriptText(EMOTE_SEE_LUNCH, m_creature);
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL);
DoScriptText(EMOTE_SEE_LUNCH, me);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL);
}
}
@@ -140,34 +140,34 @@ struct npc_kyle_frenziedAI : public ScriptedAI
switch(uiEventPhase)
{
case 1:
if (Unit* pUnit = Unit::GetUnit(*m_creature,uiPlayerGUID))
if (Unit* pUnit = Unit::GetUnit(*me,uiPlayerGUID))
{
if (GameObject* pGo = pUnit->GetGameObject(SPELL_LUNCH))
{
m_bIsMovingToLunch = true;
m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
me->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ());
}
}
break;
case 2:
DoScriptText(EMOTE_EAT_LUNCH, m_creature);
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
DoScriptText(EMOTE_EAT_LUNCH, me);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING);
break;
case 3:
if (Player* pUnit = Unit::GetPlayer(uiPlayerGUID))
pUnit->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID());
pUnit->TalkedToCreature(me->GetEntry(), me->GetGUID());
m_creature->UpdateEntry(NPC_KYLE_FRIENDLY);
me->UpdateEntry(NPC_KYLE_FRIENDLY);
break;
case 4:
uiEventTimer = 30000;
DoScriptText(EMOTE_DANCE, m_creature);
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL);
DoScriptText(EMOTE_DANCE, me);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL);
break;
case 5:
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
Reset();
m_creature->GetMotionMaster()->Clear();
me->GetMotionMaster()->Clear();
break;
}
}
@@ -269,8 +269,8 @@ struct npc_plains_visionAI : public ScriptedAI
}
else
{
m_creature->setDeathState(JUST_DIED);
m_creature->RemoveCorpse();
me->setDeathState(JUST_DIED);
me->RemoveCorpse();
}
}
@@ -278,7 +278,7 @@ struct npc_plains_visionAI : public ScriptedAI
{
if (newWaypoint)
{
m_creature->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]);
me->GetMotionMaster()->MovePoint(WayPointId, wp_plain_vision[WayPointId][0], wp_plain_vision[WayPointId][1], wp_plain_vision[WayPointId][2]);
newWaypoint = false;
}
}
@@ -149,8 +149,8 @@ struct boss_onyxiaAI : public ScriptedAI
void Aggro(Unit* pWho)
{
DoScriptText(SAY_AGGRO, m_creature);
m_creature->SetInCombatWithZone();
DoScriptText(SAY_AGGRO, me);
me->SetInCombatWithZone();
}
void JustSummoned(Creature *pSummoned)
@@ -163,7 +163,7 @@ struct boss_onyxiaAI : public ScriptedAI
void KilledUnit(Unit* pVictim)
{
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void SpellHit(Unit *pCaster, const SpellEntry* pSpell)
@@ -177,8 +177,8 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_pPointData)
{
m_creature->GetMap()->CreatureRelocation(m_creature, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, 0.0f);
m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
me->GetMap()->CreatureRelocation(me, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, 0.0f);
me->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344);
}
}
@@ -218,7 +218,7 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiFlameBreathTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH);
DoCast(me->getVictim(), SPELL_FLAMEBREATH);
m_uiFlameBreathTimer = urand(10000, 20000);
}
else
@@ -226,7 +226,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiTailSweepTimer <= uiDiff)
{
DoCast(m_creature, SPELL_TAILSWEEP);
DoCast(me, SPELL_TAILSWEEP);
m_uiTailSweepTimer = urand(15000, 20000);
}
else
@@ -234,7 +234,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiCleaveTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
m_uiCleaveTimer = urand(2000, 5000);
}
else
@@ -242,7 +242,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiWingBuffetTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_WINGBUFFET);
DoCast(me->getVictim(), SPELL_WINGBUFFET);
m_uiWingBuffetTimer = urand(15000, 30000);
}
else
@@ -252,7 +252,7 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiBellowingRoarTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR);
DoCast(me->getVictim(), SPELL_BELLOWINGROAR);
m_uiBellowingRoarTimer = 30000;
}
else
@@ -260,19 +260,19 @@ struct boss_onyxiaAI : public ScriptedAI
}
else
{
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)
if (me->GetHealth()*100 / me->GetMaxHealth() < 60)
{
m_uiPhase = PHASE_BREATH;
SetCombatMovement(false);
m_creature->GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MoveIdle();
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
DoScriptText(SAY_PHASE_2_TRANS, m_creature);
DoScriptText(SAY_PHASE_2_TRANS, me);
if (m_pPointData)
m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
SetNextRandomPoint();
return;
@@ -283,13 +283,13 @@ struct boss_onyxiaAI : public ScriptedAI
}
else
{
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40)
if (me->GetHealth()*100 / me->GetMaxHealth() < 40)
{
m_uiPhase = PHASE_END;
DoScriptText(SAY_PHASE_3_TRANS, m_creature);
DoScriptText(SAY_PHASE_3_TRANS, me);
SetCombatMovement(true);
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
me->GetMotionMaster()->MoveChase(me->getVictim());
return;
}
@@ -307,15 +307,15 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiMovePoint == m_pPointData->uiLocIdEnd)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoScriptText(EMOTE_BREATH, m_creature);
DoCast(m_creature, m_pPointData->uiSpellId);
DoScriptText(EMOTE_BREATH, me);
DoCast(me, m_pPointData->uiSpellId);
}
else
{
m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
}
}
else
@@ -323,7 +323,7 @@ struct boss_onyxiaAI : public ScriptedAI
if (m_uiEngulfingFlamesTimer <= uiDiff)
{
if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_FIREBALL);
@@ -340,8 +340,8 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiWhelpTimer <= uiDiff)
{
m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
me->SummonCreature(NPC_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
me->SummonCreature(NPC_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_uiWhelpTimer = 1000;
}
else
@@ -365,8 +365,8 @@ struct boss_onyxiaAI : public ScriptedAI
{
if (m_uiLairGuardTimer <= uiDiff)
{
m_creature->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_creature->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
me->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
me->SummonCreature(NPC_LAIRGUARD, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000);
m_uiLairGuardTimer = 30000;
}
else
+3 -3
View File
@@ -114,7 +114,7 @@ struct npc_shenthulAI : public ScriptedAI
{
if (Salute_Timer <= diff)
{
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
CanEmote = true;
Reset_Timer = 60000;
} else Salute_Timer -= diff;
@@ -194,13 +194,13 @@ struct npc_thrall_warchiefAI : public ScriptedAI
if (ChainLightning_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING);
DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING);
ChainLightning_Timer = 9000;
} else ChainLightning_Timer -= diff;
if (Shock_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHOCK);
DoCast(me->getVictim(), SPELL_SHOCK);
Shock_Timer = 15000;
} else Shock_Timer -= diff;
@@ -57,12 +57,12 @@ struct boss_amnennar_the_coldbringerAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(SAY_AGGRO, m_creature);
DoScriptText(SAY_AGGRO, me);
}
void KilledUnit()
{
DoScriptText(SAY_KILL, m_creature);
DoScriptText(SAY_KILL, me);
}
void UpdateAI(const uint32 diff)
@@ -73,40 +73,40 @@ struct boss_amnennar_the_coldbringerAI : public ScriptedAI
//AmnenarsWrath_Timer
if (AmnenarsWrath_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_AMNENNARSWRATH);
DoCast(me->getVictim(), SPELL_AMNENNARSWRATH);
AmnenarsWrath_Timer = 12000;
} else AmnenarsWrath_Timer -= diff;
//FrostBolt_Timer
if (FrostBolt_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROSTBOLT);
DoCast(me->getVictim(), SPELL_FROSTBOLT);
FrostBolt_Timer = 8000;
} else FrostBolt_Timer -= diff;
if (FrostNova_Timer <= diff)
{
DoCast(m_creature, SPELL_FROST_NOVA);
DoCast(me, SPELL_FROST_NOVA);
FrostNova_Timer = 15000;
} else FrostNova_Timer -= diff;
if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60)
if (!Spectrals60 && me->GetHealth()*100 / me->GetMaxHealth() < 60)
{
DoScriptText(SAY_SUMMON60, m_creature);
DoCast(m_creature->getVictim(), SPELL_FROST_SPECTRES);
DoScriptText(SAY_SUMMON60, me);
DoCast(me->getVictim(), SPELL_FROST_SPECTRES);
Spectrals60 = true;
}
if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50)
if (!Hp && me->GetHealth()*100 / me->GetMaxHealth() < 50)
{
DoScriptText(SAY_HP, m_creature);
DoScriptText(SAY_HP, me);
Hp = true;
}
if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30)
if (!Spectrals30 && me->GetHealth()*100 / me->GetMaxHealth() < 30)
{
DoScriptText(SAY_SUMMON30, m_creature);
DoCast(m_creature->getVictim(), SPELL_FROST_SPECTRES);
DoScriptText(SAY_SUMMON30, me);
DoCast(me->getVictim(), SPELL_FROST_SPECTRES);
Spectrals30 = true;
}
@@ -119,11 +119,11 @@ struct npc_tomb_creatureAI : public ScriptedAI
return;
//from acid
if (m_creature->GetEntry() == CREATURE_TOMB_REAVER)
if (me->GetEntry() == CREATURE_TOMB_REAVER)
{
if (uiWebTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_WEB);
DoCast(me->getVictim(), SPELL_WEB);
uiWebTimer = urand(7000,16000);
} else uiWebTimer -= uiDiff;
}
@@ -59,43 +59,43 @@ struct npc_willixAI : public npc_escortAI
switch (i)
{
case 3:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
DoScriptText(SAY_POINT, m_creature, pPlayer);
me->HandleEmoteCommand(EMOTE_STATE_POINT);
DoScriptText(SAY_POINT, me, pPlayer);
break;
case 4:
m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 8:
DoScriptText(SAY_BLUELEAF, m_creature, pPlayer);
DoScriptText(SAY_BLUELEAF, me, pPlayer);
break;
case 9:
DoScriptText(SAY_DANGER, m_creature, pPlayer);
DoScriptText(SAY_DANGER, me, pPlayer);
break;
case 13:
DoScriptText(SAY_BAD, m_creature, pPlayer);
DoScriptText(SAY_BAD, me, pPlayer);
break;
case 14:
m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 25:
DoScriptText(SAY_THINK, m_creature, pPlayer);
DoScriptText(SAY_THINK, me, pPlayer);
break;
case 31:
DoScriptText(SAY_SOON, m_creature, pPlayer);
DoScriptText(SAY_SOON, me, pPlayer);
break;
case 42:
DoScriptText(SAY_FINALY, m_creature, pPlayer);
DoScriptText(SAY_FINALY, me, pPlayer);
break;
case 43:
m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 45:
DoScriptText(SAY_WIN, m_creature, pPlayer);
DoScriptText(SAY_WIN, me, pPlayer);
if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature);
CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,me);
break;
case 46:
DoScriptText(SAY_END, m_creature, pPlayer);
DoScriptText(SAY_END, me, pPlayer);
break;
}
}
@@ -104,12 +104,12 @@ struct npc_willixAI : public npc_escortAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO1, m_creature, NULL);
DoScriptText(SAY_AGGRO1, me, NULL);
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -148,7 +148,7 @@ struct npc_deaths_head_ward_keeperAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if (!m_creature->isAlive())
if (!me->isAlive())
return;
if (pInstance)
@@ -156,9 +156,9 @@ struct npc_deaths_head_ward_keeperAI : public ScriptedAI
if (QuillboarChanneling_Timer <= diff)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(true);
DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(true);
DoCast(me, SPELL_QUILLBOAR_CHANNELING);
QuillboarChanneling_Timer = 1100;
} else QuillboarChanneling_Timer -= diff;
@@ -80,7 +80,7 @@ struct boss_ayamissAI : public ScriptedAI
return;
//If he is 70% start phase 2
if (phase == 1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false))
if (phase == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 70 && !me->IsNonMeleeSpellCasted(false))
{
phase=2;
}
@@ -88,21 +88,21 @@ struct boss_ayamissAI : public ScriptedAI
//STINGERSPRAY_Timer (only in phase2)
if (phase == 2 && STINGERSPRAY_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_STINGERSPRAY);
DoCast(me->getVictim(), SPELL_STINGERSPRAY);
STINGERSPRAY_Timer = 30000;
} else STINGERSPRAY_Timer -= diff;
//POISONSTINGER_Timer (only in phase1)
if (phase == 1 && POISONSTINGER_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_POISONSTINGER);
DoCast(me->getVictim(), SPELL_POISONSTINGER);
POISONSTINGER_Timer = 30000;
} else POISONSTINGER_Timer -= diff;
//SUMMONSWARMER_Timer (only in phase1)
if (SUMMONSWARMER_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SUMMONSWARMER);
DoCast(me->getVictim(), SPELL_SUMMONSWARMER);
SUMMONSWARMER_Timer = 60000;
} else SUMMONSWARMER_Timer -= diff;
@@ -81,16 +81,16 @@ struct boss_kurinnaxxAI : public ScriptedAI
return;
//If we are <30% cast enrage
if (!bIsEnraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false))
if (!bIsEnraged && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false))
{
bIsEnraged = true;
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
}
//Mortal Wound spell
if (uiMortalWoundTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTALWOUND);
DoCast(me->getVictim(), SPELL_MORTALWOUND);
uiMortalWoundTimer = urand(2000,7000);
} else uiMortalWoundTimer -= diff;
@@ -105,14 +105,14 @@ struct boss_kurinnaxxAI : public ScriptedAI
//Wide Slash spell
if (uiWideSlashTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_WIDE_SLASH);
DoCast(me->getVictim(), SPELL_WIDE_SLASH);
uiWideSlashTimer = urand(10000,15000);
} else uiWideSlashTimer -= diff;
//Trash spell
if (uiTrashTimer <= diff)
{
DoCast(m_creature, SPELL_TRASH);
DoCast(me, SPELL_TRASH);
uiTrashTimer = urand(20000,25000);
} else uiTrashTimer -= diff;
@@ -70,7 +70,7 @@ struct boss_moamAI : public ScriptedAI
uiDrainManaTimer = urand(3000,7000);
uiPhaseTimer = 90000;
Phase = NORMAL;
m_creature->SetPower(POWER_MANA,0);
me->SetPower(POWER_MANA,0);
if (pInstance)
pInstance->SetData(DATA_MOAM_EVENT, NOT_STARTED);
@@ -78,7 +78,7 @@ struct boss_moamAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoScriptText(EMOTE_AGGRO, m_creature);
DoScriptText(EMOTE_AGGRO, me);
if (pInstance)
pInstance->SetData(DATA_MOAM_EVENT, IN_PROGRESS);
@@ -97,7 +97,7 @@ struct boss_moamAI : public ScriptedAI
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
{
pTarget->ModifyPower(POWER_MANA, -500);
m_creature->ModifyPower(POWER_MANA, 1000);
me->ModifyPower(POWER_MANA, 1000);
}
}
}
@@ -110,17 +110,17 @@ struct boss_moamAI : public ScriptedAI
return;
//If we are 100%MANA cast Arcane Erruption
if (m_creature->GetPower(POWER_MANA) == m_creature->GetMaxPower(POWER_MANA))
if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
{
DoCast(m_creature->getVictim(), SPELL_ARCANEERUPTION);
DoScriptText(EMOTE_MANA_FULL, m_creature);
m_creature->SetPower(POWER_MANA,0);
DoCast(me->getVictim(), SPELL_ARCANEERUPTION);
DoScriptText(EMOTE_MANA_FULL, me);
me->SetPower(POWER_MANA,0);
}
//Trample Spell
if (uiTrampleTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TRAMPLE);
DoCast(me->getVictim(), SPELL_TRAMPLE);
uiTrampleTimer = urand(3000,7000);
} else uiTrampleTimer -= diff;
@@ -137,10 +137,10 @@ struct boss_moamAI : public ScriptedAI
if (uiPhaseTimer <= diff)
{
Phase = STONE;
DoCast(m_creature, SPELL_SUMMONMANA);
DoCast(m_creature, SPELL_SUMMONMANA);
DoCast(m_creature, SPELL_SUMMONMANA);
DoCast(m_creature, SPELL_GRDRSLEEP);
DoCast(me, SPELL_SUMMONMANA);
DoCast(me, SPELL_SUMMONMANA);
DoCast(me, SPELL_SUMMONMANA);
DoCast(me, SPELL_GRDRSLEEP);
} else uiPhaseTimer -= diff;
}
}
+80 -80
View File
@@ -493,7 +493,7 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
PlayerGUID = 0;
eventEnd = false;
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
void HandleAnimation()
@@ -502,10 +502,10 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
if (!plr)
return;
Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, m_creature);
Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100,m_creature);
Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, m_creature);
Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,m_creature);
Unit* Fandral = plr->FindNearestCreature(C_FANDRAL_STAGHELM, 100, me);
Unit* Arygos = plr->FindNearestCreature(C_ARYGOS, 100,me);
Unit* Caelestrasz = plr->FindNearestCreature(C_CAELESTRASZ, 100, me);
Unit* Merithra = plr->FindNearestCreature(C_MERITHRA, 100,me);
if (!Fandral || !Arygos || !Caelestrasz || !Merithra)
return;
@@ -517,11 +517,11 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
switch(AnimationCount)
{
case 0:
DoScriptText(ANACHRONOS_SAY_1, m_creature , Fandral);
DoScriptText(ANACHRONOS_SAY_1, me , Fandral);
break;
case 1:
Fandral->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID());
DoScriptText(FANDRAL_SAY_1, Fandral,m_creature);
Fandral->SetUInt64Value(UNIT_FIELD_TARGET, me->GetGUID());
DoScriptText(FANDRAL_SAY_1, Fandral,me);
break;
case 2:
Fandral->SetUInt64Value(UNIT_FIELD_TARGET,NULL);
@@ -611,143 +611,143 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
Caelestrasz->CastSpell(Caelestrasz,54293,false);
break;
case 28:
DoScriptText(ANACHRONOS_SAY_2,m_creature, Fandral);
DoScriptText(ANACHRONOS_SAY_2,me, Fandral);
break;
case 29:
Caelestrasz->GetMotionMaster()->MoveCharge(-8150,1530,50,7);
DoScriptText(FANDRAL_SAY_2, Fandral, m_creature);
DoScriptText(FANDRAL_SAY_2, Fandral, me);
break;
case 30:
break;
case 31:
DoScriptText(ANACHRONOS_SAY_3, m_creature, Fandral);
DoScriptText(ANACHRONOS_SAY_3, me, Fandral);
break;
case 32:
Caelestrasz->SetVisibility(VISIBILITY_OFF);
Fandral->GetMotionMaster()->MoveCharge(-8108,1529,2.77,8);
m_creature->GetMotionMaster()->MoveCharge(-8113,1525,2.77,8);
me->GetMotionMaster()->MoveCharge(-8113,1525,2.77,8);
break;//both run to the gate
case 33:
DoScriptText(ANACHRONOS_SAY_4, m_creature);
DoScriptText(ANACHRONOS_SAY_4, me);
Caelestrasz->GetMotionMaster()->MoveCharge(-8165,1530,65,7);
break; //Text: sands will stop
case 34:
DoCast(plr, 23017, true);//Arcane Channeling
break;
case 35:
m_creature->CastSpell(-8088,1520.43,2.67,25158,true);
me->CastSpell(-8088,1520.43,2.67,25158,true);
break;
case 36:
DoCast(plr, 25159, true);
break;
case 37:
m_creature->SummonGameObject(GO_GATE_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
break;
case 38:
DoCast(plr, 25166, true);
m_creature->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
break;
case 39:
DoScriptText(ANACHRONOS_SAY_5, m_creature, Fandral);
DoScriptText(ANACHRONOS_SAY_5, me, Fandral);
break;
case 40:
Fandral->CastSpell(m_creature, 25167, true);
Fandral->CastSpell(me, 25167, true);
break;
case 41:
Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ,-8130,1525,17.5,0,0,0,0,0,0);
DoScriptText(FANDRAL_SAY_3, Fandral);
break;
case 42:
m_creature->CastStop();
me->CastStop();
DoScriptText(FANDRAL_EMOTE_1, Fandral);
break;
case 43:
Fandral->CastStop();
break;
case 44:
DoScriptText(ANACHRONOS_SAY_6, m_creature);
DoScriptText(ANACHRONOS_SAY_6, me);
break;
case 45:
DoScriptText(ANACHRONOS_SAY_7, m_creature);
DoScriptText(ANACHRONOS_SAY_7, me);
break;
case 46:
DoScriptText(ANACHRONOS_SAY_8, m_creature);
m_creature->GetMotionMaster()->MoveCharge(-8110,1527,2.77,4);
DoScriptText(ANACHRONOS_SAY_8, me);
me->GetMotionMaster()->MoveCharge(-8110,1527,2.77,4);
break;
case 47:
DoScriptText(ANACHRONOS_EMOTE_1, m_creature);
DoScriptText(ANACHRONOS_EMOTE_1, me);
break;
case 48:
DoScriptText(FANDRAL_SAY_4,Fandral,m_creature);
DoScriptText(FANDRAL_SAY_4,Fandral,me);
break;
case 49:
DoScriptText(FANDRAL_SAY_5,Fandral,m_creature);
DoScriptText(FANDRAL_SAY_5,Fandral,me);
break;
case 50:
DoScriptText(FANDRAL_EMOTE_2,Fandral);
Fandral->CastSpell(-8127,1525,17.5,33806,true);
break;
case 51:
while (mob = plr->FindNearestCreature(15423,50,m_creature))
while (mob = plr->FindNearestCreature(15423,50,me))
mob->RemoveFromWorld();
while (mob = plr->FindNearestCreature(15424,50,m_creature))
while (mob = plr->FindNearestCreature(15424,50,me))
mob->RemoveFromWorld();
while (mob = plr->FindNearestCreature(15414,50,m_creature))
while (mob = plr->FindNearestCreature(15414,50,me))
mob->RemoveFromWorld();
while (mob = plr->FindNearestCreature(15422,50,m_creature))
while (mob = plr->FindNearestCreature(15422,50,me))
mob->RemoveFromWorld();
break;
case 52:
Fandral->GetMotionMaster()->MoveCharge(-8028.75, 1538.795, 2.61,4);
DoScriptText(ANACHRONOS_SAY_9, m_creature,Fandral);
DoScriptText(ANACHRONOS_SAY_9, me,Fandral);
break;
case 53:
DoScriptText(FANDRAL_SAY_6,Fandral);
break;
case 54:
DoScriptText(ANACHRONOS_EMOTE_2,m_creature);
DoScriptText(ANACHRONOS_EMOTE_2,me);
break;
case 55:
Fandral->SetVisibility(VISIBILITY_OFF);
break;
case 56:
DoScriptText(ANACHRONOS_EMOTE_3, m_creature);
m_creature->GetMotionMaster()->MoveCharge(-8116,1522,3.65,4);
DoScriptText(ANACHRONOS_EMOTE_3, me);
me->GetMotionMaster()->MoveCharge(-8116,1522,3.65,4);
break;
case 57:
m_creature->GetMotionMaster()->MoveCharge(-8116.7,1527,3.7,4);
me->GetMotionMaster()->MoveCharge(-8116.7,1527,3.7,4);
break;
case 58:
m_creature->GetMotionMaster()->MoveCharge(-8112.67,1529.9,2.86,4);
me->GetMotionMaster()->MoveCharge(-8112.67,1529.9,2.86,4);
break;
case 59:
m_creature->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4);
me->GetMotionMaster()->MoveCharge(-8117.99,1532.24,3.94,4);
break;
case 60:
if (plr)
DoScriptText(ANACHRONOS_SAY_10, m_creature,plr);
m_creature->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4);
DoScriptText(ANACHRONOS_SAY_10, me,plr);
me->GetMotionMaster()->MoveCharge(-8113.46,1524.16,2.89,4);
break;
case 61:
m_creature->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6);
if (plr->IsInRange(m_creature,0,15))
plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,m_creature);
me->GetMotionMaster()->MoveCharge(-8057.1,1470.32,2.61,6);
if (plr->IsInRange(me,0,15))
plr->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD ,me);
break;
case 62:
m_creature->SetDisplayId(15500);
me->SetDisplayId(15500);
break;
case 63:
m_creature->HandleEmoteCommand(254);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
me->HandleEmoteCommand(254);
me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
break;
case 64:
m_creature->GetMotionMaster()->MoveCharge(-8000,1400,150,9);
me->GetMotionMaster()->MoveCharge(-8000,1400,150,9);
break;
case 65:
m_creature->SetVisibility(VISIBILITY_OFF);
if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*m_creature, AnachronosQuestTriggerGUID)))
me->SetVisibility(VISIBILITY_OFF);
if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID)))
{
DoScriptText(ARYGOS_YELL_1,m_creature);
DoScriptText(ARYGOS_YELL_1,me);
AnachronosQuestTrigger->AI()->EnterEvadeMode();
eventEnd=true;
}
@@ -765,9 +765,9 @@ struct npc_anachronos_the_ancientAI : public ScriptedAI
else AnimationTimer -= diff;
}
if (AnimationCount < 65)
m_creature->CombatStop();
me->CombatStop();
if (AnimationCount == 65 || eventEnd)
m_creature->AI()->EnterEvadeMode();
me->AI()->EnterEvadeMode();
}
};
@@ -799,70 +799,70 @@ struct mob_qiraj_war_spawnAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
Unit *pTarget;
Player* plr = m_creature->GetPlayer(PlayerGUID);
Player* plr = me->GetPlayer(PlayerGUID);
if (!Timers)
{
if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414) //all but Kaldorei Soldiers
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) //all but Kaldorei Soldiers
{
SpellTimer1 = SpawnCast[1].Timer1;
SpellTimer2 = SpawnCast[2].Timer1;
SpellTimer3 = SpawnCast[3].Timer1;
}
if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
SpellTimer4 = SpawnCast[0].Timer1;
Timers = true;
}
if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422|| m_creature->GetEntry() == 15414)
if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414)
{
if (SpellTimer1 <= diff)
{
DoCast(m_creature, SpawnCast[1].SpellId);
DoCast(m_creature, 24319);
DoCast(me, SpawnCast[1].SpellId);
DoCast(me, 24319);
SpellTimer1 = SpawnCast[1].Timer2;
} else SpellTimer1 -= diff;
if (SpellTimer2 <= diff)
{
DoCast(m_creature, SpawnCast[2].SpellId);
DoCast(me, SpawnCast[2].SpellId);
SpellTimer2 = SpawnCast[2].Timer2;
} else SpellTimer2 -= diff;
if (SpellTimer3 <= diff)
{
DoCast(m_creature, SpawnCast[3].SpellId);
DoCast(me, SpawnCast[3].SpellId);
SpellTimer3 = SpawnCast[3].Timer2;
} else SpellTimer3 -= diff;
}
if (m_creature->GetEntry() == 15423 || m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
{
if (SpellTimer4 <= diff)
{
m_creature->RemoveAllAttackers();
m_creature->AttackStop();
DoCast(m_creature, 15533);
me->RemoveAllAttackers();
me->AttackStop();
DoCast(me, 15533);
SpellTimer4 = SpawnCast[0].Timer2;
} else SpellTimer4 -= diff;
}
if (!hasTarget)
{
if (m_creature->GetEntry() == 15424 || m_creature->GetEntry() == 15422 || m_creature->GetEntry() == 15414)
pTarget = m_creature->FindNearestCreature(15423,20,true);
if (m_creature->GetEntry() == 15423)
if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414)
pTarget = me->FindNearestCreature(15423,20,true);
if (me->GetEntry() == 15423)
{
uint8 tar = urand(0,2);
if (tar == 0)
pTarget = m_creature->FindNearestCreature(15422,20,true);
pTarget = me->FindNearestCreature(15422,20,true);
else if (tar == 1)
pTarget = m_creature->FindNearestCreature(15424,20,true);
pTarget = me->FindNearestCreature(15424,20,true);
else if (tar == 2)
pTarget = m_creature->FindNearestCreature(15414,20,true);
pTarget = me->FindNearestCreature(15414,20,true);
}
hasTarget = true;
if (pTarget)
m_creature->AI()->AttackStart(pTarget);
me->AI()->AttackStart(pTarget);
}
if (!(m_creature->FindNearestCreature(15379,100)))
DoCast(m_creature, 33652);
if (!(me->FindNearestCreature(15379,100)))
DoCast(me, 33652);
if (!UpdateVictim())
{
@@ -907,7 +907,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
Announced = false;
Failed = false;
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
}
void SummonNextWave()
@@ -926,7 +926,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
float Z = SpawnLocation[locIndex + i].z;
float O = SpawnLocation[locIndex + i].o;
uint32 desptimer = WavesInfo[WaveCount].DespTimer;
Spawn = m_creature->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer);
Spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer);
if (Spawn)
{
@@ -940,7 +940,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
if (WaveCount < 5) //1-4 Wave
{
CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->MobGUID = m_creature->GetGUID();
CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->MobGUID = me->GetGUID();
CAST_AI(mob_qiraj_war_spawnAI, Spawn->AI())->PlayerGUID = PlayerGUID;
}
}
@@ -971,7 +971,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
GroupMember = (Unit::GetPlayer(itr->guid));
if (!GroupMember)
continue;
if (!GroupMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
if (!GroupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && GroupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE)
{
GroupMember->FailQuest(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD);
GroupMember->SetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, QUEST_STATUS_NONE);
@@ -983,7 +983,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
++DeadMemberCount;
}
if (GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS))
if (GroupMemberCount == FailedMemberCount || !pPlayer->IsWithinDistInMap(me, EVENT_AREA_RADIUS))
Failed = true; //only so event can restart
}
}
@@ -1004,7 +1004,7 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
{
if (!Announced && AnnounceTimer <= diff)
{
DoScriptText(WavesInfo[WaveCount].WaveTextId, m_creature);
DoScriptText(WavesInfo[WaveCount].WaveTextId, me);
Announced = true;
} else AnnounceTimer -= diff;
@@ -1019,8 +1019,8 @@ struct npc_anachronos_quest_triggerAI : public ScriptedAI
};
void mob_qiraj_war_spawnAI::JustDied(Unit* slayer)
{
m_creature->RemoveCorpse();
if (Creature* Mob = (Unit::GetCreature(*m_creature, MobGUID)))
me->RemoveCorpse();
if (Creature* Mob = (Unit::GetCreature(*me, MobGUID)))
CAST_AI(npc_anachronos_quest_triggerAI, Mob->AI())->LiveCounter();
};
@@ -109,22 +109,22 @@ struct npc_kaya_flathoofAI : public npc_escortAI
switch(i)
{
case 16:
DoScriptText(SAY_AMBUSH, m_creature);
m_creature->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
m_creature->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
m_creature->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
DoScriptText(SAY_AMBUSH, me);
me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53, -503.34, -46.31, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85, -503.77, -45.90, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37, -496.23, -45.71, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 18: m_creature->SetInFront(pPlayer);
DoScriptText(SAY_END, m_creature, pPlayer);
case 18: me->SetInFront(pPlayer);
DoScriptText(SAY_END, me, pPlayer);
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature);
pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, me);
break;
}
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void Reset(){}
+47 -47
View File
@@ -59,7 +59,7 @@ struct mob_aquementasAI : public ScriptedAI
{
SendItem_Timer = 0;
SwitchFaction_Timer = 10000;
m_creature->setFaction(35);
me->setFaction(35);
isFriendly = true;
AquaJet_Timer = 5000;
@@ -82,7 +82,7 @@ struct mob_aquementasAI : public ScriptedAI
void EnterCombat(Unit* who)
{
DoScriptText(AGGRO_YELL_AQUE, m_creature, who);
DoScriptText(AGGRO_YELL_AQUE, me, who);
}
void UpdateAI(const uint32 diff)
@@ -91,7 +91,7 @@ struct mob_aquementasAI : public ScriptedAI
{
if (SwitchFaction_Timer <= diff)
{
m_creature->setFaction(91);
me->setFaction(91);
isFriendly = false;
} else SwitchFaction_Timer -= diff;
}
@@ -103,21 +103,21 @@ struct mob_aquementasAI : public ScriptedAI
{
if (SendItem_Timer <= diff)
{
if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)
SendItem(m_creature->getVictim());
if (me->getVictim()->GetTypeId() == TYPEID_PLAYER)
SendItem(me->getVictim());
SendItem_Timer = 5000;
} else SendItem_Timer -= diff;
}
if (FrostShock_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK);
DoCast(me->getVictim(), SPELL_FROST_SHOCK);
FrostShock_Timer = 15000;
} else FrostShock_Timer -= diff;
if (AquaJet_Timer <= diff)
{
DoCast(m_creature, SPELL_AQUA_JET);
DoCast(me, SPELL_AQUA_JET);
AquaJet_Timer = 15000;
} else AquaJet_Timer -= diff;
@@ -160,25 +160,25 @@ struct npc_custodian_of_timeAI : public npc_escortAI
switch(i)
{
case 0: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pPlayer); break;
case 1: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pPlayer); break;
case 2: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pPlayer); break;
case 3: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
case 5: DoScriptText(WHISPER_CUSTODIAN_5, m_creature, pPlayer); break;
case 6: DoScriptText(WHISPER_CUSTODIAN_6, m_creature, pPlayer); break;
case 7: DoScriptText(WHISPER_CUSTODIAN_7, m_creature, pPlayer); break;
case 8: DoScriptText(WHISPER_CUSTODIAN_8, m_creature, pPlayer); break;
case 9: DoScriptText(WHISPER_CUSTODIAN_9, m_creature, pPlayer); break;
case 10: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
case 13: DoScriptText(WHISPER_CUSTODIAN_10, m_creature, pPlayer); break;
case 14: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
case 16: DoScriptText(WHISPER_CUSTODIAN_11, m_creature, pPlayer); break;
case 17: DoScriptText(WHISPER_CUSTODIAN_12, m_creature, pPlayer); break;
case 18: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
case 22: DoScriptText(WHISPER_CUSTODIAN_13, m_creature, pPlayer); break;
case 23: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break;
case 0: DoScriptText(WHISPER_CUSTODIAN_1, me, pPlayer); break;
case 1: DoScriptText(WHISPER_CUSTODIAN_2, me, pPlayer); break;
case 2: DoScriptText(WHISPER_CUSTODIAN_3, me, pPlayer); break;
case 3: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
case 5: DoScriptText(WHISPER_CUSTODIAN_5, me, pPlayer); break;
case 6: DoScriptText(WHISPER_CUSTODIAN_6, me, pPlayer); break;
case 7: DoScriptText(WHISPER_CUSTODIAN_7, me, pPlayer); break;
case 8: DoScriptText(WHISPER_CUSTODIAN_8, me, pPlayer); break;
case 9: DoScriptText(WHISPER_CUSTODIAN_9, me, pPlayer); break;
case 10: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
case 13: DoScriptText(WHISPER_CUSTODIAN_10, me, pPlayer); break;
case 14: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
case 16: DoScriptText(WHISPER_CUSTODIAN_11, me, pPlayer); break;
case 17: DoScriptText(WHISPER_CUSTODIAN_12, me, pPlayer); break;
case 18: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
case 22: DoScriptText(WHISPER_CUSTODIAN_13, me, pPlayer); break;
case 23: DoScriptText(WHISPER_CUSTODIAN_4, me, pPlayer); break;
case 24:
DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pPlayer);
DoScriptText(WHISPER_CUSTODIAN_14, me, pPlayer);
DoCast(pPlayer, 34883);
// below here is temporary workaround, to be removed when spell works properly
pPlayer->AreaExploredOrEventHappens(10277);
@@ -196,7 +196,7 @@ struct npc_custodian_of_timeAI : public npc_escortAI
if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE)
{
float Radius = 10.0;
if (m_creature->IsWithinDistInMap(who, Radius))
if (me->IsWithinDistInMap(who, Radius))
{
Start(false, false, who->GetGUID());
}
@@ -370,17 +370,17 @@ struct npc_OOX17AI : public npc_escortAI
switch(i) {
case 23:
m_creature->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_creature->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_creature->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_OOX_AMBUSH, m_creature);
me->SummonCreature(SPAWN_FIRST, -8350.96, -4445.79, 10.10, 6.20, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, -8355.96, -4447.79, 10.10, 6.27, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, -8353.96, -4442.79, 10.10, 6.08, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_OOX_AMBUSH, me);
break;
case 56:
m_creature->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_creature->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
m_creature->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_OOX_AMBUSH, m_creature);
me->SummonCreature(SPAWN_SECOND_1, -7510.07, -4795.50, 9.35, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_SECOND_2, -7515.07, -4797.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_SECOND_2, -7518.07, -4792.50, 9.35, 6.22, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_OOX_AMBUSH, me);
if (Unit* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30))
DoScriptText(SAY_OOX17_AMBUSH_REPLY, scoff);
break;
@@ -388,8 +388,8 @@ struct npc_OOX17AI : public npc_escortAI
case 86:
if (pPlayer)
{
DoScriptText(SAY_OOX_END, m_creature);
pPlayer->GroupEventHappens(Q_OOX17, m_creature);
DoScriptText(SAY_OOX_END, me);
pPlayer->GroupEventHappens(Q_OOX17, me);
}
break;
}
@@ -399,12 +399,12 @@ struct npc_OOX17AI : public npc_escortAI
void EnterCombat(Unit* who)
{
DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), m_creature);
DoScriptText(RAND(SAY_OOX_AGGRO1,SAY_OOX_AGGRO2), me);
}
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
};
@@ -476,14 +476,14 @@ struct npc_toogaAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && pWho->GetEntry() == NPC_TORTA)
if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && pWho->GetEntry() == NPC_TORTA)
{
if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
{
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE)
pPlayer->GroupEventHappens(QUEST_TOOGA, m_creature);
pPlayer->GroupEventHappens(QUEST_TOOGA, me);
}
TortaGUID = pWho->GetGUID();
@@ -514,7 +514,7 @@ struct npc_toogaAI : public FollowerAI
{
m_uiPostEventTimer = 5000;
Unit *pTorta = Unit::GetUnit(*m_creature, TortaGUID);
Unit *pTorta = Unit::GetUnit(*me, TortaGUID);
if (!pTorta || !pTorta->isAlive())
{
//something happened, so just complete
@@ -525,23 +525,23 @@ struct npc_toogaAI : public FollowerAI
switch(m_uiPhasePostEvent)
{
case 1:
DoScriptText(SAY_TOOG_POST_1, m_creature);
DoScriptText(SAY_TOOG_POST_1, me);
break;
case 2:
DoScriptText(SAY_TORT_POST_2, pTorta);
break;
case 3:
DoScriptText(SAY_TOOG_POST_3, m_creature);
DoScriptText(SAY_TOOG_POST_3, me);
break;
case 4:
DoScriptText(SAY_TORT_POST_4, pTorta);
break;
case 5:
DoScriptText(SAY_TOOG_POST_5, m_creature);
DoScriptText(SAY_TOOG_POST_5, me);
break;
case 6:
DoScriptText(SAY_TORT_POST_6, pTorta);
m_creature->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]);
me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]);
break;
}
@@ -558,7 +558,7 @@ struct npc_toogaAI : public FollowerAI
m_uiCheckSpeechTimer = 5000;
if (urand(0,9) > 8)
DoScriptText(RAND(SAY_TOOG_THIRST,SAY_TOOG_WORRIED), m_creature);
DoScriptText(RAND(SAY_TOOG_THIRST,SAY_TOOG_WORRIED), me);
}
else
m_uiCheckSpeechTimer -= uiDiff;
+4 -4
View File
@@ -51,9 +51,9 @@ struct npc_mistAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_ARYNIA)
if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_ARYNIA)
{
if (m_creature->IsWithinDistInMap(pWho, 10.0f))
if (me->IsWithinDistInMap(pWho, 10.0f))
{
DoScriptText(SAY_AT_HOME, pWho);
DoComplete();
@@ -63,12 +63,12 @@ struct npc_mistAI : public FollowerAI
void DoComplete()
{
DoScriptText(EMOTE_AT_HOME, m_creature);
DoScriptText(EMOTE_AT_HOME, me);
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE)
pPlayer->GroupEventHappens(QUEST_MIST, m_creature);
pPlayer->GroupEventHappens(QUEST_MIST, me);
}
//The follow is over (and for later development, run off to the woods before really end)
@@ -71,7 +71,7 @@ struct boss_kriAI : public ScriptedAI
{
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
// Unlootable if death
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
@@ -85,20 +85,20 @@ struct boss_kriAI : public ScriptedAI
//Cleave_Timer
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 5000 + rand()%7000;
} else Cleave_Timer -= diff;
//ToxicVolley_Timer
if (ToxicVolley_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_TOXIC_VOLLEY);
DoCast(me->getVictim(), SPELL_TOXIC_VOLLEY);
ToxicVolley_Timer = 10000 + rand()%5000;
} else ToxicVolley_Timer -= diff;
if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death)
if (me->GetHealth() <= me->GetMaxHealth() * 0.05 && !Death)
{
DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD);
DoCast(me->getVictim(), SPELL_POISON_CLOUD);
Death = true;
}
@@ -109,7 +109,7 @@ struct boss_kriAI : public ScriptedAI
{
if (pInstance && pInstance->GetData(DATA_VEMISDEAD))
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
VemDead = true;
}
Check_Timer = 2000;
@@ -151,7 +151,7 @@ struct boss_vemAI : public ScriptedAI
pInstance->SetData(DATA_VEM_DEATH, 0);
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
// Unlootable if death
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
}
@@ -174,7 +174,7 @@ struct boss_vemAI : public ScriptedAI
if (pTarget)
{
DoCast(pTarget, SPELL_CHARGE);
//m_creature->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
//me->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, true,1);
AttackStart(pTarget);
}
@@ -184,16 +184,16 @@ struct boss_vemAI : public ScriptedAI
//KnockBack_Timer
if (KnockBack_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_KNOCKBACK);
if (DoGetThreat(m_creature->getVictim()))
DoModifyThreatPercent(m_creature->getVictim(),-80);
DoCast(me->getVictim(), SPELL_KNOCKBACK);
if (DoGetThreat(me->getVictim()))
DoModifyThreatPercent(me->getVictim(),-80);
KnockBack_Timer = 15000 + rand()%10000;
} else KnockBack_Timer -= diff;
//Enrage_Timer
if (!Enraged && Enrage_Timer <= diff)
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
Enraged = true;
} else Charge_Timer -= diff;
@@ -231,14 +231,14 @@ struct boss_yaujAI : public ScriptedAI
{
if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2)
// Unlootable if death
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pInstance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
for (uint8 i = 0; i < 10; ++i)
{
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
Creature* Summoned = me->SummonCreature(15621,me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000);
if (Summoned && pTarget)
Summoned->AI()->AttackStart(pTarget);
}
@@ -257,7 +257,7 @@ struct boss_yaujAI : public ScriptedAI
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_FEAR);
DoCast(me->getVictim(), SPELL_FEAR);
DoResetThreat();
Fear_Timer = 20000;
} else Fear_Timer -= diff;
@@ -267,8 +267,8 @@ struct boss_yaujAI : public ScriptedAI
{
if (pInstance)
{
Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI));
Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM));
Unit *pKri = Unit::GetUnit((*me), pInstance->GetData64(DATA_KRI));
Unit *pVem = Unit::GetUnit((*me), pInstance->GetData64(DATA_VEM));
switch (urand(0,2))
{
@@ -281,7 +281,7 @@ struct boss_yaujAI : public ScriptedAI
DoCast(pVem, SPELL_HEAL);
break;
case 2:
DoCast(m_creature, SPELL_HEAL);
DoCast(me, SPELL_HEAL);
break;
}
}
@@ -298,7 +298,7 @@ struct boss_yaujAI : public ScriptedAI
{
if (pInstance->GetData(DATA_VEMISDEAD))
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
VemDead = true;
}
}
@@ -204,17 +204,17 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
ClockWise = false;
//Reset flags
m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
m_creature->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetVisibility(VISIBILITY_ON);
me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_ON);
//Reset Phase
if (pInst)
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
//to avoid having a following void zone
Creature* pPortal= m_creature->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
Creature* pPortal= me->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
if (pPortal)
pPortal->SetReactState(REACT_PASSIVE);
}
@@ -274,11 +274,11 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
//SPELL_GREEN_BEAM
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
DoCast(pTarget, SPELL_GREEN_BEAM);
//Correctly update our target
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTarget->GetGUID());
me->SetUInt64Value(UNIT_FIELD_TARGET, pTarget->GetGUID());
}
//Beam every 3 seconds
@@ -309,29 +309,29 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
//Switch to Dark Beam
pInst->SetData(DATA_CTHUN_PHASE, PHASE_EYE_RED_BEAM);
m_creature->InterruptNonMeleeSpells(false);
m_creature->SetReactState(REACT_PASSIVE);
me->InterruptNonMeleeSpells(false);
me->SetReactState(REACT_PASSIVE);
//Remove any target
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Select random target for dark beam to start on
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
{
//Face our target
DarkGlareAngle = m_creature->GetAngle(pTarget);
DarkGlareAngle = me->GetAngle(pTarget);
DarkGlareTickTimer = 1000;
DarkGlareTick = 0;
ClockWise = RAND(true, false);
}
//Add red coloration to C'thun
DoCast(m_creature, SPELL_RED_COLORATION, true);
DoCast(me, SPELL_RED_COLORATION, true);
//Freeze animation
DoCast(m_creature, SPELL_FREEZE_ANIM);
m_creature->SetOrientation(DarkGlareAngle);
m_creature->StopMoving();
DoCast(me, SPELL_FREEZE_ANIM);
me->SetOrientation(DarkGlareAngle);
me->StopMoving();
//Darkbeam for 35 seconds
PhaseTimer = 35000;
@@ -345,14 +345,14 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
{
//Set angle and cast
if (ClockWise)
m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35));
me->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35));
else
m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35));
me->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35));
m_creature->StopMoving();
me->StopMoving();
//Actual dark glare cast, maybe something missing here?
DoCast(m_creature, SPELL_DARK_GLARE, false);
DoCast(me, SPELL_DARK_GLARE, false);
//Increase tick
++DarkGlareTick;
@@ -370,14 +370,14 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
BeamTimer = 3000;
ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn during Dark beam)
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
//Remove Red coloration from c'thun
m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
m_creature->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
me->RemoveAurasDueToSpell(SPELL_FREEZE_ANIM);
//set it back to aggressive
m_creature->SetReactState(REACT_AGGRESSIVE);
me->SetReactState(REACT_AGGRESSIVE);
//Eye Beam for 50 seconds
PhaseTimer = 50000;
@@ -388,18 +388,18 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
//Transition phase
case PHASE_CTHUN_TRANSITION:
//Remove any target
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
m_creature->SetHealth(0);
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetHealth(0);
me->SetVisibility(VISIBILITY_OFF);
break;
//Dead phase
case PHASE_CTHUN_DONE:
Creature* pPortal= m_creature->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
Creature* pPortal= me->FindNearestCreature(MOB_CTHUN_PORTAL, 10);
if (pPortal)
pPortal->ForcedDespawn();
m_creature->ForcedDespawn();
me->ForcedDespawn();
break;
}
}
@@ -415,29 +415,29 @@ struct eye_of_cthunAI : public Scripted_NoMovementAI
case PHASE_EYE_GREEN_BEAM:
case PHASE_EYE_RED_BEAM:
//Only if it will kill
if (damage < m_creature->GetHealth())
if (damage < me->GetHealth())
return;
//Fake death in phase 0 or 1 (green beam or dark glare phase)
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
//Remove Red coloration from c'thun
m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
me->RemoveAurasDueToSpell(SPELL_RED_COLORATION);
//Reset to normal emote state and prevent select and attack
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Remove Target field
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Death animation/respawning;
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_TRANSITION);
m_creature->SetHealth(0);
me->SetHealth(0);
damage = 0;
m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveAllAuras();
me->InterruptNonMeleeSpells(true);
me->RemoveAllAuras();
break;
case PHASE_CTHUN_DONE:
@@ -514,9 +514,9 @@ struct cthunAI : public Scripted_NoMovementAI
Stomach_Map.clear();
//Reset flags
m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetVisibility(VISIBILITY_OFF);
me->RemoveAurasDueToSpell(SPELL_TRANSFORM);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_OFF);
if (pInst)
pInst->SetData(DATA_CTHUN_PHASE, PHASE_NOT_STARTED);
@@ -550,7 +550,7 @@ struct cthunAI : public Scripted_NoMovementAI
while (i != Stomach_Map.end())
{
//Check for valid player
Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
Unit* pUnit = Unit::GetUnit(*me, i->first);
//Only units out of stomach
if (pUnit && i->second == false)
@@ -580,7 +580,7 @@ struct cthunAI : public Scripted_NoMovementAI
//WisperTimer
if (WisperTimer <= diff)
{
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
if (!pMap->IsDungeon()) return;
//Play random sound to the zone
@@ -602,7 +602,7 @@ struct cthunAI : public Scripted_NoMovementAI
return;
}
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//No instance
if (!pInst)
@@ -640,22 +640,22 @@ struct cthunAI : public Scripted_NoMovementAI
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
//Switch to c'thun model
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, SPELL_TRANSFORM, false);
m_creature->SetHealth(m_creature->GetMaxHealth());
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_TRANSFORM, false);
me->SetHealth(me->GetMaxHealth());
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
me->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
//Emerging phase
//AttackStart(Unit::GetUnit(*m_creature, HoldpPlayer));
//AttackStart(Unit::GetUnit(*me, HoldpPlayer));
DoZoneInCombat();
//Place all units in threat list on outside of stomach
Stomach_Map.clear();
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)
{
//Outside stomach
Stomach_Map[(*i)->getUnitGuid()] = false;
@@ -680,17 +680,17 @@ struct cthunAI : public Scripted_NoMovementAI
//Body Phase
case PHASE_CTHUN_STOMACH:
//Remove Target field
m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0);
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
//Weaken
if (FleshTentaclesKilled > 1)
{
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_WEAK);
DoScriptText(EMOTE_WEAKENED, m_creature);
DoScriptText(EMOTE_WEAKENED, me);
PhaseTimer = 45000;
DoCast(m_creature, SPELL_PURPLE_COLORATION, true);
DoCast(me, SPELL_PURPLE_COLORATION, true);
UNORDERED_MAP<uint64, bool>::iterator i = Stomach_Map.begin();
@@ -698,13 +698,13 @@ struct cthunAI : public Scripted_NoMovementAI
while (i != Stomach_Map.end())
{
//Check for valid player
Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
Unit* pUnit = Unit::GetUnit(*me, i->first);
//Only move units in stomach
if (pUnit && i->second == true)
{
//Teleport each player out
DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, rand()%6);
//Cast knockback on them
DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
@@ -729,7 +729,7 @@ struct cthunAI : public Scripted_NoMovementAI
while (i != Stomach_Map.end())
{
//Check for valid player
Unit* pUnit = Unit::GetUnit(*m_creature, i->first);
Unit* pUnit = Unit::GetUnit(*me, i->first);
//Only apply to units in stomach
if (pUnit && i->second == true)
@@ -741,7 +741,7 @@ struct cthunAI : public Scripted_NoMovementAI
if (pUnit->IsWithinDist3d(&KickPos, 15.0f))
{
//Teleport each player out
DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6);
DoTeleportPlayer(pUnit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+10, rand()%6);
//Cast knockback on them
DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true);
@@ -766,7 +766,7 @@ struct cthunAI : public Scripted_NoMovementAI
//Set target in stomach
Stomach_Map[pTarget->GetGUID()] = true;
pTarget->InterruptNonMeleeSpells(false);
pTarget->CastSpell(pTarget, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID());
pTarget->CastSpell(pTarget, SPELL_MOUTH_TENTACLE, true, NULL, NULL, me->GetGUID());
StomachEnterTarget = pTarget->GetGUID();
StomachEnterVisTimer = 3800;
}
@@ -778,7 +778,7 @@ struct cthunAI : public Scripted_NoMovementAI
if (StomachEnterVisTimer <= diff)
{
//Check for valid player
Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget);
Unit* pUnit = Unit::GetUnit(*me, StomachEnterTarget);
if (pUnit)
{
@@ -830,7 +830,7 @@ struct cthunAI : public Scripted_NoMovementAI
pInst->SetData(DATA_CTHUN_PHASE, PHASE_CTHUN_STOMACH);
//Remove purple coloration
m_creature->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION);
me->RemoveAurasDueToSpell(SPELL_PURPLE_COLORATION);
//Spawn 2 flesh tentacles
FleshTentaclesKilled = 0;
@@ -871,7 +871,7 @@ struct cthunAI : public Scripted_NoMovementAI
damage = 1;
//Prevent death in non-weakened state
if (damage >= m_creature->GetHealth())
if (damage >= me->GetHealth())
damage = 0;
return;
@@ -901,7 +901,7 @@ struct eye_tentacleAI : public Scripted_NoMovementAI
{
eye_tentacleAI(Creature *c) : Scripted_NoMovementAI(c)
{
if (Creature* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -914,7 +914,7 @@ struct eye_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -941,7 +941,7 @@ struct eye_tentacleAI : public Scripted_NoMovementAI
//KillSelfTimer
if (KillSelfTimer <= diff)
{
m_creature->Kill(m_creature);
me->Kill(me);
return;
} else KillSelfTimer -= diff;
@@ -964,7 +964,7 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
{
SetCombatMovement(false);
if (Creature* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -978,7 +978,7 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -1002,26 +1002,26 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
return;
//EvadeTimer
if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
if (!me->IsWithinMeleeRange(me->getVictim()))
if (EvadeTimer <= diff)
{
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
//Dissapear and reappear at new position
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (!pTarget)
{
m_creature->Kill(m_creature);
me->Kill(me);
return;
}
if (!pTarget->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
if (Creature* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
if (Creature* pPortal = me->SummonCreature(MOB_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1033,20 +1033,20 @@ struct claw_tentacleAI : public Scripted_NoMovementAI
AttackStart(pTarget);
}
m_creature->SetVisibility(VISIBILITY_ON);
me->SetVisibility(VISIBILITY_ON);
} else EvadeTimer -= diff;
//GroundRuptureTimer
if (GroundRuptureTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
DoCast(me->getVictim(), SPELL_GROUND_RUPTURE);
GroundRuptureTimer = 30000;
} else GroundRuptureTimer -= diff;
//HamstringTimer
if (HamstringTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
DoCast(me->getVictim(), SPELL_HAMSTRING);
HamstringTimer = 5000;
} else HamstringTimer -= diff;
@@ -1060,7 +1060,7 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
{
SetCombatMovement(false);
if (Creature* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1075,7 +1075,7 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -1100,26 +1100,26 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
return;
//EvadeTimer
if (!m_creature->IsWithinMeleeRange(m_creature->getVictim()))
if (!me->IsWithinMeleeRange(me->getVictim()))
if (EvadeTimer <= diff)
{
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
//Dissapear and reappear at new position
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (!pTarget)
{
m_creature->Kill(m_creature);
me->Kill(me);
return;
}
if (!pTarget->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
if (Creature* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
me->GetMap()->CreatureRelocation(me, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0);
if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1132,28 +1132,28 @@ struct giant_claw_tentacleAI : public Scripted_NoMovementAI
AttackStart(pTarget);
}
m_creature->SetVisibility(VISIBILITY_ON);
me->SetVisibility(VISIBILITY_ON);
} else EvadeTimer -= diff;
//GroundRuptureTimer
if (GroundRuptureTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
DoCast(me->getVictim(), SPELL_GROUND_RUPTURE);
GroundRuptureTimer = 30000;
} else GroundRuptureTimer -= diff;
//ThrashTimer
if (ThrashTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THRASH);
DoCast(me->getVictim(), SPELL_THRASH);
ThrashTimer = 10000;
} else ThrashTimer -= diff;
//HamstringTimer
if (HamstringTimer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_HAMSTRING);
DoCast(me->getVictim(), SPELL_HAMSTRING);
HamstringTimer = 10000;
} else HamstringTimer -= diff;
@@ -1167,7 +1167,7 @@ struct giant_eye_tentacleAI : public Scripted_NoMovementAI
{
SetCombatMovement(false);
if (Creature* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, *m_creature, TEMPSUMMON_CORPSE_DESPAWN))
if (Creature* pPortal = me->SummonCreature(MOB_GIANT_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN))
{
pPortal->SetReactState(REACT_PASSIVE);
Portal = pPortal->GetGUID();
@@ -1179,7 +1179,7 @@ struct giant_eye_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* who)
{
if (Unit* p = Unit::GetUnit(*m_creature, Portal))
if (Unit* p = Unit::GetUnit(*me, Portal))
p->Kill(p);
}
@@ -1222,8 +1222,8 @@ struct flesh_tentacleAI : public Scripted_NoMovementAI
void JustDied(Unit* killer)
{
if (CAST_SUM(m_creature))
if (Creature* pSummoner = CAST_CRE(CAST_SUM(m_creature)->GetSummoner()))
if (CAST_SUM(me))
if (Creature* pSummoner = CAST_CRE(CAST_SUM(me)->GetSummoner()))
if (pSummoner->AI())
pSummoner->AI()->DoAction(ACTION_FLESH_TENTACLE_KILLED);
}
@@ -93,7 +93,7 @@ struct boss_fankrissAI : public ScriptedAI
//MortalWound_Timer
if (MortalWound_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTAL_WOUND);
DoCast(me->getVictim(), SPELL_MORTAL_WOUND);
MortalWound_Timer = 10000 + rand()%10000;
} else MortalWound_Timer -= diff;
@@ -120,7 +120,7 @@ struct boss_fankrissAI : public ScriptedAI
// Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer.
//We will only telport if fankriss 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 (SpawnHatchlings_Timer <= diff)
{
@@ -137,46 +137,46 @@ struct boss_fankrissAI : public ScriptedAI
{
case 0:
DoTeleportPlayer(pTarget, -8106.0142,1289.2900,-74.419533,5.112);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
break;
case 1:
DoTeleportPlayer(pTarget, -7990.135354,1155.1907,-78.849319,2.608);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
break;
case 2:
DoTeleportPlayer(pTarget,-8159.7753,1127.9064,-76.868660,0.675);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()-3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-3, pTarget->GetPositionY()+3, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()-5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
Hatchling = m_creature->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
Hatchling = me->SummonCreature(15962, pTarget->GetPositionX()-5, pTarget->GetPositionY()+5, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000);
if (Hatchling)
Hatchling->AI()->AttackStart(pTarget);
break;
@@ -73,8 +73,8 @@ struct boss_huhuranAI : public ScriptedAI
//Frenzy_Timer
if (!Frenzy && 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 = true;
PoisonBolt_Timer = 3000;
Frenzy_Timer = 25000 + rand()%10000;
@@ -91,14 +91,14 @@ struct boss_huhuranAI : public ScriptedAI
//Spit Timer
if (Spit_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ACIDSPIT);
DoCast(me->getVictim(), SPELL_ACIDSPIT);
Spit_Timer = 5000 + rand()%5000;
} else Spit_Timer -= diff;
//NoxiousPoison_Timer
if (NoxiousPoison_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_NOXIOUSPOISON);
DoCast(me->getVictim(), SPELL_NOXIOUSPOISON);
NoxiousPoison_Timer = 12000 + rand()%12000;
} else NoxiousPoison_Timer -= diff;
@@ -107,7 +107,7 @@ struct boss_huhuranAI : public ScriptedAI
{
if (PoisonBolt_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_POISONBOLT);
DoCast(me->getVictim(), SPELL_POISONBOLT);
PoisonBolt_Timer = 3000;
} else PoisonBolt_Timer -= diff;
}
@@ -115,16 +115,16 @@ struct boss_huhuranAI : public ScriptedAI
//FrenzyBack_Timer
if (Frenzy && FrenzyBack_Timer <= diff)
{
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
Frenzy = false;
FrenzyBack_Timer = 15000;
} else FrenzyBack_Timer -= diff;
if (!Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31)
if (!Berserk && me->GetHealth()*100 / me->GetMaxHealth() < 31)
{
m_creature->InterruptNonMeleeSpells(false);
DoScriptText(EMOTE_GENERIC_BERSERK, m_creature);
DoCast(m_creature, SPELL_BERSERK);
me->InterruptNonMeleeSpells(false);
DoScriptText(EMOTE_GENERIC_BERSERK, me);
DoCast(me, SPELL_BERSERK);
Berserk = true;
}
@@ -60,7 +60,7 @@ struct boss_ouroAI : public ScriptedAI
void EnterCombat(Unit *who)
{
DoCast(m_creature->getVictim(), SPELL_BIRTH);
DoCast(me->getVictim(), SPELL_BIRTH);
}
void UpdateAI(const uint32 diff)
@@ -72,14 +72,14 @@ struct boss_ouroAI : public ScriptedAI
//Sweep_Timer
if (!Submerged && Sweep_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SWEEP);
DoCast(me->getVictim(), SPELL_SWEEP);
Sweep_Timer = 15000 + rand()%15000;
} else Sweep_Timer -= diff;
//SandBlast_Timer
if (!Submerged && SandBlast_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SANDBLAST);
DoCast(me->getVictim(), SPELL_SANDBLAST);
SandBlast_Timer = 20000 + rand()%15000;
} else SandBlast_Timer -= diff;
@@ -87,10 +87,10 @@ struct boss_ouroAI : public ScriptedAI
if (!Submerged && Submerge_Timer <= diff)
{
//Cast
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->setFaction(35);
DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE);
me->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setFaction(35);
DoCast(me, SPELL_DIRTMOUND_PASSIVE);
Submerged = true;
Back_Timer = 30000 + rand()%15000;
@@ -111,10 +111,10 @@ struct boss_ouroAI : public ScriptedAI
//Back_Timer
if (Submerged && Back_Timer <= diff)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->setFaction(14);
DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE);
DoCast(me->getVictim(), SPELL_GROUND_RUPTURE);
Submerged = false;
Submerge_Timer = 60000 + rand()%60000;
@@ -69,17 +69,17 @@ struct boss_sarturaAI : 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);
}
void KilledUnit(Unit* victim)
{
DoScriptText(SAY_SLAY, m_creature);
DoScriptText(SAY_SLAY, me);
}
void UpdateAI(const uint32 diff)
@@ -96,8 +96,8 @@ struct boss_sarturaAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
m_creature->AddThreat(pTarget, 1.0f);
m_creature->TauntApply(pTarget);
me->AddThreat(pTarget, 1.0f);
me->TauntApply(pTarget);
AttackStart(pTarget);
WhirlWindRandom_Timer = 3000 + rand()%4000;
@@ -114,7 +114,7 @@ struct boss_sarturaAI : public ScriptedAI
{
if (WhirlWind_Timer <= diff)
{
DoCast(m_creature, SPELL_WHIRLWIND);
DoCast(me, SPELL_WHIRLWIND);
WhirlWind = true;
WhirlWindEnd_Timer = 15000;
} else WhirlWind_Timer -= diff;
@@ -125,8 +125,8 @@ struct boss_sarturaAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
m_creature->AddThreat(pTarget, 1.0f);
m_creature->TauntApply(pTarget);
me->AddThreat(pTarget, 1.0f);
me->TauntApply(pTarget);
AttackStart(pTarget);
AggroReset = true;
@@ -146,9 +146,9 @@ struct boss_sarturaAI : public ScriptedAI
//If she is 20% enrage
if (!Enraged)
{
if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false))
if (me->GetHealth()*100 / me->GetMaxHealth() <= 20 && !me->IsNonMeleeSpellCasted(false))
{
DoCast(m_creature, SPELL_ENRAGE);
DoCast(me, SPELL_ENRAGE);
Enraged = true;
}
}
@@ -158,7 +158,7 @@ struct boss_sarturaAI : public ScriptedAI
{
if (EnrageHard_Timer <= diff)
{
DoCast(m_creature, SPELL_ENRAGEHARD);
DoCast(me, SPELL_ENRAGEHARD);
EnragedHard = true;
} else EnrageHard_Timer -= diff;
}
@@ -207,7 +207,7 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
if (!WhirlWind && WhirlWind_Timer <= diff)
{
DoCast(m_creature, SPELL_WHIRLWINDADD);
DoCast(me, SPELL_WHIRLWINDADD);
WhirlWind = true;
WhirlWind_Timer = 25000 + rand()%15000;
WhirlWindEnd_Timer = 15000;
@@ -221,8 +221,8 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
m_creature->AddThreat(pTarget, 1.0f);
m_creature->TauntApply(pTarget);
me->AddThreat(pTarget, 1.0f);
me->TauntApply(pTarget);
AttackStart(pTarget);
WhirlWindRandom_Timer = 3000 + rand()%4000;
@@ -242,8 +242,8 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
Unit *pTarget = NULL;
pTarget = SelectUnit(SELECT_TARGET_RANDOM,1);
if (pTarget)
m_creature->AddThreat(pTarget, 1.0f);
m_creature->TauntApply(pTarget);
me->AddThreat(pTarget, 1.0f);
me->TauntApply(pTarget);
AttackStart(pTarget);
AggroReset = true;
@@ -252,7 +252,7 @@ struct mob_sartura_royal_guardAI : public ScriptedAI
if (KnockBack_Timer <= diff)
{
DoCast(m_creature, SPELL_WHIRLWINDADD);
DoCast(me, SPELL_WHIRLWINDADD);
KnockBack_Timer = 10000 + rand()%10000;
} else KnockBack_Timer -= diff;
}
@@ -81,29 +81,29 @@ struct boss_skeramAI : public ScriptedAI
Images25 = false;
Invisible = false;
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);
if (IsImage)
m_creature->setDeathState(JUST_DIED);
me->setDeathState(JUST_DIED);
}
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* Killer)
{
if (!IsImage)
DoScriptText(SAY_DEATH, m_creature);
DoScriptText(SAY_DEATH, me);
}
void EnterCombat(Unit *who)
{
if (IsImage || Images75)
return;
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), m_creature);
DoScriptText(RAND(SAY_AGGRO1,SAY_AGGRO2,SAY_AGGRO3), me);
}
void UpdateAI(const uint32 diff)
@@ -115,25 +115,25 @@ struct boss_skeramAI : public ScriptedAI
//ArcaneExplosion_Timer
if (ArcaneExplosion_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION);
DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
ArcaneExplosion_Timer = 8000 + rand()%10000;
} else ArcaneExplosion_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
{
//EarthShock_Timer
if (EarthShock_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_EARTH_SHOCK);
DoCast(me->getVictim(), SPELL_EARTH_SHOCK);
EarthShock_Timer = 1000;
} else EarthShock_Timer -= diff;
}
@@ -141,19 +141,19 @@ struct boss_skeramAI : public ScriptedAI
//Blink_Timer
if (Blink_Timer <= diff)
{
//DoCast(m_creature, SPELL_BLINK);
//DoCast(me, SPELL_BLINK);
switch (urand(0,2))
{
case 0:
m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f);
me->GetMap()->CreatureRelocation(me, -8340.782227,2083.814453,125.648788,0.0f);
DoResetThreat();
break;
case 1:
m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f);
me->GetMap()->CreatureRelocation(me, -8341.546875,2118.504639,133.058151,0.0f);
DoResetThreat();
break;
case 2:
m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f);
me->GetMap()->CreatureRelocation(me, -8318.822266,2058.231201,133.058151,0.0f);
DoResetThreat();
break;
}
@@ -162,7 +162,7 @@ struct boss_skeramAI : public ScriptedAI
Blink_Timer= 20000 + rand()%20000;
} else Blink_Timer -= diff;
int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5);
int procent = (int) (me->GetHealth()*100 / me->GetMaxHealth() +0.5);
//Summoning 2 Images and teleporting to a random position on 75% health
if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70))
@@ -183,8 +183,8 @@ struct boss_skeramAI : public ScriptedAI
if (Invisible_Timer <= diff)
{
//Making Skeram visible after telporting
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_ON);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
Invisible_Timer = 2500;
Invisible = false;
@@ -196,7 +196,7 @@ struct boss_skeramAI : public ScriptedAI
void DoSplit(int atPercent /* 75 50 25 */)
{
DoScriptText(SAY_SPLIT, m_creature);
DoScriptText(SAY_SPLIT, me);
ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0);
ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0);
@@ -230,7 +230,7 @@ struct boss_skeramAI : public ScriptedAI
if (Group *pGrp = pTarget->GetGroup())
for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico)
{
//if (grp->m_targetIcons[ico] == m_creature->GetGUID()) -- private member :(
//if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :(
pGrp->SetTargetIcon(ico, 0, 0);
}
@@ -238,10 +238,10 @@ struct boss_skeramAI : public ScriptedAI
}
}
m_creature->RemoveAllAuras();
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r);
me->RemoveAllAuras();
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetVisibility(VISIBILITY_OFF);
me->GetMap()->CreatureRelocation(me, bossc->x, bossc->y, bossc->z, bossc->r);
Invisible = true;
delete place1;
delete place2;
@@ -258,21 +258,21 @@ struct boss_skeramAI : public ScriptedAI
Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
Creature *Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
Creature *Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image1)
{
Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5);
Image1->SetHealth(m_creature->GetHealth() / 5);
Image1->SetMaxHealth(me->GetMaxHealth() / 5);
Image1->SetHealth(me->GetHealth() / 5);
if (pTarget)
Image1->AI()->AttackStart(pTarget);
CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true;
}
Creature *Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
Creature *Image2 = me->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
if (Image2)
{
Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5);
Image2->SetHealth(m_creature->GetHealth() / 5);
Image2->SetMaxHealth(me->GetMaxHealth() / 5);
Image2->SetHealth(me->GetHealth() / 5);
if (pTarget)
Image2->AI()->AttackStart(pTarget);
CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true;
@@ -88,7 +88,7 @@ struct boss_twinemperorsAI : public ScriptedAI
AfterTeleportTimer = 0;
Abuse_Bug_Timer = 10000 + rand()%7000;
BugsTimer = 2000;
m_creature->clearUnitState(UNIT_STAT_STUNNED);
me->clearUnitState(UNIT_STAT_STUNNED);
DontYellWhenDead = false;
EnrageTimer = 15*60000;
}
@@ -96,7 +96,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature *GetOtherBoss()
{
if (pInstance)
return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
return Unit::GetCreature(*me, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR));
else
return NULL;
}
@@ -106,7 +106,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Unit *pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth());
float dPercent = ((float)damage) / ((float)me->GetMaxHealth());
int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth()));
int ohealth = pOtherBoss->GetHealth()-odmg;
pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0);
@@ -129,12 +129,12 @@ struct boss_twinemperorsAI : public ScriptedAI
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true;
}
if (!DontYellWhenDead) // I hope AI is not threaded
DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH);
DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH);
}
void KilledUnit(Unit* victim)
{
DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL);
DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL);
}
void EnterCombat(Unit *who)
@@ -148,7 +148,7 @@ struct boss_twinemperorsAI : public ScriptedAI
ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI());
if (!pOtherBoss->isInCombat())
{
DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO);
DoPlaySoundToSet(me, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO);
otherAI->AttackStart(who);
otherAI->DoZoneInCombat();
}
@@ -157,7 +157,7 @@ struct boss_twinemperorsAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *entry)
{
if (caster == m_creature)
if (caster == me)
return;
Creature *pOtherBoss = GetOtherBoss();
@@ -165,19 +165,19 @@ struct boss_twinemperorsAI : public ScriptedAI
return;
// add health so we keep same percentage for both brothers
uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
uint32 mytotal = me->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth();
float mult = ((float)mytotal) / ((float)histotal);
if (mult < 1)
mult = 1.0f/mult;
#define HEAL_BROTHER_AMOUNT 30000.0f
uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT);
uint32 myh = m_creature->GetHealth();
uint32 myh = me->GetHealth();
uint32 hish = pOtherBoss->GetHealth();
if (mytotal > histotal)
{
uint32 h = m_creature->GetHealth()+largerAmount;
m_creature->SetHealth(std::min(mytotal, h));
uint32 h = me->GetHealth()+largerAmount;
me->SetHealth(std::min(mytotal, h));
}
else
{
@@ -194,7 +194,7 @@ struct boss_twinemperorsAI : public ScriptedAI
if (Heal_Timer <= diff)
{
Unit *pOtherBoss = GetOtherBoss();
if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature,60))
if (pOtherBoss && pOtherBoss->IsWithinDist(me,60))
{
DoCast(pOtherBoss, SPELL_HEAL_BROTHER);
Heal_Timer = 1000;
@@ -215,16 +215,16 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature *pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
//m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
//me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
float other_x = pOtherBoss->GetPositionX();
float other_y = pOtherBoss->GetPositionY();
float other_z = pOtherBoss->GetPositionZ();
float other_o = pOtherBoss->GetOrientation();
Map *thismap = m_creature->GetMap();
thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(),
m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation());
thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o);
Map *thismap = me->GetMap();
thismap->CreatureRelocation(pOtherBoss, me->GetPositionX(),
me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
thismap->CreatureRelocation(me, other_x, other_y, other_z, other_o);
SetAfterTeleport();
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport();
@@ -233,11 +233,11 @@ struct boss_twinemperorsAI : public ScriptedAI
void SetAfterTeleport()
{
m_creature->InterruptNonMeleeSpells(false);
me->InterruptNonMeleeSpells(false);
DoStopAttack();
DoResetThreat();
DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL);
m_creature->addUnitState(UNIT_STAT_STUNNED);
DoCast(me, SPELL_TWIN_TELEPORT_VISUAL);
me->addUnitState(UNIT_STAT_STUNNED);
AfterTeleport = true;
AfterTeleportTimer = 2000;
tspellcasted = false;
@@ -249,9 +249,9 @@ struct boss_twinemperorsAI : public ScriptedAI
{
if (!tspellcasted)
{
m_creature->clearUnitState(UNIT_STAT_STUNNED);
DoCast(m_creature, SPELL_TWIN_TELEPORT);
m_creature->addUnitState(UNIT_STAT_STUNNED);
me->clearUnitState(UNIT_STAT_STUNNED);
DoCast(me, SPELL_TWIN_TELEPORT);
me->addUnitState(UNIT_STAT_STUNNED);
}
tspellcasted = true;
@@ -259,13 +259,13 @@ struct boss_twinemperorsAI : public ScriptedAI
if (AfterTeleportTimer <= diff)
{
AfterTeleport = false;
m_creature->clearUnitState(UNIT_STAT_STUNNED);
Unit *nearu = m_creature->SelectNearestTarget(100);
me->clearUnitState(UNIT_STAT_STUNNED);
Unit *nearu = me->SelectNearestTarget(100);
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
if (nearu)
{
AttackStart(nearu);
m_creature->getThreatManager().addThreat(nearu, 10000);
me->getThreatManager().addThreat(nearu, 10000);
}
return true;
}
@@ -292,15 +292,15 @@ struct boss_twinemperorsAI : public ScriptedAI
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);
float attackRadius = me->GetAttackDistance(who);
if (attackRadius < PULL_RANGE)
attackRadius = PULL_RANGE;
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
if (me->IsWithinDistInMap(who, attackRadius) && me->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/)
{
//if (who->HasStealthAura())
// who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
@@ -312,8 +312,8 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature *RespawnNearbyBugsAndGetOne()
{
std::list<Creature*> lUnitList;
m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f);
m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f);
me->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f);
me->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f);
if (lUnitList.empty())
return NULL;
@@ -331,7 +331,7 @@ struct boss_twinemperorsAI : public ScriptedAI
c->setFaction(7);
c->RemoveAllAuras();
}
if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
{
if (!nearb || (rand()%4) == 0)
nearb = c;
@@ -375,9 +375,9 @@ struct boss_twinemperorsAI : public ScriptedAI
{
if (EnrageTimer <= diff)
{
if (!m_creature->IsNonMeleeSpellCasted(true))
if (!me->IsNonMeleeSpellCasted(true))
{
DoCast(m_creature, SPELL_BERSERK);
DoCast(me, SPELL_BERSERK);
EnrageTimer = 60*60000;
} else EnrageTimer = 0;
} else EnrageTimer-=diff;
@@ -406,13 +406,13 @@ struct boss_veknilashAI : public boss_twinemperorsAI
Scarabs_Timer = 7000 + rand()%7000;
//Added. Can be removed if its included in DB.
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
void CastSpellOnBug(Creature *pTarget)
{
pTarget->setFaction(14);
pTarget->AI()->AttackStart(m_creature->getThreatManager().getHostilTarget());
pTarget->AI()->AttackStart(me->getThreatManager().getHostilTarget());
pTarget->AddAura(SPELL_MUTATE_BUG, pTarget);
pTarget->SetHealth(pTarget->GetMaxHealth());
}
@@ -429,7 +429,7 @@ struct boss_veknilashAI : public boss_twinemperorsAI
//UnbalancingStrike_Timer
if (UnbalancingStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_UNBALANCING_STRIKE);
DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE);
UnbalancingStrike_Timer = 8000+rand()%12000;
} else UnbalancingStrike_Timer -= diff;
@@ -482,9 +482,9 @@ struct boss_veklorAI : public boss_twinemperorsAI
Scorpions_Timer = 7000 + rand()%7000;
//Added. Can be removed if its included in DB.
m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
}
void CastSpellOnBug(Creature *pTarget)
@@ -511,10 +511,10 @@ struct boss_veklorAI : public boss_twinemperorsAI
//ShadowBolt_Timer
if (ShadowBolt_Timer <= diff)
{
if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f))
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0);
if (!me->IsWithinDist(me->getVictim(), 45.0f))
me->GetMotionMaster()->MoveChase(me->getVictim(), VEKLOR_DIST, 0);
else
DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT);
DoCast(me->getVictim(), SPELL_SHADOWBOLT);
ShadowBolt_Timer = 2000;
} else ShadowBolt_Timer -= diff;
@@ -563,10 +563,10 @@ struct boss_veklorAI : public boss_twinemperorsAI
if (who->isTargetableForAttack())
{
// VL doesn't melee
if (m_creature->Attack(who, false))
if (me->Attack(who, false))
{
m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
m_creature->AddThreat(who, 0.0f);
me->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0);
me->AddThreat(who, 0.0f);
}
}
}
@@ -89,7 +89,7 @@ struct aqsentinelAI : public ScriptedAI
void AddBuddyToList(uint64 CreatureGUID)
{
if (CreatureGUID == m_creature->GetGUID())
if (CreatureGUID == me->GetGUID())
return;
for (int i=0; i<3; ++i)
@@ -110,13 +110,13 @@ struct aqsentinelAI : public ScriptedAI
for (int i=0; i<3; ++i)
if (NearbyGUID[i] && NearbyGUID[i] != c->GetGUID())
cai->AddBuddyToList(NearbyGUID[i]);
cai->AddBuddyToList(m_creature->GetGUID());
cai->AddBuddyToList(me->GetGUID());
}
void SendMyListToBuddies()
{
for (int i=0; i<3; ++i)
if (Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[i]))
if (Creature *pNearby = Unit::GetCreature(*me, NearbyGUID[i]))
GiveBuddyMyList(pNearby);
}
@@ -124,7 +124,7 @@ struct aqsentinelAI : public ScriptedAI
{
for (int i=0; i<3; ++i)
{
Creature *c = Unit::GetCreature(*m_creature, NearbyGUID[i]);
Creature *c = Unit::GetCreature(*me, NearbyGUID[i]);
if (c)
{
if (!c->isInCombat())
@@ -140,7 +140,7 @@ struct aqsentinelAI : public ScriptedAI
void AddSentinelsNear(Unit *nears)
{
std::list<Creature*> assistList;
m_creature->GetCreatureListWithEntryInGrid(assistList,15264,70.0f);
me->GetCreatureListWithEntryInGrid(assistList,15264,70.0f);
if (assistList.empty())
return;
@@ -172,14 +172,14 @@ struct aqsentinelAI : public ScriptedAI
selectAbility(pickAbilityRandom(chosenAbilities));
ClearBuddyList();
AddSentinelsNear(m_creature);
AddSentinelsNear(me);
int bli;
for (bli = 0; bli < 3; ++bli)
{
if (!NearbyGUID[bli])
break;
Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[bli]);
Creature *pNearby = Unit::GetCreature(*me, NearbyGUID[bli]);
if (!pNearby)
break;
@@ -199,13 +199,13 @@ struct aqsentinelAI : public ScriptedAI
void Reset()
{
if (!m_creature->isDead())
if (!me->isDead())
{
for (int i=0; i<3; ++i)
{
if (!NearbyGUID[i])
continue;
if (Creature *pNearby = Unit::GetCreature(*m_creature, NearbyGUID[i]))
if (Creature *pNearby = Unit::GetCreature(*me, NearbyGUID[i]))
{
if (pNearby->isDead())
pNearby->Respawn();
@@ -218,7 +218,7 @@ struct aqsentinelAI : public ScriptedAI
void GainSentinelAbility(uint32 id)
{
m_creature->AddAura(id, m_creature);
me->AddAura(id, me);
}
void EnterCombat(Unit *who)
@@ -234,7 +234,7 @@ struct aqsentinelAI : public ScriptedAI
{
for (int ni=0; ni<3; ++ni)
{
Creature *sent = Unit::GetCreature(*m_creature, NearbyGUID[ni]);
Creature *sent = Unit::GetCreature(*me, NearbyGUID[ni]);
if (!sent)
continue;
if (sent->isDead())
@@ -250,9 +250,9 @@ struct aqsentinelAI : public ScriptedAI
Unit *GetHatedManaUser() const
{
std::list<HostileReference*>::const_iterator i;
for (i = m_creature->getThreatManager().getThreatList().begin(); i != m_creature->getThreatManager().getThreatList().end(); ++i)
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->getPowerType() == POWER_MANA)
return pUnit;
}
@@ -267,7 +267,7 @@ struct aqsentinelAI : public ScriptedAI
case SPELL_THUNDER_BUFF:
case SPELL_MSTRIKE_BUFF:
case SPELL_STORM_BUFF:
return m_creature->getVictim();
return me->getVictim();
case SPELL_MANAB_BUFF:
return GetHatedManaUser();
@@ -277,7 +277,7 @@ struct aqsentinelAI : public ScriptedAI
case SPELL_REFLECTSFr_BUFF:
case SPELL_THORNS_BUFF:
default:
return m_creature;
return me;
}
}
};
+45 -45
View File
@@ -102,23 +102,23 @@ struct npc_giltharesAI : public npc_escortAI
switch(uiPointId)
{
case 16:
DoScriptText(SAY_GIL_AT_LAST, m_creature, pPlayer);
DoScriptText(SAY_GIL_AT_LAST, me, pPlayer);
break;
case 17:
DoScriptText(SAY_GIL_PROCEED, m_creature, pPlayer);
DoScriptText(SAY_GIL_PROCEED, me, pPlayer);
break;
case 18:
DoScriptText(SAY_GIL_FREEBOOTERS, m_creature, pPlayer);
DoScriptText(SAY_GIL_FREEBOOTERS, me, pPlayer);
break;
case 37:
DoScriptText(SAY_GIL_ALMOST, m_creature, pPlayer);
DoScriptText(SAY_GIL_ALMOST, me, pPlayer);
break;
case 47:
DoScriptText(SAY_GIL_SWEET, m_creature, pPlayer);
DoScriptText(SAY_GIL_SWEET, me, pPlayer);
break;
case 53:
DoScriptText(SAY_GIL_FREED, m_creature, pPlayer);
pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, m_creature);
DoScriptText(SAY_GIL_FREED, me, pPlayer);
pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, me);
break;
}
}
@@ -130,10 +130,10 @@ struct npc_giltharesAI : public npc_escortAI
return;
//only aggro text if not player and only in this area
if (pWho->GetTypeId() != TYPEID_PLAYER && m_creature->GetAreaId() == AREA_MERCHANT_COAST)
if (pWho->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST)
{
//appears to be pretty much random (possible only if escorter not in combat with pWho yet?)
DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), m_creature, pWho);
DoScriptText(RAND(SAY_GIL_AGGRO_1, SAY_GIL_AGGRO_2, SAY_GIL_AGGRO_3, SAY_GIL_AGGRO_4), me, pWho);
}
}
};
@@ -214,20 +214,20 @@ struct npc_taskmaster_fizzuleAI : public ScriptedAI
IsFriend = false;
Reset_Timer = 120000;
FlareCount = 0;
m_creature->setFaction(factionNorm);
me->setFaction(factionNorm);
}
void DoFriend()
{
m_creature->RemoveAllAuras();
m_creature->DeleteThreatList();
m_creature->CombatStop(true);
me->RemoveAllAuras();
me->DeleteThreatList();
me->CombatStop(true);
m_creature->StopMoving();
m_creature->GetMotionMaster()->MoveIdle();
me->StopMoving();
me->GetMotionMaster()->MoveIdle();
m_creature->setFaction(FACTION_FRIENDLY_F);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
me->setFaction(FACTION_FRIENDLY_F);
me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
@@ -266,7 +266,7 @@ struct npc_taskmaster_fizzuleAI : public ScriptedAI
{
if (FlareCount >= 2)
{
if (m_creature->getFaction() == FACTION_FRIENDLY_F)
if (me->getFaction() == FACTION_FRIENDLY_F)
return;
DoFriend();
@@ -345,7 +345,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
{
if (!who || (!who->isAlive())) return;
if (m_creature->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
{
PlayerGUID = who->GetGUID();
EventInProgress = true;
@@ -367,14 +367,14 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) {
EventInProgress = false;
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
pWarrior->FailQuest(1719);
for (uint8 i = 0; i < 6; ++i)
{
if (AffrayChallenger[i])
{
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[i]);
if (pCreature) {
if (pCreature->isAlive())
{
@@ -390,7 +390,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
if (BigWill)
{
Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
Creature* pCreature = Unit::GetCreature((*me), BigWill);
if (pCreature) {
if (pCreature->isAlive()) {
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
@@ -409,11 +409,11 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) {
pWarrior->AreaExploredOrEventHappens(1719);
DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, m_creature);
DoScriptText(SAY_TWIGGY_FLATHEAD_BEGIN, me);
for (uint8 i = 0; i < 6; ++i)
{
Creature* pCreature = m_creature->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
Creature* pCreature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000);
if (!pCreature)
continue;
pCreature->setFaction(35);
@@ -435,10 +435,10 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
{
if (AffrayChallenger[i])
{
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[i]);
Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[i]);
if ((!pCreature || (!pCreature->isAlive())) && !Challenger_down[i])
{
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, m_creature);
DoScriptText(SAY_TWIGGY_FLATHEAD_DOWN, me);
Challenger_down[i] = true;
}
}
@@ -450,8 +450,8 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
{
if (AffrayChallenger[Wave] && Wave < 6 && !EventBigWill)
{
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, m_creature);
Creature* pCreature = Unit::GetCreature((*m_creature), AffrayChallenger[Wave]);
DoScriptText(SAY_TWIGGY_FLATHEAD_FRAY, me);
Creature* pCreature = Unit::GetCreature((*me), AffrayChallenger[Wave]);
if (pCreature && (pCreature->isAlive()))
{
pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -464,7 +464,7 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
}
}
else if (Wave >= 6 && !EventBigWill) {
if (Creature* pCreature = m_creature->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
if (Creature* pCreature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12, 6.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000))
{
BigWill = pCreature->GetGUID();
//pCreature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32);
@@ -477,10 +477,10 @@ struct npc_twiggy_flatheadAI : public ScriptedAI
}
else if (Wave >= 6 && EventBigWill && BigWill)
{
Creature* pCreature = Unit::GetCreature((*m_creature), BigWill);
Creature* pCreature = Unit::GetCreature((*me), BigWill);
if (!pCreature || !pCreature->isAlive())
{
DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, m_creature);
DoScriptText(SAY_TWIGGY_FLATHEAD_OVER, me);
EventInProgress = false;
EventBigWill = false;
EventGrate = false;
@@ -537,8 +537,8 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
{
if (!HasEscortState(STATE_ESCORT_ESCORTING))
{
if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD)
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
if (me->getStandState() == UNIT_STAND_STATE_DEAD)
me->SetStandState(UNIT_STAND_STATE_STAND);
m_bIsPostEvent = false;
m_uiPostEventTimer = 1000;
@@ -556,16 +556,16 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
switch(uiPointId)
{
case 0:
DoScriptText(SAY_STARTUP1, m_creature);
DoScriptText(SAY_STARTUP1, me);
break;
case 9:
SetRun(false);
break;
case 17:
if (Creature* pTemp = m_creature->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
if (Creature* pTemp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000))
{
DoScriptText(SAY_MERCENARY, pTemp);
m_creature->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000);
}
break;
case 24:
@@ -584,10 +584,10 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
switch(uiPointId)
{
case 9:
DoScriptText(SAY_STARTUP2, m_creature, pPlayer);
DoScriptText(SAY_STARTUP2, me, pPlayer);
break;
case 18:
DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer);
DoScriptText(SAY_PROGRESS_1, me, pPlayer);
SetRun();
break;
}
@@ -596,10 +596,10 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->GetEntry() == NPC_PILOT_WIZZ)
m_creature->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetStandState(UNIT_STAND_STATE_DEAD);
if (pSummoned->GetEntry() == NPC_MERCENARY)
pSummoned->AI()->AttackStart(m_creature);
pSummoned->AI()->AttackStart(me);
}
void UpdateEscortAI(const uint32 uiDiff)
@@ -613,19 +613,19 @@ struct npc_wizzlecrank_shredderAI : public npc_escortAI
switch(m_uiPostEventCount)
{
case 0:
DoScriptText(SAY_PROGRESS_2, m_creature);
DoScriptText(SAY_PROGRESS_2, me);
break;
case 1:
DoScriptText(SAY_PROGRESS_3, m_creature);
DoScriptText(SAY_PROGRESS_3, me);
break;
case 2:
DoScriptText(SAY_END, m_creature);
DoScriptText(SAY_END, me);
break;
case 3:
if (Player* pPlayer = GetPlayerForEscort())
{
pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature);
m_creature->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
pPlayer->GroupEventHappens(QUEST_ESCAPE, me);
me->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000);
}
break;
}
+31 -31
View File
@@ -58,12 +58,12 @@ struct npc_kanatiAI : public npc_escortAI
switch(uiPointId)
{
case 0:
DoScriptText(SAY_KAN_START, m_creature);
DoScriptText(SAY_KAN_START, me);
DoSpawnGalak();
break;
case 1:
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature);
pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, me);
break;
}
}
@@ -71,14 +71,14 @@ struct npc_kanatiAI : public npc_escortAI
void DoSpawnGalak()
{
for (int i = 0; i < 3; ++i)
m_creature->SummonCreature(NPC_GALAK_ASS,
me->SummonCreature(NPC_GALAK_ASS,
m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f,
TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
}
void JustSummoned(Creature* pSummoned)
{
pSummoned->AI()->AttackStart(m_creature);
pSummoned->AI()->AttackStart(me);
}
};
@@ -139,20 +139,20 @@ struct npc_lakota_windsongAI : public npc_escortAI
switch(uiPointId)
{
case 8:
DoScriptText(SAY_LAKO_LOOK_OUT, m_creature);
DoScriptText(SAY_LAKO_LOOK_OUT, me);
DoSpawnBandits(ID_AMBUSH_1);
break;
case 14:
DoScriptText(SAY_LAKO_HERE_COME, m_creature);
DoScriptText(SAY_LAKO_HERE_COME, me);
DoSpawnBandits(ID_AMBUSH_2);
break;
case 21:
DoScriptText(SAY_LAKO_MORE, m_creature);
DoScriptText(SAY_LAKO_MORE, me);
DoSpawnBandits(ID_AMBUSH_3);
break;
case 45:
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature);
pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, me);
break;
}
}
@@ -160,7 +160,7 @@ struct npc_lakota_windsongAI : public npc_escortAI
void DoSpawnBandits(int uiAmbushId)
{
for (int i = 0; i < 2; ++i)
m_creature->SummonCreature(NPC_GRIM_BANDIT,
me->SummonCreature(NPC_GRIM_BANDIT,
m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
@@ -217,15 +217,15 @@ struct npc_paoka_swiftmountainAI : public npc_escortAI
switch(uiPointId)
{
case 15:
DoScriptText(SAY_WYVERN, m_creature);
DoScriptText(SAY_WYVERN, me);
DoSpawnWyvern();
break;
case 26:
DoScriptText(SAY_COMPLETE, m_creature);
DoScriptText(SAY_COMPLETE, me);
break;
case 27:
if (Player* pPlayer = GetPlayerForEscort())
pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature);
pPlayer->GroupEventHappens(QUEST_HOMEWARD, me);
break;
}
}
@@ -233,7 +233,7 @@ struct npc_paoka_swiftmountainAI : public npc_escortAI
void DoSpawnWyvern()
{
for (int i = 0; i < 3; ++i)
m_creature->SummonCreature(NPC_WYVERN,
me->SummonCreature(NPC_WYVERN,
m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f,
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
@@ -282,13 +282,13 @@ struct npc_pluckyAI : public ScriptedAI
{
m_uiResetTimer = 120000;
if (m_creature->getFaction() != m_uiNormFaction)
m_creature->setFaction(m_uiNormFaction);
if (me->getFaction() != m_uiNormFaction)
me->setFaction(m_uiNormFaction);
if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(m_creature, SPELL_PLUCKY_CHICKEN, false);
DoCast(me, SPELL_PLUCKY_CHICKEN, false);
}
void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote)
@@ -297,36 +297,36 @@ struct npc_pluckyAI : public ScriptedAI
{
if (uiTextEmote == TEXTEMOTE_BECKON)
{
m_creature->setFaction(FACTION_FRIENDLY);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(m_creature, SPELL_PLUCKY_HUMAN, false);
me->setFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(me, SPELL_PLUCKY_HUMAN, false);
}
}
if (uiTextEmote == TEXTEMOTE_CHICKEN)
{
if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
return;
else
{
m_creature->setFaction(FACTION_FRIENDLY);
m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(m_creature, SPELL_PLUCKY_HUMAN, false);
m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
me->setFaction(FACTION_FRIENDLY);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
DoCast(me, SPELL_PLUCKY_HUMAN, false);
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
}
}
}
void UpdateAI(const uint32 uiDiff)
{
if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
{
if (m_uiResetTimer <= uiDiff)
{
if (!m_creature->getVictim())
if (!me->getVictim())
EnterEvadeMode();
else
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
return;
}
@@ -394,8 +394,8 @@ struct npc_enraged_pantherAI : public ScriptedAI
void Reset()
{
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SetReactState(REACT_PASSIVE);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
me->SetReactState(REACT_PASSIVE);
}
void UpdateAI(const uint32 diff)
+4 -4
View File
@@ -71,25 +71,25 @@ struct npc_cairne_bloodhoofAI : public ScriptedAI
if (Uppercut_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_UPPERCUT);
DoCast(me->getVictim(), SPELL_UPPERCUT);
Uppercut_Timer = 20000;
} else Uppercut_Timer -= diff;
if (Thunderclap_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_THUNDERCLAP);
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
Thunderclap_Timer = 15000;
} else Thunderclap_Timer -= diff;
if (MortalStrike_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE);
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
MortalStrike_Timer = 15000;
} else MortalStrike_Timer -= diff;
if (Cleave_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_CLEAVE);
DoCast(me->getVictim(), SPELL_CLEAVE);
Cleave_Timer = 7000;
} else Cleave_Timer -= diff;
+25 -25
View File
@@ -61,24 +61,24 @@ struct npc_ameAI : public npc_escortAI
{
case 19:
m_creature->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_AGGRO1, m_creature, pPlayer);
me->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_AGGRO1, me, pPlayer);
break;
case 28:
DoScriptText(SAY_SEARCH, m_creature, pPlayer);
DoScriptText(SAY_SEARCH, me, pPlayer);
break;
case 38:
m_creature->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_AGGRO2, m_creature, pPlayer);
me->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_AGGRO2, me, pPlayer);
break;
case 49:
m_creature->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_AGGRO3, m_creature, pPlayer);
me->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
DoScriptText(SAY_AGGRO3, me, pPlayer);
break;
case 55:
DoScriptText(SAY_FINISH, m_creature, pPlayer);
DoScriptText(SAY_FINISH, me, pPlayer);
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_CHASING_AME,m_creature);
pPlayer->GroupEventHappens(QUEST_CHASING_AME,me);
break;
}
@@ -91,7 +91,7 @@ struct npc_ameAI : public npc_escortAI
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void JustDied(Unit* killer)
@@ -108,7 +108,7 @@ struct npc_ameAI : public npc_escortAI
if (DEMORALIZINGSHOUT_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_DEMORALIZINGSHOUT);
DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT);
DEMORALIZINGSHOUT_Timer = 70000;
} else DEMORALIZINGSHOUT_Timer -= diff;
@@ -189,14 +189,14 @@ struct npc_ringoAI : public FollowerAI
{
FollowerAI::MoveInLineOfSight(pWho);
if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_SPRAGGLE)
if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_SPRAGGLE)
{
if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
if (me->IsWithinDistInMap(pWho, INTERACTION_DISTANCE))
{
if (Player* pPlayer = GetLeaderForFollower())
{
if (pPlayer->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE)
pPlayer->GroupEventHappens(QUEST_A_LITTLE_HELP, m_creature);
pPlayer->GroupEventHappens(QUEST_A_LITTLE_HELP, me);
}
SpraggleGUID = pWho->GetGUID();
@@ -217,21 +217,21 @@ struct npc_ringoAI : public FollowerAI
{
SetFollowPaused(true);
DoScriptText(RAND(SAY_FAINT_1,SAY_FAINT_2,SAY_FAINT_3,SAY_FAINT_4), m_creature);
DoScriptText(RAND(SAY_FAINT_1,SAY_FAINT_2,SAY_FAINT_3,SAY_FAINT_4), me);
}
//what does actually happen here? Emote? Aura?
m_creature->SetStandState(UNIT_STAND_STATE_SLEEP);
me->SetStandState(UNIT_STAND_STATE_SLEEP);
}
void ClearFaint()
{
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
me->SetStandState(UNIT_STAND_STATE_STAND);
if (HasFollowState(STATE_FOLLOW_POSTEVENT))
return;
DoScriptText(RAND(SAY_WAKE_1,SAY_WAKE_2,SAY_WAKE_3,SAY_WAKE_4), m_creature);
DoScriptText(RAND(SAY_WAKE_1,SAY_WAKE_2,SAY_WAKE_3,SAY_WAKE_4), me);
SetFollowPaused(false);
}
@@ -244,7 +244,7 @@ struct npc_ringoAI : public FollowerAI
{
if (m_uiEndEventTimer <= uiDiff)
{
Unit *pSpraggle = Unit::GetUnit(*m_creature, SpraggleGUID);
Unit *pSpraggle = Unit::GetUnit(*me, SpraggleGUID);
if (!pSpraggle || !pSpraggle->isAlive())
{
SetFollowComplete();
@@ -254,7 +254,7 @@ struct npc_ringoAI : public FollowerAI
switch(m_uiEndEventProgress)
{
case 1:
DoScriptText(SAY_RIN_END_1, m_creature);
DoScriptText(SAY_RIN_END_1, me);
m_uiEndEventTimer = 3000;
break;
case 2:
@@ -262,21 +262,21 @@ struct npc_ringoAI : public FollowerAI
m_uiEndEventTimer = 5000;
break;
case 3:
DoScriptText(SAY_RIN_END_3, m_creature);
DoScriptText(SAY_RIN_END_3, me);
m_uiEndEventTimer = 1000;
break;
case 4:
DoScriptText(EMOTE_RIN_END_4, m_creature);
DoScriptText(EMOTE_RIN_END_4, me);
SetFaint();
m_uiEndEventTimer = 9000;
break;
case 5:
DoScriptText(EMOTE_RIN_END_5, m_creature);
DoScriptText(EMOTE_RIN_END_5, me);
ClearFaint();
m_uiEndEventTimer = 1000;
break;
case 6:
DoScriptText(SAY_RIN_END_6, m_creature);
DoScriptText(SAY_RIN_END_6, me);
m_uiEndEventTimer = 3000;
break;
case 7:
@@ -284,7 +284,7 @@ struct npc_ringoAI : public FollowerAI
m_uiEndEventTimer = 10000;
break;
case 8:
DoScriptText(EMOTE_RIN_END_8, m_creature);
DoScriptText(EMOTE_RIN_END_8, me);
m_uiEndEventTimer = 5000;
break;
case 9:
@@ -81,8 +81,8 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
eventTimer = 0;
currentEvent = 0;
eventProgress = 0;
m_creature->setActive(true);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
me->setActive(true);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
}
uint32 eventTimer;
@@ -103,7 +103,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
pInstance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS);
break;
case 5:
DoScriptText(SAY_MUST_CONTINUE, m_creature);
DoScriptText(SAY_MUST_CONTINUE, me);
pInstance->SetData(TYPE_NARALEX_PART1, DONE);
break;
case 11:
@@ -112,7 +112,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
pInstance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS);
break;
case 19:
DoScriptText(SAY_BEYOND_THIS_CORRIDOR, m_creature);
DoScriptText(SAY_BEYOND_THIS_CORRIDOR, me);
break;
case 24:
eventProgress = 1;
@@ -129,7 +129,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
void EnterCombat(Unit* who)
{
DoScriptText(SAY_ATTACKED, m_creature, who);
DoScriptText(SAY_ATTACKED, me, who);
}
void JustDied(Unit *slayer)
@@ -145,7 +145,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
void JustSummoned(Creature* summoned)
{
summoned->AI()->AttackStart(m_creature);
summoned->AI()->AttackStart(me);
}
void UpdateAI(const uint32 diff)
@@ -166,31 +166,31 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
if (eventProgress == 1)
{
++eventProgress;
DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature);
m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
DoScriptText(SAY_TEMPLE_OF_PROMISE, me);
me->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
me->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
}
break;
case TYPE_NARALEX_PART2:
if (eventProgress == 1)
{
++eventProgress;
DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature);
DoCast(m_creature, SPELL_SERPENTINE_CLEANSING);
//CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false);
DoScriptText(SAY_BANISH_THE_SPIRITS, me);
DoCast(me, SPELL_SERPENTINE_CLEANSING);
//CAST_AI(npc_escortAI, me->AI())->SetCanDefend(false);
eventTimer = 30000;
m_creature->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
m_creature->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
m_creature->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
me->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
me->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
me->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
}
else
if (eventProgress == 2)
{
//CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(true);
DoScriptText(SAY_CAVERNS_PURIFIED, m_creature);
//CAST_AI(npc_escortAI, me->AI())->SetCanDefend(true);
DoScriptText(SAY_CAVERNS_PURIFIED, me);
pInstance->SetData(TYPE_NARALEX_PART2, DONE);
if (m_creature->HasAura(SPELL_SERPENTINE_CLEANSING))
m_creature->RemoveAura(SPELL_SERPENTINE_CLEANSING);
if (me->HasAura(SPELL_SERPENTINE_CLEANSING))
me->RemoveAura(SPELL_SERPENTINE_CLEANSING);
}
break;
case TYPE_NARALEX_PART3:
@@ -198,18 +198,18 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
{
++eventProgress;
eventTimer = 4000;
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
DoScriptText(SAY_EMERALD_DREAM, m_creature);
me->SetStandState(UNIT_STAND_STATE_KNEEL);
DoScriptText(SAY_EMERALD_DREAM, me);
}
else
if (eventProgress == 2)
{
++eventProgress;
eventTimer = 15000;
//CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false);
//CAST_AI(npc_escortAI, me->AI())->SetCanDefend(false);
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoCast(naralex, SPELL_NARALEXS_AWAKENING, true);
DoScriptText(EMOTE_AWAKENING_RITUAL, m_creature);
DoScriptText(EMOTE_AWAKENING_RITUAL, me);
}
else
if (eventProgress == 3)
@@ -218,9 +218,9 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
eventTimer = 15000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(EMOTE_TROUBLED_SLEEP, naralex);
m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
}
else
if (eventProgress == 4)
@@ -229,13 +229,13 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
eventTimer = 30000;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
me->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000);
}
else
if (eventProgress == 5)
@@ -243,8 +243,8 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
++eventProgress;
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
DoScriptText(EMOTE_HORRENDOUS_VISION, naralex);
m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
DoScriptText(SAY_MUTANUS_THE_DEVOURER, m_creature);
me->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
DoScriptText(SAY_MUTANUS_THE_DEVOURER, me);
pInstance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS);
}
else
@@ -257,7 +257,7 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
AchievementEntry const *AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS);
if (AchievWC)
{
Map* pMap = m_creature->GetMap();
Map* pMap = me->GetMap();
if (pMap && pMap->IsDungeon())
{
Map::PlayerList const &players = pMap->GetPlayers();
@@ -265,12 +265,12 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
itr->getSource()->CompletedAchievement(AchievWC);
}
}
if (m_creature->HasAura(SPELL_NARALEXS_AWAKENING))
m_creature->RemoveAura(SPELL_NARALEXS_AWAKENING);
if (me->HasAura(SPELL_NARALEXS_AWAKENING))
me->RemoveAura(SPELL_NARALEXS_AWAKENING);
naralex->SetStandState(UNIT_STAND_STATE_STAND);
DoScriptText(SAY_I_AM_AWAKE, naralex);
}
DoScriptText(SAY_NARALEX_AWAKES, m_creature);
DoScriptText(SAY_NARALEX_AWAKES, me);
}
else
if (eventProgress == 7)
@@ -291,8 +291,8 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
naralex->AddAura(SPELL_FLIGHT_FORM, naralex);
}
SetRun();
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
m_creature->AddAura(SPELL_FLIGHT_FORM, m_creature);
me->SetStandState(UNIT_STAND_STATE_STAND);
me->AddAura(SPELL_FLIGHT_FORM, me);
}
else
if (eventProgress == 9)
@@ -312,15 +312,15 @@ struct npc_disciple_of_naralexAI : public npc_escortAI
naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870);
naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801);
}
m_creature->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870);
m_creature->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135);
me->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870);
me->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135);
}
else
if (eventProgress == 11)
{
if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX)))
naralex->SetVisibility(VISIBILITY_OFF);
m_creature->SetVisibility(VISIBILITY_OFF);
me->SetVisibility(VISIBILITY_OFF);
pInstance->SetData(TYPE_NARALEX_PART3, DONE);
}
break;
+4 -4
View File
@@ -50,14 +50,14 @@ struct npc_sergeant_blyAI : public ScriptedAI
//ScriptedInstance* pInstance;
uint32 ShieldBash_Timer;
uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required.
uint32 Revenge_Timer; //this is wrong, spell should never be used unless me->getVictim() dodge, parry or block attack. Trinity support required.
void Reset()
{
ShieldBash_Timer = 5000;
Revenge_Timer = 8000;
m_creature->setFaction(FACTION_FRIENDLY);
me->setFaction(FACTION_FRIENDLY);
/*if (pInstance)
pInstance->SetData(0, NOT_STARTED);*/
@@ -82,13 +82,13 @@ struct npc_sergeant_blyAI : public ScriptedAI
if (ShieldBash_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_SHIELD_BASH);
DoCast(me->getVictim(), SPELL_SHIELD_BASH);
ShieldBash_Timer = 15000;
} else ShieldBash_Timer -= diff;
if (Revenge_Timer <= diff)
{
DoCast(m_creature->getVictim(), SPELL_REVENGE);
DoCast(me->getVictim(), SPELL_REVENGE);
Revenge_Timer = 10000;
} else Revenge_Timer -= diff;