From 0dfab5d69b60228312ab152922b13af632ded234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Sat, 7 Aug 2021 17:48:57 +0200 Subject: [PATCH] refactor(Scripts/Northrend): code cleanup (part 11) (#7103) --- .../Northrend/Naxxramas/boss_gothik.cpp | 6 +-- .../Naxxramas/instance_naxxramas.cpp | 2 +- .../Nexus/EyeOfEternity/boss_malygos.cpp | 6 +-- .../Northrend/Nexus/Nexus/boss_ormorok.cpp | 3 +- .../Northrend/Nexus/Oculus/boss_urom.cpp | 2 +- .../scripts/Northrend/Nexus/Oculus/oculus.cpp | 2 +- .../HallsOfStone/boss_maiden_of_grief.cpp | 5 ++- .../Ulduar/HallsOfStone/brann_bronzebeard.cpp | 1 - .../HallsOfStone/instance_halls_of_stone.cpp | 4 +- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 2 +- .../Ulduar/Ulduar/boss_flame_leviathan.cpp | 19 -------- .../Northrend/Ulduar/Ulduar/boss_freya.cpp | 5 +-- .../Ulduar/Ulduar/boss_general_vezax.cpp | 4 +- .../Northrend/Ulduar/Ulduar/boss_hodir.cpp | 22 ++++++--- .../Northrend/Ulduar/Ulduar/boss_ignis.cpp | 6 ++- .../Northrend/Ulduar/Ulduar/boss_mimiron.cpp | 10 +++-- .../Ulduar/Ulduar/boss_razorscale.cpp | 45 ++++++++++--------- .../Northrend/Ulduar/Ulduar/boss_thorim.cpp | 4 +- .../Ulduar/Ulduar/instance_ulduar.cpp | 26 ++++++----- .../UtgardePinnacle/boss_svala.cpp | 3 -- .../instance_utgarde_pinnacle.cpp | 2 - .../VaultOfArchavon/boss_toravon.cpp | 6 --- .../Northrend/VioletHold/boss_ichoron.cpp | 5 --- src/server/scripts/Northrend/zone_dalaran.cpp | 2 - .../scripts/Northrend/zone_dragonblight.cpp | 11 ++--- .../scripts/Northrend/zone_howling_fjord.cpp | 9 +--- .../scripts/Northrend/zone_sholazar_basin.cpp | 6 +-- .../scripts/Northrend/zone_wintergrasp.cpp | 17 +------ 28 files changed, 101 insertions(+), 134 deletions(-) diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 061d07b03..87d0c4a80 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -148,9 +148,9 @@ const Position PosSummonDead[5] = {2664.8f, -3340.7f, 268.23f, 3.7f} }; -const Position PosGroundLivingSide = {2691.2f, -3387.0f, 267.68f, 1.52f}; -const Position PosGroundDeadSide = {2693.5f, -3334.6f, 267.68f, 4.67f}; -const Position PosPlatform = {2640.5f, -3360.6f, 285.26f, 0.0f}; +//const Position PosGroundLivingSide = {2691.2f, -3387.0f, 267.68f, 1.52f}; +//const Position PosGroundDeadSide = {2693.5f, -3334.6f, 267.68f, 4.67f}; +//const Position PosPlatform = {2640.5f, -3360.6f, 285.26f, 0.0f}; #define POS_Y_GATE -3360.78f #define POS_Y_WEST -3285.0f diff --git a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index a6c46b526..f85004201 100644 --- a/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/server/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -646,7 +646,7 @@ public: } // Horseman handling - if (bossId == BOSS_HORSEMAN && _horsemanLoadDoneState == false) + if (bossId == BOSS_HORSEMAN && !_horsemanLoadDoneState) { if (state == DONE) { diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 406d9b182..4b1dbc98c 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -491,9 +491,9 @@ public: continue; Position plrpos; - float angle = CenterPos.GetAngle(pPlayer); - plrpos.m_positionX = CenterPos.GetPositionX() + cos(angle) * 5.0f; - plrpos.m_positionY = CenterPos.GetPositionY() + sin(angle) * 5.0f; + float playerAngle = CenterPos.GetAngle(pPlayer); + plrpos.m_positionX = CenterPos.GetPositionX() + cos(playerAngle) * 5.0f; + plrpos.m_positionY = CenterPos.GetPositionY() + sin(playerAngle) * 5.0f; plrpos.m_positionZ = CenterPos.GetPositionZ() + 18.0f; plrpos.m_orientation = plrpos.GetAngle(&CenterPos); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index efce138d4..c475d08a4 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -3,7 +3,6 @@ */ #include "nexus.h" -#include "Player.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" @@ -43,7 +42,7 @@ enum Events enum Misc { NPC_CRYSTAL_SPIKE = 27099, - NPC_CRYSTALLINE_TANGLER = 32665, +// NPC_CRYSTALLINE_TANGLER = 32665, GO_CRYSTAL_SPIKE = 188537 }; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index b3cd71ccf..b404e4281 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -23,7 +23,7 @@ enum Spells }; #define SPELL_EMPOWERED_ARCANE_EXPLOSION DUNGEON_MODE(SPELL_EMPOWERED_ARCANE_EXPLOSION_N, SPELL_EMPOWERED_ARCANE_EXPLOSION_H) -#define SPELL_TIME_BOMB DUNGEON_MODE(SPELL_TIME_BOMB_N, SPELL_TIME_BOMB_H) +//#define SPELL_TIME_BOMB DUNGEON_MODE(SPELL_TIME_BOMB_N, SPELL_TIME_BOMB_H) enum UromNPCs { diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index d9a4d3451..da284d4fd 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -184,7 +184,7 @@ public: openedMenu[player->GetGUID()] = true; } - if (openedMenu[player->GetGUID()] != true) + if (!openedMenu[player->GetGUID()]) { AddGossipItemFor(player, 9708, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); SendGossipMenuFor(player, GOSSIP_TEXTID_DRAKES, creature->GetGUID()); diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index 0e92b21ae..78918d449 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -1,4 +1,7 @@ -/* MAIDEN OF GRIEF BY SILVANII (mmorcin@wp.pl), Some cleanups by Xinef */ +/* + * Originally written by SILVANII (mmorcin@wp.pl) and Xinef + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 +*/ #include "halls_of_stone.h" #include "ScriptedCreature.h" diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index 56657001a..f377ee61b 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -15,7 +15,6 @@ #define GOSSIP_ITEM_3 "We dont have time for this right now, we have to keep going." #define GOSSIP_ITEM_4 "We're with you Brann! Open it!" #define TEXT_ID_START 13100 -#define YELL_AGGRO "You be dead soon enough!" enum NPCs { diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp index 7cf66ae07..fff2db7d8 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/instance_halls_of_stone.cpp @@ -187,8 +187,8 @@ public: if (data == DONE) { - isMaidenOfGriefDead = (type == BOSS_MAIDEN_OF_GRIEF ? true : isMaidenOfGriefDead); - isKrystalusDead = (type == BOSS_KRYSTALLUS ? true : isKrystalusDead); + isMaidenOfGriefDead = type == BOSS_MAIDEN_OF_GRIEF || isMaidenOfGriefDead; + isKrystalusDead = type == BOSS_KRYSTALLUS || isKrystalusDead; } if (isMaidenOfGriefDead && isKrystalusDead) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index db2e31b9e..9d2992809 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -45,7 +45,7 @@ enum AuriayaSpells #define SPELL_RIP_FLESH RAID_MODE(SPELL_RIP_FLESH_10, SPELL_RIP_FLESH_25) #define SPELL_FERAL_POUNCE RAID_MODE(SPELL_FERAL_POUNCE_10, SPELL_FERAL_POUNCE_25) #define SPELL_FERAL_RUSH RAID_MODE(SPELL_FERAL_RUSH_10, SPELL_FERAL_RUSH_25) -#define SPELL_SEEPING_FERAL_ESSENCE RAID_MODE(SPELL_SEEPING_FERAL_ESSENCE_10, SPELL_SEEPING_FERAL_ESSENCE_25) +//#define SPELL_SEEPING_FERAL_ESSENCE RAID_MODE(SPELL_SEEPING_FERAL_ESSENCE_10, SPELL_SEEPING_FERAL_ESSENCE_25) enum AuriayaNPC { diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index a73287f38..9e547d478 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -1178,25 +1178,6 @@ public: }; }; -enum ScriptedTextNorgannonDellorah -{ - DELLORAH_SAY_1 = 0, - DELLORAH_SAY_2 = 1, - DELLORAH_SAY_3 = 2, - DELLORAH_SAY_4 = 3, - DELLORAH_SAY_5 = 4, - DELLORAH_SAY_6 = 5, - DELLORAH_SAY_7 = 6, - - NORGANNON_SAY_1 = 0, - NORGANNON_SAY_2 = 1, - NORGANNON_SAY_3 = 2, - NORGANNON_SAY_4 = 3, - NORGANNON_SAY_5 = 4, - - RHYDIAN_EMOTE = 0, -}; - class npc_brann_radio : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 35eef1359..a7dd30630 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -122,7 +122,7 @@ enum FreyaSpells #define SPELL_NATURE_FURY RAID_MODE(SPELL_NATURE_FURY_10, SPELL_NATURE_FURY_25) #define SPELL_HARDENED_BARK RAID_MODE(SPELL_HARDENED_BARK_10, SPELL_HARDENED_BARK_25) #define SPELL_DETONATE RAID_MODE(SPELL_DETONATE_10, SPELL_DETONATE_25) -#define SPELL_NATURE_BOMB_DAMAGE RAID_MODE(SPELL_NATURE_BOMB_DAMAGE_10, SPELL_NATURE_BOMB_DAMAGE_25) +//#define SPELL_NATURE_BOMB_DAMAGE RAID_MODE(SPELL_NATURE_BOMB_DAMAGE_10, SPELL_NATURE_BOMB_DAMAGE_25) #define SPELL_SUNBEAM RAID_MODE(SPELL_SUNBEAM_10, SPELL_SUNBEAM_25) #define SPELL_GROUND_TREMOR_FREYA RAID_MODE(SPELL_GROUND_TREMOR_FREYA_10, SPELL_GROUND_TREMOR_FREYA_25) #define SPELL_IRON_ROOTS_FREYA RAID_MODE(SPELL_IRON_ROOTS_FREYA_10, SPELL_IRON_ROOTS_FREYA_25) @@ -502,8 +502,7 @@ public: m_pInstance->SetData(TYPE_FREYA, IN_PROGRESS); // HARD MODE CHECKS - Creature* elder = nullptr; - elder = ObjectAccessor::GetCreature(*me, m_pInstance->GetGuidData(NPC_ELDER_STONEBARK)); + Creature* elder = ObjectAccessor::GetCreature(*me, m_pInstance->GetGuidData(NPC_ELDER_STONEBARK)); if (elder && elder->IsAlive()) { elder->CastSpell(elder, SPELL_DRAINED_OF_POWER, true); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index f06fd106b..72add78fd 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -51,7 +51,7 @@ enum VezaxSpellData enum VezaxNpcs { // NPC_VEZAX = 33271, - NPC_VEZAX_BUNNY = 33500, + // NPC_VEZAX_BUNNY = 33500, NPC_SARONITE_ANIMUS = 33524, }; @@ -182,7 +182,7 @@ public: case 1: return (me->GetLootMode() == 3 ? 1 : 0); case 2: - return (bAchievShadowdodger == true ? 1 : 0); + return (bAchievShadowdodger ? 1 : 0); } return 0; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index a2cd1fae7..703352e2e 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -460,9 +460,13 @@ public: break; case EVENT_FREEZE: if (Player* plr = SelectTargetFromPlayerList(50.0f, SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) + { me->CastSpell(plr, SPELL_FREEZE, false); - else if (Unit* plr = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true)) - me->CastSpell(plr, SPELL_FREEZE, false); + } + else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true)) + { + me->CastSpell(target, SPELL_FREEZE, false); + } events.RescheduleEvent(EVENT_FREEZE, urand(17000, 20000)); break; } @@ -663,8 +667,8 @@ public: if ((s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || (s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))) me->DespawnOrUnsummon(2000); else if (s->GetTypeId() == TYPEID_PLAYER) - if (InstanceScript* pInstance = me->GetInstanceScript()) - if (pInstance->GetData(TYPE_HODIR) == NOT_STARTED) + if (InstanceScript* instanceScript = me->GetInstanceScript()) + if (instanceScript->GetData(TYPE_HODIR) == NOT_STARTED) { s->CastSpell(s, SPELL_FLASH_FREEZE_INSTAKILL, true); me->DespawnOrUnsummon(2000); @@ -1337,9 +1341,13 @@ public: if (Aura* aur = target->GetAura(target->GetTypeId() == TYPEID_PLAYER ? SPELL_FLASH_FREEZE_TRAPPED_PLAYER : SPELL_FLASH_FREEZE_TRAPPED_NPC)) { - if (Unit* caster = aur->GetCaster()) - if (caster->GetTypeId() == TYPEID_UNIT) - caster->ToCreature()->DespawnOrUnsummon(); + if (Unit* caster2 = aur->GetCaster()) + { + if (caster2->GetTypeId() == TYPEID_UNIT) + { + caster2->ToCreature()->DespawnOrUnsummon(); + } + } target->CastSpell(target, SPELL_FLASH_FREEZE_INSTAKILL, true); return; } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp index 460cbdd65..622315b72 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_ignis.cpp @@ -397,12 +397,14 @@ public: if( me->GetVictim() && temp->GetGUID() == me->GetVictim()->GetGUID() ) continue; bool found = false; - for( std::list::iterator itr = icl.begin(); itr != icl.end(); ++itr ) - if( (*itr)->GetVictim() && (*itr)->GetVictim()->GetGUID() == temp->GetGUID() ) + for (std::list::iterator iterator = icl.begin(); iterator != icl.end(); ++iterator) + { + if ((*iterator)->GetVictim() && (*iterator)->GetVictim()->GetGUID() == temp->GetGUID()) { found = true; break; } + } if( !found ) playerGUIDs.push_back(temp->GetGUID()); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index c18bd4d95..16e74c09d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -455,12 +455,14 @@ public: if( !pg.empty() ) { uint8 index = urand(0, pg.size() - 1); - Player* p = pg[index]; + Player* player = pg[index]; float angle = rand_norm() * 2 * M_PI; float z = 364.35f; - if (!p->IsWithinLOS(p->GetPositionX() + cos(angle) * 5.0f, p->GetPositionY() + sin(angle) * 5.0f, z)) - angle = p->GetAngle(2744.65f, 2569.46f); - me->CastSpell(p->GetPositionX() + cos(angle) * 5.0f, p->GetPositionY() + sin(angle) * 5.0f, z, SPELL_SUMMON_FLAMES_INITIAL, true); + if (!player->IsWithinLOS(player->GetPositionX() + cos(angle) * 5.0f, player->GetPositionY() + sin(angle) * 5.0f, z)) + { + angle = player->GetAngle(2744.65f, 2569.46f); + } + me->CastSpell(player->GetPositionX() + cos(angle) * 5.0f, player->GetPositionY() + sin(angle) * 5.0f, z, SPELL_SUMMON_FLAMES_INITIAL, true); pg.erase(pg.begin() + index); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index fbab98ad0..016a596fd 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -2,7 +2,6 @@ * Originally written by Pussywizard - Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 */ -#include "MoveSplineInit.h" #include "PassiveAI.h" #include "Player.h" #include "ScriptedCreature.h" @@ -30,15 +29,15 @@ #define SPELL_CHAIN_3 49683 #define SPELL_CHAIN_4 49684 #define SPELL_LAUNCH_CHAIN 62505 -#define SPELL_HARPOON_SHOT_BUFF 62509 -#define SPELL_HARPOON_FIRE_STATE 62696 +//#define SPELL_HARPOON_SHOT_BUFF 62509 +//#define SPELL_HARPOON_FIRE_STATE 62696 #define REQ_CHAIN_COUNT RAID_MODE(2, 4) #define SPELL_DEVOURINGFLAME_SUMMON 63308 -#define SPELL_DEVOURINGFLAME_GROUNDAURA_10 64709 -#define SPELL_DEVOURINGFLAME_GROUNDAURA_25 64734 -#define S_DEVOURINGFLAME_GROUNDAURA RAID_MODE(SPELL_DEVOURINGFLAME_GROUNDAURA_10, SPELL_DEVOURINGFLAME_GROUNDAURA_25) -#define NPC_DEVOURINGFLAME 34188 +//#define SPELL_DEVOURINGFLAME_GROUNDAURA_10 64709 +//#define SPELL_DEVOURINGFLAME_GROUNDAURA_25 64734 +//#define S_DEVOURINGFLAME_GROUNDAURA RAID_MODE(SPELL_DEVOURINGFLAME_GROUNDAURA_10, SPELL_DEVOURINGFLAME_GROUNDAURA_25) +//#define NPC_DEVOURINGFLAME 34188 #define SPELL_STORMSTRIKE 51876 #define SPELL_WHIRLWIND 63808 #define SPELL_LIGHTINGBOLT 63809 @@ -49,10 +48,10 @@ #define NPC_DARK_RUNE_WATCHER 33453 #define NPC_EXPEDITION_ENGINEER 33287 #define NPC_EXPEDITION_COMMANDER 33210 -#define NPC_EXPEDITION_DEFENDER 33816 -#define NPC_EXPEDITION_TRAPPER 33259 +//#define NPC_EXPEDITION_DEFENDER 33816 +//#define NPC_EXPEDITION_TRAPPER 33259 #define NPC_RAZORSCALE 33186 -#define NPC_HARPOON_FIRE_STATE 33282 +//#define NPC_HARPOON_FIRE_STATE 33282 #define GO_DRILL 195305 #define GO_HARPOON_GUN_1 194519 @@ -208,16 +207,22 @@ public: { case SPELL_LAUNCH_CHAIN: { - uint32 spell = 0; - if( caster->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1) ) - spell = SPELL_CHAIN_1; - else if( caster->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_2) ) - spell = SPELL_CHAIN_2; - else if( caster->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_3) ) - spell = SPELL_CHAIN_3; - else - spell = SPELL_CHAIN_4; - caster->CastSpell(me, spell, true); + uint32 spellId = SPELL_CHAIN_4; + + if (caster->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_1)) + { + spellId = SPELL_CHAIN_1; + } + else if (caster->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_2)) + { + spellId = SPELL_CHAIN_2; + } + else if (caster->GetGUID() == pInstance->GetGuidData(DATA_HARPOON_FIRE_STATE_3)) + { + spellId = SPELL_CHAIN_3; + } + + caster->CastSpell(me, spellId, true); } break; case SPELL_CHAIN_1: diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index b6f5af018..e30536959 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -1459,8 +1459,10 @@ public: { case EVENT_RC_RUNIC_SMASH_TRIGGER: _nextTriggerPos += 16.0f; - if (!(_nextTriggerPos > -260.0f)) + if (_nextTriggerPos <= -260.0f) + { events.RescheduleEvent(EVENT_RC_RUNIC_SMASH_TRIGGER, 500); + } RunRunicSmash(true); break; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 32bf1d563..e4333f36d 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -704,11 +704,13 @@ public: { instance->LoadGrid(364.0f, -16.0f); //make sure leviathan is loaded m_leviathanTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED] = data; - GameObject* gobj = nullptr; - if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED][0]))) - gobj->SetGoState(GO_STATE_ACTIVE); - if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED][1]))) - gobj->SetGoState(GO_STATE_ACTIVE); + for (uint8 i = 0; i < 2; ++i) + { + if (GameObject *gameObject = instance->GetGameObject(m_leviathanVisualTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED][i])) + { + gameObject->SetGoState(GO_STATE_ACTIVE); + } + } return; } @@ -890,7 +892,6 @@ public: case DATA_THORIM_FIRST_DOORS: case DATA_THORIM_SECOND_DOORS: return m_thorimGameobjectsGUID[data - DATA_THORIM_LEVER_GATE]; - break; // Hodir chests case GO_HODIR_CHEST_HARD: @@ -1229,15 +1230,20 @@ void instance_ulduar::instance_ulduar_InstanceMapScript::SpawnLeviathanEncounter if (mode < VEHICLE_POS_NONE) { - TempSummon* veh = nullptr; for (uint8 i = 0; i < (instance->Is25ManRaid() ? 5 : 2); ++i) { - if ((veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15 * mode + i]))) + if (TempSummon* veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15 * mode + i])) + { _leviathanVehicles.push_back(veh->GetGUID()); - if ((veh = instance->SummonCreature(NPC_VEHICLE_CHOPPER, vehiclePositions[15 * mode + i + 5]))) + } + if (TempSummon* veh = instance->SummonCreature(NPC_VEHICLE_CHOPPER, vehiclePositions[15 * mode + i + 5])) + { _leviathanVehicles.push_back(veh->GetGUID()); - if ((veh = instance->SummonCreature(NPC_SALVAGED_DEMOLISHER, vehiclePositions[15 * mode + i + 10]))) + } + if (TempSummon* veh = instance->SummonCreature(NPC_SALVAGED_DEMOLISHER, vehiclePositions[15 * mode + i + 10])) + { _leviathanVehicles.push_back(veh->GetGUID()); + } } } } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index 765677aa0..b94ef8e4b 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -46,9 +46,6 @@ enum Misc NPC_RITUAL_CHANNELER = 27281, NPC_ARTHAS = 29280, NPC_FLAME_BRAZIER = 27273, - - // ACTIONS - ACTION_START_SORROWGRAVE = 1, }; enum Events diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp index 5539aa0dc..aaae3da2a 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/instance_utgarde_pinnacle.cpp @@ -34,7 +34,6 @@ public: ObjectGuid SkadiRuthlessDoor; ObjectGuid YmironDoor; ObjectGuid StatisGenerator; - uint32 FightStatus; uint32 Encounters[MAX_ENCOUNTERS]; uint8 SkadiHits; uint8 SkadiInRange; @@ -47,7 +46,6 @@ public: { SkadiHits = 0; SkadiInRange = 0; - FightStatus = 0; svalaAchievement = false; skadiAchievement = false; diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index bb09981ff..4f6e46566 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -37,12 +37,6 @@ enum Events EVENT_CAST_WHITEOUT_GROUND_EFFECT = 4, }; -enum Misc -{ - NPC_FROZEN_ORB = 38456, - NPC_FROZEN_ORB_STALKER = 38461, -}; - class boss_toravon : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp index 8d12f1c95..f530f1599 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_ichoron.cpp @@ -57,11 +57,6 @@ enum eSpells #define SPELL_WATER_BOLT_VOLLEY DUNGEON_MODE(SPELL_WATER_BOLT_VOLLEY_N, SPELL_WATER_BOLT_VOLLEY_H) #define SPELL_FRENZY DUNGEON_MODE(SPELL_FRENZY_N, SPELL_FRENZY_H) -enum eEvents -{ - EVENT_SPELL_WATER_BOLT_VOLLEY = 1, -}; - class boss_ichoron : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index 8ecccc4e2..57294912f 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -14,11 +14,9 @@ Script Data End */ #include "Player.h" #include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "ScriptMgr.h" #include "World.h" -#include "WorldSession.h" // Ours class npc_steam_powered_auctioneer : public CreatureScript diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 3a413ae7e..ab119654f 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -21,7 +21,6 @@ EndContentData */ #include "PassiveAI.h" #include "Player.h" #include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "ScriptMgr.h" #include "SpellAuras.h" @@ -1620,9 +1619,7 @@ public: void StoreTargets() { - uint8 creaturecount; - - creaturecount = 0; + uint8 creturesCount = 0; for (uint8 ii = 0; ii < 3; ++ii) { @@ -1630,10 +1627,10 @@ public: GetCreatureListWithEntryInGrid(creatureList, me, AudienceMobs[ii], 15.0f); for (std::list::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) { - if (Creature* creatureList = *itr) + if (Creature* creature = *itr) { - audienceList[creaturecount] = creatureList->GetGUID(); - ++creaturecount; + audienceList[creturesCount] = creature->GetGUID(); + ++creturesCount; } } } diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 22e828913..70b16cb35 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -99,13 +99,13 @@ public: DoMeleeAttackIfReady(); } - void setphase(short phase) + void setphase(short newPhase) { Unit* summoner = me->ToTempSummon() ? me->ToTempSummon()->GetSummoner() : nullptr; if (!summoner || summoner->GetTypeId() != TYPEID_PLAYER) return; - switch (phase) + switch (newPhase) { case 1: me->MonsterWhisper("You think that you can get rid of me through meditation?", summoner->ToPlayer()); @@ -258,11 +258,6 @@ public: ## npc_plaguehound_tracker ######*/ -enum Plaguehound -{ - QUEST_SNIFF_OUT_ENEMY = 11253 -}; - class npc_plaguehound_tracker : public CreatureScript { public: diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 1d05b4c18..81a447a43 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -277,9 +277,9 @@ quest Still At It (12644) #define MCM_TEXT_FAILED "You have FAILED!!!" #define ACTION_PRESSURE 1 #define ACTION_HEAT 2 -#define ACTION_BANANA 3 -#define ACTION_ORANGE 4 -#define ACTION_PAPAYA 5 +//#define ACTION_BANANA 3 +//#define ACTION_ORANGE 4 +//#define ACTION_PAPAYA 5 #define NPC_WANTS_BANANAS 28537 class npc_still_at_it_trigger : public CreatureScript diff --git a/src/server/scripts/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 8dc62d2ba..0c63e8813 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -1,16 +1,5 @@ -/* Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it and/or modify it under version 2 of the License, or (at your option), any later version. 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, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +/* + * Copyright (C) 2016+ AzerothCore , released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3 */ #include "Battlefield.h" @@ -25,11 +14,9 @@ #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "ScriptMgr.h" -#include "ScriptSystem.h" #include "SpellScript.h" #include "Vehicle.h" #include "World.h" -#include "WorldSession.h" #define GOSSIP_HELLO_DEMO1 "Build catapult." #define GOSSIP_HELLO_DEMO2 "Build demolisher."