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/EasternKingdoms/CMakeLists.txt | 46 +- .../scripts/EasternKingdoms/alterac_mountains.cpp | 35 -- .../scripts/EasternKingdoms/arathi_highlands.cpp | 146 ----- .../scripts/EasternKingdoms/blasted_lands.cpp | 76 --- .../scripts/EasternKingdoms/burning_steppes.cpp | 158 ----- src/server/scripts/EasternKingdoms/duskwood.cpp | 143 ----- .../EasternKingdoms/eastern_plaguelands.cpp | 192 ------ .../scripts/EasternKingdoms/eversong_woods.cpp | 634 -------------------- src/server/scripts/EasternKingdoms/ghostlands.cpp | 226 ------- src/server/scripts/EasternKingdoms/hinterlands.cpp | 352 ----------- src/server/scripts/EasternKingdoms/ironforge.cpp | 99 ---- .../scripts/EasternKingdoms/isle_of_queldanas.cpp | 159 ----- src/server/scripts/EasternKingdoms/loch_modan.cpp | 106 ---- .../scripts/EasternKingdoms/redridge_mountains.cpp | 173 ------ .../scripts/EasternKingdoms/silvermoon_city.cpp | 111 ---- .../scripts/EasternKingdoms/silverpine_forest.cpp | 327 ----------- .../scripts/EasternKingdoms/stormwind_city.cpp | 647 --------------------- .../scripts/EasternKingdoms/stranglethorn_vale.cpp | 129 ---- .../scripts/EasternKingdoms/swamp_of_sorrows.cpp | 155 ----- .../scripts/EasternKingdoms/tirisfal_glades.cpp | 217 ------- src/server/scripts/EasternKingdoms/undercity.cpp | 334 ----------- .../EasternKingdoms/western_plaguelands.cpp | 419 ------------- src/server/scripts/EasternKingdoms/westfall.cpp | 272 --------- src/server/scripts/EasternKingdoms/wetlands.cpp | 172 ------ .../EasternKingdoms/zone_alterac_mountains.cpp | 35 ++ .../EasternKingdoms/zone_arathi_highlands.cpp | 146 +++++ .../scripts/EasternKingdoms/zone_blasted_lands.cpp | 76 +++ .../EasternKingdoms/zone_burning_steppes.cpp | 158 +++++ .../scripts/EasternKingdoms/zone_duskwood.cpp | 143 +++++ .../EasternKingdoms/zone_eastern_plaguelands.cpp | 192 ++++++ .../EasternKingdoms/zone_eversong_woods.cpp | 634 ++++++++++++++++++++ .../scripts/EasternKingdoms/zone_ghostlands.cpp | 226 +++++++ .../scripts/EasternKingdoms/zone_hinterlands.cpp | 352 +++++++++++ .../scripts/EasternKingdoms/zone_ironforge.cpp | 99 ++++ .../EasternKingdoms/zone_isle_of_queldanas.cpp | 159 +++++ .../scripts/EasternKingdoms/zone_loch_modan.cpp | 106 ++++ .../EasternKingdoms/zone_redridge_mountains.cpp | 173 ++++++ .../EasternKingdoms/zone_silvermoon_city.cpp | 111 ++++ .../EasternKingdoms/zone_silverpine_forest.cpp | 327 +++++++++++ .../EasternKingdoms/zone_stormwind_city.cpp | 647 +++++++++++++++++++++ .../EasternKingdoms/zone_stranglethorn_vale.cpp | 129 ++++ .../EasternKingdoms/zone_swamp_of_sorrows.cpp | 155 +++++ .../EasternKingdoms/zone_tirisfal_glades.cpp | 217 +++++++ .../scripts/EasternKingdoms/zone_undercity.cpp | 334 +++++++++++ .../EasternKingdoms/zone_western_plaguelands.cpp | 419 +++++++++++++ .../scripts/EasternKingdoms/zone_westfall.cpp | 272 +++++++++ .../scripts/EasternKingdoms/zone_wetlands.cpp | 172 ++++++ 47 files changed, 5305 insertions(+), 5305 deletions(-) delete mode 100644 src/server/scripts/EasternKingdoms/alterac_mountains.cpp delete mode 100644 src/server/scripts/EasternKingdoms/arathi_highlands.cpp delete mode 100644 src/server/scripts/EasternKingdoms/blasted_lands.cpp delete mode 100644 src/server/scripts/EasternKingdoms/burning_steppes.cpp delete mode 100644 src/server/scripts/EasternKingdoms/duskwood.cpp delete mode 100644 src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp delete mode 100644 src/server/scripts/EasternKingdoms/eversong_woods.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ghostlands.cpp delete mode 100644 src/server/scripts/EasternKingdoms/hinterlands.cpp delete mode 100644 src/server/scripts/EasternKingdoms/ironforge.cpp delete mode 100644 src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp delete mode 100644 src/server/scripts/EasternKingdoms/loch_modan.cpp delete mode 100644 src/server/scripts/EasternKingdoms/redridge_mountains.cpp delete mode 100644 src/server/scripts/EasternKingdoms/silvermoon_city.cpp delete mode 100644 src/server/scripts/EasternKingdoms/silverpine_forest.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stormwind_city.cpp delete mode 100644 src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp delete mode 100644 src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp delete mode 100644 src/server/scripts/EasternKingdoms/tirisfal_glades.cpp delete mode 100644 src/server/scripts/EasternKingdoms/undercity.cpp delete mode 100644 src/server/scripts/EasternKingdoms/western_plaguelands.cpp delete mode 100644 src/server/scripts/EasternKingdoms/westfall.cpp delete mode 100644 src/server/scripts/EasternKingdoms/wetlands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_duskwood.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_ghostlands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_hinterlands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_ironforge.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_loch_modan.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_undercity.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_westfall.cpp create mode 100644 src/server/scripts/EasternKingdoms/zone_wetlands.cpp (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 854124ee05c..bbdbe396a95 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -10,8 +10,8 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - EasternKingdoms/ghostlands.cpp - EasternKingdoms/eversong_woods.cpp + EasternKingdoms/zone_ghostlands.cpp + EasternKingdoms/zone_eversong_woods.cpp EasternKingdoms/AlteracValley/boss_galvangar.cpp EasternKingdoms/AlteracValley/boss_balinda.cpp EasternKingdoms/AlteracValley/boss_drekthar.cpp @@ -31,7 +31,7 @@ set(scripts_STAT_SRCS EasternKingdoms/Scholomance/instance_scholomance.cpp EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp - EasternKingdoms/isle_of_queldanas.cpp + EasternKingdoms/zone_isle_of_queldanas.cpp EasternKingdoms/boss_kruul.cpp EasternKingdoms/ZulGurub/boss_hakkar.cpp EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -48,12 +48,12 @@ set(scripts_STAT_SRCS EasternKingdoms/ZulGurub/boss_jindo.cpp EasternKingdoms/ZulGurub/boss_wushoolay.cpp EasternKingdoms/ZulGurub/boss_thekal.cpp - EasternKingdoms/wetlands.cpp - EasternKingdoms/arathi_highlands.cpp + EasternKingdoms/zone_wetlands.cpp + EasternKingdoms/zone_arathi_highlands.cpp EasternKingdoms/Gnomeregan/instance_gnomeregan.cpp EasternKingdoms/Gnomeregan/gnomeregan.cpp EasternKingdoms/Gnomeregan/gnomeregan.h - EasternKingdoms/redridge_mountains.cpp + EasternKingdoms/zone_redridge_mountains.cpp EasternKingdoms/BlackrockDepths/boss_high_interrogator_gerstahn.cpp EasternKingdoms/BlackrockDepths/boss_gorosh_the_dervish.cpp EasternKingdoms/BlackrockDepths/blackrock_depths.cpp @@ -67,12 +67,12 @@ set(scripts_STAT_SRCS EasternKingdoms/BlackrockDepths/blackrock_depths.h EasternKingdoms/BlackrockDepths/boss_emperor_dagran_thaurissan.cpp EasternKingdoms/BlackrockDepths/boss_magmus.cpp - EasternKingdoms/ironforge.cpp + EasternKingdoms/zone_ironforge.cpp EasternKingdoms/ScarletEnclave/chapter2.cpp EasternKingdoms/ScarletEnclave/chapter5.cpp EasternKingdoms/ScarletEnclave/chapter1.cpp EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp - EasternKingdoms/eastern_plaguelands.cpp + EasternKingdoms/zone_eastern_plaguelands.cpp EasternKingdoms/MoltenCore/boss_gehennas.cpp EasternKingdoms/MoltenCore/boss_lucifron.cpp EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -99,7 +99,7 @@ set(scripts_STAT_SRCS EasternKingdoms/Stratholme/boss_postmaster_malown.cpp EasternKingdoms/Stratholme/stratholme.h EasternKingdoms/Stratholme/stratholme.cpp - EasternKingdoms/tirisfal_glades.cpp + EasternKingdoms/zone_tirisfal_glades.cpp EasternKingdoms/SunkenTemple/sunken_temple.cpp EasternKingdoms/SunkenTemple/sunken_temple.h EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -115,7 +115,7 @@ set(scripts_STAT_SRCS EasternKingdoms/Uldaman/uldaman.h EasternKingdoms/Uldaman/instance_uldaman.cpp EasternKingdoms/Uldaman/boss_archaedas.cpp - EasternKingdoms/swamp_of_sorrows.cpp + EasternKingdoms/zone_swamp_of_sorrows.cpp EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp EasternKingdoms/BlackrockSpire/boss_drakkisath.cpp EasternKingdoms/BlackrockSpire/boss_warmaster_voone.cpp @@ -139,12 +139,12 @@ set(scripts_STAT_SRCS EasternKingdoms/SunwellPlateau/boss_brutallus.cpp EasternKingdoms/SunwellPlateau/sunwell_plateau.cpp EasternKingdoms/SunwellPlateau/boss_felmyst.cpp - EasternKingdoms/stranglethorn_vale.cpp + EasternKingdoms/zone_stranglethorn_vale.cpp EasternKingdoms/Deadmines/deadmines.h EasternKingdoms/Deadmines/deadmines.cpp EasternKingdoms/Deadmines/boss_mr_smite.cpp EasternKingdoms/Deadmines/instance_deadmines.cpp - EasternKingdoms/duskwood.cpp + EasternKingdoms/zone_duskwood.cpp EasternKingdoms/ScarletMonastery/boss_azshir_the_sleepless.cpp EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp EasternKingdoms/ScarletMonastery/boss_bloodmage_thalnos.cpp @@ -157,13 +157,13 @@ set(scripts_STAT_SRCS EasternKingdoms/ScarletMonastery/boss_arcanist_doan.cpp EasternKingdoms/ScarletMonastery/boss_herod.cpp EasternKingdoms/ScarletMonastery/boss_scorn.cpp - EasternKingdoms/undercity.cpp - EasternKingdoms/silvermoon_city.cpp - EasternKingdoms/loch_modan.cpp + EasternKingdoms/zone_undercity.cpp + EasternKingdoms/zone_silvermoon_city.cpp + EasternKingdoms/zone_loch_modan.cpp EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp EasternKingdoms/ShadowfangKeep/instance_shadowfang_keep.cpp EasternKingdoms/ShadowfangKeep/shadowfang_keep.h - EasternKingdoms/burning_steppes.cpp + EasternKingdoms/zone_burning_steppes.cpp EasternKingdoms/BlackwingLair/boss_chromaggus.cpp EasternKingdoms/BlackwingLair/boss_razorgore.cpp EasternKingdoms/BlackwingLair/boss_firemaw.cpp @@ -174,8 +174,8 @@ set(scripts_STAT_SRCS EasternKingdoms/BlackwingLair/boss_nefarian.cpp EasternKingdoms/BlackwingLair/boss_flamegor.cpp EasternKingdoms/BlackwingLair/boss_victor_nefarius.cpp - EasternKingdoms/blasted_lands.cpp - EasternKingdoms/stormwind_city.cpp + EasternKingdoms/zone_blasted_lands.cpp + EasternKingdoms/zone_stormwind_city.cpp EasternKingdoms/ZulAman/boss_halazzi.cpp EasternKingdoms/ZulAman/boss_hexlord.cpp EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -185,11 +185,11 @@ set(scripts_STAT_SRCS EasternKingdoms/ZulAman/boss_nalorakk.cpp EasternKingdoms/ZulAman/zulaman.cpp EasternKingdoms/ZulAman/zulaman.h - EasternKingdoms/hinterlands.cpp - EasternKingdoms/western_plaguelands.cpp - EasternKingdoms/alterac_mountains.cpp - EasternKingdoms/westfall.cpp - EasternKingdoms/silverpine_forest.cpp + EasternKingdoms/zone_hinterlands.cpp + EasternKingdoms/zone_western_plaguelands.cpp + EasternKingdoms/zone_alterac_mountains.cpp + EasternKingdoms/zone_westfall.cpp + EasternKingdoms/zone_silverpine_forest.cpp EasternKingdoms/Karazhan/instance_karazhan.cpp EasternKingdoms/Karazhan/boss_nightbane.cpp EasternKingdoms/Karazhan/karazhan.cpp diff --git a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/alterac_mountains.cpp deleted file mode 100644 index 9b9af494554..00000000000 --- a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp +++ /dev/null @@ -1,35 +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: Alterac_Mountains -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Alterac Mountains -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -/*void AddSC_alterac_mountains() -{ - Script* newscript; -}*/ diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp deleted file mode 100644 index d638a435936..00000000000 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ /dev/null @@ -1,146 +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: Arathi Highlands -SD%Complete: 100 -SDComment: Quest support: 665 -SDCategory: Arathi Highlands -EndScriptData */ - -/* ContentData -npc_professor_phizzlethorpe -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_professor_phizzlethorpe -######*/ - -enum eEnums -{ - SAY_PROGRESS_1 = 0, - SAY_PROGRESS_2 = 1, - SAY_PROGRESS_3 = 2, - EMOTE_PROGRESS_4 = 3, - SAY_AGGRO = 4, - SAY_PROGRESS_5 = 5, - SAY_PROGRESS_6 = 6, - SAY_PROGRESS_7 = 7, - EMOTE_PROGRESS_8 = 8, - SAY_PROGRESS_9 = 9, - - QUEST_SUNKEN_TREASURE = 665, - MOB_VENGEFUL_SURGE = 2776 -}; - -class npc_professor_phizzlethorpe : public CreatureScript -{ - public: - - npc_professor_phizzlethorpe() - : CreatureScript("npc_professor_phizzlethorpe") - { - } - - struct npc_professor_phizzlethorpeAI : public npc_escortAI - { - npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 4: - Talk(SAY_PROGRESS_2, player->GetGUID()); - break; - case 5: - Talk(SAY_PROGRESS_3, player->GetGUID()); - break; - case 8: - Talk(EMOTE_PROGRESS_4); - break; - case 9: - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - case 10: - Talk(SAY_PROGRESS_5, player->GetGUID()); - break; - case 11: - Talk(SAY_PROGRESS_6, player->GetGUID()); - SetRun(); - break; - case 19: - Talk(SAY_PROGRESS_7, player->GetGUID()); - break; - case 20: - Talk(EMOTE_PROGRESS_8); - Talk(SAY_PROGRESS_9, player->GetGUID()); - player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); - break; - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_professor_phizzlethorpeAI(creature); - } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) - { - creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID()); - if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI()))) - pEscortAI->Start(false, false, player->GetGUID(), quest); - - creature->setFaction(113); - } - return true; - } -}; - -void AddSC_arathi_highlands() -{ - new npc_professor_phizzlethorpe(); -} diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/blasted_lands.cpp deleted file mode 100644 index 4f76edf4406..00000000000 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ /dev/null @@ -1,76 +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: Blasted_Lands -SD%Complete: 90 -SDComment: Quest support: 3628. Teleporter to Rise of the Defiler missing group support. -SDCategory: Blasted Lands -EndScriptData */ - -/* ContentData -npc_deathly_usher -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npc_deathly_usher -######*/ - -#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler." - -#define SPELL_TELEPORT_SINGLE 12885 -#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142 -#define SPELL_TELEPORT_GROUP 27686 - -class npc_deathly_usher : public CreatureScript -{ -public: - npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -void AddSC_blasted_lands() -{ - new npc_deathly_usher(); -} diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/burning_steppes.cpp deleted file mode 100644 index b6899c534e4..00000000000 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ /dev/null @@ -1,158 +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: Burning_Steppes -SD%Complete: 100 -SDComment: Quest support: 4224, 4866 -SDCategory: Burning Steppes -EndScriptData */ - -/* ContentData -npc_ragged_john -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npc_ragged_john -######*/ - -#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him." -#define GOSSIP_SELECT1 "So what did you do?" -#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'." -#define GOSSIP_SELECT3 "Ironfoe?" -#define GOSSIP_SELECT4 "Interesting... continue John." -#define GOSSIP_SELECT5 "So that's how Windsor died..." -#define GOSSIP_SELECT6 "So how did he die?" -#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?" -#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?" -#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?" -#define GOSSIP_SELECT10 "Ahh... Ironfoe" -#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" - -class npc_ragged_john : public CreatureScript -{ -public: - npc_ragged_john() : CreatureScript("npc_ragged_john") { } - - 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_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2714, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2715, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2716, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2717, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(2718, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(2719, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(2720, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); - player->SEND_GOSSIP_MENU(2721, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); - player->SEND_GOSSIP_MENU(2722, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); - player->SEND_GOSSIP_MENU(2723, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+10: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(2725, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4224); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(2713, creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ragged_johnAI (creature); - } - - struct npc_ragged_johnAI : public ScriptedAI - { - npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - - void MoveInLineOfSight(Unit* who) - { - if (who->HasAura(16468)) - { - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) - { - DoCast(who, 16472); - CAST_PLR(who)->AreaExploredOrEventHappens(4866); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit* /*who*/) {} - }; -}; - -void AddSC_burning_steppes() -{ - new npc_ragged_john(); -} diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/duskwood.cpp deleted file mode 100644 index 1ce83d31a63..00000000000 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ /dev/null @@ -1,143 +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: Duskwood -SD%Complete: 100 -SDComment: Quest Support:8735 -SDCategory: Duskwood -EndScriptData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "Player.h" - -enum Yells -{ - YELL_TWILIGHTCORRUPTOR_RESPAWN = 0, - YELL_TWILIGHTCORRUPTOR_AGGRO = 1, - YELL_TWILIGHTCORRUPTOR_KILL = 2, -}; - - -/*###### -# at_twilight_grove -######*/ - -class at_twilight_grove : public AreaTriggerScript -{ -public: - at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { } - - bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) - { - if (player->HasQuestForItem(21149)) - { - if (Unit* TCorrupter = player->SummonCreature(15625, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000)) - { - TCorrupter->setFaction(14); - TCorrupter->SetMaxHealth(832750); - } - if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) - { - CorrupterSpeaker->SetName("Twilight Corrupter"); - CorrupterSpeaker->SetVisible(true); - CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player->GetGUID()); - } - } - return false; - }; -}; - -/*###### -# boss_twilight_corrupter -######*/ - -#define SPELL_SOUL_CORRUPTION 25805 -#define SPELL_CREATURE_OF_NIGHTMARE 25806 -#define SPELL_LEVEL_UP 24312 - -class boss_twilight_corrupter : public CreatureScript -{ -public: - boss_twilight_corrupter() : CreatureScript("boss_twilight_corrupter") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_twilight_corrupterAI (creature); - } - - struct boss_twilight_corrupterAI : public ScriptedAI - { - boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SoulCorruption_Timer; - uint32 CreatureOfNightmare_Timer; - uint8 KillCount; - - void Reset() - { - SoulCorruption_Timer = 15000; - CreatureOfNightmare_Timer = 30000; - KillCount = 0; - } - void EnterCombat(Unit* /*who*/) - { - Talk(YELL_TWILIGHTCORRUPTOR_AGGRO); - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - ++KillCount; - Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim->GetGUID()); - - if (KillCount == 3) - { - DoCast(me, SPELL_LEVEL_UP, true); - KillCount = 0; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - if (SoulCorruption_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION); - SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers - } else SoulCorruption_Timer-=diff; - - if (CreatureOfNightmare_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE); - CreatureOfNightmare_Timer = 45000; //gotta confirm Timers - } else CreatureOfNightmare_Timer-=diff; - DoMeleeAttackIfReady(); - }; - }; -}; - -void AddSC_duskwood() -{ - new boss_twilight_corrupter(); - new at_twilight_grove(); -} diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp deleted file mode 100644 index a2522fd9495..00000000000 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ /dev/null @@ -1,192 +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: Eastern_Plaguelands -SD%Complete: 100 -SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched -SDCategory: Eastern Plaguelands -EndScriptData */ - -/* ContentData -mobs_ghoul_flayer -npc_augustus_the_touched -npc_darrowshire_spirit -npc_tirion_fordring -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "WorldSession.h" - -class mobs_ghoul_flayer : public CreatureScript -{ -public: - mobs_ghoul_flayer() : CreatureScript("mobs_ghoul_flayer") { } - - struct mobs_ghoul_flayerAI : public ScriptedAI - { - mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() {} - - void EnterCombat(Unit* /*who*/) {} - - void JustDied(Unit* killer) - { - if (killer->GetTypeId() == TYPEID_PLAYER) - me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new mobs_ghoul_flayerAI (creature); - } -}; - -/*###### -## npc_augustus_the_touched -######*/ - -class npc_augustus_the_touched : public CreatureScript -{ -public: - npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { } - - 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(6164)) - 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_darrowshire_spirit -######*/ - -#define SPELL_SPIRIT_SPAWNIN 17321 - -class npc_darrowshire_spirit : public CreatureScript -{ -public: - npc_darrowshire_spirit() : CreatureScript("npc_darrowshire_spirit") { } - - bool OnGossipHello(Player* player, Creature* creature) - { - player->SEND_GOSSIP_MENU(3873, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_darrowshire_spiritAI (creature); - } - - struct npc_darrowshire_spiritAI : public ScriptedAI - { - npc_darrowshire_spiritAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() - { - DoCast(me, SPELL_SPIRIT_SPAWNIN); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* /*who*/) {} - }; -}; - -/*###### -## npc_tirion_fordring -######*/ - -#define GOSSIP_HELLO "I am ready to hear your tale, Tirion." -#define GOSSIP_SELECT1 "Thank you, Tirion. What of your identity?" -#define GOSSIP_SELECT2 "That is terrible." -#define GOSSIP_SELECT3 "I will, Tirion." - -class npc_tirion_fordring : public CreatureScript -{ -public: - npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { } - - 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_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(4493, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(4494, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(4495, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(5742); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == UNIT_STAND_STATE_SIT) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -void AddSC_eastern_plaguelands() -{ - new mobs_ghoul_flayer(); - new npc_augustus_the_touched(); - new npc_darrowshire_spirit(); - new npc_tirion_fordring(); -} diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/eversong_woods.cpp deleted file mode 100644 index 432768a51de..00000000000 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ /dev/null @@ -1,634 +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: Eversong_Woods -SD%Complete: 100 -SDComment: Quest support: 8483, 8488, 8490, 9686 -SDCategory: Eversong Woods -EndScriptData */ - -/* ContentData -npc_prospector_anvilward -npc_apprentice_mirveda -npc_infused_crystal -npc_kelerun_bloodmourn -go_harbinger_second_trial -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## Quest 9686 Second Trial -######*/ - -enum SeconTrial -{ - QUEST_SECOND_TRIAL = 9686, - OFFSET_NEXT_ATTACK = 750, -}; - -enum eSpells -{ - SPELL_FLASH_OF_LIGHT = 19939, - SPELL_SEAL_OF_JUSTICE = 20164, - SPELL_JUDGEMENT_OF_LIGHT = 20271, - SPELL_SEAL_OF_COMMAND = 20375, -}; - -enum eNpc -{ - MASTER_KELERUN_BLOODMOURN = 17807, - CHAMPION_BLOODWRATH = 17809, - CHAMPION_LIGHTREND = 17810, - CHAMPION_SWIFTBLADE = 17811, - CHAMPION_SUNSTRIKER = 17812, -}; - -enum eFaction -{ - FACTION_HOSTILE = 45, - FACTION_FRIENDLY = 7, -}; - -enum eSays -{ - TEXT_SECOND_TRIAL_1 = 0, - TEXT_SECOND_TRIAL_2 = 1, - TEXT_SECOND_TRIAL_3 = 2, - TEXT_SECOND_TRIAL_4 = 3, -}; - -struct Locations -{ - float x, y, z, o; -}; - -static Locations SpawnPosition[]= -{ - {5.3f, -11.8f, 0.361f, 4.2f}, - {11.2f, -29.17f, 0.361f, 2.7f}, - {-5.7f, -34.85f, 0.361f, 1.09f}, - {-11.9f, -18, 0.361f, 5.87f} -}; - -static uint32 PaladinEntry[] = {CHAMPION_BLOODWRATH, CHAMPION_LIGHTREND, CHAMPION_SWIFTBLADE, CHAMPION_SUNSTRIKER}; - -/*###### -## npc_second_trial_paladin -######*/ - -class npc_second_trial_paladin : public CreatureScript -{ -public: - npc_second_trial_paladin() : CreatureScript("npc_second_trial_paladin") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_secondTrialAI (creature); - } - - struct npc_secondTrialAI : public ScriptedAI - { - npc_secondTrialAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 timer; - uint8 questPhase; - uint64 summonerGuid; - - bool spellFlashLight; - bool spellJustice; - bool spellJudLight; - bool spellCommand; - - uint32 timerFlashLight; - uint32 timerJustice; - uint32 timerJudLight; - uint32 timerCommand; - - void Reset() - { - timer = 2000; - questPhase = 0; - summonerGuid = 0; - - me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL); - me->setFaction(FACTION_FRIENDLY); - - spellFlashLight = false; - spellJustice = false; - spellJudLight = false; - spellCommand = false; - - switch (me->GetEntry()) - { - case CHAMPION_BLOODWRATH: - spellFlashLight = true; - timerFlashLight = 3225; - break; - case CHAMPION_LIGHTREND: - spellJustice = true; - timerJustice = 500; - break; - case CHAMPION_SWIFTBLADE: - spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 - timerJudLight = 500; - break; - case CHAMPION_SUNSTRIKER: - spellFlashLight = true; - spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 - spellCommand = false; // Misses Dummy // http://www.wowhead.com/?spell=20375 - timerFlashLight = 3225; - timerJudLight = 500; - timerCommand = 1500; - break; - } - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (questPhase == 1) - { - if (timer <= diff) - { - me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - me->setFaction(FACTION_HOSTILE); - questPhase = 0; - - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - { - me->AddThreat(target, 5000000.0f); - AttackStart(target); - } - } - else - timer -= diff; - } - - if (!UpdateVictim()) - return; - - // healer - if (spellFlashLight && HealthBelowPct(70)) - { - if (timerFlashLight <= diff) - { - DoCast(me, SPELL_FLASH_OF_LIGHT); - timerFlashLight = 3225 + rand()%3225; - } - else - timerFlashLight -= diff; - } - - if (spellJustice) - { - if (timerJustice <= diff) - { - DoCast(me, SPELL_SEAL_OF_JUSTICE); - timerJustice = urand(10000, 20000); - } - else - timerJustice -= diff; - } - - if (spellJudLight) - { - if (timerJudLight <= diff) - { - DoCast(me, SPELL_JUDGEMENT_OF_LIGHT); - timerJudLight = urand(10000, 20000); - } - else - timerJudLight -= diff; - } - - if (spellCommand) - { - if (timerCommand <= diff) - { - DoCast(me, SPELL_SEAL_OF_COMMAND); - timerCommand = urand(20000, 40000); - } - else - timerCommand -= diff; - } - - DoMeleeAttackIfReady(); - } - - void Activate(uint64 summonerguid) - { - questPhase = 1; - summonerGuid = summonerguid; - } - - void KilledUnit(Unit* Killed) - { - if (Killed->GetTypeId() == TYPEID_PLAYER) - if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) - CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); - } - - void JustDied(Unit* killer); - }; -}; - -/*###### -## npc_second_trial_controller -######*/ - -class npc_second_trial_controller : public CreatureScript -{ -public: - npc_second_trial_controller() : CreatureScript("npc_second_trial_controller") { } - - bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest) - { - // One Player exclusive quest, wait for user go activation - if (quest->GetQuestId() == QUEST_SECOND_TRIAL) - CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->questPhase = 1; - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - // quest only available if not already started - // Quest_template flag is set to : QUEST_FLAGS_EVENT - // Escort quests or any other event-driven quests. If player in party, all players that can accept this quest will receive confirmation box to accept quest. - // !not sure if this really works! - - if (CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->questPhase == 0) - { - player->PrepareQuestMenu(creature->GetGUID()); - player->SendPreparedQuest(creature->GetGUID()); - } - - player->SEND_GOSSIP_MENU(creature->GetEntry(), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new master_kelerun_bloodmournAI (creature); - } - - struct master_kelerun_bloodmournAI : public ScriptedAI - { - master_kelerun_bloodmournAI(Creature* creature) : ScriptedAI(creature) {} - - uint8 questPhase; - uint8 paladinPhase; - uint32 timer; - - uint64 paladinGuid[4]; - - void Reset() - { - questPhase = 0; - timer = 60000; - paladinPhase = 0; - for (uint8 i = 0; i < 4; ++i) - paladinGuid[i] = 0; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - // Quest accepted but object not activated, object despawned (if in sync 1 minute!) - if (questPhase == 1) - { - if (timer <= diff) - Reset(); - else - timer -= diff; - } - // fight the 4 paladin mobs phase - else if (questPhase == 2) - { - if (timer <= diff) - { - if (Creature* paladinSpawn = Unit::GetCreature((*me), paladinGuid[paladinPhase])) - { - CAST_AI(npc_second_trial_paladin::npc_secondTrialAI, paladinSpawn->AI())->Activate(me->GetGUID()); - - switch (paladinPhase) - { - case 0: - Talk(TEXT_SECOND_TRIAL_1); - break; - case 1: - Talk(TEXT_SECOND_TRIAL_2); - break; - case 2: - Talk(TEXT_SECOND_TRIAL_3); - break; - case 3: - Talk(TEXT_SECOND_TRIAL_4); - break; - } - } - else - Reset(); - - questPhase = 4; - timer = OFFSET_NEXT_ATTACK; - } - else - timer -= diff; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void StartEvent() - { - if (questPhase == 1) - { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code - for (uint8 i = 0; i < 4; ++i) - if (Creature* summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000)) - paladinGuid[i] = summoned->GetGUID(); - - timer = OFFSET_NEXT_ATTACK; - questPhase = 2; - } - } - - void SecondTrialKill() - { - if (questPhase > 0) - { - ++paladinPhase; - - if (paladinPhase < 4) - questPhase = 2; - else - Reset(); // Quest Complete, QuestComplete handler is - } - } - - void SummonedCreatureDespawn(Creature* /*c*/) {} - }; -}; - -void npc_second_trial_paladin::npc_secondTrialAI::JustDied(Unit* Killer) -{ - if (Killer->GetTypeId() == TYPEID_PLAYER) - { - if (Creature* summoner = Unit::GetCreature((*me), summonerGuid)) - CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, summoner->AI())->SecondTrialKill(); - - // last kill quest complete for group - if (me->GetEntry() == CHAMPION_SUNSTRIKER) - { - if (Killer->GetTypeId() == TYPEID_PLAYER) - Killer->ToPlayer()->GroupEventHappens(QUEST_SECOND_TRIAL, Killer); - } - } -} - -/*###### -## go_second_trial -######*/ -class go_second_trial : public GameObjectScript -{ -public: - go_second_trial() : GameObjectScript("go_second_trial") { } - - bool OnGossipHello(Player* /*player*/, GameObject* go) - { - // find spawn :: master_kelerun_bloodmourn - if (Creature* creature = go->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) - CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->StartEvent(); - - return true; - } -}; - -/*###### -## npc_apprentice_mirveda -######*/ - -#define QUEST_UNEXPECTED_RESULT 8488 -#define MOB_GHARZUL 15958 -#define MOB_ANGERSHADE 15656 - -class npc_apprentice_mirveda : public CreatureScript -{ -public: - npc_apprentice_mirveda() : CreatureScript("npc_apprentice_mirveda") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) - { - CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->Summon = true; - CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_apprentice_mirvedaAI (creature); - } - - struct npc_apprentice_mirvedaAI : public ScriptedAI - { - npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) {} - - uint32 KillCount; - uint64 PlayerGUID; - bool Summon; - SummonList Summons; - - void Reset() - { - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - Summon = false; - } - - void EnterCombat(Unit* /*who*/){} - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - Summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature* summoned) - { - Summons.Despawn(summoned); - ++KillCount; - } - - void JustDied(Unit* /*killer*/) - { - if (PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - player->FailQuest(QUEST_UNEXPECTED_RESULT); - } - - void UpdateAI(const uint32 /*diff*/) - { - if (KillCount >= 3 && PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - player->CompleteQuest(QUEST_UNEXPECTED_RESULT); - - if (Summon) - { - me->SummonCreature(MOB_GHARZUL, 8745, -7134.32f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); - Summon = false; - } - } - }; -}; - -/*###### -## npc_infused_crystal -######*/ - -enum InfusedCrystal -{ - MOB_ENRAGED_WRAITH = 17086, - EMOTE = 0, - QUEST_POWERING_OUR_DEFENSES = 8490 -}; - -struct Location -{ - float x, y, z; -}; - -static Location SpawnLocations[] = -{ - {8270.68f, -7188.53f, 139.619f}, - {8284.27f, -7187.78f, 139.603f}, - {8297.43f, -7193.53f, 139.603f}, - {8303.5f, -7201.96f, 139.577f}, - {8273.22f, -7241.82f, 139.382f}, - {8254.89f, -7222.12f, 139.603f}, - {8278.51f, -7242.13f, 139.162f}, - {8267.97f, -7239.17f, 139.517f} -}; - -class npc_infused_crystal : public CreatureScript -{ -public: - npc_infused_crystal() : CreatureScript("npc_infused_crystal") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_infused_crystalAI (creature); - } - - struct npc_infused_crystalAI : public Scripted_NoMovementAI - { - npc_infused_crystalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} - - uint32 EndTimer; - uint32 WaveTimer; - bool Completed; - bool Progress; - uint64 PlayerGUID; - - void Reset() - { - EndTimer = 0; - Completed = false; - Progress = false; - PlayerGUID = 0; - WaveTimer = 0; - } - - void MoveInLineOfSight(Unit* who) - { - if (!Progress && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f)) - { - if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE) - { - PlayerGUID = who->GetGUID(); - WaveTimer = 1000; - EndTimer = 60000; - Progress = true; - } - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void JustDied(Unit* /*killer*/) - { - if (PlayerGUID && !Completed) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); - } - - void UpdateAI(const uint32 diff) - { - if (EndTimer < diff && Progress) - { - Talk(EMOTE); - Completed = true; - if (PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - CAST_PLR(player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); - - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - me->RemoveCorpse(); - } else EndTimer -= diff; - - if (WaveTimer < diff && !Completed && Progress) - { - uint32 ran1 = rand()%8; - uint32 ran2 = rand()%8; - uint32 ran3 = rand()%8; - me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); - WaveTimer = 30000; - } else WaveTimer -= diff; - } - }; -}; - -void AddSC_eversong_woods() -{ - new npc_second_trial_controller(); - new npc_second_trial_paladin(); - new go_second_trial(); - new npc_apprentice_mirveda(); - new npc_infused_crystal(); -} diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/ghostlands.cpp deleted file mode 100644 index 9e00ceb2aa5..00000000000 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ /dev/null @@ -1,226 +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: Ghostlands -SD%Complete: 100 -SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber -SDCategory: Ghostlands -EndScriptData */ - -/* ContentData -npc_blood_knight_dawnstar -npc_budd_nedreck -npc_rathis_tomber -npc_ranger_lilatha -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" -#include "WorldSession.h" - -/*###### -## npc_budd_nedreck -######*/ - -#define GOSSIP_HBN "You gave the crew disguises?" - -class npc_budd_nedreck : public CreatureScript -{ -public: - npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 42540, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } -}; - -/*###### -## npc_rathis_tomber -######*/ - -class npc_rathis_tomber : public CreatureScript -{ -public: - npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { } - - 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(9152)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - player->SEND_GOSSIP_MENU(8432, creature->GetGUID()); - }else - player->SEND_GOSSIP_MENU(8431, creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_ranger_lilatha -######*/ - -enum eEnums -{ - SAY_START = 0, - SAY_PROGRESS1 = 1, - SAY_PROGRESS2 = 2, - SAY_PROGRESS3 = 3, - SAY_END1 = 4, - SAY_END2 = 5, - SAY_CAPTAIN_ANSWER = 0, - - QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212, - GO_CAGE = 181152, - NPC_CAPTAIN_HELIOS = 16220, - FACTION_SMOON_E = 1603 -}; - -class npc_ranger_lilatha : public CreatureScript -{ -public: - npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") { } - - struct npc_ranger_lilathaAI : public npc_escortAI - { - npc_ranger_lilathaAI(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); - Talk(SAY_START, player->GetGUID()); - break; - case 5: - Talk(SAY_PROGRESS1, player->GetGUID()); - break; - case 11: - Talk(SAY_PROGRESS2, player->GetGUID()); - me->SetOrientation(4.762841f); - break; - case 18: - { - Talk(SAY_PROGRESS3, player->GetGUID()); - Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); - Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Summ1 && Summ2) - { - Summ1->Attack(me, true); - Summ2->Attack(player, true); - } - me->AI()->AttackStart(Summ1); - } - break; - case 19: - me->SetWalk(false); - break; - case 25: - me->SetWalk(true); - break; - case 30: - if (player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); - break; - case 32: - me->SetOrientation(2.978281f); - Talk(SAY_END1, player->GetGUID()); - break; - case 33: - me->SetOrientation(5.858011f); - Talk(SAY_END2, player->GetGUID()); - Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); - if (CaptainHelios) - CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player->GetGUID()); - break; - } - } - - void Reset() - { - if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) - Cage->SetGoState(GO_STATE_READY); - } - }; - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) - { - creature->setFaction(113); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_ranger_lilathaAI(creature); - } - -}; - -void AddSC_ghostlands() -{ - new npc_budd_nedreck(); - new npc_rathis_tomber(); - new npc_ranger_lilatha(); -} diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/hinterlands.cpp deleted file mode 100644 index ffd31937677..00000000000 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ /dev/null @@ -1,352 +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: Hinterlands -SD%Complete: 100 -SDComment: Quest support: 863, 2742 -SDCategory: The Hinterlands -EndScriptData */ - -/* ContentData -npc_00x09hl -npc_rinji -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_00x09hl -######*/ - -enum eOOX -{ - SAY_OOX_START = 0, - SAY_OOX_AGGRO = 1, - SAY_OOX_AMBUSH = 3, - SAY_OOX_AMBUSH_REPLY = 4, - SAY_OOX_END = 5, - - QUEST_RESQUE_OOX_09 = 836, - - NPC_MARAUDING_OWL = 7808, - NPC_VILE_AMBUSHER = 7809, - - FACTION_ESCORTEE_A = 774, - FACTION_ESCORTEE_H = 775 -}; - -class npc_00x09hl : public CreatureScript -{ -public: - npc_00x09hl() : CreatureScript("npc_00x09hl") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RESQUE_OOX_09) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - - if (player->GetTeam() == ALLIANCE) - creature->setFaction(FACTION_ESCORTEE_A); - else if (player->GetTeam() == HORDE) - creature->setFaction(FACTION_ESCORTEE_H); - - creature->AI()->Talk(SAY_OOX_START, player->GetGUID()); - - if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hl::npc_00x09hlAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_00x09hlAI(creature); - } - - struct npc_00x09hlAI : public npc_escortAI - { - npc_00x09hlAI(Creature* creature) : npc_escortAI(creature) { } - - void Reset() { } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 26: - Talk(SAY_OOX_AMBUSH); - break; - case 43: - Talk(SAY_OOX_AMBUSH); - break; - case 64: - Talk(SAY_OOX_END); - if (Player* player = GetPlayerForEscort()) - player->GroupEventHappens(QUEST_RESQUE_OOX_09, me); - break; - } - } - - void WaypointStart(uint32 uiPointId) - { - switch (uiPointId) - { - case 27: - for (uint8 i = 0; i < 3; ++i) - { - const Position src = {147.927444f, -3851.513428f, 130.893f, 0}; - Position dst; - me->GetRandomPoint(src, 7.0f, dst); - DoSummon(NPC_MARAUDING_OWL, dst, 25000, TEMPSUMMON_CORPSE_TIMED_DESPAWN); - } - break; - case 44: - for (uint8 i = 0; i < 3; ++i) - { - const Position src = {-141.151581f, -4291.213867f, 120.130f, 0}; - Position dst; - me->GetRandomPoint(src, 7.0f, dst); - me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); - } - break; - } - } - - void EnterCombat(Unit* who) - { - if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER) - return; - - Talk(SAY_OOX_AGGRO); - } - - void JustSummoned(Creature* summoned) - { - summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - } - }; -}; - -/*###### -## npc_rinji -######*/ - -enum eRinji -{ - SAY_RIN_BY_OUTRUNNER = 0, - - SAY_RIN_FREE = 0, //from here - SAY_RIN_HELP = 1, - SAY_RIN_COMPLETE = 2, - SAY_RIN_PROGRESS_1 = 3, - SAY_RIN_PROGRESS_2 = 4, - - QUEST_RINJI_TRAPPED = 2742, - NPC_RANGER = 2694, - NPC_OUTRUNNER = 2691, - GO_RINJI_CAGE = 142036 -}; - -struct Location -{ - float m_fX, m_fY, m_fZ; -}; - -Location m_afAmbushSpawn[] = -{ - {191.296204f, -2839.329346f, 107.388f}, - {70.972466f, -2848.674805f, 109.459f} -}; - -Location m_afAmbushMoveTo[] = -{ - {166.630386f, -2824.780273f, 108.153f}, - {70.886589f, -2874.335449f, 116.675f} -}; - -class npc_rinji : public CreatureScript -{ -public: - npc_rinji() : CreatureScript("npc_rinji") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) - { - if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) - go->UseDoorOrButton(); - - if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_rinjiAI(creature); - } - - struct npc_rinjiAI : public npc_escortAI - { - npc_rinjiAI(Creature* creature) : npc_escortAI(creature) - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - } - - bool m_bIsByOutrunner; - uint32 m_uiPostEventCount; - uint32 m_uiPostEventTimer; - int m_iSpawnId; - - void Reset() - { - m_uiPostEventCount = 0; - m_uiPostEventTimer = 3000; - } - - void JustRespawned() - { - m_bIsByOutrunner = false; - m_iSpawnId = 0; - - npc_escortAI::JustRespawned(); - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) - { - if (Creature* talker = who->ToCreature()) - talker->AI()->Talk(SAY_RIN_BY_OUTRUNNER); - m_bIsByOutrunner = true; - } - - if (rand()%4) - return; - - //only if attacked and escorter is not in combat? - Talk(SAY_RIN_HELP); - } - } - - void DoSpawnAmbush(bool bFirst) - { - if (!bFirst) - m_iSpawnId = 1; - - me->SummonCreature(NPC_RANGER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - - for (int i = 0; i < 2; ++i) - { - me->SummonCreature(NPC_OUTRUNNER, - m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, - TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->SetWalk(false); - summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 1: - Talk(SAY_RIN_FREE, player->GetGUID()); - break; - case 7: - DoSpawnAmbush(true); - break; - case 13: - DoSpawnAmbush(false); - break; - case 17: - Talk(SAY_RIN_COMPLETE, player->GetGUID()); - player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); - SetRun(); - m_uiPostEventCount = 1; - break; - } - } - - void UpdateEscortAI(const uint32 uiDiff) - { - //Check if we have a current target - if (!UpdateVictim()) - { - if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount) - { - if (m_uiPostEventTimer <= uiDiff) - { - m_uiPostEventTimer = 3000; - - if (Player* player = GetPlayerForEscort()) - { - switch (m_uiPostEventCount) - { - case 1: - Talk(SAY_RIN_PROGRESS_1, player->GetGUID()); - ++m_uiPostEventCount; - break; - case 2: - Talk(SAY_RIN_PROGRESS_2, player->GetGUID()); - m_uiPostEventCount = 0; - break; - } - } - else - { - me->DespawnOrUnsummon(); - return; - } - } - else - m_uiPostEventTimer -= uiDiff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_hinterlands() -{ - new npc_00x09hl(); - new npc_rinji(); -} diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/ironforge.cpp deleted file mode 100644 index f9e8d4d16c6..00000000000 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ /dev/null @@ -1,99 +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: Ironforge -SD%Complete: 100 -SDComment: Quest support: 3702 -SDCategory: Ironforge -EndScriptData */ - -/* ContentData -npc_royal_historian_archesonus -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npc_royal_historian_archesonus -######*/ - -#define GOSSIP_ITEM_ROYAL "I am ready to listen" -#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" -#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." -#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" -#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" - -class npc_royal_historian_archesonus : public CreatureScript -{ -public: - npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } - - 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_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2236, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2237, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2238, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(2239, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(3702); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - player->SEND_GOSSIP_MENU(2235, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -void AddSC_ironforge() -{ - new npc_royal_historian_archesonus(); -} diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp deleted file mode 100644 index bfd4d24cec6..00000000000 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ /dev/null @@ -1,159 +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: Isle_of_Queldanas -SD%Complete: 100 -SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541 -SDCategory: Isle Of Quel'Danas -EndScriptData */ - -/* ContentData -npc_converted_sentry -npc_greengill_slave -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "Player.h" -#include "Pet.h" -#include "SpellInfo.h" - -/*###### -## npc_converted_sentry -######*/ -enum ConvertedSentry -{ - SAY_CONVERTED = 0, - - SPELL_CONVERT_CREDIT = 45009 -}; - - -class npc_converted_sentry : public CreatureScript -{ -public: - npc_converted_sentry() : CreatureScript("npc_converted_sentry") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_converted_sentryAI (creature); - } - - struct npc_converted_sentryAI : public ScriptedAI - { - npc_converted_sentryAI(Creature* creature) : ScriptedAI(creature) {} - - bool Credit; - uint32 Timer; - - void Reset() - { - Credit = false; - Timer = 2500; - } - - void MoveInLineOfSight(Unit* /*who*/) {} - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (!Credit) - { - if (Timer <= diff) - { - Talk(SAY_CONVERTED); - - DoCast(me, SPELL_CONVERT_CREDIT); - if (me->isPet()) - me->ToPet()->SetDuration(7500); - Credit = true; - } else Timer -= diff; - } - } - }; -}; - -/*###### -## npc_greengill_slave -######*/ - -#define ENRAGE 45111 -#define ORB 45109 -#define QUESTG 11541 -#define DM 25060 - -class npc_greengill_slave : public CreatureScript -{ -public: - npc_greengill_slave() : CreatureScript("npc_greengill_slave") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_greengill_slaveAI(creature); - } - - struct npc_greengill_slaveAI : public ScriptedAI - { - npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) {} - - uint64 PlayerGUID; - - void EnterCombat(Unit* /*who*/){} - - void Reset() - { - PlayerGUID = 0; - } - - void SpellHit(Unit* caster, const SpellInfo* spell) - { - if (!caster) - return; - - if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !me->HasAura(ENRAGE)) - { - PlayerGUID = caster->GetGUID(); - if (PlayerGUID) - { - Player* player = Unit::GetPlayer(*me, PlayerGUID); - if (player && player->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) - DoCast(player, 45110, true); - } - DoCast(me, ENRAGE); - Unit* Myrmidon = me->FindNearestCreature(DM, 70); - if (Myrmidon) - { - me->AddThreat(Myrmidon, 100000.0f); - AttackStart(Myrmidon); - } - } - } - - void UpdateAI(const uint32 /*diff*/) - { - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_isle_of_queldanas() -{ - new npc_converted_sentry(); - new npc_greengill_slave(); -} diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/loch_modan.cpp deleted file mode 100644 index 30f12718d64..00000000000 --- a/src/server/scripts/EasternKingdoms/loch_modan.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: Loch_Modan -SD%Complete: 100 -SDComment: Quest support: 3181 -SDCategory: Loch Modan -EndScriptData */ - -/* ContentData -npc_mountaineer_pebblebitty -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npc_mountaineer_pebblebitty -######*/ - -#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge" - -#define GOSSIP_MP1 "But i need to get there, now open the gate!" -#define GOSSIP_MP2 "Ok, so what is this other way?" -#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable." -#define GOSSIP_MP4 "Yes..." -#define GOSSIP_MP5 "Ok, i'll try to remember that." -#define GOSSIP_MP6 "A key? Ok!" - -class npc_mountaineer_pebblebitty : public CreatureScript -{ -public: - npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } - - 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_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(1833, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(1834, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); - player->SEND_GOSSIP_MENU(1835, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); - player->SEND_GOSSIP_MENU(1836, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); - player->SEND_GOSSIP_MENU(1837, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); - player->SEND_GOSSIP_MENU(1838, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->CLOSE_GOSSIP_MENU(); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (!player->GetQuestRewardStatus(3181) == 1) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -void AddSC_loch_modan() -{ - new npc_mountaineer_pebblebitty(); -} diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/redridge_mountains.cpp deleted file mode 100644 index 5ff95f83f25..00000000000 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ /dev/null @@ -1,173 +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 . - */ - -/* Script Data Start -SDName: Redridge Mountains -SD%Complete: 100% -SDComment: Support for quest 219. -Script Data End */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -enum eCorporalKeeshan -{ - QUEST_MISSING_IN_ACTION = 219, - - SAY_CORPORAL_1 = 0, - SAY_CORPORAL_2 = 1, - SAY_CORPORAL_3 = 2, - SAY_CORPORAL_4 = 3, - SAY_CORPORAL_5 = 4, - - SPELL_MOCKING_BLOW = 21008, - SPELL_SHIELD_BASH = 11972, -}; - -class npc_corporal_keeshan : public CreatureScript -{ -public: - npc_corporal_keeshan() : CreatureScript("npc_corporal_keeshan") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) - { - CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest); - creature->AI()->Talk(SAY_CORPORAL_1); - } - - return false; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_corporal_keeshanAI(creature); - } - - struct npc_corporal_keeshanAI : public npc_escortAI - { - npc_corporal_keeshanAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiPhase; - uint32 uiTimer; - uint32 uiMockingBlowTimer; - uint32 uiShieldBashTimer; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - uiMockingBlowTimer = 5000; - uiShieldBashTimer = 8000; - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) - me->SetWalk(false); - - switch (waypointId) - { - case 39: - SetEscortPaused(true); - uiTimer = 2000; - uiPhase = 1; - break; - case 65: - me->SetWalk(false); - break; - case 115: - player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); - uiTimer = 2000; - uiPhase = 4; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (HasEscortState(STATE_ESCORT_NONE)) - return; - - npc_escortAI::UpdateAI(uiDiff); - - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - me->SetStandState(UNIT_STAND_STATE_SIT); - uiTimer = 1000; - uiPhase = 2; - break; - case 2: - Talk(SAY_CORPORAL_2); - uiTimer = 15000; - uiPhase = 3; - break; - case 3: - Talk(SAY_CORPORAL_3); - me->SetStandState(UNIT_STAND_STATE_STAND); - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 4: - Talk(SAY_CORPORAL_4); - uiTimer = 2500; - uiPhase = 5; - case 5: - Talk(SAY_CORPORAL_5); - uiTimer = 0; - uiPhase = 0; - } - } else uiTimer -= uiDiff; - } - - if (!UpdateVictim()) - return; - - if (uiMockingBlowTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MOCKING_BLOW); - uiMockingBlowTimer = 5000; - } else uiMockingBlowTimer -= uiDiff; - - if (uiShieldBashTimer <= uiDiff) - { - DoCast(me->getVictim(), SPELL_MOCKING_BLOW); - uiShieldBashTimer = 8000; - } else uiShieldBashTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_redridge_mountains() -{ - new npc_corporal_keeshan(); -} diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/silvermoon_city.cpp deleted file mode 100644 index e750faefbf5..00000000000 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ /dev/null @@ -1,111 +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: Silvermoon_City -SD%Complete: 100 -SDComment: Quest support: 9685 -SDCategory: Silvermoon City -EndScriptData */ - -/* ContentData -npc_blood_knight_stillblade -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "Player.h" -#include "SpellInfo.h" - -/*####### -# npc_blood_knight_stillblade -#######*/ -enum eStillbladeData -{ - SAY_HEAL = 0, - - QUEST_REDEEMING_THE_DEAD = 9685, - SPELL_SHIMMERING_VESSEL = 31225, - SPELL_REVIVE_SELF = 32343, -}; - -class npc_blood_knight_stillblade : public CreatureScript -{ -public: - npc_blood_knight_stillblade() : CreatureScript("npc_blood_knight_stillblade") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_blood_knight_stillbladeAI (creature); - } - - struct npc_blood_knight_stillbladeAI : public ScriptedAI - { - npc_blood_knight_stillbladeAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 lifeTimer; - bool spellHit; - - void Reset() - { - lifeTimer = 120000; - me->SetStandState(UNIT_STAND_STATE_DEAD); - me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7); // lay down - spellHit = false; - } - - void EnterCombat(Unit* /*who*/) - { - } - - void MoveInLineOfSight(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (me->IsStandState()) - { - if (lifeTimer <= diff) - me->AI()->EnterEvadeMode(); - else - lifeTimer -= diff; - } - } - - void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) - { - if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && - (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) - { - CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); - DoCast(me, SPELL_REVIVE_SELF); - me->SetStandState(UNIT_STAND_STATE_STAND); - me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); - //me->RemoveAllAuras(); - Talk(SAY_HEAL); - spellHit = true; - } - } - }; -}; - -void AddSC_silvermoon_city() -{ - new npc_blood_knight_stillblade(); -} diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/silverpine_forest.cpp deleted file mode 100644 index 290f7fa6882..00000000000 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.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: Silverpine_Forest -SD%Complete: 100 -SDComment: Quest support: 435, 452 -SDCategory: Silverpine Forest -EndScriptData */ - -/* ContentData -npc_deathstalker_erland -pyrewood_ambush -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_deathstalker_erland -######*/ - -enum eErland -{ - SAY_QUESTACCEPT = 0, - SAY_START = 1, - SAY_AGGRO = 2, - SAY_PROGRESS = 3, - SAY_LAST = 4, - - SAY_RANE = 0, - SAY_RANE_ANSWER = 5, - SAY_MOVE_QUINN = 6, - - SAY_QUINN = 7, - SAY_QUINN_ANSWER = 0, - SAY_BYE = 8, - - QUEST_ESCORTING = 435, - NPC_RANE = 1950, - NPC_QUINN = 1951 -}; - -class npc_deathstalker_erland : public CreatureScript -{ -public: - npc_deathstalker_erland() : CreatureScript("npc_deathstalker_erland") { } - - struct npc_deathstalker_erlandAI : public npc_escortAI - { - npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 1: - Talk(SAY_START, player->GetGUID()); - break; - case 10: - Talk(SAY_PROGRESS); - break; - case 13: - Talk(SAY_LAST, player->GetGUID()); - player->GroupEventHappens(QUEST_ESCORTING, me); - break; - case 15: - if (Creature* rane = me->FindNearestCreature(NPC_RANE, 20.0f)) - rane->AI()->Talk(SAY_RANE); - break; - case 16: - Talk(SAY_RANE_ANSWER); - break; - case 17: - Talk(SAY_MOVE_QUINN); - break; - case 24: - Talk(SAY_QUINN); - break; - case 25: - if (Creature* quinn = me->FindNearestCreature(NPC_QUINN, 20.0f)) - quinn->AI()->Talk(SAY_QUINN_ANSWER); - break; - case 26: - Talk(SAY_BYE); - break; - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - Talk(SAY_AGGRO, who->GetGUID()); - } - }; - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_ESCORTING) - { - creature->AI()->Talk(SAY_QUESTACCEPT, player->GetGUID()); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI())) - pEscortAI->Start(true, false, player->GetGUID()); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_deathstalker_erlandAI(creature); - } -}; - -/*###### -## pyrewood_ambush -#######*/ - -#define QUEST_PYREWOOD_AMBUSH 452 - -#define NPCSAY_INIT "Get ready, they'll be arriving any minute..." //not blizzlike -#define NPCSAY_END "Thanks for your help!" //not blizzlike - -static float PyrewoodSpawnPoints[3][4] = -{ - //pos_x pos_y pos_z orien - //outside - /* - {-400.85f, 1513.64f, 18.67f, 0}, - {-397.32f, 1514.12f, 18.67f, 0}, - {-397.44f, 1511.09f, 18.67f, 0}, - */ - //door - {-396.17f, 1505.86f, 19.77f, 0}, - {-396.91f, 1505.77f, 19.77f, 0}, - {-397.94f, 1504.74f, 19.77f, 0}, -}; - -#define WAIT_SECS 6000 - -class pyrewood_ambush : public CreatureScript -{ -public: - pyrewood_ambush() : CreatureScript("pyrewood_ambush") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest *quest) - { - if (quest->GetQuestId() == QUEST_PYREWOOD_AMBUSH && !CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress) - { - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress = true; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->Phase = 0; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->KillCount = 0; - CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->PlayerGUID = player->GetGUID(); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new pyrewood_ambushAI (creature); - } - - struct pyrewood_ambushAI : public ScriptedAI - { - pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) - { - QuestInProgress = false; - } - - uint32 Phase; - int8 KillCount; - uint32 WaitTimer; - uint64 PlayerGUID; - SummonList Summons; - - bool QuestInProgress; - - void Reset() - { - WaitTimer = WAIT_SECS; - - if (!QuestInProgress) //fix reset values (see UpdateVictim) - { - Phase = 0; - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - } - } - - void EnterCombat(Unit* /*who*/){} - - void JustSummoned(Creature* summoned) - { - Summons.Summon(summoned); - ++KillCount; - } - - void SummonedCreatureDespawn(Creature* summoned) - { - Summons.Despawn(summoned); - --KillCount; - } - - void SummonCreatureWithRandomTarget(uint32 creatureId, int position) - { - if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) - { - Unit* target = NULL; - if (PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - if (player->isAlive() && RAND(0, 1)) - target = player; - - if (!target) - target = me; - - summoned->setFaction(168); - summoned->AddThreat(target, 32.0f); - summoned->AI()->AttackStart(target); - } - } - - void JustDied(Unit* /*killer*/) - { - if (PlayerGUID) - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - if (player->GetQuestStatus(QUEST_PYREWOOD_AMBUSH) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(QUEST_PYREWOOD_AMBUSH); - } - - void UpdateAI(const uint32 diff) - { - //sLog->outInfo(LOG_FILTER_TSCR, "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); - - if (!QuestInProgress) - return; - - if (KillCount && Phase < 6) - { - if (!UpdateVictim()) //reset() on target Despawn... - return; - - DoMeleeAttackIfReady(); - return; - } - - switch (Phase) - { - case 0: - if (WaitTimer == WAIT_SECS) - me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike - - if (WaitTimer <= diff) - { - WaitTimer -= diff; - return; - } - break; - case 1: - SummonCreatureWithRandomTarget(2060, 1); - break; - case 2: - SummonCreatureWithRandomTarget(2061, 2); - SummonCreatureWithRandomTarget(2062, 0); - break; - case 3: - SummonCreatureWithRandomTarget(2063, 1); - SummonCreatureWithRandomTarget(2064, 2); - SummonCreatureWithRandomTarget(2065, 0); - break; - case 4: - SummonCreatureWithRandomTarget(2066, 1); - SummonCreatureWithRandomTarget(2067, 0); - SummonCreatureWithRandomTarget(2068, 2); - break; - case 5: //end - if (PlayerGUID) - { - if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) - { - me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike - player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); - } - } - QuestInProgress = false; - Reset(); - break; - } - ++Phase; //prepare next phase - } - }; -}; - -/*###### -## AddSC -######*/ - -void AddSC_silverpine_forest() -{ - new npc_deathstalker_erland(); - new pyrewood_ambush(); -} diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/stormwind_city.cpp deleted file mode 100644 index e81567a1a7a..00000000000 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ /dev/null @@ -1,647 +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: Stormwind_City -SD%Complete: 100 -SDComment: Quest support: 1640, 1447, 4185, 11223, 434. -SDCategory: Stormwind City -EndScriptData */ - -/* ContentData -npc_archmage_malin -npc_bartleby -npc_lady_katrana_prestor -npc_tyrion -npc_tyrion_spybot -npc_marzon_silent_blade -npc_lord_gregor_lescovar -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_archmage_malin -######*/ - -#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." - -class npc_archmage_malin : public CreatureScript -{ -public: - npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF) - { - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 42711, true); - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_bartleby -######*/ - -enum eBartleby -{ - FACTION_ENEMY = 168, - QUEST_BEAT = 1640 -}; - -class npc_bartleby : public CreatureScript -{ -public: - npc_bartleby() : CreatureScript("npc_bartleby") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_BEAT) - { - creature->setFaction(FACTION_ENEMY); - creature->AI()->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_bartlebyAI(creature); - } - - struct npc_bartlebyAI : public ScriptedAI - { - npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) - { - m_uiNormalFaction = creature->getFaction(); - } - - uint32 m_uiNormalFaction; - - void Reset() - { - if (me->getFaction() != m_uiNormalFaction) - me->setFaction(m_uiNormalFaction); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - //Take 0 damage - uiDamage = 0; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); - EnterEvadeMode(); - } - } - }; -}; - -/*###### -## npc_lady_katrana_prestor -######*/ - -#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." -#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." -#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." -#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." - -class npc_lady_katrana_prestor : public CreatureScript -{ -public: - npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } - - 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_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(2694, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - player->SEND_GOSSIP_MENU(2695, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2696, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4185); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - player->SEND_GOSSIP_MENU(2693, creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_lord_gregor_lescovar -######*/ - -enum eLordGregorLescovar -{ - SAY_GUARD_2 = 0, - SAY_LESCOVAR_2 = 0, - SAY_LESCOVAR_3 = 1, - SAY_LESCOVAR_4 = 2, - SAY_MARZON_1 = 0, - SAY_MARZON_2 = 1, - SAY_TYRION_2 = 1, - - NPC_STORMWIND_ROYAL = 1756, - NPC_MARZON_BLADE = 1755, - NPC_TYRION = 7766, - - QUEST_THE_ATTACK = 434 -}; - -class npc_lord_gregor_lescovar : public CreatureScript -{ -public: - npc_lord_gregor_lescovar() : CreatureScript("npc_lord_gregor_lescovar") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lord_gregor_lescovarAI(creature); - } - - struct npc_lord_gregor_lescovarAI : public npc_escortAI - { - npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature) - { - creature->RestoreFaction(); - } - - uint32 uiTimer; - uint32 uiPhase; - - uint64 MarzonGUID; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - - MarzonGUID = 0; - } - - void EnterEvadeMode() - { - me->DisappearAndDie(); - - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - { - if (pMarzon->isAlive()) - pMarzon->DisappearAndDie(); - } - } - - void EnterCombat(Unit* who) - { - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - { - if (pMarzon->isAlive() && !pMarzon->isInCombat()) - pMarzon->AI()->AttackStart(who); - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 14: - SetEscortPaused(true); - Talk(SAY_LESCOVAR_2); - uiTimer = 3000; - uiPhase = 1; - break; - case 16: - SetEscortPaused(true); - if (Creature* pMarzon = me->SummonCreature(NPC_MARZON_BLADE, -8411.360352f, 480.069733f, 123.760895f, 4.941504f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) - { - pMarzon->GetMotionMaster()->MovePoint(0, -8408.000977f, 468.611450f, 123.759903f); - MarzonGUID = pMarzon->GetGUID(); - } - uiTimer = 2000; - uiPhase = 4; - break; - } - } - //TO-DO: We don't have movemaps, also we can't make 2 npcs walks to one point propperly (and we can not use escort ai, because they are 2 different spawns and with same entry), because of it we make them, disappear. - void DoGuardsDisappearAndDie() - { - std::list GuardList; - me->GetCreatureListWithEntryInGrid(GuardList, NPC_STORMWIND_ROYAL, 8.0f); - if (!GuardList.empty()) - { - for (std::list::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr) - { - if (Creature* pGuard = *itr) - pGuard->DisappearAndDie(); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) - pGuard->AI()->Talk(SAY_GUARD_2); - uiTimer = 3000; - uiPhase = 2; - break; - case 2: - DoGuardsDisappearAndDie(); - uiTimer = 2000; - uiPhase = 3; - break; - case 3: - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 4: - Talk(SAY_LESCOVAR_3); - uiTimer = 0; - uiPhase = 0; - break; - case 5: - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - pMarzon->AI()->Talk(SAY_MARZON_1); - uiTimer = 3000; - uiPhase = 6; - break; - case 6: - Talk(SAY_LESCOVAR_4); - if (Player* player = GetPlayerForEscort()) - player->AreaExploredOrEventHappens(QUEST_THE_ATTACK); - uiTimer = 2000; - uiPhase = 7; - break; - case 7: - if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) - pTyrion->AI()->Talk(SAY_TYRION_2); - if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) - pMarzon->setFaction(14); - me->setFaction(14); - uiTimer = 0; - uiPhase = 0; - break; - } - } else uiTimer -= uiDiff; - } - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_marzon_silent_blade -######*/ - -class npc_marzon_silent_blade : public CreatureScript -{ -public: - npc_marzon_silent_blade() : CreatureScript("npc_marzon_silent_blade") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_marzon_silent_bladeAI(creature); - } - - struct npc_marzon_silent_bladeAI : public ScriptedAI - { - npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) - { - me->SetWalk(true); - } - - void Reset() - { - me->RestoreFaction(); - } - - void EnterCombat(Unit* who) - { - Talk(SAY_MARZON_2); - - if (me->isSummon()) - { - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) - summoner->ToCreature()->AI()->AttackStart(who); - } - } - } - - void EnterEvadeMode() - { - me->DisappearAndDie(); - - if (me->isSummon()) - { - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) - summoner->ToCreature()->DisappearAndDie(); - } - } - } - - void MovementInform(uint32 uiType, uint32 /*uiId*/) - { - if (uiType != POINT_MOTION_TYPE) - return; - - if (me->isSummon()) - { - Unit* summoner = me->ToTempSummon()->GetSummoner(); - if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled) - { - npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai = - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, summoner->GetAI()); - if (ai) - { - ai->uiTimer = 2000; - ai->uiPhase = 5; - } - //me->ChangeOrient(0.0f, summoner); - } - } - } - - void UpdateAI(const uint32 /*diff*/) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_tyrion_spybot -######*/ - -enum eTyrionSpybot -{ - SAY_QUEST_ACCEPT_ATTACK = 0, - SAY_SPYBOT_1 = 1, - SAY_SPYBOT_2 = 2, - SAY_SPYBOT_3 = 3, - SAY_SPYBOT_4 = 4, - SAY_TYRION_1 = 0, - SAY_GUARD_1 = 1, - SAY_LESCOVAR_1 = 3, - - NPC_PRIESTESS_TYRIONA = 7779, - NPC_LORD_GREGOR_LESCOVAR = 1754, -}; - -class npc_tyrion_spybot : public CreatureScript -{ -public: - npc_tyrion_spybot() : CreatureScript("npc_tyrion_spybot") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tyrion_spybotAI(creature); - } - - struct npc_tyrion_spybotAI : public npc_escortAI - { - npc_tyrion_spybotAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiTimer; - uint32 uiPhase; - - void Reset() - { - uiTimer = 0; - uiPhase = 0; - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 1: - SetEscortPaused(true); - uiTimer = 2000; - uiPhase = 1; - break; - case 5: - SetEscortPaused(true); - Talk(SAY_SPYBOT_1); - uiTimer = 2000; - uiPhase = 5; - break; - case 17: - SetEscortPaused(true); - Talk(SAY_SPYBOT_3); - uiTimer = 3000; - uiPhase = 8; - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (uiPhase) - { - if (uiTimer <= uiDiff) - { - switch (uiPhase) - { - case 1: - Talk(SAY_QUEST_ACCEPT_ATTACK); - uiTimer = 3000; - uiPhase = 2; - break; - case 2: - if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 10.0f)) - pTyrion->AI()->Talk(SAY_TYRION_1); - uiTimer = 3000; - uiPhase = 3; - break; - case 3: - me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE); - uiTimer = 2000; - uiPhase = 4; - break; - case 4: - SetEscortPaused(false); - uiPhase = 0; - uiTimer = 0; - break; - case 5: - if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true)) - pGuard->AI()->Talk(SAY_GUARD_1); - uiTimer = 3000; - uiPhase = 6; - break; - case 6: - Talk(SAY_SPYBOT_2); - uiTimer = 3000; - uiPhase = 7; - break; - case 7: - SetEscortPaused(false); - uiTimer = 0; - uiPhase = 0; - break; - case 8: - if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) - pLescovar->AI()->Talk(SAY_LESCOVAR_1); - uiTimer = 3000; - uiPhase = 9; - break; - case 9: - Talk(SAY_SPYBOT_4); - uiTimer = 3000; - uiPhase = 10; - break; - case 10: - if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) - { - if (Player* player = GetPlayerForEscort()) - { - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, false, player->GetGUID()); - CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); - } - } - me->DisappearAndDie(); - uiTimer = 0; - uiPhase = 0; - break; - } - } else uiTimer -= uiDiff; - } - npc_escortAI::UpdateAI(uiDiff); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_tyrion -######*/ - -enum eTyrion -{ - NPC_TYRION_SPYBOT = 8856 -}; - -class npc_tyrion : public CreatureScript -{ -public: - npc_tyrion() : CreatureScript("npc_tyrion") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_THE_ATTACK) - { - if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true)) - { - CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID()); - CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f); - } - return true; - } - return false; - } -}; - -void AddSC_stormwind_city() -{ - new npc_archmage_malin(); - new npc_bartleby(); - new npc_lady_katrana_prestor(); - new npc_tyrion(); - new npc_tyrion_spybot(); - new npc_lord_gregor_lescovar(); - new npc_marzon_silent_blade(); -} diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp deleted file mode 100644 index 6e14ef840a3..00000000000 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ /dev/null @@ -1,129 +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: Stranglethorn_Vale -SD%Complete: 100 -SDComment: Quest support: 592 -SDCategory: Stranglethorn Vale -EndScriptData */ - -/* ContentData -mob_yenniku -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "Player.h" -#include "SpellInfo.h" - -/*###### -## mob_yenniku -######*/ - -class mob_yenniku : public CreatureScript -{ -public: - mob_yenniku() : CreatureScript("mob_yenniku") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new mob_yennikuAI (creature); - } - - struct mob_yennikuAI : public ScriptedAI - { - mob_yennikuAI(Creature* creature) : ScriptedAI(creature) - { - bReset = false; - } - - uint32 Reset_Timer; - bool bReset; - - void Reset() - { - Reset_Timer = 0; - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - } - - void SpellHit(Unit* caster, const SpellInfo* spell) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - //Yenniku's Release - if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) - { - me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - me->CombatStop(); //stop combat - me->DeleteThreatList(); //unsure of this - me->setFaction(83); //horde generic - - bReset = true; - Reset_Timer = 60000; - } - } - return; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (bReset) - { - if (Reset_Timer <= diff) - { - EnterEvadeMode(); - bReset = false; - me->setFaction(28); //troll, bloodscalp - return; - } - else Reset_Timer -= diff; - - if (me->isInCombat() && me->getVictim()) - { - if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) - { - Unit* victim = me->getVictim(); - if (CAST_PLR(victim)->GetTeam() == HORDE) - { - me->CombatStop(); - me->DeleteThreatList(); - } - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## -######*/ - -void AddSC_stranglethorn_vale() -{ - new mob_yenniku(); -} diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp deleted file mode 100644 index f686de5d88f..00000000000 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ /dev/null @@ -1,155 +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 . - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_galen_goodward -######*/ - -enum Galen -{ - QUEST_GALENS_ESCAPE = 1393, - - GO_GALENS_CAGE = 37118, - - SAY_PERIODIC = 0, - SAY_QUEST_ACCEPTED = 1, - SAY_ATTACKED = 2, - SAY_QUEST_COMPLETE = 3, - EMOTE_WHISPER = 4, - EMOTE_DISAPPEAR = 5, -}; - -class npc_galen_goodward : public CreatureScript -{ -public: - - npc_galen_goodward() : CreatureScript("npc_galen_goodward") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_GALENS_ESCAPE) - { - CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, creature->AI())->Start(false, false, player->GetGUID()); - creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); - creature->AI()->Talk(SAY_QUEST_ACCEPTED); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_galen_goodwardAI(creature); - } - - struct npc_galen_goodwardAI : public npc_escortAI - { - npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature) - { - m_uiGalensCageGUID = 0; - Reset(); - } - - uint64 m_uiGalensCageGUID; - uint32 m_uiPeriodicSay; - - void Reset() - { - m_uiPeriodicSay = 6000; - } - - void EnterCombat(Unit* who) - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - Talk(SAY_ATTACKED, who->GetGUID()); - } - - void WaypointStart(uint32 uiPointId) - { - switch (uiPointId) - { - case 0: - { - GameObject* pCage = NULL; - if (m_uiGalensCageGUID) - pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID); - else - pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE); - if (pCage) - { - pCage->UseDoorOrButton(); - m_uiGalensCageGUID = pCage->GetGUID(); - } - break; - } - case 21: - Talk(EMOTE_DISAPPEAR); - break; - } - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 0: - if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) - pCage->ResetDoorOrButton(); - break; - case 20: - if (Player* player = GetPlayerForEscort()) - { - me->SetFacingToObject(player); - Talk(SAY_QUEST_COMPLETE, player->GetGUID()); - Talk(EMOTE_WHISPER, player->GetGUID()); - player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); - } - SetRun(true); - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - - if (HasEscortState(STATE_ESCORT_NONE)) - return; - - if (m_uiPeriodicSay < uiDiff) - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - Talk(SAY_PERIODIC); - m_uiPeriodicSay = 15000; - } - else - m_uiPeriodicSay -= uiDiff; - - DoMeleeAttackIfReady(); - } - }; -}; - -void AddSC_swamp_of_sorrows() -{ - new npc_galen_goodward(); -} diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp deleted file mode 100644 index f36220dec0f..00000000000 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ /dev/null @@ -1,217 +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: Tirisfal_Glades -SD%Complete: 100 -SDComment: Quest support: 590, 1819 -SDCategory: Tirisfal Glades -EndScriptData */ - -/* ContentData -npc_calvin_montague -go_mausoleum_door -go_mausoleum_trigger -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "Player.h" - -/*###### -## npc_calvin_montague -######*/ - -enum Calvin -{ - SAY_COMPLETE = 0, - SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) - QUEST_590 = 590, - FACTION_HOSTILE = 168 -}; - -class npc_calvin_montague : public CreatureScript -{ -public: - npc_calvin_montague() : CreatureScript("npc_calvin_montague") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_590) - { - creature->setFaction(FACTION_HOSTILE); - creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_calvin_montagueAI (creature); - } - - struct npc_calvin_montagueAI : public ScriptedAI - { - npc_calvin_montagueAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 m_uiPhase; - uint32 m_uiPhaseTimer; - uint64 m_uiPlayerGUID; - - void Reset() - { - m_uiPhase = 0; - m_uiPhaseTimer = 5000; - m_uiPlayerGUID = 0; - - me->RestoreFaction(); - - if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - } - - void EnterCombat(Unit* /*who*/) {} - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim() || me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) - { - uiDamage = 0; - - me->RestoreFaction(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->CombatStop(true); - - m_uiPhase = 1; - - if (pDoneBy->GetTypeId() == TYPEID_PLAYER) - m_uiPlayerGUID = pDoneBy->GetGUID(); - } - } - - void UpdateAI(uint32 const diff) - { - if (m_uiPhase) - { - if (m_uiPhaseTimer <= diff) - m_uiPhaseTimer = 7500; - else - { - m_uiPhaseTimer -= diff; - return; - } - - switch (m_uiPhase) - { - case 1: - Talk(SAY_COMPLETE); - ++m_uiPhase; - break; - case 2: - if (Player* player = Unit::GetPlayer(*me, m_uiPlayerGUID)) - player->AreaExploredOrEventHappens(QUEST_590); - - DoCast(me, SPELL_DRINK, true); - ++m_uiPhase; - break; - case 3: - EnterEvadeMode(); - break; - } - - return; - } - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## go_mausoleum_door -## go_mausoleum_trigger -######*/ - -enum eMausoleum -{ - QUEST_ULAG = 1819, - NPC_ULAG = 6390, - GO_TRIGGER = 104593, - GO_DOOR = 176594 -}; - -class go_mausoleum_door : public GameObjectScript -{ -public: - go_mausoleum_door() : GameObjectScript("go_mausoleum_door") { } - - bool OnGossipHello(Player* player, GameObject* /*go*/) - { - if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pTrigger = player->FindNearestGameObject(GO_TRIGGER, 30.0f)) - { - pTrigger->SetGoState(GO_STATE_READY); - player->SummonCreature(NPC_ULAG, 2390.26f, 336.47f, 40.01f, 2.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); - return false; - } - - return false; - } -}; - -class go_mausoleum_trigger : public GameObjectScript -{ -public: - go_mausoleum_trigger() : GameObjectScript("go_mausoleum_trigger") { } - - bool OnGossipHello(Player* player, GameObject* go) - { - if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) - return false; - - if (GameObject* pDoor = player->FindNearestGameObject(GO_DOOR, 30.0f)) - { - go->SetGoState(GO_STATE_ACTIVE); - pDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); - return true; - } - - return false; - } -}; - -void AddSC_tirisfal_glades() -{ - new npc_calvin_montague(); - new go_mausoleum_door(); - new go_mausoleum_trigger(); -} diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/undercity.cpp deleted file mode 100644 index 2c3017a2f1a..00000000000 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ /dev/null @@ -1,334 +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: Undercity -SD%Complete: 95 -SDComment: Quest support: 6628, 9180(post-event). -SDCategory: Undercity -EndScriptData */ - -/* ContentData -npc_lady_sylvanas_windrunner -npc_highborne_lamenter -npc_parqual_fintallas -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" - -/*###### -## npc_lady_sylvanas_windrunner -######*/ - -enum Sylvanas -{ - QUEST_JOURNEY_TO_UNDERCITY = 9180, - EMOTE_LAMENT_END = 0, - SAY_LAMENT_END = 1, - - SOUND_CREDIT = 10896, - ENTRY_HIGHBORNE_LAMENTER = 21628, - ENTRY_HIGHBORNE_BUNNY = 21641, - - SPELL_HIGHBORNE_AURA = 37090, - SPELL_SYLVANAS_CAST = 36568, - SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099 - - // Combat spells - SPELL_BLACK_ARROW = 59712, - SPELL_FADE = 20672, - SPELL_FADE_BLINK = 29211, - SPELL_MULTI_SHOT = 59713, - SPELL_SHOT = 59710, - SPELL_SUMMON_SKELETON = 59711 -}; - -float HighborneLoc[4][3]= -{ - {1285.41f, 312.47f, 0.51f}, - {1286.96f, 310.40f, 1.00f}, - {1289.66f, 309.66f, 1.52f}, - {1292.51f, 310.50f, 1.99f}, -}; - -#define HIGHBORNE_LOC_Y -61.00f -#define HIGHBORNE_LOC_Y_NEW -55.50f - -class npc_lady_sylvanas_windrunner : public CreatureScript -{ -public: - npc_lady_sylvanas_windrunner() : CreatureScript("npc_lady_sylvanas_windrunner") { } - - bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest *_Quest, uint32 /*slot*/) - { - if (_Quest->GetQuestId() == QUEST_JOURNEY_TO_UNDERCITY) - { - CAST_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->LamentEvent = true; - CAST_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->DoPlaySoundToSet(creature, SOUND_CREDIT); - creature->CastSpell(creature, SPELL_SYLVANAS_CAST, false); - - for (uint8 i = 0; i < 4; ++i) - creature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_lady_sylvanas_windrunnerAI (creature); - } - - struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI - { - npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 LamentEventTimer; - bool LamentEvent; - uint64 targetGUID; - - uint32 FadeTimer; - uint32 SummonSkeletonTimer; - uint32 BlackArrowTimer; - uint32 ShotTimer; - uint32 MultiShotTimer; - - void Reset() - { - LamentEventTimer = 5000; - LamentEvent = false; - targetGUID = 0; - - FadeTimer = 30000; - SummonSkeletonTimer = 20000; - BlackArrowTimer = 15000; - ShotTimer = 8000; - MultiShotTimer = 10000; - } - - void EnterCombat(Unit* /*who*/) {} - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) - { - if (Creature* target = Unit::GetCreature(*summoned, targetGUID)) - { - target->MonsterMoveWithSpeed(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0); - target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); - summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); - } - - summoned->SetDisableGravity(true); - targetGUID = summoned->GetGUID(); - } - } - - void UpdateAI(const uint32 diff) - { - if (LamentEvent) - { - if (LamentEventTimer <= diff) - { - DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); - - LamentEventTimer = 2000; - if (!me->HasAura(SPELL_SYLVANAS_CAST)) - { - Talk(SAY_LAMENT_END); - Talk(EMOTE_LAMENT_END); - LamentEvent = false; - } - } else LamentEventTimer -= diff; - } - - if (!UpdateVictim()) - return; - - // Combat spells - - if (FadeTimer <= diff) - { - DoCast(me, SPELL_FADE); - // add a blink to simulate a stealthed movement and reappearing elsewhere - DoCast(me, SPELL_FADE_BLINK); - FadeTimer = 30000 + rand()%5000; - // if the victim is out of melee range she cast multi shot - if (Unit* victim = me->getVictim()) - if (me->GetDistance(victim) > 10.0f) - DoCast(victim, SPELL_MULTI_SHOT); - } else FadeTimer -= diff; - - if (SummonSkeletonTimer <= diff) - { - DoCast(me, SPELL_SUMMON_SKELETON); - SummonSkeletonTimer = 20000 + rand()%10000; - } else SummonSkeletonTimer -= diff; - - if (BlackArrowTimer <= diff) - { - if (Unit* victim = me->getVictim()) - { - DoCast(victim, SPELL_BLACK_ARROW); - BlackArrowTimer = 15000 + rand()%5000; - } - } else BlackArrowTimer -= diff; - - if (ShotTimer <= diff) - { - if (Unit* victim = me->getVictim()) - { - DoCast(victim, SPELL_SHOT); - ShotTimer = 8000 + rand()%2000; - } - } else ShotTimer -= diff; - - if (MultiShotTimer <= diff) - { - if (Unit* victim = me->getVictim()) - { - DoCast(victim, SPELL_MULTI_SHOT); - MultiShotTimer = 10000 + rand()%3000; - } - } else MultiShotTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; -}; - -/*###### -## npc_highborne_lamenter -######*/ - -class npc_highborne_lamenter : public CreatureScript -{ -public: - npc_highborne_lamenter() : CreatureScript("npc_highborne_lamenter") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_highborne_lamenterAI (creature); - } - - struct npc_highborne_lamenterAI : public ScriptedAI - { - npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 EventMoveTimer; - uint32 EventCastTimer; - bool EventMove; - bool EventCast; - - void Reset() - { - EventMoveTimer = 10000; - EventCastTimer = 17500; - EventMove = true; - EventCast = true; - } - - void EnterCombat(Unit* /*who*/) {} - - void UpdateAI(const uint32 diff) - { - if (EventMove) - { - if (EventMoveTimer <= diff) - { - me->SetDisableGravity(true); - me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); - me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); - EventMove = false; - } else EventMoveTimer -= diff; - } - if (EventCast) - { - if (EventCastTimer <= diff) - { - DoCast(me, SPELL_HIGHBORNE_AURA); - EventCast = false; - } else EventCastTimer -= diff; - } - } - }; -}; - -/*###### -## npc_parqual_fintallas -######*/ - -#define SPELL_MARK_OF_SHAME 6767 - -#define GOSSIP_HPF1 "Gul'dan" -#define GOSSIP_HPF2 "Kel'Thuzad" -#define GOSSIP_HPF3 "Ner'zhul" - -class npc_parqual_fintallas : public CreatureScript -{ -public: - npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { } - - 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_MARK_OF_SHAME, false); - } - if (action == GOSSIP_ACTION_INFO_DEF+2) - { - player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(6628); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(5822, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(5821, creature->GetGUID()); - - return true; - } -}; - -/*###### -## AddSC -######*/ - -void AddSC_undercity() -{ - new npc_lady_sylvanas_windrunner(); - new npc_highborne_lamenter(); - new npc_parqual_fintallas(); -} diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/western_plaguelands.cpp deleted file mode 100644 index ee22b766154..00000000000 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ /dev/null @@ -1,419 +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: Western_Plaguelands -SD%Complete: 90 -SDComment: Quest support: 5097, 5098, 5216, 5219, 5222, 5225, 5229, 5231, 5233, 5235. To obtain Vitreous Focuser (could use more spesifics about gossip items) -SDCategory: Western Plaguelands -EndScriptData */ - -/* ContentData -npcs_dithers_and_arbington -npc_myranda_the_hag -npc_the_scourge_cauldron -npc_andorhal_tower -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" -#include "WorldSession.h" - -/*###### -## npcs_dithers_and_arbington -######*/ - -#define GOSSIP_HDA1 "What does the Felstone Field Cauldron need?" -#define GOSSIP_HDA2 "What does the Dalson's Tears Cauldron need?" -#define GOSSIP_HDA3 "What does the Writhing Haunt Cauldron need?" -#define GOSSIP_HDA4 "What does the Gahrron's Withering Cauldron need?" - -#define GOSSIP_SDA1 "Thanks, i need a Vitreous Focuser" - -class npcs_dithers_and_arbington : public CreatureScript -{ -public: - npcs_dithers_and_arbington() : CreatureScript("npcs_dithers_and_arbington") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_TRADE: - player->GetSession()->SendListInventory(creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(3980, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(3981, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(3982, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(3983, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, 17529, false); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->isVendor()) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); - - if (player->GetQuestRewardStatus(5237) || player->GetQuestRewardStatus(5238)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(3985, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_myranda_the_hag -######*/ - -enum eMyranda -{ - QUEST_SUBTERFUGE = 5862, - QUEST_IN_DREAMS = 5944, - SPELL_SCARLET_ILLUSION = 17961 -}; - -#define GOSSIP_ITEM_ILLUSION "I am ready for the illusion, Myranda." - -class npc_myranda_the_hag : public CreatureScript -{ -public: - npc_myranda_the_hag() : CreatureScript("npc_myranda_the_hag") { } - - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, SPELL_SCARLET_ILLUSION, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE && - !player->GetQuestRewardStatus(QUEST_IN_DREAMS) && !player->HasAura(SPELL_SCARLET_ILLUSION)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ILLUSION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(4773, creature->GetGUID()); - return true; - } - else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } -}; - -/*###### -## npc_the_scourge_cauldron -######*/ - -class npc_the_scourge_cauldron : public CreatureScript -{ -public: - npc_the_scourge_cauldron() : CreatureScript("npc_the_scourge_cauldron") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_the_scourge_cauldronAI (creature); - } - - struct npc_the_scourge_cauldronAI : public ScriptedAI - { - npc_the_scourge_cauldronAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - - void EnterCombat(Unit* /*who*/) {} - - void DoDie() - { - //summoner dies here - me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //override any database `spawntimesecs` to prevent duplicated summons - uint32 rTime = me->GetRespawnDelay(); - if (rTime<600) - me->SetRespawnDelay(600); - } - - void MoveInLineOfSight(Unit* who) - { - if (!who || who->GetTypeId() != TYPEID_PLAYER) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - switch (me->GetAreaId()) - { - case 199: //felstone - if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 200: //dalson - if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 201: //gahrron - if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - case 202: //writhing - if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || - CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) - { - me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); - DoDie(); - } - break; - } - } - } - }; -}; - -/*###### -## npcs_andorhal_tower -######*/ - -enum eAndorhalTower -{ - GO_BEACON_TORCH = 176093 -}; - -class npc_andorhal_tower : public CreatureScript -{ -public: - npc_andorhal_tower() : CreatureScript("npc_andorhal_tower") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_andorhal_towerAI (creature); - } - - struct npc_andorhal_towerAI : public Scripted_NoMovementAI - { - npc_andorhal_towerAI(Creature* creature) : Scripted_NoMovementAI(creature) {} - - void MoveInLineOfSight(Unit* who) - { - if (!who || who->GetTypeId() != TYPEID_PLAYER) - return; - - if (me->FindNearestGameObject(GO_BEACON_TORCH, 10.0f)) - CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); - } - }; -}; - -/*###### -## npc_anchorite_truuen -######*/ - -enum eTruuen -{ - NPC_GHOST_UTHER = 17233, - NPC_THEL_DANIS = 1854, - NPC_GHOUL = 1791, //ambush - - QUEST_TOMB_LIGHTBRINGER = 9446, - - SAY_WP_0 = 0, //Beware! We are attacked! - SAY_WP_1 = 1, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed! - SAY_WP_2 = 2, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now... - SAY_WP_3 = 0, //Be welcome, friends! - SAY_WP_4 = 0, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart. - SAY_WP_5 = 1, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire. - SAY_WP_6 = 2 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here. -}; - -class npc_anchorite_truuen : public CreatureScript -{ -public: - npc_anchorite_truuen() : CreatureScript("npc_anchorite_truuen") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - npc_escortAI* pEscortAI = CAST_AI(npc_anchorite_truuen::npc_anchorite_truuenAI, creature->AI()); - - if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER) - pEscortAI->Start(true, true, player->GetGUID()); - return false; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_anchorite_truuenAI(creature); - } - - struct npc_anchorite_truuenAI : public npc_escortAI - { - npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) { } - - uint32 m_uiChatTimer; - - uint64 UghostGUID; - uint64 TheldanisGUID; - - Creature* Ughost; - Creature* Theldanis; - - void Reset() - { - m_uiChatTimer = 7000; - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == NPC_GHOUL) - summoned->AI()->AttackStart(me); - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - - switch (waypointId) - { - case 8: - Talk(SAY_WP_0); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - break; - case 9: - Talk(SAY_WP_1); - break; - case 14: - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+10.0f, me->GetPositionY()+10.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - me->SummonCreature(NPC_GHOUL, me->GetPositionX()+8.0f, me->GetPositionY()+8.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); - break; - case 15: - Talk(SAY_WP_2); - case 21: - Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150); - if (Theldanis) - Theldanis->AI()->Talk(SAY_WP_3); - break; - case 22: - break; - case 23: - Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - if (Ughost) - { - Ughost->SetDisableGravity(true); - Ughost->AI()->Talk(SAY_WP_4, me->GetGUID()); - } - m_uiChatTimer = 4000; - break; - case 24: - if (Ughost) - Ughost->AI()->Talk(SAY_WP_5, me->GetGUID()); - m_uiChatTimer = 4000; - break; - case 25: - if (Ughost) - Ughost->AI()->Talk(SAY_WP_6, me->GetGUID()); - m_uiChatTimer = 4000; - break; - case 26: - if (player) - player->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me); - break; - } - } - - void EnterCombat(Unit* /*who*/){} - - void JustDied(Unit* /*killer*/) - { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_TOMB_LIGHTBRINGER); - } - - void UpdateAI(const uint32 uiDiff) - { - npc_escortAI::UpdateAI(uiDiff); - DoMeleeAttackIfReady(); - if (HasEscortState(STATE_ESCORT_ESCORTING)) - m_uiChatTimer = 6000; - } - }; -}; - -/*###### -## -######*/ - -void AddSC_western_plaguelands() -{ - new npcs_dithers_and_arbington(); - new npc_myranda_the_hag(); - new npc_the_scourge_cauldron(); - new npc_andorhal_tower(); - new npc_anchorite_truuen(); -} diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/westfall.cpp deleted file mode 100644 index 1b93cf1be71..00000000000 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ /dev/null @@ -1,272 +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: Westfall -SD%Complete: 90 -SDComment: Quest support: 155, 1651 -SDCategory: Westfall -EndScriptData */ - -/* ContentData -npc_daphne_stilwell -npc_defias_traitor -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_daphne_stilwell -######*/ - -enum eEnums -{ - SAY_DS_START = 0, - SAY_DS_DOWN_1 = 1, - SAY_DS_DOWN_2 = 2, - SAY_DS_DOWN_3 = 3, - SAY_DS_PROLOGUE = 4, - - SPELL_SHOOT = 6660, - QUEST_TOME_VALOR = 1651, - NPC_DEFIAS_RAIDER = 6180, - EQUIP_ID_RIFLE = 2511 -}; - -class npc_daphne_stilwell : public CreatureScript -{ -public: - npc_daphne_stilwell() : CreatureScript("npc_daphne_stilwell") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_TOME_VALOR) - { - creature->AI()->Talk(SAY_DS_START); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI())) - pEscortAI->Start(true, true, player->GetGUID()); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_daphne_stilwellAI(creature); - } - - struct npc_daphne_stilwellAI : public npc_escortAI - { - npc_daphne_stilwellAI(Creature* creature) : npc_escortAI(creature) {} - - uint32 uiWPHolder; - uint32 uiShootTimer; - - void Reset() - { - if (HasEscortState(STATE_ESCORT_ESCORTING)) - { - switch (uiWPHolder) - { - case 7: - Talk(SAY_DS_DOWN_1); - break; - case 8: - Talk(SAY_DS_DOWN_2); - break; - case 9: - Talk(SAY_DS_DOWN_3); - break; - } - } - else - uiWPHolder = 0; - - uiShootTimer = 0; - } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - uiWPHolder = waypointId; - - switch (waypointId) - { - case 4: - SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); - me->SetSheath(SHEATH_STATE_RANGED); - me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE); - break; - case 7: - me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 8: - me->SetSheath(SHEATH_STATE_RANGED); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 9: - me->SetSheath(SHEATH_STATE_RANGED); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018f, 1570.738f, 54.828f, 4.220f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 10: - SetRun(false); - break; - case 11: - Talk(SAY_DS_PROLOGUE); - break; - case 13: - SetEquipmentSlots(true); - me->SetSheath(SHEATH_STATE_UNARMED); - me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE); - break; - case 17: - player->GroupEventHappens(QUEST_TOME_VALOR, me); - break; - } - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (me->Attack(who, false)) - { - me->AddThreat(who, 0.0f); - me->SetInCombatWith(who); - who->SetInCombatWith(me); - - me->GetMotionMaster()->MoveChase(who, 30.0f); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(me); - } - - void Update(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (uiShootTimer <= diff) - { - uiShootTimer = 1500; - - if (!me->IsWithinDist(me->getVictim(), ATTACK_DISTANCE)) - DoCast(me->getVictim(), SPELL_SHOOT); - } else uiShootTimer -= diff; - } - }; -}; - -/*###### -## npc_defias_traitor -######*/ -enum DefiasSays -{ - SAY_START = 0, - SAY_PROGRESS = 1, - SAY_END = 2, - SAY_AGGRO = 3 -}; - - -#define QUEST_DEFIAS_BROTHERHOOD 155 - -class npc_defias_traitor : public CreatureScript -{ -public: - npc_defias_traitor() : CreatureScript("npc_defias_traitor") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitor::npc_defias_traitorAI, creature->AI())) - pEscortAI->Start(true, true, player->GetGUID()); - - creature->AI()->Talk(SAY_START, player->GetGUID()); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_defias_traitorAI(creature); - } - - struct npc_defias_traitorAI : public npc_escortAI - { - npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } - - void WaypointReached(uint32 waypointId) - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 35: - SetRun(false); - break; - case 36: - Talk(SAY_PROGRESS, player->GetGUID()); - break; - case 44: - Talk(SAY_END, player->GetGUID()); - player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); - break; - } - } - - void EnterCombat(Unit* who) - { - Talk(SAY_AGGRO, who->GetGUID()); - } - - void Reset() {} - }; -}; - -void AddSC_westfall() -{ - new npc_daphne_stilwell(); - new npc_defias_traitor(); -} diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/wetlands.cpp deleted file mode 100644 index c8a1fc2b2b4..00000000000 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ /dev/null @@ -1,172 +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: Wetlands -SD%Complete: 80 -SDComment: Quest support: 1249 -SDCategory: Wetlands -EndScriptData */ - -/* ContentData -npc_mikhail -npc_tapoke_slim_jahn -EndContentData */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_tapoke_slim_jahn -######*/ - -enum eTapokeSlim -{ - QUEST_MISSING_DIPLO_PT11 = 1249, - FACTION_ENEMY = 168, - SPELL_STEALTH = 1785, - SPELL_CALL_FRIENDS = 16457, //summons 1x friend - NPC_SLIMS_FRIEND = 4971, - NPC_TAPOKE_SLIM_JAHN = 4962 -}; - -class npc_tapoke_slim_jahn : public CreatureScript -{ -public: - npc_tapoke_slim_jahn() : CreatureScript("npc_tapoke_slim_jahn") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_tapoke_slim_jahnAI(creature); - } - - struct npc_tapoke_slim_jahnAI : public npc_escortAI - { - npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) { } - - bool IsFriendSummoned; - - void Reset() - { - if (!HasEscortState(STATE_ESCORT_ESCORTING)) - IsFriendSummoned = false; - } - - void WaypointReached(uint32 waypointId) - { - switch (waypointId) - { - case 2: - if (me->HasStealthAura()) - me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); - SetRun(); - me->setFaction(FACTION_ENEMY); - break; - } - } - - void EnterCombat(Unit* /*who*/) - { - if (HasEscortState(STATE_ESCORT_ESCORTING) && !IsFriendSummoned && GetPlayerForEscort()) - { - for (uint8 i = 0; i < 3; ++i) - DoCast(me, SPELL_CALL_FRIENDS, true); - - IsFriendSummoned = true; - } - } - - void JustSummoned(Creature* summoned) - { - if (Player* player = GetPlayerForEscort()) - summoned->AI()->AttackStart(player); - } - - void AttackedBy(Unit* pAttacker) - { - if (me->getVictim()) - return; - - if (me->IsFriendlyTo(pAttacker)) - return; - - AttackStart(pAttacker); - } - - void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) - { - if (HealthBelowPct(20)) - { - if (Player* player = GetPlayerForEscort()) - { - if (player->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(player)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me); - - uiDamage = 0; - - me->RestoreFaction(); - me->RemoveAllAuras(); - me->DeleteThreatList(); - me->CombatStop(true); - - SetRun(false); - } - } - } - }; -}; - -/*###### -## npc_mikhail -######*/ - -class npc_mikhail : public CreatureScript -{ -public: - npc_mikhail() : CreatureScript("npc_mikhail") { } - - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) - { - if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT11) - { - Creature* pSlim = creature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f); - - if (!pSlim) - return false; - - if (!pSlim->HasStealthAura()) - pSlim->CastSpell(pSlim, SPELL_STEALTH, true); - - if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI())) - pEscortAI->Start(false, false, player->GetGUID(), quest); - } - return false; - } -}; - -/*###### -## AddSC -######*/ - -void AddSC_wetlands() -{ - new npc_tapoke_slim_jahn(); - new npc_mikhail(); -} diff --git a/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp new file mode 100644 index 00000000000..9b9af494554 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp @@ -0,0 +1,35 @@ +/* + * 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: Alterac_Mountains +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Alterac Mountains +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" + +/*void AddSC_alterac_mountains() +{ + Script* newscript; +}*/ diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp new file mode 100644 index 00000000000..d638a435936 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -0,0 +1,146 @@ +/* + * 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: Arathi Highlands +SD%Complete: 100 +SDComment: Quest support: 665 +SDCategory: Arathi Highlands +EndScriptData */ + +/* ContentData +npc_professor_phizzlethorpe +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_professor_phizzlethorpe +######*/ + +enum eEnums +{ + SAY_PROGRESS_1 = 0, + SAY_PROGRESS_2 = 1, + SAY_PROGRESS_3 = 2, + EMOTE_PROGRESS_4 = 3, + SAY_AGGRO = 4, + SAY_PROGRESS_5 = 5, + SAY_PROGRESS_6 = 6, + SAY_PROGRESS_7 = 7, + EMOTE_PROGRESS_8 = 8, + SAY_PROGRESS_9 = 9, + + QUEST_SUNKEN_TREASURE = 665, + MOB_VENGEFUL_SURGE = 2776 +}; + +class npc_professor_phizzlethorpe : public CreatureScript +{ + public: + + npc_professor_phizzlethorpe() + : CreatureScript("npc_professor_phizzlethorpe") + { + } + + struct npc_professor_phizzlethorpeAI : public npc_escortAI + { + npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 4: + Talk(SAY_PROGRESS_2, player->GetGUID()); + break; + case 5: + Talk(SAY_PROGRESS_3, player->GetGUID()); + break; + case 8: + Talk(EMOTE_PROGRESS_4); + break; + case 9: + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + case 10: + Talk(SAY_PROGRESS_5, player->GetGUID()); + break; + case 11: + Talk(SAY_PROGRESS_6, player->GetGUID()); + SetRun(); + break; + case 19: + Talk(SAY_PROGRESS_7, player->GetGUID()); + break; + case 20: + Talk(EMOTE_PROGRESS_8); + Talk(SAY_PROGRESS_9, player->GetGUID()); + player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void EnterCombat(Unit* /*who*/) + { + Talk(SAY_AGGRO); + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_professor_phizzlethorpeAI(creature); + } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) + { + creature->AI()->Talk(SAY_PROGRESS_1, player->GetGUID()); + if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI()))) + pEscortAI->Start(false, false, player->GetGUID(), quest); + + creature->setFaction(113); + } + return true; + } +}; + +void AddSC_arathi_highlands() +{ + new npc_professor_phizzlethorpe(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp new file mode 100644 index 00000000000..4f76edf4406 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp @@ -0,0 +1,76 @@ +/* + * 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: Blasted_Lands +SD%Complete: 90 +SDComment: Quest support: 3628. Teleporter to Rise of the Defiler missing group support. +SDCategory: Blasted Lands +EndScriptData */ + +/* ContentData +npc_deathly_usher +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npc_deathly_usher +######*/ + +#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler." + +#define SPELL_TELEPORT_SINGLE 12885 +#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142 +#define SPELL_TELEPORT_GROUP 27686 + +class npc_deathly_usher : public CreatureScript +{ +public: + npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF) + { + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, SPELL_TELEPORT_SINGLE, true); + } + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (player->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(10757)) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +void AddSC_blasted_lands() +{ + new npc_deathly_usher(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp new file mode 100644 index 00000000000..b6899c534e4 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp @@ -0,0 +1,158 @@ +/* + * 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: Burning_Steppes +SD%Complete: 100 +SDComment: Quest support: 4224, 4866 +SDCategory: Burning Steppes +EndScriptData */ + +/* ContentData +npc_ragged_john +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npc_ragged_john +######*/ + +#define GOSSIP_HELLO "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him." +#define GOSSIP_SELECT1 "So what did you do?" +#define GOSSIP_SELECT2 "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'." +#define GOSSIP_SELECT3 "Ironfoe?" +#define GOSSIP_SELECT4 "Interesting... continue John." +#define GOSSIP_SELECT5 "So that's how Windsor died..." +#define GOSSIP_SELECT6 "So how did he die?" +#define GOSSIP_SELECT7 "Ok so where the hell is he? Wait a minute! Are you drunk?" +#define GOSSIP_SELECT8 "WHY is he in Blackrock Depths?" +#define GOSSIP_SELECT9 "300? So the Dark Irons killed him and dragged him into the Depths?" +#define GOSSIP_SELECT10 "Ahh... Ironfoe" +#define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" + +class npc_ragged_john : public CreatureScript +{ +public: + npc_ragged_john() : CreatureScript("npc_ragged_john") { } + + 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_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(2714, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(2715, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(2716, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->SEND_GOSSIP_MENU(2717, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + player->SEND_GOSSIP_MENU(2718, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + player->SEND_GOSSIP_MENU(2719, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + player->SEND_GOSSIP_MENU(2720, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + player->SEND_GOSSIP_MENU(2721, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + player->SEND_GOSSIP_MENU(2722, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + player->SEND_GOSSIP_MENU(2723, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+10: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + player->SEND_GOSSIP_MENU(2725, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(4224); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(2713, creature->GetGUID()); + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_ragged_johnAI (creature); + } + + struct npc_ragged_johnAI : public ScriptedAI + { + npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() {} + + void MoveInLineOfSight(Unit* who) + { + if (who->HasAura(16468)) + { + if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) + { + DoCast(who, 16472); + CAST_PLR(who)->AreaExploredOrEventHappens(4866); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit* /*who*/) {} + }; +}; + +void AddSC_burning_steppes() +{ + new npc_ragged_john(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp new file mode 100644 index 00000000000..1ce83d31a63 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp @@ -0,0 +1,143 @@ +/* + * 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: Duskwood +SD%Complete: 100 +SDComment: Quest Support:8735 +SDCategory: Duskwood +EndScriptData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" + +enum Yells +{ + YELL_TWILIGHTCORRUPTOR_RESPAWN = 0, + YELL_TWILIGHTCORRUPTOR_AGGRO = 1, + YELL_TWILIGHTCORRUPTOR_KILL = 2, +}; + + +/*###### +# at_twilight_grove +######*/ + +class at_twilight_grove : public AreaTriggerScript +{ +public: + at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { } + + bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) + { + if (player->HasQuestForItem(21149)) + { + if (Unit* TCorrupter = player->SummonCreature(15625, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000)) + { + TCorrupter->setFaction(14); + TCorrupter->SetMaxHealth(832750); + } + if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) + { + CorrupterSpeaker->SetName("Twilight Corrupter"); + CorrupterSpeaker->SetVisible(true); + CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player->GetGUID()); + } + } + return false; + }; +}; + +/*###### +# boss_twilight_corrupter +######*/ + +#define SPELL_SOUL_CORRUPTION 25805 +#define SPELL_CREATURE_OF_NIGHTMARE 25806 +#define SPELL_LEVEL_UP 24312 + +class boss_twilight_corrupter : public CreatureScript +{ +public: + boss_twilight_corrupter() : CreatureScript("boss_twilight_corrupter") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_twilight_corrupterAI (creature); + } + + struct boss_twilight_corrupterAI : public ScriptedAI + { + boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 SoulCorruption_Timer; + uint32 CreatureOfNightmare_Timer; + uint8 KillCount; + + void Reset() + { + SoulCorruption_Timer = 15000; + CreatureOfNightmare_Timer = 30000; + KillCount = 0; + } + void EnterCombat(Unit* /*who*/) + { + Talk(YELL_TWILIGHTCORRUPTOR_AGGRO); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + ++KillCount; + Talk(YELL_TWILIGHTCORRUPTOR_KILL, victim->GetGUID()); + + if (KillCount == 3) + { + DoCast(me, SPELL_LEVEL_UP, true); + KillCount = 0; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + if (SoulCorruption_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_SOUL_CORRUPTION); + SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers + } else SoulCorruption_Timer-=diff; + + if (CreatureOfNightmare_Timer <= diff) + { + DoCast(me->getVictim(), SPELL_CREATURE_OF_NIGHTMARE); + CreatureOfNightmare_Timer = 45000; //gotta confirm Timers + } else CreatureOfNightmare_Timer-=diff; + DoMeleeAttackIfReady(); + }; + }; +}; + +void AddSC_duskwood() +{ + new boss_twilight_corrupter(); + new at_twilight_grove(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp new file mode 100644 index 00000000000..a2522fd9495 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp @@ -0,0 +1,192 @@ +/* + * 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: Eastern_Plaguelands +SD%Complete: 100 +SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched +SDCategory: Eastern Plaguelands +EndScriptData */ + +/* ContentData +mobs_ghoul_flayer +npc_augustus_the_touched +npc_darrowshire_spirit +npc_tirion_fordring +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" +#include "WorldSession.h" + +class mobs_ghoul_flayer : public CreatureScript +{ +public: + mobs_ghoul_flayer() : CreatureScript("mobs_ghoul_flayer") { } + + struct mobs_ghoul_flayerAI : public ScriptedAI + { + mobs_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() {} + + void EnterCombat(Unit* /*who*/) {} + + void JustDied(Unit* killer) + { + if (killer->GetTypeId() == TYPEID_PLAYER) + me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new mobs_ghoul_flayerAI (creature); + } +}; + +/*###### +## npc_augustus_the_touched +######*/ + +class npc_augustus_the_touched : public CreatureScript +{ +public: + npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { } + + 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(6164)) + 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_darrowshire_spirit +######*/ + +#define SPELL_SPIRIT_SPAWNIN 17321 + +class npc_darrowshire_spirit : public CreatureScript +{ +public: + npc_darrowshire_spirit() : CreatureScript("npc_darrowshire_spirit") { } + + bool OnGossipHello(Player* player, Creature* creature) + { + player->SEND_GOSSIP_MENU(3873, creature->GetGUID()); + player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); + creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_darrowshire_spiritAI (creature); + } + + struct npc_darrowshire_spiritAI : public ScriptedAI + { + npc_darrowshire_spiritAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() + { + DoCast(me, SPELL_SPIRIT_SPAWNIN); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit* /*who*/) {} + }; +}; + +/*###### +## npc_tirion_fordring +######*/ + +#define GOSSIP_HELLO "I am ready to hear your tale, Tirion." +#define GOSSIP_SELECT1 "Thank you, Tirion. What of your identity?" +#define GOSSIP_SELECT2 "That is terrible." +#define GOSSIP_SELECT3 "I will, Tirion." + +class npc_tirion_fordring : public CreatureScript +{ +public: + npc_tirion_fordring() : CreatureScript("npc_tirion_fordring") { } + + 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_SELECT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(4493, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(4494, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SELECT3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->SEND_GOSSIP_MENU(4495, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(5742); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && player->getStandState() == UNIT_STAND_STATE_SIT) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +void AddSC_eastern_plaguelands() +{ + new mobs_ghoul_flayer(); + new npc_augustus_the_touched(); + new npc_darrowshire_spirit(); + new npc_tirion_fordring(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp new file mode 100644 index 00000000000..432768a51de --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp @@ -0,0 +1,634 @@ +/* + * 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: Eversong_Woods +SD%Complete: 100 +SDComment: Quest support: 8483, 8488, 8490, 9686 +SDCategory: Eversong Woods +EndScriptData */ + +/* ContentData +npc_prospector_anvilward +npc_apprentice_mirveda +npc_infused_crystal +npc_kelerun_bloodmourn +go_harbinger_second_trial +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## Quest 9686 Second Trial +######*/ + +enum SeconTrial +{ + QUEST_SECOND_TRIAL = 9686, + OFFSET_NEXT_ATTACK = 750, +}; + +enum eSpells +{ + SPELL_FLASH_OF_LIGHT = 19939, + SPELL_SEAL_OF_JUSTICE = 20164, + SPELL_JUDGEMENT_OF_LIGHT = 20271, + SPELL_SEAL_OF_COMMAND = 20375, +}; + +enum eNpc +{ + MASTER_KELERUN_BLOODMOURN = 17807, + CHAMPION_BLOODWRATH = 17809, + CHAMPION_LIGHTREND = 17810, + CHAMPION_SWIFTBLADE = 17811, + CHAMPION_SUNSTRIKER = 17812, +}; + +enum eFaction +{ + FACTION_HOSTILE = 45, + FACTION_FRIENDLY = 7, +}; + +enum eSays +{ + TEXT_SECOND_TRIAL_1 = 0, + TEXT_SECOND_TRIAL_2 = 1, + TEXT_SECOND_TRIAL_3 = 2, + TEXT_SECOND_TRIAL_4 = 3, +}; + +struct Locations +{ + float x, y, z, o; +}; + +static Locations SpawnPosition[]= +{ + {5.3f, -11.8f, 0.361f, 4.2f}, + {11.2f, -29.17f, 0.361f, 2.7f}, + {-5.7f, -34.85f, 0.361f, 1.09f}, + {-11.9f, -18, 0.361f, 5.87f} +}; + +static uint32 PaladinEntry[] = {CHAMPION_BLOODWRATH, CHAMPION_LIGHTREND, CHAMPION_SWIFTBLADE, CHAMPION_SUNSTRIKER}; + +/*###### +## npc_second_trial_paladin +######*/ + +class npc_second_trial_paladin : public CreatureScript +{ +public: + npc_second_trial_paladin() : CreatureScript("npc_second_trial_paladin") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_secondTrialAI (creature); + } + + struct npc_secondTrialAI : public ScriptedAI + { + npc_secondTrialAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 timer; + uint8 questPhase; + uint64 summonerGuid; + + bool spellFlashLight; + bool spellJustice; + bool spellJudLight; + bool spellCommand; + + uint32 timerFlashLight; + uint32 timerJustice; + uint32 timerJudLight; + uint32 timerCommand; + + void Reset() + { + timer = 2000; + questPhase = 0; + summonerGuid = 0; + + me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_KNEEL); + me->setFaction(FACTION_FRIENDLY); + + spellFlashLight = false; + spellJustice = false; + spellJudLight = false; + spellCommand = false; + + switch (me->GetEntry()) + { + case CHAMPION_BLOODWRATH: + spellFlashLight = true; + timerFlashLight = 3225; + break; + case CHAMPION_LIGHTREND: + spellJustice = true; + timerJustice = 500; + break; + case CHAMPION_SWIFTBLADE: + spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 + timerJudLight = 500; + break; + case CHAMPION_SUNSTRIKER: + spellFlashLight = true; + spellJudLight = false; // Misses Script Effect // http://www.wowhead.com/?spell=20271 + spellCommand = false; // Misses Dummy // http://www.wowhead.com/?spell=20375 + timerFlashLight = 3225; + timerJudLight = 500; + timerCommand = 1500; + break; + } + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (questPhase == 1) + { + if (timer <= diff) + { + me->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + me->setFaction(FACTION_HOSTILE); + questPhase = 0; + + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { + me->AddThreat(target, 5000000.0f); + AttackStart(target); + } + } + else + timer -= diff; + } + + if (!UpdateVictim()) + return; + + // healer + if (spellFlashLight && HealthBelowPct(70)) + { + if (timerFlashLight <= diff) + { + DoCast(me, SPELL_FLASH_OF_LIGHT); + timerFlashLight = 3225 + rand()%3225; + } + else + timerFlashLight -= diff; + } + + if (spellJustice) + { + if (timerJustice <= diff) + { + DoCast(me, SPELL_SEAL_OF_JUSTICE); + timerJustice = urand(10000, 20000); + } + else + timerJustice -= diff; + } + + if (spellJudLight) + { + if (timerJudLight <= diff) + { + DoCast(me, SPELL_JUDGEMENT_OF_LIGHT); + timerJudLight = urand(10000, 20000); + } + else + timerJudLight -= diff; + } + + if (spellCommand) + { + if (timerCommand <= diff) + { + DoCast(me, SPELL_SEAL_OF_COMMAND); + timerCommand = urand(20000, 40000); + } + else + timerCommand -= diff; + } + + DoMeleeAttackIfReady(); + } + + void Activate(uint64 summonerguid) + { + questPhase = 1; + summonerGuid = summonerguid; + } + + void KilledUnit(Unit* Killed) + { + if (Killed->GetTypeId() == TYPEID_PLAYER) + if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE) + CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL); + } + + void JustDied(Unit* killer); + }; +}; + +/*###### +## npc_second_trial_controller +######*/ + +class npc_second_trial_controller : public CreatureScript +{ +public: + npc_second_trial_controller() : CreatureScript("npc_second_trial_controller") { } + + bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest) + { + // One Player exclusive quest, wait for user go activation + if (quest->GetQuestId() == QUEST_SECOND_TRIAL) + CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->questPhase = 1; + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + // quest only available if not already started + // Quest_template flag is set to : QUEST_FLAGS_EVENT + // Escort quests or any other event-driven quests. If player in party, all players that can accept this quest will receive confirmation box to accept quest. + // !not sure if this really works! + + if (CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->questPhase == 0) + { + player->PrepareQuestMenu(creature->GetGUID()); + player->SendPreparedQuest(creature->GetGUID()); + } + + player->SEND_GOSSIP_MENU(creature->GetEntry(), creature->GetGUID()); + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new master_kelerun_bloodmournAI (creature); + } + + struct master_kelerun_bloodmournAI : public ScriptedAI + { + master_kelerun_bloodmournAI(Creature* creature) : ScriptedAI(creature) {} + + uint8 questPhase; + uint8 paladinPhase; + uint32 timer; + + uint64 paladinGuid[4]; + + void Reset() + { + questPhase = 0; + timer = 60000; + paladinPhase = 0; + for (uint8 i = 0; i < 4; ++i) + paladinGuid[i] = 0; + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + // Quest accepted but object not activated, object despawned (if in sync 1 minute!) + if (questPhase == 1) + { + if (timer <= diff) + Reset(); + else + timer -= diff; + } + // fight the 4 paladin mobs phase + else if (questPhase == 2) + { + if (timer <= diff) + { + if (Creature* paladinSpawn = Unit::GetCreature((*me), paladinGuid[paladinPhase])) + { + CAST_AI(npc_second_trial_paladin::npc_secondTrialAI, paladinSpawn->AI())->Activate(me->GetGUID()); + + switch (paladinPhase) + { + case 0: + Talk(TEXT_SECOND_TRIAL_1); + break; + case 1: + Talk(TEXT_SECOND_TRIAL_2); + break; + case 2: + Talk(TEXT_SECOND_TRIAL_3); + break; + case 3: + Talk(TEXT_SECOND_TRIAL_4); + break; + } + } + else + Reset(); + + questPhase = 4; + timer = OFFSET_NEXT_ATTACK; + } + else + timer -= diff; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void StartEvent() + { + if (questPhase == 1) + { // no player check, quest can be finished as group, so no complex PlayerGUID/group search code + for (uint8 i = 0; i < 4; ++i) + if (Creature* summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000)) + paladinGuid[i] = summoned->GetGUID(); + + timer = OFFSET_NEXT_ATTACK; + questPhase = 2; + } + } + + void SecondTrialKill() + { + if (questPhase > 0) + { + ++paladinPhase; + + if (paladinPhase < 4) + questPhase = 2; + else + Reset(); // Quest Complete, QuestComplete handler is + } + } + + void SummonedCreatureDespawn(Creature* /*c*/) {} + }; +}; + +void npc_second_trial_paladin::npc_secondTrialAI::JustDied(Unit* Killer) +{ + if (Killer->GetTypeId() == TYPEID_PLAYER) + { + if (Creature* summoner = Unit::GetCreature((*me), summonerGuid)) + CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, summoner->AI())->SecondTrialKill(); + + // last kill quest complete for group + if (me->GetEntry() == CHAMPION_SUNSTRIKER) + { + if (Killer->GetTypeId() == TYPEID_PLAYER) + Killer->ToPlayer()->GroupEventHappens(QUEST_SECOND_TRIAL, Killer); + } + } +} + +/*###### +## go_second_trial +######*/ +class go_second_trial : public GameObjectScript +{ +public: + go_second_trial() : GameObjectScript("go_second_trial") { } + + bool OnGossipHello(Player* /*player*/, GameObject* go) + { + // find spawn :: master_kelerun_bloodmourn + if (Creature* creature = go->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f)) + CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->StartEvent(); + + return true; + } +}; + +/*###### +## npc_apprentice_mirveda +######*/ + +#define QUEST_UNEXPECTED_RESULT 8488 +#define MOB_GHARZUL 15958 +#define MOB_ANGERSHADE 15656 + +class npc_apprentice_mirveda : public CreatureScript +{ +public: + npc_apprentice_mirveda() : CreatureScript("npc_apprentice_mirveda") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) + { + CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->Summon = true; + CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->PlayerGUID = player->GetGUID(); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_apprentice_mirvedaAI (creature); + } + + struct npc_apprentice_mirvedaAI : public ScriptedAI + { + npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) {} + + uint32 KillCount; + uint64 PlayerGUID; + bool Summon; + SummonList Summons; + + void Reset() + { + KillCount = 0; + PlayerGUID = 0; + Summons.DespawnAll(); + Summon = false; + } + + void EnterCombat(Unit* /*who*/){} + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + Summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature* summoned) + { + Summons.Despawn(summoned); + ++KillCount; + } + + void JustDied(Unit* /*killer*/) + { + if (PlayerGUID) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + player->FailQuest(QUEST_UNEXPECTED_RESULT); + } + + void UpdateAI(const uint32 /*diff*/) + { + if (KillCount >= 3 && PlayerGUID) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + player->CompleteQuest(QUEST_UNEXPECTED_RESULT); + + if (Summon) + { + me->SummonCreature(MOB_GHARZUL, 8745, -7134.32f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + me->SummonCreature(MOB_ANGERSHADE, 8745, -7134.32f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000); + Summon = false; + } + } + }; +}; + +/*###### +## npc_infused_crystal +######*/ + +enum InfusedCrystal +{ + MOB_ENRAGED_WRAITH = 17086, + EMOTE = 0, + QUEST_POWERING_OUR_DEFENSES = 8490 +}; + +struct Location +{ + float x, y, z; +}; + +static Location SpawnLocations[] = +{ + {8270.68f, -7188.53f, 139.619f}, + {8284.27f, -7187.78f, 139.603f}, + {8297.43f, -7193.53f, 139.603f}, + {8303.5f, -7201.96f, 139.577f}, + {8273.22f, -7241.82f, 139.382f}, + {8254.89f, -7222.12f, 139.603f}, + {8278.51f, -7242.13f, 139.162f}, + {8267.97f, -7239.17f, 139.517f} +}; + +class npc_infused_crystal : public CreatureScript +{ +public: + npc_infused_crystal() : CreatureScript("npc_infused_crystal") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_infused_crystalAI (creature); + } + + struct npc_infused_crystalAI : public Scripted_NoMovementAI + { + npc_infused_crystalAI(Creature* creature) : Scripted_NoMovementAI(creature) {} + + uint32 EndTimer; + uint32 WaveTimer; + bool Completed; + bool Progress; + uint64 PlayerGUID; + + void Reset() + { + EndTimer = 0; + Completed = false; + Progress = false; + PlayerGUID = 0; + WaveTimer = 0; + } + + void MoveInLineOfSight(Unit* who) + { + if (!Progress && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 10.0f)) + { + if (CAST_PLR(who)->GetQuestStatus(QUEST_POWERING_OUR_DEFENSES) == QUEST_STATUS_INCOMPLETE) + { + PlayerGUID = who->GetGUID(); + WaveTimer = 1000; + EndTimer = 60000; + Progress = true; + } + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void JustDied(Unit* /*killer*/) + { + if (PlayerGUID && !Completed) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + CAST_PLR(player)->FailQuest(QUEST_POWERING_OUR_DEFENSES); + } + + void UpdateAI(const uint32 diff) + { + if (EndTimer < diff && Progress) + { + Talk(EMOTE); + Completed = true; + if (PlayerGUID) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + CAST_PLR(player)->CompleteQuest(QUEST_POWERING_OUR_DEFENSES); + + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + me->RemoveCorpse(); + } else EndTimer -= diff; + + if (WaveTimer < diff && !Completed && Progress) + { + uint32 ran1 = rand()%8; + uint32 ran2 = rand()%8; + uint32 ran3 = rand()%8; + me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran1].x, SpawnLocations[ran1].y, SpawnLocations[ran1].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran2].x, SpawnLocations[ran2].y, SpawnLocations[ran2].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + me->SummonCreature(MOB_ENRAGED_WRAITH, SpawnLocations[ran3].x, SpawnLocations[ran3].y, SpawnLocations[ran3].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + WaveTimer = 30000; + } else WaveTimer -= diff; + } + }; +}; + +void AddSC_eversong_woods() +{ + new npc_second_trial_controller(); + new npc_second_trial_paladin(); + new go_second_trial(); + new npc_apprentice_mirveda(); + new npc_infused_crystal(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp new file mode 100644 index 00000000000..9e00ceb2aa5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -0,0 +1,226 @@ +/* + * 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: Ghostlands +SD%Complete: 100 +SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber +SDCategory: Ghostlands +EndScriptData */ + +/* ContentData +npc_blood_knight_dawnstar +npc_budd_nedreck +npc_rathis_tomber +npc_ranger_lilatha +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" +#include "WorldSession.h" + +/*###### +## npc_budd_nedreck +######*/ + +#define GOSSIP_HBN "You gave the crew disguises?" + +class npc_budd_nedreck : public CreatureScript +{ +public: + npc_budd_nedreck() : CreatureScript("npc_budd_nedreck") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF) + { + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, 42540, false); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HBN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } +}; + +/*###### +## npc_rathis_tomber +######*/ + +class npc_rathis_tomber : public CreatureScript +{ +public: + npc_rathis_tomber() : CreatureScript("npc_rathis_tomber") { } + + 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(9152)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + player->SEND_GOSSIP_MENU(8432, creature->GetGUID()); + }else + player->SEND_GOSSIP_MENU(8431, creature->GetGUID()); + + return true; + } +}; + +/*###### +## npc_ranger_lilatha +######*/ + +enum eEnums +{ + SAY_START = 0, + SAY_PROGRESS1 = 1, + SAY_PROGRESS2 = 2, + SAY_PROGRESS3 = 3, + SAY_END1 = 4, + SAY_END2 = 5, + SAY_CAPTAIN_ANSWER = 0, + + QUEST_ESCAPE_FROM_THE_CATACOMBS = 9212, + GO_CAGE = 181152, + NPC_CAPTAIN_HELIOS = 16220, + FACTION_SMOON_E = 1603 +}; + +class npc_ranger_lilatha : public CreatureScript +{ +public: + npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") { } + + struct npc_ranger_lilathaAI : public npc_escortAI + { + npc_ranger_lilathaAI(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); + Talk(SAY_START, player->GetGUID()); + break; + case 5: + Talk(SAY_PROGRESS1, player->GetGUID()); + break; + case 11: + Talk(SAY_PROGRESS2, player->GetGUID()); + me->SetOrientation(4.762841f); + break; + case 18: + { + Talk(SAY_PROGRESS3, player->GetGUID()); + Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0); + Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Summ1 && Summ2) + { + Summ1->Attack(me, true); + Summ2->Attack(player, true); + } + me->AI()->AttackStart(Summ1); + } + break; + case 19: + me->SetWalk(false); + break; + case 25: + me->SetWalk(true); + break; + case 30: + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me); + break; + case 32: + me->SetOrientation(2.978281f); + Talk(SAY_END1, player->GetGUID()); + break; + case 33: + me->SetOrientation(5.858011f); + Talk(SAY_END2, player->GetGUID()); + Creature* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50); + if (CaptainHelios) + CaptainHelios->AI()->Talk(SAY_CAPTAIN_ANSWER, player->GetGUID()); + break; + } + } + + void Reset() + { + if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20)) + Cage->SetGoState(GO_STATE_READY); + } + }; + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) + { + creature->setFaction(113); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_ranger_lilatha::npc_ranger_lilathaAI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_ranger_lilathaAI(creature); + } + +}; + +void AddSC_ghostlands() +{ + new npc_budd_nedreck(); + new npc_rathis_tomber(); + new npc_ranger_lilatha(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp new file mode 100644 index 00000000000..ffd31937677 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -0,0 +1,352 @@ +/* + * 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: Hinterlands +SD%Complete: 100 +SDComment: Quest support: 863, 2742 +SDCategory: The Hinterlands +EndScriptData */ + +/* ContentData +npc_00x09hl +npc_rinji +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_00x09hl +######*/ + +enum eOOX +{ + SAY_OOX_START = 0, + SAY_OOX_AGGRO = 1, + SAY_OOX_AMBUSH = 3, + SAY_OOX_AMBUSH_REPLY = 4, + SAY_OOX_END = 5, + + QUEST_RESQUE_OOX_09 = 836, + + NPC_MARAUDING_OWL = 7808, + NPC_VILE_AMBUSHER = 7809, + + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +class npc_00x09hl : public CreatureScript +{ +public: + npc_00x09hl() : CreatureScript("npc_00x09hl") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_RESQUE_OOX_09) + { + creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (player->GetTeam() == ALLIANCE) + creature->setFaction(FACTION_ESCORTEE_A); + else if (player->GetTeam() == HORDE) + creature->setFaction(FACTION_ESCORTEE_H); + + creature->AI()->Talk(SAY_OOX_START, player->GetGUID()); + + if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hl::npc_00x09hlAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_00x09hlAI(creature); + } + + struct npc_00x09hlAI : public npc_escortAI + { + npc_00x09hlAI(Creature* creature) : npc_escortAI(creature) { } + + void Reset() { } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 26: + Talk(SAY_OOX_AMBUSH); + break; + case 43: + Talk(SAY_OOX_AMBUSH); + break; + case 64: + Talk(SAY_OOX_END); + if (Player* player = GetPlayerForEscort()) + player->GroupEventHappens(QUEST_RESQUE_OOX_09, me); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch (uiPointId) + { + case 27: + for (uint8 i = 0; i < 3; ++i) + { + const Position src = {147.927444f, -3851.513428f, 130.893f, 0}; + Position dst; + me->GetRandomPoint(src, 7.0f, dst); + DoSummon(NPC_MARAUDING_OWL, dst, 25000, TEMPSUMMON_CORPSE_TIMED_DESPAWN); + } + break; + case 44: + for (uint8 i = 0; i < 3; ++i) + { + const Position src = {-141.151581f, -4291.213867f, 120.130f, 0}; + Position dst; + me->GetRandomPoint(src, 7.0f, dst); + me->SummonCreature(NPC_VILE_AMBUSHER, dst, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + } + } + + void EnterCombat(Unit* who) + { + if (who->GetEntry() == NPC_MARAUDING_OWL || who->GetEntry() == NPC_VILE_AMBUSHER) + return; + + Talk(SAY_OOX_AGGRO); + } + + void JustSummoned(Creature* summoned) + { + summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); + } + }; +}; + +/*###### +## npc_rinji +######*/ + +enum eRinji +{ + SAY_RIN_BY_OUTRUNNER = 0, + + SAY_RIN_FREE = 0, //from here + SAY_RIN_HELP = 1, + SAY_RIN_COMPLETE = 2, + SAY_RIN_PROGRESS_1 = 3, + SAY_RIN_PROGRESS_2 = 4, + + QUEST_RINJI_TRAPPED = 2742, + NPC_RANGER = 2694, + NPC_OUTRUNNER = 2691, + GO_RINJI_CAGE = 142036 +}; + +struct Location +{ + float m_fX, m_fY, m_fZ; +}; + +Location m_afAmbushSpawn[] = +{ + {191.296204f, -2839.329346f, 107.388f}, + {70.972466f, -2848.674805f, 109.459f} +}; + +Location m_afAmbushMoveTo[] = +{ + {166.630386f, -2824.780273f, 108.153f}, + {70.886589f, -2874.335449f, 116.675f} +}; + +class npc_rinji : public CreatureScript +{ +public: + npc_rinji() : CreatureScript("npc_rinji") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) + { + if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) + go->UseDoorOrButton(); + + if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_rinjiAI(creature); + } + + struct npc_rinjiAI : public npc_escortAI + { + npc_rinjiAI(Creature* creature) : npc_escortAI(creature) + { + m_bIsByOutrunner = false; + m_iSpawnId = 0; + } + + bool m_bIsByOutrunner; + uint32 m_uiPostEventCount; + uint32 m_uiPostEventTimer; + int m_iSpawnId; + + void Reset() + { + m_uiPostEventCount = 0; + m_uiPostEventTimer = 3000; + } + + void JustRespawned() + { + m_bIsByOutrunner = false; + m_iSpawnId = 0; + + npc_escortAI::JustRespawned(); + } + + void EnterCombat(Unit* who) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) + { + if (Creature* talker = who->ToCreature()) + talker->AI()->Talk(SAY_RIN_BY_OUTRUNNER); + m_bIsByOutrunner = true; + } + + if (rand()%4) + return; + + //only if attacked and escorter is not in combat? + Talk(SAY_RIN_HELP); + } + } + + void DoSpawnAmbush(bool bFirst) + { + if (!bFirst) + m_iSpawnId = 1; + + me->SummonCreature(NPC_RANGER, + m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + + for (int i = 0; i < 2; ++i) + { + me->SummonCreature(NPC_OUTRUNNER, + m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->SetWalk(false); + summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); + } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 1: + Talk(SAY_RIN_FREE, player->GetGUID()); + break; + case 7: + DoSpawnAmbush(true); + break; + case 13: + DoSpawnAmbush(false); + break; + case 17: + Talk(SAY_RIN_COMPLETE, player->GetGUID()); + player->GroupEventHappens(QUEST_RINJI_TRAPPED, me); + SetRun(); + m_uiPostEventCount = 1; + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + //Check if we have a current target + if (!UpdateVictim()) + { + if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount) + { + if (m_uiPostEventTimer <= uiDiff) + { + m_uiPostEventTimer = 3000; + + if (Player* player = GetPlayerForEscort()) + { + switch (m_uiPostEventCount) + { + case 1: + Talk(SAY_RIN_PROGRESS_1, player->GetGUID()); + ++m_uiPostEventCount; + break; + case 2: + Talk(SAY_RIN_PROGRESS_2, player->GetGUID()); + m_uiPostEventCount = 0; + break; + } + } + else + { + me->DespawnOrUnsummon(); + return; + } + } + else + m_uiPostEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } + }; +}; + +void AddSC_hinterlands() +{ + new npc_00x09hl(); + new npc_rinji(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_ironforge.cpp b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp new file mode 100644 index 00000000000..f9e8d4d16c6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp @@ -0,0 +1,99 @@ +/* + * 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: Ironforge +SD%Complete: 100 +SDComment: Quest support: 3702 +SDCategory: Ironforge +EndScriptData */ + +/* ContentData +npc_royal_historian_archesonus +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npc_royal_historian_archesonus +######*/ + +#define GOSSIP_ITEM_ROYAL "I am ready to listen" +#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" +#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." +#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" +#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" + +class npc_royal_historian_archesonus : public CreatureScript +{ +public: + npc_royal_historian_archesonus() : CreatureScript("npc_royal_historian_archesonus") { } + + 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_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(2236, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(2237, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(2238, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->SEND_GOSSIP_MENU(2239, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(3702); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + player->SEND_GOSSIP_MENU(2235, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +void AddSC_ironforge() +{ + new npc_royal_historian_archesonus(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp new file mode 100644 index 00000000000..bfd4d24cec6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp @@ -0,0 +1,159 @@ +/* + * 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: Isle_of_Queldanas +SD%Complete: 100 +SDComment: Quest support: 11524, 11525, 11532, 11533, 11542, 11543, 11541 +SDCategory: Isle Of Quel'Danas +EndScriptData */ + +/* ContentData +npc_converted_sentry +npc_greengill_slave +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" +#include "Pet.h" +#include "SpellInfo.h" + +/*###### +## npc_converted_sentry +######*/ +enum ConvertedSentry +{ + SAY_CONVERTED = 0, + + SPELL_CONVERT_CREDIT = 45009 +}; + + +class npc_converted_sentry : public CreatureScript +{ +public: + npc_converted_sentry() : CreatureScript("npc_converted_sentry") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_converted_sentryAI (creature); + } + + struct npc_converted_sentryAI : public ScriptedAI + { + npc_converted_sentryAI(Creature* creature) : ScriptedAI(creature) {} + + bool Credit; + uint32 Timer; + + void Reset() + { + Credit = false; + Timer = 2500; + } + + void MoveInLineOfSight(Unit* /*who*/) {} + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (!Credit) + { + if (Timer <= diff) + { + Talk(SAY_CONVERTED); + + DoCast(me, SPELL_CONVERT_CREDIT); + if (me->isPet()) + me->ToPet()->SetDuration(7500); + Credit = true; + } else Timer -= diff; + } + } + }; +}; + +/*###### +## npc_greengill_slave +######*/ + +#define ENRAGE 45111 +#define ORB 45109 +#define QUESTG 11541 +#define DM 25060 + +class npc_greengill_slave : public CreatureScript +{ +public: + npc_greengill_slave() : CreatureScript("npc_greengill_slave") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_greengill_slaveAI(creature); + } + + struct npc_greengill_slaveAI : public ScriptedAI + { + npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) {} + + uint64 PlayerGUID; + + void EnterCombat(Unit* /*who*/){} + + void Reset() + { + PlayerGUID = 0; + } + + void SpellHit(Unit* caster, const SpellInfo* spell) + { + if (!caster) + return; + + if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !me->HasAura(ENRAGE)) + { + PlayerGUID = caster->GetGUID(); + if (PlayerGUID) + { + Player* player = Unit::GetPlayer(*me, PlayerGUID); + if (player && player->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE) + DoCast(player, 45110, true); + } + DoCast(me, ENRAGE); + Unit* Myrmidon = me->FindNearestCreature(DM, 70); + if (Myrmidon) + { + me->AddThreat(Myrmidon, 100000.0f); + AttackStart(Myrmidon); + } + } + } + + void UpdateAI(const uint32 /*diff*/) + { + DoMeleeAttackIfReady(); + } + }; +}; + +void AddSC_isle_of_queldanas() +{ + new npc_converted_sentry(); + new npc_greengill_slave(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp new file mode 100644 index 00000000000..30f12718d64 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_loch_modan.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: Loch_Modan +SD%Complete: 100 +SDComment: Quest support: 3181 +SDCategory: Loch Modan +EndScriptData */ + +/* ContentData +npc_mountaineer_pebblebitty +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npc_mountaineer_pebblebitty +######*/ + +#define GOSSIP_MP "Open the gate please, i need to get to Searing Gorge" + +#define GOSSIP_MP1 "But i need to get there, now open the gate!" +#define GOSSIP_MP2 "Ok, so what is this other way?" +#define GOSSIP_MP3 "Doesn't matter, i'm invulnerable." +#define GOSSIP_MP4 "Yes..." +#define GOSSIP_MP5 "Ok, i'll try to remember that." +#define GOSSIP_MP6 "A key? Ok!" + +class npc_mountaineer_pebblebitty : public CreatureScript +{ +public: + npc_mountaineer_pebblebitty() : CreatureScript("npc_mountaineer_pebblebitty") { } + + 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_MP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(1833, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(1834, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + player->SEND_GOSSIP_MENU(1835, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + player->SEND_GOSSIP_MENU(1836, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + player->SEND_GOSSIP_MENU(1837, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + player->SEND_GOSSIP_MENU(1838, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + player->CLOSE_GOSSIP_MENU(); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (!player->GetQuestRewardStatus(3181) == 1) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +void AddSC_loch_modan() +{ + new npc_mountaineer_pebblebitty(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp new file mode 100644 index 00000000000..5ff95f83f25 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp @@ -0,0 +1,173 @@ +/* + * 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 . + */ + +/* Script Data Start +SDName: Redridge Mountains +SD%Complete: 100% +SDComment: Support for quest 219. +Script Data End */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +enum eCorporalKeeshan +{ + QUEST_MISSING_IN_ACTION = 219, + + SAY_CORPORAL_1 = 0, + SAY_CORPORAL_2 = 1, + SAY_CORPORAL_3 = 2, + SAY_CORPORAL_4 = 3, + SAY_CORPORAL_5 = 4, + + SPELL_MOCKING_BLOW = 21008, + SPELL_SHIELD_BASH = 11972, +}; + +class npc_corporal_keeshan : public CreatureScript +{ +public: + npc_corporal_keeshan() : CreatureScript("npc_corporal_keeshan") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_MISSING_IN_ACTION) + { + CAST_AI(npc_corporal_keeshan::npc_corporal_keeshanAI, creature->AI())->Start(true, false, player->GetGUID(), quest); + creature->AI()->Talk(SAY_CORPORAL_1); + } + + return false; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_corporal_keeshanAI(creature); + } + + struct npc_corporal_keeshanAI : public npc_escortAI + { + npc_corporal_keeshanAI(Creature* creature) : npc_escortAI(creature) {} + + uint32 uiPhase; + uint32 uiTimer; + uint32 uiMockingBlowTimer; + uint32 uiShieldBashTimer; + + void Reset() + { + uiTimer = 0; + uiPhase = 0; + uiMockingBlowTimer = 5000; + uiShieldBashTimer = 8000; + } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + if (waypointId >= 65 && me->GetUnitMovementFlags() == MOVEMENTFLAG_WALKING) + me->SetWalk(false); + + switch (waypointId) + { + case 39: + SetEscortPaused(true); + uiTimer = 2000; + uiPhase = 1; + break; + case 65: + me->SetWalk(false); + break; + case 115: + player->AreaExploredOrEventHappens(QUEST_MISSING_IN_ACTION); + uiTimer = 2000; + uiPhase = 4; + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (HasEscortState(STATE_ESCORT_NONE)) + return; + + npc_escortAI::UpdateAI(uiDiff); + + if (uiPhase) + { + if (uiTimer <= uiDiff) + { + switch (uiPhase) + { + case 1: + me->SetStandState(UNIT_STAND_STATE_SIT); + uiTimer = 1000; + uiPhase = 2; + break; + case 2: + Talk(SAY_CORPORAL_2); + uiTimer = 15000; + uiPhase = 3; + break; + case 3: + Talk(SAY_CORPORAL_3); + me->SetStandState(UNIT_STAND_STATE_STAND); + SetEscortPaused(false); + uiTimer = 0; + uiPhase = 0; + break; + case 4: + Talk(SAY_CORPORAL_4); + uiTimer = 2500; + uiPhase = 5; + case 5: + Talk(SAY_CORPORAL_5); + uiTimer = 0; + uiPhase = 0; + } + } else uiTimer -= uiDiff; + } + + if (!UpdateVictim()) + return; + + if (uiMockingBlowTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_MOCKING_BLOW); + uiMockingBlowTimer = 5000; + } else uiMockingBlowTimer -= uiDiff; + + if (uiShieldBashTimer <= uiDiff) + { + DoCast(me->getVictim(), SPELL_MOCKING_BLOW); + uiShieldBashTimer = 8000; + } else uiShieldBashTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + }; +}; + +void AddSC_redridge_mountains() +{ + new npc_corporal_keeshan(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp new file mode 100644 index 00000000000..e750faefbf5 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp @@ -0,0 +1,111 @@ +/* + * 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: Silvermoon_City +SD%Complete: 100 +SDComment: Quest support: 9685 +SDCategory: Silvermoon City +EndScriptData */ + +/* ContentData +npc_blood_knight_stillblade +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" +#include "SpellInfo.h" + +/*####### +# npc_blood_knight_stillblade +#######*/ +enum eStillbladeData +{ + SAY_HEAL = 0, + + QUEST_REDEEMING_THE_DEAD = 9685, + SPELL_SHIMMERING_VESSEL = 31225, + SPELL_REVIVE_SELF = 32343, +}; + +class npc_blood_knight_stillblade : public CreatureScript +{ +public: + npc_blood_knight_stillblade() : CreatureScript("npc_blood_knight_stillblade") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_blood_knight_stillbladeAI (creature); + } + + struct npc_blood_knight_stillbladeAI : public ScriptedAI + { + npc_blood_knight_stillbladeAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 lifeTimer; + bool spellHit; + + void Reset() + { + lifeTimer = 120000; + me->SetStandState(UNIT_STAND_STATE_DEAD); + me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7); // lay down + spellHit = false; + } + + void EnterCombat(Unit* /*who*/) + { + } + + void MoveInLineOfSight(Unit* /*who*/) + { + } + + void UpdateAI(const uint32 diff) + { + if (me->IsStandState()) + { + if (lifeTimer <= diff) + me->AI()->EnterEvadeMode(); + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit* Hitter, const SpellInfo* Spellkind) + { + if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && + (Hitter->GetTypeId() == TYPEID_PLAYER) && (CAST_PLR(Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) + { + CAST_PLR(Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); + DoCast(me, SPELL_REVIVE_SELF); + me->SetStandState(UNIT_STAND_STATE_STAND); + me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //me->RemoveAllAuras(); + Talk(SAY_HEAL); + spellHit = true; + } + } + }; +}; + +void AddSC_silvermoon_city() +{ + new npc_blood_knight_stillblade(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp new file mode 100644 index 00000000000..290f7fa6882 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.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: Silverpine_Forest +SD%Complete: 100 +SDComment: Quest support: 435, 452 +SDCategory: Silverpine Forest +EndScriptData */ + +/* ContentData +npc_deathstalker_erland +pyrewood_ambush +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_deathstalker_erland +######*/ + +enum eErland +{ + SAY_QUESTACCEPT = 0, + SAY_START = 1, + SAY_AGGRO = 2, + SAY_PROGRESS = 3, + SAY_LAST = 4, + + SAY_RANE = 0, + SAY_RANE_ANSWER = 5, + SAY_MOVE_QUINN = 6, + + SAY_QUINN = 7, + SAY_QUINN_ANSWER = 0, + SAY_BYE = 8, + + QUEST_ESCORTING = 435, + NPC_RANE = 1950, + NPC_QUINN = 1951 +}; + +class npc_deathstalker_erland : public CreatureScript +{ +public: + npc_deathstalker_erland() : CreatureScript("npc_deathstalker_erland") { } + + struct npc_deathstalker_erlandAI : public npc_escortAI + { + npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) {} + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 1: + Talk(SAY_START, player->GetGUID()); + break; + case 10: + Talk(SAY_PROGRESS); + break; + case 13: + Talk(SAY_LAST, player->GetGUID()); + player->GroupEventHappens(QUEST_ESCORTING, me); + break; + case 15: + if (Creature* rane = me->FindNearestCreature(NPC_RANE, 20.0f)) + rane->AI()->Talk(SAY_RANE); + break; + case 16: + Talk(SAY_RANE_ANSWER); + break; + case 17: + Talk(SAY_MOVE_QUINN); + break; + case 24: + Talk(SAY_QUINN); + break; + case 25: + if (Creature* quinn = me->FindNearestCreature(NPC_QUINN, 20.0f)) + quinn->AI()->Talk(SAY_QUINN_ANSWER); + break; + case 26: + Talk(SAY_BYE); + break; + } + } + + void Reset() {} + + void EnterCombat(Unit* who) + { + Talk(SAY_AGGRO, who->GetGUID()); + } + }; + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_ESCORTING) + { + creature->AI()->Talk(SAY_QUESTACCEPT, player->GetGUID()); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_deathstalker_erland::npc_deathstalker_erlandAI, creature->AI())) + pEscortAI->Start(true, false, player->GetGUID()); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_deathstalker_erlandAI(creature); + } +}; + +/*###### +## pyrewood_ambush +#######*/ + +#define QUEST_PYREWOOD_AMBUSH 452 + +#define NPCSAY_INIT "Get ready, they'll be arriving any minute..." //not blizzlike +#define NPCSAY_END "Thanks for your help!" //not blizzlike + +static float PyrewoodSpawnPoints[3][4] = +{ + //pos_x pos_y pos_z orien + //outside + /* + {-400.85f, 1513.64f, 18.67f, 0}, + {-397.32f, 1514.12f, 18.67f, 0}, + {-397.44f, 1511.09f, 18.67f, 0}, + */ + //door + {-396.17f, 1505.86f, 19.77f, 0}, + {-396.91f, 1505.77f, 19.77f, 0}, + {-397.94f, 1504.74f, 19.77f, 0}, +}; + +#define WAIT_SECS 6000 + +class pyrewood_ambush : public CreatureScript +{ +public: + pyrewood_ambush() : CreatureScript("pyrewood_ambush") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest *quest) + { + if (quest->GetQuestId() == QUEST_PYREWOOD_AMBUSH && !CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress) + { + CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->QuestInProgress = true; + CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->Phase = 0; + CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->KillCount = 0; + CAST_AI(pyrewood_ambush::pyrewood_ambushAI, creature->AI())->PlayerGUID = player->GetGUID(); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new pyrewood_ambushAI (creature); + } + + struct pyrewood_ambushAI : public ScriptedAI + { + pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) + { + QuestInProgress = false; + } + + uint32 Phase; + int8 KillCount; + uint32 WaitTimer; + uint64 PlayerGUID; + SummonList Summons; + + bool QuestInProgress; + + void Reset() + { + WaitTimer = WAIT_SECS; + + if (!QuestInProgress) //fix reset values (see UpdateVictim) + { + Phase = 0; + KillCount = 0; + PlayerGUID = 0; + Summons.DespawnAll(); + } + } + + void EnterCombat(Unit* /*who*/){} + + void JustSummoned(Creature* summoned) + { + Summons.Summon(summoned); + ++KillCount; + } + + void SummonedCreatureDespawn(Creature* summoned) + { + Summons.Despawn(summoned); + --KillCount; + } + + void SummonCreatureWithRandomTarget(uint32 creatureId, int position) + { + if (Creature* summoned = me->SummonCreature(creatureId, PyrewoodSpawnPoints[position][0], PyrewoodSpawnPoints[position][1], PyrewoodSpawnPoints[position][2], PyrewoodSpawnPoints[position][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) + { + Unit* target = NULL; + if (PlayerGUID) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + if (player->isAlive() && RAND(0, 1)) + target = player; + + if (!target) + target = me; + + summoned->setFaction(168); + summoned->AddThreat(target, 32.0f); + summoned->AI()->AttackStart(target); + } + } + + void JustDied(Unit* /*killer*/) + { + if (PlayerGUID) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + if (player->GetQuestStatus(QUEST_PYREWOOD_AMBUSH) == QUEST_STATUS_INCOMPLETE) + player->FailQuest(QUEST_PYREWOOD_AMBUSH); + } + + void UpdateAI(const uint32 diff) + { + //sLog->outInfo(LOG_FILTER_TSCR, "DEBUG: p(%i) k(%i) d(%u) W(%i)", Phase, KillCount, diff, WaitTimer); + + if (!QuestInProgress) + return; + + if (KillCount && Phase < 6) + { + if (!UpdateVictim()) //reset() on target Despawn... + return; + + DoMeleeAttackIfReady(); + return; + } + + switch (Phase) + { + case 0: + if (WaitTimer == WAIT_SECS) + me->MonsterSay(NPCSAY_INIT, LANG_UNIVERSAL, 0); //no blizzlike + + if (WaitTimer <= diff) + { + WaitTimer -= diff; + return; + } + break; + case 1: + SummonCreatureWithRandomTarget(2060, 1); + break; + case 2: + SummonCreatureWithRandomTarget(2061, 2); + SummonCreatureWithRandomTarget(2062, 0); + break; + case 3: + SummonCreatureWithRandomTarget(2063, 1); + SummonCreatureWithRandomTarget(2064, 2); + SummonCreatureWithRandomTarget(2065, 0); + break; + case 4: + SummonCreatureWithRandomTarget(2066, 1); + SummonCreatureWithRandomTarget(2067, 0); + SummonCreatureWithRandomTarget(2068, 2); + break; + case 5: //end + if (PlayerGUID) + { + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) + { + me->MonsterSay(NPCSAY_END, LANG_UNIVERSAL, 0); //not blizzlike + player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); + } + } + QuestInProgress = false; + Reset(); + break; + } + ++Phase; //prepare next phase + } + }; +}; + +/*###### +## AddSC +######*/ + +void AddSC_silverpine_forest() +{ + new npc_deathstalker_erland(); + new pyrewood_ambush(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp new file mode 100644 index 00000000000..e81567a1a7a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp @@ -0,0 +1,647 @@ +/* + * 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: Stormwind_City +SD%Complete: 100 +SDComment: Quest support: 1640, 1447, 4185, 11223, 434. +SDCategory: Stormwind City +EndScriptData */ + +/* ContentData +npc_archmage_malin +npc_bartleby +npc_lady_katrana_prestor +npc_tyrion +npc_tyrion_spybot +npc_marzon_silent_blade +npc_lord_gregor_lescovar +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_archmage_malin +######*/ + +#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." + +class npc_archmage_malin : public CreatureScript +{ +public: + npc_archmage_malin() : CreatureScript("npc_archmage_malin") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF) + { + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, 42711, true); + } + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +/*###### +## npc_bartleby +######*/ + +enum eBartleby +{ + FACTION_ENEMY = 168, + QUEST_BEAT = 1640 +}; + +class npc_bartleby : public CreatureScript +{ +public: + npc_bartleby() : CreatureScript("npc_bartleby") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_BEAT) + { + creature->setFaction(FACTION_ENEMY); + creature->AI()->AttackStart(player); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_bartlebyAI(creature); + } + + struct npc_bartlebyAI : public ScriptedAI + { + npc_bartlebyAI(Creature* creature) : ScriptedAI(creature) + { + m_uiNormalFaction = creature->getFaction(); + } + + uint32 m_uiNormalFaction; + + void Reset() + { + if (me->getFaction() != m_uiNormalFaction) + me->setFaction(m_uiNormalFaction); + } + + void AttackedBy(Unit* pAttacker) + { + if (me->getVictim()) + return; + + if (me->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) + { + //Take 0 damage + uiDamage = 0; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); + EnterEvadeMode(); + } + } + }; +}; + +/*###### +## npc_lady_katrana_prestor +######*/ + +#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." +#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." +#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." +#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." + +class npc_lady_katrana_prestor : public CreatureScript +{ +public: + npc_lady_katrana_prestor() : CreatureScript("npc_lady_katrana_prestor") { } + + 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_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(2694, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + player->SEND_GOSSIP_MENU(2695, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + player->SEND_GOSSIP_MENU(2696, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(4185); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(2693, creature->GetGUID()); + + return true; + } +}; + +/*###### +## npc_lord_gregor_lescovar +######*/ + +enum eLordGregorLescovar +{ + SAY_GUARD_2 = 0, + SAY_LESCOVAR_2 = 0, + SAY_LESCOVAR_3 = 1, + SAY_LESCOVAR_4 = 2, + SAY_MARZON_1 = 0, + SAY_MARZON_2 = 1, + SAY_TYRION_2 = 1, + + NPC_STORMWIND_ROYAL = 1756, + NPC_MARZON_BLADE = 1755, + NPC_TYRION = 7766, + + QUEST_THE_ATTACK = 434 +}; + +class npc_lord_gregor_lescovar : public CreatureScript +{ +public: + npc_lord_gregor_lescovar() : CreatureScript("npc_lord_gregor_lescovar") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_lord_gregor_lescovarAI(creature); + } + + struct npc_lord_gregor_lescovarAI : public npc_escortAI + { + npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature) + { + creature->RestoreFaction(); + } + + uint32 uiTimer; + uint32 uiPhase; + + uint64 MarzonGUID; + + void Reset() + { + uiTimer = 0; + uiPhase = 0; + + MarzonGUID = 0; + } + + void EnterEvadeMode() + { + me->DisappearAndDie(); + + if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) + { + if (pMarzon->isAlive()) + pMarzon->DisappearAndDie(); + } + } + + void EnterCombat(Unit* who) + { + if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) + { + if (pMarzon->isAlive() && !pMarzon->isInCombat()) + pMarzon->AI()->AttackStart(who); + } + } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 14: + SetEscortPaused(true); + Talk(SAY_LESCOVAR_2); + uiTimer = 3000; + uiPhase = 1; + break; + case 16: + SetEscortPaused(true); + if (Creature* pMarzon = me->SummonCreature(NPC_MARZON_BLADE, -8411.360352f, 480.069733f, 123.760895f, 4.941504f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000)) + { + pMarzon->GetMotionMaster()->MovePoint(0, -8408.000977f, 468.611450f, 123.759903f); + MarzonGUID = pMarzon->GetGUID(); + } + uiTimer = 2000; + uiPhase = 4; + break; + } + } + //TO-DO: We don't have movemaps, also we can't make 2 npcs walks to one point propperly (and we can not use escort ai, because they are 2 different spawns and with same entry), because of it we make them, disappear. + void DoGuardsDisappearAndDie() + { + std::list GuardList; + me->GetCreatureListWithEntryInGrid(GuardList, NPC_STORMWIND_ROYAL, 8.0f); + if (!GuardList.empty()) + { + for (std::list::const_iterator itr = GuardList.begin(); itr != GuardList.end(); ++itr) + { + if (Creature* pGuard = *itr) + pGuard->DisappearAndDie(); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (uiPhase) + { + if (uiTimer <= uiDiff) + { + switch (uiPhase) + { + case 1: + if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 8.0f, true)) + pGuard->AI()->Talk(SAY_GUARD_2); + uiTimer = 3000; + uiPhase = 2; + break; + case 2: + DoGuardsDisappearAndDie(); + uiTimer = 2000; + uiPhase = 3; + break; + case 3: + SetEscortPaused(false); + uiTimer = 0; + uiPhase = 0; + break; + case 4: + Talk(SAY_LESCOVAR_3); + uiTimer = 0; + uiPhase = 0; + break; + case 5: + if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) + pMarzon->AI()->Talk(SAY_MARZON_1); + uiTimer = 3000; + uiPhase = 6; + break; + case 6: + Talk(SAY_LESCOVAR_4); + if (Player* player = GetPlayerForEscort()) + player->AreaExploredOrEventHappens(QUEST_THE_ATTACK); + uiTimer = 2000; + uiPhase = 7; + break; + case 7: + if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 20.0f, true)) + pTyrion->AI()->Talk(SAY_TYRION_2); + if (Creature* pMarzon = Unit::GetCreature(*me, MarzonGUID)) + pMarzon->setFaction(14); + me->setFaction(14); + uiTimer = 0; + uiPhase = 0; + break; + } + } else uiTimer -= uiDiff; + } + npc_escortAI::UpdateAI(uiDiff); + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## npc_marzon_silent_blade +######*/ + +class npc_marzon_silent_blade : public CreatureScript +{ +public: + npc_marzon_silent_blade() : CreatureScript("npc_marzon_silent_blade") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_marzon_silent_bladeAI(creature); + } + + struct npc_marzon_silent_bladeAI : public ScriptedAI + { + npc_marzon_silent_bladeAI(Creature* creature) : ScriptedAI(creature) + { + me->SetWalk(true); + } + + void Reset() + { + me->RestoreFaction(); + } + + void EnterCombat(Unit* who) + { + Talk(SAY_MARZON_2); + + if (me->isSummon()) + { + if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + { + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive() && !summoner->isInCombat()) + summoner->ToCreature()->AI()->AttackStart(who); + } + } + } + + void EnterEvadeMode() + { + me->DisappearAndDie(); + + if (me->isSummon()) + { + if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + { + if (summoner->GetTypeId() == TYPEID_UNIT && summoner->isAlive()) + summoner->ToCreature()->DisappearAndDie(); + } + } + } + + void MovementInform(uint32 uiType, uint32 /*uiId*/) + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (me->isSummon()) + { + Unit* summoner = me->ToTempSummon()->GetSummoner(); + if (summoner && summoner->GetTypeId() == TYPEID_UNIT && summoner->IsAIEnabled) + { + npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI* ai = + CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, summoner->GetAI()); + if (ai) + { + ai->uiTimer = 2000; + ai->uiPhase = 5; + } + //me->ChangeOrient(0.0f, summoner); + } + } + } + + void UpdateAI(const uint32 /*diff*/) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## npc_tyrion_spybot +######*/ + +enum eTyrionSpybot +{ + SAY_QUEST_ACCEPT_ATTACK = 0, + SAY_SPYBOT_1 = 1, + SAY_SPYBOT_2 = 2, + SAY_SPYBOT_3 = 3, + SAY_SPYBOT_4 = 4, + SAY_TYRION_1 = 0, + SAY_GUARD_1 = 1, + SAY_LESCOVAR_1 = 3, + + NPC_PRIESTESS_TYRIONA = 7779, + NPC_LORD_GREGOR_LESCOVAR = 1754, +}; + +class npc_tyrion_spybot : public CreatureScript +{ +public: + npc_tyrion_spybot() : CreatureScript("npc_tyrion_spybot") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_tyrion_spybotAI(creature); + } + + struct npc_tyrion_spybotAI : public npc_escortAI + { + npc_tyrion_spybotAI(Creature* creature) : npc_escortAI(creature) {} + + uint32 uiTimer; + uint32 uiPhase; + + void Reset() + { + uiTimer = 0; + uiPhase = 0; + } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 1: + SetEscortPaused(true); + uiTimer = 2000; + uiPhase = 1; + break; + case 5: + SetEscortPaused(true); + Talk(SAY_SPYBOT_1); + uiTimer = 2000; + uiPhase = 5; + break; + case 17: + SetEscortPaused(true); + Talk(SAY_SPYBOT_3); + uiTimer = 3000; + uiPhase = 8; + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (uiPhase) + { + if (uiTimer <= uiDiff) + { + switch (uiPhase) + { + case 1: + Talk(SAY_QUEST_ACCEPT_ATTACK); + uiTimer = 3000; + uiPhase = 2; + break; + case 2: + if (Creature* pTyrion = me->FindNearestCreature(NPC_TYRION, 10.0f)) + pTyrion->AI()->Talk(SAY_TYRION_1); + uiTimer = 3000; + uiPhase = 3; + break; + case 3: + me->UpdateEntry(NPC_PRIESTESS_TYRIONA, ALLIANCE); + uiTimer = 2000; + uiPhase = 4; + break; + case 4: + SetEscortPaused(false); + uiPhase = 0; + uiTimer = 0; + break; + case 5: + if (Creature* pGuard = me->FindNearestCreature(NPC_STORMWIND_ROYAL, 10.0f, true)) + pGuard->AI()->Talk(SAY_GUARD_1); + uiTimer = 3000; + uiPhase = 6; + break; + case 6: + Talk(SAY_SPYBOT_2); + uiTimer = 3000; + uiPhase = 7; + break; + case 7: + SetEscortPaused(false); + uiTimer = 0; + uiPhase = 0; + break; + case 8: + if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) + pLescovar->AI()->Talk(SAY_LESCOVAR_1); + uiTimer = 3000; + uiPhase = 9; + break; + case 9: + Talk(SAY_SPYBOT_4); + uiTimer = 3000; + uiPhase = 10; + break; + case 10: + if (Creature* pLescovar = me->FindNearestCreature(NPC_LORD_GREGOR_LESCOVAR, 10.0f)) + { + if (Player* player = GetPlayerForEscort()) + { + CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->Start(false, false, player->GetGUID()); + CAST_AI(npc_lord_gregor_lescovar::npc_lord_gregor_lescovarAI, pLescovar->AI())->SetMaxPlayerDistance(200.0f); + } + } + me->DisappearAndDie(); + uiTimer = 0; + uiPhase = 0; + break; + } + } else uiTimer -= uiDiff; + } + npc_escortAI::UpdateAI(uiDiff); + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## npc_tyrion +######*/ + +enum eTyrion +{ + NPC_TYRION_SPYBOT = 8856 +}; + +class npc_tyrion : public CreatureScript +{ +public: + npc_tyrion() : CreatureScript("npc_tyrion") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_THE_ATTACK) + { + if (Creature* pSpybot = creature->FindNearestCreature(NPC_TYRION_SPYBOT, 5.0f, true)) + { + CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->Start(false, false, player->GetGUID()); + CAST_AI(npc_tyrion_spybot::npc_tyrion_spybotAI, pSpybot->AI())->SetMaxPlayerDistance(200.0f); + } + return true; + } + return false; + } +}; + +void AddSC_stormwind_city() +{ + new npc_archmage_malin(); + new npc_bartleby(); + new npc_lady_katrana_prestor(); + new npc_tyrion(); + new npc_tyrion_spybot(); + new npc_lord_gregor_lescovar(); + new npc_marzon_silent_blade(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp new file mode 100644 index 00000000000..6e14ef840a3 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp @@ -0,0 +1,129 @@ +/* + * 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: Stranglethorn_Vale +SD%Complete: 100 +SDComment: Quest support: 592 +SDCategory: Stranglethorn Vale +EndScriptData */ + +/* ContentData +mob_yenniku +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" +#include "SpellInfo.h" + +/*###### +## mob_yenniku +######*/ + +class mob_yenniku : public CreatureScript +{ +public: + mob_yenniku() : CreatureScript("mob_yenniku") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new mob_yennikuAI (creature); + } + + struct mob_yennikuAI : public ScriptedAI + { + mob_yennikuAI(Creature* creature) : ScriptedAI(creature) + { + bReset = false; + } + + uint32 Reset_Timer; + bool bReset; + + void Reset() + { + Reset_Timer = 0; + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + } + + void SpellHit(Unit* caster, const SpellInfo* spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + //Yenniku's Release + if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) + { + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + me->CombatStop(); //stop combat + me->DeleteThreatList(); //unsure of this + me->setFaction(83); //horde generic + + bReset = true; + Reset_Timer = 60000; + } + } + return; + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (bReset) + { + if (Reset_Timer <= diff) + { + EnterEvadeMode(); + bReset = false; + me->setFaction(28); //troll, bloodscalp + return; + } + else Reset_Timer -= diff; + + if (me->isInCombat() && me->getVictim()) + { + if (me->getVictim()->GetTypeId() == TYPEID_PLAYER) + { + Unit* victim = me->getVictim(); + if (CAST_PLR(victim)->GetTeam() == HORDE) + { + me->CombatStop(); + me->DeleteThreatList(); + } + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## +######*/ + +void AddSC_stranglethorn_vale() +{ + new mob_yenniku(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp new file mode 100644 index 00000000000..f686de5d88f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp @@ -0,0 +1,155 @@ +/* + * 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 . + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_galen_goodward +######*/ + +enum Galen +{ + QUEST_GALENS_ESCAPE = 1393, + + GO_GALENS_CAGE = 37118, + + SAY_PERIODIC = 0, + SAY_QUEST_ACCEPTED = 1, + SAY_ATTACKED = 2, + SAY_QUEST_COMPLETE = 3, + EMOTE_WHISPER = 4, + EMOTE_DISAPPEAR = 5, +}; + +class npc_galen_goodward : public CreatureScript +{ +public: + + npc_galen_goodward() : CreatureScript("npc_galen_goodward") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_GALENS_ESCAPE) + { + CAST_AI(npc_galen_goodward::npc_galen_goodwardAI, creature->AI())->Start(false, false, player->GetGUID()); + creature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + creature->AI()->Talk(SAY_QUEST_ACCEPTED); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_galen_goodwardAI(creature); + } + + struct npc_galen_goodwardAI : public npc_escortAI + { + npc_galen_goodwardAI(Creature* creature) : npc_escortAI(creature) + { + m_uiGalensCageGUID = 0; + Reset(); + } + + uint64 m_uiGalensCageGUID; + uint32 m_uiPeriodicSay; + + void Reset() + { + m_uiPeriodicSay = 6000; + } + + void EnterCombat(Unit* who) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + Talk(SAY_ATTACKED, who->GetGUID()); + } + + void WaypointStart(uint32 uiPointId) + { + switch (uiPointId) + { + case 0: + { + GameObject* pCage = NULL; + if (m_uiGalensCageGUID) + pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID); + else + pCage = GetClosestGameObjectWithEntry(me, GO_GALENS_CAGE, INTERACTION_DISTANCE); + if (pCage) + { + pCage->UseDoorOrButton(); + m_uiGalensCageGUID = pCage->GetGUID(); + } + break; + } + case 21: + Talk(EMOTE_DISAPPEAR); + break; + } + } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 0: + if (GameObject* pCage = me->GetMap()->GetGameObject(m_uiGalensCageGUID)) + pCage->ResetDoorOrButton(); + break; + case 20: + if (Player* player = GetPlayerForEscort()) + { + me->SetFacingToObject(player); + Talk(SAY_QUEST_COMPLETE, player->GetGUID()); + Talk(EMOTE_WHISPER, player->GetGUID()); + player->GroupEventHappens(QUEST_GALENS_ESCAPE, me); + } + SetRun(true); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + + if (HasEscortState(STATE_ESCORT_NONE)) + return; + + if (m_uiPeriodicSay < uiDiff) + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + Talk(SAY_PERIODIC); + m_uiPeriodicSay = 15000; + } + else + m_uiPeriodicSay -= uiDiff; + + DoMeleeAttackIfReady(); + } + }; +}; + +void AddSC_swamp_of_sorrows() +{ + new npc_galen_goodward(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp new file mode 100644 index 00000000000..f36220dec0f --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp @@ -0,0 +1,217 @@ +/* + * 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: Tirisfal_Glades +SD%Complete: 100 +SDComment: Quest support: 590, 1819 +SDCategory: Tirisfal Glades +EndScriptData */ + +/* ContentData +npc_calvin_montague +go_mausoleum_door +go_mausoleum_trigger +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" + +/*###### +## npc_calvin_montague +######*/ + +enum Calvin +{ + SAY_COMPLETE = 0, + SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) + QUEST_590 = 590, + FACTION_HOSTILE = 168 +}; + +class npc_calvin_montague : public CreatureScript +{ +public: + npc_calvin_montague() : CreatureScript("npc_calvin_montague") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_590) + { + creature->setFaction(FACTION_HOSTILE); + creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + CAST_AI(npc_calvin_montague::npc_calvin_montagueAI, creature->AI())->AttackStart(player); + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_calvin_montagueAI (creature); + } + + struct npc_calvin_montagueAI : public ScriptedAI + { + npc_calvin_montagueAI(Creature* creature) : ScriptedAI(creature) { } + + uint32 m_uiPhase; + uint32 m_uiPhaseTimer; + uint64 m_uiPlayerGUID; + + void Reset() + { + m_uiPhase = 0; + m_uiPhaseTimer = 5000; + m_uiPlayerGUID = 0; + + me->RestoreFaction(); + + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + } + + void EnterCombat(Unit* /*who*/) {} + + void AttackedBy(Unit* pAttacker) + { + if (me->getVictim() || me->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > me->GetHealth() || me->HealthBelowPctDamaged(15, uiDamage)) + { + uiDamage = 0; + + me->RestoreFaction(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->CombatStop(true); + + m_uiPhase = 1; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + m_uiPlayerGUID = pDoneBy->GetGUID(); + } + } + + void UpdateAI(uint32 const diff) + { + if (m_uiPhase) + { + if (m_uiPhaseTimer <= diff) + m_uiPhaseTimer = 7500; + else + { + m_uiPhaseTimer -= diff; + return; + } + + switch (m_uiPhase) + { + case 1: + Talk(SAY_COMPLETE); + ++m_uiPhase; + break; + case 2: + if (Player* player = Unit::GetPlayer(*me, m_uiPlayerGUID)) + player->AreaExploredOrEventHappens(QUEST_590); + + DoCast(me, SPELL_DRINK, true); + ++m_uiPhase; + break; + case 3: + EnterEvadeMode(); + break; + } + + return; + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## go_mausoleum_door +## go_mausoleum_trigger +######*/ + +enum eMausoleum +{ + QUEST_ULAG = 1819, + NPC_ULAG = 6390, + GO_TRIGGER = 104593, + GO_DOOR = 176594 +}; + +class go_mausoleum_door : public GameObjectScript +{ +public: + go_mausoleum_door() : GameObjectScript("go_mausoleum_door") { } + + bool OnGossipHello(Player* player, GameObject* /*go*/) + { + if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) + return false; + + if (GameObject* pTrigger = player->FindNearestGameObject(GO_TRIGGER, 30.0f)) + { + pTrigger->SetGoState(GO_STATE_READY); + player->SummonCreature(NPC_ULAG, 2390.26f, 336.47f, 40.01f, 2.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + return false; + } + + return false; + } +}; + +class go_mausoleum_trigger : public GameObjectScript +{ +public: + go_mausoleum_trigger() : GameObjectScript("go_mausoleum_trigger") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) + return false; + + if (GameObject* pDoor = player->FindNearestGameObject(GO_DOOR, 30.0f)) + { + go->SetGoState(GO_STATE_ACTIVE); + pDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); + return true; + } + + return false; + } +}; + +void AddSC_tirisfal_glades() +{ + new npc_calvin_montague(); + new go_mausoleum_door(); + new go_mausoleum_trigger(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp new file mode 100644 index 00000000000..2c3017a2f1a --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp @@ -0,0 +1,334 @@ +/* + * 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: Undercity +SD%Complete: 95 +SDComment: Quest support: 6628, 9180(post-event). +SDCategory: Undercity +EndScriptData */ + +/* ContentData +npc_lady_sylvanas_windrunner +npc_highborne_lamenter +npc_parqual_fintallas +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Player.h" + +/*###### +## npc_lady_sylvanas_windrunner +######*/ + +enum Sylvanas +{ + QUEST_JOURNEY_TO_UNDERCITY = 9180, + EMOTE_LAMENT_END = 0, + SAY_LAMENT_END = 1, + + SOUND_CREDIT = 10896, + ENTRY_HIGHBORNE_LAMENTER = 21628, + ENTRY_HIGHBORNE_BUNNY = 21641, + + SPELL_HIGHBORNE_AURA = 37090, + SPELL_SYLVANAS_CAST = 36568, + SPELL_RIBBON_OF_SOULS = 34432, // the real one to use might be 37099 + + // Combat spells + SPELL_BLACK_ARROW = 59712, + SPELL_FADE = 20672, + SPELL_FADE_BLINK = 29211, + SPELL_MULTI_SHOT = 59713, + SPELL_SHOT = 59710, + SPELL_SUMMON_SKELETON = 59711 +}; + +float HighborneLoc[4][3]= +{ + {1285.41f, 312.47f, 0.51f}, + {1286.96f, 310.40f, 1.00f}, + {1289.66f, 309.66f, 1.52f}, + {1292.51f, 310.50f, 1.99f}, +}; + +#define HIGHBORNE_LOC_Y -61.00f +#define HIGHBORNE_LOC_Y_NEW -55.50f + +class npc_lady_sylvanas_windrunner : public CreatureScript +{ +public: + npc_lady_sylvanas_windrunner() : CreatureScript("npc_lady_sylvanas_windrunner") { } + + bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest *_Quest, uint32 /*slot*/) + { + if (_Quest->GetQuestId() == QUEST_JOURNEY_TO_UNDERCITY) + { + CAST_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->LamentEvent = true; + CAST_AI(npc_lady_sylvanas_windrunner::npc_lady_sylvanas_windrunnerAI, creature->AI())->DoPlaySoundToSet(creature, SOUND_CREDIT); + creature->CastSpell(creature, SPELL_SYLVANAS_CAST, false); + + for (uint8 i = 0; i < 4; ++i) + creature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_lady_sylvanas_windrunnerAI (creature); + } + + struct npc_lady_sylvanas_windrunnerAI : public ScriptedAI + { + npc_lady_sylvanas_windrunnerAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 LamentEventTimer; + bool LamentEvent; + uint64 targetGUID; + + uint32 FadeTimer; + uint32 SummonSkeletonTimer; + uint32 BlackArrowTimer; + uint32 ShotTimer; + uint32 MultiShotTimer; + + void Reset() + { + LamentEventTimer = 5000; + LamentEvent = false; + targetGUID = 0; + + FadeTimer = 30000; + SummonSkeletonTimer = 20000; + BlackArrowTimer = 15000; + ShotTimer = 8000; + MultiShotTimer = 10000; + } + + void EnterCombat(Unit* /*who*/) {} + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) + { + if (Creature* target = Unit::GetCreature(*summoned, targetGUID)) + { + target->MonsterMoveWithSpeed(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0); + target->SetPosition(target->GetPositionX(), target->GetPositionY(), me->GetPositionZ()+15.0f, 0.0f); + summoned->CastSpell(target, SPELL_RIBBON_OF_SOULS, false); + } + + summoned->SetDisableGravity(true); + targetGUID = summoned->GetGUID(); + } + } + + void UpdateAI(const uint32 diff) + { + if (LamentEvent) + { + if (LamentEventTimer <= diff) + { + DoSummon(ENTRY_HIGHBORNE_BUNNY, me, 10.0f, 3000, TEMPSUMMON_TIMED_DESPAWN); + + LamentEventTimer = 2000; + if (!me->HasAura(SPELL_SYLVANAS_CAST)) + { + Talk(SAY_LAMENT_END); + Talk(EMOTE_LAMENT_END); + LamentEvent = false; + } + } else LamentEventTimer -= diff; + } + + if (!UpdateVictim()) + return; + + // Combat spells + + if (FadeTimer <= diff) + { + DoCast(me, SPELL_FADE); + // add a blink to simulate a stealthed movement and reappearing elsewhere + DoCast(me, SPELL_FADE_BLINK); + FadeTimer = 30000 + rand()%5000; + // if the victim is out of melee range she cast multi shot + if (Unit* victim = me->getVictim()) + if (me->GetDistance(victim) > 10.0f) + DoCast(victim, SPELL_MULTI_SHOT); + } else FadeTimer -= diff; + + if (SummonSkeletonTimer <= diff) + { + DoCast(me, SPELL_SUMMON_SKELETON); + SummonSkeletonTimer = 20000 + rand()%10000; + } else SummonSkeletonTimer -= diff; + + if (BlackArrowTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_BLACK_ARROW); + BlackArrowTimer = 15000 + rand()%5000; + } + } else BlackArrowTimer -= diff; + + if (ShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_SHOT); + ShotTimer = 8000 + rand()%2000; + } + } else ShotTimer -= diff; + + if (MultiShotTimer <= diff) + { + if (Unit* victim = me->getVictim()) + { + DoCast(victim, SPELL_MULTI_SHOT); + MultiShotTimer = 10000 + rand()%3000; + } + } else MultiShotTimer -= diff; + + DoMeleeAttackIfReady(); + } + }; +}; + +/*###### +## npc_highborne_lamenter +######*/ + +class npc_highborne_lamenter : public CreatureScript +{ +public: + npc_highborne_lamenter() : CreatureScript("npc_highborne_lamenter") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_highborne_lamenterAI (creature); + } + + struct npc_highborne_lamenterAI : public ScriptedAI + { + npc_highborne_lamenterAI(Creature* creature) : ScriptedAI(creature) {} + + uint32 EventMoveTimer; + uint32 EventCastTimer; + bool EventMove; + bool EventCast; + + void Reset() + { + EventMoveTimer = 10000; + EventCastTimer = 17500; + EventMove = true; + EventCast = true; + } + + void EnterCombat(Unit* /*who*/) {} + + void UpdateAI(const uint32 diff) + { + if (EventMove) + { + if (EventMoveTimer <= diff) + { + me->SetDisableGravity(true); + me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetDistance(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW) / (5000 * 0.001f)); + me->SetPosition(me->GetPositionX(), me->GetPositionY(), HIGHBORNE_LOC_Y_NEW, me->GetOrientation()); + EventMove = false; + } else EventMoveTimer -= diff; + } + if (EventCast) + { + if (EventCastTimer <= diff) + { + DoCast(me, SPELL_HIGHBORNE_AURA); + EventCast = false; + } else EventCastTimer -= diff; + } + } + }; +}; + +/*###### +## npc_parqual_fintallas +######*/ + +#define SPELL_MARK_OF_SHAME 6767 + +#define GOSSIP_HPF1 "Gul'dan" +#define GOSSIP_HPF2 "Kel'Thuzad" +#define GOSSIP_HPF3 "Ner'zhul" + +class npc_parqual_fintallas : public CreatureScript +{ +public: + npc_parqual_fintallas() : CreatureScript("npc_parqual_fintallas") { } + + 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_MARK_OF_SHAME, false); + } + if (action == GOSSIP_ACTION_INFO_DEF+2) + { + player->CLOSE_GOSSIP_MENU(); + player->AreaExploredOrEventHappens(6628); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HPF3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->SEND_GOSSIP_MENU(5822, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(5821, creature->GetGUID()); + + return true; + } +}; + +/*###### +## AddSC +######*/ + +void AddSC_undercity() +{ + new npc_lady_sylvanas_windrunner(); + new npc_highborne_lamenter(); + new npc_parqual_fintallas(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp new file mode 100644 index 00000000000..ee22b766154 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp @@ -0,0 +1,419 @@ +/* + * 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: Western_Plaguelands +SD%Complete: 90 +SDComment: Quest support: 5097, 5098, 5216, 5219, 5222, 5225, 5229, 5231, 5233, 5235. To obtain Vitreous Focuser (could use more spesifics about gossip items) +SDCategory: Western Plaguelands +EndScriptData */ + +/* ContentData +npcs_dithers_and_arbington +npc_myranda_the_hag +npc_the_scourge_cauldron +npc_andorhal_tower +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "ScriptedEscortAI.h" +#include "Player.h" +#include "WorldSession.h" + +/*###### +## npcs_dithers_and_arbington +######*/ + +#define GOSSIP_HDA1 "What does the Felstone Field Cauldron need?" +#define GOSSIP_HDA2 "What does the Dalson's Tears Cauldron need?" +#define GOSSIP_HDA3 "What does the Writhing Haunt Cauldron need?" +#define GOSSIP_HDA4 "What does the Gahrron's Withering Cauldron need?" + +#define GOSSIP_SDA1 "Thanks, i need a Vitreous Focuser" + +class npcs_dithers_and_arbington : public CreatureScript +{ +public: + npcs_dithers_and_arbington() : CreatureScript("npcs_dithers_and_arbington") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + switch (action) + { + case GOSSIP_ACTION_TRADE: + player->GetSession()->SendListInventory(creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(3980, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(3981, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(3982, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->SEND_GOSSIP_MENU(3983, creature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + player->CLOSE_GOSSIP_MENU(); + creature->CastSpell(player, 17529, false); + break; + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (creature->isVendor()) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (player->GetQuestRewardStatus(5237) || player->GetQuestRewardStatus(5238)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->SEND_GOSSIP_MENU(3985, creature->GetGUID()); + } + else + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +/*###### +## npc_myranda_the_hag +######*/ + +enum eMyranda +{ + QUEST_SUBTERFUGE = 5862, + QUEST_IN_DREAMS = 5944, + SPELL_SCARLET_ILLUSION = 17961 +}; + +#define GOSSIP_ITEM_ILLUSION "I am ready for the illusion, Myranda." + +class npc_myranda_the_hag : public CreatureScript +{ +public: + npc_myranda_the_hag() : CreatureScript("npc_myranda_the_hag") { } + + bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF + 1) + { + player->CLOSE_GOSSIP_MENU(); + player->CastSpell(player, SPELL_SCARLET_ILLUSION, false); + } + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if (creature->isQuestGiver()) + player->PrepareQuestMenu(creature->GetGUID()); + + if (player->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE && + !player->GetQuestRewardStatus(QUEST_IN_DREAMS) && !player->HasAura(SPELL_SCARLET_ILLUSION)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ILLUSION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->SEND_GOSSIP_MENU(4773, creature->GetGUID()); + return true; + } + else + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + + return true; + } +}; + +/*###### +## npc_the_scourge_cauldron +######*/ + +class npc_the_scourge_cauldron : public CreatureScript +{ +public: + npc_the_scourge_cauldron() : CreatureScript("npc_the_scourge_cauldron") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_the_scourge_cauldronAI (creature); + } + + struct npc_the_scourge_cauldronAI : public ScriptedAI + { + npc_the_scourge_cauldronAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() {} + + void EnterCombat(Unit* /*who*/) {} + + void DoDie() + { + //summoner dies here + me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //override any database `spawntimesecs` to prevent duplicated summons + uint32 rTime = me->GetRespawnDelay(); + if (rTime<600) + me->SetRespawnDelay(600); + } + + void MoveInLineOfSight(Unit* who) + { + if (!who || who->GetTypeId() != TYPEID_PLAYER) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + switch (me->GetAreaId()) + { + case 199: //felstone + if (CAST_PLR(who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 200: //dalson + if (CAST_PLR(who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 201: //gahrron + if (CAST_PLR(who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 202: //writhing + if (CAST_PLR(who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || + CAST_PLR(who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) + { + me->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + } + } + } + }; +}; + +/*###### +## npcs_andorhal_tower +######*/ + +enum eAndorhalTower +{ + GO_BEACON_TORCH = 176093 +}; + +class npc_andorhal_tower : public CreatureScript +{ +public: + npc_andorhal_tower() : CreatureScript("npc_andorhal_tower") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_andorhal_towerAI (creature); + } + + struct npc_andorhal_towerAI : public Scripted_NoMovementAI + { + npc_andorhal_towerAI(Creature* creature) : Scripted_NoMovementAI(creature) {} + + void MoveInLineOfSight(Unit* who) + { + if (!who || who->GetTypeId() != TYPEID_PLAYER) + return; + + if (me->FindNearestGameObject(GO_BEACON_TORCH, 10.0f)) + CAST_PLR(who)->KilledMonsterCredit(me->GetEntry(), me->GetGUID()); + } + }; +}; + +/*###### +## npc_anchorite_truuen +######*/ + +enum eTruuen +{ + NPC_GHOST_UTHER = 17233, + NPC_THEL_DANIS = 1854, + NPC_GHOUL = 1791, //ambush + + QUEST_TOMB_LIGHTBRINGER = 9446, + + SAY_WP_0 = 0, //Beware! We are attacked! + SAY_WP_1 = 1, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed! + SAY_WP_2 = 2, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now... + SAY_WP_3 = 0, //Be welcome, friends! + SAY_WP_4 = 0, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart. + SAY_WP_5 = 1, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire. + SAY_WP_6 = 2 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here. +}; + +class npc_anchorite_truuen : public CreatureScript +{ +public: + npc_anchorite_truuen() : CreatureScript("npc_anchorite_truuen") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + npc_escortAI* pEscortAI = CAST_AI(npc_anchorite_truuen::npc_anchorite_truuenAI, creature->AI()); + + if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER) + pEscortAI->Start(true, true, player->GetGUID()); + return false; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_anchorite_truuenAI(creature); + } + + struct npc_anchorite_truuenAI : public npc_escortAI + { + npc_anchorite_truuenAI(Creature* creature) : npc_escortAI(creature) { } + + uint32 m_uiChatTimer; + + uint64 UghostGUID; + uint64 TheldanisGUID; + + Creature* Ughost; + Creature* Theldanis; + + void Reset() + { + m_uiChatTimer = 7000; + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == NPC_GHOUL) + summoned->AI()->AttackStart(me); + } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + + switch (waypointId) + { + case 8: + Talk(SAY_WP_0); + me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); + me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); + break; + case 9: + Talk(SAY_WP_1); + break; + case 14: + me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); + me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); + me->SummonCreature(NPC_GHOUL, me->GetPositionX()+10.0f, me->GetPositionY()+10.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); + me->SummonCreature(NPC_GHOUL, me->GetPositionX()+8.0f, me->GetPositionY()+8.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000); + break; + case 15: + Talk(SAY_WP_2); + case 21: + Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150); + if (Theldanis) + Theldanis->AI()->Talk(SAY_WP_3); + break; + case 22: + break; + case 23: + Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86f, -1825.42f, 81.99f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + if (Ughost) + { + Ughost->SetDisableGravity(true); + Ughost->AI()->Talk(SAY_WP_4, me->GetGUID()); + } + m_uiChatTimer = 4000; + break; + case 24: + if (Ughost) + Ughost->AI()->Talk(SAY_WP_5, me->GetGUID()); + m_uiChatTimer = 4000; + break; + case 25: + if (Ughost) + Ughost->AI()->Talk(SAY_WP_6, me->GetGUID()); + m_uiChatTimer = 4000; + break; + case 26: + if (player) + player->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me); + break; + } + } + + void EnterCombat(Unit* /*who*/){} + + void JustDied(Unit* /*killer*/) + { + if (Player* player = GetPlayerForEscort()) + player->FailQuest(QUEST_TOMB_LIGHTBRINGER); + } + + void UpdateAI(const uint32 uiDiff) + { + npc_escortAI::UpdateAI(uiDiff); + DoMeleeAttackIfReady(); + if (HasEscortState(STATE_ESCORT_ESCORTING)) + m_uiChatTimer = 6000; + } + }; +}; + +/*###### +## +######*/ + +void AddSC_western_plaguelands() +{ + new npcs_dithers_and_arbington(); + new npc_myranda_the_hag(); + new npc_the_scourge_cauldron(); + new npc_andorhal_tower(); + new npc_anchorite_truuen(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp new file mode 100644 index 00000000000..1b93cf1be71 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp @@ -0,0 +1,272 @@ +/* + * 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: Westfall +SD%Complete: 90 +SDComment: Quest support: 155, 1651 +SDCategory: Westfall +EndScriptData */ + +/* ContentData +npc_daphne_stilwell +npc_defias_traitor +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_daphne_stilwell +######*/ + +enum eEnums +{ + SAY_DS_START = 0, + SAY_DS_DOWN_1 = 1, + SAY_DS_DOWN_2 = 2, + SAY_DS_DOWN_3 = 3, + SAY_DS_PROLOGUE = 4, + + SPELL_SHOOT = 6660, + QUEST_TOME_VALOR = 1651, + NPC_DEFIAS_RAIDER = 6180, + EQUIP_ID_RIFLE = 2511 +}; + +class npc_daphne_stilwell : public CreatureScript +{ +public: + npc_daphne_stilwell() : CreatureScript("npc_daphne_stilwell") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_TOME_VALOR) + { + creature->AI()->Talk(SAY_DS_START); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_daphne_stilwell::npc_daphne_stilwellAI, creature->AI())) + pEscortAI->Start(true, true, player->GetGUID()); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_daphne_stilwellAI(creature); + } + + struct npc_daphne_stilwellAI : public npc_escortAI + { + npc_daphne_stilwellAI(Creature* creature) : npc_escortAI(creature) {} + + uint32 uiWPHolder; + uint32 uiShootTimer; + + void Reset() + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + switch (uiWPHolder) + { + case 7: + Talk(SAY_DS_DOWN_1); + break; + case 8: + Talk(SAY_DS_DOWN_2); + break; + case 9: + Talk(SAY_DS_DOWN_3); + break; + } + } + else + uiWPHolder = 0; + + uiShootTimer = 0; + } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + uiWPHolder = waypointId; + + switch (waypointId) + { + case 4: + SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); + me->SetSheath(SHEATH_STATE_RANGED); + me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE); + break; + case 7: + me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 8: + me->SetSheath(SHEATH_STATE_RANGED); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + me->SetSheath(SHEATH_STATE_RANGED); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + me->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018f, 1570.738f, 54.828f, 4.220f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 10: + SetRun(false); + break; + case 11: + Talk(SAY_DS_PROLOGUE); + break; + case 13: + SetEquipmentSlots(true); + me->SetSheath(SHEATH_STATE_UNARMED); + me->HandleEmoteCommand(EMOTE_STATE_USE_STANDING_NO_SHEATHE); + break; + case 17: + player->GroupEventHappens(QUEST_TOME_VALOR, me); + break; + } + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (me->Attack(who, false)) + { + me->AddThreat(who, 0.0f); + me->SetInCombatWith(who); + who->SetInCombatWith(me); + + me->GetMotionMaster()->MoveChase(who, 30.0f); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(me); + } + + void Update(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (uiShootTimer <= diff) + { + uiShootTimer = 1500; + + if (!me->IsWithinDist(me->getVictim(), ATTACK_DISTANCE)) + DoCast(me->getVictim(), SPELL_SHOOT); + } else uiShootTimer -= diff; + } + }; +}; + +/*###### +## npc_defias_traitor +######*/ +enum DefiasSays +{ + SAY_START = 0, + SAY_PROGRESS = 1, + SAY_END = 2, + SAY_AGGRO = 3 +}; + + +#define QUEST_DEFIAS_BROTHERHOOD 155 + +class npc_defias_traitor : public CreatureScript +{ +public: + npc_defias_traitor() : CreatureScript("npc_defias_traitor") { } + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) + { + if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitor::npc_defias_traitorAI, creature->AI())) + pEscortAI->Start(true, true, player->GetGUID()); + + creature->AI()->Talk(SAY_START, player->GetGUID()); + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_defias_traitorAI(creature); + } + + struct npc_defias_traitorAI : public npc_escortAI + { + npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } + + void WaypointReached(uint32 waypointId) + { + Player* player = GetPlayerForEscort(); + if (!player) + return; + + switch (waypointId) + { + case 35: + SetRun(false); + break; + case 36: + Talk(SAY_PROGRESS, player->GetGUID()); + break; + case 44: + Talk(SAY_END, player->GetGUID()); + player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); + break; + } + } + + void EnterCombat(Unit* who) + { + Talk(SAY_AGGRO, who->GetGUID()); + } + + void Reset() {} + }; +}; + +void AddSC_westfall() +{ + new npc_daphne_stilwell(); + new npc_defias_traitor(); +} diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp new file mode 100644 index 00000000000..c8a1fc2b2b4 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -0,0 +1,172 @@ +/* + * 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: Wetlands +SD%Complete: 80 +SDComment: Quest support: 1249 +SDCategory: Wetlands +EndScriptData */ + +/* ContentData +npc_mikhail +npc_tapoke_slim_jahn +EndContentData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedEscortAI.h" +#include "Player.h" + +/*###### +## npc_tapoke_slim_jahn +######*/ + +enum eTapokeSlim +{ + QUEST_MISSING_DIPLO_PT11 = 1249, + FACTION_ENEMY = 168, + SPELL_STEALTH = 1785, + SPELL_CALL_FRIENDS = 16457, //summons 1x friend + NPC_SLIMS_FRIEND = 4971, + NPC_TAPOKE_SLIM_JAHN = 4962 +}; + +class npc_tapoke_slim_jahn : public CreatureScript +{ +public: + npc_tapoke_slim_jahn() : CreatureScript("npc_tapoke_slim_jahn") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_tapoke_slim_jahnAI(creature); + } + + struct npc_tapoke_slim_jahnAI : public npc_escortAI + { + npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) { } + + bool IsFriendSummoned; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + IsFriendSummoned = false; + } + + void WaypointReached(uint32 waypointId) + { + switch (waypointId) + { + case 2: + if (me->HasStealthAura()) + me->RemoveAurasByType(SPELL_AURA_MOD_STEALTH); + SetRun(); + me->setFaction(FACTION_ENEMY); + break; + } + } + + void EnterCombat(Unit* /*who*/) + { + if (HasEscortState(STATE_ESCORT_ESCORTING) && !IsFriendSummoned && GetPlayerForEscort()) + { + for (uint8 i = 0; i < 3; ++i) + DoCast(me, SPELL_CALL_FRIENDS, true); + + IsFriendSummoned = true; + } + } + + void JustSummoned(Creature* summoned) + { + if (Player* player = GetPlayerForEscort()) + summoned->AI()->AttackStart(player); + } + + void AttackedBy(Unit* pAttacker) + { + if (me->getVictim()) + return; + + if (me->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* /*pDoneBy*/, uint32& uiDamage) + { + if (HealthBelowPct(20)) + { + if (Player* player = GetPlayerForEscort()) + { + if (player->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(player)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me); + + uiDamage = 0; + + me->RestoreFaction(); + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + + SetRun(false); + } + } + } + }; +}; + +/*###### +## npc_mikhail +######*/ + +class npc_mikhail : public CreatureScript +{ +public: + npc_mikhail() : CreatureScript("npc_mikhail") { } + + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) + { + if (quest->GetQuestId() == QUEST_MISSING_DIPLO_PT11) + { + Creature* pSlim = creature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f); + + if (!pSlim) + return false; + + if (!pSlim->HasStealthAura()) + pSlim->CastSpell(pSlim, SPELL_STEALTH, true); + + if (npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahn::npc_tapoke_slim_jahnAI, pSlim->AI())) + pEscortAI->Start(false, false, player->GetGUID(), quest); + } + return false; + } +}; + +/*###### +## AddSC +######*/ + +void AddSC_wetlands() +{ + new npc_tapoke_slim_jahn(); + new npc_mikhail(); +} -- cgit v1.2.3 From dbfc4b83aa64425cf14e8c40cc5605ca91d5b8f4 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 2 Jan 2013 15:08:13 -0330 Subject: Core/Scripting: Some file name updates. --- src/server/scripts/EasternKingdoms/CMakeLists.txt | 2 +- .../ScarletEnclave/the_scarlet_enclave.cpp | 124 --------------------- .../ScarletEnclave/zone_the_scarlet_enclave.cpp | 124 +++++++++++++++++++++ src/server/scripts/Northrend/CMakeLists.txt | 4 +- .../Nexus/Nexus/boss_commander_kolurg.cpp | 75 +++++++++++++ .../Nexus/Nexus/boss_commander_stoutbeard.cpp | 71 ++++++++++++ .../Northrend/Nexus/Nexus/commander_kolurg.cpp | 75 ------------- .../Northrend/Nexus/Nexus/commander_stoutbeard.cpp | 71 ------------ 8 files changed, 273 insertions(+), 273 deletions(-) delete mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp create mode 100644 src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp create mode 100644 src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp create mode 100644 src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp delete mode 100644 src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp delete mode 100644 src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index bbdbe396a95..15faf9dfb83 100644 --- a/src/server/scripts/EasternKingdoms/CMakeLists.txt +++ b/src/server/scripts/EasternKingdoms/CMakeLists.txt @@ -71,7 +71,7 @@ set(scripts_STAT_SRCS EasternKingdoms/ScarletEnclave/chapter2.cpp EasternKingdoms/ScarletEnclave/chapter5.cpp EasternKingdoms/ScarletEnclave/chapter1.cpp - EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp + EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp EasternKingdoms/zone_eastern_plaguelands.cpp EasternKingdoms/MoltenCore/boss_gehennas.cpp EasternKingdoms/MoltenCore/boss_lucifron.cpp diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp deleted file mode 100644 index a86b15a7f5c..00000000000 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ /dev/null @@ -1,124 +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 "PassiveAI.h" -#include "Player.h" - -/*#### -## npc_valkyr_battle_maiden -####*/ -#define SPELL_REVIVE 51918 -#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" - -class npc_valkyr_battle_maiden : public CreatureScript -{ -public: - npc_valkyr_battle_maiden() : CreatureScript("npc_valkyr_battle_maiden") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_valkyr_battle_maidenAI (creature); - } - - struct npc_valkyr_battle_maidenAI : public PassiveAI - { - npc_valkyr_battle_maidenAI(Creature* creature) : PassiveAI(creature) {} - - uint32 FlyBackTimer; - float x, y, z; - uint32 phase; - - void Reset() - { - me->setActive(true); - me->SetVisible(false); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetCanFly(true); - FlyBackTimer = 500; - phase = 0; - - me->GetPosition(x, y, z); - z += 4.0f; - x -= 3.5f; - y -= 5.0f; - me->GetMotionMaster()->Clear(false); - me->SetPosition(x, y, z, 0.0f); - } - - void UpdateAI(const uint32 diff) - { - if (FlyBackTimer <= diff) - { - Player* player = NULL; - if (me->isSummon()) - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - if (summoner->GetTypeId() == TYPEID_PLAYER) - player = CAST_PLR(summoner); - - if (!player) - phase = 3; - - switch (phase) - { - case 0: - me->SetWalk(false); - me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); - FlyBackTimer = 500; - break; - case 1: - player->GetClosePoint(x, y, z, me->GetObjectSize()); - z += 2.5f; - x -= 2.0f; - y -= 1.5f; - me->GetMotionMaster()->MovePoint(0, x, y, z); - me->SetTarget(player->GetGUID()); - me->SetVisible(true); - FlyBackTimer = 4500; - break; - case 2: - if (!player->isRessurectRequested()) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); - DoCast(player, SPELL_REVIVE, true); - me->MonsterWhisper(VALK_WHISPER, player->GetGUID()); - } - FlyBackTimer = 5000; - break; - case 3: - me->SetVisible(false); - FlyBackTimer = 3000; - break; - case 4: - me->DisappearAndDie(); - break; - default: - //Nothing To DO - break; - } - ++phase; - } else FlyBackTimer-=diff; - } - }; - -}; - -void AddSC_the_scarlet_enclave() -{ - new npc_valkyr_battle_maiden(); -} diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp new file mode 100644 index 00000000000..a86b15a7f5c --- /dev/null +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -0,0 +1,124 @@ +/* + * 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 "PassiveAI.h" +#include "Player.h" + +/*#### +## npc_valkyr_battle_maiden +####*/ +#define SPELL_REVIVE 51918 +#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" + +class npc_valkyr_battle_maiden : public CreatureScript +{ +public: + npc_valkyr_battle_maiden() : CreatureScript("npc_valkyr_battle_maiden") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_valkyr_battle_maidenAI (creature); + } + + struct npc_valkyr_battle_maidenAI : public PassiveAI + { + npc_valkyr_battle_maidenAI(Creature* creature) : PassiveAI(creature) {} + + uint32 FlyBackTimer; + float x, y, z; + uint32 phase; + + void Reset() + { + me->setActive(true); + me->SetVisible(false); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetCanFly(true); + FlyBackTimer = 500; + phase = 0; + + me->GetPosition(x, y, z); + z += 4.0f; + x -= 3.5f; + y -= 5.0f; + me->GetMotionMaster()->Clear(false); + me->SetPosition(x, y, z, 0.0f); + } + + void UpdateAI(const uint32 diff) + { + if (FlyBackTimer <= diff) + { + Player* player = NULL; + if (me->isSummon()) + if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + if (summoner->GetTypeId() == TYPEID_PLAYER) + player = CAST_PLR(summoner); + + if (!player) + phase = 3; + + switch (phase) + { + case 0: + me->SetWalk(false); + me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED); + FlyBackTimer = 500; + break; + case 1: + player->GetClosePoint(x, y, z, me->GetObjectSize()); + z += 2.5f; + x -= 2.0f; + y -= 1.5f; + me->GetMotionMaster()->MovePoint(0, x, y, z); + me->SetTarget(player->GetGUID()); + me->SetVisible(true); + FlyBackTimer = 4500; + break; + case 2: + if (!player->isRessurectRequested()) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); + DoCast(player, SPELL_REVIVE, true); + me->MonsterWhisper(VALK_WHISPER, player->GetGUID()); + } + FlyBackTimer = 5000; + break; + case 3: + me->SetVisible(false); + FlyBackTimer = 3000; + break; + case 4: + me->DisappearAndDie(); + break; + default: + //Nothing To DO + break; + } + ++phase; + } else FlyBackTimer-=diff; + } + }; + +}; + +void AddSC_the_scarlet_enclave() +{ + new npc_valkyr_battle_maiden(); +} diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 18549a1bf70..1da1e4ab178 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -78,8 +78,8 @@ set(scripts_STAT_SRCS Northrend/Nexus/Oculus/boss_urom.cpp Northrend/Nexus/Oculus/oculus.cpp Northrend/Nexus/Oculus/instance_oculus.cpp - Northrend/Nexus/Nexus/commander_kolurg.cpp - Northrend/Nexus/Nexus/commander_stoutbeard.cpp + Northrend/Nexus/Nexus/boss_commander_kolurg.cpp + Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp Northrend/Nexus/Nexus/boss_ormorok.cpp Northrend/Nexus/Nexus/boss_magus_telestra.cpp Northrend/Nexus/Nexus/instance_nexus.cpp diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp new file mode 100644 index 00000000000..fedb1f5cebc --- /dev/null +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp @@ -0,0 +1,75 @@ +/* + * 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 . + */ + +/* Script Data Start +SDName: Boss Commander Kolurg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Alliance Heroic +SDCategory: +Script Data End */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//not used +//Yell +#define SAY_AGGRO -1576024 +#define SAY_KILL -1576025 +#define SAY_DEATH -1576026 + +class boss_commander_kolurg : public CreatureScript +{ +public: + boss_commander_kolurg() : CreatureScript("boss_commander_kolurg") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_commander_kolurgAI (creature); + } + + struct boss_commander_kolurgAI : public ScriptedAI + { + boss_commander_kolurgAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() {} + void EnterCombat(Unit* /*who*/) {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* /*killer*/) {} + }; + +}; + +void AddSC_boss_commander_kolurg() +{ + new boss_commander_kolurg(); +} diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp new file mode 100644 index 00000000000..39c93f15d6f --- /dev/null +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp @@ -0,0 +1,71 @@ +/* + * 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 . + */ + +/* Script Data Start +SDName: Boss Commander Stoutbeard +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Horde Heroic +SDCategory: +Script Data End */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" + +enum CommanderStoutbeard +{ + SPELL_BATTLE_SHOUT = 31403, + SPELL_CHARGE = 60067, + SPELL_FRIGHTENING_SHOUT = 19134, + SPELL_WHIRLWIND_1 = 38619, + SPELL_WHIRLWIND_2 = 38618 +}; + + +class boss_commander_stoutbeard : public CreatureScript +{ +public: + boss_commander_stoutbeard() : CreatureScript("boss_commander_stoutbeard") { } + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_commander_stoutbeardAI (creature); + } + + struct boss_commander_stoutbeardAI : public ScriptedAI + { + boss_commander_stoutbeardAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() {} + void AttackStart(Unit* /*who*/) {} + void MoveInLineOfSight(Unit* /*who*/) {} + void UpdateAI(const uint32 /*diff*/) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + }; + +}; + +void AddSC_boss_commander_stoutbeard() +{ + new boss_commander_stoutbeard(); +} diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp deleted file mode 100644 index fedb1f5cebc..00000000000 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ /dev/null @@ -1,75 +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 . - */ - -/* Script Data Start -SDName: Boss Commander Kolurg -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only Alliance Heroic -SDCategory: -Script Data End */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -#define SPELL_BATTLE_SHOUT 31403 -#define SPELL_CHARGE 60067 -#define SPELL_FRIGHTENING_SHOUT 19134 -#define SPELL_WHIRLWIND_1 38619 -#define SPELL_WHIRLWIND_2 38618 - -//not used -//Yell -#define SAY_AGGRO -1576024 -#define SAY_KILL -1576025 -#define SAY_DEATH -1576026 - -class boss_commander_kolurg : public CreatureScript -{ -public: - boss_commander_kolurg() : CreatureScript("boss_commander_kolurg") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_commander_kolurgAI (creature); - } - - struct boss_commander_kolurgAI : public ScriptedAI - { - boss_commander_kolurgAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - void EnterCombat(Unit* /*who*/) {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* /*killer*/) {} - }; - -}; - -void AddSC_boss_commander_kolurg() -{ - new boss_commander_kolurg(); -} diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp deleted file mode 100644 index 39c93f15d6f..00000000000 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ /dev/null @@ -1,71 +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 . - */ - -/* Script Data Start -SDName: Boss Commander Stoutbeard -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only Horde Heroic -SDCategory: -Script Data End */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" - -enum CommanderStoutbeard -{ - SPELL_BATTLE_SHOUT = 31403, - SPELL_CHARGE = 60067, - SPELL_FRIGHTENING_SHOUT = 19134, - SPELL_WHIRLWIND_1 = 38619, - SPELL_WHIRLWIND_2 = 38618 -}; - - -class boss_commander_stoutbeard : public CreatureScript -{ -public: - boss_commander_stoutbeard() : CreatureScript("boss_commander_stoutbeard") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_commander_stoutbeardAI (creature); - } - - struct boss_commander_stoutbeardAI : public ScriptedAI - { - boss_commander_stoutbeardAI(Creature* creature) : ScriptedAI(creature) {} - - void Reset() {} - void AttackStart(Unit* /*who*/) {} - void MoveInLineOfSight(Unit* /*who*/) {} - void UpdateAI(const uint32 /*diff*/) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - }; - -}; - -void AddSC_boss_commander_stoutbeard() -{ - new boss_commander_stoutbeard(); -} -- cgit v1.2.3