From 38c55a15adcd708c76c1f813cbe265c4005f9593 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 2 Jan 2013 14:52:13 -0330 Subject: Core/Scripting: Rename zone scripts. --- src/server/scripts/Kalimdor/CMakeLists.txt | 44 +- src/server/scripts/Kalimdor/ashenvale.cpp | 486 ------- src/server/scripts/Kalimdor/azshara.cpp | 525 ------- src/server/scripts/Kalimdor/azuremyst_isle.cpp | 770 ---------- src/server/scripts/Kalimdor/bloodmyst_isle.cpp | 212 --- src/server/scripts/Kalimdor/darkshore.cpp | 394 ----- src/server/scripts/Kalimdor/desolace.cpp | 308 ---- src/server/scripts/Kalimdor/durotar.cpp | 589 -------- src/server/scripts/Kalimdor/dustwallow_marsh.cpp | 780 ---------- src/server/scripts/Kalimdor/felwood.cpp | 106 -- src/server/scripts/Kalimdor/feralas.cpp | 249 ---- src/server/scripts/Kalimdor/moonglade.cpp | 714 --------- src/server/scripts/Kalimdor/mulgore.cpp | 327 ----- src/server/scripts/Kalimdor/orgrimmar.cpp | 254 ---- src/server/scripts/Kalimdor/silithus.cpp | 1515 -------------------- .../scripts/Kalimdor/stonetalon_mountains.cpp | 179 --- src/server/scripts/Kalimdor/tanaris.cpp | 685 --------- src/server/scripts/Kalimdor/teldrassil.cpp | 114 -- src/server/scripts/Kalimdor/the_barrens.cpp | 695 --------- src/server/scripts/Kalimdor/thousand_needles.cpp | 463 ------ src/server/scripts/Kalimdor/thunder_bluff.cpp | 147 -- src/server/scripts/Kalimdor/ungoro_crater.cpp | 348 ----- src/server/scripts/Kalimdor/winterspring.cpp | 72 - src/server/scripts/Kalimdor/zone_ashenvale.cpp | 486 +++++++ src/server/scripts/Kalimdor/zone_azshara.cpp | 525 +++++++ .../scripts/Kalimdor/zone_azuremyst_isle.cpp | 770 ++++++++++ .../scripts/Kalimdor/zone_bloodmyst_isle.cpp | 212 +++ src/server/scripts/Kalimdor/zone_darkshore.cpp | 394 +++++ src/server/scripts/Kalimdor/zone_desolace.cpp | 308 ++++ src/server/scripts/Kalimdor/zone_durotar.cpp | 589 ++++++++ .../scripts/Kalimdor/zone_dustwallow_marsh.cpp | 780 ++++++++++ src/server/scripts/Kalimdor/zone_felwood.cpp | 106 ++ src/server/scripts/Kalimdor/zone_feralas.cpp | 249 ++++ src/server/scripts/Kalimdor/zone_moonglade.cpp | 714 +++++++++ src/server/scripts/Kalimdor/zone_mulgore.cpp | 327 +++++ src/server/scripts/Kalimdor/zone_orgrimmar.cpp | 254 ++++ src/server/scripts/Kalimdor/zone_silithus.cpp | 1515 ++++++++++++++++++++ .../scripts/Kalimdor/zone_stonetalon_mountains.cpp | 179 +++ src/server/scripts/Kalimdor/zone_tanaris.cpp | 685 +++++++++ src/server/scripts/Kalimdor/zone_teldrassil.cpp | 114 ++ src/server/scripts/Kalimdor/zone_the_barrens.cpp | 695 +++++++++ .../scripts/Kalimdor/zone_thousand_needles.cpp | 463 ++++++ src/server/scripts/Kalimdor/zone_thunder_bluff.cpp | 147 ++ src/server/scripts/Kalimdor/zone_ungoro_crater.cpp | 348 +++++ src/server/scripts/Kalimdor/zone_winterspring.cpp | 72 + 45 files changed, 9954 insertions(+), 9954 deletions(-) delete mode 100644 src/server/scripts/Kalimdor/ashenvale.cpp delete mode 100644 src/server/scripts/Kalimdor/azshara.cpp delete mode 100644 src/server/scripts/Kalimdor/azuremyst_isle.cpp delete mode 100644 src/server/scripts/Kalimdor/bloodmyst_isle.cpp delete mode 100644 src/server/scripts/Kalimdor/darkshore.cpp delete mode 100644 src/server/scripts/Kalimdor/desolace.cpp delete mode 100644 src/server/scripts/Kalimdor/durotar.cpp delete mode 100644 src/server/scripts/Kalimdor/dustwallow_marsh.cpp delete mode 100644 src/server/scripts/Kalimdor/felwood.cpp delete mode 100644 src/server/scripts/Kalimdor/feralas.cpp delete mode 100644 src/server/scripts/Kalimdor/moonglade.cpp delete mode 100644 src/server/scripts/Kalimdor/mulgore.cpp delete mode 100644 src/server/scripts/Kalimdor/orgrimmar.cpp delete mode 100644 src/server/scripts/Kalimdor/silithus.cpp delete mode 100644 src/server/scripts/Kalimdor/stonetalon_mountains.cpp delete mode 100644 src/server/scripts/Kalimdor/tanaris.cpp delete mode 100644 src/server/scripts/Kalimdor/teldrassil.cpp delete mode 100644 src/server/scripts/Kalimdor/the_barrens.cpp delete mode 100644 src/server/scripts/Kalimdor/thousand_needles.cpp delete mode 100644 src/server/scripts/Kalimdor/thunder_bluff.cpp delete mode 100644 src/server/scripts/Kalimdor/ungoro_crater.cpp delete mode 100644 src/server/scripts/Kalimdor/winterspring.cpp create mode 100644 src/server/scripts/Kalimdor/zone_ashenvale.cpp create mode 100644 src/server/scripts/Kalimdor/zone_azshara.cpp create mode 100644 src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp create mode 100644 src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp create mode 100644 src/server/scripts/Kalimdor/zone_darkshore.cpp create mode 100644 src/server/scripts/Kalimdor/zone_desolace.cpp create mode 100644 src/server/scripts/Kalimdor/zone_durotar.cpp create mode 100644 src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp create mode 100644 src/server/scripts/Kalimdor/zone_felwood.cpp create mode 100644 src/server/scripts/Kalimdor/zone_feralas.cpp create mode 100644 src/server/scripts/Kalimdor/zone_moonglade.cpp create mode 100644 src/server/scripts/Kalimdor/zone_mulgore.cpp create mode 100644 src/server/scripts/Kalimdor/zone_orgrimmar.cpp create mode 100644 src/server/scripts/Kalimdor/zone_silithus.cpp create mode 100644 src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp create mode 100644 src/server/scripts/Kalimdor/zone_tanaris.cpp create mode 100644 src/server/scripts/Kalimdor/zone_teldrassil.cpp create mode 100644 src/server/scripts/Kalimdor/zone_the_barrens.cpp create mode 100644 src/server/scripts/Kalimdor/zone_thousand_needles.cpp create mode 100644 src/server/scripts/Kalimdor/zone_thunder_bluff.cpp create mode 100644 src/server/scripts/Kalimdor/zone_ungoro_crater.cpp create mode 100644 src/server/scripts/Kalimdor/zone_winterspring.cpp (limited to 'src/server/scripts/Kalimdor') diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index ee091c96309..5c44cd7ef27 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -10,9 +10,9 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Kalimdor/stonetalon_mountains.cpp - Kalimdor/silithus.cpp - Kalimdor/moonglade.cpp + Kalimdor/zone_stonetalon_mountains.cpp + Kalimdor/zone_silithus.cpp + Kalimdor/zone_moonglade.cpp Kalimdor/RazorfenDowns/razorfen_downs.cpp Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -58,10 +58,10 @@ set(scripts_STAT_SRCS Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp Kalimdor/BlackfathomDeeps/blackfathom_deeps.h - Kalimdor/azuremyst_isle.cpp - Kalimdor/orgrimmar.cpp - Kalimdor/desolace.cpp - Kalimdor/feralas.cpp + Kalimdor/zone_azuremyst_isle.cpp + Kalimdor/zone_orgrimmar.cpp + Kalimdor/zone_desolace.cpp + Kalimdor/zone_feralas.cpp Kalimdor/Maraudon/boss_princess_theradras.cpp Kalimdor/Maraudon/boss_landslide.cpp Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -78,7 +78,7 @@ set(scripts_STAT_SRCS Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp - Kalimdor/darkshore.cpp + Kalimdor/zone_darkshore.cpp Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -87,27 +87,27 @@ set(scripts_STAT_SRCS Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp - Kalimdor/mulgore.cpp - Kalimdor/bloodmyst_isle.cpp - Kalimdor/thunder_bluff.cpp - Kalimdor/azshara.cpp + Kalimdor/zone_mulgore.cpp + Kalimdor/zone_bloodmyst_isle.cpp + Kalimdor/zone_thunder_bluff.cpp + Kalimdor/zone_azshara.cpp Kalimdor/RazorfenKraul/razorfen_kraul.h Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp Kalimdor/RazorfenKraul/razorfen_kraul.cpp - Kalimdor/the_barrens.cpp - Kalimdor/ungoro_crater.cpp + Kalimdor/zone_the_barrens.cpp + Kalimdor/zone_ungoro_crater.cpp Kalimdor/WailingCaverns/wailing_caverns.h Kalimdor/WailingCaverns/instance_wailing_caverns.cpp Kalimdor/WailingCaverns/wailing_caverns.cpp - Kalimdor/durotar.cpp - Kalimdor/felwood.cpp + Kalimdor/zone_durotar.cpp + Kalimdor/zone_felwood.cpp Kalimdor/boss_azuregos.cpp - Kalimdor/tanaris.cpp - Kalimdor/dustwallow_marsh.cpp - Kalimdor/winterspring.cpp - Kalimdor/thousand_needles.cpp - Kalimdor/ashenvale.cpp - Kalimdor/teldrassil.cpp + Kalimdor/zone_tanaris.cpp + Kalimdor/zone_dustwallow_marsh.cpp + Kalimdor/zone_winterspring.cpp + Kalimdor/zone_thousand_needles.cpp + Kalimdor/zone_ashenvale.cpp + Kalimdor/zone_teldrassil.cpp Kalimdor/OnyxiasLair/boss_onyxia.cpp Kalimdor/OnyxiasLair/onyxias_lair.h Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp deleted file mode 100644 index 94c68a1d3ec..00000000000 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ /dev/null @@ -1,486 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Ashenvale -SD%Complete: 70 -SDComment: Quest support: 6544, 6482 -SDCategory: Ashenvale Forest -EndScriptData */ - -/* ContentData -npc_torek -npc_ruul_snowhoof -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*#### -# npc_torek -####*/ - -enum TorekSays -{ - SAY_READY = 0, - SAY_MOVE = 1, - SAY_PREPARE = 2, - SAY_WIN = 3, - SAY_END = 4, -}; - -enum TorekSpells -{ - SPELL_REND = 11977, - SPELL_THUNDERCLAP = 8078, -}; - -enum TorekMisc -{ - QUEST_TOREK_ASSULT = 6544, - - ENTRY_SPLINTERTREE_RAIDER = 12859, - ENTRY_DURIEL = 12860, - ENTRY_SILVERWING_SENTINEL = 12896, - ENTRY_SILVERWING_WARRIOR = 12897, -}; - -class npc_torek : public CreatureScript -{ - public: - - npc_torek() : CreatureScript("npc_torek") - { - } - - struct npc_torekAI : public npc_escortAI - { - npc_torekAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 Rend_Timer; - uint32 Thunderclap_Timer; - bool Completed; - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 1: - Talk(SAY_MOVE, player->GetGUID()); - break; - case 8: - Talk(SAY_PREPARE, player->GetGUID()); - 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->GetGUID()); - Completed = true; - player->GroupEventHappens(QUEST_TOREK_ASSULT, me); - break; - case 21: - Talk(SAY_END, player->GetGUID()); - break; - } - } - } - - void Reset() - { - Rend_Timer = 5000; - Thunderclap_Timer = 8000; - Completed = false; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (Rend_Timer <= diff) - { - DoCast(me->getVictim(), 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 - { - return new npc_torekAI(creature); - } - - bool OnQuestAccept(Player* player, Creature* creature, 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?) - creature->AI()->Talk(SAY_READY, player->GetGUID()); - creature->setFaction(113); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI())) - pEscortAI->Start(true, true, player->GetGUID()); - } - - return true; - } -}; - -/*#### -# npc_ruul_snowhoof -####*/ - -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} -}; - -class npc_ruul_snowhoof : public CreatureScript -{ - public: - npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { } - - struct npc_ruul_snowhoofAI : public npc_escortAI - { - npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - 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*/) {} - - void Reset() - { - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_READY); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ruul_snowhoofAI(creature); - } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - 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; - } -}; - -enum Muglash -{ - SAY_MUG_START1 = 0, - SAY_MUG_START2 = 1, - SAY_MUG_BRAZIER = 2, - SAY_MUG_BRAZIER_WAIT = 3, - SAY_MUG_ON_GUARD = 4, - SAY_MUG_REST = 5, - SAY_MUG_DONE = 6, - SAY_MUG_GRATITUDE = 7, - SAY_MUG_PATROL = 8, - SAY_MUG_RETURN = 9, - - QUEST_VORSHA = 6641, - - GO_NAGA_BRAZIER = 178247, - - NPC_WRATH_RIDER = 3713, - NPC_WRATH_SORCERESS = 3717, - NPC_WRATH_RAZORTAIL = 3712, - - NPC_WRATH_PRIESTESS = 3944, - NPC_WRATH_MYRMIDON = 3711, - NPC_WRATH_SEAWITCH = 3715, - - NPC_VORSHA = 12940, - NPC_MUGLASH = 12717 -}; - -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 -}; - -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 -}; - -Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f}; - -class npc_muglash : public CreatureScript -{ - public: - npc_muglash() : CreatureScript("npc_muglash") { } - - struct npc_muglashAI : public npc_escortAI - { - npc_muglashAI(Creature* creature) : npc_escortAI(creature) { } - - uint8 WaveId; - uint32 EventTimer; - bool IsBrazierExtinguished; - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 0: - Talk(SAY_MUG_START2, player->GetGUID()); - break; - case 24: - Talk(SAY_MUG_BRAZIER, player->GetGUID()); - - if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) - { - go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - SetEscortPaused(true); - } - break; - case 25: - Talk(SAY_MUG_GRATITUDE); - player->GroupEventHappens(QUEST_VORSHA, me); - break; - case 26: - Talk(SAY_MUG_PATROL); - break; - case 27: - Talk(SAY_MUG_RETURN); - break; - } - } - } - - void EnterCombat(Unit* /*who*/) - { - if (Player* player = GetPlayerForEscort()) - if (HasEscortState(STATE_ESCORT_PAUSED)) - { - if (urand(0, 1)) - Talk(SAY_MUG_ON_GUARD, player->GetGUID()); - return; - } - } - - void Reset() - { - EventTimer = 10000; - WaveId = 0; - IsBrazierExtinguished = false; - } - - void JustDied(Unit* /*killer*/) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_VORSHA); - } - - void DoWaveSummon() - { - switch (WaveId) - { - case 1: - me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - break; - case 2: - me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - break; - case 3: - me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - break; - case 4: - SetEscortPaused(false); - Talk(SAY_MUG_DONE); - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (!me->getVictim()) - { - if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished) - { - if (EventTimer < uiDiff) - { - ++WaveId; - DoWaveSummon(); - EventTimer = 10000; - } - else - EventTimer -= uiDiff; - } - return; - } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_muglashAI(creature); - } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - 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; - } -}; - -class go_naga_brazier : public GameObjectScript -{ - public: - go_naga_brazier() : GameObjectScript("go_naga_brazier") { } - - bool OnGossipHello(Player* /*player*/, GameObject* go) - { - if (Creature* creature = GetClosestCreatureWithEntry(go, NPC_MUGLASH, INTERACTION_DISTANCE*2)) - { - if (npc_muglash::npc_muglashAI* pEscortAI = CAST_AI(npc_muglash::npc_muglashAI, creature->AI())) - { - creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT); - - pEscortAI->IsBrazierExtinguished = true; - return false; - } - } - - return true; - } -}; - -void AddSC_ashenvale() -{ - new npc_torek(); - new npc_ruul_snowhoof(); - new npc_muglash(); - new go_naga_brazier(); -} diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/azshara.cpp deleted file mode 100644 index 44f7e1e8172..00000000000 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Azshara -SD%Complete: 90 -SDComment: Quest support: 2744, 3141, 9364, 10994 -SDCategory: Azshara -EndScriptData */ - -/* ContentData -mobs_spitelashes -npc_loramus_thalipedes -mob_rizzle_sprysprocket -mob_depth_charge -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "SpellInfo.h" -#include "WorldSession.h" - -/*###### -## mobs_spitelashes -######*/ - -class mobs_spitelashes : public CreatureScript -{ -public: - mobs_spitelashes() : CreatureScript("mobs_spitelashes") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_spitelashesAI (creature); - } - - struct mobs_spitelashesAI : public ScriptedAI - { - mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 morphtimer; - bool spellhit; - - void Reset() - { - morphtimer = 0; - spellhit = false; - } - - void EnterCombat(Unit* /*who*/) { } - - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) - { - if (!spellhit && - Hitter->GetTypeId() == TYPEID_PLAYER && - CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && - (Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826)) - { - spellhit=true; - DoCast(me, 29124); //become a sheep - } - } - - void UpdateAI(const uint32 diff) - { - // 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) - { - me->DespawnOrUnsummon(); - return; - } - // walk 5 seconds before summoning - if (spellhit && morphtimer<5000) - { - morphtimer+=diff; - if (morphtimer >= 5000) - { - DoCast(me, 28406); //summon copies - DoCast(me, 6924); //visual explosion - } - } - if (!UpdateVictim()) - return; - - //TODO: add abilities for the different creatures - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_loramus_thalipedes -######*/ - -#define GOSSIP_HELLO_LT1 "Can you help me?" -#define GOSSIP_HELLO_LT2 "Tell me your story" -#define GOSSIP_SELECT_LT1 "Please continue" -#define GOSSIP_SELECT_LT2 "I do not understand" -#define GOSSIP_SELECT_LT3 "Indeed" -#define GOSSIP_SELECT_LT4 "I will do this with or your help, Loramus" -#define GOSSIP_SELECT_LT5 "Yes" - -class npc_loramus_thalipedes : public CreatureScript -{ -public: - npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2744); - break; - - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); - player->SEND_GOSSIP_MENU(1813, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+21: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - player->SEND_GOSSIP_MENU(1814, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); - player->SEND_GOSSIP_MENU(1815, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+23: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); - player->SEND_GOSSIP_MENU(1816, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+24: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); - player->SEND_GOSSIP_MENU(1817, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+25: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3141); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*#### -# mob_rizzle_sprysprocket -####*/ - -enum RizzleSprysprocketData -{ - QUEST_CHASING_THE_MOONSTONE = 10994, - - MOB_DEPTH_CHARGE = 23025, - - SPELL_RIZZLE_BLACKJACK = 39865, - SPELL_RIZZLE_ESCAPE = 39871, - SPELL_RIZZLE_FROST_GRENADE = 40525, - SPELL_DEPTH_CHARGE_TRAP = 38576, - SPELL_PERIODIC_DEPTH_CHARGE = 39912, - SPELL_GIVE_SOUTHFURY_MOONSTONE = 39886, - - SAY_RIZZLE_START = 0, - SAY_RIZZLE_GRENADE = 1, - SAY_RIZZLE_FINAL = 2, - MSG_ESCAPE_NOTICE = 3 -}; - -#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." - -Position const WPs[58] = -{ - {3691.97f, -3962.41f, 35.9118f, 3.67f}, - {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}, - {3569.94f, -3970.25f, 29.9118f, 3.44f}, - {3541.03f, -3975.64f, 29.9118f, 3.41f}, - {3510.84f, -3978.71f, 29.9118f, 3.41f}, - {3472.7f, -3997.07f, 29.9118f, 3.35f}, - {3439.15f, -4014.55f, 29.9118f, 3.29f}, - {3412.8f, -4025.87f, 29.9118f, 3.25f}, - {3384.95f, -4038.04f, 29.9118f, 3.24f}, - {3346.77f, -4052.93f, 29.9118f, 3.22f}, - {3299.56f, -4071.59f, 29.9118f, 3.20f}, - {3261.22f, -4080.38f, 30.9118f, 3.19f}, - {3220.68f, -4083.09f, 31.9118f, 3.18f}, - {3187.11f, -4070.45f, 33.9118f, 3.16f}, - {3162.78f, -4062.75f, 33.9118f, 3.15f}, - {3136.09f, -4050.32f, 33.9118f, 3.07f}, - {3119.47f, -4044.51f, 36.0363f, 3.07f}, - {3098.95f, -4019.8f, 33.9118f, 3.07f}, - {3073.07f, -4011.42f, 33.9118f, 3.07f}, - {3051.71f, -3993.37f, 33.9118f, 3.02f}, - {3027.52f, -3978.6f, 33.9118f, 3.00f}, - {3003.78f, -3960.14f, 33.9118f, 2.98f}, - {2977.99f, -3941.98f, 31.9118f, 2.96f}, - {2964.57f, -3932.07f, 30.9118f, 2.96f}, - {2947.9f, -3921.31f, 29.9118f, 2.96f}, - {2924.91f, -3910.8f, 29.9118f, 2.94f}, - {2903.04f, -3896.42f, 29.9118f, 2.93f}, - {2884.75f, -3874.03f, 29.9118f, 2.90f}, - {2868.19f, -3851.48f, 29.9118f, 2.82f}, - {2854.62f, -3819.72f, 29.9118f, 2.80f}, - {2825.53f, -3790.4f, 29.9118f, 2.744f}, - {2804.31f, -3773.05f, 29.9118f, 2.71f}, - {2769.78f, -3763.57f, 29.9118f, 2.70f}, - {2727.23f, -3745.92f, 30.9118f, 2.69f}, - {2680.12f, -3737.49f, 30.9118f, 2.67f}, - {2647.62f, -3739.94f, 30.9118f, 2.66f}, - {2616.6f, -3745.75f, 30.9118f, 2.64f}, - {2589.38f, -3731.97f, 30.9118f, 2.61f}, - {2562.94f, -3722.35f, 31.9118f, 2.56f}, - {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}, - {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}, - {2075.73f, -3643.59f, 31.9118f, 3.22f}, - {2033.59f, -3649.52f, 31.9118f, 3.42f}, - {1985.22f, -3662.99f, 31.9118f, 3.42f}, - {1927.09f, -3679.56f, 33.9118f, 3.42f}, - {1873.57f, -3695.32f, 33.9118f, 3.44f} -}; - -class mob_rizzle_sprysprocket : public CreatureScript -{ -public: - mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - 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(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000; - CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - 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 - { - return new mob_rizzle_sprysprocketAI (creature); - } - - struct mob_rizzle_sprysprocketAI : public ScriptedAI - { - mob_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() - { - SpellEscapeTimer = 1300; - TeleportTimer = 3500; - CheckTimer = 10000; - GrenadeTimer = 30000; - MustDieTimer = 3000; - CurrWP = 0; - - PlayerGUID = 0; - - MustDie = false; - Escape = false; - ContinueWP = false; - Reached = false; - } - - void UpdateAI(const uint32 diff) - { - if (MustDie) - { - if (MustDieTimer <= diff) - { - me->DespawnOrUnsummon(); - return; - } else MustDieTimer -= diff; - } - - if (!Escape) - { - if (!PlayerGUID) - return; - - if (SpellEscapeTimer <= diff) - { - DoCast(me, SPELL_RIZZLE_ESCAPE, false); - SpellEscapeTimer = 10000; - } else SpellEscapeTimer -= diff; - - if (TeleportTimer <= diff) - { - // temp solution - unit can't be teleported by core using spelleffect 5, only players - DoTeleportTo(3706.39f, -3969.15f, 35.9118f); - - //begin swimming and summon depth charges - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - return; - - Talk(MSG_ESCAPE_NOTICE, player->GetGUID()); - 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]); - Escape = true; - } else TeleportTimer -= diff; - - return; - } - - if (ContinueWP) - { - me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); - ContinueWP = false; - } - - if (GrenadeTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player) - { - Talk(SAY_RIZZLE_GRENADE, player->GetGUID()); - DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); - } - GrenadeTimer = 30000; - } else GrenadeTimer -= diff; - - if (CheckTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - { - me->DespawnOrUnsummon(); - return; - } - - if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached) - { - Talk(SAY_RIZZLE_FINAL); - me->SetUInt32Value(UNIT_NPC_FLAGS, 1); - me->setFaction(35); - me->GetMotionMaster()->MoveIdle(); - me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); - Reached = true; - } - - CheckTimer = 1000; - } else CheckTimer -= diff; - - } - - void SendText(int32 iTextEntry, Player* player) - { - LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); - const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx); - sWorld->SendServerMessage(SERVER_MSG_STRING, text, player); - } - - void AttackStart(Unit* who) - { - if (!who || PlayerGUID) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->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*/) {} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 57) - { - me->DespawnOrUnsummon(); - return; - } - - ++CurrWP; - ContinueWP = true; - } - }; -}; - -/*#### -# mob_depth_charge -####*/ -class mob_depth_charge : public CreatureScript -{ -public: - mob_depth_charge() : CreatureScript("mob_depth_charge") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_depth_chargeAI (creature); - } - - struct mob_depth_chargeAI : public ScriptedAI - { - mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} - - bool WeMustDie; - uint32 WeMustDieTimer; - - void Reset() - { - me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - WeMustDie = false; - WeMustDieTimer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (WeMustDie) - { - if (WeMustDieTimer <= diff) - me->DespawnOrUnsummon(); - else - WeMustDieTimer -= diff; - } - return; - } - - void MoveInLineOfSight(Unit* who) - { - if (!who) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) - { - DoCast(who, SPELL_DEPTH_CHARGE_TRAP); - WeMustDie = true; - return; - } - } - - void AttackStart(Unit* /*who*/) {} - - void EnterCombat(Unit* /*who*/) {} - }; -}; - -void AddSC_azshara() -{ - new mobs_spitelashes(); - new npc_loramus_thalipedes(); - new mob_rizzle_sprysprocket(); - new mob_depth_charge(); -} diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp deleted file mode 100644 index 4b03cd65cad..00000000000 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ /dev/null @@ -1,770 +0,0 @@ - /* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Azuremyst_Isle -SD%Complete: 75 -SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. -SDCategory: Azuremyst Isle -EndScriptData */ - -/* ContentData -npc_draenei_survivor -npc_engineer_spark_overgrind -npc_injured_draenei -npc_magwin -npc_geezle -go_ravager_cage -npc_death_ravager -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "ScriptedGossip.h" -#include "Cell.h" -#include "CellImpl.h" -#include "GridNotifiers.h" - -/*###### -## npc_draenei_survivor -######*/ - -enum draeneiSurvivor -{ - SAY_HEAL = 0, - - SAY_HELP = 1, - - SPELL_IRRIDATION = 35046, - SPELL_STUNNED = 28630 -}; - -class npc_draenei_survivor : public CreatureScript -{ -public: - npc_draenei_survivor() : CreatureScript("npc_draenei_survivor") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_draenei_survivorAI (creature); - } - - struct npc_draenei_survivorAI : public ScriptedAI - { - npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 pCaster; - - uint32 SayThanksTimer; - uint32 RunAwayTimer; - uint32 SayHelpTimer; - - bool CanSayHelp; - - void Reset() - { - pCaster = 0; - - SayThanksTimer = 0; - RunAwayTimer = 0; - SayHelpTimer = 10000; - - CanSayHelp = true; - - DoCast(me, SPELL_IRRIDATION, true); - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - me->SetHealth(me->CountPctFromMaxHealth(10)); - me->SetStandState(UNIT_STAND_STATE_SLEEP); - } - - void EnterCombat(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit* who) - { - if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 25.0f)) - { - //Random switch between 4 texts - Talk(SAY_HELP, who->GetGUID()); - - SayHelpTimer = 20000; - CanSayHelp = false; - } - } - - void SpellHit(Unit* Caster, const SpellInfo* Spell) - { - if (Spell->SpellFamilyFlags[2] & 0x080000000) - { - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - me->SetStandState(UNIT_STAND_STATE_STAND); - - DoCast(me, SPELL_STUNNED, true); - - pCaster = Caster->GetGUID(); - - SayThanksTimer = 5000; - } - } - - void UpdateAI(const uint32 diff) - { - if (SayThanksTimer) - { - if (SayThanksTimer <= diff) - { - me->RemoveAurasDueToSpell(SPELL_IRRIDATION); - - if (Player* player = Unit::GetPlayer(*me, pCaster)) - { - Talk(SAY_HEAL, player->GetGUID()); - - player->TalkedToCreature(me->GetEntry(), me->GetGUID()); - } - - me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f); - - RunAwayTimer = 10000; - SayThanksTimer = 0; - } else SayThanksTimer -= diff; - - return; - } - - if (RunAwayTimer) - { - if (RunAwayTimer <= diff) - me->DespawnOrUnsummon(); - else - RunAwayTimer -= diff; - - return; - } - - if (SayHelpTimer <= diff) - { - CanSayHelp = true; - SayHelpTimer = 20000; - } else SayHelpTimer -= diff; - } - }; - -}; - -/*###### -## npc_engineer_spark_overgrind -######*/ - -enum Overgrind -{ - SAY_TEXT = 0, - SAY_EMOTE = 1, - ATTACK_YELL = 2, - - AREA_COVE = 3579, - AREA_ISLE = 3639, - QUEST_GNOMERCY = 9537, - FACTION_HOSTILE = 14, - SPELL_DYNAMITE = 7978 -}; - -#define GOSSIP_FIGHT "Traitor! You will be brought to justice!" - -class npc_engineer_spark_overgrind : public CreatureScript -{ -public: - npc_engineer_spark_overgrind() : CreatureScript("npc_engineer_spark_overgrind") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_engineer_spark_overgrind::npc_engineer_spark_overgrindAI, creature->AI())->AttackStart(player); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_engineer_spark_overgrindAI (creature); - } - - struct npc_engineer_spark_overgrindAI : public ScriptedAI - { - npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature) - { - NormFaction = creature->getFaction(); - NpcFlags = creature->GetUInt32Value(UNIT_NPC_FLAGS); - - if (creature->GetAreaId() == AREA_COVE || creature->GetAreaId() == AREA_ISLE) - IsTreeEvent = true; - } - - uint32 NormFaction; - uint32 NpcFlags; - - uint32 DynamiteTimer; - uint32 EmoteTimer; - - bool IsTreeEvent; - - void Reset() - { - DynamiteTimer = 8000; - EmoteTimer = urand(120000, 150000); - - me->setFaction(NormFaction); - me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); - - IsTreeEvent = false; - } - - void EnterCombat(Unit* who) - { - Talk(ATTACK_YELL, who->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat() && !IsTreeEvent) - { - if (EmoteTimer <= diff) - { - Talk(SAY_TEXT); - Talk(SAY_EMOTE); - EmoteTimer = urand(120000, 150000); - } else EmoteTimer -= diff; - } - else if (IsTreeEvent) - return; - - if (!UpdateVictim()) - return; - - if (DynamiteTimer <= diff) - { - DoCast(me->getVictim(), SPELL_DYNAMITE); - DynamiteTimer = 8000; - } else DynamiteTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_injured_draenei -######*/ - -class npc_injured_draenei : public CreatureScript -{ -public: - npc_injured_draenei() : CreatureScript("npc_injured_draenei") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_injured_draeneiAI (creature); - } - - struct npc_injured_draeneiAI : public ScriptedAI - { - npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - me->SetHealth(me->CountPctFromMaxHealth(15)); - switch (urand(0, 1)) - { - case 0: - me->SetStandState(UNIT_STAND_STATE_SIT); - break; - - case 1: - me->SetStandState(UNIT_STAND_STATE_SLEEP); - break; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void MoveInLineOfSight(Unit* /*who*/) {} - - void UpdateAI(const uint32 /*diff*/) {} - }; - -}; - -/*###### -## npc_magwin -######*/ - -enum Magwin -{ - SAY_START = 0, - SAY_AGGRO = 1, - SAY_PROGRESS = 2, - SAY_END1 = 3, - SAY_END2 = 4, - EMOTE_HUG = 5, - - QUEST_A_CRY_FOR_SAY_HELP = 9528 -}; - -class npc_magwin : public CreatureScript -{ -public: - npc_magwin() : CreatureScript("npc_magwin") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP) - { - creature->setFaction(113); - if (npc_escortAI* pEscortAI = CAST_AI(npc_escortAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_magwinAI(creature); - } - - struct npc_magwinAI : public npc_escortAI - { - npc_magwinAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 0: - Talk(SAY_START, player->GetGUID()); - break; - case 17: - Talk(SAY_PROGRESS, player->GetGUID()); - break; - case 28: - Talk(SAY_END1, player->GetGUID()); - break; - case 29: - Talk(EMOTE_HUG, player->GetGUID()); - Talk(SAY_END2, player->GetGUID()); - player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); - break; - } - } - } - - void EnterCombat(Unit* who) - { - Talk(SAY_AGGRO, who->GetGUID()); - } - - void Reset() {} - }; - -}; - -/*###### -## npc_geezle -######*/ - -enum Geezle -{ - QUEST_TREES_COMPANY = 9531, - - SPELL_TREE_DISGUISE = 30298, - - GEEZLE_SAY_1 = 0, - SPARK_SAY_2 = 3, - SPARK_SAY_3 = 4, - GEEZLE_SAY_4 = 1, - SPARK_SAY_5 = 5, - SPARK_SAY_6 = 6, - GEEZLE_SAY_7 = 2, - - EMOTE_SPARK = 7, - - MOB_SPARK = 17243, - GO_NAGA_FLAG = 181694 -}; - -Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f}; - -class npc_geezle : public CreatureScript -{ -public: - npc_geezle() : CreatureScript("npc_geezle") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_geezleAI(creature); - } - - struct npc_geezleAI : public ScriptedAI - { - npc_geezleAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 SparkGUID; - - uint8 Step; - uint32 SayTimer; - - bool EventStarted; - - void Reset() - { - SparkGUID = 0; - Step = 0; - StartEvent(); - } - - void EnterCombat(Unit* /*who*/){} - - void StartEvent() - { - Step = 0; - EventStarted = true; - if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) - { - SparkGUID = Spark->GetGUID(); - Spark->setActive(true); - Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - SayTimer = 8000; - } - - uint32 NextStep(uint8 Step) - { - Creature* Spark = Unit::GetCreature(*me, SparkGUID); - if (!Spark) - return 99999999; - - switch (Step) - { - case 0: - Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); - me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); - return 9000; - case 1: - DespawnNagaFlag(true); - Spark->AI()->Talk(EMOTE_SPARK); - return 1000; - case 2: - Talk(GEEZLE_SAY_1, SparkGUID); - Spark->SetInFront(me); - me->SetInFront(Spark); - return 5000; - case 3: - Spark->AI()->Talk(SPARK_SAY_2); - return 7000; - case 4: - Spark->AI()->Talk(SPARK_SAY_3); - return 8000; - case 5: - Talk(GEEZLE_SAY_4, SparkGUID); - return 8000; - case 6: - Spark->AI()->Talk(SPARK_SAY_5); - return 9000; - case 7: - Spark->AI()->Talk(SPARK_SAY_6); - return 8000; - case 8: - Talk(GEEZLE_SAY_7, SparkGUID); - return 2000; - case 9: - me->GetMotionMaster()->MoveTargetedHome(); - Spark->GetMotionMaster()->MovePoint(0, SparkPos); - CompleteQuest(); - return 9000; - case 10: - Spark->DisappearAndDie(); - DespawnNagaFlag(false); - me->DisappearAndDie(); - default: return 99999999; - } - } - - // will complete Tree's company quest for all nearby players that are disguised as trees - void CompleteQuest() - { - float radius = 50.0f; - std::list players; - Trinity::AnyPlayerInObjectRangeCheck checker(me, radius); - Trinity::PlayerListSearcher searcher(me, players, checker); - me->VisitNearbyWorldObject(radius, searcher); - - for (std::list::const_iterator itr = players.begin(); itr != players.end(); ++itr) - if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE)) - (*itr)->KilledMonsterCredit(MOB_SPARK, 0); - } - - void DespawnNagaFlag(bool despawn) - { - std::list FlagList; - me->GetGameObjectListWithEntryInGrid(FlagList, GO_NAGA_FLAG, 100.0f); - - if (!FlagList.empty()) - { - for (std::list::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) - { - if (despawn) - (*itr)->SetLootState(GO_JUST_DEACTIVATED); - else - (*itr)->Respawn(); - } - } - else - sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: FlagList is empty!"); - } - - void UpdateAI(const uint32 diff) - { - if (SayTimer <= diff) - { - if (EventStarted) - SayTimer = NextStep(Step++); - } - else - SayTimer -= diff; - } - }; - -}; - -enum RavegerCage -{ - NPC_DEATH_RAVAGER = 17556, - - SPELL_REND = 13443, - SPELL_ENRAGING_BITE = 30736, - - QUEST_STRENGTH_ONE = 9582 -}; - -class go_ravager_cage : public GameObjectScript -{ -public: - go_ravager_cage() : GameObjectScript("go_ravager_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - go->UseDoorOrButton(); - if (player->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* ravager = go->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true)) - { - ravager->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - ravager->SetReactState(REACT_AGGRESSIVE); - ravager->AI()->AttackStart(player); - } - } - return true; - } -}; - -class npc_death_ravager : public CreatureScript -{ -public: - npc_death_ravager() : CreatureScript("npc_death_ravager") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_death_ravagerAI(creature); - } - - struct npc_death_ravagerAI : public ScriptedAI - { - npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){} - - uint32 RendTimer; - uint32 EnragingBiteTimer; - - void Reset() - { - RendTimer = 30000; - EnragingBiteTimer = 20000; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (RendTimer <= diff) - { - DoCast(me->getVictim(), SPELL_REND); - RendTimer = 30000; - } - else RendTimer -= diff; - - if (EnragingBiteTimer <= diff) - { - DoCast(me->getVictim(), SPELL_ENRAGING_BITE); - EnragingBiteTimer = 15000; - } - else EnragingBiteTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*######## -## Quest: The Prophecy of Akida -########*/ - -enum BristlelimbCage -{ - QUEST_THE_PROPHECY_OF_AKIDA = 9544, - NPC_STILLPINE_CAPITIVE = 17375, - GO_BRISTELIMB_CAGE = 181714, - - CAPITIVE_SAY = 0, - - POINT_INIT = 1, - EVENT_DESPAWN = 1, -}; - -class npc_stillpine_capitive : public CreatureScript -{ - public: - npc_stillpine_capitive() : CreatureScript("npc_stillpine_capitive") { } - - struct npc_stillpine_capitiveAI : public ScriptedAI - { - npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() - { - if (GameObject* cage = me->FindNearestGameObject(GO_BRISTELIMB_CAGE, 5.0f)) - { - cage->SetLootState(GO_JUST_DEACTIVATED); - cage->SetGoState(GO_STATE_READY); - } - _events.Reset(); - _player = NULL; - _movementComplete = false; - } - - void StartMoving(Player* owner) - { - if (owner) - { - Talk(CAPITIVE_SAY, owner->GetGUID()); - _player = owner; - } - Position pos; - me->GetNearPosition(pos, 3.0f, 0.0f); - me->GetMotionMaster()->MovePoint(POINT_INIT, pos); - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE || id != POINT_INIT) - return; - - if (_player) - _player->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); - - _movementComplete = true; - _events.ScheduleEvent(EVENT_DESPAWN, 3500); - } - - void UpdateAI(uint32 const diff) - { - if (!_movementComplete) - return; - - _events.Update(diff); - - if (_events.ExecuteEvent() == EVENT_DESPAWN) - me->DespawnOrUnsummon(); - } - - private: - Player* _player; - EventMap _events; - bool _movementComplete; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_stillpine_capitiveAI(creature); - } -}; - -class go_bristlelimb_cage : public GameObjectScript -{ - public: - go_bristlelimb_cage() : GameObjectScript("go_bristlelimb_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - go->SetGoState(GO_STATE_READY); - if (player->GetQuestStatus(QUEST_THE_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* capitive = go->FindNearestCreature(NPC_STILLPINE_CAPITIVE, 5.0f, true)) - { - go->ResetDoorOrButton(); - CAST_AI(npc_stillpine_capitive::npc_stillpine_capitiveAI, capitive->AI())->StartMoving(player); - return false; - } - } - return true; - } -}; - -void AddSC_azuremyst_isle() -{ - new npc_draenei_survivor(); - new npc_engineer_spark_overgrind(); - new npc_injured_draenei(); - new npc_magwin(); - new npc_geezle(); - new npc_death_ravager(); - new go_ravager_cage(); - new npc_stillpine_capitive(); - new go_bristlelimb_cage(); -} diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/bloodmyst_isle.cpp deleted file mode 100644 index 102a9494a65..00000000000 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Bloodmyst_Isle -SD%Complete: 80 -SDComment: Quest support: 9670, 9756(gossip items text needed). -SDCategory: Bloodmyst Isle -EndScriptData */ - -/* ContentData -mob_webbed_creature -npc_captured_sunhawk_agent -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## mob_webbed_creature -######*/ - -//possible creatures to be spawned -uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; - -class mob_webbed_creature : public CreatureScript -{ -public: - mob_webbed_creature() : CreatureScript("mob_webbed_creature") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_webbed_creatureAI (creature); - } - - struct mob_webbed_creatureAI : public ScriptedAI - { - mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - - void EnterCombat(Unit* /*who*/) {} - - void JustDied(Unit* killer) - { - uint32 spawnCreatureID = 0; - - switch (urand(0, 2)) - { - case 0: - spawnCreatureID = 17681; - if (Player* player = killer->ToPlayer()) - player->KilledMonsterCredit(spawnCreatureID, 0); - break; - case 1: - case 2: - spawnCreatureID = possibleSpawns[urand(0, 30)]; - break; - } - - if (spawnCreatureID) - me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); - } - }; - -}; - -/*###### -## npc_captured_sunhawk_agent -######*/ - -#define C_SUNHAWK_TRIGGER 17974 - -#define GOSSIP_HELLO_CSA "[PH] " -#define GOSSIP_SELECT_CSA1 "[PH] " -#define GOSSIP_SELECT_CSA2 "[PH] " -#define GOSSIP_SELECT_CSA3 "[PH] " -#define GOSSIP_SELECT_CSA4 "[PH] " -#define GOSSIP_SELECT_CSA5 "[PH] " - -class npc_captured_sunhawk_agent : public CreatureScript -{ -public: - npc_captured_sunhawk_agent() : CreatureScript("npc_captured_sunhawk_agent") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(9137, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(9138, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(9139, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(9140, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(9141, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->CLOSE_GOSSIP_MENU(); - player->TalkedToCreature(C_SUNHAWK_TRIGGER, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_CSA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(9136, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(9134, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## Quest 9667: Saving Princess Stillpine -######*/ - -enum Stillpine -{ - QUEST_SAVING_PRINCESS_STILLPINE = 9667, - NPC_PRINCESS_STILLPINE = 17682, - GO_PRINCESS_STILLPINES_CAGE = 181928, - SPELL_OPENING_PRINCESS_STILLPINE_CREDIT = 31003, - SAY_DIRECTION = 0 -}; - -class go_princess_stillpines_cage : public GameObjectScript -{ -public: - go_princess_stillpines_cage() : GameObjectScript("go_princess_stillpines_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - go->SetGoState(GO_STATE_READY); - if (Creature* stillpine = go->FindNearestCreature(NPC_PRINCESS_STILLPINE, 25, true)) - { - stillpine->GetMotionMaster()->MovePoint(1, go->GetPositionX(), go->GetPositionY()-15, go->GetPositionZ()); - player->CastedCreatureOrGO(NPC_PRINCESS_STILLPINE, 0, SPELL_OPENING_PRINCESS_STILLPINE_CREDIT); - } - return true; - } -}; - -class npc_princess_stillpine : public CreatureScript -{ -public: - npc_princess_stillpine() : CreatureScript("npc_princess_stillpine") { } - - struct npc_princess_stillpineAI : public ScriptedAI - { - npc_princess_stillpineAI(Creature* creature) : ScriptedAI(creature) {} - - void MovementInform(uint32 type, uint32 id) - { - if (type == POINT_MOTION_TYPE && id == 1) - { - Talk(SAY_DIRECTION); - me->DespawnOrUnsummon(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_princess_stillpineAI(creature); - } -}; - -void AddSC_bloodmyst_isle() -{ - new mob_webbed_creature(); - new npc_captured_sunhawk_agent(); - new npc_princess_stillpine(); - new go_princess_stillpines_cage(); -} diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/darkshore.cpp deleted file mode 100644 index 09f061148d3..00000000000 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ /dev/null @@ -1,394 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Darkshore -SD%Complete: 100 -SDComment: Quest support: 731, 2078, 5321 -SDCategory: Darkshore -EndScriptData */ - -/* ContentData -npc_kerlonian -npc_prospector_remtravel -npc_threshwackonator -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "ScriptedFollowerAI.h" -#include "Player.h" -#include "SpellInfo.h" - -/*#### -# npc_kerlonian -####*/ - -enum Kerlonian -{ - SAY_KER_START = 0, - EMOTE_KER_SLEEP = 1, - SAY_KER_SLEEP = 2, - SAY_KER_ALERT_1 = 3, - SAY_KER_END = 4, - EMOTE_KER_AWAKEN = 5, - - SPELL_SLEEP_VISUAL = 25148, - SPELL_AWAKEN = 17536, - QUEST_SLEEPER_AWAKENED = 5321, - NPC_LILADRIS = 11219, //attackers entries unknown - FACTION_KER_ESCORTEE = 113 -}; - -//TODO: make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. -class npc_kerlonian : public CreatureScript -{ -public: - npc_kerlonian() : CreatureScript("npc_kerlonian") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED) - { - if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - creature->AI()->Talk(SAY_KER_START, player->GetGUID()); - pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kerlonianAI(creature); - } - - struct npc_kerlonianAI : public FollowerAI - { - npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } - - uint32 FallAsleepTimer; - - void Reset() - { - FallAsleepTimer = urand(10000, 45000); - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me); - - Talk(SAY_KER_END); - } - - SetFollowComplete(); - } - } - } - - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN) - ClearSleeping(); - } - - void SetSleeping() - { - SetFollowPaused(true); - - Talk(EMOTE_KER_SLEEP); - - Talk(SAY_KER_SLEEP); - - me->SetStandState(UNIT_STAND_STATE_SLEEP); - DoCast(me, SPELL_SLEEP_VISUAL, false); - } - - void ClearSleeping() - { - me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL); - me->SetStandState(UNIT_STAND_STATE_STAND); - - Talk(EMOTE_KER_AWAKEN); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (!HasFollowState(STATE_FOLLOW_INPROGRESS)) - return; - - if (!HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FallAsleepTimer <= Diff) - { - SetSleeping(); - FallAsleepTimer = urand(25000, 90000); - } - else - FallAsleepTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*#### -# npc_prospector_remtravel -####*/ - -enum Remtravel -{ - SAY_REM_START = 0, - SAY_REM_AGGRO = 1, - SAY_REM_RAMP1_1 = 2, - SAY_REM_RAMP1_2 = 3, - SAY_REM_BOOK = 4, - SAY_REM_TENT1_1 = 5, - SAY_REM_TENT1_2 = 6, - SAY_REM_MOSS = 7, - EMOTE_REM_MOSS = 8, - SAY_REM_MOSS_PROGRESS = 9, - SAY_REM_PROGRESS = 10, - SAY_REM_REMEMBER = 11, - EMOTE_REM_END = 12, - - FACTION_ESCORTEE = 10, - QUEST_ABSENT_MINDED_PT2 = 731, - NPC_GRAVEL_SCOUT = 2158, - NPC_GRAVEL_BONE = 2159, - NPC_GRAVEL_GEO = 2160 -}; - -class npc_prospector_remtravel : public CreatureScript -{ -public: - npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID()); - - creature->setFaction(FACTION_ESCORTEE); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_prospector_remtravelAI(creature); - } - - struct npc_prospector_remtravelAI : public npc_escortAI - { - npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 0: - Talk(SAY_REM_START, player->GetGUID()); - break; - case 5: - Talk(SAY_REM_RAMP1_1, player->GetGUID()); - break; - case 6: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - Talk(SAY_REM_RAMP1_2, player->GetGUID()); - break; - case 14: - //depend quest rewarded? - Talk(SAY_REM_BOOK, player->GetGUID()); - break; - case 15: - Talk(SAY_REM_TENT1_1, player->GetGUID()); - break; - case 16: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 17: - Talk(SAY_REM_TENT1_2, player->GetGUID()); - break; - case 26: - Talk(SAY_REM_MOSS, player->GetGUID()); - break; - case 27: - Talk(EMOTE_REM_MOSS, player->GetGUID()); - break; - case 28: - Talk(SAY_REM_MOSS_PROGRESS, player->GetGUID()); - break; - case 29: - DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 31: - Talk(SAY_REM_PROGRESS, player->GetGUID()); - break; - case 41: - Talk(SAY_REM_REMEMBER, player->GetGUID()); - break; - case 42: - Talk(EMOTE_REM_END, player->GetGUID()); - player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); - break; - } - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - if (urand(0, 1)) - Talk(SAY_REM_AGGRO, who->GetGUID()); - } - - void JustSummoned(Creature* /*pSummoned*/) - { - //unsure if it should be any - //pSummoned->AI()->AttackStart(me); - } - }; - -}; - -/*#### -# npc_threshwackonator -####*/ - -enum Threshwackonator -{ - EMOTE_START = 0, - SAY_AT_CLOSE = 1, - QUEST_GYROMAST_REV = 2078, - NPC_GELKAK = 6667, - FACTION_HOSTILE = 14 -}; - -#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" - -class npc_threshwackonator : public CreatureScript -{ -public: - npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - - if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI())) - { - creature->AI()->Talk(EMOTE_START); - pThreshAI->StartFollow(player); - } - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_threshwackonatorAI(creature); - } - - struct npc_threshwackonatorAI : public FollowerAI - { - npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { } - - void Reset() { } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_GELKAK) - { - if (me->IsWithinDistInMap(who, 10.0f)) - { - Talk(SAY_AT_CLOSE, who->GetGUID()); - DoAtEnd(); - } - } - } - - void DoAtEnd() - { - me->setFaction(FACTION_HOSTILE); - - if (Player* pHolder = GetLeaderForFollower()) - me->AI()->AttackStart(pHolder); - - SetFollowComplete(); - } - }; - -}; - -void AddSC_darkshore() -{ - new npc_kerlonian(); - new npc_prospector_remtravel(); - new npc_threshwackonator(); -} diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/desolace.cpp deleted file mode 100644 index 8f55bb6102c..00000000000 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Desolace -SD%Complete: 100 -SDComment: Quest support: 5561 -SDCategory: Desolace -EndScriptData */ - -/* ContentData -npc_aged_dying_ancient_kodo -go_iruxos -npc_dalinda_malem -go_demon_portal -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" -#include "SpellInfo.h" - -enum DyingKodo -{ - // signed for 9999 - SAY_SMEED_HOME = 0, - - QUEST_KODO = 5561, - - NPC_SMEED = 11596, - NPC_AGED_KODO = 4700, - NPC_DYING_KODO = 4701, - NPC_ANCIENT_KODO = 4702, - NPC_TAMED_KODO = 11627, - - SPELL_KODO_KOMBO_ITEM = 18153, - SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks - SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377, - SPELL_KODO_KOMBO_GOSSIP = 18362 - -}; - -class npc_aged_dying_ancient_kodo : public CreatureScript -{ -public: - npc_aged_dying_ancient_kodo() : CreatureScript("npc_aged_dying_ancient_kodo") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) - { - //the expected quest objective - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - - player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); - creature->GetMotionMaster()->MoveIdle(); - } - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - bool EffectDummyCreature(Unit* pCaster, uint32 spellId, uint32 effIndex, Creature* creatureTarget) - { - //always check spellid and effectindex - if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0) - { - //no effect if player/creature already have aura from spells - if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || creatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) - return true; - - if (creatureTarget->GetEntry() == NPC_AGED_KODO || - creatureTarget->GetEntry() == NPC_DYING_KODO || - creatureTarget->GetEntry() == NPC_ANCIENT_KODO) - { - pCaster->CastSpell(pCaster, SPELL_KODO_KOMBO_PLAYER_BUFF, true); - - creatureTarget->UpdateEntry(NPC_TAMED_KODO); - creatureTarget->CastSpell(creatureTarget, SPELL_KODO_KOMBO_DESPAWN_BUFF, false); - - if (creatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - creatureTarget->GetMotionMaster()->MoveIdle(); - - creatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, creatureTarget->GetFollowAngle()); - } - - //always return true when we are handling this spell and effect - return true; - } - return false; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_aged_dying_ancient_kodoAI(creature); - } - - struct npc_aged_dying_ancient_kodoAI : public ScriptedAI - { - npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); } - - uint32 DespawnTimer; - - void Reset() - { - DespawnTimer = 0; - } - - void MoveInLineOfSight(Unit* who) - { - if (who->GetEntry() == NPC_SMEED) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return; - - if (me->IsWithinDistInMap(who, 10.0f)) - { - if (Creature* talker = who->ToCreature()) - talker->AI()->Talk(SAY_SMEED_HOME); - - //spell have no implemented effect (dummy), so useful to notify spellHit - DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true); - } - } - } - - void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell) - { - if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) - { - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DespawnTimer = 60000; - } - } - - void UpdateAI(const uint32 diff) - { - //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. - if (DespawnTimer && DespawnTimer <= diff) - { - if (!me->getVictim() && me->isAlive()) - { - Reset(); - me->setDeathState(JUST_DIED); - me->Respawn(); - return; - } - } else DespawnTimer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## go_iruxos -## Hand of Iruxos -######*/ - -enum Iruxos -{ - QUEST_HAND_IRUXOS = 5381, - NPC_DEMON_SPIRIT = 11876, -}; - -class go_iruxos : public GameObjectScript -{ - public: - go_iruxos() : GameObjectScript("go_iruxos") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_HAND_IRUXOS) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_SPIRIT, 25.0f, true)) - player->SummonCreature(NPC_DEMON_SPIRIT, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - return true; - } -}; - -/*###### -## npc_dalinda_malem. Quest 1440 -######*/ - -enum Dalinda -{ - QUEST_RETURN_TO_VAHLARRIEL = 1440 -}; - -class npc_dalinda : public CreatureScript -{ -public: - npc_dalinda() : CreatureScript("npc_dalinda") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI())) - { - pEscortAI->Start(true, false, player->GetGUID()); - creature->setFaction(113); - } - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_dalindaAI(creature); - } - - struct npc_dalindaAI : public npc_escortAI - { - npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - - switch (waypointId) - { - case 1: - me->IsStandState(); - break; - case 15: - if (player) - player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); - break; - } - } - - void EnterCombat(Unit* /*who*/) { } - - void Reset() {} - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); - return; - } - - void UpdateAI(const uint32 Diff) - { - npc_escortAI::UpdateAI(Diff); - if (!UpdateVictim()) - return; - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## go_demon_portal -######*/ - -enum DemonPortal -{ - NPC_DEMON_GUARDIAN = 11937, - - QUEST_PORTAL_OF_THE_LEGION = 5581, -}; - -class go_demon_portal : public GameObjectScript -{ - public: - go_demon_portal() : GameObjectScript("go_demon_portal") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_PORTAL_OF_THE_LEGION) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_GUARDIAN, 5.0f, true)) - { - if (Creature* guardian = player->SummonCreature(NPC_DEMON_GUARDIAN, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0)) - guardian->AI()->AttackStart(player); - } - - return true; - } -}; - -void AddSC_desolace() -{ - new npc_aged_dying_ancient_kodo(); - new go_iruxos(); - new npc_dalinda(); - new go_demon_portal(); -} diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/durotar.cpp deleted file mode 100644 index fa6b830c1ae..00000000000 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ /dev/null @@ -1,589 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "Vehicle.h" -#include "SpellScript.h" -#include "Player.h" - -/*###### -##Quest 5441: Lazy Peons -##npc_lazy_peon -######*/ - -enum LazyPeonYells -{ - SAY_SPELL_HIT = 0 -}; - -enum LazyPeon -{ - QUEST_LAZY_PEONS = 5441, - GO_LUMBERPILE = 175784, - SPELL_BUFF_SLEEP = 17743, - SPELL_AWAKEN_PEON = 19938 -}; - -class npc_lazy_peon : public CreatureScript -{ -public: - npc_lazy_peon() : CreatureScript("npc_lazy_peon") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lazy_peonAI(creature); - } - - struct npc_lazy_peonAI : public ScriptedAI - { - npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 PlayerGUID; - - uint32 RebuffTimer; - bool work; - - void Reset() - { - PlayerGUID = 0; - RebuffTimer = 0; - work = false; - } - - void MovementInform(uint32 /*type*/, uint32 id) - { - if (id == 1) - work = true; - } - - void SpellHit(Unit* caster, const SpellInfo* spell) - { - if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER - && CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE) - { - caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); - Talk(SAY_SPELL_HIT, caster->GetGUID()); - 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 Diff) - { - if (work == true) - me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD); - if (RebuffTimer <= Diff) - { - DoCast(me, SPELL_BUFF_SLEEP); - RebuffTimer = 300000; //Rebuff agian in 5 minutes - } - else - RebuffTimer -= Diff; - if (!UpdateVictim()) - return; - DoMeleeAttackIfReady(); - } - }; -}; - -enum Texts -{ - // Tiger Matriarch Credit - SAY_MATRIARCH_AGGRO = 0, - - // Troll Volunteer - SAY_VOLUNTEER_START = 0, - SAY_VOLUNTEER_END = 1, -}; - -enum Spells -{ - // Tiger Matriarch Credit - SPELL_SUMMON_MATRIARCH = 75187, - SPELL_NO_SUMMON_AURA = 75213, - SPELL_DETECT_INVIS = 75180, - SPELL_SUMMON_ZENTABRA_TRIGGER = 75212, - - // Tiger Matriarch - SPELL_POUNCE = 61184, - SPELL_FURIOUS_BITE = 75164, - SPELL_SUMMON_ZENTABRA = 75181, - SPELL_SPIRIT_OF_THE_TIGER_RIDER = 75166, - SPELL_EJECT_PASSENGERS = 50630, - - // Troll Volunteer - SPELL_VOLUNTEER_AURA = 75076, - SPELL_PETACT_AURA = 74071, - SPELL_QUEST_CREDIT = 75106, - SPELL_MOUNTING_CHECK = 75420, - SPELL_TURNIN = 73953, - SPELL_AOE_TURNIN = 75107, - - // Vol'jin War Drums - SPELL_MOTIVATE_1 = 75088, - SPELL_MOTIVATE_2 = 75086, -}; - -enum Creatures -{ - // Tiger Matriarch Credit - NPC_TIGER_VEHICLE = 40305, - - // Troll Volunteer - NPC_URUZIN = 40253, - NPC_VOLUNTEER_1 = 40264, - NPC_VOLUNTEER_2 = 40260, - - // Vol'jin War Drums - NPC_CITIZEN_1 = 40256, - NPC_CITIZEN_2 = 40257, -}; - -enum Events -{ - // Tiger Matriarch Credit - EVENT_CHECK_SUMMON_AURA = 1, - - // Tiger Matriarch - EVENT_POUNCE = 2, - EVENT_NOSUMMON = 3, -}; - -enum Points -{ - POINT_URUZIN = 4026400, -}; - -class npc_tiger_matriarch_credit : public CreatureScript -{ - public: - npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { } - - struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI - { - npc_tiger_matriarch_creditAI(Creature* creature) : Scripted_NoMovementAI(creature) - { - events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); - } - - void UpdateAI(uint32 const diff) - { - events.Update(diff); - - if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA) - { - std::list tigers; - GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f); - if (!tigers.empty()) - { - for (std::list::iterator itr = tigers.begin(); itr != tigers.end(); ++itr) - { - if (!(*itr)->isSummon()) - continue; - - if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner()) - if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER) - && !summoner->isInCombat()) - { - me->AddAura(SPELL_NO_SUMMON_AURA, summoner); - me->AddAura(SPELL_DETECT_INVIS, summoner); - summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true); - Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID()); - } - } - } - - events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000); - } - } - - private: - EventMap events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tiger_matriarch_creditAI(creature); - } -}; - -class npc_tiger_matriarch : public CreatureScript -{ - public: - npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {} - - struct npc_tiger_matriarchAI : public ScriptedAI - { - npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature), - _tigerGuid(0) - { - } - - void EnterCombat(Unit* /*target*/) - { - _events.Reset(); - _events.ScheduleEvent(EVENT_POUNCE, 100); - _events.ScheduleEvent(EVENT_NOSUMMON, 50000); - } - - void IsSummonedBy(Unit* summoner) - { - if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle()) - return; - - _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); - if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) - { - me->AddThreat(tiger, 500000.0f); - DoCast(me, SPELL_FURIOUS_BITE); - } - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon()) - return; - - if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner()) - { - vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); - vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); - vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); - vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); - } - me->DespawnOrUnsummon(); - } - - void DamageTaken(Unit* attacker, uint32& damage) - { - if (!attacker->isSummon()) - return; - - if (HealthBelowPct(20)) - { - damage = 0; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner()) - { - vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner); - vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true); - attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true); - vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); - vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); - vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); - vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); - } - - me->DespawnOrUnsummon(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!_tigerGuid) - return; - - _events.Update(diff); - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_POUNCE: - DoCastVictim(SPELL_POUNCE); - _events.ScheduleEvent(EVENT_POUNCE, 30000); - break; - case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA - if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) - { - if (tiger->isSummon()) - if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner()) - me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); - } - _events.ScheduleEvent(EVENT_NOSUMMON, 50000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap _events; - uint64 _tigerGuid; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tiger_matriarchAI(creature); - } -}; - -// These models was found in sniff. -// TODO: generalize these models with race from dbc -uint32 const trollmodel[] = -{11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701, -15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357, -4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768}; - -class npc_troll_volunteer : public CreatureScript -{ - public: - npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { } - - struct npc_troll_volunteerAI : public ScriptedAI - { - npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) - { - } - - void InitializeAI() - { - if (me->isDead() || !me->GetOwner()) - return; - - Reset(); - - switch (urand(0, 3)) - { - case 0: - _mountModel = 6471; - break; - case 1: - _mountModel = 6473; - break; - case 2: - _mountModel = 6469; - break; - default: - _mountModel = 6472; - break; - } - me->SetDisplayId(trollmodel[urand(0, 39)]); - if (Player* player = me->GetOwner()->ToPlayer()) - me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f); - } - - void Reset() - { - _complete = false; - me->AddAura(SPELL_VOLUNTEER_AURA, me); - me->AddAura(SPELL_MOUNTING_CHECK, me); - DoCast(me, SPELL_PETACT_AURA); - me->SetReactState(REACT_PASSIVE); - Talk(SAY_VOLUNTEER_START); - } - - // This is needed for mount check aura to know what mountmodel the npc got stored - uint32 GetMountId() - { - return _mountModel; - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - if (id == POINT_URUZIN) - me->DespawnOrUnsummon(); - } - - void SpellHit(Unit* caster, SpellInfo const* spell) - { - if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete) - { - _complete = true; // Preventing from giving credit twice - DoCast(me, SPELL_TURNIN); - DoCast(me, SPELL_QUEST_CREDIT); - me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK); - me->Dismount(); - Talk(SAY_VOLUNTEER_END); - me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ()); - } - } - - private: - uint32 _mountModel; - bool _complete; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_troll_volunteerAI(creature); - } -}; - -typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI; - -class spell_mount_check : public SpellScriptLoader -{ - public: - spell_mount_check() : SpellScriptLoader("spell_mount_check") {} - - class spell_mount_check_AuraScript : public AuraScript - { - PrepareAuraScript(spell_mount_check_AuraScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK)) - return false; - return true; - } - - void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) - { - Unit* target = GetTarget(); - Unit* owner = target->GetOwner(); - - if (!owner) - return; - - if (owner->IsMounted() && !target->IsMounted()) - { - if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI())) - target->Mount(volunteerAI->GetMountId()); - } - else if (!owner->IsMounted() && target->IsMounted()) - target->Dismount(); - - target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN)); - target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK)); - } - - void Register() - { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_mount_check_AuraScript(); - } -}; - -class spell_voljin_war_drums : public SpellScriptLoader -{ - public: - spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") {} - - class spell_voljin_war_drums_SpellScript : public SpellScript - { - PrepareSpellScript(spell_voljin_war_drums_SpellScript) - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - Unit* caster = GetCaster(); - if (Unit* target = GetHitUnit()) - { - uint32 motivate = 0; - if (target->GetEntry() == NPC_CITIZEN_1) - motivate = SPELL_MOTIVATE_1; - else if (target->GetEntry() == NPC_CITIZEN_2) - motivate = SPELL_MOTIVATE_2; - if (motivate) - caster->CastSpell(target, motivate, false); - } - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_voljin_war_drums_SpellScript(); - } -}; - -enum VoodooSpells -{ - SPELL_BREW = 16712, // Special Brew - SPELL_GHOSTLY = 16713, // Ghostly - SPELL_HEX1 = 16707, // Hex - SPELL_HEX2 = 16708, // Hex - SPELL_HEX3 = 16709, // Hex - SPELL_GROW = 16711, // Grow - SPELL_LAUNCH = 16716, // Launch (Whee!) -}; - -// 17009 -class spell_voodoo : public SpellScriptLoader -{ - public: - spell_voodoo() : SpellScriptLoader("spell_voodoo") {} - - class spell_voodoo_SpellScript : public SpellScript - { - PrepareSpellScript(spell_voodoo_SpellScript) - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) || - !sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) || - !sSpellMgr->GetSpellInfo(SPELL_HEX3) || !sSpellMgr->GetSpellInfo(SPELL_GROW) || - !sSpellMgr->GetSpellInfo(SPELL_LAUNCH)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex /*effIndex*/) - { - uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH); - if (Unit* target = GetHitUnit()) - GetCaster()->CastSpell(target, spellid, false); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_voodoo_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_voodoo_SpellScript(); - } -}; - -void AddSC_durotar() -{ - new npc_lazy_peon(); - new npc_tiger_matriarch_credit(); - new npc_tiger_matriarch(); - new npc_troll_volunteer(); - new spell_mount_check(); - new spell_voljin_war_drums(); - new spell_voodoo(); -} diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp deleted file mode 100644 index 37941227c78..00000000000 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ /dev/null @@ -1,780 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Dustwallow_Marsh -SD%Complete: 95 -SDComment: Quest support: 11180, 558, 11126, 11142, 11174, Vendor Nat Pagle -SDCategory: Dustwallow Marsh -EndScriptData */ - -/* ContentData -mobs_risen_husk_spirit -npc_lady_jaina_proudmoore -npc_nat_pagle -npc_private_hendel -npc_cassa_crimsonwing - handled by npc_taxi -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "ScriptedGossip.h" -#include "SpellScript.h" -#include "Player.h" -#include "WorldSession.h" - -/*###### -## mobs_risen_husk_spirit -######*/ - -enum HauntingWitchHill -{ - // Quest - QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, - - // General spells - SPELL_SUMMON_RESTLESS_APPARITION = 42511, - SPELL_WITCH_HILL_INFORMATION_CREDIT = 42512, - - // Risen Husk specific - SPELL_CONSUME_FLESH = 37933, - NPC_RISEN_HUSK = 23555, - - // Risen Spirit specific - SPELL_INTANGIBLE_PRESENCE = 43127, - NPC_RISEN_SPIRIT = 23554, - - // Events - EVENT_CONSUME_FLESH = 0, - EVENT_INTANGIBLE_PRESENCE = 1, -}; - -class mobs_risen_husk_spirit : public CreatureScript -{ - public: - mobs_risen_husk_spirit() : CreatureScript("mobs_risen_husk_spirit") { } - - struct mobs_risen_husk_spiritAI : public ScriptedAI - { - mobs_risen_husk_spiritAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - events.Reset(); - if (me->GetEntry() == NPC_RISEN_HUSK) - events.ScheduleEvent(EVENT_CONSUME_FLESH, 5000); - else if (me->GetEntry() == NPC_RISEN_SPIRIT) - events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 5000); - } - - void JustDied(Unit* killer) - { - if (killer->GetTypeId() == TYPEID_PLAYER) - { - if (killer->ToPlayer()->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) - { - DoCast(me, SPELL_SUMMON_RESTLESS_APPARITION, true); - DoCast(killer, SPELL_WITCH_HILL_INFORMATION_CREDIT, true); - } - } - } - - void UpdateAI(uint32 const diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_CONSUME_FLESH: - DoCastVictim(SPELL_CONSUME_FLESH); - events.ScheduleEvent(EVENT_CONSUME_FLESH, 15000); - break; - case EVENT_INTANGIBLE_PRESENCE: - DoCastVictim(SPELL_INTANGIBLE_PRESENCE); - events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 15000); - break; - default: - break; - } - } - - DoMeleeAttackIfReady(); - } - - private: - EventMap events; - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_risen_husk_spiritAI (creature); - } -}; - -/*###### -## npc_theramor_guard -######*/ - -enum TheramoreGuard -{ - QUEST_DISCREDITING_THE_DESERTERS = 11133, - - NPC_THERAMORE_GUARD = 4979, - - SPELL_DOCTORED_LEAFLET = 42725, - SPELL_PROPAGANDIZED = 42246, - - SAY_QUEST1 = 0, - SAY_QUEST2 = 1, - SAY_QUEST3 = 2 -}; - -#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?" - -class npc_theramore_guard : public CreatureScript -{ -public: - npc_theramore_guard() : CreatureScript("npc_theramore_guard") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - - if (action == GOSSIP_SENDER_INFO) - { - player->CLOSE_GOSSIP_MENU(); - player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); - creature->AI()->Talk(SAY_QUEST1); - creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); - creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; - CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_theramore_guardAI(creature); - } - - struct npc_theramore_guardAI : public ScriptedAI - { - npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 YellTimer; - uint32 Step; - bool bYellTimer; - - void Reset() - { - bYellTimer = false; - Step = 0; - } - - void UpdateAI(const uint32 Diff) - { - if (!me->HasAura(SPELL_PROPAGANDIZED)) - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - if (bYellTimer && YellTimer <= Diff) - { - switch (Step) - { - case 0: - Talk(SAY_QUEST2); - YellTimer = 3000; - ++Step; - break; - case 1: - Talk(SAY_QUEST3); - me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); - Step = 0; - bYellTimer = false; - break; - } - } - else - YellTimer -= Diff; - } - }; -}; - -/*###### -## npc_lady_jaina_proudmoore -######*/ - -enum LadyJaina -{ - QUEST_JAINAS_AUTOGRAPH = 558, - SPELL_JAINAS_AUTOGRAPH = 23122 -}; - -#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." - -class npc_lady_jaina_proudmoore : public CreatureScript -{ -public: - npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_SENDER_INFO) - { - player->SEND_GOSSIP_MENU(7012, creature->GetGUID()); - player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_nat_pagle -######*/ - -enum NatPagle -{ - QUEST_NATS_MEASURING_TAPE = 8227 -}; - -class npc_nat_pagle : public CreatureScript -{ -public: - npc_nat_pagle() : CreatureScript("npc_nat_pagle") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(7640, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(7638, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_private_hendel -######*/ - -enum Hendel -{ - SAY_PROGRESS_1_TER = 0, - SAY_PROGRESS_2_HEN = 1, - SAY_PROGRESS_3_TER = 2, - SAY_PROGRESS_4_TER = 3, - EMOTE_SURRENDER = 4, - - QUEST_MISSING_DIPLO_PT16 = 1324, - FACTION_HOSTILE = 168, //guessed, may be different - - NPC_SENTRY = 5184, //helps hendel - NPC_JAINA = 4968, //appears once hendel gives up - NPC_TERVOSH = 4967 -}; - -//TODO: develop this further, end event not created -class npc_private_hendel : public CreatureScript -{ -public: - npc_private_hendel() : CreatureScript("npc_private_hendel") { } - - bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) - creature->setFaction(FACTION_HOSTILE); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_private_hendelAI(creature); - } - - struct npc_private_hendelAI : public ScriptedAI - { - npc_private_hendelAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() - { - me->RestoreFaction(); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &Damage) - { - if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage)) - { - Damage = 0; - - if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) - player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); - - Talk(EMOTE_SURRENDER); - EnterEvadeMode(); - } - } - }; - -}; - -/*###### -## npc_zelfrax -######*/ - -Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; - -enum Zelfrax -{ - SAY_ZELFRAX1 = 0, - SAY_ZELFRAX2 = 1 -}; - -class npc_zelfrax : public CreatureScript -{ -public: - npc_zelfrax() : CreatureScript("npc_zelfrax") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_zelfraxAI(creature); - } - - struct npc_zelfraxAI : public ScriptedAI - { - npc_zelfraxAI(Creature* creature) : ScriptedAI(creature) - { - MoveToDock(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (me->Attack(who, true)) - { - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - if (IsCombatMovementAllowed()) - me->GetMotionMaster()->MoveChase(who); - } - } - - void MovementInform(uint32 Type, uint32 /*Id*/) - { - if (Type != POINT_MOTION_TYPE) - return; - - me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - SetCombatMovement(true); - - if (me->isInCombat()) - if (Unit* unit = me->getVictim()) - me->GetMotionMaster()->MoveChase(unit); - } - - void MoveToDock() - { - SetCombatMovement(false); - me->GetMotionMaster()->MovePoint(0, MovePosition); - Talk(SAY_ZELFRAX1); - Talk(SAY_ZELFRAX2); - } - - void UpdateAI(uint32 const /*Diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_stinky -######*/ - -enum Stinky -{ - QUEST_STINKYS_ESCAPE_H = 1270, - QUEST_STINKYS_ESCAPE_A = 1222, - SAY_QUEST_ACCEPTED = 0, - SAY_STAY_1 = 1, - SAY_STAY_2 = 2, - SAY_STAY_3 = 3, - SAY_STAY_4 = 4, - SAY_STAY_5 = 5, - SAY_STAY_6 = 6, - SAY_QUEST_COMPLETE = 7, - SAY_ATTACKED_1 = 8, - EMOTE_DISAPPEAR = 9 -}; - -class npc_stinky : public CreatureScript -{ -public: - npc_stinky() : CreatureScript("npc_stinky") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_stinkyAI(creature); - } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_STINKYS_ESCAPE_H || quest->GetQuestId() == QUEST_STINKYS_ESCAPE_A) - { - if (npc_stinkyAI* pEscortAI = CAST_AI(npc_stinky::npc_stinkyAI, creature->AI())) - { - creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); - creature->SetStandState(UNIT_STAND_STATE_STAND); - creature->AI()->Talk(SAY_QUEST_ACCEPTED); - pEscortAI->Start(false, false, player->GetGUID()); - } - } - return true; - } - - struct npc_stinkyAI : public npc_escortAI - { - npc_stinkyAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 7: - Talk(SAY_STAY_1, player->GetGUID()); - break; - case 11: - Talk(SAY_STAY_2, player->GetGUID()); - break; - case 25: - Talk(SAY_STAY_3, player->GetGUID()); - break; - case 26: - Talk(SAY_STAY_4, player->GetGUID()); - break; - case 27: - Talk(SAY_STAY_5, player->GetGUID()); - break; - case 28: - Talk(SAY_STAY_6, player->GetGUID()); - me->SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 29: - me->SetStandState(UNIT_STAND_STATE_STAND); - break; - case 37: - Talk(SAY_QUEST_COMPLETE, player->GetGUID()); - me->SetSpeed(MOVE_RUN, 1.2f, true); - me->SetWalk(false); - if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) - player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); - if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) - player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); - break; - case 39: - Talk(EMOTE_DISAPPEAR); - break; - } - } - - void EnterCombat(Unit* who) - { - Talk(SAY_ATTACKED_1, who->GetGUID()); - } - - void Reset() {} - - void JustDied(Unit* /*killer*/) - { - Player* player = GetPlayerForEscort(); - if (player && HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) - player->FailQuest(QUEST_STINKYS_ESCAPE_H); - - if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) - player->FailQuest(QUEST_STINKYS_ESCAPE_A); - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -enum SpellScripts -{ - SPELL_OOZE_ZAP = 42489, - SPELL_OOZE_ZAP_CHANNEL_END = 42485, - SPELL_OOZE_CHANNEL_CREDIT = 42486, - SPELL_ENERGIZED = 42492, -}; - -class spell_ooze_zap : public SpellScriptLoader -{ - public: - spell_ooze_zap() : SpellScriptLoader("spell_ooze_zap") { } - - class spell_ooze_zap_SpellScript : public SpellScript - { - PrepareSpellScript(spell_ooze_zap_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP)) - return false; - return true; - } - - SpellCastResult CheckRequirement() - { - if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue())) - return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct - - if (!GetExplTargetUnit()) - return SPELL_FAILED_BAD_TARGETS; - - return SPELL_CAST_OK; - } - - void HandleDummy(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - if (GetHitUnit()) - GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - OnCheckCast += SpellCheckCastFn(spell_ooze_zap_SpellScript::CheckRequirement); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_ooze_zap_SpellScript(); - } -}; - -class spell_ooze_zap_channel_end : public SpellScriptLoader -{ - public: - spell_ooze_zap_channel_end() : SpellScriptLoader("spell_ooze_zap_channel_end") { } - - class spell_ooze_zap_channel_end_SpellScript : public SpellScript - { - PrepareSpellScript(spell_ooze_zap_channel_end_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP_CHANNEL_END)) - return false; - return true; - } - - void HandleDummy(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - if (Player* player = GetCaster()->ToPlayer()) - player->CastSpell(player, SPELL_OOZE_CHANNEL_CREDIT, true); - GetHitUnit()->Kill(GetHitUnit()); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_channel_end_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_ooze_zap_channel_end_SpellScript(); - } -}; - -class spell_energize_aoe : public SpellScriptLoader -{ - public: - spell_energize_aoe() : SpellScriptLoader("spell_energize_aoe") { } - - class spell_energize_aoe_SpellScript : public SpellScript - { - PrepareSpellScript(spell_energize_aoe_SpellScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_ENERGIZED)) - return false; - return true; - } - - void FilterTargets(std::list& targets) - { - for (std::list::iterator itr = targets.begin(); itr != targets.end();) - { - if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE) - ++itr; - else - targets.erase(itr++); - } - targets.push_back(GetCaster()); - } - - void HandleScript(SpellEffIndex effIndex) - { - PreventHitDefaultEffect(effIndex); - GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); - } - - void Register() - { - OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); - OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_energize_aoe_SpellScript(); - } -}; - -/*###### -## go_blackhoof_cage -######*/ - -enum PrisonersOfTheGrimTotems -{ - NPC_THERAMORE_PRISONER = 23720, - SAY_FREE = 0, -}; - -class go_blackhoof_cage : public GameObjectScript -{ -public: - go_blackhoof_cage() : GameObjectScript("go_blackhoof_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - go->UseDoorOrButton(); - if (Creature* prisoner = go->FindNearestCreature(NPC_THERAMORE_PRISONER, 1.0f)) - { - if (player) - player->KilledMonsterCredit(NPC_THERAMORE_PRISONER, 0); - - prisoner->AI()->Talk(SAY_FREE); // We also emote cry here (handled in creature_text.emote) - prisoner->DespawnOrUnsummon(6000); - } - return true; - } -}; - -void AddSC_dustwallow_marsh() -{ - new mobs_risen_husk_spirit(); - new npc_lady_jaina_proudmoore(); - new npc_nat_pagle(); - new npc_private_hendel(); - new npc_zelfrax(); - new npc_stinky(); - new npc_theramore_guard(); - new spell_ooze_zap(); - new spell_ooze_zap_channel_end(); - new spell_energize_aoe(); - new go_blackhoof_cage(); -} diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/felwood.cpp deleted file mode 100644 index e23eaa961bb..00000000000 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Felwood -SD%Complete: 95 -SDComment: Quest support: 4101, 4102 -SDCategory: Felwood -EndScriptData */ - -/* ContentData -npcs_riverbreeze_and_silversky -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npcs_riverbreeze_and_silversky -######*/ - -#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" - -enum RiverbreezeAndSilversky -{ - SPELL_CENARION_BEACON = 15120, - - NPC_ARATHANDRIS_SILVERSKY = 9528, - NPC_MAYBESS_RIVERBREEZE = 9529, - - QUEST_CLEASING_FELWOOD_A = 4101, - QUEST_CLEASING_FELWOOD_H = 4102 -}; - -class npcs_riverbreeze_and_silversky : public CreatureScript -{ -public: - npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_CENARION_BEACON, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - uint32 creatureId = creature->GetEntry(); - - if (creatureId == NPC_ARATHANDRIS_SILVERSKY) - { - if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); - } else if (player->GetTeam() == HORDE) - player->SEND_GOSSIP_MENU(2845, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); - } - - if (creatureId == NPC_MAYBESS_RIVERBREEZE) - { - if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); - } else if (player->GetTeam() == ALLIANCE) - player->SEND_GOSSIP_MENU(2843, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2842, creature->GetGUID()); - } - - return true; - } -}; - -void AddSC_felwood() -{ - new npcs_riverbreeze_and_silversky(); -} diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/feralas.cpp deleted file mode 100644 index b2326de86ab..00000000000 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Feralas -SD%Complete: 100 -SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer -SDCategory: Feralas -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "ScriptedGossip.h" -#include "SpellScript.h" -#include "Player.h" -#include "WorldSession.h" - -/*###### -## npc_gregan_brewspewer -######*/ - -#define GOSSIP_HELLO "Buy somethin', will ya?" - -class npc_gregan_brewspewer : public CreatureScript -{ -public: - npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(2434, creature->GetGUID()); - } - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(2433, creature->GetGUID()); - return true; - } - -}; - -/*###### -## npc_oox22fe -######*/ - -enum OOX -{ - SAY_OOX_START = 0, - SAY_OOX_AGGRO = 1, - SAY_OOX_AMBUSH = 2, - SAY_OOX_END = 3, - - NPC_YETI = 7848, - NPC_GORILLA = 5260, - NPC_WOODPAW_REAVER = 5255, - NPC_WOODPAW_BRUTE = 5253, - NPC_WOODPAW_ALPHA = 5258, - NPC_WOODPAW_MYSTIC = 5254, - - QUEST_RESCUE_OOX22FE = 2767, - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -class npc_oox22fe : public CreatureScript -{ -public: - npc_oox22fe() : CreatureScript("npc_oox22fe") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RESCUE_OOX22FE) - { - creature->AI()->Talk(SAY_OOX_START); - //change that the npc is not lying dead on the ground - creature->SetStandState(UNIT_STAND_STATE_STAND); - - if (player->GetTeam() == ALLIANCE) - creature->setFaction(FACTION_ESCORTEE_A); - - if (player->GetTeam() == HORDE) - creature->setFaction(FACTION_ESCORTEE_H); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22fe::npc_oox22feAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_oox22feAI(creature); - } - - struct npc_oox22feAI : public npc_escortAI - { - npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - // First Ambush(3 Yetis) - case 11: - Talk(SAY_OOX_AMBUSH); - me->SummonCreature(NPC_YETI, -4841.01f, 1593.91f, 73.42f, 3.98f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_YETI, -4837.61f, 1568.58f, 78.21f, 3.13f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_YETI, -4841.89f, 1569.95f, 76.53f, 0.68f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Second Ambush(3 Gorillas) - case 21: - Talk(SAY_OOX_AMBUSH); - me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - //Third Ambush(4 Gnolls) - case 30: - Talk(SAY_OOX_AMBUSH); - me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14f, 2075.87f, 47.77f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_BRUTE, -4426.68f, 2077.98f, 47.57f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33f, 2080.24f, 47.43f, 3.87f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_WOODPAW_ALPHA, -4430.04f, 2075.54f, 46.83f, 3.81f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - break; - case 37: - Talk(SAY_OOX_END); - // Award quest credit - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); - break; - } - } - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - 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) - Talk(SAY_OOX_AGGRO); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; - -}; - -/*###### -## npc_screecher_spirit -######*/ - -class npc_screecher_spirit : public CreatureScript -{ -public: - npc_screecher_spirit() : CreatureScript("npc_screecher_spirit") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - player->SEND_GOSSIP_MENU(2039, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - return true; - } - -}; - -enum GordunniTrap -{ - GO_GORDUNNI_DIRT_MOUND = 144064, -}; - -class spell_gordunni_trap : public SpellScriptLoader -{ - public: - spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { } - - class spell_gordunni_trap_SpellScript : public SpellScript - { - PrepareSpellScript(spell_gordunni_trap_SpellScript); - - void HandleDummy() - { - if (Unit* caster = GetCaster()) - if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0)) - chest->SetSpellId(GetSpellInfo()->Id); - } - - void Register() - { - OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy); - } - }; - - SpellScript* GetSpellScript() const - { - return new spell_gordunni_trap_SpellScript(); - } -}; - -/*###### -## AddSC -######*/ - -void AddSC_feralas() -{ - new npc_gregan_brewspewer(); - new npc_oox22fe(); - new npc_screecher_spirit(); - new spell_gordunni_trap(); -} diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp deleted file mode 100644 index e41ffae03e6..00000000000 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ /dev/null @@ -1,714 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Moonglade -SD%Complete: 100 -SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. -SDCategory: Moonglade -EndScriptData */ - -/* ContentData -npc_bunthen_plainswind -npc_great_bear_spirit -npc_silva_filnaveth -npc_clintar_spirit -npc_clintar_dreamwalker -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "SpellInfo.h" -#include "Cell.h" -#include "CellImpl.h" -#include "GridNotifiers.h" - -/*###### -## npc_bunthen_plainswind -######*/ - -enum Bunthen -{ - QUEST_SEA_LION_HORDE = 30, - QUEST_SEA_LION_ALLY = 272, - TAXI_PATH_ID_ALLY = 315, - TAXI_PATH_ID_HORDE = 316 -}; - -#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." -#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" - -class npc_bunthen_plainswind : public CreatureScript -{ -public: - npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) - player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_GOSSIP_MENU(5373, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(5376, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->getClass() != CLASS_DRUID) - player->SEND_GOSSIP_MENU(4916, creature->GetGUID()); - else if (player->GetTeam() != HORDE) - { - if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(4917, creature->GetGUID()); - } - else if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(4918, creature->GetGUID()); - } - return true; - } - -}; - -/*###### -## npc_great_bear_spirit -######*/ - -#define GOSSIP_BEAR1 "What do you represent, spirit?" -#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." -#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." -#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." - -class npc_great_bear_spirit : public CreatureScript -{ -public: - npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(4721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(4733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(4734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(4735, creature->GetGUID()); - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5929); - if (player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - player->AreaExploredOrEventHappens(5930); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - //ally or horde quest - if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(4719, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(4718, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_silva_filnaveth -######*/ - -#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." -#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" - -class npc_silva_filnaveth : public CreatureScript -{ -public: - npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->SEND_GOSSIP_MENU(5374, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->SEND_GOSSIP_MENU(5375, creature->GetGUID()); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->getClass() != CLASS_DRUID) - player->SEND_GOSSIP_MENU(4913, creature->GetGUID()); - else if (player->GetTeam() != ALLIANCE) - { - if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(4915, creature->GetGUID()); - } - else if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - player->SEND_GOSSIP_MENU(4914, creature->GetGUID()); - } - return true; - } - -}; - -/*###### -## npc_clintar_spirit -######*/ - -float const Clintar_spirit_WP[41][5] = -{ - //pos_x pos_y pos_z orien waitTime - {7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, - {7476.49f, -3101, 443.457f, 0.89f, 0}, - {7486.57f, -3085.59f, 439.478f, 1.07f, 0}, - {7472.19f, -3085.06f, 443.142f, 3.07f, 0}, - {7456.92f, -3085.91f, 438.862f, 3.24f, 0}, - {7446.68f, -3083.43f, 438.245f, 2.40f, 0}, - {7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, - {7452.41f, -3085.8f, 438.984f, 5.78f, 0}, - {7469.11f, -3084.94f, 443.048f, 6.25f, 0}, - {7483.79f, -3085.44f, 439.607f, 6.25f, 0}, - {7491.14f, -3090.96f, 439.983f, 5.44f, 0}, - {7497.62f, -3098.22f, 436.854f, 5.44f, 0}, - {7498.72f, -3113.41f, 434.596f, 4.84f, 0}, - {7500.06f, -3122.51f, 434.749f, 5.17f, 0}, - {7504.96f, -3131.53f, 434.475f, 4.74f, 0}, - {7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, - {7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, - {7501.99f, -3126.01f, 434.93f, 1.83f, 0}, - {7490.76f, -3114.97f, 434.431f, 2.51f, 0}, - {7479.64f, -3105.51f, 431.123f, 1.83f, 0}, - {7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, - {7472.96f, -3074.18f, 427.566f, 1.57f, 0}, - {7472.25f, -3063, 428.268f, 1.55f, 0}, - {7473.46f, -3054.22f, 427.588f, 0.36f, 0}, - {7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, - {7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, - {7471.81f, -3058.84f, 427.073f, 4.29f, 0}, - {7472.16f, -3064.91f, 427.772f, 4.95f, 0}, - {7471.56f, -3085.36f, 428.924f, 4.72f, 0}, - {7473.56f, -3093.48f, 429.294f, 5.04f, 0}, - {7478.94f, -3104.29f, 430.638f, 5.23f, 0}, - {7484.46f, -3109.61f, 432.769f, 5.79f, 0}, - {7490.23f, -3111.08f, 434.431f, 0.02f, 0}, - {7496.29f, -3108, 434.783f, 1.15f, 0}, - {7497.46f, -3100.66f, 436.191f, 1.50f, 0}, - {7495.64f, -3093.39f, 438.349f, 2.10f, 0}, - {7492.44f, -3086.01f, 440.267f, 1.38f, 0}, - {7498.26f, -3076.44f, 440.808f, 0.71f, 0}, - {7506.4f, -3067.35f, 443.64f, 0.77f, 0}, - {7518.37f, -3057.42f, 445.584f, 0.74f, 0}, - {7517.51f, -3056.3f, 444.568f, 2.49f, 4500} -}; - -Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f}; -Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f}; - -enum ClintarSpirit -{ - ASPECT_RAVEN = 22915, - - // Texts for EnterCombat, the event and the end of the event are missing - CLINTAR_SPIRIT_SAY_START = 0, -}; - -class npc_clintar_spirit : public CreatureScript -{ -public: - npc_clintar_spirit() : CreatureScript("npc_clintar_spirit") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_clintar_spiritAI (creature); - } - - struct npc_clintar_spiritAI : public npc_escortAI - { - public: - npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) - { - PlayerGUID = 0; - } - - uint8 Step; - uint32 CurrWP; - uint32 EventTimer; - uint32 checkPlayerTimer; - - uint64 PlayerGUID; - - bool EventOnWait; - - void Reset() - { - if (!PlayerGUID) - { - Step = 0; - CurrWP = 0; - EventTimer = 0; - PlayerGUID = 0; - checkPlayerTimer = 1000; - EventOnWait = false; - } - } - - void IsSummonedBy(Unit* /*summoner*/) - { - std::list playerOnQuestList; - Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); - Trinity::PlayerListSearcher searcher(me, playerOnQuestList, checker); - me->VisitNearbyWorldObject(5.0f, searcher); - for (std::list::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr) - { - // Check if found player target has active quest - if (Player* player = (*itr)) - { - if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - StartEvent(player); - break; - } - } - else - break; - } - } - - void JustDied(Unit* /*killer*/) - { - if (!PlayerGUID) - return; - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - player->FailQuest(10965); - PlayerGUID = 0; - Reset(); - } - } - - void EnterEvadeMode() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->isInCombat() && player->getAttackerForHelper()) - { - AttackStart(player->getAttackerForHelper()); - return; - } - npc_escortAI::EnterEvadeMode(); - } - - void StartEvent(Player* player) - { - if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) - { - for (uint8 i = 0; i < 41; ++i) - { - AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); - } - PlayerGUID = player->GetGUID(); - Start(true, false, PlayerGUID); - } - return; - } - - void UpdateAI(uint32 const diff) - { - npc_escortAI::UpdateAI(diff); - - if (!PlayerGUID) - { - me->setDeathState(JUST_DIED); - return; - } - - if (!me->isInCombat() && !EventOnWait) - { - if (checkPlayerTimer <= diff) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->isInCombat() && player->getAttackerForHelper()) - AttackStart(player->getAttackerForHelper()); - checkPlayerTimer = 1000; - } else checkPlayerTimer -= diff; - } - - if (EventOnWait && EventTimer <= diff) - { - - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player || (player && player->GetQuestStatus(10965) == QUEST_STATUS_NONE)) - { - me->setDeathState(JUST_DIED); - return; - } - - switch (CurrWP) - { - case 0: - switch (Step) - { - case 0: - Talk(CLINTAR_SPIRIT_SAY_START, PlayerGUID); - EventTimer = 8000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 6: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - // Needs text - EventOnWait = false; - break; - } - break; - case 15: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventOnWait = false; - break; - } - break; - case 16: - switch (Step) - { - case 0: - // Needs text - EventTimer = 15000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 20: - switch (Step) - { - case 0: - if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) - { - mob->AddThreat(me, 10000.0f); - mob->AI()->AttackStart(me); - } - EventTimer = 2000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 24: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); - EventTimer = 5000; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventOnWait = false; - break; - } - break; - case 25: - switch (Step) - { - case 0: - // Needs text - EventTimer = 4000; - Step = 1; - break; - case 1: - EventOnWait = false; - break; - } - break; - case 40: - switch (Step) - { - case 0: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); - // Needs text - player->CompleteQuest(10965); - EventTimer = 1500; - Step = 1; - break; - case 1: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); - EventTimer = 3000; - Step = 2; - break; - case 2: - player->TalkedToCreature(me->GetEntry(), me->GetGUID()); - PlayerGUID = 0; - Reset(); - me->setDeathState(JUST_DIED); - break; - } - break; - default: - EventOnWait = false; - break; - } - - } else if (EventOnWait) EventTimer -= diff; - } - - void WaypointReached(uint32 waypointId) - { - CurrWP = waypointId; - EventTimer = 0; - Step = 0; - EventOnWait = true; - } - }; - -}; - -/*#### -# npc_omen -####*/ - -enum Omen -{ - NPC_OMEN = 15467, - - SPELL_OMEN_CLEAVE = 15284, - SPELL_OMEN_STARFALL = 26540, - SPELL_OMEN_SUMMON_SPOTLIGHT = 26392, - SPELL_ELUNE_CANDLE = 26374, - - GO_ELUNE_TRAP_1 = 180876, - GO_ELUNE_TRAP_2 = 180877, - - EVENT_CAST_CLEAVE = 1, - EVENT_CAST_STARFALL = 2, - EVENT_DESPAWN = 3, -}; - -class npc_omen : public CreatureScript -{ -public: - npc_omen() : CreatureScript("npc_omen") { } - - struct npc_omenAI : public ScriptedAI - { - npc_omenAI(Creature* creature) : ScriptedAI(creature) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f); - } - - EventMap events; - - void MovementInform(uint32 type, uint32 pointId) - { - if (type != POINT_MOTION_TYPE) - return; - - if (pointId == 1) - { - me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - if (Player* player = me->SelectNearestPlayer(40.0f)) - AttackStart(player); - } - } - - void EnterCombat(Unit* /*attacker*/) - { - events.Reset(); - events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(3000, 5000)); - events.ScheduleEvent(EVENT_CAST_STARFALL, urand(8000, 10000)); - } - - void JustDied(Unit* /*killer*/) - { - DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT); - } - - void SpellHit(Unit* /*caster*/, const SpellInfo* spell) - { - if (spell->Id == SPELL_ELUNE_CANDLE) - { - if (me->HasAura(SPELL_OMEN_STARFALL)) - me->RemoveAurasDueToSpell(SPELL_OMEN_STARFALL); - - events.RescheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000)); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - switch (events.ExecuteEvent()) - { - case EVENT_CAST_CLEAVE: - DoCastVictim(SPELL_OMEN_CLEAVE); - events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(8000, 10000)); - break; - case EVENT_CAST_STARFALL: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_OMEN_STARFALL); - events.ScheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000)); - break; - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_omenAI(creature); - } -}; - -class npc_giant_spotlight : public CreatureScript -{ -public: - npc_giant_spotlight() : CreatureScript("npc_giant_spotlight") { } - - struct npc_giant_spotlightAI : public ScriptedAI - { - npc_giant_spotlightAI(Creature* creature) : ScriptedAI(creature) {} - - EventMap events; - - void Reset() - { - events.Reset(); - events.ScheduleEvent(EVENT_DESPAWN, 5*MINUTE*IN_MILLISECONDS); - } - - void UpdateAI(const uint32 diff) - { - events.Update(diff); - - if (events.ExecuteEvent() == EVENT_DESPAWN) - { - if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_1, 5.0f)) - trap->RemoveFromWorld(); - - if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_2, 5.0f)) - trap->RemoveFromWorld(); - - if (Creature* omen = me->FindNearestCreature(NPC_OMEN, 5.0f, false)) - omen->DespawnOrUnsummon(); - - me->DespawnOrUnsummon(); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_giant_spotlightAI(creature); - } -}; - -void AddSC_moonglade() -{ - new npc_bunthen_plainswind(); - new npc_great_bear_spirit(); - new npc_silva_filnaveth(); - new npc_clintar_spirit(); - new npc_omen(); - new npc_giant_spotlight(); -} diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/mulgore.cpp deleted file mode 100644 index aca55284b67..00000000000 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Mulgore -SD%Complete: 100 -SDComment: Support for quest: 11129, 772 -SDCategory: Mulgore -EndScriptData */ - -/* ContentData -npc_skorn_whitecloud -npc_kyle_frenzied -npc_plains_vision -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "SpellInfo.h" - -/*###### -# npc_skorn_whitecloud -######*/ - -#define GOSSIP_SW "Tell me a story, Skorn." - -class npc_skorn_whitecloud : public CreatureScript -{ -public: - npc_skorn_whitecloud() : CreatureScript("npc_skorn_whitecloud") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - player->SEND_GOSSIP_MENU(523, creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (!player->GetQuestRewardStatus(770)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(522, creature->GetGUID()); - - return true; - } - -}; - -/*##### -# npc_kyle_frenzied -######*/ - -enum KyleFrenzied -{ - EMOTE_SEE_LUNCH = 0, - EMOTE_EAT_LUNCH = 1, - EMOTE_DANCE = 2, - - SPELL_LUNCH = 42222, - NPC_KYLE_FRENZIED = 23616, - NPC_KYLE_FRIENDLY = 23622, - POINT_ID = 1 -}; - -class npc_kyle_frenzied : public CreatureScript -{ -public: - npc_kyle_frenzied() : CreatureScript("npc_kyle_frenzied") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kyle_frenziedAI (creature); - } - - struct npc_kyle_frenziedAI : public ScriptedAI - { - npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {} - - bool EventActive; - bool IsMovingToLunch; - uint64 PlayerGUID; - uint32 EventTimer; - uint8 EventPhase; - - void Reset() - { - EventActive = false; - IsMovingToLunch = false; - PlayerGUID = 0; - EventTimer = 5000; - EventPhase = 0; - - if (me->GetEntry() == NPC_KYLE_FRIENDLY) - me->UpdateEntry(NPC_KYLE_FRENZIED); - } - - void SpellHit(Unit* Caster, SpellInfo const* Spell) - { - if (!me->getVictim() && !EventActive && Spell->Id == SPELL_LUNCH) - { - if (Caster->GetTypeId() == TYPEID_PLAYER) - PlayerGUID = Caster->GetGUID(); - - if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - { - me->GetMotionMaster()->MovementExpired(); - me->GetMotionMaster()->MoveIdle(); - me->StopMoving(); - } - - EventActive = true; - Talk(EMOTE_SEE_LUNCH); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); - } - } - - void MovementInform(uint32 Type, uint32 PointId) - { - if (Type != POINT_MOTION_TYPE || !EventActive) - return; - - if (PointId == POINT_ID) - IsMovingToLunch = false; - } - - void UpdateAI(const uint32 diff) - { - if (EventActive) - { - if (IsMovingToLunch) - return; - - if (EventTimer <= diff) - { - EventTimer = 5000; - ++EventPhase; - - switch (EventPhase) - { - case 1: - if (Unit* unit = Unit::GetUnit(*me, PlayerGUID)) - { - if (GameObject* go = unit->GetGameObject(SPELL_LUNCH)) - { - IsMovingToLunch = true; - me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); - } - } - break; - case 2: - Talk(EMOTE_EAT_LUNCH); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); - break; - case 3: - if (Player* unit = Unit::GetPlayer(*me, PlayerGUID)) - unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); - - me->UpdateEntry(NPC_KYLE_FRIENDLY); - break; - case 4: - EventTimer = 30000; - Talk(EMOTE_DANCE); - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); - break; - case 5: - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Reset(); - me->GetMotionMaster()->Clear(); - break; - } - } - else - EventTimer -= diff; - } - } - }; - -}; - -/*##### -# npc_plains_vision -######*/ - -Position const wpPlainVision[50] = -{ - {-2226.32f, -408.095f, -9.36235f, 0.0f}, - {-2203.04f, -437.212f, -5.72498f, 0.0f}, - {-2163.91f, -457.851f, -7.09049f, 0.0f}, - {-2123.87f, -448.137f, -9.29591f, 0.0f}, - {-2104.66f, -427.166f, -6.49513f, 0.0f}, - {-2101.48f, -422.826f, -5.3567f, 0.0f}, - {-2097.56f, -417.083f, -7.16716f, 0.0f}, - {-2084.87f, -398.626f, -9.88973f, 0.0f}, - {-2072.71f, -382.324f, -10.2488f, 0.0f}, - {-2054.05f, -356.728f, -6.22468f, 0.0f}, - {-2051.8f, -353.645f, -5.35791f, 0.0f}, - {-2049.08f, -349.912f, -6.15723f, 0.0f}, - {-2030.6f, -310.724f, -9.59302f, 0.0f}, - {-2002.15f, -249.308f, -10.8124f, 0.0f}, - {-1972.85f, -195.811f, -10.6316f, 0.0f}, - {-1940.93f, -147.652f, -11.7055f, 0.0f}, - {-1888.06f, -81.943f, -11.4404f, 0.0f}, - {-1837.05f, -34.0109f, -12.258f, 0.0f}, - {-1796.12f, -14.6462f, -10.3581f, 0.0f}, - {-1732.61f, -4.27746f, -10.0213f, 0.0f}, - {-1688.94f, -0.829945f, -11.7103f, 0.0f}, - {-1681.32f, 13.0313f, -9.48056f, 0.0f}, - {-1677.04f, 36.8349f, -7.10318f, 0.0f}, - {-1675.2f, 68.559f, -8.95384f, 0.0f}, - {-1676.57f, 89.023f, -9.65104f, 0.0f}, - {-1678.16f, 110.939f, -10.1782f, 0.0f}, - {-1677.86f, 128.681f, -5.73869f, 0.0f}, - {-1675.27f, 144.324f, -3.47916f, 0.0f}, - {-1671.7f, 163.169f, -1.23098f, 0.0f}, - {-1666.61f, 181.584f, 5.26145f, 0.0f}, - {-1661.51f, 196.154f, 8.95252f, 0.0f}, - {-1655.47f, 210.811f, 8.38727f, 0.0f}, - {-1647.07f, 226.947f, 5.27755f, 0.0f}, - {-1621.65f, 232.91f, 2.69579f, 0.0f}, - {-1600.23f, 237.641f, 2.98539f, 0.0f}, - {-1576.07f, 242.546f, 4.66541f, 0.0f}, - {-1554.57f, 248.494f, 6.60377f, 0.0f}, - {-1547.53f, 259.302f, 10.6741f, 0.0f}, - {-1541.7f, 269.847f, 16.4418f, 0.0f}, - {-1539.83f, 278.989f, 21.0597f, 0.0f}, - {-1540.16f, 290.219f, 27.8247f, 0.0f}, - {-1538.99f, 298.983f, 34.0032f, 0.0f}, - {-1540.38f, 307.337f, 41.3557f, 0.0f}, - {-1536.61f, 314.884f, 48.0179f, 0.0f}, - {-1532.42f, 323.277f, 55.6667f, 0.0f}, - {-1528.77f, 329.774f, 61.1525f, 0.0f}, - {-1525.65f, 333.18f, 63.2161f, 0.0f}, - {-1517.01f, 350.713f, 62.4286f, 0.0f}, - {-1511.39f, 362.537f, 62.4539f, 0.0f}, - {-1508.68f, 366.822f, 62.733f, 0.0f} -}; - -class npc_plains_vision : public CreatureScript -{ -public: - npc_plains_vision() : CreatureScript("npc_plains_vision") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_plains_visionAI (creature); - } - - struct npc_plains_visionAI : public ScriptedAI - { - npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {} - - bool newWaypoint; - uint8 WayPointId; - uint8 amountWP; - - void Reset() - { - WayPointId = 0; - newWaypoint = true; - amountWP = 49; - } - - void EnterCombat(Unit* /*who*/){} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id < amountWP) - { - ++WayPointId; - newWaypoint = true; - } - else - { - me->setDeathState(JUST_DIED); - me->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (newWaypoint) - { - me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]); - newWaypoint = false; - } - } - }; - -}; - -/*##### -# -######*/ - -void AddSC_mulgore() -{ - new npc_skorn_whitecloud(); - new npc_kyle_frenzied(); - new npc_plains_vision(); -} diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/orgrimmar.cpp deleted file mode 100644 index 42ef9843a4e..00000000000 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Orgrimmar -SD%Complete: 100 -SDComment: Quest support: 2460, 6566 -SDCategory: Orgrimmar -EndScriptData */ - -/* ContentData -npc_shenthul -npc_thrall_warchief -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npc_shenthul -######*/ - -enum Shenthul -{ - QUEST_SHATTERED_SALUTE = 2460 -}; - -class npc_shenthul : public CreatureScript -{ -public: - npc_shenthul() : CreatureScript("npc_shenthul") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE) - { - CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->CanTalk = true; - CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_shenthulAI (creature); - } - - struct npc_shenthulAI : public ScriptedAI - { - npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {} - - bool CanTalk; - bool CanEmote; - uint32 SaluteTimer; - uint32 ResetTimer; - uint64 PlayerGUID; - - void Reset() - { - CanTalk = false; - CanEmote = false; - SaluteTimer = 6000; - ResetTimer = 0; - PlayerGUID = 0; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (CanEmote) - { - if (ResetTimer <= diff) - { - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - { - if (player->GetTypeId() == TYPEID_PLAYER && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(QUEST_SHATTERED_SALUTE); - } - Reset(); - } else ResetTimer -= diff; - } - - if (CanTalk && !CanEmote) - { - if (SaluteTimer <= diff) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - CanEmote = true; - ResetTimer = 60000; - } else SaluteTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* player, uint32 emote) - { - if (emote == TEXT_EMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) - { - if (CanEmote) - { - player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); - Reset(); - } - } - } - }; - -}; - -/*###### -## npc_thrall_warchief -######*/ - -enum ThrallWarchief -{ - QUEST_6566 = 6566, - - SPELL_CHAIN_LIGHTNING = 16033, - SPELL_SHOCK = 16034 -}; - -#define GOSSIP_HTW "Please share your wisdom with me, Warchief." -#define GOSSIP_STW1 "What discoveries?" -#define GOSSIP_STW2 "Usurper?" -#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?" -#define GOSSIP_STW4 "I... I did not think of it that way, Warchief." -#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance." -#define GOSSIP_STW6 "Of course, Warchief!" - -//TODO: verify abilities/timers -class npc_thrall_warchief : public CreatureScript -{ -public: - npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(5733, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(5734, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(5735, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(5736, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(5737, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - player->SEND_GOSSIP_MENU(5738, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(QUEST_6566); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_thrall_warchiefAI (creature); - } - - struct npc_thrall_warchiefAI : public ScriptedAI - { - npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 ChainLightningTimer; - uint32 ShockTimer; - - void Reset() - { - ChainLightningTimer = 2000; - ShockTimer = 8000; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ChainLightningTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightningTimer = 9000; - } else ChainLightningTimer -= diff; - - if (ShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_SHOCK); - ShockTimer = 15000; - } else ShockTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_orgrimmar() -{ - new npc_shenthul(); - new npc_thrall_warchief(); -} diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/silithus.cpp deleted file mode 100644 index 58665224bdd..00000000000 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ /dev/null @@ -1,1515 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Silithus -SD%Complete: 100 -SDComment: Quest support: 7785, 8304, 8507. -SDCategory: Silithus -EndScriptData */ - -/* ContentData -npc_highlord_demitrian -npcs_rutgar_and_frankal -quest_a_pawn_on_the_eternal_pawn -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Group.h" -#include "Player.h" - -/*### -## npc_highlord_demitrian -###*/ - -#define GOSSIP_DEMITRIAN1 "What do you know of it?" -#define GOSSIP_DEMITRIAN2 "I am listening, Demitrian." -#define GOSSIP_DEMITRIAN3 "Continue, please." -#define GOSSIP_DEMITRIAN4 "A battle?" -#define GOSSIP_DEMITRIAN5 "" -#define GOSSIP_DEMITRIAN6 "Caught unaware? How?" -#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?" - -class npc_highlord_demitrian : public CreatureScript -{ -public: - npc_highlord_demitrian() : CreatureScript("npc_highlord_demitrian") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(6842, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(6843, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(6844, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(6867, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(6868, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(6869, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->SEND_GOSSIP_MENU(6870, creature->GetGUID()); - - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, 19016, true); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(7785) == QUEST_STATUS_NONE && - (player->HasItemCount(18563, 1, false) || player->HasItemCount(18564, 1, false))) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(6812, creature->GetGUID()); - return true; - } - -}; - -/*### -## npcs_rutgar_and_frankal -###*/ - -//gossip item text best guess -#define GOSSIP_ITEM1 "I seek information about Natalia" - -#define GOSSIP_ITEM2 "That sounds dangerous!" -#define GOSSIP_ITEM3 "What did you do?" -#define GOSSIP_ITEM4 "Who?" -#define GOSSIP_ITEM5 "Women do that. What did she demand?" -#define GOSSIP_ITEM6 "What do you mean?" -#define GOSSIP_ITEM7 "What happened next?" - -#define GOSSIP_ITEM11 "Yes, please continue" -#define GOSSIP_ITEM12 "What language?" -#define GOSSIP_ITEM13 "The Priestess attacked you?!" -#define GOSSIP_ITEM14 "I should ask the monkey about this" -#define GOSSIP_ITEM15 "Then what..." - -enum RutgarAndFrankal //trigger creatures to kill -{ - TRIGGER_FRANKAL = 15221, - TRIGGER_RUTGAR = 15222 -}; - -class npcs_rutgar_and_frankal : public CreatureScript -{ -public: - npcs_rutgar_and_frankal() : CreatureScript("npcs_rutgar_and_frankal") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(7755, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(7756, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(7757, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(7758, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(7759, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(7760, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 6: - player->SEND_GOSSIP_MENU(7761, creature->GetGUID()); - //'kill' our trigger to update quest status - player->KilledMonsterCredit(TRIGGER_RUTGAR, 0); - break; - - case GOSSIP_ACTION_INFO_DEF + 9: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(7762, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 10: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(7763, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 11: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); - player->SEND_GOSSIP_MENU(7764, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 12: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); - player->SEND_GOSSIP_MENU(7765, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 13: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); - player->SEND_GOSSIP_MENU(7766, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF + 14: - player->SEND_GOSSIP_MENU(7767, creature->GetGUID()); - //'kill' our trigger to update quest status - player->KilledMonsterCredit(TRIGGER_FRANKAL, 0); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && - creature->GetEntry() == 15170 && - !player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && - creature->GetEntry() == 15171 && - player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); - - player->SEND_GOSSIP_MENU(7754, creature->GetGUID()); - - return true; - } - -}; - -/*#### -# quest_a_pawn_on_the_eternal_board (Defines) -####*/ -enum EternalBoard -{ - QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, - - FACTION_HOSTILE = 14, - FACTION_FRIENDLY = 35, - - C_ANACHRONOS = 15381, - C_FANDRAL_STAGHELM = 15382, - C_ARYGOS = 15380, - C_MERITHRA = 15378, - C_CAELESTRASZ = 15379, - - ANACHRONOS_SAY_1 = 0, - ANACHRONOS_SAY_2 = 1, - ANACHRONOS_SAY_3 = 2, - ANACHRONOS_SAY_4 = 3, - ANACHRONOS_SAY_5 = 4, - ANACHRONOS_SAY_6 = 5, - ANACHRONOS_SAY_7 = 6, - ANACHRONOS_SAY_8 = 7, - ANACHRONOS_SAY_9 = 8, - ANACHRONOS_SAY_10 = 9, - ANACHRONOS_EMOTE_1 = 10, - ANACHRONOS_EMOTE_2 = 11, - ANACHRONOS_EMOTE_3 = 12, - - FANDRAL_SAY_1 = 0, - FANDRAL_SAY_2 = 1, - FANDRAL_SAY_3 = 2, - FANDRAL_SAY_4 = 3, - FANDRAL_SAY_5 = 4, - FANDRAL_SAY_6 = 5, - FANDRAL_EMOTE_1 = 6, - FANDRAL_EMOTE_2 = 7, - - CAELESTRASZ_SAY_1 = 0, - CAELESTRASZ_SAY_2 = 1, - CAELESTRASZ_YELL_1 = 2, - - ARYGOS_SAY_1 = 0, - ARYGOS_YELL_1 = 1, - ARYGOS_EMOTE_1 = 2, - - MERITHRA_SAY_1 = 0, - MERITHRA_SAY_2 = 1, - MERITHRA_YELL_1 = 2, - MERITHRA_EMOTE_1 = 3, - - GO_GATE_OF_AHN_QIRAJ = 176146, - GO_GLYPH_OF_AHN_QIRAJ = 176148, - GO_ROOTS_OF_AHN_QIRAJ = 176147 -}; -/*##### -# Quest: A Pawn on the Eternal Board -#####*/ - -/* ContentData -A Pawn on the Eternal Board - creatures, gameobjects and defines -mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle. -npc_anachronos_the_ancient : Creature that controls the event. -npc_anachronos_quest_trigger: controls the spawning of the BG War mobs. -go_crystalline_tear : GameObject that begins the event and hands out quest -TO DO: get correct spell IDs and timings for spells cast upon dragon transformations -TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. -EndContentData */ - -#define EVENT_AREA_RADIUS 65 //65yds -#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) - -struct QuestCinematic -{ - int32 TextId; - uint32 Creature, Timer; -}; - -// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz -static QuestCinematic EventAnim[]= -{ - {ANACHRONOS_SAY_1, 0, 2000}, - {FANDRAL_SAY_1, 1, 4000}, - {MERITHRA_EMOTE_1, 3, 500}, - {MERITHRA_SAY_1, 3, 500}, - {ARYGOS_EMOTE_1, 2, 2000}, - {CAELESTRASZ_SAY_1, 4, 8000}, - {MERITHRA_SAY_2, 3, 6000}, - {0, 3, 2000}, - {MERITHRA_YELL_1, 3, 2500}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 4000}, // spell - {0, 3, 1250}, //fly - {0, 3, 250}, //remove flags - {ARYGOS_SAY_1, 2, 3000}, - {0, 3, 2000}, - {ARYGOS_YELL_1, 2, 3000}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 4000}, // spell - {0, 3, 1000}, //fly - {0, 3, 1000}, //remove flags - {CAELESTRASZ_SAY_2, 4, 5000}, - {0, 3, 3000}, - {CAELESTRASZ_YELL_1, 4, 3000}, - {0, 3, 3000}, //Morph - {0, 3, 4000}, //EmoteLiftoff - {0, 3, 2500}, // spell - {ANACHRONOS_SAY_2, 0, 2000}, - {0, 3, 250}, //fly - {0, 3, 25}, //remove flags - {FANDRAL_SAY_2, 1, 3000}, - {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies - {0, 3, 2000}, // Sands will stop - {0, 3, 8000}, // Summon Gate - {ANACHRONOS_SAY_4, 0, 4000}, - {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze) - {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs) - {0, 0, 7000}, //BarrieR - {0, 0, 4000}, //Glyphs - {ANACHRONOS_SAY_5, 0, 2000}, - {0, 0, 4000}, // Roots - {FANDRAL_SAY_3, 1, 3000}, //Root Text - {FANDRAL_EMOTE_1, 1, 3000}, //falls knee - {ANACHRONOS_SAY_6, 0, 3000}, - {ANACHRONOS_SAY_7, 0, 3000}, - {ANACHRONOS_SAY_8, 0, 8000}, - {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter - {FANDRAL_SAY_4, 1, 3000}, - {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door - {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door. - {ANACHRONOS_SAY_9, 0, 3000}, - {FANDRAL_SAY_6, 1, 3000}, //fandral goes away - {ANACHRONOS_EMOTE_2, 0, 3000}, - {ANACHRONOS_EMOTE_3, 0, 3000}, - {0, 0, 2000}, - {0, 0, 2000}, - {0, 0, 4000}, - {ANACHRONOS_SAY_10, 0, 3000}, - {0, 0, 2000}, - {0, 0, 3000}, - {0, 0, 15000}, - {0, 0, 5000}, - {0, 0, 3500}, - {0, 0, 5000}, - {0, 0, 3500}, - {0, 0, 5000}, - {0, 0, 0} -}; - -//Cordinates for Spawns -Position const SpawnLocation[] = -{ - {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8085.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8080.0f, 1424.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8085.0f, 1422.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - // 2 waves of warriors - {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1525.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1523.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1521.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1519.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry - - {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror - {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror - {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror - - {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp - - {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp - {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp - - {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank - {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank - - {-8082.0f, 1513.0f, 2.61f, 3.141592f}, //Anubisath Conqueror - {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Anubisath Conqueror - {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Anubisath Conqueror -}; - -struct WaveData -{ - uint8 SpawnCount, UsedSpawnPoint; - uint32 CreatureId, SpawnTimer, YellTimer, DespTimer; - int32 WaveTextId; -}; - -static WaveData WavesInfo[5] = -{ - {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier - { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror - {12, 38, 15414, 0, 0, 24000, 0}, // Qiraji Wasps - { 6, 50, 15422, 0, 0, 24000, 0}, // Qiraji Tanks - {15, 15, 15423, 0, 0, 24000, 0} // Kaldorei Soldier - -}; - -struct SpawnSpells -{ - uint32 Timer1, Timer2, SpellId; -}; - -static SpawnSpells SpawnCast[4] = -{ - {100000, 2000, 33652}, // Stop Time - {38500, 300000, 28528}, // Poison Cloud - {58000, 300000, 35871}, // Frost Debuff (need correct spell) - {80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool) -}; -/*##### -# npc_anachronos_the_ancient -######*/ -class npc_anachronos_the_ancient : public CreatureScript -{ -public: - npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anachronos_the_ancientAI(creature); - } - - struct npc_anachronos_the_ancientAI : public ScriptedAI - { - npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 AnimationTimer; - uint8 AnimationCount; - - uint64 AnachronosQuestTriggerGUID; - uint64 MerithraGUID; - uint64 ArygosGUID; - uint64 CaelestraszGUID; - uint64 FandralGUID; - uint64 PlayerGUID; - bool eventEnd; - - void Reset() - { - AnimationTimer = 1500; - AnimationCount = 0; - AnachronosQuestTriggerGUID = 0; - MerithraGUID = 0; - ArygosGUID = 0; - CaelestraszGUID = 0; - FandralGUID = 0; - PlayerGUID = 0; - eventEnd = false; - - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void HandleAnimation() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (!player) - return; - - Creature* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me); - Creature* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me); - Creature* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me); - Creature* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me); - - if (!Fandral || !Arygos || !Caelestrasz || !Merithra) - return; - - AnimationTimer = EventAnim[AnimationCount].Timer; - if (eventEnd == false) - { - switch (AnimationCount) - { - case 0: - Talk(ANACHRONOS_SAY_1,Fandral->GetGUID()); - break; - case 1: - Fandral->SetTarget(me->GetGUID()); - Fandral->AI()->Talk(FANDRAL_SAY_1, me->GetGUID()); - break; - case 2: - Fandral->SetTarget(0); - Merithra->AI()->Talk(MERITHRA_EMOTE_1); - break; - case 3: - Merithra->AI()->Talk(MERITHRA_SAY_1); - break; - case 4: - Arygos->AI()->Talk(ARYGOS_EMOTE_1); - break; - case 5: - Caelestrasz->SetTarget(Fandral->GetGUID()); - Caelestrasz->AI()->Talk(CAELESTRASZ_SAY_1); - break; - case 6: - Merithra->AI()->Talk(MERITHRA_SAY_2); - break; - case 7: - Caelestrasz->SetTarget(0); - Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - break; - case 8: - Merithra->AI()->Talk(MERITHRA_YELL_1); - break; - case 9: - Merithra->CastSpell(Merithra, 25105, true); - break; - case 10: - Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Merithra->SetDisableGravity(true); - Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); - break; - case 11: - Merithra->CastSpell(Merithra, 24818, false); - break; - case 12: - Merithra->GetMotionMaster()->MoveCharge(-8100, 1530, 50, 42); - break; - case 13: - break; - case 14: - Arygos->AI()->Talk(ARYGOS_SAY_1); - Merithra->SetVisible(false); - break; - case 15: - Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - Merithra->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); - break; - case 16: - Arygos->AI()->Talk(ARYGOS_YELL_1); - break; - case 17: - Arygos->CastSpell(Arygos, 25107, true); - break; - case 18: - Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - Arygos->SetDisableGravity(true); - Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); - break; - case 19: - Arygos->CastSpell(Arygos, 50505, false); - break; - case 20: - Arygos->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); - break; - case 21: - break; - case 22: - Caelestrasz->AI()->Talk(CAELESTRASZ_SAY_2, Fandral->GetGUID()); - break; - case 23: - Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); - Arygos->SetVisible(false); - Arygos->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 10); - break; - case 24: - Caelestrasz->AI()->Talk(CAELESTRASZ_YELL_1); - break; - case 25: - Caelestrasz->CastSpell(Caelestrasz, 25106, true); - break; - case 26: - Caelestrasz->HandleEmoteCommand(254); - Caelestrasz->SetDisableGravity(true); - Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); - break; - case 27: - Caelestrasz->CastSpell(Caelestrasz, 54293, false); - break; - case 28: - Talk(ANACHRONOS_SAY_2, Fandral->GetGUID()); - break; - case 29: - Caelestrasz->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); - Fandral->AI()->Talk(FANDRAL_SAY_2); - break; - case 30: - break; - case 31: - Talk(ANACHRONOS_SAY_3, Fandral->GetGUID()); - break; - case 32: - Caelestrasz->SetVisible(false); - Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); - Fandral->GetMotionMaster()->MoveCharge(-8108, 1529, 2.77f, 8); - me->GetMotionMaster()->MoveCharge(-8113, 1525, 2.77f, 8); - break;//both run to the gate - case 33: - Talk(ANACHRONOS_SAY_4); - Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15); - break; //Text: sands will stop - case 34: - DoCast(player, 23017, true);//Arcane Channeling - break; - case 35: - me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true); - break; - case 36: - DoCast(player, 25159, true); - break; - case 37: - me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - break; - case 38: - DoCast(player, 25166, true); - me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - break; - case 39: - Talk(ANACHRONOS_SAY_5, Fandral->GetGUID()); - break; - case 40: - Fandral->CastSpell(me, 25167, true); - break; - case 41: - Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); - Fandral->AI()->Talk(FANDRAL_SAY_3); - break; - case 42: - me->CastStop(); - Fandral->AI()->Talk(FANDRAL_EMOTE_1); - break; - case 43: - Fandral->CastStop(); - break; - case 44: - Talk(ANACHRONOS_SAY_6); - break; - case 45: - Talk(ANACHRONOS_SAY_7); - break; - case 46: - Talk(ANACHRONOS_SAY_8); - me->GetMotionMaster()->MoveCharge(-8110, 1527, 2.77f, 4); - break; - case 47: - Talk(ANACHRONOS_EMOTE_1); - break; - case 48: - Fandral->AI()->Talk(FANDRAL_SAY_4, me->GetGUID()); - break; - case 49: - Fandral->AI()->Talk(FANDRAL_SAY_5, me->GetGUID()); - break; - case 50: - Fandral->AI()->Talk(FANDRAL_EMOTE_2); - Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true); - break; - case 51: - { - uint32 entries[4] = { 15423, 15424, 15414, 15422 }; - Unit* mob = NULL; - for (uint8 i = 0; i < 4; ++i) - { - mob = player->FindNearestCreature(entries[i], 50, me); - while (mob) - { - mob->RemoveFromWorld(); - mob = player->FindNearestCreature(15423, 50, me); - } - } - break; - } - case 52: - Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4); - Fandral->AI()->Talk(ANACHRONOS_SAY_9, me->GetGUID()); - break; - case 53: - Fandral->AI()->Talk(FANDRAL_SAY_6); - break; - case 54: - Talk(ANACHRONOS_EMOTE_2); - break; - case 55: - Fandral->SetVisible(false); - break; - case 56: - Talk(ANACHRONOS_EMOTE_3); - me->GetMotionMaster()->MoveCharge(-8116, 1522, 3.65f, 4); - break; - case 57: - me->GetMotionMaster()->MoveCharge(-8116.7f, 1527, 3.7f, 4); - break; - case 58: - me->GetMotionMaster()->MoveCharge(-8112.67f, 1529.9f, 2.86f, 4); - break; - case 59: - me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4); - break; - case 60: - if (player) - Talk(ANACHRONOS_SAY_10, player->GetGUID()); - me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4); - break; - case 61: - me->GetMotionMaster()->MoveCharge(-8057.1f, 1470.32f, 2.61f, 6); - if (player->IsInRange(me, 0, 15)) - player->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, me); - break; - case 62: - me->SetDisplayId(15500); - break; - case 63: - me->HandleEmoteCommand(254); - me->SetDisableGravity(true); - break; - case 64: - me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); - break; - case 65: - me->SetVisible(false); - if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID))) - { - Talk(ARYGOS_YELL_1); - AnachronosQuestTrigger->AI()->EnterEvadeMode(); - eventEnd=true; - } - break; - } - } - ++AnimationCount; - } - void UpdateAI(const uint32 diff) - { - if (AnimationTimer) - { - if (AnimationTimer <= diff) - HandleAnimation(); - else AnimationTimer -= diff; - } - if (AnimationCount < 65) - me->CombatStop(); - if (AnimationCount == 65 || eventEnd) - me->AI()->EnterEvadeMode(); - } - }; - -}; - -/*###### -# mob_qiraj_war_spawn -######*/ - -class mob_qiraj_war_spawn : public CreatureScript -{ -public: - mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_qiraj_war_spawnAI(creature); - } - - struct mob_qiraj_war_spawnAI : public ScriptedAI - { - mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 MobGUID; - uint64 PlayerGUID; - uint32 SpellTimer1, SpellTimer2, SpellTimer3, SpellTimer4; - bool Timers; - bool hasTarget; - - void Reset() - { - MobGUID = 0; - PlayerGUID = 0; - Timers = false; - hasTarget = false; - } - - void EnterCombat(Unit* /*who*/) {} - void JustDied(Unit* /*slayer*/); - - void UpdateAI(const uint32 diff) - { - if (!Timers) - { - 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 (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - SpellTimer4 = SpawnCast[0].Timer1; - Timers = true; - } - if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414) - { - if (SpellTimer1 <= diff) - { - DoCast(me, SpawnCast[1].SpellId); - DoCast(me, 24319); - SpellTimer1 = SpawnCast[1].Timer2; - } else SpellTimer1 -= diff; - if (SpellTimer2 <= diff) - { - DoCast(me, SpawnCast[2].SpellId); - SpellTimer2 = SpawnCast[2].Timer2; - } else SpellTimer2 -= diff; - if (SpellTimer3 <= diff) - { - DoCast(me, SpawnCast[3].SpellId); - SpellTimer3 = SpawnCast[3].Timer2; - } else SpellTimer3 -= diff; - } - if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - { - if (SpellTimer4 <= diff) - { - me->RemoveAllAttackers(); - me->AttackStop(); - DoCast(me, 15533); - SpellTimer4 = SpawnCast[0].Timer2; - } else SpellTimer4 -= diff; - } - if (!hasTarget) - { - Unit* target = NULL; - if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) - target = me->FindNearestCreature(15423, 20, true); - if (me->GetEntry() == 15423) - { - uint8 tar = urand(0, 2); - - if (tar == 0) - target = me->FindNearestCreature(15422, 20, true); - else if (tar == 1) - target = me->FindNearestCreature(15424, 20, true); - else if (tar == 2) - target = me->FindNearestCreature(15414, 20, true); - } - hasTarget = true; - if (target) - me->AI()->AttackStart(target); - } - if (!(me->FindNearestCreature(15379, 60))) - DoCast(me, 33652); - - if (!UpdateVictim()) - { - hasTarget = false; - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*##### -# npc_anachronos_quest_trigger -#####*/ - -class npc_anachronos_quest_trigger : public CreatureScript -{ -public: - npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anachronos_quest_triggerAI(creature); - } - - struct npc_anachronos_quest_triggerAI : public ScriptedAI - { - npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 PlayerGUID; - - uint32 WaveTimer; - uint32 AnnounceTimer; - - int8 LiveCount; - uint8 WaveCount; - - bool EventStarted; - bool Announced; - bool Failed; - - void Reset() - { - PlayerGUID = 0; - - WaveTimer = 2000; - AnnounceTimer = 1000; - LiveCount = 0; - WaveCount = 0; - - EventStarted = false; - Announced = false; - Failed = false; - - me->SetVisible(false); - } - - void SummonNextWave() - { - uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; - uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount; - - for (uint8 i = locIndex; i <= count; ++i) - { - uint32 desptimer = WavesInfo[WaveCount].DespTimer; - - if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) - { - if (spawn->GetEntry() == 15423) - spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); - if (i >= 30) WaveCount = 1; - if (i >= 33) WaveCount = 2; - if (i >= 45) WaveCount = 3; - if (i >= 51) WaveCount = 4; - - if (WaveCount < 5) //1-4 Wave - { - if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI())) - { - spawnAI->MobGUID = me->GetGUID(); - spawnAI->PlayerGUID = PlayerGUID; - } - } - } - } - - WaveTimer = WavesInfo[WaveCount].SpawnTimer; - AnnounceTimer = WavesInfo[WaveCount].YellTimer; - } - - void CheckEventFail() - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - - if (!player) - return; - - if (Group* EventGroup = player->GetGroup()) - { - Player* groupMember; - - uint8 GroupMemberCount = 0; - uint8 DeadMemberCount = 0; - uint8 FailedMemberCount = 0; - - Group::MemberSlotList const members = EventGroup->GetMemberSlots(); - - for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr) - { - groupMember = (Unit::GetPlayer(*me, itr->guid)); - if (!groupMember) - continue; - 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); - ++FailedMemberCount; - } - ++GroupMemberCount; - - if (groupMember->isDead()) - ++DeadMemberCount; - } - - if (GroupMemberCount == FailedMemberCount || !player->IsWithinDistInMap(me, EVENT_AREA_RADIUS)) - Failed = true; //only so event can restart - } - } - - void LiveCounter() - { - --LiveCount; - if (!LiveCount) - Announced = false; - } - - void UpdateAI(const uint32 diff) - { - if (!PlayerGUID || !EventStarted) - return; - - if (WaveCount < 4) - { - if (!Announced && AnnounceTimer <= diff) - { - Talk(WavesInfo[WaveCount].WaveTextId); - Announced = true; - } else AnnounceTimer -= diff; - - if (WaveTimer <= diff) - SummonNextWave(); - else WaveTimer -= diff; - } - CheckEventFail(); - if (WaveCount == 4 || Failed) - EnterEvadeMode(); - }; - }; - -}; - -void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) -{ - me->RemoveCorpse(); - - if (!MobGUID) - return; - - if (Creature* mob = Unit::GetCreature(*me, MobGUID)) - if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) - triggerAI->LiveCounter(); - -}; - -/*##### -# go_crystalline_tear -######*/ - -class go_crystalline_tear : public GameObjectScript -{ -public: - go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { } - - bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) - { - if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) - { - Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); - - if (Merithra) - { - Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); - Merithra->setFaction(35); - } - - if (Caelestrasz) - { - Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); - Caelestrasz->setFaction(35); - } - - if (Arygos) - { - Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); - Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); - Arygos->setFaction(35); - } - - if (Anachronos) - { - if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())) - anachronosAI->PlayerGUID = player->GetGUID(); - - if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI())) - { - triggerAI->Failed = false; - triggerAI->PlayerGUID = player->GetGUID(); - triggerAI->EventStarted = true; - triggerAI->Announced = true; - } - } - } - } - return true; - } - -}; - -/*### -## go_wind_stone -###*/ - -enum WSSpells -{ - SPELL_PUNISHMENT = 24803, - SPELL_SPAWN_IN = 25035, - - AURA_TWILIGHT_SET = 24746, - AURA_MEDALLION = 24748, - AURA_RING = 24782, - - SPELL_TEMPLAR_RANDOM = 24745, - SPELL_TEMPLAR_FIRE = 24747, - SPELL_TEMPLAR_AIR = 24757, - SPELL_TEMPLAR_EARTH = 24759, - SPELL_TEMPLAR_WATER = 24761, - - SPELL_DUKE_RANDOM = 24762, - SPELL_DUKE_FIRE = 24766, - SPELL_DUKE_AIR = 24769, - SPELL_DUKE_EARTH = 24771, - SPELL_DUKE_WATER = 24773, - - SPELL_ROYAL_RANDOM = 24785, - SPELL_ROYAL_FIRE = 24787, - SPELL_ROYAL_AIR = 24791, - SPELL_ROYAL_EARTH = 24792, - SPELL_ROYAL_WATER = 24793 -}; - -enum WSGossip -{ - GOSSIPID_LESSER_WS = 6540, - GOSSIPID_WS = 6542, - GOSSIPID_GREATER_WS = 6543 -}; - -enum WSCreatures -{ - NPC_TEMPLAR_FIRE = 15209, - NPC_TEMPLAR_WATER = 15211, - NPC_TEMPLAR_AIR = 15212, - NPC_TEMPLAR_EARTH = 15307, - - NPC_DUKE_FIRE = 15206, - NPC_DUKE_WATER = 15207, - NPC_DUKE_EARTH = 15208, - NPC_DUKE_AIR = 15220, - - NPC_ROYAL_FIRE = 15203, - NPC_ROYAL_AIR = 15204, - NPC_ROYAL_EARTH = 15205, - NPC_ROYAL_WATER = 15305 -}; - -enum WSItems -{ - ITEM_TEMPLAR_FIRE = 20416, - ITEM_TEMPLAR_EARTH = 20419, - ITEM_TEMPLAR_WATER = 20420, - ITEM_TEMPLAR_AIR = 20418, - - ITEM_DUKE_FIRE = 20432, - ITEM_DUKE_EARTH = 20435, - ITEM_DUKE_WATER = 20436, - ITEM_DUKE_AIR = 20433, - - ITEM_ROYAL_FIRE = 20447, - ITEM_ROYAL_EARTH = 20449, - ITEM_ROYAL_WATER = 20450, - ITEM_ROYAL_AIR = 20448, -}; - -enum WS -{ - TEMPLAR = 0, - DUKE = 1, - ROYAL = 2, - - FIRE = 0x1, - WATER = 0x2, - EARTH = 0x4, - AIR = 0x8 -}; - -enum WSTexts -{ - SAY_TEMPLAR_AGGRO = 0, - SAY_DUKE_AGGRO = 0, - YELL_ROYAL_AGGRO = 0 -}; - -#define GOSSIP_TEMPLAR_RANDOM "I am no cultist, you monster! Come to me and face your destruction!" -#define GOSSIP_TEMPLAR_FIRE "Crimson Templar! I hold your signet! Heed my call!" -#define GOSSIP_TEMPLAR_EARTH "Earthen Templar! I hold your signet! Heed my call!" -#define GOSSIP_TEMPLAR_AIR "Hoary Templar! I hold your signet! Heed my call!" -#define GOSSIP_TEMPLAR_WATER "Azure Templar! I hold your signet! Heed my call!" - -#define GOSSIP_DUKE_RANDOM "You will listen to this, vile duke! I am not your Twilight's Hammer lapdog! I am here to challenge you! Come! Come, and meet your death..." -#define GOSSIP_DUKE_FIRE "Duke of Cynders! I hold your signet! Heed my call!" -#define GOSSIP_DUKE_EARTH "The Duke of Shards! I hold your signet! Heed my call!" -#define GOSSIP_DUKE_AIR "The Duke of Zephyrs! I hold your signet! Heed my call!" -#define GOSSIP_DUKE_WATER "The Duke of Fathoms! I hold your signet! Heed my call!" - -#define GOSSIP_ROYAL_RANDOM "The day of the judgement has come, fiend! I challenge you to battle!" -#define GOSSIP_ROYAL_FIRE "Prince Skaldrenox! I hold your signet! Heed my call!" -#define GOSSIP_ROYAL_EARTH "Baron Kazum! I hold your signet! Heed my call!" -#define GOSSIP_ROYAL_AIR "High Marshal Whirlaxis! I hold your signet! Heed my call!" -#define GOSSIP_ROYAL_WATER "Lord Skwol! I hold your signet! Heed my call!" - -class go_wind_stone : public GameObjectScript -{ - public: - go_wind_stone() : GameObjectScript("go_wind_stone") { } - - private: - uint8 GetPlayerRank(Player* player) // For random summoning - { - bool setAura = player->HasAura(AURA_TWILIGHT_SET); - bool medallionAura = player->HasAura(AURA_MEDALLION); - bool ringAura = player->HasAura(AURA_RING); - - if (setAura && medallionAura && ringAura) - return 3; - else if (setAura && medallionAura) - return 2; - else if (setAura) - return 1; - else - return 0; - } - - uint8 GetItems(Player* player, WS type) - { - uint8 result = 0x0; - - switch (type) - { - case TEMPLAR: - { - if (player->HasItemCount(ITEM_TEMPLAR_FIRE)) - result |= FIRE; - if (player->HasItemCount(ITEM_TEMPLAR_WATER)) - result |= WATER; - if (player->HasItemCount(ITEM_TEMPLAR_EARTH)) - result |= EARTH; - if (player->HasItemCount(ITEM_TEMPLAR_AIR)) - result |= AIR; - break; - } - case DUKE: - { - if (player->HasItemCount(ITEM_DUKE_FIRE)) - result |= FIRE; - if (player->HasItemCount(ITEM_DUKE_WATER)) - result |= WATER; - if (player->HasItemCount(ITEM_DUKE_EARTH)) - result |= EARTH; - if (player->HasItemCount(ITEM_DUKE_AIR)) - result |= AIR; - break; - } - case ROYAL: - { - if (player->HasItemCount(ITEM_ROYAL_FIRE)) - result |= FIRE; - if (player->HasItemCount(ITEM_ROYAL_WATER)) - result |= WATER; - if (player->HasItemCount(ITEM_ROYAL_EARTH)) - result |= EARTH; - if (player->HasItemCount(ITEM_ROYAL_AIR)) - result |= AIR; - break; - } - default: - break; - } - return result; - } - - void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spell) - { - go->CastSpell(player, spell); - TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000); - summons->CastSpell(summons, SPELL_SPAWN_IN, false); - switch (summons->GetEntry()) - { - case NPC_TEMPLAR_FIRE: - case NPC_TEMPLAR_WATER: - case NPC_TEMPLAR_AIR: - case NPC_TEMPLAR_EARTH: - summons->AI()->Talk(SAY_TEMPLAR_AGGRO); - break; - - case NPC_DUKE_FIRE: - case NPC_DUKE_WATER: - case NPC_DUKE_EARTH: - case NPC_DUKE_AIR: - summons->AI()->Talk(SAY_DUKE_AGGRO); - break; - case NPC_ROYAL_FIRE: - case NPC_ROYAL_AIR: - case NPC_ROYAL_EARTH: - case NPC_ROYAL_WATER: - summons->AI()->Talk(YELL_ROYAL_AGGRO); - break; - } - summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summons->SendMeleeAttackStart(player); - summons->CombatStart(player); - } - - public: - bool OnGossipHello(Player* player, GameObject* go) - { - uint8 rank = GetPlayerRank(player); - - uint32 gossipId = go->GetGOInfo()->GetGossipMenuId(); - switch (gossipId) - { - case GOSSIPID_LESSER_WS: - { - if (rank >= 1) // 1 or 2 or 3 - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - else - { - go->CastSpell(player, SPELL_PUNISHMENT); - break; - } - - uint8 item = GetItems(player, TEMPLAR); - if (item & FIRE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - if (item & WATER) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - if (item & EARTH) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - if (item & AIR) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - break; - } - case GOSSIPID_WS: - { - if (rank >= 2) // 2 or 3 - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - else - { - go->CastSpell(player, SPELL_PUNISHMENT); - break; - } - - uint8 item = GetItems(player, DUKE); - if (item & FIRE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - if (item & WATER) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - if (item & EARTH) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - if (item & AIR) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); - break; - } - case GOSSIPID_GREATER_WS: - { - if (rank == 3) // 3 - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - else - { - go->CastSpell(player, SPELL_PUNISHMENT); - break; - } - - uint8 item = GetItems(player, ROYAL); - if (item & FIRE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); - if (item & WATER) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); - if (item & EARTH) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); - if (item & AIR) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); - break; - } - default: - break; - } - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(gossipId, go), go->GetGUID()); - return true; - } - - bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - player->PlayerTalkClass->SendCloseGossip(); - - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - SummonNPC(go, player, RAND(NPC_TEMPLAR_WATER, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_AIR), SPELL_TEMPLAR_RANDOM); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - SummonNPC(go, player, NPC_TEMPLAR_FIRE, SPELL_TEMPLAR_FIRE); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - SummonNPC(go, player, NPC_TEMPLAR_WATER, SPELL_TEMPLAR_WATER); - break; - case GOSSIP_ACTION_INFO_DEF + 4: - SummonNPC(go, player, NPC_TEMPLAR_EARTH, SPELL_TEMPLAR_EARTH); - break; - case GOSSIP_ACTION_INFO_DEF + 5: - SummonNPC(go, player, NPC_TEMPLAR_AIR, SPELL_TEMPLAR_AIR); - break; - - case GOSSIP_ACTION_INFO_DEF + 6: - SummonNPC(go, player, RAND(NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_DUKE_EARTH, NPC_DUKE_AIR), SPELL_DUKE_RANDOM); - break; - case GOSSIP_ACTION_INFO_DEF + 7: - SummonNPC(go, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE); - break; - case GOSSIP_ACTION_INFO_DEF + 8: - SummonNPC(go, player, NPC_DUKE_WATER, SPELL_DUKE_WATER); - break; - case GOSSIP_ACTION_INFO_DEF + 9: - SummonNPC(go, player, NPC_DUKE_EARTH, SPELL_DUKE_EARTH); - break; - case GOSSIP_ACTION_INFO_DEF + 10: - SummonNPC(go, player, NPC_DUKE_AIR, SPELL_DUKE_AIR); - break; - - case GOSSIP_ACTION_INFO_DEF + 11: - SummonNPC(go, player, RAND(NPC_ROYAL_FIRE, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_WATER), SPELL_ROYAL_RANDOM); - break; - case GOSSIP_ACTION_INFO_DEF + 12: - SummonNPC(go, player, NPC_ROYAL_FIRE, SPELL_ROYAL_FIRE); - break; - case GOSSIP_ACTION_INFO_DEF + 13: - SummonNPC(go, player, NPC_ROYAL_WATER, SPELL_ROYAL_WATER); - break; - case GOSSIP_ACTION_INFO_DEF + 14: - SummonNPC(go, player, NPC_ROYAL_EARTH, SPELL_ROYAL_EARTH); - break; - case GOSSIP_ACTION_INFO_DEF + 15: - SummonNPC(go, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR); - break; - - default: - break; - } - return true; - } -}; - -void AddSC_silithus() -{ - new go_crystalline_tear(); - new npc_anachronos_quest_trigger(); - new npc_anachronos_the_ancient(); - new mob_qiraj_war_spawn(); - new npc_highlord_demitrian(); - new npcs_rutgar_and_frankal(); - new go_wind_stone(); -} diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/stonetalon_mountains.cpp deleted file mode 100644 index 26c92c7404c..00000000000 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Stonetalon_Mountains -SD%Complete: 95 -SDComment: Quest support: 6627, 6523 -SDCategory: Stonetalon Mountains -EndScriptData */ - -/* ContentData -npc_braug_dimspirit -npc_kaya_flathoof -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_braug_dimspirit -######*/ - -#define GOSSIP_HBD1 "Ysera" -#define GOSSIP_HBD2 "Neltharion" -#define GOSSIP_HBD3 "Nozdormu" -#define GOSSIP_HBD4 "Alexstrasza" -#define GOSSIP_HBD5 "Malygos" - -class npc_braug_dimspirit : public CreatureScript -{ -public: - npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 6766, false); - - } - if (action == GOSSIP_ACTION_INFO_DEF+2) - { - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(6627); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(5820, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(5819, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_kaya_flathoof -######*/ - -enum Kaya -{ - FACTION_ESCORTEE_H = 775, - - NPC_GRIMTOTEM_RUFFIAN = 11910, - NPC_GRIMTOTEM_BRUTE = 11912, - NPC_GRIMTOTEM_SORCERER = 11913, - - SAY_START = 0, - SAY_AMBUSH = 1, - SAY_END = 2, - - QUEST_PROTECT_KAYA = 6523 -}; - -class npc_kaya_flathoof : public CreatureScript -{ -public: - npc_kaya_flathoof() : CreatureScript("npc_kaya_flathoof") { } - - struct npc_kaya_flathoofAI : public npc_escortAI - { - npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - Talk(SAY_AMBUSH); - me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: - me->SetInFront(player); - Talk(SAY_END); - player->GroupEventHappens(QUEST_PROTECT_KAYA, me); - break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void Reset(){} - }; - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_PROTECT_KAYA) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - - creature->AI()->Talk(SAY_START); - creature->setFaction(113); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kaya_flathoofAI(creature); - } - -}; - -/*###### -## AddSC -######*/ - -void AddSC_stonetalon_mountains() -{ - new npc_braug_dimspirit(); - new npc_kaya_flathoof(); -} diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/tanaris.cpp deleted file mode 100644 index 0648e40416d..00000000000 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ /dev/null @@ -1,685 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Tanaris -SD%Complete: 80 -SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor -SDCategory: Tanaris -EndScriptData */ - -/* ContentData -mob_aquementas -npc_custodian_of_time -npc_marin_noggenfogger -npc_steward_of_time -npc_stone_watcher_of_norgannon -npc_OOX17 -npc_tooga -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "ScriptedFollowerAI.h" -#include "Player.h" -#include "WorldSession.h" - -/*###### -## mob_aquementas -######*/ - -enum Aquementas -{ - AGGRO_YELL_AQUE = 0, - - SPELL_AQUA_JET = 13586, - SPELL_FROST_SHOCK = 15089 -}; - -class mob_aquementas : public CreatureScript -{ -public: - mob_aquementas() : CreatureScript("mob_aquementas") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_aquementasAI (creature); - } - - struct mob_aquementasAI : public ScriptedAI - { - mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SendItemTimer; - uint32 SwitchFactionTimer; - bool isFriendly; - - uint32 FrostShockTimer; - uint32 AquaJetTimer; - - void Reset() - { - SendItemTimer = 0; - SwitchFactionTimer = 10000; - me->setFaction(35); - isFriendly = true; - - AquaJetTimer = 5000; - FrostShockTimer = 1000; - } - - void SendItem(Unit* receiver) - { - if (CAST_PLR(receiver)->HasItemCount(11169, 1, false) && - CAST_PLR(receiver)->HasItemCount(11172, 11, false) && - CAST_PLR(receiver)->HasItemCount(11173, 1, false) && - !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) - { - ItemPosCountVec dest; - uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL); - if (msg == EQUIP_ERR_OK) - CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); - } - } - - void EnterCombat(Unit* who) - { - Talk(AGGRO_YELL_AQUE, who->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (isFriendly) - { - if (SwitchFactionTimer <= diff) - { - me->setFaction(91); - isFriendly = false; - } else SwitchFactionTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!isFriendly) - { - if (SendItemTimer <= diff) - { - if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) - SendItem(me->getVictim()); - SendItemTimer = 5000; - } else SendItemTimer -= diff; - } - - if (FrostShockTimer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_SHOCK); - FrostShockTimer = 15000; - } else FrostShockTimer -= diff; - - if (AquaJetTimer <= diff) - { - DoCast(me, SPELL_AQUA_JET); - AquaJetTimer = 15000; - } else AquaJetTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### -## npc_custodian_of_time -######*/ - -enum CustodianOfTime -{ - WHISPER_CUSTODIAN_1 = 0, - WHISPER_CUSTODIAN_2 = 1, - WHISPER_CUSTODIAN_3 = 2, - WHISPER_CUSTODIAN_4 = 3, - WHISPER_CUSTODIAN_5 = 4, - WHISPER_CUSTODIAN_6 = 5, - WHISPER_CUSTODIAN_7 = 6, - WHISPER_CUSTODIAN_8 = 7, - WHISPER_CUSTODIAN_9 = 8, - WHISPER_CUSTODIAN_10 = 9, - WHISPER_CUSTODIAN_11 = 10, - WHISPER_CUSTODIAN_12 = 11, - WHISPER_CUSTODIAN_13 = 12, - WHISPER_CUSTODIAN_14 = 13 -}; - -class npc_custodian_of_time : public CreatureScript -{ -public: - npc_custodian_of_time() : CreatureScript("npc_custodian_of_time") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_custodian_of_timeAI(creature); - } - - struct npc_custodian_of_timeAI : public npc_escortAI - { - npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 0: - Talk(WHISPER_CUSTODIAN_1, player->GetGUID()); - break; - case 1: - Talk(WHISPER_CUSTODIAN_2, player->GetGUID()); - break; - case 2: - Talk(WHISPER_CUSTODIAN_3, player->GetGUID()); - break; - case 3: - Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); - break; - case 5: - Talk(WHISPER_CUSTODIAN_5, player->GetGUID()); - break; - case 6: - Talk(WHISPER_CUSTODIAN_6, player->GetGUID()); - break; - case 7: - Talk(WHISPER_CUSTODIAN_7, player->GetGUID()); - break; - case 8: - Talk(WHISPER_CUSTODIAN_8, player->GetGUID()); - break; - case 9: - Talk(WHISPER_CUSTODIAN_9, player->GetGUID()); - break; - case 10: - Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); - break; - case 13: - Talk(WHISPER_CUSTODIAN_10, player->GetGUID()); - break; - case 14: - Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); - break; - case 16: - Talk(WHISPER_CUSTODIAN_11, player->GetGUID()); - break; - case 17: - Talk(WHISPER_CUSTODIAN_12, player->GetGUID()); - break; - case 18: - Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); - break; - case 22: - Talk(WHISPER_CUSTODIAN_13, player->GetGUID()); - break; - case 23: - Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); - break; - case 24: - Talk(WHISPER_CUSTODIAN_14, player->GetGUID()); - DoCast(player, 34883); - // below here is temporary workaround, to be removed when spell works properly - player->AreaExploredOrEventHappens(10277); - break; - } - } - } - - void MoveInLineOfSight(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0f; - if (me->IsWithinDistInMap(who, Radius)) - { - Start(false, false, who->GetGUID()); - } - } - } - } - - void EnterCombat(Unit* /*who*/) {} - void Reset() {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } - }; - -}; - -/*###### -## npc_marin_noggenfogger -######*/ - -class npc_marin_noggenfogger : public CreatureScript -{ -public: - npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetQuestRewardStatus(2662)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_steward_of_time -######*/ - -#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair." - -class npc_steward_of_time : public CreatureScript -{ -public: - npc_steward_of_time() : CreatureScript("npc_steward_of_time") { } - - bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* quest) - { - if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair - player->CastSpell(player, 34891, true); //(Flight through Caverns) - - return false; - } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - player->CastSpell(player, 34891, true); //(Flight through Caverns) - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || player->GetQuestRewardStatus(10279)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(9978, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(9977, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_stone_watcher_of_norgannon -######*/ - -#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" -#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" -#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" -#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" -#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." - -class npc_stone_watcher_of_norgannon : public CreatureScript -{ -public: - npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(1675, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(1676, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(1677, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(1678, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(1679, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(2954); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(1674, creature->GetGUID()); - - return true; - } - -}; - -/*###### -## npc_OOX17 -######*/ - -enum Npc00X17 -{ - SAY_OOX_START = 0, - SAY_OOX_AGGRO = 1, - SAY_OOX_AMBUSH = 2, - SAY_OOX17_AMBUSH_REPLY = 0, - SAY_OOX_END = 3, - - Q_OOX17 = 648, - SPAWN_FIRST = 7803, - SPAWN_SECOND_1 = 5617, - SPAWN_SECOND_2 = 7805 -}; - -class npc_OOX17 : public CreatureScript -{ -public: - npc_OOX17() : CreatureScript("npc_OOX17") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == Q_OOX17) - { - creature->setFaction(113); - creature->SetFullHealth(); - creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - creature->AI()->Talk(SAY_OOX_START); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17::npc_OOX17AI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_OOX17AI(creature); - } - - struct npc_OOX17AI : public npc_escortAI - { - npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 23: - me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - Talk(SAY_OOX_AMBUSH); - break; - case 56: - me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - me->SummonCreature(SPAWN_SECOND_2, -7518.07f, -4792.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - Talk(SAY_OOX_AMBUSH); - if (Creature* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) - scoff->AI()->Talk(SAY_OOX17_AMBUSH_REPLY); - break; - case 86: - Talk(SAY_OOX_END); - player->GroupEventHappens(Q_OOX17, me); - break; - } - } - } - - void Reset(){} - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_OOX_AGGRO); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; -}; - -/*#### -# npc_tooga -####*/ - -enum Tooga -{ - SAY_TOOG_WORRIED = 0, - SAY_TOOG_POST_1 = 1, - SAY_TORT_POST_2 = 0, - SAY_TOOG_POST_3 = 2, - SAY_TORT_POST_4 = 1, - SAY_TOOG_POST_5 = 3, - SAY_TORT_POST_6 = 2, - - QUEST_TOOGA = 1560, - NPC_TORTA = 6015, - - POINT_ID_TO_WATER = 1, - FACTION_TOOG_ESCORTEE = 113 -}; - -Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f}; - -class npc_tooga : public CreatureScript -{ -public: - npc_tooga() : CreatureScript("npc_tooga") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_TOOGA) - { - if (npc_toogaAI* pToogaAI = CAST_AI(npc_tooga::npc_toogaAI, creature->AI())) - pToogaAI->StartFollow(player, FACTION_TOOG_ESCORTEE, quest); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_toogaAI(creature); - } - - struct npc_toogaAI : public FollowerAI - { - npc_toogaAI(Creature* creature) : FollowerAI(creature) { } - - uint32 CheckSpeechTimer; - uint32 PostEventTimer; - uint32 PhasePostEvent; - - uint64 TortaGUID; - - void Reset() - { - CheckSpeechTimer = 2500; - PostEventTimer = 1000; - PhasePostEvent = 0; - - TortaGUID = 0; - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - Player* player = GetLeaderForFollower(); - if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_TOOGA, me); - - TortaGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void MovementInform(uint32 MotionType, uint32 PointId) - { - FollowerAI::MovementInform(MotionType, PointId); - - if (MotionType != POINT_MOTION_TYPE) - return; - - if (PointId == POINT_ID_TO_WATER) - SetFollowComplete(); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - //we are doing the post-event, or... - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (PostEventTimer <= Diff) - { - PostEventTimer = 5000; - - Creature* torta = Creature::GetCreature(*me, TortaGUID); - if (!torta || !torta->isAlive()) - { - //something happened, so just complete - SetFollowComplete(); - return; - } - - switch (PhasePostEvent) - { - case 1: - Talk(SAY_TOOG_POST_1); - break; - case 2: - torta->AI()->Talk(SAY_TORT_POST_2); - break; - case 3: - Talk(SAY_TOOG_POST_3); - break; - case 4: - torta->AI()->Talk(SAY_TORT_POST_4); - break; - case 5: - Talk(SAY_TOOG_POST_5); - break; - case 6: - torta->AI()->Talk(SAY_TORT_POST_6); - me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); - break; - } - - ++PhasePostEvent; - } - else - PostEventTimer -= Diff; - } - //...we are doing regular speech check - else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) - { - if (CheckSpeechTimer <= Diff) - { - CheckSpeechTimer = 5000; - - if (urand(0, 9) > 8) - Talk(SAY_TOOG_WORRIED); - } - else - CheckSpeechTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_tanaris() -{ - new mob_aquementas(); - new npc_custodian_of_time(); - new npc_marin_noggenfogger(); - new npc_steward_of_time(); - new npc_stone_watcher_of_norgannon(); - new npc_OOX17(); - new npc_tooga(); -} diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/teldrassil.cpp deleted file mode 100644 index d7983c2cbe6..00000000000 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Teldrassil -SD%Complete: 100 -SDComment: Quest support: 938 -SDCategory: Teldrassil -EndScriptData */ - -/* ContentData -npc_mist -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedFollowerAI.h" -#include "Player.h" - -/*#### -# npc_mist -####*/ - -enum Mist -{ - SAY_AT_HOME = 0, - EMOTE_AT_HOME = 1, - QUEST_MIST = 938, - NPC_ARYNIA = 3519, - FACTION_DARNASSUS = 79 -}; - -class npc_mist : public CreatureScript -{ -public: - npc_mist() : CreatureScript("npc_mist") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_MIST) - if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI())) - pMistAI->StartFollow(player, FACTION_DARNASSUS, quest); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_mistAI(creature); - } - - struct npc_mistAI : public FollowerAI - { - npc_mistAI(Creature* creature) : FollowerAI(creature) { } - - void Reset() { } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_ARYNIA) - { - if (me->IsWithinDistInMap(who, 10.0f)) - { - Talk(SAY_AT_HOME, who->GetGUID()); - DoComplete(); - } - } - } - - void DoComplete() - { - Talk(EMOTE_AT_HOME); - - Player* player = GetLeaderForFollower(); - if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_MIST, me); - - //The follow is over (and for later development, run off to the woods before really end) - SetFollowComplete(); - } - - //call not needed here, no known abilities - /*void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - }*/ - }; - -}; - -void AddSC_teldrassil() -{ - new npc_mist(); -} diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/the_barrens.cpp deleted file mode 100644 index 8f7ab09260b..00000000000 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ /dev/null @@ -1,695 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: The_Barrens -SD%Complete: 90 -SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981, -SDCategory: Barrens -EndScriptData */ - -/* ContentData -npc_beaten_corpse -npc_gilthares -npc_sputtervalve -npc_taskmaster_fizzule -npc_twiggy_flathead -npc_wizzlecrank_shredder -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" -#include "SpellInfo.h" - -/*###### -## npc_beaten_corpse -######*/ - -#define GOSSIP_CORPSE "Examine corpse in detail..." - -enum BeatenCorpse -{ - QUEST_LOST_IN_BATTLE = 4921 -}; - -class npc_beaten_corpse : public CreatureScript -{ -public: - npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF +1) - { - player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(3557, creature->GetGUID()); - return true; - } - -}; - -/*###### -# npc_gilthares -######*/ - -enum Gilthares -{ - SAY_GIL_START = 0, - SAY_GIL_AT_LAST = 1, - SAY_GIL_PROCEED = 2, - SAY_GIL_FREEBOOTERS = 3, - SAY_GIL_AGGRO = 4, - SAY_GIL_ALMOST = 5, - SAY_GIL_SWEET = 6, - SAY_GIL_FREED = 7, - - QUEST_FREE_FROM_HOLD = 898, - AREA_MERCHANT_COAST = 391, - FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest -}; - -class npc_gilthares : public CreatureScript -{ -public: - npc_gilthares() : CreatureScript("npc_gilthares") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) - { - creature->setFaction(FACTION_ESCORTEE); - creature->SetStandState(UNIT_STAND_STATE_STAND); - - creature->AI()->Talk(SAY_GIL_START, player->GetGUID()); - - if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_giltharesAI(creature); - } - - struct npc_giltharesAI : public npc_escortAI - { - npc_giltharesAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() { } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - Talk(SAY_GIL_AT_LAST, player->GetGUID()); - break; - case 17: - Talk(SAY_GIL_PROCEED, player->GetGUID()); - break; - case 18: - Talk(SAY_GIL_FREEBOOTERS, player->GetGUID()); - break; - case 37: - Talk(SAY_GIL_ALMOST,player->GetGUID()); - break; - case 47: - Talk(SAY_GIL_SWEET, player->GetGUID()); - break; - case 53: - Talk(SAY_GIL_FREED, player->GetGUID()); - player->GroupEventHappens(QUEST_FREE_FROM_HOLD, me); - break; - } - } - - void EnterCombat(Unit* who) - { - //not always use - if (rand()%4) - return; - - //only aggro text if not player and only in this area - if (who->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST) - { - //appears to be pretty much random (possible only if escorter not in combat with who yet?) - Talk(SAY_GIL_AGGRO, who->GetGUID()); - } - } - }; - -}; - -/*###### -## npc_sputtervalve -######*/ - -#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" - -class npc_sputtervalve : public CreatureScript -{ -public: - npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); - player->AreaExploredOrEventHappens(6981); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - -}; - -/*###### -## npc_taskmaster_fizzule -######*/ - -enum TaskmasterFizzule -{ - FACTION_FRIENDLY_F = 35, - SPELL_FLARE = 10113, - SPELL_FOLLY = 10137, -}; - -class npc_taskmaster_fizzule : public CreatureScript -{ -public: - npc_taskmaster_fizzule() : CreatureScript("npc_taskmaster_fizzule") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_taskmaster_fizzuleAI(creature); - } - - struct npc_taskmaster_fizzuleAI : public ScriptedAI - { - npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) - { - factionNorm = creature->getFaction(); - } - - uint32 factionNorm; - bool IsFriend; - uint32 ResetTimer; - uint8 FlareCount; - - void Reset() - { - IsFriend = false; - ResetTimer = 120000; - FlareCount = 0; - me->setFaction(factionNorm); - } - - void DoFriend() - { - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - - me->StopMoving(); - me->GetMotionMaster()->MoveIdle(); - - me->setFaction(FACTION_FRIENDLY_F); - me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - } - - void SpellHit(Unit* /*caster*/, const SpellInfo* spell) - { - if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) - { - ++FlareCount; - - if (FlareCount >= 2) - IsFriend = true; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (IsFriend) - { - if (ResetTimer <= diff) - { - EnterEvadeMode(); - return; - } else ResetTimer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void ReceiveEmote(Player* /*player*/, uint32 emote) - { - if (emote == TEXT_EMOTE_SALUTE) - { - if (FlareCount >= 2) - { - if (me->getFaction() == FACTION_FRIENDLY_F) - return; - - DoFriend(); - } - } - } - }; - -}; - -/*##### -## npc_twiggy_flathead -#####*/ - -enum TwiggyFlathead -{ - NPC_BIG_WILL = 6238, - NPC_AFFRAY_CHALLENGER = 6240, - - SAY_BIG_WILL_READY = 0, - SAY_TWIGGY_FLATHEAD_BEGIN = 0, - SAY_TWIGGY_FLATHEAD_FRAY = 1, - SAY_TWIGGY_FLATHEAD_DOWN = 2, - SAY_TWIGGY_FLATHEAD_OVER = 3 -}; - -Position const AffrayChallengerLoc[6] = -{ - {-1683.0f, -4326.0f, 2.79f, 0.0f}, - {-1682.0f, -4329.0f, 2.79f, 0.0f}, - {-1683.0f, -4330.0f, 2.79f, 0.0f}, - {-1680.0f, -4334.0f, 2.79f, 1.49f}, - {-1674.0f, -4326.0f, 2.79f, 3.49f}, - {-1677.0f, -4334.0f, 2.79f, 1.66f} -}; - -class npc_twiggy_flathead : public CreatureScript -{ -public: - npc_twiggy_flathead() : CreatureScript("npc_twiggy_flathead") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_twiggy_flatheadAI (creature); - } - - struct npc_twiggy_flatheadAI : public ScriptedAI - { - npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {} - - bool EventInProgress; - bool EventGrate; - bool EventBigWill; - bool ChallengerDown[6]; - uint8 Wave; - uint32 WaveTimer; - uint32 ChallengerChecker; - uint64 PlayerGUID; - uint64 AffrayChallenger[6]; - uint64 BigWill; - - void Reset() - { - EventInProgress = false; - EventGrate = false; - EventBigWill = false; - WaveTimer = 600000; - ChallengerChecker = 0; - Wave = 0; - PlayerGUID = 0; - - for (uint8 i = 0; i < 6; ++i) - { - AffrayChallenger[i] = 0; - ChallengerDown[i] = false; - } - BigWill = 0; - } - - void EnterCombat(Unit* /*who*/) { } - - void MoveInLineOfSight(Unit* who) - { - if (!who || (!who->isAlive())) - return; - - if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) - { - PlayerGUID = who->GetGUID(); - EventInProgress = true; - } - } - - void KilledUnit(Unit* /*victim*/) { } - - void UpdateAI(const uint32 diff) - { - if (EventInProgress) { - Player* pWarrior = NULL; - - if (PlayerGUID) - pWarrior = Unit::GetPlayer(*me, PlayerGUID); - - if (!pWarrior) - return; - - if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { - Talk(SAY_TWIGGY_FLATHEAD_DOWN); - pWarrior->FailQuest(1719); - - for (uint8 i = 0; i < 6; ++i) // unsummon challengers - { - if (AffrayChallenger[i]) - { - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if (creature && creature->isAlive()) - creature->DisappearAndDie(); - } - } - - if (BigWill) // unsummon bigWill - { - Creature* creature = Unit::GetCreature((*me), BigWill); - if (creature && creature->isAlive()) - creature->DisappearAndDie(); - } - Reset(); - } - - if (!EventGrate && EventInProgress) - { - float x, y, z; - pWarrior->GetPosition(x, y, z); - - if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { - pWarrior->AreaExploredOrEventHappens(1719); - Talk(SAY_TWIGGY_FLATHEAD_BEGIN, pWarrior->GetGUID()); - - for (uint8 i = 0; i < 6; ++i) - { - Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - if (!creature) - continue; - creature->setFaction(35); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - AffrayChallenger[i] = creature->GetGUID(); - } - WaveTimer = 5000; - ChallengerChecker = 1000; - EventGrate = true; - } - } - else if (EventInProgress) - { - if (ChallengerChecker <= diff) - { - for (uint8 i = 0; i < 6; ++i) - { - if (AffrayChallenger[i]) - { - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); - if ((!creature || (!creature->isAlive())) && !ChallengerDown[i]) - { - Talk(SAY_TWIGGY_FLATHEAD_DOWN); - ChallengerDown[i] = true; - } - } - } - ChallengerChecker = 1000; - } else ChallengerChecker -= diff; - - if (WaveTimer <= diff) - { - if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) - { - Talk(SAY_TWIGGY_FLATHEAD_FRAY); - Creature* creature = Unit::GetCreature((*me), AffrayChallenger[Wave]); - if (creature && (creature->isAlive())) - { - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - creature->setFaction(14); - creature->AI()->AttackStart(pWarrior); - ++Wave; - WaveTimer = 20000; - } - } - else if (Wave >= 6 && !EventBigWill) { - if (Creature* creature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12f, 6.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) - { - BigWill = creature->GetGUID(); - //creature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32f); - //creature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78f); - creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); - creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); - EventBigWill = true; - WaveTimer = 1000; - } - } - else if (Wave >= 6 && EventBigWill && BigWill) - { - Creature* creature = Unit::GetCreature((*me), BigWill); - if (!creature || !creature->isAlive()) - { - Talk(SAY_TWIGGY_FLATHEAD_OVER); - Reset(); - } - } - } else WaveTimer -= diff; - } - } - } - }; - -}; - -/*##### -## npc_wizzlecrank_shredder -#####*/ - -enum Wizzlecrank -{ - SAY_MERCENARY = 0, - SAY_START = 0, - SAY_STARTUP1 = 1, - SAY_STARTUP2 = 2, - SAY_PROGRESS_1 = 3, - SAY_PROGRESS_2 = 4, - SAY_PROGRESS_3 = 5, - SAY_END = 6, - - QUEST_ESCAPE = 863, - FACTION_RATCHET = 637, - NPC_PILOT_WIZZ = 3451, - NPC_MERCENARY = 3282, -}; - -class npc_wizzlecrank_shredder : public CreatureScript -{ -public: - npc_wizzlecrank_shredder() : CreatureScript("npc_wizzlecrank_shredder") { } - - struct npc_wizzlecrank_shredderAI : public npc_escortAI - { - npc_wizzlecrank_shredderAI(Creature* creature) : npc_escortAI(creature) - { - IsPostEvent = false; - PostEventTimer = 1000; - PostEventCount = 0; - } - - bool IsPostEvent; - uint32 PostEventTimer; - uint32 PostEventCount; - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (me->getStandState() == UNIT_STAND_STATE_DEAD) - me->SetStandState(UNIT_STAND_STATE_STAND); - - IsPostEvent = false; - PostEventTimer = 1000; - PostEventCount = 0; - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - Talk(SAY_STARTUP1); - break; - case 9: - SetRun(false); - break; - case 17: - if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) - { - temp->AI()->Talk(SAY_MERCENARY); - me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); - } - break; - case 24: - IsPostEvent = true; - break; - } - } - - void WaypointStart(uint32 PointId) - { - Player* player = GetPlayerForEscort(); - - if (!player) - return; - - switch (PointId) - { - case 9: - Talk(SAY_STARTUP2, player->GetGUID()); - break; - case 18: - Talk(SAY_PROGRESS_1, player->GetGUID()); - SetRun(); - break; - } - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == NPC_PILOT_WIZZ) - me->SetStandState(UNIT_STAND_STATE_DEAD); - - if (summoned->GetEntry() == NPC_MERCENARY) - summoned->AI()->AttackStart(me); - } - - void UpdateEscortAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (IsPostEvent) - { - if (PostEventTimer <= Diff) - { - switch (PostEventCount) - { - case 0: - Talk(SAY_PROGRESS_2); - break; - case 1: - Talk(SAY_PROGRESS_3); - break; - case 2: - Talk(SAY_END); - break; - case 3: - if (Player* player = GetPlayerForEscort()) - { - player->GroupEventHappens(QUEST_ESCAPE, me); - me->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); - } - break; - } - - ++PostEventCount; - PostEventTimer = 5000; - } - else - PostEventTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_ESCAPE) - { - creature->setFaction(FACTION_RATCHET); - if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_wizzlecrank_shredderAI(creature); - } - -}; - -void AddSC_the_barrens() -{ - new npc_beaten_corpse(); - new npc_gilthares(); - new npc_sputtervalve(); - new npc_taskmaster_fizzule(); - new npc_twiggy_flathead(); - new npc_wizzlecrank_shredder(); -} diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/thousand_needles.cpp deleted file mode 100644 index 9c47991a5d5..00000000000 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Thousand Needles -SD%Complete: 100 -SDComment: Support for Quest: 1950, 4770, 4904, 4966, 5151. -SDCategory: Thousand Needles -EndScriptData */ - -/* ContentData -npc_kanati -npc_lakota_windsong -npc_swiftmountain -npc_plucky -npc_enraged_panther -go_panther_cage -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*##### -# npc_kanati -######*/ - -enum Kanati -{ - SAY_KAN_START = 0, - - QUEST_PROTECT_KANATI = 4966, - NPC_GALAK_ASS = 10720 -}; - -Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f}; - -class npc_kanati : public CreatureScript -{ -public: - npc_kanati() : CreatureScript("npc_kanati") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_PROTECT_KANATI) - if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest, true); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_kanatiAI(creature); - } - - struct npc_kanatiAI : public npc_escortAI - { - npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - Talk(SAY_KAN_START); - DoSpawnGalak(); - break; - case 1: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_PROTECT_KANATI, me); - break; - } - } - - void DoSpawnGalak() - { - for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - }; - -}; - -/*###### -# npc_lakota_windsong -######*/ - -enum Lakota -{ - SAY_LAKO_START = 0, - SAY_LAKO_LOOK_OUT = 1, - SAY_LAKO_HERE_COME = 2, - SAY_LAKO_MORE = 3, - SAY_LAKO_END = 4, - - QUEST_FREE_AT_LAST = 4904, - NPC_GRIM_BANDIT = 10758, - FACTION_ESCORTEE_LAKO = 232, //guessed - - ID_AMBUSH_1 = 0, - ID_AMBUSH_2 = 2, - ID_AMBUSH_3 = 4 -}; - -Position const BanditLoc[6] = -{ - {-4905.479492f, -2062.732666f, 84.352f, 0.0f}, - {-4915.201172f, -2073.528320f, 84.733f, 0.0f}, - {-4878.883301f, -1986.947876f, 91.966f, 0.0f}, - {-4877.503906f, -1966.113403f, 91.859f, 0.0f}, - {-4767.985352f, -1873.169189f, 90.192f, 0.0f}, - {-4788.861328f, -1888.007813f, 89.888f, 0.0f} -}; - -class npc_lakota_windsong : public CreatureScript -{ -public: - npc_lakota_windsong() : CreatureScript("npc_lakota_windsong") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_FREE_AT_LAST) - { - creature->AI()->Talk(SAY_LAKO_START, player->GetGUID()); - creature->setFaction(FACTION_ESCORTEE_LAKO); - - if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lakota_windsongAI(creature); - } - - struct npc_lakota_windsongAI : public npc_escortAI - { - npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 8: - Talk(SAY_LAKO_LOOK_OUT); - DoSpawnBandits(ID_AMBUSH_1); - break; - case 14: - Talk(SAY_LAKO_HERE_COME); - DoSpawnBandits(ID_AMBUSH_2); - break; - case 21: - Talk(SAY_LAKO_MORE); - DoSpawnBandits(ID_AMBUSH_3); - break; - case 45: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_FREE_AT_LAST, me); - break; - } - } - - void DoSpawnBandits(int AmbushId) - { - for (int i = 0; i < 2; ++i) - me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } - }; - -}; - -/*###### -# npc_paoka_swiftmountain -######*/ - -enum Packa -{ - SAY_START = 0, - SAY_WYVERN = 1, - SAY_COMPLETE = 2, - - QUEST_HOMEWARD = 4770, - NPC_WYVERN = 4107, - FACTION_ESCORTEE = 232 //guessed -}; - -Position const WyvernLoc[3] = -{ - {-4990.606f, -906.057f, -5.343f, 0.0f}, - {-4970.241f, -927.378f, -4.951f, 0.0f}, - {-4985.364f, -952.528f, -5.199f, 0.0f} -}; - -class npc_paoka_swiftmountain : public CreatureScript -{ -public: - npc_paoka_swiftmountain() : CreatureScript("npc_paoka_swiftmountain") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_HOMEWARD) - { - creature->AI()->Talk(SAY_START, player->GetGUID()); - creature->setFaction(FACTION_ESCORTEE); - - if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_paoka_swiftmountainAI(creature); - } - - struct npc_paoka_swiftmountainAI : public npc_escortAI - { - npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() {} - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 15: - Talk(SAY_WYVERN); - DoSpawnWyvern(); - break; - case 26: - Talk(SAY_COMPLETE); - break; - case 27: - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_HOMEWARD, me); - break; - } - } - - void DoSpawnWyvern() - { - for (int i = 0; i < 3; ++i) - me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - } - }; -}; - -/*##### -# npc_plucky -######*/ - -#define GOSSIP_P "Please tell me the Phrase.." - -enum Plucky -{ - FACTION_FRIENDLY = 35, - QUEST_SCOOP = 1950, - SPELL_PLUCKY_HUMAN = 9192, - SPELL_PLUCKY_CHICKEN = 9220 -}; - -class npc_plucky : public CreatureScript -{ -public: - npc_plucky() : CreatureScript("npc_plucky") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->CLOSE_GOSSIP_MENU(); - player->CompleteQuest(QUEST_SCOOP); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(738, creature->GetGUID()); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_pluckyAI(creature); - } - - struct npc_pluckyAI : public ScriptedAI - { - npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } - - uint32 NormFaction; - uint32 ResetTimer; - - void Reset() - { - ResetTimer = 120000; - - if (me->getFaction() != NormFaction) - me->setFaction(NormFaction); - - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - DoCast(me, SPELL_PLUCKY_CHICKEN, false); - } - - void ReceiveEmote(Player* player, uint32 TextEmote) - { - if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) - { - if (TextEmote == TEXT_EMOTE_BECKON) - { - me->setFaction(FACTION_FRIENDLY); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(me, SPELL_PLUCKY_HUMAN, false); - } - } - - if (TextEmote == TEXT_EMOTE_CHICKEN) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - return; - else - { - 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 Diff) - { - if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) - { - if (ResetTimer <= Diff) - { - if (!me->getVictim()) - EnterEvadeMode(); - else - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - return; - } - else - ResetTimer -= Diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -enum PantherCage -{ - ENRAGED_PANTHER = 10992 -}; - -class go_panther_cage : public GameObjectScript -{ -public: - go_panther_cage() : GameObjectScript("go_panther_cage") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - go->UseDoorOrButton(); - if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) - { - if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) - { - panther->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - panther->SetReactState(REACT_AGGRESSIVE); - panther->AI()->AttackStart(player); - } - } - - return true; - } -}; - -class npc_enraged_panther : public CreatureScript -{ -public: - npc_enraged_panther() : CreatureScript("npc_enraged_panther") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_enraged_pantherAI(creature); - } - - struct npc_enraged_pantherAI : public ScriptedAI - { - npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_thousand_needles() -{ - new npc_kanati(); - new npc_lakota_windsong(); - new npc_paoka_swiftmountain(); - new npc_plucky(); - new npc_enraged_panther(); - new go_panther_cage(); -} diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/thunder_bluff.cpp deleted file mode 100644 index 0d915dc7c44..00000000000 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Thunder_Bluff -SD%Complete: 100 -SDComment: Quest support: 925 -SDCategory: Thunder Bluff -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*##### -# npc_cairne_bloodhoof -######*/ - -enum CairneBloodhoof -{ - SPELL_BERSERKER_CHARGE = 16636, - SPELL_CLEAVE = 16044, - SPELL_MORTAL_STRIKE = 16856, - SPELL_THUNDERCLAP = 23931, - SPELL_UPPERCUT = 22916 -}; - -#define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." -//TODO: verify abilities/timers -class npc_cairne_bloodhoof : public CreatureScript -{ -public: - npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_SENDER_INFO) - { - player->CastSpell(player, 23123, false); - player->SEND_GOSSIP_MENU(7014, creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - - player->SEND_GOSSIP_MENU(7013, creature->GetGUID()); - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_cairne_bloodhoofAI (creature); - } - - struct npc_cairne_bloodhoofAI : public ScriptedAI - { - npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 BerserkerChargeTimer; - uint32 CleaveTimer; - uint32 MortalStrikeTimer; - uint32 ThunderclapTimer; - uint32 UppercutTimer; - - void Reset() - { - BerserkerChargeTimer = 30000; - CleaveTimer = 5000; - MortalStrikeTimer = 10000; - ThunderclapTimer = 15000; - UppercutTimer = 10000; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BerserkerChargeTimer <= diff) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_BERSERKER_CHARGE); - BerserkerChargeTimer = 25000; - } else BerserkerChargeTimer -= diff; - - if (UppercutTimer <= diff) - { - DoCast(me->getVictim(), SPELL_UPPERCUT); - UppercutTimer = 20000; - } else UppercutTimer -= diff; - - if (ThunderclapTimer <= diff) - { - DoCast(me->getVictim(), SPELL_THUNDERCLAP); - ThunderclapTimer = 15000; - } else ThunderclapTimer -= diff; - - if (MortalStrikeTimer <= diff) - { - DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrikeTimer = 15000; - } else MortalStrikeTimer -= diff; - - if (CleaveTimer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - CleaveTimer = 7000; - } else CleaveTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_thunder_bluff() -{ - new npc_cairne_bloodhoof(); -} diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/ungoro_crater.cpp deleted file mode 100644 index e72c82bee97..00000000000 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ /dev/null @@ -1,348 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Ungoro Crater -SD%Complete: 100 -SDComment: Support for Quest: 4245, 4491 -SDCategory: Ungoro Crater -EndScriptData */ - -/* ContentData -npc_a-me -npc_ringo -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "ScriptedFollowerAI.h" -#include "Player.h" -#include "SpellInfo.h" - -enum AmeData -{ - SAY_READY = 0, - SAY_AGGRO1 = 1, - SAY_SEARCH = 2, - SAY_AGGRO2 = 3, - SAY_AGGRO3 = 4, - SAY_FINISH = 5, - - SPELL_DEMORALIZINGSHOUT = 13730, - - QUEST_CHASING_AME = 4245, - ENTRY_TARLORD = 6519, - ENTRY_TARLORD1 = 6519, - ENTRY_STOMPER = 6513, -}; - -class npc_ame : public CreatureScript -{ -public: - npc_ame() : CreatureScript("npc_ame") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_CHASING_AME) - { - CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); - creature->AI()->Talk(SAY_READY, player->GetGUID()); - creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - // Change faction so mobs attack - creature->setFaction(113); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ameAI(creature); - } - - struct npc_ameAI : public npc_escortAI - { - npc_ameAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 DemoralizingShoutTimer; - - void WaypointReached(uint32 waypointId) - { - if (Player* player = GetPlayerForEscort()) - { - switch (waypointId) - { - case 19: - me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - Talk(SAY_AGGRO1, player->GetGUID()); - break; - case 28: - Talk(SAY_SEARCH, player->GetGUID()); - break; - case 38: - me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - Talk(SAY_AGGRO2, player->GetGUID()); - break; - case 49: - me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - Talk(SAY_AGGRO3, player->GetGUID()); - break; - case 55: - Talk(SAY_FINISH, player->GetGUID()); - player->GroupEventHappens(QUEST_CHASING_AME, me); - break; - } - } - } - - void Reset() - { - DemoralizingShoutTimer = 5000; - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_CHASING_AME); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; - - if (DemoralizingShoutTimer <= diff) - { - DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); - DemoralizingShoutTimer = 70000; - } else DemoralizingShoutTimer -= diff; - } - }; -}; - -/*#### -# npc_ringo -####*/ - -enum Ringo -{ - SAY_RIN_START = 0, - - SAY_FAINT = 1, - - SAY_WAKE = 2, - - SAY_RIN_END_1 = 3, - SAY_SPR_END_2 = 0, - SAY_RIN_END_3 = 4, - EMOTE_RIN_END_4 = 5, - EMOTE_RIN_END_5 = 6, - SAY_RIN_END_6 = 7, - SAY_SPR_END_7 = 1, - EMOTE_RIN_END_8 = 8, - - SPELL_REVIVE_RINGO = 15591, - QUEST_A_LITTLE_HELP = 4491, - NPC_SPRAGGLE = 9997, - FACTION_ESCORTEE = 113 -}; - -class npc_ringo : public CreatureScript -{ -public: - npc_ringo() : CreatureScript("npc_ringo") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_A_LITTLE_HELP) - { - if (npc_ringoAI* ringoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - ringoAI->StartFollow(player, FACTION_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ringoAI(creature); - } - - struct npc_ringoAI : public FollowerAI - { - npc_ringoAI(Creature* creature) : FollowerAI(creature) { } - - uint32 FaintTimer; - uint32 EndEventProgress; - uint32 EndEventTimer; - - uint64 SpraggleGUID; - - void Reset() - { - FaintTimer = urand(30000, 60000); - EndEventProgress = 0; - EndEventTimer = 1000; - SpraggleGUID = 0; - } - - void MoveInLineOfSight(Unit* who) - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_SPRAGGLE) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_A_LITTLE_HELP, me); - } - - SpraggleGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) - ClearFaint(); - } - - void SetFaint() - { - if (!HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - SetFollowPaused(true); - - Talk(SAY_FAINT); - } - - //what does actually happen here? Emote? Aura? - me->SetStandState(UNIT_STAND_STATE_SLEEP); - } - - void ClearFaint() - { - me->SetStandState(UNIT_STAND_STATE_STAND); - - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - return; - - Talk(SAY_WAKE); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(const uint32 Diff) - { - if (!UpdateVictim()) - { - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (EndEventTimer <= Diff) - { - Creature* spraggle = Creature::GetCreature(*me, SpraggleGUID); - if (!spraggle || !spraggle->isAlive()) - { - SetFollowComplete(); - return; - } - - switch (EndEventProgress) - { - case 1: - Talk(SAY_RIN_END_1); - EndEventTimer = 3000; - break; - case 2: - spraggle->AI()->Talk(SAY_SPR_END_2); - EndEventTimer = 5000; - break; - case 3: - Talk(SAY_RIN_END_3); - EndEventTimer = 1000; - break; - case 4: - Talk(EMOTE_RIN_END_4); - SetFaint(); - EndEventTimer = 9000; - break; - case 5: - Talk(EMOTE_RIN_END_5); - ClearFaint(); - EndEventTimer = 1000; - break; - case 6: - Talk(SAY_RIN_END_6); - EndEventTimer = 3000; - break; - case 7: - spraggle->AI()->Talk(SAY_SPR_END_7); - EndEventTimer = 10000; - break; - case 8: - Talk(EMOTE_RIN_END_8); - EndEventTimer = 5000; - break; - case 9: - SetFollowComplete(); - break; - } - - ++EndEventProgress; - } - else - EndEventTimer -= Diff; - } - else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FaintTimer <= Diff) - { - SetFaint(); - FaintTimer = urand(60000, 120000); - } - else - FaintTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_ungoro_crater() -{ - new npc_ame(); - new npc_ringo(); -} diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/winterspring.cpp deleted file mode 100644 index 06f01033a25..00000000000 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -/* ScriptData -SDName: Winterspring -SD%Complete: Almost Completely Emptied -SDComment: Vendor Rivern Frostwind. -SDCategory: Winterspring -EndScriptData */ - -/* ContentData -npc_rivern_frostwind -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "WorldSession.h" - -/*###### -## npc_rivern_frostwind -######*/ - -class npc_rivern_frostwind : public CreatureScript -{ -public: - npc_rivern_frostwind() : CreatureScript("npc_rivern_frostwind") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_TRADE) - player->GetSession()->SendListInventory(creature->GetGUID()); - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor() && player->GetReputationRank(589) == REP_EXALTED) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - -}; - -void AddSC_winterspring() -{ - new npc_rivern_frostwind(); -} diff --git a/src/server/scripts/Kalimdor/zone_ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp new file mode 100644 index 00000000000..94c68a1d3ec --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp @@ -0,0 +1,486 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Ashenvale +SD%Complete: 70 +SDComment: Quest support: 6544, 6482 +SDCategory: Ashenvale Forest +EndScriptData */ + +/* ContentData +npc_torek +npc_ruul_snowhoof +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*#### +# npc_torek +####*/ + +enum TorekSays +{ + SAY_READY = 0, + SAY_MOVE = 1, + SAY_PREPARE = 2, + SAY_WIN = 3, + SAY_END = 4, +}; + +enum TorekSpells +{ + SPELL_REND = 11977, + SPELL_THUNDERCLAP = 8078, +}; + +enum TorekMisc +{ + QUEST_TOREK_ASSULT = 6544, + + ENTRY_SPLINTERTREE_RAIDER = 12859, + ENTRY_DURIEL = 12860, + ENTRY_SILVERWING_SENTINEL = 12896, + ENTRY_SILVERWING_WARRIOR = 12897, +}; + +class npc_torek : public CreatureScript +{ + public: + + npc_torek() : CreatureScript("npc_torek") + { + } + + struct npc_torekAI : public npc_escortAI + { + npc_torekAI(Creature* creature) : npc_escortAI(creature) {} + + uint32 Rend_Timer; + uint32 Thunderclap_Timer; + bool Completed; + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 1: + Talk(SAY_MOVE, player->GetGUID()); + break; + case 8: + Talk(SAY_PREPARE, player->GetGUID()); + 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->GetGUID()); + Completed = true; + player->GroupEventHappens(QUEST_TOREK_ASSULT, me); + break; + case 21: + Talk(SAY_END, player->GetGUID()); + break; + } + } + } + + void Reset() + { + Rend_Timer = 5000; + Thunderclap_Timer = 8000; + Completed = false; + } + + void EnterCombat(Unit* /*who*/) + { + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (Rend_Timer <= diff) + { + DoCast(me->getVictim(), 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 + { + return new npc_torekAI(creature); + } + + bool OnQuestAccept(Player* player, Creature* creature, 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?) + creature->AI()->Talk(SAY_READY, player->GetGUID()); + creature->setFaction(113); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_torekAI, creature->AI())) + pEscortAI->Start(true, true, player->GetGUID()); + } + + return true; + } +}; + +/*#### +# npc_ruul_snowhoof +####*/ + +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} +}; + +class npc_ruul_snowhoof : public CreatureScript +{ + public: + npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { } + + struct npc_ruul_snowhoofAI : public npc_escortAI + { + npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + 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*/) {} + + void Reset() + { + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_READY); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_ruul_snowhoofAI(creature); + } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + 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; + } +}; + +enum Muglash +{ + SAY_MUG_START1 = 0, + SAY_MUG_START2 = 1, + SAY_MUG_BRAZIER = 2, + SAY_MUG_BRAZIER_WAIT = 3, + SAY_MUG_ON_GUARD = 4, + SAY_MUG_REST = 5, + SAY_MUG_DONE = 6, + SAY_MUG_GRATITUDE = 7, + SAY_MUG_PATROL = 8, + SAY_MUG_RETURN = 9, + + QUEST_VORSHA = 6641, + + GO_NAGA_BRAZIER = 178247, + + NPC_WRATH_RIDER = 3713, + NPC_WRATH_SORCERESS = 3717, + NPC_WRATH_RAZORTAIL = 3712, + + NPC_WRATH_PRIESTESS = 3944, + NPC_WRATH_MYRMIDON = 3711, + NPC_WRATH_SEAWITCH = 3715, + + NPC_VORSHA = 12940, + NPC_MUGLASH = 12717 +}; + +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 +}; + +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 +}; + +Position const VorshaCoord = {3633.056885f, 1172.924072f, -5.388f, 0.0f}; + +class npc_muglash : public CreatureScript +{ + public: + npc_muglash() : CreatureScript("npc_muglash") { } + + struct npc_muglashAI : public npc_escortAI + { + npc_muglashAI(Creature* creature) : npc_escortAI(creature) { } + + uint8 WaveId; + uint32 EventTimer; + bool IsBrazierExtinguished; + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 0: + Talk(SAY_MUG_START2, player->GetGUID()); + break; + case 24: + Talk(SAY_MUG_BRAZIER, player->GetGUID()); + + if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) + { + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + SetEscortPaused(true); + } + break; + case 25: + Talk(SAY_MUG_GRATITUDE); + player->GroupEventHappens(QUEST_VORSHA, me); + break; + case 26: + Talk(SAY_MUG_PATROL); + break; + case 27: + Talk(SAY_MUG_RETURN); + break; + } + } + } + + void EnterCombat(Unit* /*who*/) + { + if (Player* player = GetPlayerForEscort()) + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (urand(0, 1)) + Talk(SAY_MUG_ON_GUARD, player->GetGUID()); + return; + } + } + + void Reset() + { + EventTimer = 10000; + WaveId = 0; + IsBrazierExtinguished = false; + } + + void JustDied(Unit* /*killer*/) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + if (Player* player = GetPlayerForEscort()) + player->FailQuest(QUEST_VORSHA); + } + + void DoWaveSummon() + { + switch (WaveId) + { + case 1: + me->SummonCreature(NPC_WRATH_RIDER, FirstNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SORCERESS, FirstNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_RAZORTAIL, FirstNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 2: + me->SummonCreature(NPC_WRATH_PRIESTESS, SecondNagaCoord[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_MYRMIDON, SecondNagaCoord[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + me->SummonCreature(NPC_WRATH_SEAWITCH, SecondNagaCoord[2], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 3: + me->SummonCreature(NPC_VORSHA, VorshaCoord, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 4: + SetEscortPaused(false); + Talk(SAY_MUG_DONE); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (!me->getVictim()) + { + if (HasEscortState(STATE_ESCORT_PAUSED) && IsBrazierExtinguished) + { + if (EventTimer < uiDiff) + { + ++WaveId; + DoWaveSummon(); + EventTimer = 10000; + } + else + EventTimer -= uiDiff; + } + return; + } + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_muglashAI(creature); + } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + 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; + } +}; + +class go_naga_brazier : public GameObjectScript +{ + public: + go_naga_brazier() : GameObjectScript("go_naga_brazier") { } + + bool OnGossipHello(Player* /*player*/, GameObject* go) + { + if (Creature* creature = GetClosestCreatureWithEntry(go, NPC_MUGLASH, INTERACTION_DISTANCE*2)) + { + if (npc_muglash::npc_muglashAI* pEscortAI = CAST_AI(npc_muglash::npc_muglashAI, creature->AI())) + { + creature->AI()->Talk(SAY_MUG_BRAZIER_WAIT); + + pEscortAI->IsBrazierExtinguished = true; + return false; + } + } + + return true; + } +}; + +void AddSC_ashenvale() +{ + new npc_torek(); + new npc_ruul_snowhoof(); + new npc_muglash(); + new go_naga_brazier(); +} diff --git a/src/server/scripts/Kalimdor/zone_azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp new file mode 100644 index 00000000000..44f7e1e8172 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp @@ -0,0 +1,525 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Azshara +SD%Complete: 90 +SDComment: Quest support: 2744, 3141, 9364, 10994 +SDCategory: Azshara +EndScriptData */ + +/* ContentData +mobs_spitelashes +npc_loramus_thalipedes +mob_rizzle_sprysprocket +mob_depth_charge +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" +#include "SpellInfo.h" +#include "WorldSession.h" + +/*###### +## mobs_spitelashes +######*/ + +class mobs_spitelashes : public CreatureScript +{ +public: + mobs_spitelashes() : CreatureScript("mobs_spitelashes") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new mobs_spitelashesAI (creature); + } + + struct mobs_spitelashesAI : public ScriptedAI + { + mobs_spitelashesAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 morphtimer; + bool spellhit; + + void Reset() + { + morphtimer = 0; + spellhit = false; + } + + void EnterCombat(Unit* /*who*/) { } + + void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) + { + if (!spellhit && + Hitter->GetTypeId() == TYPEID_PLAYER && + CAST_PLR(Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && + (Spellkind->Id == 118 || Spellkind->Id == 12824 || Spellkind->Id == 12825 || Spellkind->Id == 12826)) + { + spellhit=true; + DoCast(me, 29124); //become a sheep + } + } + + void UpdateAI(const uint32 diff) + { + // 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) + { + me->DespawnOrUnsummon(); + return; + } + // walk 5 seconds before summoning + if (spellhit && morphtimer<5000) + { + morphtimer+=diff; + if (morphtimer >= 5000) + { + DoCast(me, 28406); //summon copies + DoCast(me, 6924); //visual explosion + } + } + if (!UpdateVictim()) + return; + + //TODO: add abilities for the different creatures + DoMeleeAttackIfReady(); + } + }; + +}; + +/*###### +## npc_loramus_thalipedes +######*/ + +#define GOSSIP_HELLO_LT1 "Can you help me?" +#define GOSSIP_HELLO_LT2 "Tell me your story" +#define GOSSIP_SELECT_LT1 "Please continue" +#define GOSSIP_SELECT_LT2 "I do not understand" +#define GOSSIP_SELECT_LT3 "Indeed" +#define GOSSIP_SELECT_LT4 "I will do this with or your help, Loramus" +#define GOSSIP_SELECT_LT5 "Yes" + +class npc_loramus_thalipedes : public CreatureScript +{ +public: + npc_loramus_thalipedes() : CreatureScript("npc_loramus_thalipedes") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(2744); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + player->SEND_GOSSIP_MENU(1813, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + player->SEND_GOSSIP_MENU(1814, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); + player->SEND_GOSSIP_MENU(1815, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+23: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); + player->SEND_GOSSIP_MENU(1816, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+24: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_LT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); + player->SEND_GOSSIP_MENU(1817, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+25: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(3141); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (player->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_LT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +/*#### +# mob_rizzle_sprysprocket +####*/ + +enum RizzleSprysprocketData +{ + QUEST_CHASING_THE_MOONSTONE = 10994, + + MOB_DEPTH_CHARGE = 23025, + + SPELL_RIZZLE_BLACKJACK = 39865, + SPELL_RIZZLE_ESCAPE = 39871, + SPELL_RIZZLE_FROST_GRENADE = 40525, + SPELL_DEPTH_CHARGE_TRAP = 38576, + SPELL_PERIODIC_DEPTH_CHARGE = 39912, + SPELL_GIVE_SOUTHFURY_MOONSTONE = 39886, + + SAY_RIZZLE_START = 0, + SAY_RIZZLE_GRENADE = 1, + SAY_RIZZLE_FINAL = 2, + MSG_ESCAPE_NOTICE = 3 +}; + +#define GOSSIP_GET_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." + +Position const WPs[58] = +{ + {3691.97f, -3962.41f, 35.9118f, 3.67f}, + {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}, + {3569.94f, -3970.25f, 29.9118f, 3.44f}, + {3541.03f, -3975.64f, 29.9118f, 3.41f}, + {3510.84f, -3978.71f, 29.9118f, 3.41f}, + {3472.7f, -3997.07f, 29.9118f, 3.35f}, + {3439.15f, -4014.55f, 29.9118f, 3.29f}, + {3412.8f, -4025.87f, 29.9118f, 3.25f}, + {3384.95f, -4038.04f, 29.9118f, 3.24f}, + {3346.77f, -4052.93f, 29.9118f, 3.22f}, + {3299.56f, -4071.59f, 29.9118f, 3.20f}, + {3261.22f, -4080.38f, 30.9118f, 3.19f}, + {3220.68f, -4083.09f, 31.9118f, 3.18f}, + {3187.11f, -4070.45f, 33.9118f, 3.16f}, + {3162.78f, -4062.75f, 33.9118f, 3.15f}, + {3136.09f, -4050.32f, 33.9118f, 3.07f}, + {3119.47f, -4044.51f, 36.0363f, 3.07f}, + {3098.95f, -4019.8f, 33.9118f, 3.07f}, + {3073.07f, -4011.42f, 33.9118f, 3.07f}, + {3051.71f, -3993.37f, 33.9118f, 3.02f}, + {3027.52f, -3978.6f, 33.9118f, 3.00f}, + {3003.78f, -3960.14f, 33.9118f, 2.98f}, + {2977.99f, -3941.98f, 31.9118f, 2.96f}, + {2964.57f, -3932.07f, 30.9118f, 2.96f}, + {2947.9f, -3921.31f, 29.9118f, 2.96f}, + {2924.91f, -3910.8f, 29.9118f, 2.94f}, + {2903.04f, -3896.42f, 29.9118f, 2.93f}, + {2884.75f, -3874.03f, 29.9118f, 2.90f}, + {2868.19f, -3851.48f, 29.9118f, 2.82f}, + {2854.62f, -3819.72f, 29.9118f, 2.80f}, + {2825.53f, -3790.4f, 29.9118f, 2.744f}, + {2804.31f, -3773.05f, 29.9118f, 2.71f}, + {2769.78f, -3763.57f, 29.9118f, 2.70f}, + {2727.23f, -3745.92f, 30.9118f, 2.69f}, + {2680.12f, -3737.49f, 30.9118f, 2.67f}, + {2647.62f, -3739.94f, 30.9118f, 2.66f}, + {2616.6f, -3745.75f, 30.9118f, 2.64f}, + {2589.38f, -3731.97f, 30.9118f, 2.61f}, + {2562.94f, -3722.35f, 31.9118f, 2.56f}, + {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}, + {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}, + {2075.73f, -3643.59f, 31.9118f, 3.22f}, + {2033.59f, -3649.52f, 31.9118f, 3.42f}, + {1985.22f, -3662.99f, 31.9118f, 3.42f}, + {1927.09f, -3679.56f, 33.9118f, 3.42f}, + {1873.57f, -3695.32f, 33.9118f, 3.44f} +}; + +class mob_rizzle_sprysprocket : public CreatureScript +{ +public: + mob_rizzle_sprysprocket() : CreatureScript("mob_rizzle_sprysprocket") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + 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(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDieTimer = 3000; + CAST_AI(mob_rizzle_sprysprocket::mob_rizzle_sprysprocketAI, creature->AI())->MustDie = true; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + 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 + { + return new mob_rizzle_sprysprocketAI (creature); + } + + struct mob_rizzle_sprysprocketAI : public ScriptedAI + { + mob_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() + { + SpellEscapeTimer = 1300; + TeleportTimer = 3500; + CheckTimer = 10000; + GrenadeTimer = 30000; + MustDieTimer = 3000; + CurrWP = 0; + + PlayerGUID = 0; + + MustDie = false; + Escape = false; + ContinueWP = false; + Reached = false; + } + + void UpdateAI(const uint32 diff) + { + if (MustDie) + { + if (MustDieTimer <= diff) + { + me->DespawnOrUnsummon(); + return; + } else MustDieTimer -= diff; + } + + if (!Escape) + { + if (!PlayerGUID) + return; + + if (SpellEscapeTimer <= diff) + { + DoCast(me, SPELL_RIZZLE_ESCAPE, false); + SpellEscapeTimer = 10000; + } else SpellEscapeTimer -= diff; + + if (TeleportTimer <= diff) + { + // temp solution - unit can't be teleported by core using spelleffect 5, only players + DoTeleportTo(3706.39f, -3969.15f, 35.9118f); + + //begin swimming and summon depth charges + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (!player) + return; + + Talk(MSG_ESCAPE_NOTICE, player->GetGUID()); + 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]); + Escape = true; + } else TeleportTimer -= diff; + + return; + } + + if (ContinueWP) + { + me->GetMotionMaster()->MovePoint(CurrWP, WPs[CurrWP]); + ContinueWP = false; + } + + if (GrenadeTimer <= diff) + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player) + { + Talk(SAY_RIZZLE_GRENADE, player->GetGUID()); + DoCast(player, SPELL_RIZZLE_FROST_GRENADE, true); + } + GrenadeTimer = 30000; + } else GrenadeTimer -= diff; + + if (CheckTimer <= diff) + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (!player) + { + me->DespawnOrUnsummon(); + return; + } + + if (me->IsWithinDist(player, 10) && me->GetPositionX() > player->GetPositionX() && !Reached) + { + Talk(SAY_RIZZLE_FINAL); + me->SetUInt32Value(UNIT_NPC_FLAGS, 1); + me->setFaction(35); + me->GetMotionMaster()->MoveIdle(); + me->RemoveAurasDueToSpell(SPELL_PERIODIC_DEPTH_CHARGE); + Reached = true; + } + + CheckTimer = 1000; + } else CheckTimer -= diff; + + } + + void SendText(int32 iTextEntry, Player* player) + { + LocaleConstant loc_idx = player->GetSession()->GetSessionDbLocaleIndex(); + const char* text = sObjectMgr->GetTrinityString(iTextEntry, loc_idx); + sWorld->SendServerMessage(SERVER_MSG_STRING, text, player); + } + + void AttackStart(Unit* who) + { + if (!who || PlayerGUID) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->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*/) {} + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 57) + { + me->DespawnOrUnsummon(); + return; + } + + ++CurrWP; + ContinueWP = true; + } + }; +}; + +/*#### +# mob_depth_charge +####*/ +class mob_depth_charge : public CreatureScript +{ +public: + mob_depth_charge() : CreatureScript("mob_depth_charge") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_depth_chargeAI (creature); + } + + struct mob_depth_chargeAI : public ScriptedAI + { + mob_depth_chargeAI(Creature* creature) : ScriptedAI(creature) {} + + bool WeMustDie; + uint32 WeMustDieTimer; + + void Reset() + { + me->SetUnitMovementFlags(MOVEMENTFLAG_HOVER | MOVEMENTFLAG_SWIMMING); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + WeMustDie = false; + WeMustDieTimer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (WeMustDie) + { + if (WeMustDieTimer <= diff) + me->DespawnOrUnsummon(); + else + WeMustDieTimer -= diff; + } + return; + } + + void MoveInLineOfSight(Unit* who) + { + if (!who) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 5)) + { + DoCast(who, SPELL_DEPTH_CHARGE_TRAP); + WeMustDie = true; + return; + } + } + + void AttackStart(Unit* /*who*/) {} + + void EnterCombat(Unit* /*who*/) {} + }; +}; + +void AddSC_azshara() +{ + new mobs_spitelashes(); + new npc_loramus_thalipedes(); + new mob_rizzle_sprysprocket(); + new mob_depth_charge(); +} diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp new file mode 100644 index 00000000000..4b03cd65cad --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -0,0 +1,770 @@ + /* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Azuremyst_Isle +SD%Complete: 75 +SDComment: Quest support: 9283, 9537, 9582, 9554, 9531, ? (special flight path, proper model for mount missing). Injured Draenei cosmetic only, 9582. +SDCategory: Azuremyst Isle +EndScriptData */ + +/* ContentData +npc_draenei_survivor +npc_engineer_spark_overgrind +npc_injured_draenei +npc_magwin +npc_geezle +go_ravager_cage +npc_death_ravager +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" + +/*###### +## npc_draenei_survivor +######*/ + +enum draeneiSurvivor +{ + SAY_HEAL = 0, + + SAY_HELP = 1, + + SPELL_IRRIDATION = 35046, + SPELL_STUNNED = 28630 +}; + +class npc_draenei_survivor : public CreatureScript +{ +public: + npc_draenei_survivor() : CreatureScript("npc_draenei_survivor") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_draenei_survivorAI (creature); + } + + struct npc_draenei_survivorAI : public ScriptedAI + { + npc_draenei_survivorAI(Creature* creature) : ScriptedAI(creature) {} + + uint64 pCaster; + + uint32 SayThanksTimer; + uint32 RunAwayTimer; + uint32 SayHelpTimer; + + bool CanSayHelp; + + void Reset() + { + pCaster = 0; + + SayThanksTimer = 0; + RunAwayTimer = 0; + SayHelpTimer = 10000; + + CanSayHelp = true; + + DoCast(me, SPELL_IRRIDATION, true); + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + me->SetHealth(me->CountPctFromMaxHealth(10)); + me->SetStandState(UNIT_STAND_STATE_SLEEP); + } + + void EnterCombat(Unit* /*who*/) {} + + void MoveInLineOfSight(Unit* who) + { + if (CanSayHelp && who->GetTypeId() == TYPEID_PLAYER && me->IsFriendlyTo(who) && me->IsWithinDistInMap(who, 25.0f)) + { + //Random switch between 4 texts + Talk(SAY_HELP, who->GetGUID()); + + SayHelpTimer = 20000; + CanSayHelp = false; + } + } + + void SpellHit(Unit* Caster, const SpellInfo* Spell) + { + if (Spell->SpellFamilyFlags[2] & 0x080000000) + { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + me->SetStandState(UNIT_STAND_STATE_STAND); + + DoCast(me, SPELL_STUNNED, true); + + pCaster = Caster->GetGUID(); + + SayThanksTimer = 5000; + } + } + + void UpdateAI(const uint32 diff) + { + if (SayThanksTimer) + { + if (SayThanksTimer <= diff) + { + me->RemoveAurasDueToSpell(SPELL_IRRIDATION); + + if (Player* player = Unit::GetPlayer(*me, pCaster)) + { + Talk(SAY_HEAL, player->GetGUID()); + + player->TalkedToCreature(me->GetEntry(), me->GetGUID()); + } + + me->GetMotionMaster()->Clear(); + me->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f); + + RunAwayTimer = 10000; + SayThanksTimer = 0; + } else SayThanksTimer -= diff; + + return; + } + + if (RunAwayTimer) + { + if (RunAwayTimer <= diff) + me->DespawnOrUnsummon(); + else + RunAwayTimer -= diff; + + return; + } + + if (SayHelpTimer <= diff) + { + CanSayHelp = true; + SayHelpTimer = 20000; + } else SayHelpTimer -= diff; + } + }; + +}; + +/*###### +## npc_engineer_spark_overgrind +######*/ + +enum Overgrind +{ + SAY_TEXT = 0, + SAY_EMOTE = 1, + ATTACK_YELL = 2, + + AREA_COVE = 3579, + AREA_ISLE = 3639, + QUEST_GNOMERCY = 9537, + FACTION_HOSTILE = 14, + SPELL_DYNAMITE = 7978 +}; + +#define GOSSIP_FIGHT "Traitor! You will be brought to justice!" + +class npc_engineer_spark_overgrind : public CreatureScript +{ +public: + npc_engineer_spark_overgrind() : CreatureScript("npc_engineer_spark_overgrind") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF) + { + player->CLOSE_GOSSIP_MENU(); + creature->setFaction(FACTION_HOSTILE); + CAST_AI(npc_engineer_spark_overgrind::npc_engineer_spark_overgrindAI, creature->AI())->AttackStart(player); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_engineer_spark_overgrindAI (creature); + } + + struct npc_engineer_spark_overgrindAI : public ScriptedAI + { + npc_engineer_spark_overgrindAI(Creature* creature) : ScriptedAI(creature) + { + NormFaction = creature->getFaction(); + NpcFlags = creature->GetUInt32Value(UNIT_NPC_FLAGS); + + if (creature->GetAreaId() == AREA_COVE || creature->GetAreaId() == AREA_ISLE) + IsTreeEvent = true; + } + + uint32 NormFaction; + uint32 NpcFlags; + + uint32 DynamiteTimer; + uint32 EmoteTimer; + + bool IsTreeEvent; + + void Reset() + { + DynamiteTimer = 8000; + EmoteTimer = urand(120000, 150000); + + me->setFaction(NormFaction); + me->SetUInt32Value(UNIT_NPC_FLAGS, NpcFlags); + + IsTreeEvent = false; + } + + void EnterCombat(Unit* who) + { + Talk(ATTACK_YELL, who->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat() && !IsTreeEvent) + { + if (EmoteTimer <= diff) + { + Talk(SAY_TEXT); + Talk(SAY_EMOTE); + EmoteTimer = urand(120000, 150000); + } else EmoteTimer -= diff; + } + else if (IsTreeEvent) + return; + + if (!UpdateVictim()) + return; + + if (DynamiteTimer <= diff) + { + DoCast(me->getVictim(), SPELL_DYNAMITE); + DynamiteTimer = 8000; + } else DynamiteTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*###### +## npc_injured_draenei +######*/ + +class npc_injured_draenei : public CreatureScript +{ +public: + npc_injured_draenei() : CreatureScript("npc_injured_draenei") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_injured_draeneiAI (creature); + } + + struct npc_injured_draeneiAI : public ScriptedAI + { + npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + me->SetHealth(me->CountPctFromMaxHealth(15)); + switch (urand(0, 1)) + { + case 0: + me->SetStandState(UNIT_STAND_STATE_SIT); + break; + + case 1: + me->SetStandState(UNIT_STAND_STATE_SLEEP); + break; + } + } + + void EnterCombat(Unit* /*who*/) {} + + void MoveInLineOfSight(Unit* /*who*/) {} + + void UpdateAI(const uint32 /*diff*/) {} + }; + +}; + +/*###### +## npc_magwin +######*/ + +enum Magwin +{ + SAY_START = 0, + SAY_AGGRO = 1, + SAY_PROGRESS = 2, + SAY_END1 = 3, + SAY_END2 = 4, + EMOTE_HUG = 5, + + QUEST_A_CRY_FOR_SAY_HELP = 9528 +}; + +class npc_magwin : public CreatureScript +{ +public: + npc_magwin() : CreatureScript("npc_magwin") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_A_CRY_FOR_SAY_HELP) + { + creature->setFaction(113); + if (npc_escortAI* pEscortAI = CAST_AI(npc_escortAI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_magwinAI(creature); + } + + struct npc_magwinAI : public npc_escortAI + { + npc_magwinAI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 0: + Talk(SAY_START, player->GetGUID()); + break; + case 17: + Talk(SAY_PROGRESS, player->GetGUID()); + break; + case 28: + Talk(SAY_END1, player->GetGUID()); + break; + case 29: + Talk(EMOTE_HUG, player->GetGUID()); + Talk(SAY_END2, player->GetGUID()); + player->GroupEventHappens(QUEST_A_CRY_FOR_SAY_HELP, me); + break; + } + } + } + + void EnterCombat(Unit* who) + { + Talk(SAY_AGGRO, who->GetGUID()); + } + + void Reset() {} + }; + +}; + +/*###### +## npc_geezle +######*/ + +enum Geezle +{ + QUEST_TREES_COMPANY = 9531, + + SPELL_TREE_DISGUISE = 30298, + + GEEZLE_SAY_1 = 0, + SPARK_SAY_2 = 3, + SPARK_SAY_3 = 4, + GEEZLE_SAY_4 = 1, + SPARK_SAY_5 = 5, + SPARK_SAY_6 = 6, + GEEZLE_SAY_7 = 2, + + EMOTE_SPARK = 7, + + MOB_SPARK = 17243, + GO_NAGA_FLAG = 181694 +}; + +Position const SparkPos = {-5029.91f, -11291.79f, 8.096f, 0.0f}; + +class npc_geezle : public CreatureScript +{ +public: + npc_geezle() : CreatureScript("npc_geezle") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_geezleAI(creature); + } + + struct npc_geezleAI : public ScriptedAI + { + npc_geezleAI(Creature* creature) : ScriptedAI(creature) {} + + uint64 SparkGUID; + + uint8 Step; + uint32 SayTimer; + + bool EventStarted; + + void Reset() + { + SparkGUID = 0; + Step = 0; + StartEvent(); + } + + void EnterCombat(Unit* /*who*/){} + + void StartEvent() + { + Step = 0; + EventStarted = true; + if (Creature* Spark = me->SummonCreature(MOB_SPARK, SparkPos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) + { + SparkGUID = Spark->GetGUID(); + Spark->setActive(true); + Spark->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + SayTimer = 8000; + } + + uint32 NextStep(uint8 Step) + { + Creature* Spark = Unit::GetCreature(*me, SparkGUID); + if (!Spark) + return 99999999; + + switch (Step) + { + case 0: + Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f); + me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f); + return 9000; + case 1: + DespawnNagaFlag(true); + Spark->AI()->Talk(EMOTE_SPARK); + return 1000; + case 2: + Talk(GEEZLE_SAY_1, SparkGUID); + Spark->SetInFront(me); + me->SetInFront(Spark); + return 5000; + case 3: + Spark->AI()->Talk(SPARK_SAY_2); + return 7000; + case 4: + Spark->AI()->Talk(SPARK_SAY_3); + return 8000; + case 5: + Talk(GEEZLE_SAY_4, SparkGUID); + return 8000; + case 6: + Spark->AI()->Talk(SPARK_SAY_5); + return 9000; + case 7: + Spark->AI()->Talk(SPARK_SAY_6); + return 8000; + case 8: + Talk(GEEZLE_SAY_7, SparkGUID); + return 2000; + case 9: + me->GetMotionMaster()->MoveTargetedHome(); + Spark->GetMotionMaster()->MovePoint(0, SparkPos); + CompleteQuest(); + return 9000; + case 10: + Spark->DisappearAndDie(); + DespawnNagaFlag(false); + me->DisappearAndDie(); + default: return 99999999; + } + } + + // will complete Tree's company quest for all nearby players that are disguised as trees + void CompleteQuest() + { + float radius = 50.0f; + std::list players; + Trinity::AnyPlayerInObjectRangeCheck checker(me, radius); + Trinity::PlayerListSearcher searcher(me, players, checker); + me->VisitNearbyWorldObject(radius, searcher); + + for (std::list::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if ((*itr)->GetQuestStatus(QUEST_TREES_COMPANY) == QUEST_STATUS_INCOMPLETE && (*itr)->HasAura(SPELL_TREE_DISGUISE)) + (*itr)->KilledMonsterCredit(MOB_SPARK, 0); + } + + void DespawnNagaFlag(bool despawn) + { + std::list FlagList; + me->GetGameObjectListWithEntryInGrid(FlagList, GO_NAGA_FLAG, 100.0f); + + if (!FlagList.empty()) + { + for (std::list::const_iterator itr = FlagList.begin(); itr != FlagList.end(); ++itr) + { + if (despawn) + (*itr)->SetLootState(GO_JUST_DEACTIVATED); + else + (*itr)->Respawn(); + } + } + else + sLog->outError(LOG_FILTER_TSCR, "SD2 ERROR: FlagList is empty!"); + } + + void UpdateAI(const uint32 diff) + { + if (SayTimer <= diff) + { + if (EventStarted) + SayTimer = NextStep(Step++); + } + else + SayTimer -= diff; + } + }; + +}; + +enum RavegerCage +{ + NPC_DEATH_RAVAGER = 17556, + + SPELL_REND = 13443, + SPELL_ENRAGING_BITE = 30736, + + QUEST_STRENGTH_ONE = 9582 +}; + +class go_ravager_cage : public GameObjectScript +{ +public: + go_ravager_cage() : GameObjectScript("go_ravager_cage") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->UseDoorOrButton(); + if (player->GetQuestStatus(QUEST_STRENGTH_ONE) == QUEST_STATUS_INCOMPLETE) + { + if (Creature* ravager = go->FindNearestCreature(NPC_DEATH_RAVAGER, 5.0f, true)) + { + ravager->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + ravager->SetReactState(REACT_AGGRESSIVE); + ravager->AI()->AttackStart(player); + } + } + return true; + } +}; + +class npc_death_ravager : public CreatureScript +{ +public: + npc_death_ravager() : CreatureScript("npc_death_ravager") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_death_ravagerAI(creature); + } + + struct npc_death_ravagerAI : public ScriptedAI + { + npc_death_ravagerAI(Creature* creature) : ScriptedAI(creature){} + + uint32 RendTimer; + uint32 EnragingBiteTimer; + + void Reset() + { + RendTimer = 30000; + EnragingBiteTimer = 20000; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (RendTimer <= diff) + { + DoCast(me->getVictim(), SPELL_REND); + RendTimer = 30000; + } + else RendTimer -= diff; + + if (EnragingBiteTimer <= diff) + { + DoCast(me->getVictim(), SPELL_ENRAGING_BITE); + EnragingBiteTimer = 15000; + } + else EnragingBiteTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*######## +## Quest: The Prophecy of Akida +########*/ + +enum BristlelimbCage +{ + QUEST_THE_PROPHECY_OF_AKIDA = 9544, + NPC_STILLPINE_CAPITIVE = 17375, + GO_BRISTELIMB_CAGE = 181714, + + CAPITIVE_SAY = 0, + + POINT_INIT = 1, + EVENT_DESPAWN = 1, +}; + +class npc_stillpine_capitive : public CreatureScript +{ + public: + npc_stillpine_capitive() : CreatureScript("npc_stillpine_capitive") { } + + struct npc_stillpine_capitiveAI : public ScriptedAI + { + npc_stillpine_capitiveAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + if (GameObject* cage = me->FindNearestGameObject(GO_BRISTELIMB_CAGE, 5.0f)) + { + cage->SetLootState(GO_JUST_DEACTIVATED); + cage->SetGoState(GO_STATE_READY); + } + _events.Reset(); + _player = NULL; + _movementComplete = false; + } + + void StartMoving(Player* owner) + { + if (owner) + { + Talk(CAPITIVE_SAY, owner->GetGUID()); + _player = owner; + } + Position pos; + me->GetNearPosition(pos, 3.0f, 0.0f); + me->GetMotionMaster()->MovePoint(POINT_INIT, pos); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE || id != POINT_INIT) + return; + + if (_player) + _player->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); + + _movementComplete = true; + _events.ScheduleEvent(EVENT_DESPAWN, 3500); + } + + void UpdateAI(uint32 const diff) + { + if (!_movementComplete) + return; + + _events.Update(diff); + + if (_events.ExecuteEvent() == EVENT_DESPAWN) + me->DespawnOrUnsummon(); + } + + private: + Player* _player; + EventMap _events; + bool _movementComplete; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_stillpine_capitiveAI(creature); + } +}; + +class go_bristlelimb_cage : public GameObjectScript +{ + public: + go_bristlelimb_cage() : GameObjectScript("go_bristlelimb_cage") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->SetGoState(GO_STATE_READY); + if (player->GetQuestStatus(QUEST_THE_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) + { + if (Creature* capitive = go->FindNearestCreature(NPC_STILLPINE_CAPITIVE, 5.0f, true)) + { + go->ResetDoorOrButton(); + CAST_AI(npc_stillpine_capitive::npc_stillpine_capitiveAI, capitive->AI())->StartMoving(player); + return false; + } + } + return true; + } +}; + +void AddSC_azuremyst_isle() +{ + new npc_draenei_survivor(); + new npc_engineer_spark_overgrind(); + new npc_injured_draenei(); + new npc_magwin(); + new npc_geezle(); + new npc_death_ravager(); + new go_ravager_cage(); + new npc_stillpine_capitive(); + new go_bristlelimb_cage(); +} diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp new file mode 100644 index 00000000000..102a9494a65 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Bloodmyst_Isle +SD%Complete: 80 +SDComment: Quest support: 9670, 9756(gossip items text needed). +SDCategory: Bloodmyst Isle +EndScriptData */ + +/* ContentData +mob_webbed_creature +npc_captured_sunhawk_agent +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## mob_webbed_creature +######*/ + +//possible creatures to be spawned +uint32 const possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; + +class mob_webbed_creature : public CreatureScript +{ +public: + mob_webbed_creature() : CreatureScript("mob_webbed_creature") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_webbed_creatureAI (creature); + } + + struct mob_webbed_creatureAI : public ScriptedAI + { + mob_webbed_creatureAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() {} + + void EnterCombat(Unit* /*who*/) {} + + void JustDied(Unit* killer) + { + uint32 spawnCreatureID = 0; + + switch (urand(0, 2)) + { + case 0: + spawnCreatureID = 17681; + if (Player* player = killer->ToPlayer()) + player->KilledMonsterCredit(spawnCreatureID, 0); + break; + case 1: + case 2: + spawnCreatureID = possibleSpawns[urand(0, 30)]; + break; + } + + if (spawnCreatureID) + me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + } + }; + +}; + +/*###### +## npc_captured_sunhawk_agent +######*/ + +#define C_SUNHAWK_TRIGGER 17974 + +#define GOSSIP_HELLO_CSA "[PH] " +#define GOSSIP_SELECT_CSA1 "[PH] " +#define GOSSIP_SELECT_CSA2 "[PH] " +#define GOSSIP_SELECT_CSA3 "[PH] " +#define GOSSIP_SELECT_CSA4 "[PH] " +#define GOSSIP_SELECT_CSA5 "[PH] " + +class npc_captured_sunhawk_agent : public CreatureScript +{ +public: + npc_captured_sunhawk_agent() : CreatureScript("npc_captured_sunhawk_agent") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(9137, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(9138, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(9139, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(9140, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT_CSA5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->SEND_GOSSIP_MENU(9141, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->CLOSE_GOSSIP_MENU(); + player->TalkedToCreature(C_SUNHAWK_TRIGGER, creature->GetGUID()); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_CSA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(9136, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(9134, creature->GetGUID()); + + return true; + } + +}; + +/*###### +## Quest 9667: Saving Princess Stillpine +######*/ + +enum Stillpine +{ + QUEST_SAVING_PRINCESS_STILLPINE = 9667, + NPC_PRINCESS_STILLPINE = 17682, + GO_PRINCESS_STILLPINES_CAGE = 181928, + SPELL_OPENING_PRINCESS_STILLPINE_CREDIT = 31003, + SAY_DIRECTION = 0 +}; + +class go_princess_stillpines_cage : public GameObjectScript +{ +public: + go_princess_stillpines_cage() : GameObjectScript("go_princess_stillpines_cage") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->SetGoState(GO_STATE_READY); + if (Creature* stillpine = go->FindNearestCreature(NPC_PRINCESS_STILLPINE, 25, true)) + { + stillpine->GetMotionMaster()->MovePoint(1, go->GetPositionX(), go->GetPositionY()-15, go->GetPositionZ()); + player->CastedCreatureOrGO(NPC_PRINCESS_STILLPINE, 0, SPELL_OPENING_PRINCESS_STILLPINE_CREDIT); + } + return true; + } +}; + +class npc_princess_stillpine : public CreatureScript +{ +public: + npc_princess_stillpine() : CreatureScript("npc_princess_stillpine") { } + + struct npc_princess_stillpineAI : public ScriptedAI + { + npc_princess_stillpineAI(Creature* creature) : ScriptedAI(creature) {} + + void MovementInform(uint32 type, uint32 id) + { + if (type == POINT_MOTION_TYPE && id == 1) + { + Talk(SAY_DIRECTION); + me->DespawnOrUnsummon(); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_princess_stillpineAI(creature); + } +}; + +void AddSC_bloodmyst_isle() +{ + new mob_webbed_creature(); + new npc_captured_sunhawk_agent(); + new npc_princess_stillpine(); + new go_princess_stillpines_cage(); +} diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp new file mode 100644 index 00000000000..09f061148d3 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -0,0 +1,394 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Darkshore +SD%Complete: 100 +SDComment: Quest support: 731, 2078, 5321 +SDCategory: Darkshore +EndScriptData */ + +/* ContentData +npc_kerlonian +npc_prospector_remtravel +npc_threshwackonator +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "ScriptedFollowerAI.h" +#include "Player.h" +#include "SpellInfo.h" + +/*#### +# npc_kerlonian +####*/ + +enum Kerlonian +{ + SAY_KER_START = 0, + EMOTE_KER_SLEEP = 1, + SAY_KER_SLEEP = 2, + SAY_KER_ALERT_1 = 3, + SAY_KER_END = 4, + EMOTE_KER_AWAKEN = 5, + + SPELL_SLEEP_VISUAL = 25148, + SPELL_AWAKEN = 17536, + QUEST_SLEEPER_AWAKENED = 5321, + NPC_LILADRIS = 11219, //attackers entries unknown + FACTION_KER_ESCORTEE = 113 +}; + +//TODO: make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. +class npc_kerlonian : public CreatureScript +{ +public: + npc_kerlonian() : CreatureScript("npc_kerlonian") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED) + { + if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI())) + { + creature->SetStandState(UNIT_STAND_STATE_STAND); + creature->AI()->Talk(SAY_KER_START, player->GetGUID()); + pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); + } + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_kerlonianAI(creature); + } + + struct npc_kerlonianAI : public FollowerAI + { + npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } + + uint32 FallAsleepTimer; + + void Reset() + { + FallAsleepTimer = urand(10000, 45000); + } + + void MoveInLineOfSight(Unit* who) + { + FollowerAI::MoveInLineOfSight(who); + + if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_LILADRIS) + { + if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE*5)) + { + if (Player* player = GetLeaderForFollower()) + { + if (player->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_SLEEPER_AWAKENED, me); + + Talk(SAY_KER_END); + } + + SetFollowComplete(); + } + } + } + + void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) + { + if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN) + ClearSleeping(); + } + + void SetSleeping() + { + SetFollowPaused(true); + + Talk(EMOTE_KER_SLEEP); + + Talk(SAY_KER_SLEEP); + + me->SetStandState(UNIT_STAND_STATE_SLEEP); + DoCast(me, SPELL_SLEEP_VISUAL, false); + } + + void ClearSleeping() + { + me->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL); + me->SetStandState(UNIT_STAND_STATE_STAND); + + Talk(EMOTE_KER_AWAKEN); + + SetFollowPaused(false); + } + + void UpdateFollowerAI(const uint32 Diff) + { + if (!UpdateVictim()) + { + if (!HasFollowState(STATE_FOLLOW_INPROGRESS)) + return; + + if (!HasFollowState(STATE_FOLLOW_PAUSED)) + { + if (FallAsleepTimer <= Diff) + { + SetSleeping(); + FallAsleepTimer = urand(25000, 90000); + } + else + FallAsleepTimer -= Diff; + } + + return; + } + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*#### +# npc_prospector_remtravel +####*/ + +enum Remtravel +{ + SAY_REM_START = 0, + SAY_REM_AGGRO = 1, + SAY_REM_RAMP1_1 = 2, + SAY_REM_RAMP1_2 = 3, + SAY_REM_BOOK = 4, + SAY_REM_TENT1_1 = 5, + SAY_REM_TENT1_2 = 6, + SAY_REM_MOSS = 7, + EMOTE_REM_MOSS = 8, + SAY_REM_MOSS_PROGRESS = 9, + SAY_REM_PROGRESS = 10, + SAY_REM_REMEMBER = 11, + EMOTE_REM_END = 12, + + FACTION_ESCORTEE = 10, + QUEST_ABSENT_MINDED_PT2 = 731, + NPC_GRAVEL_SCOUT = 2158, + NPC_GRAVEL_BONE = 2159, + NPC_GRAVEL_GEO = 2160 +}; + +class npc_prospector_remtravel : public CreatureScript +{ +public: + npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID()); + + creature->setFaction(FACTION_ESCORTEE); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_prospector_remtravelAI(creature); + } + + struct npc_prospector_remtravelAI : public npc_escortAI + { + npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 0: + Talk(SAY_REM_START, player->GetGUID()); + break; + case 5: + Talk(SAY_REM_RAMP1_1, player->GetGUID()); + break; + case 6: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + Talk(SAY_REM_RAMP1_2, player->GetGUID()); + break; + case 14: + //depend quest rewarded? + Talk(SAY_REM_BOOK, player->GetGUID()); + break; + case 15: + Talk(SAY_REM_TENT1_1, player->GetGUID()); + break; + case 16: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + Talk(SAY_REM_TENT1_2, player->GetGUID()); + break; + case 26: + Talk(SAY_REM_MOSS, player->GetGUID()); + break; + case 27: + Talk(EMOTE_REM_MOSS, player->GetGUID()); + break; + case 28: + Talk(SAY_REM_MOSS_PROGRESS, player->GetGUID()); + break; + case 29: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 31: + Talk(SAY_REM_PROGRESS, player->GetGUID()); + break; + case 41: + Talk(SAY_REM_REMEMBER, player->GetGUID()); + break; + case 42: + Talk(EMOTE_REM_END, player->GetGUID()); + player->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, me); + break; + } + } + } + + void Reset() {} + + void EnterCombat(Unit* who) + { + if (urand(0, 1)) + Talk(SAY_REM_AGGRO, who->GetGUID()); + } + + void JustSummoned(Creature* /*pSummoned*/) + { + //unsure if it should be any + //pSummoned->AI()->AttackStart(me); + } + }; + +}; + +/*#### +# npc_threshwackonator +####*/ + +enum Threshwackonator +{ + EMOTE_START = 0, + SAY_AT_CLOSE = 1, + QUEST_GYROMAST_REV = 2078, + NPC_GELKAK = 6667, + FACTION_HOSTILE = 14 +}; + +#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" + +class npc_threshwackonator : public CreatureScript +{ +public: + npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + + if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI())) + { + creature->AI()->Talk(EMOTE_START); + pThreshAI->StartFollow(player); + } + } + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_threshwackonatorAI(creature); + } + + struct npc_threshwackonatorAI : public FollowerAI + { + npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { } + + void Reset() { } + + void MoveInLineOfSight(Unit* who) + { + FollowerAI::MoveInLineOfSight(who); + + if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_GELKAK) + { + if (me->IsWithinDistInMap(who, 10.0f)) + { + Talk(SAY_AT_CLOSE, who->GetGUID()); + DoAtEnd(); + } + } + } + + void DoAtEnd() + { + me->setFaction(FACTION_HOSTILE); + + if (Player* pHolder = GetLeaderForFollower()) + me->AI()->AttackStart(pHolder); + + SetFollowComplete(); + } + }; + +}; + +void AddSC_darkshore() +{ + new npc_kerlonian(); + new npc_prospector_remtravel(); + new npc_threshwackonator(); +} diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp new file mode 100644 index 00000000000..8f55bb6102c --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -0,0 +1,308 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Desolace +SD%Complete: 100 +SDComment: Quest support: 5561 +SDCategory: Desolace +EndScriptData */ + +/* ContentData +npc_aged_dying_ancient_kodo +go_iruxos +npc_dalinda_malem +go_demon_portal +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" +#include "SpellInfo.h" + +enum DyingKodo +{ + // signed for 9999 + SAY_SMEED_HOME = 0, + + QUEST_KODO = 5561, + + NPC_SMEED = 11596, + NPC_AGED_KODO = 4700, + NPC_DYING_KODO = 4701, + NPC_ANCIENT_KODO = 4702, + NPC_TAMED_KODO = 11627, + + SPELL_KODO_KOMBO_ITEM = 18153, + SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks + SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377, + SPELL_KODO_KOMBO_GOSSIP = 18362 + +}; + +class npc_aged_dying_ancient_kodo : public CreatureScript +{ +public: + npc_aged_dying_ancient_kodo() : CreatureScript("npc_aged_dying_ancient_kodo") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + { + //the expected quest objective + player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); + + player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); + creature->GetMotionMaster()->MoveIdle(); + } + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + bool EffectDummyCreature(Unit* pCaster, uint32 spellId, uint32 effIndex, Creature* creatureTarget) + { + //always check spellid and effectindex + if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == 0) + { + //no effect if player/creature already have aura from spells + if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || creatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + return true; + + if (creatureTarget->GetEntry() == NPC_AGED_KODO || + creatureTarget->GetEntry() == NPC_DYING_KODO || + creatureTarget->GetEntry() == NPC_ANCIENT_KODO) + { + pCaster->CastSpell(pCaster, SPELL_KODO_KOMBO_PLAYER_BUFF, true); + + creatureTarget->UpdateEntry(NPC_TAMED_KODO); + creatureTarget->CastSpell(creatureTarget, SPELL_KODO_KOMBO_DESPAWN_BUFF, false); + + if (creatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + creatureTarget->GetMotionMaster()->MoveIdle(); + + creatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, creatureTarget->GetFollowAngle()); + } + + //always return true when we are handling this spell and effect + return true; + } + return false; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_aged_dying_ancient_kodoAI(creature); + } + + struct npc_aged_dying_ancient_kodoAI : public ScriptedAI + { + npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { Reset(); } + + uint32 DespawnTimer; + + void Reset() + { + DespawnTimer = 0; + } + + void MoveInLineOfSight(Unit* who) + { + if (who->GetEntry() == NPC_SMEED) + { + if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + + if (me->IsWithinDistInMap(who, 10.0f)) + { + if (Creature* talker = who->ToCreature()) + talker->AI()->Talk(SAY_SMEED_HOME); + + //spell have no implemented effect (dummy), so useful to notify spellHit + DoCast(me, SPELL_KODO_KOMBO_GOSSIP, true); + } + } + } + + void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell) + { + if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) + { + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + DespawnTimer = 60000; + } + } + + void UpdateAI(const uint32 diff) + { + //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. + if (DespawnTimer && DespawnTimer <= diff) + { + if (!me->getVictim() && me->isAlive()) + { + Reset(); + me->setDeathState(JUST_DIED); + me->Respawn(); + return; + } + } else DespawnTimer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*###### +## go_iruxos +## Hand of Iruxos +######*/ + +enum Iruxos +{ + QUEST_HAND_IRUXOS = 5381, + NPC_DEMON_SPIRIT = 11876, +}; + +class go_iruxos : public GameObjectScript +{ + public: + go_iruxos() : GameObjectScript("go_iruxos") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + if (player->GetQuestStatus(QUEST_HAND_IRUXOS) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_SPIRIT, 25.0f, true)) + player->SummonCreature(NPC_DEMON_SPIRIT, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + return true; + } +}; + +/*###### +## npc_dalinda_malem. Quest 1440 +######*/ + +enum Dalinda +{ + QUEST_RETURN_TO_VAHLARRIEL = 1440 +}; + +class npc_dalinda : public CreatureScript +{ +public: + npc_dalinda() : CreatureScript("npc_dalinda") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI())) + { + pEscortAI->Start(true, false, player->GetGUID()); + creature->setFaction(113); + } + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_dalindaAI(creature); + } + + struct npc_dalindaAI : public npc_escortAI + { + npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + + switch (waypointId) + { + case 1: + me->IsStandState(); + break; + case 15: + if (player) + player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me); + break; + } + } + + void EnterCombat(Unit* /*who*/) { } + + void Reset() {} + + void JustDied(Unit* /*killer*/) + { + if (Player* player = GetPlayerForEscort()) + player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); + return; + } + + void UpdateAI(const uint32 Diff) + { + npc_escortAI::UpdateAI(Diff); + if (!UpdateVictim()) + return; + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## go_demon_portal +######*/ + +enum DemonPortal +{ + NPC_DEMON_GUARDIAN = 11937, + + QUEST_PORTAL_OF_THE_LEGION = 5581, +}; + +class go_demon_portal : public GameObjectScript +{ + public: + go_demon_portal() : GameObjectScript("go_demon_portal") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + if (player->GetQuestStatus(QUEST_PORTAL_OF_THE_LEGION) == QUEST_STATUS_INCOMPLETE && !go->FindNearestCreature(NPC_DEMON_GUARDIAN, 5.0f, true)) + { + if (Creature* guardian = player->SummonCreature(NPC_DEMON_GUARDIAN, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0)) + guardian->AI()->AttackStart(player); + } + + return true; + } +}; + +void AddSC_desolace() +{ + new npc_aged_dying_ancient_kodo(); + new go_iruxos(); + new npc_dalinda(); + new go_demon_portal(); +} diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp new file mode 100644 index 00000000000..fa6b830c1ae --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp @@ -0,0 +1,589 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Vehicle.h" +#include "SpellScript.h" +#include "Player.h" + +/*###### +##Quest 5441: Lazy Peons +##npc_lazy_peon +######*/ + +enum LazyPeonYells +{ + SAY_SPELL_HIT = 0 +}; + +enum LazyPeon +{ + QUEST_LAZY_PEONS = 5441, + GO_LUMBERPILE = 175784, + SPELL_BUFF_SLEEP = 17743, + SPELL_AWAKEN_PEON = 19938 +}; + +class npc_lazy_peon : public CreatureScript +{ +public: + npc_lazy_peon() : CreatureScript("npc_lazy_peon") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_lazy_peonAI(creature); + } + + struct npc_lazy_peonAI : public ScriptedAI + { + npc_lazy_peonAI(Creature* creature) : ScriptedAI(creature) {} + + uint64 PlayerGUID; + + uint32 RebuffTimer; + bool work; + + void Reset() + { + PlayerGUID = 0; + RebuffTimer = 0; + work = false; + } + + void MovementInform(uint32 /*type*/, uint32 id) + { + if (id == 1) + work = true; + } + + void SpellHit(Unit* caster, const SpellInfo* spell) + { + if (spell->Id == SPELL_AWAKEN_PEON && caster->GetTypeId() == TYPEID_PLAYER + && CAST_PLR(caster)->GetQuestStatus(QUEST_LAZY_PEONS) == QUEST_STATUS_INCOMPLETE) + { + caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); + Talk(SAY_SPELL_HIT, caster->GetGUID()); + 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 Diff) + { + if (work == true) + me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD); + if (RebuffTimer <= Diff) + { + DoCast(me, SPELL_BUFF_SLEEP); + RebuffTimer = 300000; //Rebuff agian in 5 minutes + } + else + RebuffTimer -= Diff; + if (!UpdateVictim()) + return; + DoMeleeAttackIfReady(); + } + }; +}; + +enum Texts +{ + // Tiger Matriarch Credit + SAY_MATRIARCH_AGGRO = 0, + + // Troll Volunteer + SAY_VOLUNTEER_START = 0, + SAY_VOLUNTEER_END = 1, +}; + +enum Spells +{ + // Tiger Matriarch Credit + SPELL_SUMMON_MATRIARCH = 75187, + SPELL_NO_SUMMON_AURA = 75213, + SPELL_DETECT_INVIS = 75180, + SPELL_SUMMON_ZENTABRA_TRIGGER = 75212, + + // Tiger Matriarch + SPELL_POUNCE = 61184, + SPELL_FURIOUS_BITE = 75164, + SPELL_SUMMON_ZENTABRA = 75181, + SPELL_SPIRIT_OF_THE_TIGER_RIDER = 75166, + SPELL_EJECT_PASSENGERS = 50630, + + // Troll Volunteer + SPELL_VOLUNTEER_AURA = 75076, + SPELL_PETACT_AURA = 74071, + SPELL_QUEST_CREDIT = 75106, + SPELL_MOUNTING_CHECK = 75420, + SPELL_TURNIN = 73953, + SPELL_AOE_TURNIN = 75107, + + // Vol'jin War Drums + SPELL_MOTIVATE_1 = 75088, + SPELL_MOTIVATE_2 = 75086, +}; + +enum Creatures +{ + // Tiger Matriarch Credit + NPC_TIGER_VEHICLE = 40305, + + // Troll Volunteer + NPC_URUZIN = 40253, + NPC_VOLUNTEER_1 = 40264, + NPC_VOLUNTEER_2 = 40260, + + // Vol'jin War Drums + NPC_CITIZEN_1 = 40256, + NPC_CITIZEN_2 = 40257, +}; + +enum Events +{ + // Tiger Matriarch Credit + EVENT_CHECK_SUMMON_AURA = 1, + + // Tiger Matriarch + EVENT_POUNCE = 2, + EVENT_NOSUMMON = 3, +}; + +enum Points +{ + POINT_URUZIN = 4026400, +}; + +class npc_tiger_matriarch_credit : public CreatureScript +{ + public: + npc_tiger_matriarch_credit() : CreatureScript("npc_tiger_matriarch_credit") { } + + struct npc_tiger_matriarch_creditAI : public Scripted_NoMovementAI + { + npc_tiger_matriarch_creditAI(Creature* creature) : Scripted_NoMovementAI(creature) + { + events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 2000); + } + + void UpdateAI(uint32 const diff) + { + events.Update(diff); + + if (events.ExecuteEvent() == EVENT_CHECK_SUMMON_AURA) + { + std::list tigers; + GetCreatureListWithEntryInGrid(tigers, me, NPC_TIGER_VEHICLE, 15.0f); + if (!tigers.empty()) + { + for (std::list::iterator itr = tigers.begin(); itr != tigers.end(); ++itr) + { + if (!(*itr)->isSummon()) + continue; + + if (Unit* summoner = (*itr)->ToTempSummon()->GetSummoner()) + if (!summoner->HasAura(SPELL_NO_SUMMON_AURA) && !summoner->HasAura(SPELL_SUMMON_ZENTABRA_TRIGGER) + && !summoner->isInCombat()) + { + me->AddAura(SPELL_NO_SUMMON_AURA, summoner); + me->AddAura(SPELL_DETECT_INVIS, summoner); + summoner->CastSpell(summoner, SPELL_SUMMON_MATRIARCH, true); + Talk(SAY_MATRIARCH_AGGRO, summoner->GetGUID()); + } + } + } + + events.ScheduleEvent(EVENT_CHECK_SUMMON_AURA, 5000); + } + } + + private: + EventMap events; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_tiger_matriarch_creditAI(creature); + } +}; + +class npc_tiger_matriarch : public CreatureScript +{ + public: + npc_tiger_matriarch() : CreatureScript("npc_tiger_matriarch") {} + + struct npc_tiger_matriarchAI : public ScriptedAI + { + npc_tiger_matriarchAI(Creature* creature) : ScriptedAI(creature), + _tigerGuid(0) + { + } + + void EnterCombat(Unit* /*target*/) + { + _events.Reset(); + _events.ScheduleEvent(EVENT_POUNCE, 100); + _events.ScheduleEvent(EVENT_NOSUMMON, 50000); + } + + void IsSummonedBy(Unit* summoner) + { + if (summoner->GetTypeId() != TYPEID_PLAYER || !summoner->GetVehicle()) + return; + + _tigerGuid = summoner->GetVehicle()->GetBase()->GetGUID(); + if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) + { + me->AddThreat(tiger, 500000.0f); + DoCast(me, SPELL_FURIOUS_BITE); + } + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() != TYPEID_UNIT || !victim->isSummon()) + return; + + if (Unit* vehSummoner = victim->ToTempSummon()->GetSummoner()) + { + vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); + vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); + vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); + vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); + } + me->DespawnOrUnsummon(); + } + + void DamageTaken(Unit* attacker, uint32& damage) + { + if (!attacker->isSummon()) + return; + + if (HealthBelowPct(20)) + { + damage = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (Unit* vehSummoner = attacker->ToTempSummon()->GetSummoner()) + { + vehSummoner->AddAura(SPELL_SUMMON_ZENTABRA_TRIGGER, vehSummoner); + vehSummoner->CastSpell(vehSummoner, SPELL_SUMMON_ZENTABRA, true); + attacker->CastSpell(attacker, SPELL_EJECT_PASSENGERS, true); + vehSummoner->RemoveAurasDueToSpell(SPELL_NO_SUMMON_AURA); + vehSummoner->RemoveAurasDueToSpell(SPELL_DETECT_INVIS); + vehSummoner->RemoveAurasDueToSpell(SPELL_SPIRIT_OF_THE_TIGER_RIDER); + vehSummoner->RemoveAurasDueToSpell(SPELL_SUMMON_ZENTABRA_TRIGGER); + } + + me->DespawnOrUnsummon(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!_tigerGuid) + return; + + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_POUNCE: + DoCastVictim(SPELL_POUNCE); + _events.ScheduleEvent(EVENT_POUNCE, 30000); + break; + case EVENT_NOSUMMON: // Reapply SPELL_NO_SUMMON_AURA + if (Unit* tiger = ObjectAccessor::GetUnit(*me, _tigerGuid)) + { + if (tiger->isSummon()) + if (Unit* vehSummoner = tiger->ToTempSummon()->GetSummoner()) + me->AddAura(SPELL_NO_SUMMON_AURA, vehSummoner); + } + _events.ScheduleEvent(EVENT_NOSUMMON, 50000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap _events; + uint64 _tigerGuid; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_tiger_matriarchAI(creature); + } +}; + +// These models was found in sniff. +// TODO: generalize these models with race from dbc +uint32 const trollmodel[] = +{11665, 11734, 11750, 12037, 12038, 12042, 12049, 12849, 13529, 14759, 15570, 15701, +15702, 1882, 1897, 1976, 2025, 27286, 2734, 2735, 4084, 4085, 4087, 4089, 4231, 4357, +4358, 4360, 4361, 4362, 4363, 4370, 4532, 4537, 4540, 4610, 6839, 7037, 9767, 9768}; + +class npc_troll_volunteer : public CreatureScript +{ + public: + npc_troll_volunteer() : CreatureScript("npc_troll_volunteer") { } + + struct npc_troll_volunteerAI : public ScriptedAI + { + npc_troll_volunteerAI(Creature* creature) : ScriptedAI(creature) + { + } + + void InitializeAI() + { + if (me->isDead() || !me->GetOwner()) + return; + + Reset(); + + switch (urand(0, 3)) + { + case 0: + _mountModel = 6471; + break; + case 1: + _mountModel = 6473; + break; + case 2: + _mountModel = 6469; + break; + default: + _mountModel = 6472; + break; + } + me->SetDisplayId(trollmodel[urand(0, 39)]); + if (Player* player = me->GetOwner()->ToPlayer()) + me->GetMotionMaster()->MoveFollow(player, 5.0f, float(rand_norm() + 1.0f) * M_PI / 3.0f * 4.0f); + } + + void Reset() + { + _complete = false; + me->AddAura(SPELL_VOLUNTEER_AURA, me); + me->AddAura(SPELL_MOUNTING_CHECK, me); + DoCast(me, SPELL_PETACT_AURA); + me->SetReactState(REACT_PASSIVE); + Talk(SAY_VOLUNTEER_START); + } + + // This is needed for mount check aura to know what mountmodel the npc got stored + uint32 GetMountId() + { + return _mountModel; + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + if (id == POINT_URUZIN) + me->DespawnOrUnsummon(); + } + + void SpellHit(Unit* caster, SpellInfo const* spell) + { + if (spell->Id == SPELL_AOE_TURNIN && caster->GetEntry() == NPC_URUZIN && !_complete) + { + _complete = true; // Preventing from giving credit twice + DoCast(me, SPELL_TURNIN); + DoCast(me, SPELL_QUEST_CREDIT); + me->RemoveAurasDueToSpell(SPELL_MOUNTING_CHECK); + me->Dismount(); + Talk(SAY_VOLUNTEER_END); + me->GetMotionMaster()->MovePoint(POINT_URUZIN, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ()); + } + } + + private: + uint32 _mountModel; + bool _complete; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_troll_volunteerAI(creature); + } +}; + +typedef npc_troll_volunteer::npc_troll_volunteerAI VolunteerAI; + +class spell_mount_check : public SpellScriptLoader +{ + public: + spell_mount_check() : SpellScriptLoader("spell_mount_check") {} + + class spell_mount_check_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mount_check_AuraScript) + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MOUNTING_CHECK)) + return false; + return true; + } + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + Unit* target = GetTarget(); + Unit* owner = target->GetOwner(); + + if (!owner) + return; + + if (owner->IsMounted() && !target->IsMounted()) + { + if (VolunteerAI* volunteerAI = CAST_AI(VolunteerAI, target->GetAI())) + target->Mount(volunteerAI->GetMountId()); + } + else if (!owner->IsMounted() && target->IsMounted()) + target->Dismount(); + + target->SetSpeed(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN)); + target->SetSpeed(MOVE_WALK, owner->GetSpeedRate(MOVE_WALK)); + } + + void Register() + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mount_check_AuraScript(); + } +}; + +class spell_voljin_war_drums : public SpellScriptLoader +{ + public: + spell_voljin_war_drums() : SpellScriptLoader("spell_voljin_war_drums") {} + + class spell_voljin_war_drums_SpellScript : public SpellScript + { + PrepareSpellScript(spell_voljin_war_drums_SpellScript) + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_1)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MOTIVATE_2)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + uint32 motivate = 0; + if (target->GetEntry() == NPC_CITIZEN_1) + motivate = SPELL_MOTIVATE_1; + else if (target->GetEntry() == NPC_CITIZEN_2) + motivate = SPELL_MOTIVATE_2; + if (motivate) + caster->CastSpell(target, motivate, false); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_voljin_war_drums_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_voljin_war_drums_SpellScript(); + } +}; + +enum VoodooSpells +{ + SPELL_BREW = 16712, // Special Brew + SPELL_GHOSTLY = 16713, // Ghostly + SPELL_HEX1 = 16707, // Hex + SPELL_HEX2 = 16708, // Hex + SPELL_HEX3 = 16709, // Hex + SPELL_GROW = 16711, // Grow + SPELL_LAUNCH = 16716, // Launch (Whee!) +}; + +// 17009 +class spell_voodoo : public SpellScriptLoader +{ + public: + spell_voodoo() : SpellScriptLoader("spell_voodoo") {} + + class spell_voodoo_SpellScript : public SpellScript + { + PrepareSpellScript(spell_voodoo_SpellScript) + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_BREW) || !sSpellMgr->GetSpellInfo(SPELL_GHOSTLY) || + !sSpellMgr->GetSpellInfo(SPELL_HEX1) || !sSpellMgr->GetSpellInfo(SPELL_HEX2) || + !sSpellMgr->GetSpellInfo(SPELL_HEX3) || !sSpellMgr->GetSpellInfo(SPELL_GROW) || + !sSpellMgr->GetSpellInfo(SPELL_LAUNCH)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellid = RAND(SPELL_BREW, SPELL_GHOSTLY, RAND(SPELL_HEX1, SPELL_HEX2, SPELL_HEX3), SPELL_GROW, SPELL_LAUNCH); + if (Unit* target = GetHitUnit()) + GetCaster()->CastSpell(target, spellid, false); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_voodoo_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_voodoo_SpellScript(); + } +}; + +void AddSC_durotar() +{ + new npc_lazy_peon(); + new npc_tiger_matriarch_credit(); + new npc_tiger_matriarch(); + new npc_troll_volunteer(); + new spell_mount_check(); + new spell_voljin_war_drums(); + new spell_voodoo(); +} diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp new file mode 100644 index 00000000000..37941227c78 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -0,0 +1,780 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Dustwallow_Marsh +SD%Complete: 95 +SDComment: Quest support: 11180, 558, 11126, 11142, 11174, Vendor Nat Pagle +SDCategory: Dustwallow Marsh +EndScriptData */ + +/* ContentData +mobs_risen_husk_spirit +npc_lady_jaina_proudmoore +npc_nat_pagle +npc_private_hendel +npc_cassa_crimsonwing - handled by npc_taxi +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" +#include "SpellScript.h" +#include "Player.h" +#include "WorldSession.h" + +/*###### +## mobs_risen_husk_spirit +######*/ + +enum HauntingWitchHill +{ + // Quest + QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, + + // General spells + SPELL_SUMMON_RESTLESS_APPARITION = 42511, + SPELL_WITCH_HILL_INFORMATION_CREDIT = 42512, + + // Risen Husk specific + SPELL_CONSUME_FLESH = 37933, + NPC_RISEN_HUSK = 23555, + + // Risen Spirit specific + SPELL_INTANGIBLE_PRESENCE = 43127, + NPC_RISEN_SPIRIT = 23554, + + // Events + EVENT_CONSUME_FLESH = 0, + EVENT_INTANGIBLE_PRESENCE = 1, +}; + +class mobs_risen_husk_spirit : public CreatureScript +{ + public: + mobs_risen_husk_spirit() : CreatureScript("mobs_risen_husk_spirit") { } + + struct mobs_risen_husk_spiritAI : public ScriptedAI + { + mobs_risen_husk_spiritAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() + { + events.Reset(); + if (me->GetEntry() == NPC_RISEN_HUSK) + events.ScheduleEvent(EVENT_CONSUME_FLESH, 5000); + else if (me->GetEntry() == NPC_RISEN_SPIRIT) + events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 5000); + } + + void JustDied(Unit* killer) + { + if (killer->GetTypeId() == TYPEID_PLAYER) + { + if (killer->ToPlayer()->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) + { + DoCast(me, SPELL_SUMMON_RESTLESS_APPARITION, true); + DoCast(killer, SPELL_WITCH_HILL_INFORMATION_CREDIT, true); + } + } + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_CONSUME_FLESH: + DoCastVictim(SPELL_CONSUME_FLESH); + events.ScheduleEvent(EVENT_CONSUME_FLESH, 15000); + break; + case EVENT_INTANGIBLE_PRESENCE: + DoCastVictim(SPELL_INTANGIBLE_PRESENCE); + events.ScheduleEvent(EVENT_INTANGIBLE_PRESENCE, 15000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap events; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new mobs_risen_husk_spiritAI (creature); + } +}; + +/*###### +## npc_theramor_guard +######*/ + +enum TheramoreGuard +{ + QUEST_DISCREDITING_THE_DESERTERS = 11133, + + NPC_THERAMORE_GUARD = 4979, + + SPELL_DOCTORED_LEAFLET = 42725, + SPELL_PROPAGANDIZED = 42246, + + SAY_QUEST1 = 0, + SAY_QUEST2 = 1, + SAY_QUEST3 = 2 +}; + +#define GOSSIP_ITEM_THERAMORE_GUARD "You look like an intelligent person. Why don't you read one of these leaflets and give it some thought?" + +class npc_theramore_guard : public CreatureScript +{ +public: + npc_theramore_guard() : CreatureScript("npc_theramore_guard") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->GetQuestStatus(QUEST_DISCREDITING_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THERAMORE_GUARD, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + + if (action == GOSSIP_SENDER_INFO) + { + player->CLOSE_GOSSIP_MENU(); + player->KilledMonsterCredit(NPC_THERAMORE_GUARD, 0); + creature->AI()->Talk(SAY_QUEST1); + creature->CastSpell(creature, SPELL_DOCTORED_LEAFLET, false); + creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->YellTimer = 4000; + CAST_AI(npc_theramore_guard::npc_theramore_guardAI, creature->AI())->bYellTimer = true; + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_theramore_guardAI(creature); + } + + struct npc_theramore_guardAI : public ScriptedAI + { + npc_theramore_guardAI(Creature* creature) : ScriptedAI(creature) { } + + uint32 YellTimer; + uint32 Step; + bool bYellTimer; + + void Reset() + { + bYellTimer = false; + Step = 0; + } + + void UpdateAI(const uint32 Diff) + { + if (!me->HasAura(SPELL_PROPAGANDIZED)) + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + if (bYellTimer && YellTimer <= Diff) + { + switch (Step) + { + case 0: + Talk(SAY_QUEST2); + YellTimer = 3000; + ++Step; + break; + case 1: + Talk(SAY_QUEST3); + me->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); + Step = 0; + bYellTimer = false; + break; + } + } + else + YellTimer -= Diff; + } + }; +}; + +/*###### +## npc_lady_jaina_proudmoore +######*/ + +enum LadyJaina +{ + QUEST_JAINAS_AUTOGRAPH = 558, + SPELL_JAINAS_AUTOGRAPH = 23122 +}; + +#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." + +class npc_lady_jaina_proudmoore : public CreatureScript +{ +public: + npc_lady_jaina_proudmoore() : CreatureScript("npc_lady_jaina_proudmoore") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_SENDER_INFO) + { + player->SEND_GOSSIP_MENU(7012, creature->GetGUID()); + player->CastSpell(player, SPELL_JAINAS_AUTOGRAPH, false); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_nat_pagle +######*/ + +enum NatPagle +{ + QUEST_NATS_MEASURING_TAPE = 8227 +}; + +class npc_nat_pagle : public CreatureScript +{ +public: + npc_nat_pagle() : CreatureScript("npc_nat_pagle") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_TRADE) + player->GetSession()->SendListInventory(creature->GetGUID()); + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (creature->isVendor() && player->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + player->SEND_GOSSIP_MENU(7640, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(7638, creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_private_hendel +######*/ + +enum Hendel +{ + SAY_PROGRESS_1_TER = 0, + SAY_PROGRESS_2_HEN = 1, + SAY_PROGRESS_3_TER = 2, + SAY_PROGRESS_4_TER = 3, + EMOTE_SURRENDER = 4, + + QUEST_MISSING_DIPLO_PT16 = 1324, + FACTION_HOSTILE = 168, //guessed, may be different + + NPC_SENTRY = 5184, //helps hendel + NPC_JAINA = 4968, //appears once hendel gives up + NPC_TERVOSH = 4967 +}; + +//TODO: develop this further, end event not created +class npc_private_hendel : public CreatureScript +{ +public: + npc_private_hendel() : CreatureScript("npc_private_hendel") { } + + bool OnQuestAccept(Player* /*player*/, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) + creature->setFaction(FACTION_HOSTILE); + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_private_hendelAI(creature); + } + + struct npc_private_hendelAI : public ScriptedAI + { + npc_private_hendelAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() + { + me->RestoreFaction(); + } + + void AttackedBy(Unit* pAttacker) + { + if (me->getVictim()) + return; + + if (me->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &Damage) + { + if (Damage > me->GetHealth() || me->HealthBelowPctDamaged(20, Damage)) + { + Damage = 0; + + if (Player* player = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) + player->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, me); + + Talk(EMOTE_SURRENDER); + EnterEvadeMode(); + } + } + }; + +}; + +/*###### +## npc_zelfrax +######*/ + +Position const MovePosition = {-2967.030f, -3872.1799f, 35.620f, 0.0f}; + +enum Zelfrax +{ + SAY_ZELFRAX1 = 0, + SAY_ZELFRAX2 = 1 +}; + +class npc_zelfrax : public CreatureScript +{ +public: + npc_zelfrax() : CreatureScript("npc_zelfrax") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_zelfraxAI(creature); + } + + struct npc_zelfraxAI : public ScriptedAI + { + npc_zelfraxAI(Creature* creature) : ScriptedAI(creature) + { + MoveToDock(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (me->Attack(who, true)) + { + me->SetInCombatWith(who); + who->SetInCombatWith(me); + + if (IsCombatMovementAllowed()) + me->GetMotionMaster()->MoveChase(who); + } + } + + void MovementInform(uint32 Type, uint32 /*Id*/) + { + if (Type != POINT_MOTION_TYPE) + return; + + me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + SetCombatMovement(true); + + if (me->isInCombat()) + if (Unit* unit = me->getVictim()) + me->GetMotionMaster()->MoveChase(unit); + } + + void MoveToDock() + { + SetCombatMovement(false); + me->GetMotionMaster()->MovePoint(0, MovePosition); + Talk(SAY_ZELFRAX1); + Talk(SAY_ZELFRAX2); + } + + void UpdateAI(uint32 const /*Diff*/) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*###### +## npc_stinky +######*/ + +enum Stinky +{ + QUEST_STINKYS_ESCAPE_H = 1270, + QUEST_STINKYS_ESCAPE_A = 1222, + SAY_QUEST_ACCEPTED = 0, + SAY_STAY_1 = 1, + SAY_STAY_2 = 2, + SAY_STAY_3 = 3, + SAY_STAY_4 = 4, + SAY_STAY_5 = 5, + SAY_STAY_6 = 6, + SAY_QUEST_COMPLETE = 7, + SAY_ATTACKED_1 = 8, + EMOTE_DISAPPEAR = 9 +}; + +class npc_stinky : public CreatureScript +{ +public: + npc_stinky() : CreatureScript("npc_stinky") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_stinkyAI(creature); + } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_STINKYS_ESCAPE_H || quest->GetQuestId() == QUEST_STINKYS_ESCAPE_A) + { + if (npc_stinkyAI* pEscortAI = CAST_AI(npc_stinky::npc_stinkyAI, creature->AI())) + { + creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + creature->SetStandState(UNIT_STAND_STATE_STAND); + creature->AI()->Talk(SAY_QUEST_ACCEPTED); + pEscortAI->Start(false, false, player->GetGUID()); + } + } + return true; + } + + struct npc_stinkyAI : public npc_escortAI + { + npc_stinkyAI(Creature* creature) : npc_escortAI(creature) { } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 7: + Talk(SAY_STAY_1, player->GetGUID()); + break; + case 11: + Talk(SAY_STAY_2, player->GetGUID()); + break; + case 25: + Talk(SAY_STAY_3, player->GetGUID()); + break; + case 26: + Talk(SAY_STAY_4, player->GetGUID()); + break; + case 27: + Talk(SAY_STAY_5, player->GetGUID()); + break; + case 28: + Talk(SAY_STAY_6, player->GetGUID()); + me->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case 29: + me->SetStandState(UNIT_STAND_STATE_STAND); + break; + case 37: + Talk(SAY_QUEST_COMPLETE, player->GetGUID()); + me->SetSpeed(MOVE_RUN, 1.2f, true); + me->SetWalk(false); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) + player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me); + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) + player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me); + break; + case 39: + Talk(EMOTE_DISAPPEAR); + break; + } + } + + void EnterCombat(Unit* who) + { + Talk(SAY_ATTACKED_1, who->GetGUID()); + } + + void Reset() {} + + void JustDied(Unit* /*killer*/) + { + Player* player = GetPlayerForEscort(); + if (player && HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H)) + player->FailQuest(QUEST_STINKYS_ESCAPE_H); + + if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A)) + player->FailQuest(QUEST_STINKYS_ESCAPE_A); + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; +}; + +enum SpellScripts +{ + SPELL_OOZE_ZAP = 42489, + SPELL_OOZE_ZAP_CHANNEL_END = 42485, + SPELL_OOZE_CHANNEL_CREDIT = 42486, + SPELL_ENERGIZED = 42492, +}; + +class spell_ooze_zap : public SpellScriptLoader +{ + public: + spell_ooze_zap() : SpellScriptLoader("spell_ooze_zap") { } + + class spell_ooze_zap_SpellScript : public SpellScript + { + PrepareSpellScript(spell_ooze_zap_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP)) + return false; + return true; + } + + SpellCastResult CheckRequirement() + { + if (!GetCaster()->HasAura(GetSpellInfo()->Effects[EFFECT_1].CalcValue())) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; // This is actually correct + + if (!GetExplTargetUnit()) + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + + void HandleDummy(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (GetHitUnit()) + GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + OnCheckCast += SpellCheckCastFn(spell_ooze_zap_SpellScript::CheckRequirement); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_ooze_zap_SpellScript(); + } +}; + +class spell_ooze_zap_channel_end : public SpellScriptLoader +{ + public: + spell_ooze_zap_channel_end() : SpellScriptLoader("spell_ooze_zap_channel_end") { } + + class spell_ooze_zap_channel_end_SpellScript : public SpellScript + { + PrepareSpellScript(spell_ooze_zap_channel_end_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_OOZE_ZAP_CHANNEL_END)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (Player* player = GetCaster()->ToPlayer()) + player->CastSpell(player, SPELL_OOZE_CHANNEL_CREDIT, true); + GetHitUnit()->Kill(GetHitUnit()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_ooze_zap_channel_end_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_ooze_zap_channel_end_SpellScript(); + } +}; + +class spell_energize_aoe : public SpellScriptLoader +{ + public: + spell_energize_aoe() : SpellScriptLoader("spell_energize_aoe") { } + + class spell_energize_aoe_SpellScript : public SpellScript + { + PrepareSpellScript(spell_energize_aoe_SpellScript); + + bool Validate(SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ENERGIZED)) + return false; + return true; + } + + void FilterTargets(std::list& targets) + { + for (std::list::iterator itr = targets.begin(); itr != targets.end();) + { + if ((*itr)->GetTypeId() == TYPEID_PLAYER && (*itr)->ToPlayer()->GetQuestStatus(GetSpellInfo()->Effects[EFFECT_1].CalcValue()) == QUEST_STATUS_INCOMPLETE) + ++itr; + else + targets.erase(itr++); + } + targets.push_back(GetCaster()); + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_energize_aoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_energize_aoe_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENTRY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_energize_aoe_SpellScript(); + } +}; + +/*###### +## go_blackhoof_cage +######*/ + +enum PrisonersOfTheGrimTotems +{ + NPC_THERAMORE_PRISONER = 23720, + SAY_FREE = 0, +}; + +class go_blackhoof_cage : public GameObjectScript +{ +public: + go_blackhoof_cage() : GameObjectScript("go_blackhoof_cage") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->UseDoorOrButton(); + if (Creature* prisoner = go->FindNearestCreature(NPC_THERAMORE_PRISONER, 1.0f)) + { + if (player) + player->KilledMonsterCredit(NPC_THERAMORE_PRISONER, 0); + + prisoner->AI()->Talk(SAY_FREE); // We also emote cry here (handled in creature_text.emote) + prisoner->DespawnOrUnsummon(6000); + } + return true; + } +}; + +void AddSC_dustwallow_marsh() +{ + new mobs_risen_husk_spirit(); + new npc_lady_jaina_proudmoore(); + new npc_nat_pagle(); + new npc_private_hendel(); + new npc_zelfrax(); + new npc_stinky(); + new npc_theramore_guard(); + new spell_ooze_zap(); + new spell_ooze_zap_channel_end(); + new spell_energize_aoe(); + new go_blackhoof_cage(); +} diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp new file mode 100644 index 00000000000..e23eaa961bb --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_felwood.cpp @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Felwood +SD%Complete: 95 +SDComment: Quest support: 4101, 4102 +SDCategory: Felwood +EndScriptData */ + +/* ContentData +npcs_riverbreeze_and_silversky +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npcs_riverbreeze_and_silversky +######*/ + +#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" + +enum RiverbreezeAndSilversky +{ + SPELL_CENARION_BEACON = 15120, + + NPC_ARATHANDRIS_SILVERSKY = 9528, + NPC_MAYBESS_RIVERBREEZE = 9529, + + QUEST_CLEASING_FELWOOD_A = 4101, + QUEST_CLEASING_FELWOOD_H = 4102 +}; + +class npcs_riverbreeze_and_silversky : public CreatureScript +{ +public: + npcs_riverbreeze_and_silversky() : CreatureScript("npcs_riverbreeze_and_silversky") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_CENARION_BEACON, false); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + uint32 creatureId = creature->GetEntry(); + + if (creatureId == NPC_ARATHANDRIS_SILVERSKY) + { + if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_A)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(2848, creature->GetGUID()); + } else if (player->GetTeam() == HORDE) + player->SEND_GOSSIP_MENU(2845, creature->GetGUID()); + else + player->SEND_GOSSIP_MENU(2844, creature->GetGUID()); + } + + if (creatureId == NPC_MAYBESS_RIVERBREEZE) + { + if (player->GetQuestRewardStatus(QUEST_CLEASING_FELWOOD_H)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(2849, creature->GetGUID()); + } else if (player->GetTeam() == ALLIANCE) + player->SEND_GOSSIP_MENU(2843, creature->GetGUID()); + else + player->SEND_GOSSIP_MENU(2842, creature->GetGUID()); + } + + return true; + } +}; + +void AddSC_felwood() +{ + new npcs_riverbreeze_and_silversky(); +} diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp new file mode 100644 index 00000000000..b2326de86ab --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_feralas.cpp @@ -0,0 +1,249 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Feralas +SD%Complete: 100 +SDComment: Quest support: 3520, 2767, Special vendor Gregan Brewspewer +SDCategory: Feralas +EndScriptData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" +#include "SpellScript.h" +#include "Player.h" +#include "WorldSession.h" + +/*###### +## npc_gregan_brewspewer +######*/ + +#define GOSSIP_HELLO "Buy somethin', will ya?" + +class npc_gregan_brewspewer : public CreatureScript +{ +public: + npc_gregan_brewspewer() : CreatureScript("npc_gregan_brewspewer") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + player->SEND_GOSSIP_MENU(2434, creature->GetGUID()); + } + if (action == GOSSIP_ACTION_TRADE) + player->GetSession()->SendListInventory(creature->GetGUID()); + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (creature->isVendor() && player->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(2433, creature->GetGUID()); + return true; + } + +}; + +/*###### +## npc_oox22fe +######*/ + +enum OOX +{ + SAY_OOX_START = 0, + SAY_OOX_AGGRO = 1, + SAY_OOX_AMBUSH = 2, + SAY_OOX_END = 3, + + NPC_YETI = 7848, + NPC_GORILLA = 5260, + NPC_WOODPAW_REAVER = 5255, + NPC_WOODPAW_BRUTE = 5253, + NPC_WOODPAW_ALPHA = 5258, + NPC_WOODPAW_MYSTIC = 5254, + + QUEST_RESCUE_OOX22FE = 2767, + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +class npc_oox22fe : public CreatureScript +{ +public: + npc_oox22fe() : CreatureScript("npc_oox22fe") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_RESCUE_OOX22FE) + { + creature->AI()->Talk(SAY_OOX_START); + //change that the npc is not lying dead on the ground + creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (player->GetTeam() == ALLIANCE) + creature->setFaction(FACTION_ESCORTEE_A); + + if (player->GetTeam() == HORDE) + creature->setFaction(FACTION_ESCORTEE_H); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_oox22fe::npc_oox22feAI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_oox22feAI(creature); + } + + struct npc_oox22feAI : public npc_escortAI + { + npc_oox22feAI(Creature* creature) : npc_escortAI(creature) { } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + // First Ambush(3 Yetis) + case 11: + Talk(SAY_OOX_AMBUSH); + me->SummonCreature(NPC_YETI, -4841.01f, 1593.91f, 73.42f, 3.98f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_YETI, -4837.61f, 1568.58f, 78.21f, 3.13f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_YETI, -4841.89f, 1569.95f, 76.53f, 0.68f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + //Second Ambush(3 Gorillas) + case 21: + Talk(SAY_OOX_AMBUSH); + me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + //Third Ambush(4 Gnolls) + case 30: + Talk(SAY_OOX_AMBUSH); + me->SummonCreature(NPC_WOODPAW_REAVER, -4425.14f, 2075.87f, 47.77f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_WOODPAW_BRUTE, -4426.68f, 2077.98f, 47.57f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33f, 2080.24f, 47.43f, 3.87f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_WOODPAW_ALPHA, -4430.04f, 2075.54f, 46.83f, 3.81f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + case 37: + Talk(SAY_OOX_END); + // Award quest credit + if (Player* player = GetPlayerForEscort()) + player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me); + break; + } + } + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + 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) + Talk(SAY_OOX_AGGRO); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + }; + +}; + +/*###### +## npc_screecher_spirit +######*/ + +class npc_screecher_spirit : public CreatureScript +{ +public: + npc_screecher_spirit() : CreatureScript("npc_screecher_spirit") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + player->SEND_GOSSIP_MENU(2039, creature->GetGUID()); + player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + return true; + } + +}; + +enum GordunniTrap +{ + GO_GORDUNNI_DIRT_MOUND = 144064, +}; + +class spell_gordunni_trap : public SpellScriptLoader +{ + public: + spell_gordunni_trap() : SpellScriptLoader("spell_gordunni_trap") { } + + class spell_gordunni_trap_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gordunni_trap_SpellScript); + + void HandleDummy() + { + if (Unit* caster = GetCaster()) + if (GameObject* chest = caster->SummonGameObject(GO_GORDUNNI_DIRT_MOUND, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0)) + chest->SetSpellId(GetSpellInfo()->Id); + } + + void Register() + { + OnCast += SpellCastFn(spell_gordunni_trap_SpellScript::HandleDummy); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gordunni_trap_SpellScript(); + } +}; + +/*###### +## AddSC +######*/ + +void AddSC_feralas() +{ + new npc_gregan_brewspewer(); + new npc_oox22fe(); + new npc_screecher_spirit(); + new spell_gordunni_trap(); +} diff --git a/src/server/scripts/Kalimdor/zone_moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp new file mode 100644 index 00000000000..e41ffae03e6 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp @@ -0,0 +1,714 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Moonglade +SD%Complete: 100 +SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. +SDCategory: Moonglade +EndScriptData */ + +/* ContentData +npc_bunthen_plainswind +npc_great_bear_spirit +npc_silva_filnaveth +npc_clintar_spirit +npc_clintar_dreamwalker +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "ScriptedGossip.h" +#include "Player.h" +#include "SpellInfo.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" + +/*###### +## npc_bunthen_plainswind +######*/ + +enum Bunthen +{ + QUEST_SEA_LION_HORDE = 30, + QUEST_SEA_LION_ALLY = 272, + TAXI_PATH_ID_ALLY = 315, + TAXI_PATH_ID_HORDE = 316 +}; + +#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." +#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" + +class npc_bunthen_plainswind : public CreatureScript +{ +public: + npc_bunthen_plainswind() : CreatureScript("npc_bunthen_plainswind") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: + player->CLOSE_GOSSIP_MENU(); + if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) + player->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + player->SEND_GOSSIP_MENU(5373, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(5376, creature->GetGUID()); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->getClass() != CLASS_DRUID) + player->SEND_GOSSIP_MENU(4916, creature->GetGUID()); + else if (player->GetTeam() != HORDE) + { + if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + player->SEND_GOSSIP_MENU(4917, creature->GetGUID()); + } + else if (player->getClass() == CLASS_DRUID && player->GetTeam() == HORDE) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + player->SEND_GOSSIP_MENU(4918, creature->GetGUID()); + } + return true; + } + +}; + +/*###### +## npc_great_bear_spirit +######*/ + +#define GOSSIP_BEAR1 "What do you represent, spirit?" +#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." +#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." +#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." + +class npc_great_bear_spirit : public CreatureScript +{ +public: + npc_great_bear_spirit() : CreatureScript("npc_great_bear_spirit") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(4721, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(4733, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(4734, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(4735, creature->GetGUID()); + if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE) + player->AreaExploredOrEventHappens(5929); + if (player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) + player->AreaExploredOrEventHappens(5930); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + //ally or horde quest + if (player->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + player->SEND_GOSSIP_MENU(4719, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(4718, creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_silva_filnaveth +######*/ + +#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." +#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" + +class npc_silva_filnaveth : public CreatureScript +{ +public: + npc_silva_filnaveth() : CreatureScript("npc_silva_filnaveth") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: + player->CLOSE_GOSSIP_MENU(); + if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) + player->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + player->SEND_GOSSIP_MENU(5374, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + player->SEND_GOSSIP_MENU(5375, creature->GetGUID()); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->getClass() != CLASS_DRUID) + player->SEND_GOSSIP_MENU(4913, creature->GetGUID()); + else if (player->GetTeam() != ALLIANCE) + { + if (player->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + player->SEND_GOSSIP_MENU(4915, creature->GetGUID()); + } + else if (player->getClass() == CLASS_DRUID && player->GetTeam() == ALLIANCE) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (player->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + player->SEND_GOSSIP_MENU(4914, creature->GetGUID()); + } + return true; + } + +}; + +/*###### +## npc_clintar_spirit +######*/ + +float const Clintar_spirit_WP[41][5] = +{ + //pos_x pos_y pos_z orien waitTime + {7465.28f, -3115.46f, 439.327f, 0.83f, 4000}, + {7476.49f, -3101, 443.457f, 0.89f, 0}, + {7486.57f, -3085.59f, 439.478f, 1.07f, 0}, + {7472.19f, -3085.06f, 443.142f, 3.07f, 0}, + {7456.92f, -3085.91f, 438.862f, 3.24f, 0}, + {7446.68f, -3083.43f, 438.245f, 2.40f, 0}, + {7446.17f, -3080.21f, 439.826f, 1.10f, 6000}, + {7452.41f, -3085.8f, 438.984f, 5.78f, 0}, + {7469.11f, -3084.94f, 443.048f, 6.25f, 0}, + {7483.79f, -3085.44f, 439.607f, 6.25f, 0}, + {7491.14f, -3090.96f, 439.983f, 5.44f, 0}, + {7497.62f, -3098.22f, 436.854f, 5.44f, 0}, + {7498.72f, -3113.41f, 434.596f, 4.84f, 0}, + {7500.06f, -3122.51f, 434.749f, 5.17f, 0}, + {7504.96f, -3131.53f, 434.475f, 4.74f, 0}, + {7504.31f, -3133.53f, 435.693f, 3.84f, 6000}, + {7504.55f, -3133.27f, 435.476f, 0.68f, 15000}, + {7501.99f, -3126.01f, 434.93f, 1.83f, 0}, + {7490.76f, -3114.97f, 434.431f, 2.51f, 0}, + {7479.64f, -3105.51f, 431.123f, 1.83f, 0}, + {7474.63f, -3086.59f, 428.994f, 1.83f, 2000}, + {7472.96f, -3074.18f, 427.566f, 1.57f, 0}, + {7472.25f, -3063, 428.268f, 1.55f, 0}, + {7473.46f, -3054.22f, 427.588f, 0.36f, 0}, + {7475.08f, -3053.6f, 428.653f, 0.36f, 6000}, + {7474.66f, -3053.56f, 428.433f, 3.19f, 4000}, + {7471.81f, -3058.84f, 427.073f, 4.29f, 0}, + {7472.16f, -3064.91f, 427.772f, 4.95f, 0}, + {7471.56f, -3085.36f, 428.924f, 4.72f, 0}, + {7473.56f, -3093.48f, 429.294f, 5.04f, 0}, + {7478.94f, -3104.29f, 430.638f, 5.23f, 0}, + {7484.46f, -3109.61f, 432.769f, 5.79f, 0}, + {7490.23f, -3111.08f, 434.431f, 0.02f, 0}, + {7496.29f, -3108, 434.783f, 1.15f, 0}, + {7497.46f, -3100.66f, 436.191f, 1.50f, 0}, + {7495.64f, -3093.39f, 438.349f, 2.10f, 0}, + {7492.44f, -3086.01f, 440.267f, 1.38f, 0}, + {7498.26f, -3076.44f, 440.808f, 0.71f, 0}, + {7506.4f, -3067.35f, 443.64f, 0.77f, 0}, + {7518.37f, -3057.42f, 445.584f, 0.74f, 0}, + {7517.51f, -3056.3f, 444.568f, 2.49f, 4500} +}; + +Position const AspectRavenSummon = {7472.96f, -3074.18f, 427.566f, 0.0f}; +Position const ClintarSpiritSummon = {7459.2275f, -3122.5632f, 438.9842f, 0.8594f}; + +enum ClintarSpirit +{ + ASPECT_RAVEN = 22915, + + // Texts for EnterCombat, the event and the end of the event are missing + CLINTAR_SPIRIT_SAY_START = 0, +}; + +class npc_clintar_spirit : public CreatureScript +{ +public: + npc_clintar_spirit() : CreatureScript("npc_clintar_spirit") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_clintar_spiritAI (creature); + } + + struct npc_clintar_spiritAI : public npc_escortAI + { + public: + npc_clintar_spiritAI(Creature* creature) : npc_escortAI(creature) + { + PlayerGUID = 0; + } + + uint8 Step; + uint32 CurrWP; + uint32 EventTimer; + uint32 checkPlayerTimer; + + uint64 PlayerGUID; + + bool EventOnWait; + + void Reset() + { + if (!PlayerGUID) + { + Step = 0; + CurrWP = 0; + EventTimer = 0; + PlayerGUID = 0; + checkPlayerTimer = 1000; + EventOnWait = false; + } + } + + void IsSummonedBy(Unit* /*summoner*/) + { + std::list playerOnQuestList; + Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); + Trinity::PlayerListSearcher searcher(me, playerOnQuestList, checker); + me->VisitNearbyWorldObject(5.0f, searcher); + for (std::list::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr) + { + // Check if found player target has active quest + if (Player* player = (*itr)) + { + if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + StartEvent(player); + break; + } + } + else + break; + } + } + + void JustDied(Unit* /*killer*/) + { + if (!PlayerGUID) + return; + + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + player->FailQuest(10965); + PlayerGUID = 0; + Reset(); + } + } + + void EnterEvadeMode() + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->isInCombat() && player->getAttackerForHelper()) + { + AttackStart(player->getAttackerForHelper()); + return; + } + npc_escortAI::EnterEvadeMode(); + } + + void StartEvent(Player* player) + { + if (player && player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + for (uint8 i = 0; i < 41; ++i) + { + AddWaypoint(i, Clintar_spirit_WP[i][0], Clintar_spirit_WP[i][1], Clintar_spirit_WP[i][2], (uint32)Clintar_spirit_WP[i][4]); + } + PlayerGUID = player->GetGUID(); + Start(true, false, PlayerGUID); + } + return; + } + + void UpdateAI(uint32 const diff) + { + npc_escortAI::UpdateAI(diff); + + if (!PlayerGUID) + { + me->setDeathState(JUST_DIED); + return; + } + + if (!me->isInCombat() && !EventOnWait) + { + if (checkPlayerTimer <= diff) + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->isInCombat() && player->getAttackerForHelper()) + AttackStart(player->getAttackerForHelper()); + checkPlayerTimer = 1000; + } else checkPlayerTimer -= diff; + } + + if (EventOnWait && EventTimer <= diff) + { + + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (!player || (player && player->GetQuestStatus(10965) == QUEST_STATUS_NONE)) + { + me->setDeathState(JUST_DIED); + return; + } + + switch (CurrWP) + { + case 0: + switch (Step) + { + case 0: + Talk(CLINTAR_SPIRIT_SAY_START, PlayerGUID); + EventTimer = 8000; + Step = 1; + break; + case 1: + EventOnWait = false; + break; + } + break; + case 6: + switch (Step) + { + case 0: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); + EventTimer = 5000; + Step = 1; + break; + case 1: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + // Needs text + EventOnWait = false; + break; + } + break; + case 15: + switch (Step) + { + case 0: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); + EventTimer = 5000; + Step = 1; + break; + case 1: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + EventOnWait = false; + break; + } + break; + case 16: + switch (Step) + { + case 0: + // Needs text + EventTimer = 15000; + Step = 1; + break; + case 1: + EventOnWait = false; + break; + } + break; + case 20: + switch (Step) + { + case 0: + if (Creature* mob = me->SummonCreature(ASPECT_RAVEN, AspectRavenSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000)) + { + mob->AddThreat(me, 10000.0f); + mob->AI()->AttackStart(me); + } + EventTimer = 2000; + Step = 1; + break; + case 1: + EventOnWait = false; + break; + } + break; + case 24: + switch (Step) + { + case 0: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 133); + EventTimer = 5000; + Step = 1; + break; + case 1: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + EventOnWait = false; + break; + } + break; + case 25: + switch (Step) + { + case 0: + // Needs text + EventTimer = 4000; + Step = 1; + break; + case 1: + EventOnWait = false; + break; + } + break; + case 40: + switch (Step) + { + case 0: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 2); + // Needs text + player->CompleteQuest(10965); + EventTimer = 1500; + Step = 1; + break; + case 1: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0); + EventTimer = 3000; + Step = 2; + break; + case 2: + player->TalkedToCreature(me->GetEntry(), me->GetGUID()); + PlayerGUID = 0; + Reset(); + me->setDeathState(JUST_DIED); + break; + } + break; + default: + EventOnWait = false; + break; + } + + } else if (EventOnWait) EventTimer -= diff; + } + + void WaypointReached(uint32 waypointId) + { + CurrWP = waypointId; + EventTimer = 0; + Step = 0; + EventOnWait = true; + } + }; + +}; + +/*#### +# npc_omen +####*/ + +enum Omen +{ + NPC_OMEN = 15467, + + SPELL_OMEN_CLEAVE = 15284, + SPELL_OMEN_STARFALL = 26540, + SPELL_OMEN_SUMMON_SPOTLIGHT = 26392, + SPELL_ELUNE_CANDLE = 26374, + + GO_ELUNE_TRAP_1 = 180876, + GO_ELUNE_TRAP_2 = 180877, + + EVENT_CAST_CLEAVE = 1, + EVENT_CAST_STARFALL = 2, + EVENT_DESPAWN = 3, +}; + +class npc_omen : public CreatureScript +{ +public: + npc_omen() : CreatureScript("npc_omen") { } + + struct npc_omenAI : public ScriptedAI + { + npc_omenAI(Creature* creature) : ScriptedAI(creature) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->GetMotionMaster()->MovePoint(1, 7549.977f, -2855.137f, 456.9678f); + } + + EventMap events; + + void MovementInform(uint32 type, uint32 pointId) + { + if (type != POINT_MOTION_TYPE) + return; + + if (pointId == 1) + { + me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + if (Player* player = me->SelectNearestPlayer(40.0f)) + AttackStart(player); + } + } + + void EnterCombat(Unit* /*attacker*/) + { + events.Reset(); + events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(3000, 5000)); + events.ScheduleEvent(EVENT_CAST_STARFALL, urand(8000, 10000)); + } + + void JustDied(Unit* /*killer*/) + { + DoCast(SPELL_OMEN_SUMMON_SPOTLIGHT); + } + + void SpellHit(Unit* /*caster*/, const SpellInfo* spell) + { + if (spell->Id == SPELL_ELUNE_CANDLE) + { + if (me->HasAura(SPELL_OMEN_STARFALL)) + me->RemoveAurasDueToSpell(SPELL_OMEN_STARFALL); + + events.RescheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000)); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + switch (events.ExecuteEvent()) + { + case EVENT_CAST_CLEAVE: + DoCastVictim(SPELL_OMEN_CLEAVE); + events.ScheduleEvent(EVENT_CAST_CLEAVE, urand(8000, 10000)); + break; + case EVENT_CAST_STARFALL: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_OMEN_STARFALL); + events.ScheduleEvent(EVENT_CAST_STARFALL, urand(14000, 16000)); + break; + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_omenAI(creature); + } +}; + +class npc_giant_spotlight : public CreatureScript +{ +public: + npc_giant_spotlight() : CreatureScript("npc_giant_spotlight") { } + + struct npc_giant_spotlightAI : public ScriptedAI + { + npc_giant_spotlightAI(Creature* creature) : ScriptedAI(creature) {} + + EventMap events; + + void Reset() + { + events.Reset(); + events.ScheduleEvent(EVENT_DESPAWN, 5*MINUTE*IN_MILLISECONDS); + } + + void UpdateAI(const uint32 diff) + { + events.Update(diff); + + if (events.ExecuteEvent() == EVENT_DESPAWN) + { + if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_1, 5.0f)) + trap->RemoveFromWorld(); + + if (GameObject* trap = me->FindNearestGameObject(GO_ELUNE_TRAP_2, 5.0f)) + trap->RemoveFromWorld(); + + if (Creature* omen = me->FindNearestCreature(NPC_OMEN, 5.0f, false)) + omen->DespawnOrUnsummon(); + + me->DespawnOrUnsummon(); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_giant_spotlightAI(creature); + } +}; + +void AddSC_moonglade() +{ + new npc_bunthen_plainswind(); + new npc_great_bear_spirit(); + new npc_silva_filnaveth(); + new npc_clintar_spirit(); + new npc_omen(); + new npc_giant_spotlight(); +} diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp new file mode 100644 index 00000000000..aca55284b67 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp @@ -0,0 +1,327 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Mulgore +SD%Complete: 100 +SDComment: Support for quest: 11129, 772 +SDCategory: Mulgore +EndScriptData */ + +/* ContentData +npc_skorn_whitecloud +npc_kyle_frenzied +npc_plains_vision +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" +#include "SpellInfo.h" + +/*###### +# npc_skorn_whitecloud +######*/ + +#define GOSSIP_SW "Tell me a story, Skorn." + +class npc_skorn_whitecloud : public CreatureScript +{ +public: + npc_skorn_whitecloud() : CreatureScript("npc_skorn_whitecloud") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF) + player->SEND_GOSSIP_MENU(523, creature->GetGUID()); + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (!player->GetQuestRewardStatus(770)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(522, creature->GetGUID()); + + return true; + } + +}; + +/*##### +# npc_kyle_frenzied +######*/ + +enum KyleFrenzied +{ + EMOTE_SEE_LUNCH = 0, + EMOTE_EAT_LUNCH = 1, + EMOTE_DANCE = 2, + + SPELL_LUNCH = 42222, + NPC_KYLE_FRENZIED = 23616, + NPC_KYLE_FRIENDLY = 23622, + POINT_ID = 1 +}; + +class npc_kyle_frenzied : public CreatureScript +{ +public: + npc_kyle_frenzied() : CreatureScript("npc_kyle_frenzied") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_kyle_frenziedAI (creature); + } + + struct npc_kyle_frenziedAI : public ScriptedAI + { + npc_kyle_frenziedAI(Creature* creature) : ScriptedAI(creature) {} + + bool EventActive; + bool IsMovingToLunch; + uint64 PlayerGUID; + uint32 EventTimer; + uint8 EventPhase; + + void Reset() + { + EventActive = false; + IsMovingToLunch = false; + PlayerGUID = 0; + EventTimer = 5000; + EventPhase = 0; + + if (me->GetEntry() == NPC_KYLE_FRIENDLY) + me->UpdateEntry(NPC_KYLE_FRENZIED); + } + + void SpellHit(Unit* Caster, SpellInfo const* Spell) + { + if (!me->getVictim() && !EventActive && Spell->Id == SPELL_LUNCH) + { + if (Caster->GetTypeId() == TYPEID_PLAYER) + PlayerGUID = Caster->GetGUID(); + + if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + me->GetMotionMaster()->MovementExpired(); + me->GetMotionMaster()->MoveIdle(); + me->StopMoving(); + } + + EventActive = true; + Talk(EMOTE_SEE_LUNCH); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); + } + } + + void MovementInform(uint32 Type, uint32 PointId) + { + if (Type != POINT_MOTION_TYPE || !EventActive) + return; + + if (PointId == POINT_ID) + IsMovingToLunch = false; + } + + void UpdateAI(const uint32 diff) + { + if (EventActive) + { + if (IsMovingToLunch) + return; + + if (EventTimer <= diff) + { + EventTimer = 5000; + ++EventPhase; + + switch (EventPhase) + { + case 1: + if (Unit* unit = Unit::GetUnit(*me, PlayerGUID)) + { + if (GameObject* go = unit->GetGameObject(SPELL_LUNCH)) + { + IsMovingToLunch = true; + me->GetMotionMaster()->MovePoint(POINT_ID, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()); + } + } + break; + case 2: + Talk(EMOTE_EAT_LUNCH); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); + break; + case 3: + if (Player* unit = Unit::GetPlayer(*me, PlayerGUID)) + unit->TalkedToCreature(me->GetEntry(), me->GetGUID()); + + me->UpdateEntry(NPC_KYLE_FRIENDLY); + break; + case 4: + EventTimer = 30000; + Talk(EMOTE_DANCE); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); + break; + case 5: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Reset(); + me->GetMotionMaster()->Clear(); + break; + } + } + else + EventTimer -= diff; + } + } + }; + +}; + +/*##### +# npc_plains_vision +######*/ + +Position const wpPlainVision[50] = +{ + {-2226.32f, -408.095f, -9.36235f, 0.0f}, + {-2203.04f, -437.212f, -5.72498f, 0.0f}, + {-2163.91f, -457.851f, -7.09049f, 0.0f}, + {-2123.87f, -448.137f, -9.29591f, 0.0f}, + {-2104.66f, -427.166f, -6.49513f, 0.0f}, + {-2101.48f, -422.826f, -5.3567f, 0.0f}, + {-2097.56f, -417.083f, -7.16716f, 0.0f}, + {-2084.87f, -398.626f, -9.88973f, 0.0f}, + {-2072.71f, -382.324f, -10.2488f, 0.0f}, + {-2054.05f, -356.728f, -6.22468f, 0.0f}, + {-2051.8f, -353.645f, -5.35791f, 0.0f}, + {-2049.08f, -349.912f, -6.15723f, 0.0f}, + {-2030.6f, -310.724f, -9.59302f, 0.0f}, + {-2002.15f, -249.308f, -10.8124f, 0.0f}, + {-1972.85f, -195.811f, -10.6316f, 0.0f}, + {-1940.93f, -147.652f, -11.7055f, 0.0f}, + {-1888.06f, -81.943f, -11.4404f, 0.0f}, + {-1837.05f, -34.0109f, -12.258f, 0.0f}, + {-1796.12f, -14.6462f, -10.3581f, 0.0f}, + {-1732.61f, -4.27746f, -10.0213f, 0.0f}, + {-1688.94f, -0.829945f, -11.7103f, 0.0f}, + {-1681.32f, 13.0313f, -9.48056f, 0.0f}, + {-1677.04f, 36.8349f, -7.10318f, 0.0f}, + {-1675.2f, 68.559f, -8.95384f, 0.0f}, + {-1676.57f, 89.023f, -9.65104f, 0.0f}, + {-1678.16f, 110.939f, -10.1782f, 0.0f}, + {-1677.86f, 128.681f, -5.73869f, 0.0f}, + {-1675.27f, 144.324f, -3.47916f, 0.0f}, + {-1671.7f, 163.169f, -1.23098f, 0.0f}, + {-1666.61f, 181.584f, 5.26145f, 0.0f}, + {-1661.51f, 196.154f, 8.95252f, 0.0f}, + {-1655.47f, 210.811f, 8.38727f, 0.0f}, + {-1647.07f, 226.947f, 5.27755f, 0.0f}, + {-1621.65f, 232.91f, 2.69579f, 0.0f}, + {-1600.23f, 237.641f, 2.98539f, 0.0f}, + {-1576.07f, 242.546f, 4.66541f, 0.0f}, + {-1554.57f, 248.494f, 6.60377f, 0.0f}, + {-1547.53f, 259.302f, 10.6741f, 0.0f}, + {-1541.7f, 269.847f, 16.4418f, 0.0f}, + {-1539.83f, 278.989f, 21.0597f, 0.0f}, + {-1540.16f, 290.219f, 27.8247f, 0.0f}, + {-1538.99f, 298.983f, 34.0032f, 0.0f}, + {-1540.38f, 307.337f, 41.3557f, 0.0f}, + {-1536.61f, 314.884f, 48.0179f, 0.0f}, + {-1532.42f, 323.277f, 55.6667f, 0.0f}, + {-1528.77f, 329.774f, 61.1525f, 0.0f}, + {-1525.65f, 333.18f, 63.2161f, 0.0f}, + {-1517.01f, 350.713f, 62.4286f, 0.0f}, + {-1511.39f, 362.537f, 62.4539f, 0.0f}, + {-1508.68f, 366.822f, 62.733f, 0.0f} +}; + +class npc_plains_vision : public CreatureScript +{ +public: + npc_plains_vision() : CreatureScript("npc_plains_vision") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_plains_visionAI (creature); + } + + struct npc_plains_visionAI : public ScriptedAI + { + npc_plains_visionAI(Creature* creature) : ScriptedAI(creature) {} + + bool newWaypoint; + uint8 WayPointId; + uint8 amountWP; + + void Reset() + { + WayPointId = 0; + newWaypoint = true; + amountWP = 49; + } + + void EnterCombat(Unit* /*who*/){} + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id < amountWP) + { + ++WayPointId; + newWaypoint = true; + } + else + { + me->setDeathState(JUST_DIED); + me->RemoveCorpse(); + } + } + + void UpdateAI(const uint32 /*diff*/) + { + if (newWaypoint) + { + me->GetMotionMaster()->MovePoint(WayPointId, wpPlainVision[WayPointId]); + newWaypoint = false; + } + } + }; + +}; + +/*##### +# +######*/ + +void AddSC_mulgore() +{ + new npc_skorn_whitecloud(); + new npc_kyle_frenzied(); + new npc_plains_vision(); +} diff --git a/src/server/scripts/Kalimdor/zone_orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp new file mode 100644 index 00000000000..42ef9843a4e --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp @@ -0,0 +1,254 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Orgrimmar +SD%Complete: 100 +SDComment: Quest support: 2460, 6566 +SDCategory: Orgrimmar +EndScriptData */ + +/* ContentData +npc_shenthul +npc_thrall_warchief +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npc_shenthul +######*/ + +enum Shenthul +{ + QUEST_SHATTERED_SALUTE = 2460 +}; + +class npc_shenthul : public CreatureScript +{ +public: + npc_shenthul() : CreatureScript("npc_shenthul") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_SHATTERED_SALUTE) + { + CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->CanTalk = true; + CAST_AI(npc_shenthul::npc_shenthulAI, creature->AI())->PlayerGUID = player->GetGUID(); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_shenthulAI (creature); + } + + struct npc_shenthulAI : public ScriptedAI + { + npc_shenthulAI(Creature* creature) : ScriptedAI(creature) {} + + bool CanTalk; + bool CanEmote; + uint32 SaluteTimer; + uint32 ResetTimer; + uint64 PlayerGUID; + + void Reset() + { + CanTalk = false; + CanEmote = false; + SaluteTimer = 6000; + ResetTimer = 0; + PlayerGUID = 0; + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (CanEmote) + { + if (ResetTimer <= diff) + { + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + { + if (player->GetTypeId() == TYPEID_PLAYER && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) + player->FailQuest(QUEST_SHATTERED_SALUTE); + } + Reset(); + } else ResetTimer -= diff; + } + + if (CanTalk && !CanEmote) + { + if (SaluteTimer <= diff) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + CanEmote = true; + ResetTimer = 60000; + } else SaluteTimer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* player, uint32 emote) + { + if (emote == TEXT_EMOTE_SALUTE && player->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) + { + if (CanEmote) + { + player->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); + Reset(); + } + } + } + }; + +}; + +/*###### +## npc_thrall_warchief +######*/ + +enum ThrallWarchief +{ + QUEST_6566 = 6566, + + SPELL_CHAIN_LIGHTNING = 16033, + SPELL_SHOCK = 16034 +}; + +#define GOSSIP_HTW "Please share your wisdom with me, Warchief." +#define GOSSIP_STW1 "What discoveries?" +#define GOSSIP_STW2 "Usurper?" +#define GOSSIP_STW3 "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?" +#define GOSSIP_STW4 "I... I did not think of it that way, Warchief." +#define GOSSIP_STW5 "I live only to serve, Warchief! My life is empty and meaningless without your guidance." +#define GOSSIP_STW6 "Of course, Warchief!" + +//TODO: verify abilities/timers +class npc_thrall_warchief : public CreatureScript +{ +public: + npc_thrall_warchief() : CreatureScript("npc_thrall_warchief") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(5733, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(5734, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(5735, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(5736, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->SEND_GOSSIP_MENU(5737, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_STW6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + player->SEND_GOSSIP_MENU(5738, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(QUEST_6566); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HTW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_thrall_warchiefAI (creature); + } + + struct npc_thrall_warchiefAI : public ScriptedAI + { + npc_thrall_warchiefAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 ChainLightningTimer; + uint32 ShockTimer; + + void Reset() + { + ChainLightningTimer = 2000; + ShockTimer = 8000; + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ChainLightningTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); + ChainLightningTimer = 9000; + } else ChainLightningTimer -= diff; + + if (ShockTimer <= diff) + { + DoCast(me->getVictim(), SPELL_SHOCK); + ShockTimer = 15000; + } else ShockTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; + +}; + +void AddSC_orgrimmar() +{ + new npc_shenthul(); + new npc_thrall_warchief(); +} diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp new file mode 100644 index 00000000000..58665224bdd --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -0,0 +1,1515 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Silithus +SD%Complete: 100 +SDComment: Quest support: 7785, 8304, 8507. +SDCategory: Silithus +EndScriptData */ + +/* ContentData +npc_highlord_demitrian +npcs_rutgar_and_frankal +quest_a_pawn_on_the_eternal_pawn +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Group.h" +#include "Player.h" + +/*### +## npc_highlord_demitrian +###*/ + +#define GOSSIP_DEMITRIAN1 "What do you know of it?" +#define GOSSIP_DEMITRIAN2 "I am listening, Demitrian." +#define GOSSIP_DEMITRIAN3 "Continue, please." +#define GOSSIP_DEMITRIAN4 "A battle?" +#define GOSSIP_DEMITRIAN5 "" +#define GOSSIP_DEMITRIAN6 "Caught unaware? How?" +#define GOSSIP_DEMITRIAN7 "So what did Ragnaros do next?" + +class npc_highlord_demitrian : public CreatureScript +{ +public: + npc_highlord_demitrian() : CreatureScript("npc_highlord_demitrian") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(6842, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(6843, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(6844, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(6867, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(6868, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->SEND_GOSSIP_MENU(6869, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->SEND_GOSSIP_MENU(6870, creature->GetGUID()); + + ItemPosCountVec dest; + uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 19016, 1); + if (msg == EQUIP_ERR_OK) + player->StoreNewItem(dest, 19016, true); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(7785) == QUEST_STATUS_NONE && + (player->HasItemCount(18563, 1, false) || player->HasItemCount(18564, 1, false))) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(6812, creature->GetGUID()); + return true; + } + +}; + +/*### +## npcs_rutgar_and_frankal +###*/ + +//gossip item text best guess +#define GOSSIP_ITEM1 "I seek information about Natalia" + +#define GOSSIP_ITEM2 "That sounds dangerous!" +#define GOSSIP_ITEM3 "What did you do?" +#define GOSSIP_ITEM4 "Who?" +#define GOSSIP_ITEM5 "Women do that. What did she demand?" +#define GOSSIP_ITEM6 "What do you mean?" +#define GOSSIP_ITEM7 "What happened next?" + +#define GOSSIP_ITEM11 "Yes, please continue" +#define GOSSIP_ITEM12 "What language?" +#define GOSSIP_ITEM13 "The Priestess attacked you?!" +#define GOSSIP_ITEM14 "I should ask the monkey about this" +#define GOSSIP_ITEM15 "Then what..." + +enum RutgarAndFrankal //trigger creatures to kill +{ + TRIGGER_FRANKAL = 15221, + TRIGGER_RUTGAR = 15222 +}; + +class npcs_rutgar_and_frankal : public CreatureScript +{ +public: + npcs_rutgar_and_frankal() : CreatureScript("npcs_rutgar_and_frankal") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(7755, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(7756, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(7757, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->SEND_GOSSIP_MENU(7758, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + player->SEND_GOSSIP_MENU(7759, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + player->SEND_GOSSIP_MENU(7760, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + player->SEND_GOSSIP_MENU(7761, creature->GetGUID()); + //'kill' our trigger to update quest status + player->KilledMonsterCredit(TRIGGER_RUTGAR, 0); + break; + + case GOSSIP_ACTION_INFO_DEF + 9: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + player->SEND_GOSSIP_MENU(7762, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 10: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + player->SEND_GOSSIP_MENU(7763, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 11: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + player->SEND_GOSSIP_MENU(7764, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + player->SEND_GOSSIP_MENU(7765, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + player->SEND_GOSSIP_MENU(7766, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + player->SEND_GOSSIP_MENU(7767, creature->GetGUID()); + //'kill' our trigger to update quest status + player->KilledMonsterCredit(TRIGGER_FRANKAL, 0); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && + creature->GetEntry() == 15170 && + !player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + if (player->GetQuestStatus(8304) == QUEST_STATUS_INCOMPLETE && + creature->GetEntry() == 15171 && + player->GetReqKillOrCastCurrentCount(8304, TRIGGER_RUTGAR)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + + player->SEND_GOSSIP_MENU(7754, creature->GetGUID()); + + return true; + } + +}; + +/*#### +# quest_a_pawn_on_the_eternal_board (Defines) +####*/ +enum EternalBoard +{ + QUEST_A_PAWN_ON_THE_ETERNAL_BOARD = 8519, + + FACTION_HOSTILE = 14, + FACTION_FRIENDLY = 35, + + C_ANACHRONOS = 15381, + C_FANDRAL_STAGHELM = 15382, + C_ARYGOS = 15380, + C_MERITHRA = 15378, + C_CAELESTRASZ = 15379, + + ANACHRONOS_SAY_1 = 0, + ANACHRONOS_SAY_2 = 1, + ANACHRONOS_SAY_3 = 2, + ANACHRONOS_SAY_4 = 3, + ANACHRONOS_SAY_5 = 4, + ANACHRONOS_SAY_6 = 5, + ANACHRONOS_SAY_7 = 6, + ANACHRONOS_SAY_8 = 7, + ANACHRONOS_SAY_9 = 8, + ANACHRONOS_SAY_10 = 9, + ANACHRONOS_EMOTE_1 = 10, + ANACHRONOS_EMOTE_2 = 11, + ANACHRONOS_EMOTE_3 = 12, + + FANDRAL_SAY_1 = 0, + FANDRAL_SAY_2 = 1, + FANDRAL_SAY_3 = 2, + FANDRAL_SAY_4 = 3, + FANDRAL_SAY_5 = 4, + FANDRAL_SAY_6 = 5, + FANDRAL_EMOTE_1 = 6, + FANDRAL_EMOTE_2 = 7, + + CAELESTRASZ_SAY_1 = 0, + CAELESTRASZ_SAY_2 = 1, + CAELESTRASZ_YELL_1 = 2, + + ARYGOS_SAY_1 = 0, + ARYGOS_YELL_1 = 1, + ARYGOS_EMOTE_1 = 2, + + MERITHRA_SAY_1 = 0, + MERITHRA_SAY_2 = 1, + MERITHRA_YELL_1 = 2, + MERITHRA_EMOTE_1 = 3, + + GO_GATE_OF_AHN_QIRAJ = 176146, + GO_GLYPH_OF_AHN_QIRAJ = 176148, + GO_ROOTS_OF_AHN_QIRAJ = 176147 +}; +/*##### +# Quest: A Pawn on the Eternal Board +#####*/ + +/* ContentData +A Pawn on the Eternal Board - creatures, gameobjects and defines +mob_qiraj_war_spawn : Adds that are summoned in the Qiraj gates battle. +npc_anachronos_the_ancient : Creature that controls the event. +npc_anachronos_quest_trigger: controls the spawning of the BG War mobs. +go_crystalline_tear : GameObject that begins the event and hands out quest +TO DO: get correct spell IDs and timings for spells cast upon dragon transformations +TO DO: Dragons should use the HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF) after transformation, but for some unknown reason it doesnt work. +EndContentData */ + +#define EVENT_AREA_RADIUS 65 //65yds +#define EVENT_COOLDOWN 500000 //in ms. appear after event completed or failed (should be = Adds despawn time) + +struct QuestCinematic +{ + int32 TextId; + uint32 Creature, Timer; +}; + +// Creature 0 - Anachronos, 1 - Fandral, 2 - Arygos, 3 - Merithra, 4 - Caelestrasz +static QuestCinematic EventAnim[]= +{ + {ANACHRONOS_SAY_1, 0, 2000}, + {FANDRAL_SAY_1, 1, 4000}, + {MERITHRA_EMOTE_1, 3, 500}, + {MERITHRA_SAY_1, 3, 500}, + {ARYGOS_EMOTE_1, 2, 2000}, + {CAELESTRASZ_SAY_1, 4, 8000}, + {MERITHRA_SAY_2, 3, 6000}, + {0, 3, 2000}, + {MERITHRA_YELL_1, 3, 2500}, + {0, 3, 3000}, //Morph + {0, 3, 4000}, //EmoteLiftoff + {0, 3, 4000}, // spell + {0, 3, 1250}, //fly + {0, 3, 250}, //remove flags + {ARYGOS_SAY_1, 2, 3000}, + {0, 3, 2000}, + {ARYGOS_YELL_1, 2, 3000}, + {0, 3, 3000}, //Morph + {0, 3, 4000}, //EmoteLiftoff + {0, 3, 4000}, // spell + {0, 3, 1000}, //fly + {0, 3, 1000}, //remove flags + {CAELESTRASZ_SAY_2, 4, 5000}, + {0, 3, 3000}, + {CAELESTRASZ_YELL_1, 4, 3000}, + {0, 3, 3000}, //Morph + {0, 3, 4000}, //EmoteLiftoff + {0, 3, 2500}, // spell + {ANACHRONOS_SAY_2, 0, 2000}, + {0, 3, 250}, //fly + {0, 3, 25}, //remove flags + {FANDRAL_SAY_2, 1, 3000}, + {ANACHRONOS_SAY_3, 0, 10000}, //Both run through the armies + {0, 3, 2000}, // Sands will stop + {0, 3, 8000}, // Summon Gate + {ANACHRONOS_SAY_4, 0, 4000}, + {0, 0, 2000}, //spell 1-> Arcane cosmetic (Mobs freeze) + {0, 0, 5000}, //Spell 2-> Arcane long cosmetic (barrier appears) (Barrier -> Glyphs) + {0, 0, 7000}, //BarrieR + {0, 0, 4000}, //Glyphs + {ANACHRONOS_SAY_5, 0, 2000}, + {0, 0, 4000}, // Roots + {FANDRAL_SAY_3, 1, 3000}, //Root Text + {FANDRAL_EMOTE_1, 1, 3000}, //falls knee + {ANACHRONOS_SAY_6, 0, 3000}, + {ANACHRONOS_SAY_7, 0, 3000}, + {ANACHRONOS_SAY_8, 0, 8000}, + {ANACHRONOS_EMOTE_1, 0, 1000}, //Give Scepter + {FANDRAL_SAY_4, 1, 3000}, + {FANDRAL_SAY_5, 1, 3000}, //->Equip hammer~Scepter, throw it at door + {FANDRAL_EMOTE_2, 1, 3000}, //Throw hammer at door. + {ANACHRONOS_SAY_9, 0, 3000}, + {FANDRAL_SAY_6, 1, 3000}, //fandral goes away + {ANACHRONOS_EMOTE_2, 0, 3000}, + {ANACHRONOS_EMOTE_3, 0, 3000}, + {0, 0, 2000}, + {0, 0, 2000}, + {0, 0, 4000}, + {ANACHRONOS_SAY_10, 0, 3000}, + {0, 0, 2000}, + {0, 0, 3000}, + {0, 0, 15000}, + {0, 0, 5000}, + {0, 0, 3500}, + {0, 0, 5000}, + {0, 0, 3500}, + {0, 0, 5000}, + {0, 0, 0} +}; + +//Cordinates for Spawns +Position const SpawnLocation[] = +{ + {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + + {-8085.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8085.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8085.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + + {-8085.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8080.0f, 1424.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8085.0f, 1422.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + // 2 waves of warriors + {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1525.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + + {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + + {-8082.0f, 1523.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1521.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1519.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + + {-8082.0f, 1524.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1522.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8078.0f, 1518.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + {-8082.0f, 1516.0f, 2.61f, 3.141592f}, //Kaldorei Infantry + + {-8088.0f, 1510.0f, 2.61f, 0.0f}, //Anubisath Conqueror + {-8084.0f, 1520.0f, 2.61f, 0.0f}, //Anubisath Conqueror + {-8088.0f, 1530.0f, 2.61f, 0.0f}, //Anubisath Conqueror + + {-8080.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8082.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8085.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8082.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8085.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8080.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Wasp + + {-8082.0f, 1513.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8079.0f, 1523.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8080.0f, 1531.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8079.0f, 1516.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Wasp + {-8080.0f, 1518.0f, 2.61f, 0.0f}, //Qiraj Wasp + + {-8081.0f, 1514.0f, 2.61f, 0.0f}, //Qiraj Tank + {-8081.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank + {-8081.0f, 1526.0f, 2.61f, 0.0f}, //Qiraj Tank + {-8081.0f, 1512.0f, 2.61f, 0.0f}, //Qiraj Tank + {-8082.0f, 1520.0f, 2.61f, 0.0f}, //Qiraj Tank + {-8081.0f, 1528.0f, 2.61f, 0.0f}, //Qiraj Tank + + {-8082.0f, 1513.0f, 2.61f, 3.141592f}, //Anubisath Conqueror + {-8082.0f, 1520.0f, 2.61f, 3.141592f}, //Anubisath Conqueror + {-8082.0f, 1527.0f, 2.61f, 3.141592f}, //Anubisath Conqueror +}; + +struct WaveData +{ + uint8 SpawnCount, UsedSpawnPoint; + uint32 CreatureId, SpawnTimer, YellTimer, DespTimer; + int32 WaveTextId; +}; + +static WaveData WavesInfo[5] = +{ + {30, 0, 15423, 0, 0, 24000, 0}, // Kaldorei Soldier + { 3, 35, 15424, 0, 0, 24000, 0}, // Anubisath Conqueror + {12, 38, 15414, 0, 0, 24000, 0}, // Qiraji Wasps + { 6, 50, 15422, 0, 0, 24000, 0}, // Qiraji Tanks + {15, 15, 15423, 0, 0, 24000, 0} // Kaldorei Soldier + +}; + +struct SpawnSpells +{ + uint32 Timer1, Timer2, SpellId; +}; + +static SpawnSpells SpawnCast[4] = +{ + {100000, 2000, 33652}, // Stop Time + {38500, 300000, 28528}, // Poison Cloud + {58000, 300000, 35871}, // Frost Debuff (need correct spell) + {80950, 300000, 42075}, // Fire Explosion (need correct spell however this one looks cool) +}; +/*##### +# npc_anachronos_the_ancient +######*/ +class npc_anachronos_the_ancient : public CreatureScript +{ +public: + npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_anachronos_the_ancientAI(creature); + } + + struct npc_anachronos_the_ancientAI : public ScriptedAI + { + npc_anachronos_the_ancientAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 AnimationTimer; + uint8 AnimationCount; + + uint64 AnachronosQuestTriggerGUID; + uint64 MerithraGUID; + uint64 ArygosGUID; + uint64 CaelestraszGUID; + uint64 FandralGUID; + uint64 PlayerGUID; + bool eventEnd; + + void Reset() + { + AnimationTimer = 1500; + AnimationCount = 0; + AnachronosQuestTriggerGUID = 0; + MerithraGUID = 0; + ArygosGUID = 0; + CaelestraszGUID = 0; + FandralGUID = 0; + PlayerGUID = 0; + eventEnd = false; + + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void HandleAnimation() + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (!player) + return; + + Creature* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f, me); + Creature* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f, me); + Creature* Caelestrasz = player->FindNearestCreature(C_CAELESTRASZ, 100.0f, me); + Creature* Merithra = player->FindNearestCreature(C_MERITHRA, 100.0f, me); + + if (!Fandral || !Arygos || !Caelestrasz || !Merithra) + return; + + AnimationTimer = EventAnim[AnimationCount].Timer; + if (eventEnd == false) + { + switch (AnimationCount) + { + case 0: + Talk(ANACHRONOS_SAY_1,Fandral->GetGUID()); + break; + case 1: + Fandral->SetTarget(me->GetGUID()); + Fandral->AI()->Talk(FANDRAL_SAY_1, me->GetGUID()); + break; + case 2: + Fandral->SetTarget(0); + Merithra->AI()->Talk(MERITHRA_EMOTE_1); + break; + case 3: + Merithra->AI()->Talk(MERITHRA_SAY_1); + break; + case 4: + Arygos->AI()->Talk(ARYGOS_EMOTE_1); + break; + case 5: + Caelestrasz->SetTarget(Fandral->GetGUID()); + Caelestrasz->AI()->Talk(CAELESTRASZ_SAY_1); + break; + case 6: + Merithra->AI()->Talk(MERITHRA_SAY_2); + break; + case 7: + Caelestrasz->SetTarget(0); + Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); + break; + case 8: + Merithra->AI()->Talk(MERITHRA_YELL_1); + break; + case 9: + Merithra->CastSpell(Merithra, 25105, true); + break; + case 10: + Merithra->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Merithra->SetDisableGravity(true); + Merithra->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 3); + break; + case 11: + Merithra->CastSpell(Merithra, 24818, false); + break; + case 12: + Merithra->GetMotionMaster()->MoveCharge(-8100, 1530, 50, 42); + break; + case 13: + break; + case 14: + Arygos->AI()->Talk(ARYGOS_SAY_1); + Merithra->SetVisible(false); + break; + case 15: + Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); + Merithra->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); + break; + case 16: + Arygos->AI()->Talk(ARYGOS_YELL_1); + break; + case 17: + Arygos->CastSpell(Arygos, 25107, true); + break; + case 18: + Arygos->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + Arygos->SetDisableGravity(true); + Arygos->GetMotionMaster()->MoveCharge(-8065, 1530, 6.61f, 42); + break; + case 19: + Arygos->CastSpell(Arygos, 50505, false); + break; + case 20: + Arygos->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); + break; + case 21: + break; + case 22: + Caelestrasz->AI()->Talk(CAELESTRASZ_SAY_2, Fandral->GetGUID()); + break; + case 23: + Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 2.61f, 10); + Arygos->SetVisible(false); + Arygos->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 10); + break; + case 24: + Caelestrasz->AI()->Talk(CAELESTRASZ_YELL_1); + break; + case 25: + Caelestrasz->CastSpell(Caelestrasz, 25106, true); + break; + case 26: + Caelestrasz->HandleEmoteCommand(254); + Caelestrasz->SetDisableGravity(true); + Caelestrasz->GetMotionMaster()->MoveCharge(-8065, 1530, 7.61f, 4); + break; + case 27: + Caelestrasz->CastSpell(Caelestrasz, 54293, false); + break; + case 28: + Talk(ANACHRONOS_SAY_2, Fandral->GetGUID()); + break; + case 29: + Caelestrasz->GetMotionMaster()->MoveCharge(-8095, 1530, 50, 42); + Fandral->AI()->Talk(FANDRAL_SAY_2); + break; + case 30: + break; + case 31: + Talk(ANACHRONOS_SAY_3, Fandral->GetGUID()); + break; + case 32: + Caelestrasz->SetVisible(false); + Caelestrasz->GetMotionMaster()->MoveCharge(-8034.535f, 1535.14f, 2.61f, 42); + Fandral->GetMotionMaster()->MoveCharge(-8108, 1529, 2.77f, 8); + me->GetMotionMaster()->MoveCharge(-8113, 1525, 2.77f, 8); + break;//both run to the gate + case 33: + Talk(ANACHRONOS_SAY_4); + Caelestrasz->GetMotionMaster()->MoveCharge(-8050, 1473, 65, 15); + break; //Text: sands will stop + case 34: + DoCast(player, 23017, true);//Arcane Channeling + break; + case 35: + me->CastSpell(-8088, 1520.43f, 2.67f, 25158, true); + break; + case 36: + DoCast(player, 25159, true); + break; + case 37: + me->SummonGameObject(GO_GATE_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); + break; + case 38: + DoCast(player, 25166, true); + me->SummonGameObject(GO_GLYPH_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); + break; + case 39: + Talk(ANACHRONOS_SAY_5, Fandral->GetGUID()); + break; + case 40: + Fandral->CastSpell(me, 25167, true); + break; + case 41: + Fandral->SummonGameObject(GO_ROOTS_OF_AHN_QIRAJ, -8130, 1525, 17.5f, 0, 0, 0, 0, 0, 0); + Fandral->AI()->Talk(FANDRAL_SAY_3); + break; + case 42: + me->CastStop(); + Fandral->AI()->Talk(FANDRAL_EMOTE_1); + break; + case 43: + Fandral->CastStop(); + break; + case 44: + Talk(ANACHRONOS_SAY_6); + break; + case 45: + Talk(ANACHRONOS_SAY_7); + break; + case 46: + Talk(ANACHRONOS_SAY_8); + me->GetMotionMaster()->MoveCharge(-8110, 1527, 2.77f, 4); + break; + case 47: + Talk(ANACHRONOS_EMOTE_1); + break; + case 48: + Fandral->AI()->Talk(FANDRAL_SAY_4, me->GetGUID()); + break; + case 49: + Fandral->AI()->Talk(FANDRAL_SAY_5, me->GetGUID()); + break; + case 50: + Fandral->AI()->Talk(FANDRAL_EMOTE_2); + Fandral->CastSpell(-8127, 1525, 17.5f, 33806, true); + break; + case 51: + { + uint32 entries[4] = { 15423, 15424, 15414, 15422 }; + Unit* mob = NULL; + for (uint8 i = 0; i < 4; ++i) + { + mob = player->FindNearestCreature(entries[i], 50, me); + while (mob) + { + mob->RemoveFromWorld(); + mob = player->FindNearestCreature(15423, 50, me); + } + } + break; + } + case 52: + Fandral->GetMotionMaster()->MoveCharge(-8028.75f, 1538.795f, 2.61f, 4); + Fandral->AI()->Talk(ANACHRONOS_SAY_9, me->GetGUID()); + break; + case 53: + Fandral->AI()->Talk(FANDRAL_SAY_6); + break; + case 54: + Talk(ANACHRONOS_EMOTE_2); + break; + case 55: + Fandral->SetVisible(false); + break; + case 56: + Talk(ANACHRONOS_EMOTE_3); + me->GetMotionMaster()->MoveCharge(-8116, 1522, 3.65f, 4); + break; + case 57: + me->GetMotionMaster()->MoveCharge(-8116.7f, 1527, 3.7f, 4); + break; + case 58: + me->GetMotionMaster()->MoveCharge(-8112.67f, 1529.9f, 2.86f, 4); + break; + case 59: + me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4); + break; + case 60: + if (player) + Talk(ANACHRONOS_SAY_10, player->GetGUID()); + me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4); + break; + case 61: + me->GetMotionMaster()->MoveCharge(-8057.1f, 1470.32f, 2.61f, 6); + if (player->IsInRange(me, 0, 15)) + player->GroupEventHappens(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD, me); + break; + case 62: + me->SetDisplayId(15500); + break; + case 63: + me->HandleEmoteCommand(254); + me->SetDisableGravity(true); + break; + case 64: + me->GetMotionMaster()->MoveCharge(-8000, 1400, 150, 9); + break; + case 65: + me->SetVisible(false); + if (Creature* AnachronosQuestTrigger = (Unit::GetCreature(*me, AnachronosQuestTriggerGUID))) + { + Talk(ARYGOS_YELL_1); + AnachronosQuestTrigger->AI()->EnterEvadeMode(); + eventEnd=true; + } + break; + } + } + ++AnimationCount; + } + void UpdateAI(const uint32 diff) + { + if (AnimationTimer) + { + if (AnimationTimer <= diff) + HandleAnimation(); + else AnimationTimer -= diff; + } + if (AnimationCount < 65) + me->CombatStop(); + if (AnimationCount == 65 || eventEnd) + me->AI()->EnterEvadeMode(); + } + }; + +}; + +/*###### +# mob_qiraj_war_spawn +######*/ + +class mob_qiraj_war_spawn : public CreatureScript +{ +public: + mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_qiraj_war_spawnAI(creature); + } + + struct mob_qiraj_war_spawnAI : public ScriptedAI + { + mob_qiraj_war_spawnAI(Creature* creature) : ScriptedAI(creature) {} + + uint64 MobGUID; + uint64 PlayerGUID; + uint32 SpellTimer1, SpellTimer2, SpellTimer3, SpellTimer4; + bool Timers; + bool hasTarget; + + void Reset() + { + MobGUID = 0; + PlayerGUID = 0; + Timers = false; + hasTarget = false; + } + + void EnterCombat(Unit* /*who*/) {} + void JustDied(Unit* /*slayer*/); + + void UpdateAI(const uint32 diff) + { + if (!Timers) + { + 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 (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) + SpellTimer4 = SpawnCast[0].Timer1; + Timers = true; + } + if (me->GetEntry() == 15424 || me->GetEntry() == 15422|| me->GetEntry() == 15414) + { + if (SpellTimer1 <= diff) + { + DoCast(me, SpawnCast[1].SpellId); + DoCast(me, 24319); + SpellTimer1 = SpawnCast[1].Timer2; + } else SpellTimer1 -= diff; + if (SpellTimer2 <= diff) + { + DoCast(me, SpawnCast[2].SpellId); + SpellTimer2 = SpawnCast[2].Timer2; + } else SpellTimer2 -= diff; + if (SpellTimer3 <= diff) + { + DoCast(me, SpawnCast[3].SpellId); + SpellTimer3 = SpawnCast[3].Timer2; + } else SpellTimer3 -= diff; + } + if (me->GetEntry() == 15423 || me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) + { + if (SpellTimer4 <= diff) + { + me->RemoveAllAttackers(); + me->AttackStop(); + DoCast(me, 15533); + SpellTimer4 = SpawnCast[0].Timer2; + } else SpellTimer4 -= diff; + } + if (!hasTarget) + { + Unit* target = NULL; + if (me->GetEntry() == 15424 || me->GetEntry() == 15422 || me->GetEntry() == 15414) + target = me->FindNearestCreature(15423, 20, true); + if (me->GetEntry() == 15423) + { + uint8 tar = urand(0, 2); + + if (tar == 0) + target = me->FindNearestCreature(15422, 20, true); + else if (tar == 1) + target = me->FindNearestCreature(15424, 20, true); + else if (tar == 2) + target = me->FindNearestCreature(15414, 20, true); + } + hasTarget = true; + if (target) + me->AI()->AttackStart(target); + } + if (!(me->FindNearestCreature(15379, 60))) + DoCast(me, 33652); + + if (!UpdateVictim()) + { + hasTarget = false; + return; + } + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*##### +# npc_anachronos_quest_trigger +#####*/ + +class npc_anachronos_quest_trigger : public CreatureScript +{ +public: + npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_anachronos_quest_triggerAI(creature); + } + + struct npc_anachronos_quest_triggerAI : public ScriptedAI + { + npc_anachronos_quest_triggerAI(Creature* creature) : ScriptedAI(creature) {} + + uint64 PlayerGUID; + + uint32 WaveTimer; + uint32 AnnounceTimer; + + int8 LiveCount; + uint8 WaveCount; + + bool EventStarted; + bool Announced; + bool Failed; + + void Reset() + { + PlayerGUID = 0; + + WaveTimer = 2000; + AnnounceTimer = 1000; + LiveCount = 0; + WaveCount = 0; + + EventStarted = false; + Announced = false; + Failed = false; + + me->SetVisible(false); + } + + void SummonNextWave() + { + uint8 locIndex = WavesInfo[WaveCount].UsedSpawnPoint; + uint8 count = locIndex + WavesInfo[WaveCount].SpawnCount; + + for (uint8 i = locIndex; i <= count; ++i) + { + uint32 desptimer = WavesInfo[WaveCount].DespTimer; + + if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer)) + { + if (spawn->GetEntry() == 15423) + spawn->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15427+rand()%4); + if (i >= 30) WaveCount = 1; + if (i >= 33) WaveCount = 2; + if (i >= 45) WaveCount = 3; + if (i >= 51) WaveCount = 4; + + if (WaveCount < 5) //1-4 Wave + { + if (mob_qiraj_war_spawn::mob_qiraj_war_spawnAI* spawnAI = CAST_AI(mob_qiraj_war_spawn::mob_qiraj_war_spawnAI, spawn->AI())) + { + spawnAI->MobGUID = me->GetGUID(); + spawnAI->PlayerGUID = PlayerGUID; + } + } + } + } + + WaveTimer = WavesInfo[WaveCount].SpawnTimer; + AnnounceTimer = WavesInfo[WaveCount].YellTimer; + } + + void CheckEventFail() + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + + if (!player) + return; + + if (Group* EventGroup = player->GetGroup()) + { + Player* groupMember; + + uint8 GroupMemberCount = 0; + uint8 DeadMemberCount = 0; + uint8 FailedMemberCount = 0; + + Group::MemberSlotList const members = EventGroup->GetMemberSlots(); + + for (Group::member_citerator itr = members.begin(); itr!= members.end(); ++itr) + { + groupMember = (Unit::GetPlayer(*me, itr->guid)); + if (!groupMember) + continue; + 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); + ++FailedMemberCount; + } + ++GroupMemberCount; + + if (groupMember->isDead()) + ++DeadMemberCount; + } + + if (GroupMemberCount == FailedMemberCount || !player->IsWithinDistInMap(me, EVENT_AREA_RADIUS)) + Failed = true; //only so event can restart + } + } + + void LiveCounter() + { + --LiveCount; + if (!LiveCount) + Announced = false; + } + + void UpdateAI(const uint32 diff) + { + if (!PlayerGUID || !EventStarted) + return; + + if (WaveCount < 4) + { + if (!Announced && AnnounceTimer <= diff) + { + Talk(WavesInfo[WaveCount].WaveTextId); + Announced = true; + } else AnnounceTimer -= diff; + + if (WaveTimer <= diff) + SummonNextWave(); + else WaveTimer -= diff; + } + CheckEventFail(); + if (WaveCount == 4 || Failed) + EnterEvadeMode(); + }; + }; + +}; + +void mob_qiraj_war_spawn::mob_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) +{ + me->RemoveCorpse(); + + if (!MobGUID) + return; + + if (Creature* mob = Unit::GetCreature(*me, MobGUID)) + if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) + triggerAI->LiveCounter(); + +}; + +/*##### +# go_crystalline_tear +######*/ + +class go_crystalline_tear : public GameObjectScript +{ +public: + go_crystalline_tear() : GameObjectScript("go_crystalline_tear") { } + + bool OnQuestAccept(Player* player, GameObject* go, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) + { + if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) + { + Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Unit* Arygos = trigger->SummonCreature(15380, -8034.52f, 1537.843f, 2.61f, 5.7f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + /* Unit* Fandral = */ trigger->SummonCreature(15382, -8028.462f, 1535.843f, 2.61f, 3.141592f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + Creature* Anachronos = trigger->SummonCreature(15381, -8028.75f, 1538.795f, 2.61f, 4, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); + + if (Merithra) + { + Merithra->SetUInt32Value(UNIT_NPC_FLAGS, 0); + Merithra->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + Merithra->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15420); + Merithra->setFaction(35); + } + + if (Caelestrasz) + { + Caelestrasz->SetUInt32Value(UNIT_NPC_FLAGS, 0); + Caelestrasz->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + Caelestrasz->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15419); + Caelestrasz->setFaction(35); + } + + if (Arygos) + { + Arygos->SetUInt32Value(UNIT_NPC_FLAGS, 0); + Arygos->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + Arygos->SetUInt32Value(UNIT_FIELD_DISPLAYID, 15418); + Arygos->setFaction(35); + } + + if (Anachronos) + { + if (npc_anachronos_the_ancient::npc_anachronos_the_ancientAI* anachronosAI = CAST_AI(npc_anachronos_the_ancient::npc_anachronos_the_ancientAI, Anachronos->AI())) + anachronosAI->PlayerGUID = player->GetGUID(); + + if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, trigger->AI())) + { + triggerAI->Failed = false; + triggerAI->PlayerGUID = player->GetGUID(); + triggerAI->EventStarted = true; + triggerAI->Announced = true; + } + } + } + } + return true; + } + +}; + +/*### +## go_wind_stone +###*/ + +enum WSSpells +{ + SPELL_PUNISHMENT = 24803, + SPELL_SPAWN_IN = 25035, + + AURA_TWILIGHT_SET = 24746, + AURA_MEDALLION = 24748, + AURA_RING = 24782, + + SPELL_TEMPLAR_RANDOM = 24745, + SPELL_TEMPLAR_FIRE = 24747, + SPELL_TEMPLAR_AIR = 24757, + SPELL_TEMPLAR_EARTH = 24759, + SPELL_TEMPLAR_WATER = 24761, + + SPELL_DUKE_RANDOM = 24762, + SPELL_DUKE_FIRE = 24766, + SPELL_DUKE_AIR = 24769, + SPELL_DUKE_EARTH = 24771, + SPELL_DUKE_WATER = 24773, + + SPELL_ROYAL_RANDOM = 24785, + SPELL_ROYAL_FIRE = 24787, + SPELL_ROYAL_AIR = 24791, + SPELL_ROYAL_EARTH = 24792, + SPELL_ROYAL_WATER = 24793 +}; + +enum WSGossip +{ + GOSSIPID_LESSER_WS = 6540, + GOSSIPID_WS = 6542, + GOSSIPID_GREATER_WS = 6543 +}; + +enum WSCreatures +{ + NPC_TEMPLAR_FIRE = 15209, + NPC_TEMPLAR_WATER = 15211, + NPC_TEMPLAR_AIR = 15212, + NPC_TEMPLAR_EARTH = 15307, + + NPC_DUKE_FIRE = 15206, + NPC_DUKE_WATER = 15207, + NPC_DUKE_EARTH = 15208, + NPC_DUKE_AIR = 15220, + + NPC_ROYAL_FIRE = 15203, + NPC_ROYAL_AIR = 15204, + NPC_ROYAL_EARTH = 15205, + NPC_ROYAL_WATER = 15305 +}; + +enum WSItems +{ + ITEM_TEMPLAR_FIRE = 20416, + ITEM_TEMPLAR_EARTH = 20419, + ITEM_TEMPLAR_WATER = 20420, + ITEM_TEMPLAR_AIR = 20418, + + ITEM_DUKE_FIRE = 20432, + ITEM_DUKE_EARTH = 20435, + ITEM_DUKE_WATER = 20436, + ITEM_DUKE_AIR = 20433, + + ITEM_ROYAL_FIRE = 20447, + ITEM_ROYAL_EARTH = 20449, + ITEM_ROYAL_WATER = 20450, + ITEM_ROYAL_AIR = 20448, +}; + +enum WS +{ + TEMPLAR = 0, + DUKE = 1, + ROYAL = 2, + + FIRE = 0x1, + WATER = 0x2, + EARTH = 0x4, + AIR = 0x8 +}; + +enum WSTexts +{ + SAY_TEMPLAR_AGGRO = 0, + SAY_DUKE_AGGRO = 0, + YELL_ROYAL_AGGRO = 0 +}; + +#define GOSSIP_TEMPLAR_RANDOM "I am no cultist, you monster! Come to me and face your destruction!" +#define GOSSIP_TEMPLAR_FIRE "Crimson Templar! I hold your signet! Heed my call!" +#define GOSSIP_TEMPLAR_EARTH "Earthen Templar! I hold your signet! Heed my call!" +#define GOSSIP_TEMPLAR_AIR "Hoary Templar! I hold your signet! Heed my call!" +#define GOSSIP_TEMPLAR_WATER "Azure Templar! I hold your signet! Heed my call!" + +#define GOSSIP_DUKE_RANDOM "You will listen to this, vile duke! I am not your Twilight's Hammer lapdog! I am here to challenge you! Come! Come, and meet your death..." +#define GOSSIP_DUKE_FIRE "Duke of Cynders! I hold your signet! Heed my call!" +#define GOSSIP_DUKE_EARTH "The Duke of Shards! I hold your signet! Heed my call!" +#define GOSSIP_DUKE_AIR "The Duke of Zephyrs! I hold your signet! Heed my call!" +#define GOSSIP_DUKE_WATER "The Duke of Fathoms! I hold your signet! Heed my call!" + +#define GOSSIP_ROYAL_RANDOM "The day of the judgement has come, fiend! I challenge you to battle!" +#define GOSSIP_ROYAL_FIRE "Prince Skaldrenox! I hold your signet! Heed my call!" +#define GOSSIP_ROYAL_EARTH "Baron Kazum! I hold your signet! Heed my call!" +#define GOSSIP_ROYAL_AIR "High Marshal Whirlaxis! I hold your signet! Heed my call!" +#define GOSSIP_ROYAL_WATER "Lord Skwol! I hold your signet! Heed my call!" + +class go_wind_stone : public GameObjectScript +{ + public: + go_wind_stone() : GameObjectScript("go_wind_stone") { } + + private: + uint8 GetPlayerRank(Player* player) // For random summoning + { + bool setAura = player->HasAura(AURA_TWILIGHT_SET); + bool medallionAura = player->HasAura(AURA_MEDALLION); + bool ringAura = player->HasAura(AURA_RING); + + if (setAura && medallionAura && ringAura) + return 3; + else if (setAura && medallionAura) + return 2; + else if (setAura) + return 1; + else + return 0; + } + + uint8 GetItems(Player* player, WS type) + { + uint8 result = 0x0; + + switch (type) + { + case TEMPLAR: + { + if (player->HasItemCount(ITEM_TEMPLAR_FIRE)) + result |= FIRE; + if (player->HasItemCount(ITEM_TEMPLAR_WATER)) + result |= WATER; + if (player->HasItemCount(ITEM_TEMPLAR_EARTH)) + result |= EARTH; + if (player->HasItemCount(ITEM_TEMPLAR_AIR)) + result |= AIR; + break; + } + case DUKE: + { + if (player->HasItemCount(ITEM_DUKE_FIRE)) + result |= FIRE; + if (player->HasItemCount(ITEM_DUKE_WATER)) + result |= WATER; + if (player->HasItemCount(ITEM_DUKE_EARTH)) + result |= EARTH; + if (player->HasItemCount(ITEM_DUKE_AIR)) + result |= AIR; + break; + } + case ROYAL: + { + if (player->HasItemCount(ITEM_ROYAL_FIRE)) + result |= FIRE; + if (player->HasItemCount(ITEM_ROYAL_WATER)) + result |= WATER; + if (player->HasItemCount(ITEM_ROYAL_EARTH)) + result |= EARTH; + if (player->HasItemCount(ITEM_ROYAL_AIR)) + result |= AIR; + break; + } + default: + break; + } + return result; + } + + void SummonNPC(GameObject* go, Player* player, uint32 npc, uint32 spell) + { + go->CastSpell(player, spell); + TempSummon* summons = go->SummonCreature(npc, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), player->GetOrientation() - M_PI, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10 * 60 * 1000); + summons->CastSpell(summons, SPELL_SPAWN_IN, false); + switch (summons->GetEntry()) + { + case NPC_TEMPLAR_FIRE: + case NPC_TEMPLAR_WATER: + case NPC_TEMPLAR_AIR: + case NPC_TEMPLAR_EARTH: + summons->AI()->Talk(SAY_TEMPLAR_AGGRO); + break; + + case NPC_DUKE_FIRE: + case NPC_DUKE_WATER: + case NPC_DUKE_EARTH: + case NPC_DUKE_AIR: + summons->AI()->Talk(SAY_DUKE_AGGRO); + break; + case NPC_ROYAL_FIRE: + case NPC_ROYAL_AIR: + case NPC_ROYAL_EARTH: + case NPC_ROYAL_WATER: + summons->AI()->Talk(YELL_ROYAL_AGGRO); + break; + } + summons->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summons->SendMeleeAttackStart(player); + summons->CombatStart(player); + } + + public: + bool OnGossipHello(Player* player, GameObject* go) + { + uint8 rank = GetPlayerRank(player); + + uint32 gossipId = go->GetGOInfo()->GetGossipMenuId(); + switch (gossipId) + { + case GOSSIPID_LESSER_WS: + { + if (rank >= 1) // 1 or 2 or 3 + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else + { + go->CastSpell(player, SPELL_PUNISHMENT); + break; + } + + uint8 item = GetItems(player, TEMPLAR); + if (item & FIRE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + if (item & WATER) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + if (item & EARTH) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + if (item & AIR) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TEMPLAR_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + break; + } + case GOSSIPID_WS: + { + if (rank >= 2) // 2 or 3 + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + else + { + go->CastSpell(player, SPELL_PUNISHMENT); + break; + } + + uint8 item = GetItems(player, DUKE); + if (item & FIRE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + if (item & WATER) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + if (item & EARTH) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + if (item & AIR) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DUKE_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + break; + } + case GOSSIPID_GREATER_WS: + { + if (rank == 3) // 3 + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_RANDOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + else + { + go->CastSpell(player, SPELL_PUNISHMENT); + break; + } + + uint8 item = GetItems(player, ROYAL); + if (item & FIRE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_FIRE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + if (item & WATER) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_WATER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + if (item & EARTH) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_EARTH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + if (item & AIR) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ROYAL_AIR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); + break; + } + default: + break; + } + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(gossipId, go), go->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, GameObject* go, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + player->PlayerTalkClass->SendCloseGossip(); + + switch (action) + { + case GOSSIP_ACTION_INFO_DEF + 1: + SummonNPC(go, player, RAND(NPC_TEMPLAR_WATER, NPC_TEMPLAR_FIRE, NPC_TEMPLAR_EARTH, NPC_TEMPLAR_AIR), SPELL_TEMPLAR_RANDOM); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + SummonNPC(go, player, NPC_TEMPLAR_FIRE, SPELL_TEMPLAR_FIRE); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + SummonNPC(go, player, NPC_TEMPLAR_WATER, SPELL_TEMPLAR_WATER); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + SummonNPC(go, player, NPC_TEMPLAR_EARTH, SPELL_TEMPLAR_EARTH); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + SummonNPC(go, player, NPC_TEMPLAR_AIR, SPELL_TEMPLAR_AIR); + break; + + case GOSSIP_ACTION_INFO_DEF + 6: + SummonNPC(go, player, RAND(NPC_DUKE_FIRE, NPC_DUKE_WATER, NPC_DUKE_EARTH, NPC_DUKE_AIR), SPELL_DUKE_RANDOM); + break; + case GOSSIP_ACTION_INFO_DEF + 7: + SummonNPC(go, player, NPC_DUKE_FIRE, SPELL_DUKE_FIRE); + break; + case GOSSIP_ACTION_INFO_DEF + 8: + SummonNPC(go, player, NPC_DUKE_WATER, SPELL_DUKE_WATER); + break; + case GOSSIP_ACTION_INFO_DEF + 9: + SummonNPC(go, player, NPC_DUKE_EARTH, SPELL_DUKE_EARTH); + break; + case GOSSIP_ACTION_INFO_DEF + 10: + SummonNPC(go, player, NPC_DUKE_AIR, SPELL_DUKE_AIR); + break; + + case GOSSIP_ACTION_INFO_DEF + 11: + SummonNPC(go, player, RAND(NPC_ROYAL_FIRE, NPC_ROYAL_AIR, NPC_ROYAL_EARTH, NPC_ROYAL_WATER), SPELL_ROYAL_RANDOM); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + SummonNPC(go, player, NPC_ROYAL_FIRE, SPELL_ROYAL_FIRE); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + SummonNPC(go, player, NPC_ROYAL_WATER, SPELL_ROYAL_WATER); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + SummonNPC(go, player, NPC_ROYAL_EARTH, SPELL_ROYAL_EARTH); + break; + case GOSSIP_ACTION_INFO_DEF + 15: + SummonNPC(go, player, NPC_ROYAL_AIR, SPELL_ROYAL_AIR); + break; + + default: + break; + } + return true; + } +}; + +void AddSC_silithus() +{ + new go_crystalline_tear(); + new npc_anachronos_quest_trigger(); + new npc_anachronos_the_ancient(); + new mob_qiraj_war_spawn(); + new npc_highlord_demitrian(); + new npcs_rutgar_and_frankal(); + new go_wind_stone(); +} diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp new file mode 100644 index 00000000000..26c92c7404c --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -0,0 +1,179 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Stonetalon_Mountains +SD%Complete: 95 +SDComment: Quest support: 6627, 6523 +SDCategory: Stonetalon Mountains +EndScriptData */ + +/* ContentData +npc_braug_dimspirit +npc_kaya_flathoof +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_braug_dimspirit +######*/ + +#define GOSSIP_HBD1 "Ysera" +#define GOSSIP_HBD2 "Neltharion" +#define GOSSIP_HBD3 "Nozdormu" +#define GOSSIP_HBD4 "Alexstrasza" +#define GOSSIP_HBD5 "Malygos" + +class npc_braug_dimspirit : public CreatureScript +{ +public: + npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, 6766, false); + + } + if (action == GOSSIP_ACTION_INFO_DEF+2) + { + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(6627); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(5820, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(5819, creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_kaya_flathoof +######*/ + +enum Kaya +{ + FACTION_ESCORTEE_H = 775, + + NPC_GRIMTOTEM_RUFFIAN = 11910, + NPC_GRIMTOTEM_BRUTE = 11912, + NPC_GRIMTOTEM_SORCERER = 11913, + + SAY_START = 0, + SAY_AMBUSH = 1, + SAY_END = 2, + + QUEST_PROTECT_KAYA = 6523 +}; + +class npc_kaya_flathoof : public CreatureScript +{ +public: + npc_kaya_flathoof() : CreatureScript("npc_kaya_flathoof") { } + + struct npc_kaya_flathoofAI : public npc_escortAI + { + npc_kaya_flathoofAI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 16: + Talk(SAY_AMBUSH); + me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 18: + me->SetInFront(player); + Talk(SAY_END); + player->GroupEventHappens(QUEST_PROTECT_KAYA, me); + break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void Reset(){} + }; + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_PROTECT_KAYA) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_kaya_flathoof::npc_kaya_flathoofAI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + + creature->AI()->Talk(SAY_START); + creature->setFaction(113); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_kaya_flathoofAI(creature); + } + +}; + +/*###### +## AddSC +######*/ + +void AddSC_stonetalon_mountains() +{ + new npc_braug_dimspirit(); + new npc_kaya_flathoof(); +} diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp new file mode 100644 index 00000000000..0648e40416d --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -0,0 +1,685 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Tanaris +SD%Complete: 80 +SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor +SDCategory: Tanaris +EndScriptData */ + +/* ContentData +mob_aquementas +npc_custodian_of_time +npc_marin_noggenfogger +npc_steward_of_time +npc_stone_watcher_of_norgannon +npc_OOX17 +npc_tooga +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "ScriptedFollowerAI.h" +#include "Player.h" +#include "WorldSession.h" + +/*###### +## mob_aquementas +######*/ + +enum Aquementas +{ + AGGRO_YELL_AQUE = 0, + + SPELL_AQUA_JET = 13586, + SPELL_FROST_SHOCK = 15089 +}; + +class mob_aquementas : public CreatureScript +{ +public: + mob_aquementas() : CreatureScript("mob_aquementas") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_aquementasAI (creature); + } + + struct mob_aquementasAI : public ScriptedAI + { + mob_aquementasAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 SendItemTimer; + uint32 SwitchFactionTimer; + bool isFriendly; + + uint32 FrostShockTimer; + uint32 AquaJetTimer; + + void Reset() + { + SendItemTimer = 0; + SwitchFactionTimer = 10000; + me->setFaction(35); + isFriendly = true; + + AquaJetTimer = 5000; + FrostShockTimer = 1000; + } + + void SendItem(Unit* receiver) + { + if (CAST_PLR(receiver)->HasItemCount(11169, 1, false) && + CAST_PLR(receiver)->HasItemCount(11172, 11, false) && + CAST_PLR(receiver)->HasItemCount(11173, 1, false) && + !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) + { + ItemPosCountVec dest; + uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL); + if (msg == EQUIP_ERR_OK) + CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true); + } + } + + void EnterCombat(Unit* who) + { + Talk(AGGRO_YELL_AQUE, who->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (isFriendly) + { + if (SwitchFactionTimer <= diff) + { + me->setFaction(91); + isFriendly = false; + } else SwitchFactionTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (!isFriendly) + { + if (SendItemTimer <= diff) + { + if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) + SendItem(me->getVictim()); + SendItemTimer = 5000; + } else SendItemTimer -= diff; + } + + if (FrostShockTimer <= diff) + { + DoCast(me->getVictim(), SPELL_FROST_SHOCK); + FrostShockTimer = 15000; + } else FrostShockTimer -= diff; + + if (AquaJetTimer <= diff) + { + DoCast(me, SPELL_AQUA_JET); + AquaJetTimer = 15000; + } else AquaJetTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; + +}; + +/*###### +## npc_custodian_of_time +######*/ + +enum CustodianOfTime +{ + WHISPER_CUSTODIAN_1 = 0, + WHISPER_CUSTODIAN_2 = 1, + WHISPER_CUSTODIAN_3 = 2, + WHISPER_CUSTODIAN_4 = 3, + WHISPER_CUSTODIAN_5 = 4, + WHISPER_CUSTODIAN_6 = 5, + WHISPER_CUSTODIAN_7 = 6, + WHISPER_CUSTODIAN_8 = 7, + WHISPER_CUSTODIAN_9 = 8, + WHISPER_CUSTODIAN_10 = 9, + WHISPER_CUSTODIAN_11 = 10, + WHISPER_CUSTODIAN_12 = 11, + WHISPER_CUSTODIAN_13 = 12, + WHISPER_CUSTODIAN_14 = 13 +}; + +class npc_custodian_of_time : public CreatureScript +{ +public: + npc_custodian_of_time() : CreatureScript("npc_custodian_of_time") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_custodian_of_timeAI(creature); + } + + struct npc_custodian_of_timeAI : public npc_escortAI + { + npc_custodian_of_timeAI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 0: + Talk(WHISPER_CUSTODIAN_1, player->GetGUID()); + break; + case 1: + Talk(WHISPER_CUSTODIAN_2, player->GetGUID()); + break; + case 2: + Talk(WHISPER_CUSTODIAN_3, player->GetGUID()); + break; + case 3: + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); + break; + case 5: + Talk(WHISPER_CUSTODIAN_5, player->GetGUID()); + break; + case 6: + Talk(WHISPER_CUSTODIAN_6, player->GetGUID()); + break; + case 7: + Talk(WHISPER_CUSTODIAN_7, player->GetGUID()); + break; + case 8: + Talk(WHISPER_CUSTODIAN_8, player->GetGUID()); + break; + case 9: + Talk(WHISPER_CUSTODIAN_9, player->GetGUID()); + break; + case 10: + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); + break; + case 13: + Talk(WHISPER_CUSTODIAN_10, player->GetGUID()); + break; + case 14: + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); + break; + case 16: + Talk(WHISPER_CUSTODIAN_11, player->GetGUID()); + break; + case 17: + Talk(WHISPER_CUSTODIAN_12, player->GetGUID()); + break; + case 18: + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); + break; + case 22: + Talk(WHISPER_CUSTODIAN_13, player->GetGUID()); + break; + case 23: + Talk(WHISPER_CUSTODIAN_4, player->GetGUID()); + break; + case 24: + Talk(WHISPER_CUSTODIAN_14, player->GetGUID()); + DoCast(player, 34883); + // below here is temporary workaround, to be removed when spell works properly + player->AreaExploredOrEventHappens(10277); + break; + } + } + } + + void MoveInLineOfSight(Unit* who) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (who->HasAura(34877) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0f; + if (me->IsWithinDistInMap(who, Radius)) + { + Start(false, false, who->GetGUID()); + } + } + } + } + + void EnterCombat(Unit* /*who*/) {} + void Reset() {} + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } + }; + +}; + +/*###### +## npc_marin_noggenfogger +######*/ + +class npc_marin_noggenfogger : public CreatureScript +{ +public: + npc_marin_noggenfogger() : CreatureScript("npc_marin_noggenfogger") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_TRADE) + player->GetSession()->SendListInventory(creature->GetGUID()); + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (creature->isVendor() && player->GetQuestRewardStatus(2662)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_steward_of_time +######*/ + +#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair." + +class npc_steward_of_time : public CreatureScript +{ +public: + npc_steward_of_time() : CreatureScript("npc_steward_of_time") { } + + bool OnQuestAccept(Player* player, Creature* /*creature*/, Quest const* quest) + { + if (quest->GetQuestId() == 10279) //Quest: To The Master's Lair + player->CastSpell(player, 34891, true); //(Flight through Caverns) + + return false; + } + + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF + 1) + player->CastSpell(player, 34891, true); //(Flight through Caverns) + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || player->GetQuestRewardStatus(10279)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(9978, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(9977, creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_stone_watcher_of_norgannon +######*/ + +#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" +#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" +#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" +#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" +#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" +#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." + +class npc_stone_watcher_of_norgannon : public CreatureScript +{ +public: + npc_stone_watcher_of_norgannon() : CreatureScript("npc_stone_watcher_of_norgannon") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(1675, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(1676, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->SEND_GOSSIP_MENU(1677, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(1678, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(1679, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(2954); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(1674, creature->GetGUID()); + + return true; + } + +}; + +/*###### +## npc_OOX17 +######*/ + +enum Npc00X17 +{ + SAY_OOX_START = 0, + SAY_OOX_AGGRO = 1, + SAY_OOX_AMBUSH = 2, + SAY_OOX17_AMBUSH_REPLY = 0, + SAY_OOX_END = 3, + + Q_OOX17 = 648, + SPAWN_FIRST = 7803, + SPAWN_SECOND_1 = 5617, + SPAWN_SECOND_2 = 7805 +}; + +class npc_OOX17 : public CreatureScript +{ +public: + npc_OOX17() : CreatureScript("npc_OOX17") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == Q_OOX17) + { + creature->setFaction(113); + creature->SetFullHealth(); + creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + creature->AI()->Talk(SAY_OOX_START); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_OOX17::npc_OOX17AI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_OOX17AI(creature); + } + + struct npc_OOX17AI : public npc_escortAI + { + npc_OOX17AI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 23: + me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_FIRST, -8353.96f, -4442.79f, 10.10f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + Talk(SAY_OOX_AMBUSH); + break; + case 56: + me->SummonCreature(SPAWN_SECOND_1, -7510.07f, -4795.50f, 9.35f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_SECOND_2, -7515.07f, -4797.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + me->SummonCreature(SPAWN_SECOND_2, -7518.07f, -4792.50f, 9.35f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + Talk(SAY_OOX_AMBUSH); + if (Creature* scoff = me->FindNearestCreature(SPAWN_SECOND_2, 30)) + scoff->AI()->Talk(SAY_OOX17_AMBUSH_REPLY); + break; + case 86: + Talk(SAY_OOX_END); + player->GroupEventHappens(Q_OOX17, me); + break; + } + } + } + + void Reset(){} + + void EnterCombat(Unit* /*who*/) + { + Talk(SAY_OOX_AGGRO); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + }; +}; + +/*#### +# npc_tooga +####*/ + +enum Tooga +{ + SAY_TOOG_WORRIED = 0, + SAY_TOOG_POST_1 = 1, + SAY_TORT_POST_2 = 0, + SAY_TOOG_POST_3 = 2, + SAY_TORT_POST_4 = 1, + SAY_TOOG_POST_5 = 3, + SAY_TORT_POST_6 = 2, + + QUEST_TOOGA = 1560, + NPC_TORTA = 6015, + + POINT_ID_TO_WATER = 1, + FACTION_TOOG_ESCORTEE = 113 +}; + +Position const ToWaterLoc = {-7032.664551f, -4906.199219f, -1.606446f, 0.0f}; + +class npc_tooga : public CreatureScript +{ +public: + npc_tooga() : CreatureScript("npc_tooga") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_TOOGA) + { + if (npc_toogaAI* pToogaAI = CAST_AI(npc_tooga::npc_toogaAI, creature->AI())) + pToogaAI->StartFollow(player, FACTION_TOOG_ESCORTEE, quest); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_toogaAI(creature); + } + + struct npc_toogaAI : public FollowerAI + { + npc_toogaAI(Creature* creature) : FollowerAI(creature) { } + + uint32 CheckSpeechTimer; + uint32 PostEventTimer; + uint32 PhasePostEvent; + + uint64 TortaGUID; + + void Reset() + { + CheckSpeechTimer = 2500; + PostEventTimer = 1000; + PhasePostEvent = 0; + + TortaGUID = 0; + } + + void MoveInLineOfSight(Unit* who) + { + FollowerAI::MoveInLineOfSight(who); + + if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && who->GetEntry() == NPC_TORTA) + { + if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) + { + Player* player = GetLeaderForFollower(); + if (player && player->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_TOOGA, me); + + TortaGUID = who->GetGUID(); + SetFollowComplete(true); + } + } + } + + void MovementInform(uint32 MotionType, uint32 PointId) + { + FollowerAI::MovementInform(MotionType, PointId); + + if (MotionType != POINT_MOTION_TYPE) + return; + + if (PointId == POINT_ID_TO_WATER) + SetFollowComplete(); + } + + void UpdateFollowerAI(const uint32 Diff) + { + if (!UpdateVictim()) + { + //we are doing the post-event, or... + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + if (PostEventTimer <= Diff) + { + PostEventTimer = 5000; + + Creature* torta = Creature::GetCreature(*me, TortaGUID); + if (!torta || !torta->isAlive()) + { + //something happened, so just complete + SetFollowComplete(); + return; + } + + switch (PhasePostEvent) + { + case 1: + Talk(SAY_TOOG_POST_1); + break; + case 2: + torta->AI()->Talk(SAY_TORT_POST_2); + break; + case 3: + Talk(SAY_TOOG_POST_3); + break; + case 4: + torta->AI()->Talk(SAY_TORT_POST_4); + break; + case 5: + Talk(SAY_TOOG_POST_5); + break; + case 6: + torta->AI()->Talk(SAY_TORT_POST_6); + me->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, ToWaterLoc); + break; + } + + ++PhasePostEvent; + } + else + PostEventTimer -= Diff; + } + //...we are doing regular speech check + else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + { + if (CheckSpeechTimer <= Diff) + { + CheckSpeechTimer = 5000; + + if (urand(0, 9) > 8) + Talk(SAY_TOOG_WORRIED); + } + else + CheckSpeechTimer -= Diff; + } + + return; + } + + DoMeleeAttackIfReady(); + } + }; + +}; + +void AddSC_tanaris() +{ + new mob_aquementas(); + new npc_custodian_of_time(); + new npc_marin_noggenfogger(); + new npc_steward_of_time(); + new npc_stone_watcher_of_norgannon(); + new npc_OOX17(); + new npc_tooga(); +} diff --git a/src/server/scripts/Kalimdor/zone_teldrassil.cpp b/src/server/scripts/Kalimdor/zone_teldrassil.cpp new file mode 100644 index 00000000000..d7983c2cbe6 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_teldrassil.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Teldrassil +SD%Complete: 100 +SDComment: Quest support: 938 +SDCategory: Teldrassil +EndScriptData */ + +/* ContentData +npc_mist +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedFollowerAI.h" +#include "Player.h" + +/*#### +# npc_mist +####*/ + +enum Mist +{ + SAY_AT_HOME = 0, + EMOTE_AT_HOME = 1, + QUEST_MIST = 938, + NPC_ARYNIA = 3519, + FACTION_DARNASSUS = 79 +}; + +class npc_mist : public CreatureScript +{ +public: + npc_mist() : CreatureScript("npc_mist") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_MIST) + if (npc_mistAI* pMistAI = CAST_AI(npc_mist::npc_mistAI, creature->AI())) + pMistAI->StartFollow(player, FACTION_DARNASSUS, quest); + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_mistAI(creature); + } + + struct npc_mistAI : public FollowerAI + { + npc_mistAI(Creature* creature) : FollowerAI(creature) { } + + void Reset() { } + + void MoveInLineOfSight(Unit* who) + { + FollowerAI::MoveInLineOfSight(who); + + if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_ARYNIA) + { + if (me->IsWithinDistInMap(who, 10.0f)) + { + Talk(SAY_AT_HOME, who->GetGUID()); + DoComplete(); + } + } + } + + void DoComplete() + { + Talk(EMOTE_AT_HOME); + + Player* player = GetLeaderForFollower(); + if (player && player->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_MIST, me); + + //The follow is over (and for later development, run off to the woods before really end) + SetFollowComplete(); + } + + //call not needed here, no known abilities + /*void UpdateFollowerAI(const uint32 Diff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + }*/ + }; + +}; + +void AddSC_teldrassil() +{ + new npc_mist(); +} diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp new file mode 100644 index 00000000000..8f7ab09260b --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -0,0 +1,695 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: The_Barrens +SD%Complete: 90 +SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981, +SDCategory: Barrens +EndScriptData */ + +/* ContentData +npc_beaten_corpse +npc_gilthares +npc_sputtervalve +npc_taskmaster_fizzule +npc_twiggy_flathead +npc_wizzlecrank_shredder +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" +#include "SpellInfo.h" + +/*###### +## npc_beaten_corpse +######*/ + +#define GOSSIP_CORPSE "Examine corpse in detail..." + +enum BeatenCorpse +{ + QUEST_LOST_IN_BATTLE = 4921 +}; + +class npc_beaten_corpse : public CreatureScript +{ +public: + npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF +1) + { + player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); + player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(3557, creature->GetGUID()); + return true; + } + +}; + +/*###### +# npc_gilthares +######*/ + +enum Gilthares +{ + SAY_GIL_START = 0, + SAY_GIL_AT_LAST = 1, + SAY_GIL_PROCEED = 2, + SAY_GIL_FREEBOOTERS = 3, + SAY_GIL_AGGRO = 4, + SAY_GIL_ALMOST = 5, + SAY_GIL_SWEET = 6, + SAY_GIL_FREED = 7, + + QUEST_FREE_FROM_HOLD = 898, + AREA_MERCHANT_COAST = 391, + FACTION_ESCORTEE = 232 //guessed, possible not needed for this quest +}; + +class npc_gilthares : public CreatureScript +{ +public: + npc_gilthares() : CreatureScript("npc_gilthares") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_FREE_FROM_HOLD) + { + creature->setFaction(FACTION_ESCORTEE); + creature->SetStandState(UNIT_STAND_STATE_STAND); + + creature->AI()->Talk(SAY_GIL_START, player->GetGUID()); + + if (npc_giltharesAI* pEscortAI = CAST_AI(npc_gilthares::npc_giltharesAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_giltharesAI(creature); + } + + struct npc_giltharesAI : public npc_escortAI + { + npc_giltharesAI(Creature* creature) : npc_escortAI(creature) { } + + void Reset() { } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 16: + Talk(SAY_GIL_AT_LAST, player->GetGUID()); + break; + case 17: + Talk(SAY_GIL_PROCEED, player->GetGUID()); + break; + case 18: + Talk(SAY_GIL_FREEBOOTERS, player->GetGUID()); + break; + case 37: + Talk(SAY_GIL_ALMOST,player->GetGUID()); + break; + case 47: + Talk(SAY_GIL_SWEET, player->GetGUID()); + break; + case 53: + Talk(SAY_GIL_FREED, player->GetGUID()); + player->GroupEventHappens(QUEST_FREE_FROM_HOLD, me); + break; + } + } + + void EnterCombat(Unit* who) + { + //not always use + if (rand()%4) + return; + + //only aggro text if not player and only in this area + if (who->GetTypeId() != TYPEID_PLAYER && me->GetAreaId() == AREA_MERCHANT_COAST) + { + //appears to be pretty much random (possible only if escorter not in combat with who yet?) + Talk(SAY_GIL_AGGRO, who->GetGUID()); + } + } + }; + +}; + +/*###### +## npc_sputtervalve +######*/ + +#define GOSSIP_SPUTTERVALVE "Can you tell me about this shard?" + +class npc_sputtervalve : public CreatureScript +{ +public: + npc_sputtervalve() : CreatureScript("npc_sputtervalve") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF) + { + player->SEND_GOSSIP_MENU(2013, creature->GetGUID()); + player->AreaExploredOrEventHappens(6981); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SPUTTERVALVE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + +}; + +/*###### +## npc_taskmaster_fizzule +######*/ + +enum TaskmasterFizzule +{ + FACTION_FRIENDLY_F = 35, + SPELL_FLARE = 10113, + SPELL_FOLLY = 10137, +}; + +class npc_taskmaster_fizzule : public CreatureScript +{ +public: + npc_taskmaster_fizzule() : CreatureScript("npc_taskmaster_fizzule") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_taskmaster_fizzuleAI(creature); + } + + struct npc_taskmaster_fizzuleAI : public ScriptedAI + { + npc_taskmaster_fizzuleAI(Creature* creature) : ScriptedAI(creature) + { + factionNorm = creature->getFaction(); + } + + uint32 factionNorm; + bool IsFriend; + uint32 ResetTimer; + uint8 FlareCount; + + void Reset() + { + IsFriend = false; + ResetTimer = 120000; + FlareCount = 0; + me->setFaction(factionNorm); + } + + void DoFriend() + { + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + + me->StopMoving(); + me->GetMotionMaster()->MoveIdle(); + + me->setFaction(FACTION_FRIENDLY_F); + me->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + } + + void SpellHit(Unit* /*caster*/, const SpellInfo* spell) + { + if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) + { + ++FlareCount; + + if (FlareCount >= 2) + IsFriend = true; + } + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (IsFriend) + { + if (ResetTimer <= diff) + { + EnterEvadeMode(); + return; + } else ResetTimer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* /*player*/, uint32 emote) + { + if (emote == TEXT_EMOTE_SALUTE) + { + if (FlareCount >= 2) + { + if (me->getFaction() == FACTION_FRIENDLY_F) + return; + + DoFriend(); + } + } + } + }; + +}; + +/*##### +## npc_twiggy_flathead +#####*/ + +enum TwiggyFlathead +{ + NPC_BIG_WILL = 6238, + NPC_AFFRAY_CHALLENGER = 6240, + + SAY_BIG_WILL_READY = 0, + SAY_TWIGGY_FLATHEAD_BEGIN = 0, + SAY_TWIGGY_FLATHEAD_FRAY = 1, + SAY_TWIGGY_FLATHEAD_DOWN = 2, + SAY_TWIGGY_FLATHEAD_OVER = 3 +}; + +Position const AffrayChallengerLoc[6] = +{ + {-1683.0f, -4326.0f, 2.79f, 0.0f}, + {-1682.0f, -4329.0f, 2.79f, 0.0f}, + {-1683.0f, -4330.0f, 2.79f, 0.0f}, + {-1680.0f, -4334.0f, 2.79f, 1.49f}, + {-1674.0f, -4326.0f, 2.79f, 3.49f}, + {-1677.0f, -4334.0f, 2.79f, 1.66f} +}; + +class npc_twiggy_flathead : public CreatureScript +{ +public: + npc_twiggy_flathead() : CreatureScript("npc_twiggy_flathead") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_twiggy_flatheadAI (creature); + } + + struct npc_twiggy_flatheadAI : public ScriptedAI + { + npc_twiggy_flatheadAI(Creature* creature) : ScriptedAI(creature) {} + + bool EventInProgress; + bool EventGrate; + bool EventBigWill; + bool ChallengerDown[6]; + uint8 Wave; + uint32 WaveTimer; + uint32 ChallengerChecker; + uint64 PlayerGUID; + uint64 AffrayChallenger[6]; + uint64 BigWill; + + void Reset() + { + EventInProgress = false; + EventGrate = false; + EventBigWill = false; + WaveTimer = 600000; + ChallengerChecker = 0; + Wave = 0; + PlayerGUID = 0; + + for (uint8 i = 0; i < 6; ++i) + { + AffrayChallenger[i] = 0; + ChallengerDown[i] = false; + } + BigWill = 0; + } + + void EnterCombat(Unit* /*who*/) { } + + void MoveInLineOfSight(Unit* who) + { + if (!who || (!who->isAlive())) + return; + + if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress) + { + PlayerGUID = who->GetGUID(); + EventInProgress = true; + } + } + + void KilledUnit(Unit* /*victim*/) { } + + void UpdateAI(const uint32 diff) + { + if (EventInProgress) { + Player* pWarrior = NULL; + + if (PlayerGUID) + pWarrior = Unit::GetPlayer(*me, PlayerGUID); + + if (!pWarrior) + return; + + if (!pWarrior->isAlive() && pWarrior->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE) { + Talk(SAY_TWIGGY_FLATHEAD_DOWN); + pWarrior->FailQuest(1719); + + for (uint8 i = 0; i < 6; ++i) // unsummon challengers + { + if (AffrayChallenger[i]) + { + Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); + if (creature && creature->isAlive()) + creature->DisappearAndDie(); + } + } + + if (BigWill) // unsummon bigWill + { + Creature* creature = Unit::GetCreature((*me), BigWill); + if (creature && creature->isAlive()) + creature->DisappearAndDie(); + } + Reset(); + } + + if (!EventGrate && EventInProgress) + { + float x, y, z; + pWarrior->GetPosition(x, y, z); + + if (x >= -1684 && x <= -1674 && y >= -4334 && y <= -4324) { + pWarrior->AreaExploredOrEventHappens(1719); + Talk(SAY_TWIGGY_FLATHEAD_BEGIN, pWarrior->GetGUID()); + + for (uint8 i = 0; i < 6; ++i) + { + Creature* creature = me->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + if (!creature) + continue; + creature->setFaction(35); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + AffrayChallenger[i] = creature->GetGUID(); + } + WaveTimer = 5000; + ChallengerChecker = 1000; + EventGrate = true; + } + } + else if (EventInProgress) + { + if (ChallengerChecker <= diff) + { + for (uint8 i = 0; i < 6; ++i) + { + if (AffrayChallenger[i]) + { + Creature* creature = Unit::GetCreature((*me), AffrayChallenger[i]); + if ((!creature || (!creature->isAlive())) && !ChallengerDown[i]) + { + Talk(SAY_TWIGGY_FLATHEAD_DOWN); + ChallengerDown[i] = true; + } + } + } + ChallengerChecker = 1000; + } else ChallengerChecker -= diff; + + if (WaveTimer <= diff) + { + if (Wave < 6 && AffrayChallenger[Wave] && !EventBigWill) + { + Talk(SAY_TWIGGY_FLATHEAD_FRAY); + Creature* creature = Unit::GetCreature((*me), AffrayChallenger[Wave]); + if (creature && (creature->isAlive())) + { + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + creature->setFaction(14); + creature->AI()->AttackStart(pWarrior); + ++Wave; + WaveTimer = 20000; + } + } + else if (Wave >= 6 && !EventBigWill) { + if (Creature* creature = me->SummonCreature(NPC_BIG_WILL, -1722, -4341, 6.12f, 6.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 480000)) + { + BigWill = creature->GetGUID(); + //creature->GetMotionMaster()->MovePoint(0, -1693, -4343, 4.32f); + //creature->GetMotionMaster()->MovePoint(1, -1684, -4333, 2.78f); + creature->GetMotionMaster()->MovePoint(2, -1682, -4329, 2.79f); + creature->HandleEmoteCommand(EMOTE_STATE_READY_UNARMED); + EventBigWill = true; + WaveTimer = 1000; + } + } + else if (Wave >= 6 && EventBigWill && BigWill) + { + Creature* creature = Unit::GetCreature((*me), BigWill); + if (!creature || !creature->isAlive()) + { + Talk(SAY_TWIGGY_FLATHEAD_OVER); + Reset(); + } + } + } else WaveTimer -= diff; + } + } + } + }; + +}; + +/*##### +## npc_wizzlecrank_shredder +#####*/ + +enum Wizzlecrank +{ + SAY_MERCENARY = 0, + SAY_START = 0, + SAY_STARTUP1 = 1, + SAY_STARTUP2 = 2, + SAY_PROGRESS_1 = 3, + SAY_PROGRESS_2 = 4, + SAY_PROGRESS_3 = 5, + SAY_END = 6, + + QUEST_ESCAPE = 863, + FACTION_RATCHET = 637, + NPC_PILOT_WIZZ = 3451, + NPC_MERCENARY = 3282, +}; + +class npc_wizzlecrank_shredder : public CreatureScript +{ +public: + npc_wizzlecrank_shredder() : CreatureScript("npc_wizzlecrank_shredder") { } + + struct npc_wizzlecrank_shredderAI : public npc_escortAI + { + npc_wizzlecrank_shredderAI(Creature* creature) : npc_escortAI(creature) + { + IsPostEvent = false; + PostEventTimer = 1000; + PostEventCount = 0; + } + + bool IsPostEvent; + uint32 PostEventTimer; + uint32 PostEventCount; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (me->getStandState() == UNIT_STAND_STATE_DEAD) + me->SetStandState(UNIT_STAND_STATE_STAND); + + IsPostEvent = false; + PostEventTimer = 1000; + PostEventCount = 0; + } + } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 0: + Talk(SAY_STARTUP1); + break; + case 9: + SetRun(false); + break; + case 17: + if (Creature* temp = me->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + { + temp->AI()->Talk(SAY_MERCENARY); + me->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + } + break; + case 24: + IsPostEvent = true; + break; + } + } + + void WaypointStart(uint32 PointId) + { + Player* player = GetPlayerForEscort(); + + if (!player) + return; + + switch (PointId) + { + case 9: + Talk(SAY_STARTUP2, player->GetGUID()); + break; + case 18: + Talk(SAY_PROGRESS_1, player->GetGUID()); + SetRun(); + break; + } + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == NPC_PILOT_WIZZ) + me->SetStandState(UNIT_STAND_STATE_DEAD); + + if (summoned->GetEntry() == NPC_MERCENARY) + summoned->AI()->AttackStart(me); + } + + void UpdateEscortAI(const uint32 Diff) + { + if (!UpdateVictim()) + { + if (IsPostEvent) + { + if (PostEventTimer <= Diff) + { + switch (PostEventCount) + { + case 0: + Talk(SAY_PROGRESS_2); + break; + case 1: + Talk(SAY_PROGRESS_3); + break; + case 2: + Talk(SAY_END); + break; + case 3: + if (Player* player = GetPlayerForEscort()) + { + player->GroupEventHappens(QUEST_ESCAPE, me); + me->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); + } + break; + } + + ++PostEventCount; + PostEventTimer = 5000; + } + else + PostEventTimer -= Diff; + } + + return; + } + + DoMeleeAttackIfReady(); + } + }; + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_ESCAPE) + { + creature->setFaction(FACTION_RATCHET); + if (npc_escortAI* pEscortAI = CAST_AI(npc_wizzlecrank_shredder::npc_wizzlecrank_shredderAI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_wizzlecrank_shredderAI(creature); + } + +}; + +void AddSC_the_barrens() +{ + new npc_beaten_corpse(); + new npc_gilthares(); + new npc_sputtervalve(); + new npc_taskmaster_fizzule(); + new npc_twiggy_flathead(); + new npc_wizzlecrank_shredder(); +} diff --git a/src/server/scripts/Kalimdor/zone_thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp new file mode 100644 index 00000000000..9c47991a5d5 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp @@ -0,0 +1,463 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Thousand Needles +SD%Complete: 100 +SDComment: Support for Quest: 1950, 4770, 4904, 4966, 5151. +SDCategory: Thousand Needles +EndScriptData */ + +/* ContentData +npc_kanati +npc_lakota_windsong +npc_swiftmountain +npc_plucky +npc_enraged_panther +go_panther_cage +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*##### +# npc_kanati +######*/ + +enum Kanati +{ + SAY_KAN_START = 0, + + QUEST_PROTECT_KANATI = 4966, + NPC_GALAK_ASS = 10720 +}; + +Position const GalakLoc = {-4867.387695f, -1357.353760f, -48.226f, 0.0f}; + +class npc_kanati : public CreatureScript +{ +public: + npc_kanati() : CreatureScript("npc_kanati") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_PROTECT_KANATI) + if (npc_kanatiAI* pEscortAI = CAST_AI(npc_kanati::npc_kanatiAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest, true); + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_kanatiAI(creature); + } + + struct npc_kanatiAI : public npc_escortAI + { + npc_kanatiAI(Creature* creature) : npc_escortAI(creature) { } + + void Reset() {} + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 0: + Talk(SAY_KAN_START); + DoSpawnGalak(); + break; + case 1: + if (Player* player = GetPlayerForEscort()) + player->GroupEventHappens(QUEST_PROTECT_KANATI, me); + break; + } + } + + void DoSpawnGalak() + { + for (int i = 0; i < 3; ++i) + me->SummonCreature(NPC_GALAK_ASS, GalakLoc, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + }; + +}; + +/*###### +# npc_lakota_windsong +######*/ + +enum Lakota +{ + SAY_LAKO_START = 0, + SAY_LAKO_LOOK_OUT = 1, + SAY_LAKO_HERE_COME = 2, + SAY_LAKO_MORE = 3, + SAY_LAKO_END = 4, + + QUEST_FREE_AT_LAST = 4904, + NPC_GRIM_BANDIT = 10758, + FACTION_ESCORTEE_LAKO = 232, //guessed + + ID_AMBUSH_1 = 0, + ID_AMBUSH_2 = 2, + ID_AMBUSH_3 = 4 +}; + +Position const BanditLoc[6] = +{ + {-4905.479492f, -2062.732666f, 84.352f, 0.0f}, + {-4915.201172f, -2073.528320f, 84.733f, 0.0f}, + {-4878.883301f, -1986.947876f, 91.966f, 0.0f}, + {-4877.503906f, -1966.113403f, 91.859f, 0.0f}, + {-4767.985352f, -1873.169189f, 90.192f, 0.0f}, + {-4788.861328f, -1888.007813f, 89.888f, 0.0f} +}; + +class npc_lakota_windsong : public CreatureScript +{ +public: + npc_lakota_windsong() : CreatureScript("npc_lakota_windsong") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_FREE_AT_LAST) + { + creature->AI()->Talk(SAY_LAKO_START, player->GetGUID()); + creature->setFaction(FACTION_ESCORTEE_LAKO); + + if (npc_lakota_windsongAI* pEscortAI = CAST_AI(npc_lakota_windsong::npc_lakota_windsongAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_lakota_windsongAI(creature); + } + + struct npc_lakota_windsongAI : public npc_escortAI + { + npc_lakota_windsongAI(Creature* creature) : npc_escortAI(creature) { } + + void Reset() {} + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 8: + Talk(SAY_LAKO_LOOK_OUT); + DoSpawnBandits(ID_AMBUSH_1); + break; + case 14: + Talk(SAY_LAKO_HERE_COME); + DoSpawnBandits(ID_AMBUSH_2); + break; + case 21: + Talk(SAY_LAKO_MORE); + DoSpawnBandits(ID_AMBUSH_3); + break; + case 45: + if (Player* player = GetPlayerForEscort()) + player->GroupEventHappens(QUEST_FREE_AT_LAST, me); + break; + } + } + + void DoSpawnBandits(int AmbushId) + { + for (int i = 0; i < 2; ++i) + me->SummonCreature(NPC_GRIM_BANDIT, BanditLoc[i+AmbushId], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } + }; + +}; + +/*###### +# npc_paoka_swiftmountain +######*/ + +enum Packa +{ + SAY_START = 0, + SAY_WYVERN = 1, + SAY_COMPLETE = 2, + + QUEST_HOMEWARD = 4770, + NPC_WYVERN = 4107, + FACTION_ESCORTEE = 232 //guessed +}; + +Position const WyvernLoc[3] = +{ + {-4990.606f, -906.057f, -5.343f, 0.0f}, + {-4970.241f, -927.378f, -4.951f, 0.0f}, + {-4985.364f, -952.528f, -5.199f, 0.0f} +}; + +class npc_paoka_swiftmountain : public CreatureScript +{ +public: + npc_paoka_swiftmountain() : CreatureScript("npc_paoka_swiftmountain") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_HOMEWARD) + { + creature->AI()->Talk(SAY_START, player->GetGUID()); + creature->setFaction(FACTION_ESCORTEE); + + if (npc_paoka_swiftmountainAI* pEscortAI = CAST_AI(npc_paoka_swiftmountain::npc_paoka_swiftmountainAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_paoka_swiftmountainAI(creature); + } + + struct npc_paoka_swiftmountainAI : public npc_escortAI + { + npc_paoka_swiftmountainAI(Creature* creature) : npc_escortAI(creature) { } + + void Reset() {} + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 15: + Talk(SAY_WYVERN); + DoSpawnWyvern(); + break; + case 26: + Talk(SAY_COMPLETE); + break; + case 27: + if (Player* player = GetPlayerForEscort()) + player->GroupEventHappens(QUEST_HOMEWARD, me); + break; + } + } + + void DoSpawnWyvern() + { + for (int i = 0; i < 3; ++i) + me->SummonCreature(NPC_WYVERN, WyvernLoc[i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } + }; +}; + +/*##### +# npc_plucky +######*/ + +#define GOSSIP_P "Please tell me the Phrase.." + +enum Plucky +{ + FACTION_FRIENDLY = 35, + QUEST_SCOOP = 1950, + SPELL_PLUCKY_HUMAN = 9192, + SPELL_PLUCKY_CHICKEN = 9220 +}; + +class npc_plucky : public CreatureScript +{ +public: + npc_plucky() : CreatureScript("npc_plucky") { } + + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_INFO_DEF+1: + player->CLOSE_GOSSIP_MENU(); + player->CompleteQuest(QUEST_SCOOP); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(738, creature->GetGUID()); + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_pluckyAI(creature); + } + + struct npc_pluckyAI : public ScriptedAI + { + npc_pluckyAI(Creature* creature) : ScriptedAI(creature) { NormFaction = creature->getFaction(); } + + uint32 NormFaction; + uint32 ResetTimer; + + void Reset() + { + ResetTimer = 120000; + + if (me->getFaction() != NormFaction) + me->setFaction(NormFaction); + + if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + DoCast(me, SPELL_PLUCKY_CHICKEN, false); + } + + void ReceiveEmote(Player* player, uint32 TextEmote) + { + if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + { + if (TextEmote == TEXT_EMOTE_BECKON) + { + me->setFaction(FACTION_FRIENDLY); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + DoCast(me, SPELL_PLUCKY_HUMAN, false); + } + } + + if (TextEmote == TEXT_EMOTE_CHICKEN) + { + if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + else + { + 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 Diff) + { + if (me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + { + if (ResetTimer <= Diff) + { + if (!me->getVictim()) + EnterEvadeMode(); + else + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + return; + } + else + ResetTimer -= Diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + +}; + +enum PantherCage +{ + ENRAGED_PANTHER = 10992 +}; + +class go_panther_cage : public GameObjectScript +{ +public: + go_panther_cage() : GameObjectScript("go_panther_cage") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->UseDoorOrButton(); + if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE) + { + if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true)) + { + panther->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + panther->SetReactState(REACT_AGGRESSIVE); + panther->AI()->AttackStart(player); + } + } + + return true; + } +}; + +class npc_enraged_panther : public CreatureScript +{ +public: + npc_enraged_panther() : CreatureScript("npc_enraged_panther") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_enraged_pantherAI(creature); + } + + struct npc_enraged_pantherAI : public ScriptedAI + { + npc_enraged_pantherAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + +}; + +void AddSC_thousand_needles() +{ + new npc_kanati(); + new npc_lakota_windsong(); + new npc_paoka_swiftmountain(); + new npc_plucky(); + new npc_enraged_panther(); + new go_panther_cage(); +} diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp new file mode 100644 index 00000000000..0d915dc7c44 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Thunder_Bluff +SD%Complete: 100 +SDComment: Quest support: 925 +SDCategory: Thunder Bluff +EndScriptData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*##### +# npc_cairne_bloodhoof +######*/ + +enum CairneBloodhoof +{ + SPELL_BERSERKER_CHARGE = 16636, + SPELL_CLEAVE = 16044, + SPELL_MORTAL_STRIKE = 16856, + SPELL_THUNDERCLAP = 23931, + SPELL_UPPERCUT = 22916 +}; + +#define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." +//TODO: verify abilities/timers +class npc_cairne_bloodhoof : public CreatureScript +{ +public: + npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_SENDER_INFO) + { + player->CastSpell(player, 23123, false); + player->SEND_GOSSIP_MENU(7014, creature->GetGUID()); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + player->SEND_GOSSIP_MENU(7013, creature->GetGUID()); + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_cairne_bloodhoofAI (creature); + } + + struct npc_cairne_bloodhoofAI : public ScriptedAI + { + npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 BerserkerChargeTimer; + uint32 CleaveTimer; + uint32 MortalStrikeTimer; + uint32 ThunderclapTimer; + uint32 UppercutTimer; + + void Reset() + { + BerserkerChargeTimer = 30000; + CleaveTimer = 5000; + MortalStrikeTimer = 10000; + ThunderclapTimer = 15000; + UppercutTimer = 10000; + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BerserkerChargeTimer <= diff) + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_BERSERKER_CHARGE); + BerserkerChargeTimer = 25000; + } else BerserkerChargeTimer -= diff; + + if (UppercutTimer <= diff) + { + DoCast(me->getVictim(), SPELL_UPPERCUT); + UppercutTimer = 20000; + } else UppercutTimer -= diff; + + if (ThunderclapTimer <= diff) + { + DoCast(me->getVictim(), SPELL_THUNDERCLAP); + ThunderclapTimer = 15000; + } else ThunderclapTimer -= diff; + + if (MortalStrikeTimer <= diff) + { + DoCast(me->getVictim(), SPELL_MORTAL_STRIKE); + MortalStrikeTimer = 15000; + } else MortalStrikeTimer -= diff; + + if (CleaveTimer <= diff) + { + DoCast(me->getVictim(), SPELL_CLEAVE); + CleaveTimer = 7000; + } else CleaveTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; + +}; + +void AddSC_thunder_bluff() +{ + new npc_cairne_bloodhoof(); +} diff --git a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp new file mode 100644 index 00000000000..e72c82bee97 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp @@ -0,0 +1,348 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Ungoro Crater +SD%Complete: 100 +SDComment: Support for Quest: 4245, 4491 +SDCategory: Ungoro Crater +EndScriptData */ + +/* ContentData +npc_a-me +npc_ringo +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "ScriptedFollowerAI.h" +#include "Player.h" +#include "SpellInfo.h" + +enum AmeData +{ + SAY_READY = 0, + SAY_AGGRO1 = 1, + SAY_SEARCH = 2, + SAY_AGGRO2 = 3, + SAY_AGGRO3 = 4, + SAY_FINISH = 5, + + SPELL_DEMORALIZINGSHOUT = 13730, + + QUEST_CHASING_AME = 4245, + ENTRY_TARLORD = 6519, + ENTRY_TARLORD1 = 6519, + ENTRY_STOMPER = 6513, +}; + +class npc_ame : public CreatureScript +{ +public: + npc_ame() : CreatureScript("npc_ame") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_CHASING_AME) + { + CAST_AI(npc_escortAI, (creature->AI()))->Start(false, false, player->GetGUID()); + creature->AI()->Talk(SAY_READY, player->GetGUID()); + creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + // Change faction so mobs attack + creature->setFaction(113); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_ameAI(creature); + } + + struct npc_ameAI : public npc_escortAI + { + npc_ameAI(Creature* creature) : npc_escortAI(creature) {} + + uint32 DemoralizingShoutTimer; + + void WaypointReached(uint32 waypointId) + { + if (Player* player = GetPlayerForEscort()) + { + switch (waypointId) + { + case 19: + me->SummonCreature(ENTRY_STOMPER, -6391.69f, -1730.49f, -272.83f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + Talk(SAY_AGGRO1, player->GetGUID()); + break; + case 28: + Talk(SAY_SEARCH, player->GetGUID()); + break; + case 38: + me->SummonCreature(ENTRY_TARLORD, -6370.75f, -1382.84f, -270.51f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + Talk(SAY_AGGRO2, player->GetGUID()); + break; + case 49: + me->SummonCreature(ENTRY_TARLORD1, -6324.44f, -1181.05f, -270.17f, 4.34f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + Talk(SAY_AGGRO3, player->GetGUID()); + break; + case 55: + Talk(SAY_FINISH, player->GetGUID()); + player->GroupEventHappens(QUEST_CHASING_AME, me); + break; + } + } + } + + void Reset() + { + DemoralizingShoutTimer = 5000; + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void JustDied(Unit* /*killer*/) + { + if (Player* player = GetPlayerForEscort()) + player->FailQuest(QUEST_CHASING_AME); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + if (!UpdateVictim()) + return; + + if (DemoralizingShoutTimer <= diff) + { + DoCast(me->getVictim(), SPELL_DEMORALIZINGSHOUT); + DemoralizingShoutTimer = 70000; + } else DemoralizingShoutTimer -= diff; + } + }; +}; + +/*#### +# npc_ringo +####*/ + +enum Ringo +{ + SAY_RIN_START = 0, + + SAY_FAINT = 1, + + SAY_WAKE = 2, + + SAY_RIN_END_1 = 3, + SAY_SPR_END_2 = 0, + SAY_RIN_END_3 = 4, + EMOTE_RIN_END_4 = 5, + EMOTE_RIN_END_5 = 6, + SAY_RIN_END_6 = 7, + SAY_SPR_END_7 = 1, + EMOTE_RIN_END_8 = 8, + + SPELL_REVIVE_RINGO = 15591, + QUEST_A_LITTLE_HELP = 4491, + NPC_SPRAGGLE = 9997, + FACTION_ESCORTEE = 113 +}; + +class npc_ringo : public CreatureScript +{ +public: + npc_ringo() : CreatureScript("npc_ringo") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_A_LITTLE_HELP) + { + if (npc_ringoAI* ringoAI = CAST_AI(npc_ringo::npc_ringoAI, creature->AI())) + { + creature->SetStandState(UNIT_STAND_STATE_STAND); + ringoAI->StartFollow(player, FACTION_ESCORTEE, quest); + } + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_ringoAI(creature); + } + + struct npc_ringoAI : public FollowerAI + { + npc_ringoAI(Creature* creature) : FollowerAI(creature) { } + + uint32 FaintTimer; + uint32 EndEventProgress; + uint32 EndEventTimer; + + uint64 SpraggleGUID; + + void Reset() + { + FaintTimer = urand(30000, 60000); + EndEventProgress = 0; + EndEventTimer = 1000; + SpraggleGUID = 0; + } + + void MoveInLineOfSight(Unit* who) + { + FollowerAI::MoveInLineOfSight(who); + + if (!me->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_SPRAGGLE) + { + if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) + { + if (Player* player = GetLeaderForFollower()) + { + if (player->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE) + player->GroupEventHappens(QUEST_A_LITTLE_HELP, me); + } + + SpraggleGUID = who->GetGUID(); + SetFollowComplete(true); + } + } + } + + void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell) + { + if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) + ClearFaint(); + } + + void SetFaint() + { + if (!HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + SetFollowPaused(true); + + Talk(SAY_FAINT); + } + + //what does actually happen here? Emote? Aura? + me->SetStandState(UNIT_STAND_STATE_SLEEP); + } + + void ClearFaint() + { + me->SetStandState(UNIT_STAND_STATE_STAND); + + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + return; + + Talk(SAY_WAKE); + + SetFollowPaused(false); + } + + void UpdateFollowerAI(const uint32 Diff) + { + if (!UpdateVictim()) + { + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + if (EndEventTimer <= Diff) + { + Creature* spraggle = Creature::GetCreature(*me, SpraggleGUID); + if (!spraggle || !spraggle->isAlive()) + { + SetFollowComplete(); + return; + } + + switch (EndEventProgress) + { + case 1: + Talk(SAY_RIN_END_1); + EndEventTimer = 3000; + break; + case 2: + spraggle->AI()->Talk(SAY_SPR_END_2); + EndEventTimer = 5000; + break; + case 3: + Talk(SAY_RIN_END_3); + EndEventTimer = 1000; + break; + case 4: + Talk(EMOTE_RIN_END_4); + SetFaint(); + EndEventTimer = 9000; + break; + case 5: + Talk(EMOTE_RIN_END_5); + ClearFaint(); + EndEventTimer = 1000; + break; + case 6: + Talk(SAY_RIN_END_6); + EndEventTimer = 3000; + break; + case 7: + spraggle->AI()->Talk(SAY_SPR_END_7); + EndEventTimer = 10000; + break; + case 8: + Talk(EMOTE_RIN_END_8); + EndEventTimer = 5000; + break; + case 9: + SetFollowComplete(); + break; + } + + ++EndEventProgress; + } + else + EndEventTimer -= Diff; + } + else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) + { + if (FaintTimer <= Diff) + { + SetFaint(); + FaintTimer = urand(60000, 120000); + } + else + FaintTimer -= Diff; + } + + return; + } + + DoMeleeAttackIfReady(); + } + }; +}; + +void AddSC_ungoro_crater() +{ + new npc_ame(); + new npc_ringo(); +} diff --git a/src/server/scripts/Kalimdor/zone_winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp new file mode 100644 index 00000000000..06f01033a25 --- /dev/null +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * Copyright (C) 2006-2009 ScriptDev2 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +SDName: Winterspring +SD%Complete: Almost Completely Emptied +SDComment: Vendor Rivern Frostwind. +SDCategory: Winterspring +EndScriptData */ + +/* ContentData +npc_rivern_frostwind +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" +#include "WorldSession.h" + +/*###### +## npc_rivern_frostwind +######*/ + +class npc_rivern_frostwind : public CreatureScript +{ +public: + npc_rivern_frostwind() : CreatureScript("npc_rivern_frostwind") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_TRADE) + player->GetSession()->SendListInventory(creature->GetGUID()); + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (creature->isVendor() && player->GetReputationRank(589) == REP_EXALTED) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } + +}; + +void AddSC_winterspring() +{ + new npc_rivern_frostwind(); +} -- cgit v1.2.3