aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp56
-rw-r--r--src/server/scripts/EasternKingdoms/zone_hinterlands.cpp18
-rw-r--r--src/server/scripts/Kalimdor/zone_ashenvale.cpp428
-rw-r--r--src/server/scripts/Kalimdor/zone_azshara.cpp184
4 files changed, 323 insertions, 363 deletions
diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
index b8939f16c5d..f5fe9b4046c 100644
--- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
@@ -39,22 +39,21 @@ EndContentData */
enum ProfessorPhizzlethorpe
{
// Yells
- SAY_PROGRESS_1 = 0,
- SAY_PROGRESS_2 = 1,
- SAY_PROGRESS_3 = 2,
- EMOTE_PROGRESS_4 = 3,
- SAY_AGGRO = 4,
- SAY_PROGRESS_5 = 5,
- SAY_PROGRESS_6 = 6,
- SAY_PROGRESS_7 = 7,
- EMOTE_PROGRESS_8 = 8,
- SAY_PROGRESS_9 = 9,
-
+ SAY_PROGRESS_1 = 0,
+ SAY_PROGRESS_2 = 1,
+ SAY_PROGRESS_3 = 2,
+ EMOTE_PROGRESS_4 = 3,
+ SAY_AGGRO = 4,
+ SAY_PROGRESS_5 = 5,
+ SAY_PROGRESS_6 = 6,
+ SAY_PROGRESS_7 = 7,
+ EMOTE_PROGRESS_8 = 8,
+ SAY_PROGRESS_9 = 9,
// Quests
QUEST_SUNKEN_TREASURE = 665,
-
// Creatures
- NPC_VENGEFUL_SURGE = 2776
+ NPC_VENGEFUL_SURGE = 2776,
+ FACTION_SUNKEN_TREASURE = 113
};
class npc_professor_phizzlethorpe : public CreatureScript
@@ -115,29 +114,26 @@ class npc_professor_phizzlethorpe : public CreatureScript
Talk(SAY_AGGRO);
}
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
+ {
+ Talk(SAY_PROGRESS_1, player);
+ npc_escortAI::Start(false, false, player->GetGUID(), quest);
+ me->setFaction(FACTION_SUNKEN_TREASURE);
+ }
+ }
+
void UpdateAI(uint32 diff) OVERRIDE
{
npc_escortAI::UpdateAI(diff);
}
};
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_professor_phizzlethorpeAI(creature);
- }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
- {
- creature->AI()->Talk(SAY_PROGRESS_1, player);
- if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI())))
- pEscortAI->Start(false, false, player->GetGUID(), quest);
-
- creature->setFaction(113);
- }
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_professor_phizzlethorpeAI(creature);
+ }
};
void AddSC_arathi_highlands()
diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
index 0052a9fa299..5399e0c858e 100644
--- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
@@ -80,14 +80,8 @@ public:
if (quest->GetQuestId() == QUEST_RESQUE_OOX_09)
{
me->SetStandState(UNIT_STAND_STATE_STAND);
-
- if (player->GetTeam() == ALLIANCE)
- me->setFaction(FACTION_ESCORTEE_A);
- else if (player->GetTeam() == HORDE)
- me->setFaction(FACTION_ESCORTEE_H);
-
+ me->setFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A : FACTION_ESCORTEE_H);
Talk(SAY_OOX_START, player);
-
npc_escortAI::Start(false, false, player->GetGUID(), quest);
}
}
@@ -167,14 +161,14 @@ struct Location
Location AmbushSpawn[] =
{
- {191.296204f, -2839.329346f, 107.388f},
- {70.972466f, -2848.674805f, 109.459f}
+ { 191.296204f, -2839.329346f, 107.388f },
+ { 70.972466f, -2848.674805f, 109.459f }
};
Location AmbushMoveTo[] =
{
- {166.630386f, -2824.780273f, 108.153f},
- {70.886589f, -2874.335449f, 116.675f}
+ { 166.630386f, -2824.780273f, 108.153f },
+ { 70.886589f, -2874.335449f, 116.675f }
};
class npc_rinji : public CreatureScript
@@ -315,10 +309,8 @@ public:
else
postEventTimer -= diff;
}
-
return;
}
-
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
index c278c12ee23..8304f5ba9e4 100644
--- a/src/server/scripts/Kalimdor/zone_ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp
@@ -37,130 +37,118 @@ EndContentData */
# npc_torek
####*/
-enum TorekSays
+enum Torek
{
SAY_READY = 0,
SAY_MOVE = 1,
SAY_PREPARE = 2,
SAY_WIN = 3,
SAY_END = 4,
+ SPELL_REND = 11977,
+ SPELL_THUNDERCLAP = 8078,
+ QUEST_TOREK_ASSULT = 6544,
+ NPC_SPLINTERTREE_RAIDER = 12859,
+ NPC_DURIEL = 12860,
+ NPC_SILVERWING_SENTINEL = 12896,
+ NPC_SILVERWING_WARRIOR = 12897,
+ FACTION_QUEST = 113
};
-enum TorekSpells
+class npc_torek : public CreatureScript
{
- SPELL_REND = 11977,
- SPELL_THUNDERCLAP = 8078,
-};
+public:
+ npc_torek() : CreatureScript("npc_torek") { }
-enum TorekMisc
-{
- QUEST_TOREK_ASSULT = 6544,
+ struct npc_torekAI : public npc_escortAI
+ {
+ npc_torekAI(Creature* creature) : npc_escortAI(creature) { }
- ENTRY_SPLINTERTREE_RAIDER = 12859,
- ENTRY_DURIEL = 12860,
- ENTRY_SILVERWING_SENTINEL = 12896,
- ENTRY_SILVERWING_WARRIOR = 12897,
-};
+ void Reset() OVERRIDE
+ {
+ rend_Timer = 5000;
+ thunderclap_Timer = 8000;
+ _completed = false;
+ }
-class npc_torek : public CreatureScript
-{
- public:
- npc_torek() : CreatureScript("npc_torek") { }
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
- struct npc_torekAI : public npc_escortAI
+ void JustSummoned(Creature* summoned) OVERRIDE
{
- npc_torekAI(Creature* creature) : npc_escortAI(creature) { }
+ summoned->AI()->AttackStart(me);
+ }
- uint32 Rend_Timer;
- uint32 Thunderclap_Timer;
- bool Completed;
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
+ {
+ /// @todo find companions, make them follow Torek, at any time (possibly done by core/database in future?)
+ Talk(SAY_READY, player);
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, true, player->GetGUID());
+ }
+ }
- void WaypointReached(uint32 waypointId) OVERRIDE
+ void WaypointReached(uint32 waypointId) OVERRIDE
+ {
+ if (Player* player = GetPlayerForEscort())
{
- if (Player* player = GetPlayerForEscort())
+ switch (waypointId)
{
- switch (waypointId)
- {
- case 1:
- Talk(SAY_MOVE, player);
- break;
- case 8:
- Talk(SAY_PREPARE, player);
- break;
- case 19:
- /// @todo verify location and creatures amount.
- me->SummonCreature(ENTRY_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(ENTRY_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- me->SummonCreature(ENTRY_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
- break;
- case 20:
- Talk(SAY_WIN, player);
- Completed = true;
- player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
- break;
- case 21:
- Talk(SAY_END, player);
- break;
- }
+ case 1:
+ Talk(SAY_MOVE, player);
+ break;
+ case 8:
+ Talk(SAY_PREPARE, player);
+ break;
+ case 19:
+ /// @todo verify location and creatures amount.
+ me->SummonCreature(NPC_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ me->SummonCreature(NPC_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
+ break;
+ case 20:
+ Talk(SAY_WIN, player);
+ _completed = true;
+ player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
+ break;
+ case 21:
+ Talk(SAY_END, player);
+ break;
}
}
+ }
- void Reset() OVERRIDE
- {
- Rend_Timer = 5000;
- Thunderclap_Timer = 8000;
- Completed = false;
- }
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ npc_escortAI::UpdateAI(diff);
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- }
+ if (!UpdateVictim())
+ return;
- void JustSummoned(Creature* summoned) OVERRIDE
+ if (rend_Timer <= diff)
{
- summoned->AI()->AttackStart(me);
- }
+ DoCastVictim(SPELL_REND);
+ rend_Timer = 20000;
+ } else rend_Timer -= diff;
- void UpdateAI(uint32 diff) OVERRIDE
+ if (thunderclap_Timer <= diff)
{
- npc_escortAI::UpdateAI(diff);
-
- if (!UpdateVictim())
- return;
-
- if (Rend_Timer <= diff)
- {
- DoCastVictim(SPELL_REND);
- Rend_Timer = 20000;
- } else Rend_Timer -= diff;
-
- if (Thunderclap_Timer <= diff)
- {
- DoCast(me, SPELL_THUNDERCLAP);
- Thunderclap_Timer = 30000;
- } else Thunderclap_Timer -= diff;
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_torekAI(creature);
+ DoCast(me, SPELL_THUNDERCLAP);
+ thunderclap_Timer = 30000;
+ } else thunderclap_Timer -= diff;
}
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
- {
- /// @todo find companions, make them follow Torek, at any time (possibly done by core/database in future?)
- creature->AI()->Talk(SAY_READY, player);
- creature->setFaction(113);
+ private:
+ uint32 rend_Timer;
+ uint32 thunderclap_Timer;
+ bool _completed;
- if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI()))
- pEscortAI->Start(true, true, player->GetGUID());
- }
+ };
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_torekAI(creature);
+ }
};
/*####
@@ -172,96 +160,90 @@ enum RuulSnowhoof
NPC_THISTLEFUR_URSA = 3921,
NPC_THISTLEFUR_TOTEMIC = 3922,
NPC_THISTLEFUR_PATHFINDER = 3926,
-
QUEST_FREEDOM_TO_RUUL = 6482,
-
GO_CAGE = 178147
};
Position const RuulSnowhoofSummonsCoord[6] =
{
- {3449.218018f, -587.825073f, 174.978867f, 4.714445f},
- {3446.384521f, -587.830872f, 175.186279f, 4.714445f},
- {3444.218994f, -587.835327f, 175.380600f, 4.714445f},
- {3508.344482f, -492.024261f, 186.929031f, 4.145029f},
- {3506.265625f, -490.531006f, 186.740128f, 4.239277f},
- {3503.682373f, -489.393799f, 186.629684f, 4.349232f}
+ { 3449.218018f, -587.825073f, 174.978867f, 4.714445f },
+ { 3446.384521f, -587.830872f, 175.186279f, 4.714445f },
+ { 3444.218994f, -587.835327f, 175.380600f, 4.714445f },
+ { 3508.344482f, -492.024261f, 186.929031f, 4.145029f },
+ { 3506.265625f, -490.531006f, 186.740128f, 4.239277f },
+ { 3503.682373f, -489.393799f, 186.629684f, 4.349232f }
};
class npc_ruul_snowhoof : public CreatureScript
{
- public:
- npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { }
+public:
+ npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { }
- struct npc_ruul_snowhoofAI : public npc_escortAI
+ struct npc_ruul_snowhoofAI : public npc_escortAI
+ {
+ npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
+
+ void Reset() OVERRIDE
{
- npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
+ if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
+ Cage->SetGoState(GO_STATE_READY);
+ }
- void WaypointReached(uint32 waypointId) OVERRIDE
- {
- Player* player = GetPlayerForEscort();
- if (!player)
- return;
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
- switch (waypointId)
- {
- case 0:
- me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
- if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
- Cage->SetGoState(GO_STATE_ACTIVE);
- break;
- case 13:
- me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000);
- break;
- case 19:
- me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000);
- me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000);
- break;
- case 21:
- player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
- break;
- }
- }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
+ void JustSummoned(Creature* summoned) OVERRIDE
+ {
+ summoned->AI()->AttackStart(me);
+ }
- void Reset() OVERRIDE
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_TOREK_ASSULT)
{
- if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
- Cage->SetGoState(GO_STATE_READY);
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, false, player->GetGUID());
}
+ }
- void JustSummoned(Creature* summoned) OVERRIDE
- {
- summoned->AI()->AttackStart(me);
- }
+ void WaypointReached(uint32 waypointId) OVERRIDE
+ {
+ Player* player = GetPlayerForEscort();
+ if (!player)
+ return;
- void UpdateAI(uint32 diff) OVERRIDE
+ switch (waypointId)
{
- npc_escortAI::UpdateAI(diff);
+ case 0:
+ me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
+ if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
+ Cage->SetGoState(GO_STATE_ACTIVE);
+ break;
+ case 13:
+ me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[0], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[1], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[2], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ break;
+ case 19:
+ me->SummonCreature(NPC_THISTLEFUR_TOTEMIC, RuulSnowhoofSummonsCoord[3], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_URSA, RuulSnowhoofSummonsCoord[4], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ me->SummonCreature(NPC_THISTLEFUR_PATHFINDER, RuulSnowhoofSummonsCoord[5], TEMPSUMMON_DEAD_DESPAWN, 60000);
+ break;
+ case 21:
+ player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
+ break;
}
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_ruul_snowhoofAI(creature);
}
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
+ void UpdateAI(uint32 diff) OVERRIDE
{
- if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
- {
- creature->setFaction(113);
-
- if (npc_escortAI* pEscortAI = CAST_AI(npc_ruul_snowhoofAI, (creature->AI())))
- pEscortAI->Start(true, false, player->GetGUID());
- }
-
- return true;
+ npc_escortAI::UpdateAI(diff);
}
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_ruul_snowhoofAI(creature);
+ }
};
enum Muglash
@@ -295,37 +277,68 @@ enum Muglash
Position const FirstNagaCoord[3] =
{
- {3603.504150f, 1122.631104f, 1.635f, 0.0f}, // rider
- {3589.293945f, 1148.664063f, 5.565f, 0.0f}, // sorceress
- {3609.925537f, 1168.759521f, -1.168f, 0.0f} // razortail
+ { 3603.504150f, 1122.631104f, 1.635f, 0.0f }, // rider
+ { 3589.293945f, 1148.664063f, 5.565f, 0.0f }, // sorceress
+ { 3609.925537f, 1168.759521f, -1.168f, 0.0f } // razortail
};
Position const SecondNagaCoord[3] =
{
- {3609.925537f, 1168.759521f, -1.168f, 0.0f}, // witch
- {3645.652100f, 1139.425415f, 1.322f, 0.0f}, // priest
- {3583.602051f, 1128.405762f, 2.347f, 0.0f} // myrmidon
+ { 3609.925537f, 1168.759521f, -1.168f, 0.0f }, // witch
+ { 3645.652100f, 1139.425415f, 1.322f, 0.0f }, // priest
+ { 3583.602051f, 1128.405762f, 2.347f, 0.0f } // myrmidon
};
Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f};
class npc_muglash : public CreatureScript
{
- public:
- npc_muglash() : CreatureScript("npc_muglash") { }
+public:
+ npc_muglash() : CreatureScript("npc_muglash") { }
- struct npc_muglashAI : public npc_escortAI
+ struct npc_muglashAI : public npc_escortAI
+ {
+ npc_muglashAI(Creature* creature) : npc_escortAI(creature) { }
+
+ void Reset() OVERRIDE
{
- npc_muglashAI(Creature* creature) : npc_escortAI(creature) { }
+ eventTimer = 10000;
+ waveId = 0;
+ _isBrazierExtinguished = false;
+ }
- uint8 WaveId;
- uint32 EventTimer;
- bool IsBrazierExtinguished;
+ void EnterCombat(Unit* /*who*/) OVERRIDE
+ {
+ if (Player* player = GetPlayerForEscort())
+ if (HasEscortState(STATE_ESCORT_PAUSED))
+ {
+ if (urand(0, 1))
+ Talk(SAY_MUG_ON_GUARD, player);
+ return;
+ }
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ if (HasEscortState(STATE_ESCORT_ESCORTING))
+ if (Player* player = GetPlayerForEscort())
+ player->FailQuest(QUEST_VORSHA);
+ }
- void JustSummoned(Creature* summoned) OVERRIDE
+ void JustSummoned(Creature* summoned) OVERRIDE
+ {
+ summoned->AI()->AttackStart(me);
+ }
+
+ void sQuestAccept(Player* player, Quest const* quest)
+ {
+ if (quest->GetQuestId() == QUEST_VORSHA)
{
- summoned->AI()->AttackStart(me);
+ Talk(SAY_MUG_START1);
+ me->setFaction(FACTION_QUEST);
+ npc_escortAI::Start(true, false, player->GetGUID());
}
+ }
void WaypointReached(uint32 waypointId) OVERRIDE
{
@@ -359,34 +372,9 @@ class npc_muglash : public CreatureScript
}
}
- void EnterCombat(Unit* /*who*/) OVERRIDE
- {
- if (Player* player = GetPlayerForEscort())
- if (HasEscortState(STATE_ESCORT_PAUSED))
- {
- if (urand(0, 1))
- Talk(SAY_MUG_ON_GUARD, player);
- return;
- }
- }
-
- void Reset() OVERRIDE
- {
- EventTimer = 10000;
- WaveId = 0;
- IsBrazierExtinguished = false;
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (HasEscortState(STATE_ESCORT_ESCORTING))
- if (Player* player = GetPlayerForEscort())
- player->FailQuest(QUEST_VORSHA);
- }
-
void DoWaveSummon()
{
- switch (WaveId)
+ switch (waveId)
{
case 1:
me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
@@ -414,42 +402,34 @@ class npc_muglash : public CreatureScript
if (!me->GetVictim())
{
- if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished)
+ if (HasEscortState(STATE_ESCORT_PAUSED) && _isBrazierExtinguished)
{
- if (EventTimer < diff)
+ if (eventTimer < diff)
{
- ++WaveId;
+ ++waveId;
DoWaveSummon();
- EventTimer = 10000;
+ eventTimer = 10000;
}
else
- EventTimer -= diff;
+ eventTimer -= diff;
}
return;
}
DoMeleeAttackIfReady();
}
- };
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_muglashAI(creature);
- }
+ private:
+ uint32 eventTimer;
+ uint8 waveId;
+ public:
+ bool _isBrazierExtinguished;
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_VORSHA)
- {
- if (npc_muglashAI* pEscortAI = CAST_AI(npc_muglashAI, creature->AI()))
- {
- creature->AI()->Talk(SAY_MUG_START1);
- creature->setFaction(113);
+ };
- pEscortAI->Start(true, false, player->GetGUID());
- }
- }
- return true;
- }
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_muglashAI(creature);
+ }
};
class go_naga_brazier : public GameObjectScript
@@ -465,7 +445,7 @@ class go_naga_brazier : public GameObjectScript
{
creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT);
- pEscortAI->IsBrazierExtinguished = true;
+ pEscortAI->_isBrazierExtinguished = true;
return false;
}
}
diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp
index 9fd6ebd5d34..bde7074923b 100644
--- a/src/server/scripts/Kalimdor/zone_azshara.cpp
+++ b/src/server/scripts/Kalimdor/zone_azshara.cpp
@@ -229,7 +229,7 @@ Position const WPs[58] =
{3675.02f, -3960.49f, 35.9118f, 3.67f},
{3653.19f, -3958.33f, 33.9118f, 3.59f},
{3621.12f, -3958.51f, 29.9118f, 3.48f},
- {3604.86f, -3963, 29.9118f, 3.48f},
+ {3604.86f, -3963, 29.9118f, 3.48f},
{3569.94f, -3970.25f, 29.9118f, 3.44f},
{3541.03f, -3975.64f, 29.9118f, 3.41f},
{3510.84f, -3978.71f, 29.9118f, 3.41f},
@@ -270,14 +270,14 @@ Position const WPs[58] =
{2521.05f, -3716.6f, 31.9118f, 2.55f},
{2485.26f, -3706.67f, 31.9118f, 2.51f},
{2458.93f, -3696.67f, 31.9118f, 2.51f},
- {2432, -3692.03f, 31.9118f, 2.46f},
+ {2432, -3692.03f, 31.9118f, 2.46f},
{2399.59f, -3681.97f, 31.9118f, 2.45f},
{2357.75f, -3666.6f, 31.9118f, 2.44f},
{2311.99f, -3656.88f, 31.9118f, 2.94f},
{2263.41f, -3649.55f, 31.9118f, 3.02f},
{2209.05f, -3641.76f, 31.9118f, 2.99f},
{2164.83f, -3637.64f, 31.9118f, 3.15f},
- {2122.42f, -3639, 31.9118f, 3.21f},
+ {2122.42f, -3639, 31.9118f, 3.21f},
{2075.73f, -3643.59f, 31.9118f, 3.22f},
{2033.59f, -3649.52f, 31.9118f, 3.42f},
{1985.22f, -3662.99f, 31.9118f, 3.42f},
@@ -290,51 +290,10 @@ class npc_rizzle_sprysprocket : public CreatureScript
public:
npc_rizzle_sprysprocket() : CreatureScript("npc_rizzle_sprysprocket") { }
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
- {
- player->PlayerTalkClass->ClearMenus();
- if (action == GOSSIP_ACTION_INFO_DEF + 1 && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
- {
- player->CLOSE_GOSSIP_MENU();
- creature->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
- CAST_AI(npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000;
- CAST_AI(npc_rizzle_sprysprocket::npc_rizzle_sprysprocketAI, creature->AI())->MustDie = true;
- }
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
- {
- if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE)
- return true;
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- player->SEND_GOSSIP_MENU(10811, creature->GetGUID());
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_rizzle_sprysprocketAI(creature);
- }
-
struct npc_rizzle_sprysprocketAI : public ScriptedAI
{
npc_rizzle_sprysprocketAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 SpellEscapeTimer;
- uint32 TeleportTimer;
- uint32 CheckTimer;
- uint32 GrenadeTimer;
- uint32 MustDieTimer;
- uint32 CurrWP;
-
- uint64 PlayerGUID;
-
- bool MustDie;
- bool Escape;
- bool ContinueWP;
- bool Reached;
-
void Reset() OVERRIDE
{
SpellEscapeTimer = 1300;
@@ -352,6 +311,47 @@ public:
Reached = false;
}
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+
+ void AttackStart(Unit* who) OVERRIDE
+ {
+ if (!who || PlayerGUID)
+ return;
+
+ Player* player = who->ToPlayer();
+
+ if (player && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
+ {
+ PlayerGUID = who->GetGUID();
+ Talk(SAY_RIZZLE_START);
+ DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
+ return;
+ }
+ }
+
+ void sGossipSelect(Player* player, uint32 sender, uint32 action) OVERRIDE
+ {
+ player->CLOSE_GOSSIP_MENU();
+ me->CastSpell(player, SPELL_GIVE_SOUTHFURY_MOONSTONE, true);
+ MustDieTimer = 3000;
+ MustDie = true;
+ }
+
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
+ {
+ if (type != POINT_MOTION_TYPE)
+ return;
+
+ if (id == 57)
+ {
+ me->DespawnOrUnsummon();
+ return;
+ }
+
+ ++CurrWP;
+ ContinueWP = true;
+ }
+
void UpdateAI(uint32 diff) OVERRIDE
{
if (MustDie)
@@ -434,42 +434,35 @@ public:
CheckTimer = 1000;
} else CheckTimer -= diff;
-
- }
-
- void AttackStart(Unit* who) OVERRIDE
- {
- if (!who || PlayerGUID)
- return;
-
- Player* player = who->ToPlayer();
-
- if (player && player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) == QUEST_STATUS_INCOMPLETE)
- {
- PlayerGUID = who->GetGUID();
- Talk(SAY_RIZZLE_START);
- DoCast(who, SPELL_RIZZLE_BLACKJACK, false);
- return;
- }
}
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
-
- void MovementInform(uint32 type, uint32 id) OVERRIDE
- {
- if (type != POINT_MOTION_TYPE)
- return;
+ private:
+ uint64 PlayerGUID;
+ uint32 SpellEscapeTimer;
+ uint32 TeleportTimer;
+ uint32 CheckTimer;
+ uint32 GrenadeTimer;
+ uint32 MustDieTimer;
+ uint32 CurrWP;
+ bool MustDie;
+ bool Escape;
+ bool ContinueWP;
+ bool Reached;
+ };
- if (id == 57)
- {
- me->DespawnOrUnsummon();
- return;
- }
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
+ {
+ if (player->GetQuestStatus(QUEST_CHASING_THE_MOONSTONE) != QUEST_STATUS_INCOMPLETE)
+ return true;
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GET_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(10811, creature->GetGUID());
+ return true;
+ }
- ++CurrWP;
- ContinueWP = true;
- }
- };
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_rizzle_sprysprocketAI(creature);
+ }
};
/*####
@@ -480,11 +473,6 @@ class npc_depth_charge : public CreatureScript
public:
npc_depth_charge() : CreatureScript("npc_depth_charge") { }
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_depth_chargeAI(creature);
- }
-
struct npc_depth_chargeAI : public ScriptedAI
{
npc_depth_chargeAI(Creature* creature) : ScriptedAI(creature) { }
@@ -501,20 +489,11 @@ public:
WeMustDieTimer = 1000;
}
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (WeMustDie)
- {
- if (WeMustDieTimer <= diff)
- me->DespawnOrUnsummon();
- else
- WeMustDieTimer -= diff;
- }
- return;
- }
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
- void MoveInLineOfSight(Unit* who) OVERRIDE
+ void AttackStart(Unit* /*who*/) OVERRIDE { }
+ void MoveInLineOfSight(Unit* who) OVERRIDE
{
if (!who)
return;
@@ -527,10 +506,23 @@ public:
}
}
- void AttackStart(Unit* /*who*/) OVERRIDE { }
-
- void EnterCombat(Unit* /*who*/) OVERRIDE { }
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (WeMustDie)
+ {
+ if (WeMustDieTimer <= diff)
+ me->DespawnOrUnsummon();
+ else
+ WeMustDieTimer -= diff;
+ }
+ return;
+ }
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_depth_chargeAI(creature);
+ }
};
void AddSC_azshara()