diff options
Diffstat (limited to 'src/server/scripts')
100 files changed, 2183 insertions, 1065 deletions
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp index 3395047c720..2130e61cb47 100644 --- a/src/server/scripts/Commands/cs_lookup.cpp +++ b/src/server/scripts/Commands/cs_lookup.cpp @@ -1033,7 +1033,7 @@ public: found = true; } } - + if (!found) handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND); diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index ef1fc681a31..43c2001fbf7 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -97,7 +97,6 @@ public: { "gameobject_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestInvRelationsCommand, "", NULL }, { "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, { "gameobject_questrelation", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestRelationsCommand, "", NULL }, - { "gameobject_scripts", SEC_ADMINISTRATOR, true, &HandleReloadGameObjectScriptsCommand, "", NULL }, { "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL }, { "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL }, { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, @@ -260,7 +259,6 @@ public: } sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts..."); - HandleReloadGameObjectScriptsCommand(handler, "a"); HandleReloadEventScriptsCommand(handler, "a"); HandleReloadSpellScriptsCommand(handler, "a"); handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded."); @@ -951,26 +949,6 @@ public: return true; } - static bool HandleReloadGameObjectScriptsCommand(ChatHandler* handler, const char* args) - { - if (sScriptMgr->IsScriptScheduled()) - { - handler->SendSysMessage("DB scripts used currently, please attempt reload later."); - handler->SetSentErrorMessage(true); - return false; - } - - if (*args != 'a') - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `gameobject_scripts`..."); - - sObjectMgr->LoadGameObjectScripts(); - - if (*args != 'a') - handler->SendGlobalGMSysMessage("DB table `gameobject_scripts` reloaded."); - - return true; - } - static bool HandleReloadEventScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) diff --git a/src/server/scripts/EasternKingdoms/CMakeLists.txt b/src/server/scripts/EasternKingdoms/CMakeLists.txt index 854124ee05c..f581baa31fa 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,8 @@ 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/Scholomance/boss_kirtonos_the_herald.cpp + EasternKingdoms/zone_isle_of_queldanas.cpp EasternKingdoms/boss_kruul.cpp EasternKingdoms/ZulGurub/boss_hakkar.cpp EasternKingdoms/ZulGurub/boss_mandokir.cpp @@ -48,12 +49,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 +68,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/ScarletEnclave/zone_the_scarlet_enclave.cpp + EasternKingdoms/zone_eastern_plaguelands.cpp EasternKingdoms/MoltenCore/boss_gehennas.cpp EasternKingdoms/MoltenCore/boss_lucifron.cpp EasternKingdoms/MoltenCore/boss_golemagg.cpp @@ -99,7 +100,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 +116,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 +140,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 +158,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 +175,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 +186,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/MagistersTerrace/boss_vexallus.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp index 19b717fa6ea..85a113ec495 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_vexallus.cpp @@ -70,9 +70,9 @@ public: return new boss_vexallusAI (creature); }; - struct boss_vexallusAI : public ScriptedAI + struct boss_vexallusAI : public BossAI { - boss_vexallusAI(Creature* creature) : ScriptedAI(creature) + boss_vexallusAI(Creature* creature) : BossAI(creature, DATA_VEXALLUS_EVENT) { instance = creature->GetInstanceScript(); } @@ -87,6 +87,7 @@ public: void Reset() { + summons.DespawnAll(); ChainLightningTimer = 8000; ArcaneShockTimer = 5000; OverloadTimer = 1200; @@ -104,6 +105,7 @@ public: void JustDied(Unit* /*killer*/) { + summons.DespawnAll(); if (instance) instance->SetData(DATA_VEXALLUS_EVENT, DONE); } @@ -206,7 +208,10 @@ public: struct mob_pure_energyAI : public ScriptedAI { - mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) {} + mob_pure_energyAI(Creature* creature) : ScriptedAI(creature) + { + me->SetDisplayId(me->GetCreatureTemplate()->Modelid2); + } void Reset() {} diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index c22cec65ab7..97fe57c5434 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -146,7 +146,7 @@ public: me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); if (Player* starter = Unit::GetPlayer(*me, playerGUID)) - sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter); + Talk(SAY_EVENT_ATTACK); phase = PHASE_TO_ATTACK; } @@ -165,7 +165,7 @@ public: anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f); playerGUID = target->GetGUID(); - sCreatureTextMgr->SendChat(me, SAY_EVENT_START, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, target); + Talk(SAY_EVENT_START); } void UpdateAI(const uint32 diff) @@ -330,15 +330,21 @@ public: #define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" -enum eDuelEnums +enum Spells_DKI { - SAY_DUEL = 0, - SPELL_DUEL = 52996, //SPELL_DUEL_TRIGGERED = 52990, SPELL_DUEL_VICTORY = 52994, SPELL_DUEL_FLAG = 52991, +}; + +enum Says_VBM +{ + SAY_DUEL = 0, +}; +enum Misc_VBN +{ QUEST_DEATH_CHALLENGE = 12733, FACTION_HOSTILE = 2068 }; @@ -501,8 +507,15 @@ public: ## npc_dark_rider_of_acherus ######*/ -#define DESPAWN_HORSE 52267 -#define SAY_DARK_RIDER "The realm of shadows awaits..." +enum Spells_DR +{ + SPELL_DESPAWN_HORSE = 51918 +}; + +enum Says_DR +{ + SAY_DARK_RIDER = 0 +}; class npc_dark_rider_of_acherus : public CreatureScript { @@ -547,7 +560,7 @@ public: break; case 1: if (Unit* target = Unit::GetUnit(*me, TargetGUID)) - DoCast(target, DESPAWN_HORSE, true); + DoCast(target, SPELL_DESPAWN_HORSE, true); PhaseTimer = 3000; Phase = 2; break; @@ -587,13 +600,13 @@ public: ## npc_salanar_the_horseman ######*/ -enum eSalanar +enum Spells_Salanar { - REALM_OF_SHADOWS = 52693, - EFFECT_STOLEN_HORSE = 52263, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266, - SPELL_EFFECT_OVERTAKE = 52349 + SPELL_REALM_OF_SHADOWS = 52693, + SPELL_EFFECT_STOLEN_HORSE = 52263, + SPELL_DELIVER_STOLEN_HORSE = 52264, + SPELL_CALL_DARK_RIDER = 52266, + SPELL_EFFECT_OVERTAKE = 52349 }; class npc_salanar_the_horseman : public CreatureScript @@ -612,18 +625,18 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (spell->Id == DELIVER_STOLEN_HORSE) + if (spell->Id == SPELL_DELIVER_STOLEN_HORSE) { if (caster->GetTypeId() == TYPEID_UNIT && caster->IsVehicle()) { if (Unit* charmer = caster->GetCharmer()) { - if (charmer->HasAura(EFFECT_STOLEN_HORSE)) + if (charmer->HasAura(SPELL_EFFECT_STOLEN_HORSE)) { - charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); + charmer->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE); caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); + DoCast(caster, SPELL_CALL_DARK_RIDER, true); if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) CAST_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); } @@ -651,8 +664,8 @@ public: //CAST_CRE(who)->Respawn(true); } - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + if (CAST_PLR(charmer)->HasAura(SPELL_REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); } } } @@ -715,10 +728,10 @@ public: }; // correct way: 52312 52314 52555 ... -enum SG +enum Creatures_SG { - GHOULS = 28845, - GHOSTS = 28846, + NPC_GHOULS = 28845, + NPC_GHOSTS = 28846, }; class npc_dkc1_gothik : public CreatureScript { @@ -738,7 +751,7 @@ public: { ScriptedAI::MoveInLineOfSight(who); - if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f)) + if (who->GetEntry() == NPC_GHOULS && me->IsWithinDistInMap(who, 10.0f)) { if (Unit* owner = who->GetOwner()) { @@ -753,7 +766,7 @@ public: CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) - owner->RemoveAllMinionsByEntry(GHOULS); + owner->RemoveAllMinionsByEntry(NPC_GHOSTS); } } } @@ -786,7 +799,7 @@ public: void FindMinions(Unit* owner) { std::list<Creature*> MinionList; - owner->GetAllMinionsByEntry(MinionList, GHOULS); + owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS); if (!MinionList.empty()) { @@ -812,7 +825,7 @@ public: Player* plrOwner = owner->ToPlayer(); if (plrOwner && plrOwner->isInCombat()) { - if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == GHOSTS) + if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == NPC_GHOSTS) AttackStart(plrOwner->getAttackerForHelper()); else FindMinions(owner); @@ -825,7 +838,7 @@ public: //ScriptedAI::UpdateAI(diff); //Check if we have a current target - if (me->getVictim()->GetEntry() == GHOSTS) + if (me->getVictim()->GetEntry() == NPC_GHOSTS) { if (me->isAttackReady()) { @@ -846,8 +859,11 @@ public: ## npc_scarlet_miner_cart ####*/ -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 +enum Spells_SM +{ + SPELL_CART_CHECK = 54173, + SPELL_CART_DRAG = 52465 +}; class npc_scarlet_miner_cart : public CreatureScript { @@ -902,8 +918,11 @@ public: ## npc_scarlet_miner ####*/ -#define SAY_SCARLET_MINER1 "Where'd this come from? I better get this down to the ships before the foreman sees it!" -#define SAY_SCARLET_MINER2 "Now I can have a rest!" +enum Says_SM +{ + SAY_SCARLET_MINER_0 = 0, + SAY_SCARLET_MINER_1 = 1 +}; class npc_scarlet_miner : public CreatureScript { @@ -984,7 +1003,7 @@ public: me->SetInFront(car); me->SendMovementFlagUpdate(); } - me->MonsterSay(SAY_SCARLET_MINER1, LANG_UNIVERSAL, 0); + Talk(SAY_SCARLET_MINER_0); SetRun(true); IntroTimer = 4000; IntroPhase = 1; @@ -998,7 +1017,7 @@ public: car->StopMoving(); car->RemoveAura(SPELL_CART_DRAG); } - me->MonsterSay(SAY_SCARLET_MINER2, LANG_UNIVERSAL, 0); + Talk(SAY_SCARLET_MINER_1); break; default: break; @@ -1036,7 +1055,10 @@ public: ## go_inconspicuous_mine_car ######*/ -#define SPELL_CART_SUMM 52463 +enum Spells_Cart +{ + SPELL_CART_SUMM = 52463 +}; class go_inconspicuous_mine_car : public GameObjectScript { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index a86b15a7f5c..32ce484f715 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -23,8 +23,16 @@ /*#### ## npc_valkyr_battle_maiden ####*/ -#define SPELL_REVIVE 51918 -#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" + +enum Spells_VBM +{ + SPELL_REVIVE = 51918 +}; + +enum Says_VBM +{ + WHISPER_REVIVE = 0 +}; class npc_valkyr_battle_maiden : public CreatureScript { @@ -96,7 +104,7 @@ public: { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); DoCast(player, SPELL_REVIVE, true); - me->MonsterWhisper(VALK_WHISPER, player->GetGUID()); + Talk(WHISPER_REVIVE,player->GetGUID()); } FlyBackTimer = 5000; break; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp new file mode 100644 index 00000000000..14ef18aba58 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -0,0 +1,299 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "scholomance.h" +#include "MoveSplineInit.h" +#include "GameObjectAI.h" +#include "Player.h" + +enum Says +{ + EMOTE_SUMMONED = 0 +}; + +enum Spells +{ + SPELL_SWOOP = 18144, + SPELL_WING_FLAP = 12882, + SPELL_PIERCE_ARMOR = 6016, + SPELL_DISARM = 8379, + SPELL_KIRTONOS_TRANSFORM = 16467, + SPELL_SHADOW_BOLT = 17228, + SPELL_CURSE_OF_TONGUES = 12889, + SPELL_DOMINATE_MIND = 14515 +}; + +enum Events +{ + INTRO_1 = 1, + INTRO_2 = 2, + INTRO_3 = 3, + INTRO_4 = 4, + INTRO_5 = 5, + INTRO_6 = 6, + EVENT_SWOOP = 7, + EVENT_WING_FLAP = 8, + EVENT_PIERCE_ARMOR = 9, + EVENT_DISARM = 10, + EVENT_SHADOW_BOLT = 11, + EVENT_CURSE_OF_TONGUES = 12, + EVENT_DOMINATE_MIND = 13, + EVENT_KIRTONOS_TRANSFORM = 14 +}; + +enum Misc +{ + WEAPON_KIRTONOS_STAFF = 11365, + POINT_KIRTONOS_LAND = 13, + KIRTONOS_PATH = 105061 +}; + +class boss_kirtonos_the_herald : public CreatureScript +{ + public: boss_kirtonos_the_herald() : CreatureScript("boss_kirtonos_the_herald") { } + + struct boss_kirtonos_the_heraldAI : public BossAI + { + boss_kirtonos_the_heraldAI(Creature* creature) : BossAI(creature, TYPE_KIRTONOS) { } + + void Reset() + { + _introEvent = 0; + _introTimer = 0; + _Reset(); + } + + void EnterCombat(Unit* /*who*/) + { + _introTimer = 0; + _introEvent = 0; + events.ScheduleEvent(EVENT_SWOOP, urand(8000, 8000)); + events.ScheduleEvent(EVENT_WING_FLAP, urand(15000, 15000)); + events.ScheduleEvent(EVENT_PIERCE_ARMOR, urand(18000, 18000)); + events.ScheduleEvent(EVENT_DISARM, urand(22000, 22000)); + events.ScheduleEvent(EVENT_SHADOW_BOLT, urand(42000, 42000)); + events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, urand(53000, 53000)); + events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(34000, 48000)); + events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(20000, 20000)); + _EnterCombat(); + } + + void JustDied(Unit* /*killer*/) + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS))) + gate->SetGoState(GO_STATE_ACTIVE); + if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD))) + { + brazier->ResetDoorOrButton(); + brazier->SetGoState(GO_STATE_READY); + } + _JustDied(); + } + + void EnterEvadeMode() + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS))) + gate->SetGoState(GO_STATE_ACTIVE); + if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD))) + { + brazier->ResetDoorOrButton(); + brazier->SetGoState(GO_STATE_READY); + } + me->DespawnOrUnsummon(5000); + } + + void IsSummonedBy(Unit* /*summoner*/) + { + me->SetDisableGravity(true); + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + _introEvent = INTRO_1; + _introTimer = 1; + _currentPoint = 0; + Talk(EMOTE_SUMMONED); + } + + void JustSummoned(Creature* summon) + { + BossAI::JustSummoned(summon); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == WAYPOINT_MOTION_TYPE && id == POINT_KIRTONOS_LAND) + { + _introTimer = 1500; + _introEvent = INTRO_2; + } + } + + void UpdateAI(uint32 const diff) + { + if (_introEvent) + { + if (_introTimer <= diff) + { + switch (_introEvent) + { + case INTRO_1: + me->GetMotionMaster()->MovePath(KIRTONOS_PATH,false); + _introEvent = 0; + break; + case INTRO_2: + me->GetMotionMaster()->MovePoint(0, 299.4884f, 92.76137f, 105.6335f); + _introTimer = 1000; + _introEvent = INTRO_3; + break; + case INTRO_3: + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_GATE_KIRTONOS))) + gate->SetGoState(GO_STATE_READY); + me->SetFacingTo(0.01745329f); + _introTimer = 3000; + _introEvent = INTRO_4; + break; + case INTRO_4: + if (GameObject* brazier = me->GetMap()->GetGameObject(instance->GetData64(GO_BRAZIER_OF_THE_HERALD))) + brazier->SetGoState(GO_STATE_READY); + me->SetWalk(true); + me->SetDisableGravity(false); + DoCast(me, SPELL_KIRTONOS_TRANSFORM); + _introTimer = 1000; + _introEvent = INTRO_5; + break; + case INTRO_5: + me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF)); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + _introTimer = 5000; + _introEvent = INTRO_6; + case INTRO_6: + // I don't know how to make him not swim across screen here. Tell me and I will fix. + me->GetMotionMaster()->MovePoint(0, 314.8673f, 90.3021f, 101.6459f); + _introTimer = 0; + _introEvent = 0; + break; + } + } + else + _introTimer -= diff; + } + + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SWOOP: + DoCast(me, SPELL_SWOOP); + events.ScheduleEvent(EVENT_SWOOP, 15000); + break; + case EVENT_WING_FLAP: + DoCast(me, SPELL_WING_FLAP); + events.ScheduleEvent(EVENT_WING_FLAP, 13000); + break; + case EVENT_PIERCE_ARMOR: + DoCastVictim(SPELL_PIERCE_ARMOR, true); + events.ScheduleEvent(EVENT_PIERCE_ARMOR, 12000); + break; + case EVENT_DISARM: + DoCastVictim(SPELL_DISARM, true); + events.ScheduleEvent(EVENT_DISARM, 11000); + break; + case EVENT_SHADOW_BOLT: + DoCastVictim(SPELL_SHADOW_BOLT, true); + events.ScheduleEvent(EVENT_SHADOW_BOLT, 42000); + break; + case EVENT_CURSE_OF_TONGUES: + DoCastVictim(SPELL_CURSE_OF_TONGUES, true); + events.ScheduleEvent(EVENT_CURSE_OF_TONGUES, 35000); + break; + case EVENT_DOMINATE_MIND: + DoCastVictim(SPELL_DOMINATE_MIND, true); + events.ScheduleEvent(EVENT_DOMINATE_MIND, urand(44000, 48000)); + break; + case EVENT_KIRTONOS_TRANSFORM: + if (me->HasAura(SPELL_KIRTONOS_TRANSFORM)) + { + me->RemoveAura(SPELL_KIRTONOS_TRANSFORM); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); + } + else + { + DoCast(me, SPELL_KIRTONOS_TRANSFORM); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF)); + } + events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(16000, 18000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + uint8 _introEvent; + uint32 _introTimer; + uint32 _currentPoint; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_kirtonos_the_heraldAI(creature); + } +}; + +/*###### +## go_brazier_of_the_herald +######*/ + +enum Brazier_Of_The_Herald +{ + NPC_KIRTONOS = 10506, + SOUND_SCREECH = 557 +}; + +class go_brazier_of_the_herald : public GameObjectScript +{ + public: + go_brazier_of_the_herald() : GameObjectScript("go_brazier_of_the_herald") { } + + bool OnGossipHello(Player* player, GameObject* go) + { + go->UseDoorOrButton(); + go->PlayDirectSound(SOUND_SCREECH, 0); + player->SummonCreature(NPC_KIRTONOS, 315.028f, 70.53845f, 102.1496f, 0.3859715f, TEMPSUMMON_DEAD_DESPAWN, 900000); + return true; + } +}; + +void AddSC_boss_kirtonos_the_herald() +{ + new boss_kirtonos_the_herald(); + new go_brazier_of_the_herald; +} diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp index 583b9074433..fc966c4bbb9 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -27,17 +27,6 @@ EndScriptData */ #include "InstanceScript.h" #include "scholomance.h" -#define GO_GATE_KIRTONOS 175570 -#define GO_GATE_GANDLING 177374 -#define GO_GATE_MALICIA 177375 -#define GO_GATE_THEOLEN 177377 -#define GO_GATE_POLKELT 177376 -#define GO_GATE_RAVENIAN 177372 -#define GO_GATE_BAROV 177373 -#define GO_GATE_ILLUCIA 177371 - -#define MAX_ENCOUNTER 2 - class instance_scholomance : public InstanceMapScript { public: @@ -64,6 +53,7 @@ public: uint64 GateRavenianGUID; uint64 GateBarovGUID; uint64 GateIlluciaGUID; + uint64 BrazierOfTheHeraldGUID; void Initialize() { @@ -77,6 +67,7 @@ public: GateRavenianGUID = 0; GateBarovGUID = 0; GateIlluciaGUID = 0; + BrazierOfTheHeraldGUID = 0; for (uint8 i = 0; i < 6; ++i) IsBossDied[i] = false; @@ -86,14 +77,15 @@ public: { switch (go->GetEntry()) { - case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break; - case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break; - case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break; - case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break; - case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break; - case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break; - case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break; - case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break; + case GO_GATE_KIRTONOS: GateKirtonosGUID = go->GetGUID(); break; + case GO_GATE_GANDLING: GateGandlingGUID = go->GetGUID(); break; + case GO_GATE_MALICIA: GateMiliciaGUID = go->GetGUID(); break; + case GO_GATE_THEOLEN: GateTheolenGUID = go->GetGUID(); break; + case GO_GATE_POLKELT: GatePolkeltGUID = go->GetGUID(); break; + case GO_GATE_RAVENIAN: GateRavenianGUID = go->GetGUID(); break; + case GO_GATE_BAROV: GateBarovGUID = go->GetGUID(); break; + case GO_GATE_ILLUCIA: GateIlluciaGUID = go->GetGUID(); break; + case GO_BRAZIER_OF_THE_HERALD: BrazierOfTheHeraldGUID = go->GetGUID(); break; } } @@ -135,6 +127,19 @@ public: IsBossDied[3] && IsBossDied[4] && IsBossDied[5]) ? IN_PROGRESS : 0; } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case GO_GATE_KIRTONOS: + return GateKirtonosGUID; + case GO_BRAZIER_OF_THE_HERALD: + return BrazierOfTheHeraldGUID; + } + + return 0; + } }; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h index bae7c8c8efc..20b782fd43a 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h +++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h @@ -19,13 +19,31 @@ #ifndef DEF_SCHOLOMANCE_H #define DEF_SCHOLOMANCE_H -#define TYPE_GANDLING 1 -#define DATA_DOCTORTHEOLENKRASTINOV_DEATH 2 -#define DATA_INSTRUCTORMALICIA_DEATH 3 -#define DATA_LADYILLUCIABAROV_DEATH 4 -#define DATA_LORDALEXEIBAROV_DEATH 5 -#define DATA_LOREKEEPERPOLKELT_DEATH 6 -#define DATA_THERAVENIAN_DEATH 7 -#define TYPE_KIRTONOS 8 -#endif +uint32 const MAX_ENCOUNTER = 2; + +enum DataTypes +{ + TYPE_GANDLING = 1, + DATA_DOCTORTHEOLENKRASTINOV_DEATH = 2, + DATA_INSTRUCTORMALICIA_DEATH = 3, + DATA_LADYILLUCIABAROV_DEATH = 4, + DATA_LORDALEXEIBAROV_DEATH = 5, + DATA_LOREKEEPERPOLKELT_DEATH = 6, + DATA_THERAVENIAN_DEATH = 7, + TYPE_KIRTONOS = 8 +}; +enum GameobjectIds +{ + GO_GATE_KIRTONOS = 175570, + GO_GATE_GANDLING = 177374, + GO_GATE_MALICIA = 177375, + GO_GATE_THEOLEN = 177377, + GO_GATE_POLKELT = 177376, + GO_GATE_RAVENIAN = 177372, + GO_GATE_BAROV = 177373, + GO_GATE_ILLUCIA = 177371, + GO_BRAZIER_OF_THE_HERALD = 175564 +}; + +#endif diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 3517bc0e223..2357f59b65d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -27,56 +27,39 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" -#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!" -#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!" -#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!" -#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting." -#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!" - -#define ADD_1X 4017.403809f -#define ADD_1Y -3339.703369f -#define ADD_1Z 115.057655f -#define ADD_1O 5.487860f - -#define ADD_2X 4013.189209f -#define ADD_2Y -3351.808350f -#define ADD_2Z 115.052254f -#define ADD_2O 0.134280f - -#define ADD_3X 4017.738037f -#define ADD_3Y -3363.478016f -#define ADD_3Z 115.057274f -#define ADD_3O 0.723313f - -#define ADD_4X 4048.877197f -#define ADD_4Y -3363.223633f -#define ADD_4Z 115.054253f -#define ADD_4O 3.627735f - -#define ADD_5X 4051.777588f -#define ADD_5Y -3350.893311f -#define ADD_5Z 115.055351f -#define ADD_5O 3.066176f - -#define ADD_6X 4048.375977f -#define ADD_6Y -3339.966309f -#define ADD_6Z 115.055222f -#define ADD_6O 2.457497f - -#define SPELL_SHADOWBOLT 17393 -#define SPELL_CLEAVE 15284 -#define SPELL_MORTALSTRIKE 15708 - -#define SPELL_UNHOLY_AURA 17467 -#define SPELL_RAISEDEAD 17473 //triggers death pact (17471) - -#define SPELL_RAISE_DEAD1 17475 -#define SPELL_RAISE_DEAD2 17476 -#define SPELL_RAISE_DEAD3 17477 -#define SPELL_RAISE_DEAD4 17478 -#define SPELL_RAISE_DEAD5 17479 -#define SPELL_RAISE_DEAD6 17480 +enum Says +{ + SAY_BARON_RUN_START = 0, + SAY_BARON_RUN_BOSS_KILL = 1, + SAY_BARON_RUN_FAIL = 2, + SAY_EVENT_RAMSTEIN = 3, + SAY_EVENT_BARON = 4 +}; + +enum Spells +{ + SPELL_SHADOWBOLT = 17393, + SPELL_CLEAVE = 15284, + SPELL_MORTALSTRIKE = 15708, + + SPELL_UNHOLY_AURA = 15284, + SPELL_RAISEDEAD = 15708, //triggers death pact (17471) + + SPELL_RAISE_DEAD1 = 17475, + SPELL_RAISE_DEAD2 = 17476, + SPELL_RAISE_DEAD3 = 17477, + SPELL_RAISE_DEAD4 = 17478, + SPELL_RAISE_DEAD5 = 17479, + SPELL_RAISE_DEAD6 = 17480, +}; + +// Define Add positions +Position const ADD_POS_1 = {4017.403809f, -3339.703369f, 115.057655f, 5.487860f}; +Position const ADD_POS_2 = {4013.189209f, -3351.808350f, 115.052254f, 0.134280f}; +Position const ADD_POS_3 = {4017.738037f, -3363.478016f, 115.057274f, 0.723313f}; +Position const ADD_POS_4 = {4048.877197f, -3363.223633f, 115.054253f, 3.627735f}; +Position const ADD_POS_5 = {4051.777588f, -3350.893311f, 115.055351f, 3.066176f}; +Position const ADD_POS_6 = {4048.375977f, -3339.966309f, 115.055222f, 2.457497f}; class boss_baron_rivendare : public CreatureScript { @@ -172,12 +155,12 @@ public: //SummonSkeletons if (SummonSkeletons_Timer <= diff) { - me->SummonCreature(11197, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_2X, ADD_2Y, ADD_2Z, ADD_2O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_3X, ADD_3Y, ADD_3Z, ADD_3O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_4X, ADD_4Y, ADD_4Z, ADD_4O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_5X, ADD_5Y, ADD_5Z, ADD_5O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_6X, ADD_6Y, ADD_6Z, ADD_6O, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_1, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_2, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_3, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_4, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_5, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_6, TEMPSUMMON_TIMED_DESPAWN, 29000); //34 seconds until we should cast this again SummonSkeletons_Timer = 40000; diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 6d555a52eec..87301f43745 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -31,19 +31,15 @@ EndScriptData */ #include "uldaman.h" #include "Player.h" -#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!" -#define SOUND_AGGRO 5855 - -#define SAY_SUMMON "Awake ye servants, defend the discs!" -#define SOUND_SUMMON 5856 - -#define SAY_SUMMON2 "To my side, brothers. For the makers!" -#define SOUND_SUMMON2 5857 - -#define SAY_KILL "Reckless mortal." -#define SOUND_KILL 5858 +enum Says +{ + SAY_AGGRO = 0, + SAY_SUMMON_GUARDIANS = 1, + SAY_SUMMON_VAULT_WALKERS = 2, + SAY_KILL = 3 +}; -enum eSpells +enum Spells { SPELL_GROUND_TREMOR = 6524, SPELL_ARCHAEDAS_AWAKEN = 10347, @@ -52,6 +48,7 @@ enum eSpells SPELL_SUB_BOSS_AGGRO = 11568, SPELL_AWAKEN_VAULT_WALKER = 10258, SPELL_AWAKEN_EARTHEN_GUARDIAN = 10252, + SPELL_SELF_DESTRUCT = 9874 }; class boss_archaedas : public CreatureScript @@ -122,8 +119,7 @@ class boss_archaedas : public CreatureScript // Being woken up from the altar, start the awaken sequence if (spell == sSpellMgr->GetSpellInfo(SPELL_ARCHAEDAS_AWAKEN)) { - me->MonsterYell(SAY_AGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AGGRO); + Talk(SAY_AGGRO); iAwakenTimer = 4000; bWakingUp = true; } @@ -131,8 +127,7 @@ class boss_archaedas : public CreatureScript void KilledUnit(Unit* /*victim*/) { - me->MonsterYell(SAY_KILL, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL); + Talk(SAY_KILL); } void UpdateAI(const uint32 uiDiff) @@ -172,8 +167,7 @@ class boss_archaedas : public CreatureScript ActivateMinion(instance->GetData64(8), true); // EarthenGuardian4 ActivateMinion(instance->GetData64(9), true); // EarthenGuardian5 ActivateMinion(instance->GetData64(10), false); // EarthenGuardian6 - me->MonsterYell(SAY_SUMMON, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMON); + Talk(SAY_SUMMON_GUARDIANS); bGuardiansAwake = true; } @@ -184,8 +178,7 @@ class boss_archaedas : public CreatureScript ActivateMinion(instance->GetData64(2), true); // VaultWalker2 ActivateMinion(instance->GetData64(3), true); // VaultWalker3 ActivateMinion(instance->GetData64(4), false); // VaultWalker4 - me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMON2); + Talk(SAY_SUMMON_VAULT_WALKERS); bVaultWalkersAwake = true; } @@ -224,8 +217,6 @@ SDComment: These mobs are initially frozen until Archaedas awakens them one at a time. EndScriptData */ -#define SPELL_ARCHAEDAS_AWAKEN 10347 - class mob_archaedas_minions : public CreatureScript { public: @@ -323,8 +314,6 @@ SDComment: After activating the altar of the keepers, the stone keepers will wake up one by one. EndScriptData */ -#define SPELL_SELF_DESTRUCT 9874 - class mob_stonekeepers : public CreatureScript { public: @@ -388,8 +377,6 @@ SDComment: Needs 1 person to activate the Archaedas script SDCategory: Uldaman EndScriptData */ -#define SPELL_BOSS_OBJECT_VISUAL 11206 - class go_altar_of_archaedas : public GameObjectScript { public: @@ -419,8 +406,6 @@ SDComment: Need 1 person to activate to open the altar. One by one the StoneKee SDCategory: Uldaman EndScriptData */ -#define SPELL_BOSS_OBJECT_VISUAL 11206 - class go_altar_of_the_keepers : public GameObjectScript { public: diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 89b14ff0f4d..1b2512ccf63 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -38,7 +38,7 @@ enum Spells { SPELL_STATIC_DISRUPTION = 43622, SPELL_STATIC_VISUAL = 45265, - SPELL_CALL_LIGHTNING = 43661, //Missing timer + SPELL_CALL_LIGHTNING = 43661, // Missing timer SPELL_GUST_OF_WIND = 43621, SPELL_ELECTRICAL_STORM = 43648, SPELL_BERSERK = 45078, @@ -46,25 +46,24 @@ enum Spells SPELL_EAGLE_SWOOP = 44732 }; -//"Your death gonna be quick, strangers. You shoulda never have come to this place..." -#define SAY_ONAGGRO "I be da predator! You da prey..." -#define SAY_ONDEATH "You can't... kill... me spirit!" -#define SAY_ONSLAY1 "Ya got nothin'!" -#define SAY_ONSLAY2 "Stop your cryin'!" -#define SAY_ONSUMMON "Feed, me bruddahs!" -#define SAY_ONENRAGE "All you be doing is wasting my time!" -#define SOUND_ONAGGRO 12013 -#define SOUND_ONDEATH 12019 -#define SOUND_ONSLAY1 12017 -#define SOUND_ONSLAY2 12018 -#define SOUND_ONSUMMON 12014 -#define SOUND_ONENRAGE 12016 - -#define MOB_SOARING_EAGLE 24858 -#define SE_LOC_X_MAX 400 -#define SE_LOC_X_MIN 335 -#define SE_LOC_Y_MAX 1435 -#define SE_LOC_Y_MIN 1370 +enum Says +{ + SAY_AGGRO = 0, + SAY_SUMMON = 1, + SAY_INTRO = 2, // Not used in script + SAY_ENRAGE = 3, + SAY_KILL = 4, + SAY_DEATH = 5 +}; + +enum Misc +{ + MOB_SOARING_EAGLE = 24858, + SE_LOC_X_MAX = 400, + SE_LOC_X_MIN = 335, + SE_LOC_Y_MAX = 1435, + SE_LOC_Y_MIN = 1370 +}; class boss_akilzon : public CreatureScript { @@ -130,8 +129,7 @@ class boss_akilzon : public CreatureScript void EnterCombat(Unit* /*who*/) { - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONAGGRO); + Talk(SAY_AGGRO); //DoZoneInCombat(); if (instance) instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); @@ -139,8 +137,7 @@ class boss_akilzon : public CreatureScript void JustDied(Unit* /*killer*/) { - me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONDEATH); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_AKILZONEVENT, DONE); DespawnSummons(); @@ -148,17 +145,7 @@ class boss_akilzon : public CreatureScript void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSLAY1); - break; - case 1: - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSLAY2); - break; - } + Talk(SAY_KILL); } void DespawnSummons() @@ -276,8 +263,7 @@ class boss_akilzon : public CreatureScript if (Enrage_Timer <= diff) { - me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONENRAGE); + Talk(SAY_ENRAGE); DoCast(me, SPELL_BERSERK, true); Enrage_Timer = 600000; } else Enrage_Timer -= diff; @@ -351,8 +337,7 @@ class boss_akilzon : public CreatureScript if (SummonEagles_Timer <= diff) { - me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSUMMON); + Talk(SAY_SUMMON); float x, y, z; me->GetPosition(x, y, z); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index a7764fc4c4c..2305c360fd2 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -27,86 +27,68 @@ EndScriptData */ #include "zulaman.h" #include "SpellInfo.h" -//Speech -const char* YELL_TRANSFORM_TO_LYNX = "Let me introduce to you my new bruddahs: fang and claw!"; -#define SOUND_TRANSFORM_TO_LYNX 12094 - -const char* YELL_TRANSFORM_TO_BEAR = "Got me some new tricks...like me bruddah bear!"; -#define SOUND_TRANSFORM_TO_BEAR 12092 - -const char* YELL_TRANSFORM_TO_DRAGONHAWK = "Ya don' have to look to da sky to see da dragonhawk!"; -#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095 - -const char* YELL_TRANSFORM_TO_EAGLE = "Dere be no hidin' from da eagle!"; -#define SOUND_TRANSFORM_TO_EAGLE 12093 - -#define YELL_KILL_ONE "Da Amani de chuka!" -#define SOUND_KILL_ONE 12098 - -#define YELL_KILL_TWO "Lot more gonna fall like you!" -#define SOUND_KILL_TWO 12099 - -#define YELL_FIRE_BREATH "Fire kill you just as quick!" -#define SOUND_FIRE_BRETH 12096 - -#define YELL_AGGRO "Nobody badduh dan me!" -#define SOUND_AGGRO 12091 - -#define YELL_BERSERK "You too slow! Me too strong!" -#define SOUND_BERSERK 12097 - -#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..." -#define SOUND_DEATH 12100 - -//Still not used, need more info -#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!" -#define SOUND_INTRO 12090 - -//Spells: -//====== Troll Form -#define SPELL_WHIRLWIND 17207 -#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed -//====== Bear Form -#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid -#define SPELL_OVERPOWER 43456 // use after melee attack dodged -//====== Eagle Form -#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577 -#define SPELL_ZAP_INFORM 42577 -#define SPELL_ZAP_DAMAGE 43137 // 1250 damage -#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex -#define CREATURE_FEATHER_VORTEX 24136 -#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual -#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second -//Lynx Form -#define SPELL_CLAW_RAGE_HASTE 42583 -#define SPELL_CLAW_RAGE_TRIGGER 43149 -#define SPELL_CLAW_RAGE_DAMAGE 43150 -#define SPELL_LYNX_RUSH_HASTE 43152 -#define SPELL_LYNX_RUSH_DAMAGE 43153 -//Dragonhawk Form -#define SPELL_FLAME_WHIRL 43213 // trigger two spells -#define SPELL_FLAME_BREATH 43215 -#define SPELL_SUMMON_PILLAR 43216 // summon 24187 -#define CREATURE_COLUMN_OF_FIRE 24187 -#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217 - -//cosmetic -#define SPELL_SPIRIT_AURA 42466 -#define SPELL_SIPHON_SOUL 43501 - -//Transforms: -#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg -#define SPELL_SHAPE_OF_THE_EAGLE 42606 -#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30% -#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608 - -#define SPELL_BERSERK 45078 - -#define PHASE_BEAR 0 -#define PHASE_EAGLE 1 -#define PHASE_LYNX 2 -#define PHASE_DRAGONHAWK 3 -#define PHASE_TROLL 4 +enum Says +{ + YELL_INTRO = 0, + YELL_AGGRO = 1, + YELL_TRANSFORM_TO_BEAR = 2, + YELL_TRANSFORM_TO_EAGLE = 3, + YELL_TRANSFORM_TO_LYNX = 4, + YELL_TRANSFORM_TO_DRAGONHAWK = 5, + YELL_FIRE_BREATH = 6, + YELL_BERSERK = 7, + YELL_KILL = 8, + YELL_DEATH = 9 +}; + +enum Spells +{ + // Troll Form + SPELL_WHIRLWIND = 17207, + SPELL_GRIEVOUS_THROW = 43093, // remove debuff after full healed + // Bear Form + SPELL_CREEPING_PARALYSIS = 43095, // should cast on the whole raid + SPELL_OVERPOWER = 43456, // use after melee attack dodged + // Eagle Form + SPELL_ENERGY_STORM = 43983, // enemy area aura, trigger 42577 + SPELL_ZAP_INFORM = 42577, + SPELL_ZAP_DAMAGE = 43137, // 1250 damage + SPELL_SUMMON_CYCLONE = 43112, // summon four feather vortex + CREATURE_FEATHER_VORTEX = 24136, + SPELL_CYCLONE_VISUAL = 43119, // trigger 43147 visual + SPELL_CYCLONE_PASSIVE = 43120, // trigger 43121 (4y aoe) every second + // Lynx Form + SPELL_CLAW_RAGE_HASTE = 42583, + SPELL_CLAW_RAGE_TRIGGER = 43149, + SPELL_CLAW_RAGE_DAMAGE = 43150, + SPELL_LYNX_RUSH_HASTE = 43152, + SPELL_LYNX_RUSH_DAMAGE = 43153, + // Dragonhawk Form + SPELL_FLAME_WHIRL = 43213, // trigger two spells + SPELL_FLAME_BREATH = 43215, + SPELL_SUMMON_PILLAR = 43216, // summon 24187 + CREATURE_COLUMN_OF_FIRE = 24187, + SPELL_PILLAR_TRIGGER = 43218, // trigger 43217 + // Cosmetic + SPELL_SPIRIT_AURA = 42466, + SPELL_SIPHON_SOUL = 43501, + // Transforms: + SPELL_SHAPE_OF_THE_BEAR = 42594, // 15% dmg + SPELL_SHAPE_OF_THE_EAGLE = 42606, + SPELL_SHAPE_OF_THE_LYNX = 42607, // haste melee 30% + SPELL_SHAPE_OF_THE_DRAGONHAWK = 42608, + + SPELL_BERSERK = 45078 +}; + +enum Phase +{ + PHASE_BEAR = 0, + PHASE_EAGLE = 1, + PHASE_LYNX = 2, + PHASE_DRAGONHAWK = 3, + PHASE_TROLL = 4 +}; //coords for going for changing form #define CENTER_X 120.148811f @@ -129,17 +111,16 @@ static SpiritInfoStruct SpiritInfo[4] = struct TransformStruct { - uint32 sound; - std::string text; + uint8 text; uint32 spell, unaura; }; static TransformStruct Transform[4] = { - {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, - {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, - {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, - {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} + {YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, + {YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, + {YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, + {YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} }; class boss_zuljin : public CreatureScript @@ -230,8 +211,7 @@ class boss_zuljin : public CreatureScript DoZoneInCombat(); - me->MonsterYell(YELL_INTRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_INTRO); + Talk(YELL_INTRO); SpawnAdds(); EnterPhase(0); } @@ -241,17 +221,7 @@ class boss_zuljin : public CreatureScript if (Intro_Timer) return; - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL_ONE); - break; - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL_TWO); - break; - } + Talk(YELL_KILL); } void JustDied(Unit* /*killer*/) @@ -259,8 +229,7 @@ class boss_zuljin : public CreatureScript if (instance) instance->SetData(DATA_ZULJINEVENT, DONE); - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_DEATH); + Talk(YELL_DEATH); Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); if (Unit* Temp = Unit::GetUnit(*me, SpiritGUID[3])) @@ -353,8 +322,7 @@ class boss_zuljin : public CreatureScript me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); me->RemoveAurasDueToSpell(Transform[Phase].unaura); DoCast(me, Transform[Phase].spell); - me->MonsterYell(Transform[Phase].text.c_str(), LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, Transform[Phase].sound); + Talk(Transform[Phase].text); if (Phase > 0) { if (Unit* Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) @@ -409,8 +377,7 @@ class boss_zuljin : public CreatureScript if (Berserk_Timer <= diff) { DoCast(me, SPELL_BERSERK, true); - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_BERSERK); + Talk(YELL_BERSERK); Berserk_Timer = 60000; } else Berserk_Timer -= diff; @@ -421,8 +388,7 @@ class boss_zuljin : public CreatureScript { if (Intro_Timer <= diff) { - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AGGRO); + Talk(YELL_AGGRO); Intro_Timer = 0; } else Intro_Timer -= diff; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 372811b8a8c..abd6b468b07 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -29,13 +29,14 @@ EndScriptData */ #include "Player.h" #include "TemporarySummon.h" -#define MAX_ENCOUNTER 6 -#define RAND_VENDOR 2 +enum Misc +{ + MAX_ENCOUNTER = 7, + RAND_VENDOR = 2, + WORLDSTATE_SHOW_TIMER = 3104, + WORLDSTATE_TIME_TO_SACRIFICE = 3106 +}; -//187021 //Harkor's Satchel -//186648 //Tanzar's Trunk -//186672 //Ashli's Bag -//186667 //Kraz's Package // Chests spawn at bear/eagle/dragonhawk/lynx bosses // The loots depend on how many bosses have been killed, but not the entries of the chests // But we cannot add loots to gameobject, so we have to use the fixed loot_template @@ -51,9 +52,10 @@ static SHostageInfo HostageInfo[] = {23999, 187021, 400, 1414, 74.36f, 3.3f}, // eagle {24001, 186672, -35, 1134, 18.71f, 1.9f}, // dragonhawk {24024, 186667, 413, 1117, 6.32f, 3.1f} // lynx - }; +Position const HarrisonJonesLoc = {120.687f, 1674.0f, 42.0217f, 1.59044f}; + class instance_zulaman : public InstanceMapScript { public: @@ -70,9 +72,11 @@ class instance_zulaman : public InstanceMapScript uint64 TanzarsTrunkGUID; uint64 AshlisBagGUID; uint64 KrazsPackageGUID; + uint64 StrangeGongGUID; uint64 HexLordGateGUID; uint64 ZulJinGateGUID; + uint64 MassiveGateGUID; uint64 AkilzonDoorGUID; uint64 ZulJinDoorGUID; uint64 HalazziDoorGUID; @@ -93,20 +97,24 @@ class instance_zulaman : public InstanceMapScript TanzarsTrunkGUID = 0; AshlisBagGUID = 0; KrazsPackageGUID = 0; - + StrangeGongGUID = 0; HexLordGateGUID = 0; ZulJinGateGUID = 0; + MassiveGateGUID = 0; AkilzonDoorGUID = 0; HalazziDoorGUID = 0; ZulJinDoorGUID = 0; QuestTimer = 0; - QuestMinute = 21; + QuestMinute = 0; BossKilled = 0; ChestLooted = 0; for (uint8 i = 0; i < RAND_VENDOR; ++i) RandVendor[i] = NOT_STARTED; + + m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED; + instance->SummonCreature(NPC_HARRISON_JONES, HarrisonJonesLoc); } bool IsEncounterInProgress() const @@ -122,11 +130,11 @@ class instance_zulaman : public InstanceMapScript { switch (creature->GetEntry()) { - case 23578://janalai - case 23863://zuljin - case 24239://hexlord - case 23577://halazzi - case 23576://nalorakk + case NPC_JANALAI: + case NPC_ZULJIN: + case NPC_HEXLORD: + case NPC_HALAZZI: + case NPC_NALORAKK: default: break; } } @@ -135,18 +143,19 @@ class instance_zulaman : public InstanceMapScript { switch (go->GetEntry()) { - case 186303: HalazziDoorGUID = go->GetGUID(); break; - case 186304: ZulJinGateGUID = go->GetGUID(); break; - case 186305: HexLordGateGUID = go->GetGUID(); break; - case 186858: AkilzonDoorGUID = go->GetGUID(); break; - case 186859: ZulJinDoorGUID = go->GetGUID(); break; - - case 187021: HarkorsSatchelGUID = go->GetGUID(); break; - case 186648: TanzarsTrunkGUID = go->GetGUID(); break; - case 186672: AshlisBagGUID = go->GetGUID(); break; - case 186667: KrazsPackageGUID = go->GetGUID(); break; + case GO_DOOR_HALAZZI: HalazziDoorGUID = go->GetGUID(); break; + case GO_GATE_ZULJIN: ZulJinGateGUID = go->GetGUID(); break; + case GO_GATE_HEXLORD: HexLordGateGUID = go->GetGUID(); break; + case GO_MASSIVE_GATE: MassiveGateGUID = go->GetGUID(); break; + case GO_DOOR_AKILZON: AkilzonDoorGUID = go->GetGUID(); break; + case GO_DOOR_ZULJIN: ZulJinDoorGUID = go->GetGUID(); break; + + case GO_HARKORS_SATCHEL: HarkorsSatchelGUID = go->GetGUID(); break; + case GO_TANZARS_TRUNK: TanzarsTrunkGUID = go->GetGUID(); break; + case GO_ASHLIS_BAG: AshlisBagGUID = go->GetGUID(); break; + case GO_KRAZS_PACKAGE: KrazsPackageGUID = go->GetGUID(); break; + case GO_STRANGE_GONG: StrangeGongGUID = go->GetGUID(); break; default: break; - } CheckInstanceStatus(); } @@ -173,10 +182,10 @@ class instance_zulaman : public InstanceMapScript void CheckInstanceStatus() { - if (BossKilled >= 4) + if (BossKilled >= DATA_HALAZZIEVENT) HandleGameObject(HexLordGateGUID, true); - if (BossKilled >= 5) + if (BossKilled >= DATA_HEXLORDEVENT) HandleGameObject(ZulJinGateGUID, true); } @@ -214,49 +223,57 @@ class instance_zulaman : public InstanceMapScript { switch (type) { + case DATA_GONGEVENT: + m_auiEncounter[DATA_GONGEVENT] = data; + if (data == IN_PROGRESS) + SaveToDB(); + else if (data == DONE) + QuestMinute = 21; + break; case DATA_NALORAKKEVENT: - m_auiEncounter[0] = data; + m_auiEncounter[DATA_NALORAKKEVENT] = data; if (data == DONE) { if (QuestMinute) { QuestMinute += 15; - DoUpdateWorldState(3106, QuestMinute); + DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute); } SummonHostage(0); } break; case DATA_AKILZONEVENT: - m_auiEncounter[1] = data; + m_auiEncounter[DATA_AKILZONEVENT] = data; HandleGameObject(AkilzonDoorGUID, data != IN_PROGRESS); if (data == DONE) { if (QuestMinute) { QuestMinute += 10; - DoUpdateWorldState(3106, QuestMinute); + DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute); } SummonHostage(1); } break; case DATA_JANALAIEVENT: - m_auiEncounter[2] = data; - if (data == DONE) SummonHostage(2); + m_auiEncounter[DATA_JANALAIEVENT] = data; + if (data == DONE) + SummonHostage(2); break; case DATA_HALAZZIEVENT: - m_auiEncounter[3] = data; + m_auiEncounter[DATA_HALAZZIEVENT] = data; HandleGameObject(HalazziDoorGUID, data != IN_PROGRESS); if (data == DONE) SummonHostage(3); break; case DATA_HEXLORDEVENT: - m_auiEncounter[4] = data; + m_auiEncounter[DATA_HEXLORDEVENT] = data; if (data == IN_PROGRESS) HandleGameObject(HexLordGateGUID, false); else if (data == NOT_STARTED) CheckInstanceStatus(); break; case DATA_ZULJINEVENT: - m_auiEncounter[5] = data; + m_auiEncounter[DATA_ZULJINEVENT] = data; HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS); break; case DATA_CHESTLOOTED: @@ -274,10 +291,10 @@ class instance_zulaman : public InstanceMapScript if (data == DONE) { ++BossKilled; - if (QuestMinute && BossKilled >= 4) + if (QuestMinute && BossKilled >= DATA_HALAZZIEVENT) { QuestMinute = 0; - DoUpdateWorldState(3104, 0); + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); } CheckInstanceStatus(); SaveToDB(); @@ -288,12 +305,13 @@ class instance_zulaman : public InstanceMapScript { switch (type) { - case DATA_NALORAKKEVENT: return m_auiEncounter[0]; - case DATA_AKILZONEVENT: return m_auiEncounter[1]; - case DATA_JANALAIEVENT: return m_auiEncounter[2]; - case DATA_HALAZZIEVENT: return m_auiEncounter[3]; - case DATA_HEXLORDEVENT: return m_auiEncounter[4]; - case DATA_ZULJINEVENT: return m_auiEncounter[5]; + case DATA_GONGEVENT: return m_auiEncounter[DATA_GONGEVENT]; + case DATA_NALORAKKEVENT: return m_auiEncounter[DATA_NALORAKKEVENT]; + case DATA_AKILZONEVENT: return m_auiEncounter[DATA_AKILZONEVENT]; + case DATA_JANALAIEVENT: return m_auiEncounter[DATA_JANALAIEVENT]; + case DATA_HALAZZIEVENT: return m_auiEncounter[DATA_HALAZZIEVENT]; + case DATA_HEXLORDEVENT: return m_auiEncounter[DATA_HEXLORDEVENT]; + case DATA_ZULJINEVENT: return m_auiEncounter[DATA_ZULJINEVENT]; case DATA_CHESTLOOTED: return ChestLooted; case TYPE_RAND_VENDOR_1: return RandVendor[0]; case TYPE_RAND_VENDOR_2: return RandVendor[1]; @@ -312,13 +330,27 @@ class instance_zulaman : public InstanceMapScript QuestTimer += 60000; if (QuestMinute) { - DoUpdateWorldState(3104, 1); - DoUpdateWorldState(3106, QuestMinute); - } else DoUpdateWorldState(3104, 0); + DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1); + DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, QuestMinute); + } else DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0); } QuestTimer -= diff; } } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case GO_STRANGE_GONG: + return StrangeGongGUID; + case GO_MASSIVE_GATE: + return MassiveGateGUID; + } + + return 0; + } + }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 660f144c2dd..59997ebaa31 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -33,6 +33,7 @@ EndContentData */ #include "zulaman.h" #include "Player.h" #include "SpellInfo.h" +#include "SpellScript.h" /*###### ## npc_forest_frog @@ -199,9 +200,294 @@ class npc_zulaman_hostage : public CreatureScript } }; +/*###### +## npc_harrison_jones +######*/ + +enum Says +{ + SAY_HARRISON_0 = 0, + SAY_HARRISON_1 = 1, + SAY_HARRISON_2 = 0, + SAY_HARRISON_3 = 1 +}; + +enum Spells +{ + SPELL_BANGING_THE_GONG = 45225, + SPELL_STEALTH = 34189, + SPELL_COSMETIC_SPEAR_THROW = 43647 +}; + +enum Events +{ + GONG_EVENT_1 = 1, + GONG_EVENT_2 = 2, + GONG_EVENT_3 = 3, + GONG_EVENT_4 = 4, + GONG_EVENT_5 = 5, + GONG_EVENT_6 = 6, + GONG_EVENT_7 = 7, + GONG_EVENT_8 = 8, + GONG_EVENT_9 = 9, + GONG_EVENT_10 = 10, + GONG_EVENT_11 = 11 +}; + +enum Waypoints +{ + HARRISON_MOVE_1 = 860440, + HARRISON_MOVE_2 = 860441, + HARRISON_MOVE_3 = 860442 +}; + +enum DisplayIds +{ + MODEL_HARRISON_JONES_0 = 22340, + MODEL_HARRISON_JONES_1 = 22354, + MODEL_HARRISON_JONES_2 = 22347 +}; + +enum EntryIds +{ + NPC_HARRISON_JONES_1 = 24375, + NPC_HARRISON_JONES_2 = 24365, + NPC_AMANISHI_GUARDIAN = 23597, +}; + +enum Weapons +{ + WEAPON_MACE = 5301, + WEAPON_SPEAR = 13631 +}; + +class npc_harrison_jones : public CreatureScript +{ + public: + + npc_harrison_jones() + : CreatureScript("npc_harrison_jones") + { + } + + struct npc_harrison_jonesAI : public ScriptedAI + { + npc_harrison_jonesAI(Creature* creature) : ScriptedAI(creature) + { + instance = creature->GetInstanceScript(); + } + + InstanceScript* instance; + + uint8 _gongEvent; + uint32 _gongTimer; + uint64 uiTargetGUID; + + void Reset() + { + _gongEvent = 0; + _gongTimer = 0; + uiTargetGUID = 0; + } + + void EnterCombat(Unit* /*who*/) {} + + void sGossipSelect(Player* player, uint32 sender, uint32 action) + { + if (me->GetCreatureTemplate()->GossipMenuId == sender && !action) + { + player->CLOSE_GOSSIP_MENU(); + me->SetInFront(player); + me->SendMovementFlagUpdate(true); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + Talk(SAY_HARRISON_0); + _gongEvent = GONG_EVENT_1; + _gongTimer = 4000; + } + } + + void SpellHit(Unit*, const SpellInfo* spell) + { + if (spell->Id == SPELL_COSMETIC_SPEAR_THROW) + { + me->RemoveAllAuras(); + me->SetEntry(NPC_HARRISON_JONES_2); + me->SetDisplayId(MODEL_HARRISON_JONES_2); + me->SetTarget(0); + me->SetByteValue(UNIT_FIELD_BYTES_1,0,UNIT_STAND_STATE_DEAD); + me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + if (instance) + instance->SetData(DATA_GONGEVENT, DONE); + } + } + + void UpdateAI(uint32 const diff) + { + if (_gongEvent) + { + if (_gongTimer <= diff) + { + switch (_gongEvent) + { + case GONG_EVENT_1: + me->GetMotionMaster()->MovePath(HARRISON_MOVE_1,false); + _gongEvent = GONG_EVENT_2; + _gongTimer = 12000; + break; + case GONG_EVENT_2: + me->SetFacingTo(6.235659f); + Talk(SAY_HARRISON_1); + DoCast(me, SPELL_BANGING_THE_GONG); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_MACE)); + me->SetSheath(SHEATH_STATE_MELEE); + _gongEvent = GONG_EVENT_3; + _gongTimer = 4000; + break; + case GONG_EVENT_3: + if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) + gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + _gongEvent = GONG_EVENT_4; + _gongTimer = 105000; + break; + case GONG_EVENT_4: + me->RemoveAura(SPELL_BANGING_THE_GONG); + if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) + gong->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); + + // trigger or gong will need to be scripted to set IN_PROGRESS after enough hits. + // This is temp workaround. + if (instance) + instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed. + + if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS) + { + // Players are Now Saved to instance at SPECIAL (Player should be notified?) + me->GetMotionMaster()->MovePath(HARRISON_MOVE_2,false); + _gongEvent = GONG_EVENT_5; + _gongTimer = 5000; + } + else + { + _gongTimer = 1000; + _gongEvent = GONG_EVENT_9; + } + break; + case GONG_EVENT_5: + me->SetEntry(NPC_HARRISON_JONES_1); + me->SetDisplayId(MODEL_HARRISON_JONES_1); + Talk(SAY_HARRISON_2); + _gongTimer = 12000; + _gongEvent = GONG_EVENT_6; + break; + case GONG_EVENT_6: + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); + Talk(SAY_HARRISON_3); + _gongTimer = 7000; + _gongEvent = GONG_EVENT_7; + break; + case GONG_EVENT_7: + if (!uiTargetGUID) + { + std::list<Creature*> targetList; + GetCreatureListWithEntryInGrid(targetList, me, NPC_AMANISHI_GUARDIAN, 26.0f); + if (!targetList.empty()) + { + for (std::list<Creature*>::const_iterator itr = targetList.begin(); itr != targetList.end(); ++itr) + { + if (Creature* ptarget = *itr) + { + if (ptarget->GetPositionX() > 120) + { + ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR)); + ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetReactState(REACT_PASSIVE); + ptarget->AI()->SetData(0,1); + } + else + ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetReactState(REACT_PASSIVE); + ptarget->AI()->SetData(0,2); + } + } + } + } + + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_MASSIVE_GATE))) + gate->SetGoState(GO_STATE_ACTIVE); + _gongTimer = 2000; + _gongEvent = GONG_EVENT_8; + break; + case GONG_EVENT_8: + DoCast(me, SPELL_STEALTH); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); + me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); + _gongTimer = 1000; + _gongEvent = 0; + break; + case GONG_EVENT_9: + me->GetMotionMaster()->MovePoint(0, 120.687f, 1674.0f, 42.0217f); + _gongTimer = 12000; + _gongEvent = GONG_EVENT_10; + break; + case GONG_EVENT_10: + me->SetFacingTo(1.59044f); + _gongEvent = 11; + _gongTimer = 6000; + break; + case GONG_EVENT_11: + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + if (instance) + instance->SetData(DATA_GONGEVENT, NOT_STARTED); + _gongEvent = 0; + _gongTimer = 1000; + break; + } + } + else + _gongTimer -= diff; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_harrison_jonesAI(creature); + } +}; + +class spell_banging_the_gong : public SpellScriptLoader +{ + public: + spell_banging_the_gong() : SpellScriptLoader("spell_banging_the_gong") { } + + class spell_banging_the_gong_SpellScript : public SpellScript + { + PrepareSpellScript(spell_banging_the_gong_SpellScript); + + void Activate(SpellEffIndex index) + { + PreventHitDefaultEffect(index); + GetHitGObj()->SendCustomAnim(0); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_banging_the_gong_SpellScript(); + } +}; + + void AddSC_zulaman() { new npc_forest_frog(); new npc_zulaman_hostage(); + new npc_harrison_jones(); + new spell_banging_the_gong(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h index 7227dfaedf4..c3386f8c996 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.h @@ -19,15 +19,43 @@ #ifndef DEF_ZULAMAN_H #define DEF_ZULAMAN_H -#define DATA_NALORAKKEVENT 1 -#define DATA_AKILZONEVENT 2 -#define DATA_JANALAIEVENT 3 -#define DATA_HALAZZIEVENT 4 -#define DATA_HEXLORDEVENT 5 -#define DATA_ZULJINEVENT 6 -#define DATA_CHESTLOOTED 7 -#define TYPE_RAND_VENDOR_1 8 -#define TYPE_RAND_VENDOR_2 9 +enum DataTypes +{ + DATA_GONGEVENT = 0, + DATA_NALORAKKEVENT = 1, + DATA_AKILZONEVENT = 2, + DATA_JANALAIEVENT = 3, + DATA_HALAZZIEVENT = 4, + DATA_HEXLORDEVENT = 5, + DATA_ZULJINEVENT = 6, + DATA_CHESTLOOTED = 7, + TYPE_RAND_VENDOR_1 = 8, + TYPE_RAND_VENDOR_2 = 9 +}; -#endif +enum CreatureIds +{ + NPC_HARRISON_JONES = 24358, + NPC_JANALAI = 23578, + NPC_ZULJIN = 23863, + NPC_HEXLORD = 24239, + NPC_HALAZZI = 23577, + NPC_NALORAKK = 23576 +}; + +enum GameobjectIds +{ + GO_DOOR_HALAZZI = 186303, + GO_GATE_ZULJIN = 186304, + GO_GATE_HEXLORD = 186305, + GO_MASSIVE_GATE = 186728, + GO_DOOR_AKILZON = 186858, + GO_DOOR_ZULJIN = 186859, + GO_HARKORS_SATCHEL = 187021, + GO_TANZARS_TRUNK = 186648, + GO_ASHLIS_BAG = 186672, + GO_KRAZS_PACKAGE = 186667, + GO_STRANGE_GONG = 187359 +}; +#endif diff --git a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp index 9b9af494554..9b9af494554 100644 --- a/src/server/scripts/EasternKingdoms/alterac_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_alterac_mountains.cpp diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index d638a435936..d638a435936 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp diff --git a/src/server/scripts/EasternKingdoms/blasted_lands.cpp b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp index 4f76edf4406..4f76edf4406 100644 --- a/src/server/scripts/EasternKingdoms/blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp diff --git a/src/server/scripts/EasternKingdoms/burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp index b6899c534e4..b6899c534e4 100644 --- a/src/server/scripts/EasternKingdoms/burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp diff --git a/src/server/scripts/EasternKingdoms/duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp index 1ce83d31a63..1ce83d31a63 100644 --- a/src/server/scripts/EasternKingdoms/duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp diff --git a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp index a2522fd9495..a2522fd9495 100644 --- a/src/server/scripts/EasternKingdoms/eastern_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp diff --git a/src/server/scripts/EasternKingdoms/eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp index 432768a51de..432768a51de 100644 --- a/src/server/scripts/EasternKingdoms/eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp diff --git a/src/server/scripts/EasternKingdoms/ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index 9e00ceb2aa5..9e00ceb2aa5 100644 --- a/src/server/scripts/EasternKingdoms/ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp diff --git a/src/server/scripts/EasternKingdoms/hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index ffd31937677..ffd31937677 100644 --- a/src/server/scripts/EasternKingdoms/hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp diff --git a/src/server/scripts/EasternKingdoms/ironforge.cpp b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp index f9e8d4d16c6..f9e8d4d16c6 100644 --- a/src/server/scripts/EasternKingdoms/ironforge.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ironforge.cpp diff --git a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp index bfd4d24cec6..bfd4d24cec6 100644 --- a/src/server/scripts/EasternKingdoms/isle_of_queldanas.cpp +++ b/src/server/scripts/EasternKingdoms/zone_isle_of_queldanas.cpp diff --git a/src/server/scripts/EasternKingdoms/loch_modan.cpp b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp index 30f12718d64..30f12718d64 100644 --- a/src/server/scripts/EasternKingdoms/loch_modan.cpp +++ b/src/server/scripts/EasternKingdoms/zone_loch_modan.cpp diff --git a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp index 5ff95f83f25..5ff95f83f25 100644 --- a/src/server/scripts/EasternKingdoms/redridge_mountains.cpp +++ b/src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp diff --git a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp index e750faefbf5..e750faefbf5 100644 --- a/src/server/scripts/EasternKingdoms/silvermoon_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silvermoon_city.cpp diff --git a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index 290f7fa6882..290f7fa6882 100644 --- a/src/server/scripts/EasternKingdoms/silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp diff --git a/src/server/scripts/EasternKingdoms/stormwind_city.cpp b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp index e81567a1a7a..e81567a1a7a 100644 --- a/src/server/scripts/EasternKingdoms/stormwind_city.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp diff --git a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp index 6e14ef840a3..6e14ef840a3 100644 --- a/src/server/scripts/EasternKingdoms/stranglethorn_vale.cpp +++ b/src/server/scripts/EasternKingdoms/zone_stranglethorn_vale.cpp diff --git a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp index f686de5d88f..f686de5d88f 100644 --- a/src/server/scripts/EasternKingdoms/swamp_of_sorrows.cpp +++ b/src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp diff --git a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp index f36220dec0f..f36220dec0f 100644 --- a/src/server/scripts/EasternKingdoms/tirisfal_glades.cpp +++ b/src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp diff --git a/src/server/scripts/EasternKingdoms/undercity.cpp b/src/server/scripts/EasternKingdoms/zone_undercity.cpp index 2c3017a2f1a..2c3017a2f1a 100644 --- a/src/server/scripts/EasternKingdoms/undercity.cpp +++ b/src/server/scripts/EasternKingdoms/zone_undercity.cpp diff --git a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp index ee22b766154..ee22b766154 100644 --- a/src/server/scripts/EasternKingdoms/western_plaguelands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_western_plaguelands.cpp diff --git a/src/server/scripts/EasternKingdoms/westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp index 1b93cf1be71..1b93cf1be71 100644 --- a/src/server/scripts/EasternKingdoms/westfall.cpp +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp diff --git a/src/server/scripts/EasternKingdoms/wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index c8a1fc2b2b4..c8a1fc2b2b4 100644 --- a/src/server/scripts/EasternKingdoms/wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp diff --git a/src/server/scripts/Kalimdor/CMakeLists.txt b/src/server/scripts/Kalimdor/CMakeLists.txt index ee091c96309..5c44cd7ef27 100644 --- a/src/server/scripts/Kalimdor/CMakeLists.txt +++ b/src/server/scripts/Kalimdor/CMakeLists.txt @@ -10,9 +10,9 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Kalimdor/stonetalon_mountains.cpp - Kalimdor/silithus.cpp - Kalimdor/moonglade.cpp + Kalimdor/zone_stonetalon_mountains.cpp + Kalimdor/zone_silithus.cpp + Kalimdor/zone_moonglade.cpp Kalimdor/RazorfenDowns/razorfen_downs.cpp Kalimdor/RazorfenDowns/instance_razorfen_downs.cpp Kalimdor/RazorfenDowns/boss_amnennar_the_coldbringer.cpp @@ -58,10 +58,10 @@ set(scripts_STAT_SRCS Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp Kalimdor/BlackfathomDeeps/blackfathom_deeps.h - Kalimdor/azuremyst_isle.cpp - Kalimdor/orgrimmar.cpp - Kalimdor/desolace.cpp - Kalimdor/feralas.cpp + Kalimdor/zone_azuremyst_isle.cpp + Kalimdor/zone_orgrimmar.cpp + Kalimdor/zone_desolace.cpp + Kalimdor/zone_feralas.cpp Kalimdor/Maraudon/boss_princess_theradras.cpp Kalimdor/Maraudon/boss_landslide.cpp Kalimdor/Maraudon/boss_celebras_the_cursed.cpp @@ -78,7 +78,7 @@ set(scripts_STAT_SRCS Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp - Kalimdor/darkshore.cpp + Kalimdor/zone_darkshore.cpp Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp Kalimdor/RuinsOfAhnQiraj/instance_ruins_of_ahnqiraj.cpp Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -87,27 +87,27 @@ set(scripts_STAT_SRCS Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp - Kalimdor/mulgore.cpp - Kalimdor/bloodmyst_isle.cpp - Kalimdor/thunder_bluff.cpp - Kalimdor/azshara.cpp + Kalimdor/zone_mulgore.cpp + Kalimdor/zone_bloodmyst_isle.cpp + Kalimdor/zone_thunder_bluff.cpp + Kalimdor/zone_azshara.cpp Kalimdor/RazorfenKraul/razorfen_kraul.h Kalimdor/RazorfenKraul/instance_razorfen_kraul.cpp Kalimdor/RazorfenKraul/razorfen_kraul.cpp - Kalimdor/the_barrens.cpp - Kalimdor/ungoro_crater.cpp + Kalimdor/zone_the_barrens.cpp + Kalimdor/zone_ungoro_crater.cpp Kalimdor/WailingCaverns/wailing_caverns.h Kalimdor/WailingCaverns/instance_wailing_caverns.cpp Kalimdor/WailingCaverns/wailing_caverns.cpp - Kalimdor/durotar.cpp - Kalimdor/felwood.cpp + Kalimdor/zone_durotar.cpp + Kalimdor/zone_felwood.cpp Kalimdor/boss_azuregos.cpp - Kalimdor/tanaris.cpp - Kalimdor/dustwallow_marsh.cpp - Kalimdor/winterspring.cpp - Kalimdor/thousand_needles.cpp - Kalimdor/ashenvale.cpp - Kalimdor/teldrassil.cpp + Kalimdor/zone_tanaris.cpp + Kalimdor/zone_dustwallow_marsh.cpp + Kalimdor/zone_winterspring.cpp + Kalimdor/zone_thousand_needles.cpp + Kalimdor/zone_ashenvale.cpp + Kalimdor/zone_teldrassil.cpp Kalimdor/OnyxiasLair/boss_onyxia.cpp Kalimdor/OnyxiasLair/onyxias_lair.h Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 2ff0bc61448..e72e6dff9cf 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -21,20 +21,22 @@ #include "ScriptedCreature.h" #include "ruins_of_ahnqiraj.h" -enum eAyamiss +enum Spells { SPELL_STINGERSPRAY = 25749, - SPELL_POISONSTINGER = 25748, //only used in phase1 + SPELL_POISONSTINGER = 25748, // Only used in phase 1 SPELL_PARALYZE = 25725, SPELL_TRASH = 3391, - SPELL_FRENZY = 8269, + SPELL_FRENZY = 8269, // Not used SPELL_LASH = 25852, - - EMOTE_FRENZY = -1000002, - SPELL_FEED = 25721, }; +enum Says +{ + EMOTE_FRENZY = 0 // Not used +}; + class boss_ayamiss : public CreatureScript { public: diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 9573d495524..d32a19e4020 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -16,287 +16,225 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Skeram -SD%Complete: 75 -SDComment: Mind Control buggy. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "temple_of_ahnqiraj.h" -#include "Group.h" -#include "Player.h" -enum Skeram +enum Yells { SAY_AGGRO = 0, SAY_SLAY = 1, SAY_SPLIT = 2, SAY_DEATH = 3, +}; - SPELL_ARCANE_EXPLOSION = 25679, +enum Spells +{ + SPELL_ARCANE_EXPLOSION = 26192, SPELL_EARTH_SHOCK = 26194, SPELL_TRUE_FULFILLMENT = 785, - SPELL_BLINK = 28391 + SPELL_INITIALIZE_IMAGE = 3730, + SPELL_SUMMON_IMAGES = 747 }; -class ov_mycoordinates +enum Events { - public: - float x, y, z, r; - ov_mycoordinates(float cx, float cy, float cz, float cr) - { - x = cx; y = cy; z = cz; r = cr; - } + EVENT_ARCANE_EXPLOSION = 0, + EVENT_FULLFILMENT = 1, + EVENT_BLINK = 2, + EVENT_EARTH_SHOCK = 3 }; +uint32 const BlinkSpells[3] = { 4801, 8195, 20449 }; + class boss_skeram : public CreatureScript { -public: - boss_skeram() : CreatureScript("boss_skeram") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_skeramAI (creature); - } - - struct boss_skeramAI : public ScriptedAI - { - boss_skeramAI(Creature* creature) : ScriptedAI(creature) - { - IsImage = false; - } - - uint32 ArcaneExplosion_Timer; - uint32 EarthShock_Timer; - uint32 FullFillment_Timer; - uint32 Blink_Timer; - uint32 Invisible_Timer; - - bool Images75; - bool Images50; - bool Images25; - bool IsImage; - bool Invisible; - - void Reset() - { - ArcaneExplosion_Timer = urand(6000, 12000); - EarthShock_Timer = 2000; - FullFillment_Timer = 15000; - Blink_Timer = urand(8000, 20000); - Invisible_Timer = 500; - - Images75 = false; - Images50 = false; - Images25 = false; - Invisible = false; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisible(true); - - if (IsImage) - me->setDeathState(JUST_DIED); - } - - void KilledUnit(Unit* /*victim*/) - { - Talk(SAY_SLAY); - } - - void JustDied(Unit* /*killer*/) - { - if (!IsImage) - Talk(SAY_DEATH); - } - - void EnterCombat(Unit* /*who*/) - { - if (IsImage || Images75) - return; - Talk(SAY_AGGRO); - } + public: + boss_skeram() : CreatureScript("boss_skeram") { } - void UpdateAI(const uint32 diff) + struct boss_skeramAI : public BossAI { - //Return since we have no target - if (!UpdateVictim()) - return; + boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { } - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) + void Reset() { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = urand(8000, 18000); - } else ArcaneExplosion_Timer -= diff; + _flag = 0; + _hpct = 75.0f; + me->SetVisible(true); + } - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) + void KilledUnit(Unit* /*victim*/) { - //Make sure our attack is ready and we arn't currently casting - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - }else + Talk(SAY_SLAY); + } + + void EnterEvadeMode() { - //EarthShock_Timer - if (EarthShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_EARTH_SHOCK); - EarthShock_Timer = 1000; - } else EarthShock_Timer -= diff; + ScriptedAI::EnterEvadeMode(); + if (me->isSummon()) + ((TempSummon*)me)->UnSummon(); } - //Blink_Timer - if (Blink_Timer <= diff) + void JustSummoned(Creature* creature) { - //DoCast(me, SPELL_BLINK); - switch (urand(0, 2)) + // Shift the boss and images (Get it? *Shift*?) + uint8 Rand; + if (_flag != 0) { - case 0: - me->SetPosition(-8340.782227f, 2083.814453f, 125.648788f, 0.0f); - DoResetThreat(); - break; - case 1: - me->SetPosition(-8341.546875f, 2118.504639f, 133.058151f, 0.0f); - DoResetThreat(); - break; - case 2: - me->SetPosition(-8318.822266f, 2058.231201f, 133.058151f, 0.0f); - DoResetThreat(); - break; + while (_flag & (1 << Rand)) + Rand = urand(0, 2); + DoCast(me, BlinkSpells[Rand]); + _flag |= (1 << Rand); + _flag |= (1 << 7); } - DoStopAttack(); - - Blink_Timer= urand(20000, 40000); - } else Blink_Timer -= diff; - int procent = (int) (me->GetHealthPct() + 0.5f); - - //Summoning 2 Images and teleporting to a random position on 75% health - if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) - DoSplit(75); - - //Summoning 2 Images and teleporting to a random position on 50% health - if ((!Images50 && !IsImage) && (procent <= 50 && procent > 45)) - DoSplit(50); - - //Summoning 2 Images and teleporting to a random position on 25% health - if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) - DoSplit(25); + while (_flag & (1 << Rand)) + Rand = urand(0, 2); + creature->CastSpell(creature, BlinkSpells[Rand]); + _flag |= (1 << Rand); + + if (_flag & (1 << 7)) + _flag = 0; + + if (Unit* Target = SelectTarget(SELECT_TARGET_RANDOM)) + creature->AI()->AttackStart(Target); + + float ImageHealthPct; + + if (me->GetHealthPct() < 25.0f) + ImageHealthPct = 0.50f; + else if (me->GetHealthPct() < 50.0f) + ImageHealthPct = 0.20f; + else + ImageHealthPct = 0.10f; + + creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct); + creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f)); + } - //Invisible_Timer - if (Invisible) + void JustDied(Unit* /*killer*/) { - if (Invisible_Timer <= diff) - { - //Making Skeram visible after telporting - me->SetVisible(true); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - Invisible_Timer = 2500; - Invisible = false; - } else Invisible_Timer -= diff; + if (!me->isSummon()) + Talk(SAY_DEATH); + else + me->RemoveCorpse(); } - DoMeleeAttackIfReady(); - } - - void DoSplit(int atPercent /* 75 50 25 */) - { - Talk(SAY_SPLIT); - - ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227f, 2083.814453f, 125.648788f, 0); - ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875f, 2118.504639f, 133.058151f, 0); - ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266f, 2058.231201f, 133.058151f, 0); + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.Reset(); - ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000)); + events.ScheduleEvent(EVENT_FULLFILMENT, 15000); + events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000)); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); - switch (urand(0, 2)) - { - case 0: - bossc=place1; - i1=place2; - i2=place3; - break; - case 1: - bossc=place2; - i1=place1; - i2=place3; - break; - case 2: - bossc=place3; - i1=place1; - i2=place2; - break; + Talk(SAY_AGGRO); } - for (uint16 i = 0; i < 41; ++i) + void UpdateAI(uint32 const diff) { - if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))) + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - if (Group* pGrp = target->GetGroup()) - for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico) - { - //if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :( - pGrp->SetTargetIcon(ico, 0, 0); - } + switch (eventId) + { + case EVENT_ARCANE_EXPLOSION: + DoCastAOE(SPELL_ARCANE_EXPLOSION, true); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000)); + break; + case EVENT_FULLFILMENT: + // TODO: For some weird reason boss does not cast this + // Spell actually works, tested in duel + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true); + events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000)); + break; + case EVENT_BLINK: + DoCast(me, BlinkSpells[urand(0, 2)]); + DoResetThreat(); + me->SetVisible(true); + events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000)); + break; + case EVENT_EARTH_SHOCK: + DoCastVictim(SPELL_EARTH_SHOCK); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); + break; + } + } - break; + if (!me->isSummon() && me->GetHealthPct() < _hpct) + { + DoCast(me, SPELL_SUMMON_IMAGES); + Talk(SAY_SPLIT); + _hpct -= 25.0f; + me->SetVisible(false); + events.RescheduleEvent(EVENT_BLINK, 2000); + } + + if (me->IsWithinMeleeRange(me->getVictim())) + { + events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000); + DoMeleeAttackIfReady(); } } + + private: + float _hpct; + uint8 _flag; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_skeramAI(creature); + } +}; - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisible(false); - me->SetPosition(bossc->x, bossc->y, bossc->z, bossc->r); - Invisible = true; - DoResetThreat(); - DoStopAttack(); +class PlayerOrPetCheck +{ + public: + bool operator()(WorldObject* object) const + { + if (object->GetTypeId() != TYPEID_PLAYER) + if (!object->ToCreature()->isPet()) + return true; - switch (atPercent) - { - case 75: Images75 = true; break; - case 50: Images50 = true; break; - case 25: Images25 = true; break; - } + return false; + } +}; - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); +class spell_skeram_arcane_explosion : public SpellScriptLoader +{ + public: + spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { } + + class spell_skeram_arcane_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript); - Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image1) + void FilterTargets(std::list<WorldObject*>& targets) { - Image1->SetMaxHealth(me->GetMaxHealth() / 5); - Image1->SetHealth(me->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); - CAST_AI(boss_skeram::boss_skeramAI, Image1->AI())->IsImage = true; + targets.remove_if(PlayerOrPetCheck()); } - Creature* Image2 = me->SummonCreature(15263, i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image2) + void Register() { - Image2->SetMaxHealth(me->GetMaxHealth() / 5); - Image2->SetHealth(me->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - CAST_AI(boss_skeram::boss_skeramAI, Image2->AI())->IsImage = true; + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } - Invisible = true; - delete place1; - delete place2; - delete place3; - } - - }; + }; + SpellScript* GetSpellScript() const + { + return new spell_skeram_arcane_explosion_SpellScript(); + } }; void AddSC_boss_skeram() { new boss_skeram(); + new spell_skeram_arcane_explosion(); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index 5649253fa4e..fcbe3a84d62 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -279,7 +279,7 @@ class npc_glob_of_viscidus : public CreatureScript else { Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20); - Viscidus->GetAI()->DoCast(Viscidus, SPELL_VISCIDUS_SHRINKS); + Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS); } } } diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/zone_ashenvale.cpp index 94c68a1d3ec..94c68a1d3ec 100644 --- a/src/server/scripts/Kalimdor/ashenvale.cpp +++ b/src/server/scripts/Kalimdor/zone_ashenvale.cpp diff --git a/src/server/scripts/Kalimdor/azshara.cpp b/src/server/scripts/Kalimdor/zone_azshara.cpp index 44f7e1e8172..44f7e1e8172 100644 --- a/src/server/scripts/Kalimdor/azshara.cpp +++ b/src/server/scripts/Kalimdor/zone_azshara.cpp diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index 4b03cd65cad..4b03cd65cad 100644 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp diff --git a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index 102a9494a65..102a9494a65 100644 --- a/src/server/scripts/Kalimdor/bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp diff --git a/src/server/scripts/Kalimdor/darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index 09f061148d3..09f061148d3 100644 --- a/src/server/scripts/Kalimdor/darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp diff --git a/src/server/scripts/Kalimdor/desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index 8f55bb6102c..8f55bb6102c 100644 --- a/src/server/scripts/Kalimdor/desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp diff --git a/src/server/scripts/Kalimdor/durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp index fa6b830c1ae..fa6b830c1ae 100644 --- a/src/server/scripts/Kalimdor/durotar.cpp +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index 37941227c78..37941227c78 100644 --- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp diff --git a/src/server/scripts/Kalimdor/felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp index e23eaa961bb..e23eaa961bb 100644 --- a/src/server/scripts/Kalimdor/felwood.cpp +++ b/src/server/scripts/Kalimdor/zone_felwood.cpp diff --git a/src/server/scripts/Kalimdor/feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp index b2326de86ab..b2326de86ab 100644 --- a/src/server/scripts/Kalimdor/feralas.cpp +++ b/src/server/scripts/Kalimdor/zone_feralas.cpp diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/zone_moonglade.cpp index e41ffae03e6..e41ffae03e6 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/zone_moonglade.cpp diff --git a/src/server/scripts/Kalimdor/mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp index aca55284b67..aca55284b67 100644 --- a/src/server/scripts/Kalimdor/mulgore.cpp +++ b/src/server/scripts/Kalimdor/zone_mulgore.cpp diff --git a/src/server/scripts/Kalimdor/orgrimmar.cpp b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp index 42ef9843a4e..42ef9843a4e 100644 --- a/src/server/scripts/Kalimdor/orgrimmar.cpp +++ b/src/server/scripts/Kalimdor/zone_orgrimmar.cpp diff --git a/src/server/scripts/Kalimdor/silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 58665224bdd..58665224bdd 100644 --- a/src/server/scripts/Kalimdor/silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp diff --git a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index 26c92c7404c..26c92c7404c 100644 --- a/src/server/scripts/Kalimdor/stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp diff --git a/src/server/scripts/Kalimdor/tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 0648e40416d..0648e40416d 100644 --- a/src/server/scripts/Kalimdor/tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp diff --git a/src/server/scripts/Kalimdor/teldrassil.cpp b/src/server/scripts/Kalimdor/zone_teldrassil.cpp index d7983c2cbe6..d7983c2cbe6 100644 --- a/src/server/scripts/Kalimdor/teldrassil.cpp +++ b/src/server/scripts/Kalimdor/zone_teldrassil.cpp diff --git a/src/server/scripts/Kalimdor/the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 8f7ab09260b..8f7ab09260b 100644 --- a/src/server/scripts/Kalimdor/the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp diff --git a/src/server/scripts/Kalimdor/thousand_needles.cpp b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp index 9c47991a5d5..9c47991a5d5 100644 --- a/src/server/scripts/Kalimdor/thousand_needles.cpp +++ b/src/server/scripts/Kalimdor/zone_thousand_needles.cpp diff --git a/src/server/scripts/Kalimdor/thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp index 0d915dc7c44..0d915dc7c44 100644 --- a/src/server/scripts/Kalimdor/thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp diff --git a/src/server/scripts/Kalimdor/ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp index e72c82bee97..e72c82bee97 100644 --- a/src/server/scripts/Kalimdor/ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp diff --git a/src/server/scripts/Kalimdor/winterspring.cpp b/src/server/scripts/Kalimdor/zone_winterspring.cpp index 06f01033a25..06f01033a25 100644 --- a/src/server/scripts/Kalimdor/winterspring.cpp +++ b/src/server/scripts/Kalimdor/zone_winterspring.cpp diff --git a/src/server/scripts/Northrend/CMakeLists.txt b/src/server/scripts/Northrend/CMakeLists.txt index 233d49192e6..1da1e4ab178 100644 --- a/src/server/scripts/Northrend/CMakeLists.txt +++ b/src/server/scripts/Northrend/CMakeLists.txt @@ -10,9 +10,9 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Northrend/wintergrasp.cpp + Northrend/zone_wintergrasp.cpp Northrend/isle_of_conquest.cpp - Northrend/storm_peaks.cpp + Northrend/zone_storm_peaks.cpp Northrend/Ulduar/HallsOfLightning/instance_halls_of_lightning.cpp Northrend/Ulduar/HallsOfLightning/boss_bjarngrim.cpp Northrend/Ulduar/HallsOfLightning/halls_of_lightning.h @@ -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 @@ -117,14 +117,14 @@ set(scripts_STAT_SRCS Northrend/Naxxramas/instance_naxxramas.cpp Northrend/Naxxramas/boss_grobbulus.cpp Northrend/Naxxramas/boss_noth.cpp - Northrend/crystalsong_forest.cpp + Northrend/zone_crystalsong_forest.cpp Northrend/VaultOfArchavon/boss_archavon.cpp Northrend/VaultOfArchavon/boss_koralon.cpp Northrend/VaultOfArchavon/vault_of_archavon.h Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp Northrend/VaultOfArchavon/boss_emalon.cpp Northrend/VaultOfArchavon/boss_toravon.cpp - Northrend/sholazar_basin.cpp + Northrend/zone_sholazar_basin.cpp Northrend/UtgardeKeep/UtgardePinnacle/boss_palehoof.cpp Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp Northrend/UtgardeKeep/UtgardePinnacle/instance_pinnacle.cpp @@ -137,8 +137,8 @@ set(scripts_STAT_SRCS Northrend/UtgardeKeep/UtgardeKeep/instance_utgarde_keep.cpp Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp - Northrend/dragonblight.cpp - Northrend/grizzly_hills.cpp + Northrend/zone_dragonblight.cpp + Northrend/zone_grizzly_hills.cpp Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -176,8 +176,8 @@ set(scripts_STAT_SRCS Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp Northrend/IcecrownCitadel/boss_sindragosa.cpp Northrend/IcecrownCitadel/boss_the_lich_king.cpp - Northrend/zuldrak.cpp - Northrend/icecrown.cpp + Northrend/zone_zuldrak.cpp + Northrend/zone_icecrown.cpp Northrend/Gundrak/boss_slad_ran.cpp Northrend/Gundrak/instance_gundrak.cpp Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -185,9 +185,9 @@ set(scripts_STAT_SRCS Northrend/Gundrak/boss_gal_darah.cpp Northrend/Gundrak/boss_moorabi.cpp Northrend/Gundrak/boss_eck.cpp - Northrend/borean_tundra.cpp - Northrend/howling_fjord.cpp - Northrend/dalaran.cpp + Northrend/zone_borean_tundra.cpp + Northrend/zone_howling_fjord.cpp + Northrend/zone_dalaran.cpp Northrend/DraktharonKeep/boss_trollgore.cpp Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp Northrend/DraktharonKeep/boss_novos.cpp diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 6d33efb4515..e99128fbbf9 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -16,229 +16,245 @@ */ #include "ScriptMgr.h" +#include "SpellScript.h" #include "ScriptedCreature.h" #include "drak_tharon_keep.h" -enum Spells +enum Misc { - SPELL_ARCANE_BLAST = 49198, - H_SPELL_ARCANE_BLAST = 59909, - SPELL_ARCANE_FIELD = 47346, - SPELL_BLIZZARD = 49034, - H_SPELL_BLIZZARD = 59854, - SPELL_FROSTBOLT = 49037, - H_SPELL_FROSTBOLT = 59855, - SPELL_WRATH_OF_MISERY = 50089, - H_SPELL_WRATH_OF_MISERY = 59856, - SPELL_SUMMON_MINIONS = 59910 //Summons an army of Fetid Troll Corpses to assist the caster. + ACTION_RESET_CRYSTALS, + ACTION_ACTIVATE_CRYSTAL, + ACTION_DEACTIVATE, + EVENT_ATTACK, + EVENT_SUMMON_MINIONS, + DATA_NOVOS_ACHIEV }; -//not in db -enum Yells +enum Creatures { - SAY_AGGRO = 0, - SAY_KILL = 1, - SAY_DEATH = 2, - SAY_NECRO_ADD = 3, - SAY_REUBBLE = 4 + NPC_CRYSTAL_CHANNEL_TARGET = 26712, + NPC_FETID_TROLL_CORPSE = 27597, + NPC_RISEN_SHADOWCASTER = 27600, + NPC_HULKING_CORPSE = 27597 }; -enum Creatures +enum Spells { - CREATURE_RISEN_SHADOWCASTER = 27600, - CREATURE_FETID_TROLL_CORPSE = 27598, - CREATURE_HULKING_CORPSE = 27597, - CREATURE_CRYSTAL_HANDLER = 26627 + SPELL_BEAM_CHANNEL = 52106, + SPELL_ARCANE_FIELD = 47346, + + SPELL_SUMMON_RISEN_SHADOWCASTER = 49105, + SPELL_SUMMON_FETID_TROLL_CORPSE = 49103, + SPELL_SUMMON_HULKING_CORPSE = 49104, + SPELL_SUMMON_CRYSTAL_HANDLER = 49179, + + SPELL_ARCANE_BLAST = 49198, + SPELL_BLIZZARD = 49034, + SPELL_FROSTBOLT = 49037, + SPELL_WRATH_OF_MISERY = 50089, + SPELL_SUMMON_MINIONS = 59910 }; -enum CombatPhase +struct SummonerInfo { - IDLE, - PHASE_1, - PHASE_2 + uint32 data, spell, timer; }; -#define ACTION_MINION_REACHED 1 -#define DATA_OH_NOVOS 2 +const SummonerInfo summoners[] = +{ + { DATA_NOVOS_SUMMONER_1, SPELL_SUMMON_RISEN_SHADOWCASTER, 15000 }, + { DATA_NOVOS_SUMMONER_2, SPELL_SUMMON_FETID_TROLL_CORPSE, 5000 }, + { DATA_NOVOS_SUMMONER_3, SPELL_SUMMON_HULKING_CORPSE, 30000 }, + { DATA_NOVOS_SUMMONER_4, SPELL_SUMMON_CRYSTAL_HANDLER, 30000 } +}; -static Position AddSpawnPoint = { -379.20f, -816.76f, 59.70f, 0.0f }; -static Position CrystalHandlerSpawnPoint = { -326.626343f, -709.956604f, 27.813314f, 0.0f }; -static Position AddDestinyPoint = { -379.314545f, -772.577637f, 28.58837f, 0.0f }; +#define MAX_Y_COORD_OH_NOVOS -771.95f class boss_novos : public CreatureScript { public: boss_novos() : CreatureScript("boss_novos") { } - struct boss_novosAI : public Scripted_NoMovementAI + struct boss_novosAI : public BossAI { - boss_novosAI(Creature* creature) : Scripted_NoMovementAI(creature), lSummons(me) + boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS_EVENT) {} + + void Reset() { - instance = creature->GetInstanceScript(); + events.Reset(); + summons.DespawnAll(); + instance->SetData(DATA_NOVOS_EVENT, NOT_STARTED); + + _ohNovos = true; + _crystalHandlerCount = 0; + SetCrystalsStatus(false); + SetSummonerStatus(false); + SetBubbled(false); } - uint32 uiTimer; - uint32 uiCrystalHandlerTimer; - uint8 crystalHandlerAmount; + void EnterCombat(Unit* /* victim */) + { + me->setActive(true); + DoZoneInCombat(); + instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS); - bool ohNovos; + SetCrystalsStatus(true); + SetSummonerStatus(true); + SetBubbled(true); + } - SummonList lSummons; + void AttackStart(Unit* target) + { + if (!target) + return; - std::list<uint64> luiCrystals; + if (me->Attack(target, true)) + DoStartNoMovement(target); + } - CombatPhase Phase; + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || _bubbled) + return; - InstanceScript* instance; + events.Update(diff); - void Reset() - { - Phase = IDLE; - luiCrystals.clear(); - ohNovos = true; - me->CastStop(); - lSummons.DespawnAll(); - crystalHandlerAmount = 0; - - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (instance) - { - instance->SetData(DATA_NOVOS_EVENT, NOT_STARTED); - for (uint8 n = 0; n < 4; ++n) - luiCrystals.push_back(instance->GetData64(DATA_NOVOS_CRYSTAL_1 + n)); - for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr) - { - if (GameObject* temp = instance->instance->GetGameObject(*itr)) - temp->SetGoState(GO_STATE_READY); - } - } - } + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - Phase = PHASE_1; - uiCrystalHandlerTimer = 30*IN_MILLISECONDS; - uiTimer = 1*IN_MILLISECONDS; - DoCast(SPELL_ARCANE_FIELD); - if (instance) + if (uint32 eventId = events.ExecuteEvent()) { - for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr) + switch (eventId) { - if (GameObject* temp = instance->instance->GetGameObject(*itr)) - temp->SetGoState(GO_STATE_ACTIVE); + case EVENT_SUMMON_MINIONS: + DoCast(SPELL_SUMMON_MINIONS); + events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000); + break; + case EVENT_ATTACK: + if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(victim, RAND(SPELL_ARCANE_BLAST, SPELL_BLIZZARD, SPELL_FROSTBOLT, SPELL_WRATH_OF_MISERY)); + events.ScheduleEvent(EVENT_ATTACK, 3000); + break; + default: + break; } - instance->SetData(DATA_NOVOS_EVENT, IN_PROGRESS); } - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); } - void UpdateAI(const uint32 diff) + void DoAction(int32 const action) { - switch (Phase) - { - case PHASE_1: - if (uiTimer <= diff) - { - Creature* summon = me->SummonCreature(RAND(CREATURE_FETID_TROLL_CORPSE, CREATURE_HULKING_CORPSE, CREATURE_RISEN_SHADOWCASTER), AddSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20*IN_MILLISECONDS); - summon->GetMotionMaster()->MovePoint(0, AddDestinyPoint); - //If spell is casted stops casting arcane field so no spell casting - //DoCast(me, SPELL_SUMMON_MINIONS); - uiTimer = 3*IN_MILLISECONDS; - } else uiTimer -= diff; - if (crystalHandlerAmount < 4) - { - if (uiCrystalHandlerTimer <= diff) - { - Talk(SAY_NECRO_ADD); - Creature* pCrystalHandler = me->SummonCreature(CREATURE_CRYSTAL_HANDLER, CrystalHandlerSpawnPoint, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20*IN_MILLISECONDS); - pCrystalHandler->GetMotionMaster()->MovePoint(0, AddDestinyPoint); - uiCrystalHandlerTimer = urand(20*IN_MILLISECONDS, 30*IN_MILLISECONDS); - } else uiCrystalHandlerTimer -= diff; - } - break; - case PHASE_2: - if (uiTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(target, DUNGEON_MODE(RAND(SPELL_ARCANE_BLAST, SPELL_BLIZZARD, SPELL_FROSTBOLT, SPELL_WRATH_OF_MISERY), - RAND(H_SPELL_ARCANE_BLAST, H_SPELL_BLIZZARD, H_SPELL_FROSTBOLT, H_SPELL_WRATH_OF_MISERY))); - uiTimer = urand(1*IN_MILLISECONDS, 3*IN_MILLISECONDS); - } else uiTimer -= diff; - break; - default: - break; - } + if (action == ACTION_CRYSTAL_HANDLER_DIED) + CrystalHandlerDied(); } - void JustDied(Unit* /*killer*/) + + void MoveInLineOfSight(Unit* who) { - Talk(SAY_DEATH); - if (instance) - instance->SetData(DATA_NOVOS_EVENT, DONE); - lSummons.DespawnAll(); + BossAI::MoveInLineOfSight(who); + + if (!_ohNovos || !who || who->GetTypeId() != TYPEID_UNIT || who->GetPositionY() > MAX_Y_COORD_OH_NOVOS) + return; + + uint32 entry = who->GetEntry(); + if (entry == NPC_HULKING_CORPSE || entry == NPC_RISEN_SHADOWCASTER || entry == NPC_FETID_TROLL_CORPSE) + _ohNovos = false; } - void KilledUnit(Unit* victim) + uint32 GetData(uint32 type) const { - if (victim == me) - return; - Talk(SAY_KILL); + return type == DATA_NOVOS_ACHIEV && _ohNovos ? 1 : 0; } void JustSummoned(Creature* summon) { - if (summon->GetEntry() == CREATURE_CRYSTAL_HANDLER) - crystalHandlerAmount++; - - lSummons.Summon(summon); + summons.Summon(summon); } - void DoAction(int32 const action) + private: + void SetBubbled(bool state) { - if (action == ACTION_MINION_REACHED) - ohNovos = false; + _bubbled = state; + if (!state) + { + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + if (me->HasUnitState(UNIT_STATE_CASTING)) + me->CastStop(); + } + else + { + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + DoCast(SPELL_ARCANE_FIELD); + } } - uint32 GetData(uint32 type) const + void SetSummonerStatus(bool active) { - if (type == DATA_OH_NOVOS) - return ohNovos ? 1 : 0; + for (uint8 i = 0; i < 4; i++) + if (uint64 guid = instance->GetData64(summoners[i].data)) + if (Creature* crystalChannelTarget = instance->instance->GetCreature(guid)) + { + if (active) + crystalChannelTarget->AI()->SetData(summoners[i].spell, summoners[i].timer); + else + crystalChannelTarget->AI()->Reset(); + } + } - return 0; + void SetCrystalsStatus(bool active) + { + for (uint8 i = 0; i < 4; i++) + if (uint64 guid = instance->GetData64(DATA_NOVOS_CRYSTAL_1 + i)) + if (GameObject* crystal = instance->instance->GetGameObject(guid)) + SetCrystalStatus(crystal, active); } - void RemoveCrystal() + void SetCrystalStatus(GameObject* crystal, bool active) { - if (!luiCrystals.empty()) - { - if (instance) - if (GameObject* temp = instance->instance->GetGameObject(luiCrystals.back())) - temp->SetGoState(GO_STATE_READY); - luiCrystals.pop_back(); - } - if (luiCrystals.empty()) + if (!crystal) + return; + + crystal->SetGoState(active ? GO_STATE_ACTIVE : GO_STATE_READY); + if (Creature* crystalChannelTarget = crystal->FindNearestCreature(NPC_CRYSTAL_CHANNEL_TARGET, 5.0f)) { - me->CastStop(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Phase = PHASE_2; - uiTimer = 1*IN_MILLISECONDS; + if (active) + crystalChannelTarget->AI()->DoCastAOE(SPELL_BEAM_CHANNEL); + else if (crystalChannelTarget->HasUnitState(UNIT_STATE_CASTING)) + crystalChannelTarget->CastStop(); } } - Unit* GetRandomTarget() + void CrystalHandlerDied() { - return SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + for (uint8 i = 0; i < 4; i++) + if (uint64 guid = instance->GetData64(DATA_NOVOS_CRYSTAL_1 + i)) + if (GameObject* crystal = instance->instance->GetGameObject(guid)) + if (crystal->GetGoState() == GO_STATE_ACTIVE) + { + SetCrystalStatus(crystal, false); + break; + } + + if (++_crystalHandlerCount >= 4) + { + SetSummonerStatus(false); + SetBubbled(false); + events.ScheduleEvent(EVENT_ATTACK, 3000); + if (IsHeroic()) + events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000); + } + else if (uint64 guid = instance->GetData64(DATA_NOVOS_SUMMONER_4)) + if (Creature* crystalChannelTarget = instance->instance->GetCreature(guid)) + crystalChannelTarget->AI()->SetData(SPELL_SUMMON_CRYSTAL_HANDLER, 15000); } + + uint8 _crystalHandlerCount; + bool _ohNovos; + bool _bubbled; }; CreatureAI* GetAI(Creature* creature) const @@ -247,126 +263,116 @@ public: } }; -enum CrystalHandlerSpells -{ - SPELL_FLASH_OF_DARKNESS = 49668, - H_SPELL_FLASH_OF_DARKNESS = 59004 -}; - -class mob_crystal_handler : public CreatureScript +class npc_crystal_channel_target : public CreatureScript { public: - mob_crystal_handler() : CreatureScript("mob_crystal_handler") { } + npc_crystal_channel_target() : CreatureScript("npc_crystal_channel_target") {} - struct mob_crystal_handlerAI : public ScriptedAI + struct npc_crystal_channel_targetAI : public ScriptedAI { - mob_crystal_handlerAI(Creature* creature) : ScriptedAI(creature) + npc_crystal_channel_targetAI(Creature* creature) : ScriptedAI(creature) {} + + void Reset() { - instance = creature->GetInstanceScript(); + _spell = 0; + _timer = 0; + _temp = 0; } - uint32 uiFlashOfDarknessTimer; - - InstanceScript* instance; - - void Reset() + void UpdateAI(const uint32 diff) { - uiFlashOfDarknessTimer = 5*IN_MILLISECONDS; + if (_spell) + { + if (_temp <= diff) + { + DoCast(_spell); + _temp = _timer; + } + else + _temp -= diff; + } } - void JustDied(Unit* /*killer*/) + void SetData(uint32 id, uint32 value) { - if (Creature* pNovos = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_NOVOS) : 0)) - CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->RemoveCrystal(); + _spell = id; + _timer = value; + _temp = value; } - void UpdateAI(const uint32 diff) + void JustSummoned(Creature* summon) { - if (!UpdateVictim()) - return; + if (InstanceScript* instance = me->GetInstanceScript()) + if (uint64 guid = instance->GetData64(DATA_NOVOS)) + if (Creature* novos = Creature::GetCreature(*me, guid)) + novos->AI()->JustSummoned(summon); - if (uiFlashOfDarknessTimer <= diff) - { - DoCast(me->getVictim(), DUNGEON_MODE(SPELL_FLASH_OF_DARKNESS, H_SPELL_FLASH_OF_DARKNESS)); - uiFlashOfDarknessTimer = 5*IN_MILLISECONDS; - } else uiFlashOfDarknessTimer -= diff; + if (summon) + summon->GetMotionMaster()->MovePath(summon->GetEntry() * 100, false); - DoMeleeAttackIfReady(); + if (_spell == SPELL_SUMMON_CRYSTAL_HANDLER) + Reset(); } - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE || id != 0) - return; - if (Creature* pNovos = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_NOVOS) : 0)) - if (Unit* target = CAST_AI(boss_novos::boss_novosAI, pNovos->AI())->GetRandomTarget()) - AttackStart(target); - } + private: + uint32 _spell; + uint32 _timer; + uint32 _temp; }; CreatureAI* GetAI(Creature* creature) const { - return new mob_crystal_handlerAI(creature); + return new npc_crystal_channel_targetAI(creature); } }; -class mob_novos_minion : public CreatureScript +class achievement_oh_novos : public AchievementCriteriaScript { public: - mob_novos_minion() : CreatureScript("mob_novos_minion") { } + achievement_oh_novos() : AchievementCriteriaScript("achievement_oh_novos") {} - struct mob_novos_minionAI : public ScriptedAI + bool OnCheck(Player* /*player*/, Unit* target) { - mob_novos_minionAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } + return target && target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->AI()->GetData(DATA_NOVOS_ACHIEV); + } +}; - InstanceScript* instance; +enum SummonMinions +{ + SPELL_COPY_OF_SUMMON_MINIONS = 59933 +}; - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE || id !=0) - return; - if (Creature* Novos = ObjectAccessor::GetCreature(*me, instance ? instance->GetData64(DATA_NOVOS) : 0)) - { - Novos->AI()->DoAction(ACTION_MINION_REACHED); - if (Unit* target = CAST_AI(boss_novos::boss_novosAI, Novos->AI())->GetRandomTarget()) - AttackStart(target); - } - } - }; +class spell_summon_minions : public SpellScriptLoader +{ +public: + spell_summon_minions() : SpellScriptLoader("spell_summon_minions") { } - CreatureAI* GetAI(Creature* creature) const + class spell_summon_minions_SpellScript : public SpellScript { - return new mob_novos_minionAI(creature); - } -}; + PrepareSpellScript(spell_summon_minions_SpellScript); -class achievement_oh_novos : public AchievementCriteriaScript -{ - public: - achievement_oh_novos() : AchievementCriteriaScript("achievement_oh_novos") + void HandleScript(SpellEffIndex /*effIndex*/) { + GetCaster()->CastSpell((Unit*)NULL, SPELL_COPY_OF_SUMMON_MINIONS, true); + GetCaster()->CastSpell((Unit*)NULL, SPELL_COPY_OF_SUMMON_MINIONS, true); } - bool OnCheck(Player* /*player*/, Unit* target) + void Register() { - if (!target) - return false; - - if (Creature* Novos = target->ToCreature()) - if (Novos->AI()->GetData(DATA_OH_NOVOS)) - return true; - - return false; + OnEffectHitTarget += SpellEffectFn(spell_summon_minions_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } + }; + + SpellScript* GetSpellScript() const + { + return new spell_summon_minions_SpellScript(); + } }; void AddSC_boss_novos() { new boss_novos(); - new mob_crystal_handler(); - new mob_novos_minion(); + new npc_crystal_channel_target(); + new spell_summon_minions(); new achievement_oh_novos(); } diff --git a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h index dc8428f9104..e17cba4bccd 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h +++ b/src/server/scripts/Northrend/DraktharonKeep/drak_tharon_keep.h @@ -31,9 +31,16 @@ enum Data64 DATA_NOVOS, DATA_DRED, DATA_THARON_JA, + DATA_NOVOS_CRYSTAL_1, DATA_NOVOS_CRYSTAL_2, DATA_NOVOS_CRYSTAL_3, - DATA_NOVOS_CRYSTAL_4 + DATA_NOVOS_CRYSTAL_4, + DATA_NOVOS_SUMMONER_1, + DATA_NOVOS_SUMMONER_2, + DATA_NOVOS_SUMMONER_3, + DATA_NOVOS_SUMMONER_4, + + ACTION_CRYSTAL_HANDLER_DIED }; #endif diff --git a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp index 52c5c9eab8e..28bea60fb87 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/instance_drak_tharon_keep.cpp @@ -16,6 +16,7 @@ */ #include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "InstanceScript.h" #include "drak_tharon_keep.h" @@ -30,17 +31,23 @@ enum Creatures { - NPC_TROLLGORE = 26630, - NPC_NOVOS = 26631, - NPC_KING_DRED = 27483, - NPC_THARON_JA = 26632 + NPC_TROLLGORE = 26630, + NPC_NOVOS = 26631, + NPC_KING_DRED = 27483, + NPC_THARON_JA = 26632, + NPC_CRYSTAL_CHANNEL_TARGET = 26712, + NPC_CRYSTAL_HANDLER = 26627 }; enum GameObjects { - GO_NOVOS_CRYSTAL_1 = 189299, - GO_NOVOS_CRYSTAL_2 = 189300, - GO_NOVOS_CRYSTAL_3 = 189301, - GO_NOVOS_CRYSTAL_4 = 189302 + GO_NOVOS_CRYSTAL_1 = 189299, + GO_NOVOS_CRYSTAL_2 = 189300, + GO_NOVOS_CRYSTAL_3 = 189301, + GO_NOVOS_CRYSTAL_4 = 189302 +}; +enum Achievements +{ + ACM_CRITERIA_OH_NOVOS = 7361 }; class instance_drak_tharon : public InstanceMapScript @@ -52,17 +59,22 @@ public: { instance_drak_tharon_InstanceScript(Map* map) : InstanceScript(map) {} - uint8 uiDredAchievCounter; + uint8 dredAchievCounter; - uint64 uiTrollgore; - uint64 uiNovos; - uint64 uiDred; - uint64 uiTharonJa; + uint64 trollgoreGUID; + uint64 novosGUID; + uint64 dredGUID; + uint64 tharonJaGUID; - uint64 uiNovosCrystal1; - uint64 uiNovosCrystal2; - uint64 uiNovosCrystal3; - uint64 uiNovosCrystal4; + uint64 novosCrystalGUID1; + uint64 novosCrystalGUID2; + uint64 novosCrystalGUID3; + uint64 novosCrystalGUID4; + + uint64 novosSummonerGUID1; + uint64 novosSummonerGUID2; + uint64 novosSummonerGUID3; + uint64 novosSummonerGUID4; uint16 m_auiEncounter[MAX_ENCOUNTER]; @@ -71,15 +83,23 @@ public: void Initialize() { memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - uiTrollgore = 0; - uiNovos = 0; - uiDred = 0; - uiTharonJa = 0; - uiNovosCrystal1 = 0; - uiNovosCrystal2 = 0; - uiNovosCrystal3 = 0; - uiNovosCrystal4 = 0; - uiDredAchievCounter = 0; + + dredAchievCounter = 0; + + trollgoreGUID = 0; + novosGUID = 0; + dredGUID = 0; + tharonJaGUID = 0; + + novosCrystalGUID1 = 0; + novosCrystalGUID2 = 0; + novosCrystalGUID3 = 0; + novosCrystalGUID4 = 0; + + novosSummonerGUID1 = 0; + novosSummonerGUID2 = 0; + novosSummonerGUID3 = 0; + novosSummonerGUID4 = 0; } bool IsEncounterInProgress() const @@ -96,16 +116,20 @@ public: switch (go->GetEntry()) { case GO_NOVOS_CRYSTAL_1: - uiNovosCrystal1 = go->GetGUID(); + novosCrystalGUID1 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; case GO_NOVOS_CRYSTAL_2: - uiNovosCrystal2 = go->GetGUID(); + novosCrystalGUID2 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; case GO_NOVOS_CRYSTAL_3: - uiNovosCrystal3 = go->GetGUID(); + novosCrystalGUID3 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; case GO_NOVOS_CRYSTAL_4: - uiNovosCrystal4 = go->GetGUID(); + novosCrystalGUID4 = go->GetGUID(); + go->SetGoState(GO_STATE_READY); break; } } @@ -115,32 +139,55 @@ public: switch (creature->GetEntry()) { case NPC_TROLLGORE: - uiTrollgore = creature->GetGUID(); + trollgoreGUID = creature->GetGUID(); break; case NPC_NOVOS: - uiNovos = creature->GetGUID(); + novosGUID = creature->GetGUID(); break; case NPC_KING_DRED: - uiDred = creature->GetGUID(); + dredGUID = creature->GetGUID(); break; case NPC_THARON_JA: - uiTharonJa = creature->GetGUID(); + tharonJaGUID = creature->GetGUID(); + break; + case NPC_CRYSTAL_CHANNEL_TARGET: + InitializeNovosSummoner(creature); break; } } + void InitializeNovosSummoner(Creature* creature) + { + float x = creature->GetPositionX(); + float y = creature->GetPositionY(); + float z = creature->GetPositionZ(); + + if (x < -374.0f && x > -379.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) + novosSummonerGUID1 = creature->GetGUID(); + else if (x < -379.0f && x > -385.0f && y > -820.0f && y < -815.0f && z < 60.0f && z > 58.0f) + novosSummonerGUID2 = creature->GetGUID(); + else if (x < -374.0f && x > -385.0f && y > -827.0f && y < -820.0f && z < 60.0f && z > 58.0f) + novosSummonerGUID3 = creature->GetGUID(); + else if (x < -338.0f && x > -344.0f && y > -727.0f && y < 721.0f && z < 30.0f && z > 26.0f) + novosSummonerGUID4 = creature->GetGUID(); + } + uint64 GetData64(uint32 identifier) const { switch (identifier) { - case DATA_TROLLGORE: return uiTrollgore; - case DATA_NOVOS: return uiNovos; - case DATA_DRED: return uiDred; - case DATA_THARON_JA: return uiTharonJa; - case DATA_NOVOS_CRYSTAL_1: return uiNovosCrystal1; - case DATA_NOVOS_CRYSTAL_2: return uiNovosCrystal2; - case DATA_NOVOS_CRYSTAL_3: return uiNovosCrystal3; - case DATA_NOVOS_CRYSTAL_4: return uiNovosCrystal4; + case DATA_TROLLGORE: return trollgoreGUID; + case DATA_NOVOS: return novosGUID; + case DATA_DRED: return dredGUID; + case DATA_THARON_JA: return tharonJaGUID; + case DATA_NOVOS_CRYSTAL_1: return novosCrystalGUID1; + case DATA_NOVOS_CRYSTAL_2: return novosCrystalGUID2; + case DATA_NOVOS_CRYSTAL_3: return novosCrystalGUID3; + case DATA_NOVOS_CRYSTAL_4: return novosCrystalGUID4; + case DATA_NOVOS_SUMMONER_1: return novosSummonerGUID1; + case DATA_NOVOS_SUMMONER_2: return novosSummonerGUID2; + case DATA_NOVOS_SUMMONER_3: return novosSummonerGUID3; + case DATA_NOVOS_SUMMONER_4: return novosSummonerGUID4; } return 0; @@ -164,7 +211,7 @@ public: break; case DATA_KING_DRED_ACHIEV: - uiDredAchievCounter = data; + dredAchievCounter = data; break; } @@ -182,7 +229,7 @@ public: case DATA_NOVOS_EVENT: return m_auiEncounter[1]; case DATA_DRED_EVENT: return m_auiEncounter[2]; case DATA_THARON_JA_EVENT: return m_auiEncounter[3]; - case DATA_KING_DRED_ACHIEV: return uiDredAchievCounter; + case DATA_KING_DRED_ACHIEV: return dredAchievCounter; } return 0; } @@ -199,6 +246,14 @@ public: return saveStream.str(); } + void OnUnitDeath(Unit* unit) + { + if (unit->GetEntry() == NPC_CRYSTAL_HANDLER) + if (novosGUID) + if (Creature* novos = instance->GetCreature(novosGUID)) + novos->AI()->DoAction(ACTION_CRYSTAL_HANDLER_DIED); + } + void Load(const char* in) { if (!in) diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 85414e3808c..952363c6dcf 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -35,10 +35,13 @@ Script Data End */ #include "eye_of_eternity.h" #include "ScriptedEscortAI.h" #include "Player.h" +#include "Vehicle.h" +#include "CombatAI.h" +#include "CreatureTextMgr.h" enum Achievements { - ACHIEV_TIMED_START_EVENT = 20387, + ACHIEV_TIMED_START_EVENT = 20387, }; enum Events @@ -132,25 +135,36 @@ enum MalygosEvents #define TEN_MINUTES 600000 -enum MalygosSays +enum Texts { - SAY_AGGRO_P_ONE, - SAY_KILLED_PLAYER_P_ONE, - SAY_END_P_ONE, - SAY_AGGRO_P_TWO, - SAY_ANTI_MAGIC_SHELL, // not sure when execute it - SAY_MAGIC_BLAST, // not sure when execute it - SAY_KILLED_PLAYER_P_TWO, - SAY_END_P_TWO, - SAY_INTRO_P_THREE, - SAY_AGGRO_P_THREE, - SAY_SURGE_POWER, // not sure when execute it - SAY_BUFF_SPARK, - SAY_KILLED_PLAYER_P_THREE, - SAY_SPELL_CASTING_P_THREE, - SAY_DEATH + // Malygos + SAY_AGGRO_P_ONE = 0, + SAY_KILLED_PLAYER_P_ONE = 1, + SAY_END_P_ONE = 2, + SAY_AGGRO_P_TWO = 3, + SAY_ANTI_MAGIC_SHELL = 4, // not sure when execute it + SAY_MAGIC_BLAST = 5, // not sure when execute it + SAY_KILLED_PLAYER_P_TWO = 6, + SAY_END_P_TWO = 7, + SAY_INTRO_P_THREE = 8, + SAY_AGGRO_P_THREE = 9, + SAY_SURGE_POWER = 10, // not sure when execute it + SAY_BUFF_SPARK = 11, + SAY_KILLED_PLAYER_P_THREE = 12, + SAY_SPELL_CASTING_P_THREE = 13, + SAY_DEATH, + + // Alexstrasza + SAY_ONE = 0, + SAY_TWO = 1, + SAY_THREE = 2, + SAY_FOUR = 3, + + // Power Sparks + EMOTE_POWER_SPARK_SUMMONED = 0 }; + #define MAX_HOVER_DISK_WAYPOINTS 18 // Sniffed data (x, y,z) @@ -178,7 +192,7 @@ const Position HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS] = #define GROUND_Z 268 -// Source: Sniffs (x, y,z) +// Source: Sniffs (x,y,z) #define MALYGOS_MAX_WAYPOINTS 16 const Position MalygosPhaseTwoWaypoints[MALYGOS_MAX_WAYPOINTS] = { @@ -316,6 +330,7 @@ public: // The rest is handled in the AI of the vehicle. target->CastSpell(target, SPELL_SUMMOM_RED_DRAGON, true); + me->Attack(target, false); } } @@ -748,13 +763,18 @@ public: _instance = creature->GetInstanceScript(); } - void Reset() + void SpellHit(Unit* /*caster*/, const SpellInfo* spell) { - _summonTimer = urand(5, 7)*IN_MILLISECONDS; + if (spell->Id == SPELL_PORTAL_OPENED) + { + DoCast(me, SPELL_SUMMON_POWER_PARK, true); + } } - void UpdateAI(uint32 const diff) + void UpdateAI(uint32 const /*diff*/) { + // When duration of oppened riff visual ends, + // closed one should be cast if (!me->HasAura(SPELL_PORTAL_VISUAL_CLOSED) && !me->HasAura(SPELL_PORTAL_OPENED)) DoCast(me, SPELL_PORTAL_VISUAL_CLOSED, true); @@ -770,16 +790,6 @@ public: } } } - - if (!me->HasAura(SPELL_PORTAL_OPENED)) - return; - - if (_summonTimer <= diff) - { - DoCast(SPELL_SUMMON_POWER_PARK); - _summonTimer = urand(5, 7)*IN_MILLISECONDS; - } else - _summonTimer -= diff; } void JustSummoned(Creature* summon) @@ -811,6 +821,8 @@ public: _instance = creature->GetInstanceScript(); MoveToMalygos(); + // Talk range was not enough for this encounter + sCreatureTextMgr->SendChat(me, EMOTE_POWER_SPARK_SUMMONED, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP); } void EnterEvadeMode() @@ -853,14 +865,9 @@ public: } } - void DamageTaken(Unit* /*done_by*/, uint32& damage) + void JustDied(Unit* /*killer*/) { - if (damage > me->GetMaxHealth()) - { - damage = 0; - DoCast(me, SPELL_POWER_SPARK_DEATH, true); - me->DespawnOrUnsummon(1000); - } + me->CastSpell(me, SPELL_POWER_SPARK_DEATH, true); // not supposed to hide the fact it's there by not selectable } private: @@ -903,8 +910,7 @@ public: else { // Error found: This is not called if the passenger is a player - - if (unit->GetTypeId() == TYPEID_UNIT) + if (unit->GetTypeId() == TYPEID_UNIT || unit->GetTypeId() == TYPEID_PLAYER) { // This will only be called if the passenger dies if (_instance) @@ -1012,7 +1018,7 @@ public: }; }; -// SmartAI does not work correctly for this (vehicles) +// SmartAI does not work correctly for vehicles class npc_wyrmrest_skytalon : public CreatureScript { public: @@ -1023,14 +1029,13 @@ public: return new npc_wyrmrest_skytalonAI (creature); } - struct npc_wyrmrest_skytalonAI : public NullCreatureAI + struct npc_wyrmrest_skytalonAI : public VehicleAI { - npc_wyrmrest_skytalonAI(Creature* creature) : NullCreatureAI(creature) - { - _instance = creature->GetInstanceScript(); + npc_wyrmrest_skytalonAI(Creature* creature) : VehicleAI(creature) { } - _timer = 1000; - _entered = false; + void IsSummonedBy(Unit* summoner) + { + summoner->CastSpell(me, SPELL_RIDE_RED_DRAGON, true); } void PassengerBoarded(Unit* /*unit*/, int8 /*seat*/, bool apply) @@ -1038,54 +1043,9 @@ public: if (!apply) me->DespawnOrUnsummon(); } - - // we can't call this in reset function, it fails. - void MakePlayerEnter() - { - if (!_instance) - return; - - if (Unit* summoner = me->ToTempSummon()->GetSummoner()) - { - if (Creature* malygos = Unit::GetCreature(*me, _instance->GetData64(DATA_MALYGOS))) - { - summoner->CastSpell(me, SPELL_RIDE_RED_DRAGON, true); - float victimThreat = malygos->getThreatManager().getThreat(summoner); - malygos->getThreatManager().resetAllAggro(); - malygos->AI()->AttackStart(me); - malygos->AddThreat(me, victimThreat); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!_entered) - { - if (_timer <= diff) - { - MakePlayerEnter(); - _entered = true; - } else - _timer -= diff; - } - } - - private: - InstanceScript* _instance; - uint32 _timer; - bool _entered; }; }; -enum AlexstraszaYells -{ - SAY_ONE, - SAY_TWO, - SAY_THREE, - SAY_FOUR -}; - class npc_alexstrasza_eoe : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp index fedb1f5cebc..fedb1f5cebc 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_kolurg.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_kolurg.cpp diff --git a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp index 39c93f15d6f..39c93f15d6f 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/commander_stoutbeard.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_commander_stoutbeard.cpp diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index dc9665ae27b..33e0619c7e5 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -21,7 +21,8 @@ enum { - EMOTE_BERSERK = 0 + EMOTE_BERSERK = 0, + EMOTE_LEAP = 1 // Not in use }; //Spells Archavon @@ -38,9 +39,6 @@ enum //4 Warders spawned #define ARCHAVON_WARDER 32353 //npc 32353 -//Yell -#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target - enum Events { // Archavon diff --git a/src/server/scripts/Northrend/borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 8e7507bce61..8e7507bce61 100644 --- a/src/server/scripts/Northrend/borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp diff --git a/src/server/scripts/Northrend/crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index d12b5176b15..d12b5176b15 100644 --- a/src/server/scripts/Northrend/crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp diff --git a/src/server/scripts/Northrend/dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index d16b6fe4588..d16b6fe4588 100644 --- a/src/server/scripts/Northrend/dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index a8fb0215902..a8fb0215902 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp diff --git a/src/server/scripts/Northrend/grizzly_hills.cpp b/src/server/scripts/Northrend/zone_grizzly_hills.cpp index fe1f561071c..fe1f561071c 100644 --- a/src/server/scripts/Northrend/grizzly_hills.cpp +++ b/src/server/scripts/Northrend/zone_grizzly_hills.cpp diff --git a/src/server/scripts/Northrend/howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index ff4d8ec7a79..ff4d8ec7a79 100644 --- a/src/server/scripts/Northrend/howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index 2ec5a3e8164..2ec5a3e8164 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp diff --git a/src/server/scripts/Northrend/sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 2aa355084a1..2aa355084a1 100644 --- a/src/server/scripts/Northrend/sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 85ab1dc1127..85ab1dc1127 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 8935c77b30e..8935c77b30e 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp diff --git a/src/server/scripts/Northrend/zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 69e8d900435..69e8d900435 100644 --- a/src/server/scripts/Northrend/zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt index 9fb0d4715a0..f038af07634 100644 --- a/src/server/scripts/Outland/CMakeLists.txt +++ b/src/server/scripts/Outland/CMakeLists.txt @@ -10,7 +10,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} - Outland/nagrand.cpp + Outland/zone_nagrand.cpp Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -44,7 +44,7 @@ set(scripts_STAT_SRCS Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp Outland/CoilfangReservoir/underbog/boss_hungarfen.cpp Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp - Outland/shattrath_city.cpp + Outland/zone_shattrath_city.cpp Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -59,6 +59,10 @@ set(scripts_STAT_SRCS Outland/TempestKeep/Eye/boss_alar.cpp Outland/TempestKeep/Eye/boss_kaelthas.cpp Outland/TempestKeep/Eye/the_eye.cpp + Outland/TempestKeep/botanica/the_botanica.h + Outland/TempestKeep/botanica/instance_the_botanica.cpp + Outland/TempestKeep/botanica/boss_commander_sarannis.cpp + Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp Outland/TempestKeep/botanica/boss_warp_splinter.cpp Outland/TempestKeep/botanica/boss_laj.cpp @@ -81,8 +85,8 @@ set(scripts_STAT_SRCS Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp Outland/boss_doomwalker.cpp - Outland/terokkar_forest.cpp - Outland/hellfire_peninsula.cpp + Outland/zone_terokkar_forest.cpp + Outland/zone_hellfire_peninsula.cpp Outland/boss_doomlord_kazzak.cpp Outland/BlackTemple/boss_teron_gorefiend.cpp Outland/BlackTemple/black_temple.h @@ -96,14 +100,14 @@ set(scripts_STAT_SRCS Outland/BlackTemple/boss_warlord_najentus.cpp Outland/BlackTemple/boss_bloodboil.cpp Outland/BlackTemple/boss_illidan.cpp - Outland/shadowmoon_valley.cpp - Outland/blades_edge_mountains.cpp + Outland/zone_shadowmoon_valley.cpp + Outland/zone_blades_edge_mountains.cpp Outland/GruulsLair/boss_high_king_maulgar.cpp Outland/GruulsLair/boss_gruul.cpp Outland/GruulsLair/gruuls_lair.h Outland/GruulsLair/instance_gruuls_lair.cpp - Outland/netherstorm.cpp - Outland/zangarmarsh.cpp + Outland/zone_netherstorm.cpp + Outland/zone_zangarmarsh.cpp ) message(" -> Prepared: Outland") diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp new file mode 100644 index 00000000000..fe89925b6f9 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp @@ -0,0 +1,186 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "the_botanica.h" +#include "SpellScript.h" + +enum Says +{ + SAY_AGGRO = 0, + SAY_KILL = 1, + SAY_ARCANE_RESONANCE = 2, + SAY_ARCANE_DEVASTATION = 3, + EMOTE_SUMMON = 4, + SAY_SUMMON = 5, + SAY_DEATH = 6 +}; + +enum Spells +{ + SPELL_ARCANE_RESONANCE = 34794, + SPELL_ARCANE_DEVASTATION = 34799, + SPELL_SUMMON_REINFORCEMENTS = 34803 +}; + +enum +{ + EVENT_ARCANE_RESONANCE = 1, + EVENT_ARCANE_DEVASTATION = 2 +}; + +class boss_commander_sarannis : public CreatureScript +{ + public: boss_commander_sarannis() : CreatureScript("boss_commander_sarannis") { } + + struct boss_commander_sarannisAI : public BossAI + { + boss_commander_sarannisAI(Creature* creature) : BossAI(creature, DATA_COMMANDER_SARANNIS) { } + + void Reset() + { + _Reset(); + _phase = true; + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_ARCANE_RESONANCE, 42700); + events.ScheduleEvent(EVENT_ARCANE_DEVASTATION, 15200); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_KILL); + } + + void JustDied(Unit* /*killer*/) + { + _JustDied(); + Talk(SAY_DEATH); + } + + void DamageTaken(Unit* /*killer*/, uint32 &damage) + { + if (me->HealthBelowPctDamaged(50, damage) && _phase) + { + _phase = false; + Talk(EMOTE_SUMMON); + Talk(SAY_SUMMON); + DoCast(me, SPELL_SUMMON_REINFORCEMENTS); + } + } + + void JustSummoned(Creature* summon) + { + BossAI::JustSummoned(summon); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANE_RESONANCE: + Talk(SAY_ARCANE_RESONANCE); + DoCastVictim(SPELL_ARCANE_RESONANCE, true); + events.ScheduleEvent(EVENT_ARCANE_RESONANCE, 42700); + break; + case EVENT_ARCANE_DEVASTATION: + Talk(SAY_ARCANE_DEVASTATION); + DoCastVictim(SPELL_ARCANE_DEVASTATION, true); + events.ScheduleEvent(EVENT_ARCANE_DEVASTATION, urand(11000, 19200)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _phase; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_commander_sarannisAI(creature); + } +}; + +Position const PosSummonReinforcements[4] = +{ + { 160.4483f, 287.6435f, -3.887904f, 2.3841f }, + { 153.4406f, 289.9929f, -4.736916f, 2.3841f }, + { 154.4137f, 292.8956f, -4.683603f, 2.3841f }, + { 157.1544f, 294.2599f, -4.726504f, 2.3841f } +}; + +enum Creatures +{ + NPC_SUMMONED_BLOODWARDER_MENDER = 20083, + NPC_SUMMONED_BLOODWARDER_RESERVIST = 20078 +}; + +class spell_commander_sarannis_summon_reinforcements : public SpellScriptLoader +{ + public: + spell_commander_sarannis_summon_reinforcements() : SpellScriptLoader("spell_commander_sarannis_summon_reinforcements") { } + + class spell_commander_sarannis_summon_reinforcements_SpellScript : public SpellScript + { + PrepareSpellScript(spell_commander_sarannis_summon_reinforcements_SpellScript); + + void HandleCast(SpellEffIndex /*effIndex*/) + { + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_MENDER, PosSummonReinforcements[0], TEMPSUMMON_CORPSE_DESPAWN); + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[1], TEMPSUMMON_CORPSE_DESPAWN); + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[2], TEMPSUMMON_CORPSE_DESPAWN); + if (GetCaster()->GetMap()->IsHeroic()) + GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[3], TEMPSUMMON_CORPSE_DESPAWN); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_commander_sarannis_summon_reinforcements_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_commander_sarannis_summon_reinforcements_SpellScript(); + } +}; + +void AddSC_boss_commander_sarannis() +{ + new boss_commander_sarannis(); + new spell_commander_sarannis_summon_reinforcements(); +} diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index b3604d66d90..2ab527c2fd5 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "the_botanica.h" enum eSays { @@ -33,7 +34,7 @@ enum eSays SAY_TREE = 2, SAY_SUMMON = 3, SAY_DEATH = 4, - SAY_OOC_RANDOM = 5, + SAY_OOC_RANDOM = 5 }; enum eSpells @@ -44,7 +45,7 @@ enum eSpells SPELL_PLANT_WHITE = 34759, SPELL_PLANT_GREEN = 34761, SPELL_PLANT_BLUE = 34762, - SPELL_PLANT_RED = 34763, + SPELL_PLANT_RED = 34763 }; #define ENTRY_FRAYER 19953 @@ -58,9 +59,9 @@ class boss_high_botanist_freywinn : public CreatureScript { } - struct boss_high_botanist_freywinnAI : public ScriptedAI + struct boss_high_botanist_freywinnAI : public BossAI { - boss_high_botanist_freywinnAI(Creature* creature) : ScriptedAI(creature) {} + boss_high_botanist_freywinnAI(Creature* creature) : BossAI(creature, DATA_HIGH_BOTANIST_FREYWINN) { } std::list<uint64> Adds_List; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp index b1a894d9b48..bd9195e44f8 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_laj.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "the_botanica.h" enum eSpells { @@ -38,7 +39,7 @@ enum eSpells SPELL_SUMMON_LASHER_3 = 34686, SPELL_SUMMON_FLAYER_4 = 34687, SPELL_SUMMON_LASHER_4 = 34688, - SPELL_SUMMON_FLAYER_3 = 34690, + SPELL_SUMMON_FLAYER_3 = 34690 }; enum eOthers { @@ -47,7 +48,7 @@ enum eOthers MODEL_ARCANE = 14213, MODEL_FIRE = 13110, MODEL_FROST = 14112, - MODEL_NATURE = 14214, + MODEL_NATURE = 14214 }; class boss_laj : public CreatureScript @@ -59,9 +60,9 @@ class boss_laj : public CreatureScript { } - struct boss_lajAI : public ScriptedAI + struct boss_lajAI : public BossAI { - boss_lajAI(Creature* creature) : ScriptedAI(creature) {} + boss_lajAI(Creature* creature) : BossAI(creature, DATA_LAJ) { } bool CanSummon; uint32 Teleport_Timer; diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp new file mode 100644 index 00000000000..ffd48f4dcb5 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp @@ -0,0 +1,152 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "the_botanica.h" + +enum Says +{ + SAY_AGGRO = 0, + SAY_20_PERCENT_HP = 1, + SAY_KILL = 2, + SAY_CAST_SACRIFICE = 3, + SAY_50_PERCENT_HP = 4, + SAY_CAST_HELLFIRE = 5, + SAY_DEATH = 6, + EMOTE_ENRAGE = 7 +}; + +enum Spells +{ + SPELL_SACRIFICE = 34661, + SPELL_HELLFIRE_NORMAL = 34659, + SPELL_HELLFIRE_HEROIC = 39131, + SPELL_ENRAGE = 34670 +}; + +enum Events +{ + EVENT_SACRIFICE = 1, + EVENT_HELLFIRE = 2, + EVENT_ENRAGE = 3 +}; + +class boss_thorngrin_the_tender : public CreatureScript +{ + public: boss_thorngrin_the_tender() : CreatureScript("thorngrin_the_tender") { } + + struct boss_thorngrin_the_tenderAI : public BossAI + { + boss_thorngrin_the_tenderAI(Creature* creature) : BossAI(creature, DATA_THORNGRIN_THE_TENDER) { } + + void Reset() + { + _Reset(); + _phase1 = true; + _phase2 = true; + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_SACRIFICE, 5700); + events.ScheduleEvent(EVENT_HELLFIRE, IsHeroic() ? urand(17400, 19300) : 18000); + events.ScheduleEvent(EVENT_ENRAGE, 12000); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_KILL); + } + + void JustDied(Unit* /*killer*/) + { + _JustDied(); + Talk(SAY_DEATH); + } + + void DamageTaken(Unit* /*killer*/, uint32 &damage) + { + if (me->HealthBelowPctDamaged(50, damage) && _phase1) + { + _phase1 = false; + Talk(SAY_50_PERCENT_HP); + } + if (me->HealthBelowPctDamaged(20, damage) && _phase2) + { + _phase2 = false; + Talk(SAY_20_PERCENT_HP); + } + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SACRIFICE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) + { + Talk(SAY_CAST_SACRIFICE); + DoCast(target, SPELL_SACRIFICE, true); + } + events.ScheduleEvent(EVENT_SACRIFICE, 29400); + break; + case EVENT_HELLFIRE: + Talk(SAY_CAST_HELLFIRE); + DoCastVictim(DUNGEON_MODE(SPELL_HELLFIRE_NORMAL, SPELL_HELLFIRE_HEROIC), true); + events.ScheduleEvent(EVENT_HELLFIRE, IsHeroic() ? urand(17400, 19300) : 18000); + break; + case EVENT_ENRAGE: + Talk(EMOTE_ENRAGE); + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, 33000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + bool _phase1; + bool _phase2; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_thorngrin_the_tenderAI(creature); + } +}; + +void AddSC_boss_thorngrin_the_tender() +{ + new boss_thorngrin_the_tender(); +} diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp index 2ca1bb28f96..d2b6c44ec7b 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_warp_splinter.cpp @@ -25,6 +25,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "the_botanica.h" enum eSays { @@ -40,13 +41,13 @@ enum eSpells SUMMON_TREANTS = 34727, // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) ARCANE_VOLLEY = 36705, ARCANE_VOLLEY_H = 39133, - SPELL_HEAL_FATHER = 6262, + SPELL_HEAL_FATHER = 6262 }; enum eOthers { CREATURE_TREANT = 19949, - TREANT_SPAWN_DIST = 50, //50 yards from Warp Splinter's spawn point + TREANT_SPAWN_DIST = 50 //50 yards from Warp Splinter's spawn point }; float treant_pos[6][3] = @@ -134,9 +135,9 @@ class boss_warp_splinter : public CreatureScript : CreatureScript("boss_warp_splinter") { } - struct boss_warp_splinterAI : public ScriptedAI + struct boss_warp_splinterAI : public BossAI { - boss_warp_splinterAI(Creature* creature) : ScriptedAI(creature) + boss_warp_splinterAI(Creature* creature) : BossAI(creature, DATA_WARP_SPLINTER) { Treant_Spawn_Pos_X = creature->GetPositionX(); Treant_Spawn_Pos_Y = creature->GetPositionY(); diff --git a/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp new file mode 100644 index 00000000000..69b95e8c813 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp @@ -0,0 +1,164 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#include "ScriptMgr.h" +#include "InstanceScript.h" +#include "the_botanica.h" + +class instance_the_botanica : public InstanceMapScript +{ + public: + instance_the_botanica() : InstanceMapScript("instance_the_botanica", 553) { } + + struct instance_the_botanica_InstanceMapScript : public InstanceScript + { + instance_the_botanica_InstanceMapScript(Map* map) : InstanceScript(map) + { + CommanderSarannisGUID = 0; + HighBotanistFreywinnGUID = 0; + ThorngrinTheTenderGUID = 0; + LajGUID = 0; + WarpSplinterGUID = 0; + } + + void OnCreatureCreate(Creature* creature) + { + switch (creature->GetEntry()) + { + case NPC_COMMANDER_SARANNIS: + CommanderSarannisGUID = creature->GetGUID(); + break; + case NPC_HIGH_BOTANIST_FREYWINN: + HighBotanistFreywinnGUID = creature->GetGUID(); + break; + case NPC_THORNGRIN_THE_TENDER: + ThorngrinTheTenderGUID = creature->GetGUID(); + break; + case NPC_LAJ: + LajGUID = creature->GetGUID(); + break; + case NPC_WARP_SPLINTER: + WarpSplinterGUID = creature->GetGUID(); + break; + default: + break; + } + } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case DATA_COMMANDER_SARANNIS: + return CommanderSarannisGUID; + case DATA_HIGH_BOTANIST_FREYWINN: + return HighBotanistFreywinnGUID; + case DATA_THORNGRIN_THE_TENDER: + return ThorngrinTheTenderGUID; + case DATA_LAJ: + return LajGUID; + case DATA_WARP_SPLINTER: + return WarpSplinterGUID; + default: + break; + } + + return 0; + } + + bool SetBossState(uint32 type, EncounterState state) + { + if (!InstanceScript::SetBossState(type, state)) + return false; + + switch (type) + { + case DATA_COMMANDER_SARANNIS: + case DATA_HIGH_BOTANIST_FREYWINN: + case DATA_THORNGRIN_THE_TENDER: + case DATA_LAJ: + case DATA_WARP_SPLINTER: + break; + default: + break; + } + + return true; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "B O " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(char const* str) + { + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'B' && dataHead2 == 'O') + { + for (uint8 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + protected: + uint64 CommanderSarannisGUID; + uint64 HighBotanistFreywinnGUID; + uint64 ThorngrinTheTenderGUID; + uint64 LajGUID; + uint64 WarpSplinterGUID; + }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_the_botanica_InstanceMapScript(map); + } +}; + +void AddSC_instance_the_botanica() +{ + new instance_the_botanica; +} diff --git a/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h new file mode 100644 index 00000000000..d5657dc7048 --- /dev/null +++ b/src/server/scripts/Outland/TempestKeep/botanica/the_botanica.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#ifndef DEF_THE_BOTANICA_H +#define DEF_THE_BOTANICA_H + +uint32 const EncounterCount = 5; + +enum DataTypes +{ + DATA_COMMANDER_SARANNIS = 0, + DATA_HIGH_BOTANIST_FREYWINN = 1, + DATA_THORNGRIN_THE_TENDER = 2, + DATA_LAJ = 3, + DATA_WARP_SPLINTER = 4 +}; + +enum CreatureIds +{ + NPC_COMMANDER_SARANNIS = 17976, + NPC_HIGH_BOTANIST_FREYWINN = 17975, + NPC_THORNGRIN_THE_TENDER = 17978, + NPC_LAJ = 17980, + NPC_WARP_SPLINTER = 17977 +}; + +#endif diff --git a/src/server/scripts/Outland/blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index d03abc82b9c..d03abc82b9c 100644 --- a/src/server/scripts/Outland/blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp diff --git a/src/server/scripts/Outland/hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 64b484268df..64b484268df 100644 --- a/src/server/scripts/Outland/hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 0a92b985c95..0a92b985c95 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 769ee7dc68d..769ee7dc68d 100644 --- a/src/server/scripts/Outland/netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp diff --git a/src/server/scripts/Outland/shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp index 0a016f0923c..0a016f0923c 100644 --- a/src/server/scripts/Outland/shadowmoon_valley.cpp +++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp diff --git a/src/server/scripts/Outland/shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index ac26614ae69..ac26614ae69 100644 --- a/src/server/scripts/Outland/shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp diff --git a/src/server/scripts/Outland/terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 2b046a7518e..2b046a7518e 100644 --- a/src/server/scripts/Outland/terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp diff --git a/src/server/scripts/Outland/zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index 319da372bf8..319da372bf8 100644 --- a/src/server/scripts/Outland/zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp |