From 7bddd69c954aa8733d13ff4002880f0d194faacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francesco=20Borz=C3=AC?= Date: Fri, 6 Aug 2021 15:45:17 +0200 Subject: [PATCH] refactor(Scripts/Kalimdor): code cleanup (part 10) (#7065) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor(Scripts/Kalimdor): code cleanup (part 10) * chore(Core/zone_mulgore): delete file * chore(Core/zone_teldrassil): remove file * chore(Core/kalimdor_script_loader): remove mulgore and teldrassil zone Co-authored-by: Stefano Borzì --- .../BattleForMountHyjal/boss_anetheron.cpp | 10 +++++++- .../BattleForMountHyjal/boss_archimonde.cpp | 1 - .../BattleForMountHyjal/boss_azgalor.cpp | 4 ++- .../CavernsOfTime/BattleForMountHyjal/hyjal.h | 1 - .../BattleForMountHyjal/hyjalAI.cpp | 1 - .../BattleForMountHyjal/hyjal_trash.cpp | 7 +++--- .../BattleForMountHyjal/instance_hyjal.cpp | 3 --- .../culling_of_stratholme.cpp | 15 +++++++---- .../EscapeFromDurnholdeKeep/old_hillsbrad.h | 4 --- .../RuinsOfAhnQiraj/boss_kurinnaxx.cpp | 1 - .../Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp | 1 - .../TempleOfAhnQiraj/boss_bug_trio.cpp | 3 +-- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 16 ++++++------ .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 3 +-- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 6 ++--- .../mob_anubisath_sentinel.cpp | 1 - .../Kalimdor/ZulFarrak/instance_zulfarrak.cpp | 1 - src/server/scripts/Kalimdor/boss_azuregos.cpp | 3 +-- .../Kalimdor/kalimdor_script_loader.cpp | 4 --- src/server/scripts/Kalimdor/zone_desolace.cpp | 11 +++++--- .../Kalimdor/zone_dustwallow_marsh.cpp | 1 - src/server/scripts/Kalimdor/zone_feralas.cpp | 1 - src/server/scripts/Kalimdor/zone_mulgore.cpp | 15 ----------- src/server/scripts/Kalimdor/zone_silithus.cpp | 17 ++++++------- .../scripts/Kalimdor/zone_teldrassil.cpp | 25 ------------------- .../scripts/Kalimdor/zone_the_barrens.cpp | 3 +-- 26 files changed, 55 insertions(+), 103 deletions(-) delete mode 100644 src/server/scripts/Kalimdor/zone_mulgore.cpp delete mode 100644 src/server/scripts/Kalimdor/zone_teldrassil.cpp diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index d6ac85d8d..66e13518a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -121,12 +121,16 @@ public: //Return since we have no target if (!UpdateVictim()) + { return; + } if (SwarmTimer <= diff) { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) + { DoCast(target, SPELL_CARRION_SWARM); + } SwarmTimer = urand(45000, 60000); Talk(SAY_SWARM); @@ -209,7 +213,9 @@ public: { if (me->IsWithinDist(who, 50) && !me->IsInCombat() && me->IsValidAttackTarget(who)) + { AttackStart(who); + } } void UpdateAI(uint32 diff) override @@ -219,7 +225,7 @@ public: if (AnetheronGUID) { Creature* boss = ObjectAccessor::GetCreature(*me, AnetheronGUID); - if (!boss || (boss && boss->isDead())) + if (!boss || boss->isDead()) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); @@ -232,7 +238,9 @@ public: //Return since we have no target if (!UpdateVictim()) + { return; + } if (ImmolationTimer <= diff) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp index 6ad76ed0d..2082b87a2 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_archimonde.cpp @@ -11,7 +11,6 @@ SDComment: Doomfires not completely offlike due to core limitations for random m SDCategory: Caverns of Time, Mount Hyjal EndScriptData */ -#include "hyjal_trash.h" #include "hyjal.h" #include "Player.h" #include "ScriptedCreature.h" diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index c9a67b423..574461e3e 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -232,7 +232,7 @@ public: if (AzgalorGUID) { Creature* boss = ObjectAccessor::GetCreature(*me, AzgalorGUID); - if (!boss || (boss && boss->isDead())) + if (!boss || boss->isDead()) { me->setDeathState(JUST_DIED); me->RemoveCorpse(); @@ -245,7 +245,9 @@ public: //Return since we have no target if (!UpdateVictim()) + { return; + } if (WarstompTimer <= diff) { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h index 972c3a485..eac85ee13 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal.h @@ -11,7 +11,6 @@ #include "CreatureAIImpl.h" #define HyjalScriptName "instance_hyjal" -#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy." uint32 const EncounterCount = 5; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index b1c136941..de92ca6e6 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -19,7 +19,6 @@ EndScriptData */ #include "hyjalAI.h" #include "ScriptedCreature.h" #include "ScriptedEscortAI.h" -#include "ScriptMgr.h" enum Spawns { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp index d5ccdbddc..b9539796c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjal_trash.cpp @@ -6,7 +6,6 @@ #include "hyjal_trash.h" #include "hyjal.h" -#include "hyjalAI.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" @@ -20,9 +19,9 @@ enum Spells SPELL_DISEASE_CLOUD = 31607, SPELL_KNOCKDOWN = 31610, SPELL_FRENZY = 31540, - SPELL_RAISE_DEAD_1 = 31617, - SPELL_RAISE_DEAD_2 = 31624, - SPELL_RAISE_DEAD_3 = 31625, +// SPELL_RAISE_DEAD_1 = 31617, +// SPELL_RAISE_DEAD_2 = 31624, +// SPELL_RAISE_DEAD_3 = 31625, SPELL_SHADOW_BOLT = 31627, SPELL_BANSHEE_CURSE = 31651, SPELL_BANSHEE_WAIL = 38183, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp index 961485caf..38fc957f0 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/instance_hyjal.cpp @@ -15,8 +15,6 @@ EndScriptData */ #include "hyjal_trash.h" #include "InstanceScript.h" #include "Opcodes.h" -#include "Player.h" -#include "ScriptedCreature.h" #include "ScriptMgr.h" #include "WorldPacket.h" @@ -29,7 +27,6 @@ EndScriptData */ */ #define YELL_EFFORTS "All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more." -#define YELL_EFFORTS_NAME "Archimonde" class instance_hyjal : public InstanceMapScript { diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 9064e038b..2288cf934 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -434,13 +434,18 @@ public: SetEscortPaused(false); SetRun(false); - Creature* cr = nullptr; - if ((cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1]))) + if (Creature* cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1])) + { cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK); - if ((cr = me->SummonCreature(NPC_CITY_MAN4, EventPos[EVENT_SRC_HALL_CITYMAN2]))) + } + if (Creature* cr = me->SummonCreature(NPC_CITY_MAN4, EventPos[EVENT_SRC_HALL_CITYMAN2])) + { cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK); - if ((cr = me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_HALL_CITYMAN3]))) + } + if (Creature* cr = me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_HALL_CITYMAN3])) + { cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK); + } } else if (param == ACTION_START_SECRET_PASSAGE) { @@ -1251,7 +1256,7 @@ void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data) waveGroupId = 4; SendNextWave(NPC_MEATHOOK); } - else if (data == COS_PROGRESS_KILLED_SALRAMM) + else // if (data == COS_PROGRESS_KILLED_SALRAMM) { if (pInstance) pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 10); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h index cff5a2991..ac3ba6297 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h +++ b/src/server/scripts/Kalimdor/CavernsOfTime/EscapeFromDurnholdeKeep/old_hillsbrad.h @@ -40,9 +40,6 @@ enum NpcIds NPC_CAPTAIN_SKARLOC = 17862, NPC_SKARLOC_MOUNT = 18798, - - NPC_LORDAERON_SENTRY = 17815, - NPC_LORDAERON_WATCHMAN = 17814, }; enum GobjectIds @@ -54,7 +51,6 @@ enum GobjectIds enum MiscIds { - QUEST_DIVERSION = 10283, WORLD_STATE_BARRELS_PLANTED = 2436, SKARLOC_MOUNT_MODEL = 18223, diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp index 01c1fb6f9..e21b11bb4 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_kurinnaxx.cpp @@ -5,7 +5,6 @@ */ #include "CreatureTextMgr.h" -#include "ObjectMgr.h" #include "ruins_of_ahnqiraj.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index 7e8b69fe1..4e9fa5651 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -4,7 +4,6 @@ * Copyright (C) 2005-2009 MaNGOS */ -#include "ObjectMgr.h" #include "ruins_of_ahnqiraj.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp index 15b4adc14..2390333ec 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_bug_trio.cpp @@ -179,8 +179,7 @@ public: //Charge_Timer if (Charge_Timer <= diff) { - Unit* target = nullptr; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target) { DoCast(target, SPELL_CHARGE); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index f62eeec61..07f11914e 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -268,13 +268,13 @@ public: { if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) { - Creature* Spawned = nullptr; - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500); + Creature* spawned = me->SummonCreature(NPC_CLAW_TENTACLE, *target, TEMPSUMMON_CORPSE_DESPAWN, 500); - if (Spawned && Spawned->AI()) - Spawned->AI()->AttackStart(target); + if (spawned && spawned->AI()) + { + spawned->AI()->AttackStart(target); + } } //One claw tentacle every 12.5 seconds @@ -548,7 +548,7 @@ public: Unit* unit = ObjectAccessor::GetUnit(*me, i->first); //Only units out of stomach - if (unit && i->second == false) + if (unit && !i->second) temp.push_back(unit); ++i; @@ -692,7 +692,7 @@ public: Unit* unit = ObjectAccessor::GetUnit(*me, i->first); //Only move units in stomach - if (unit && i->second == true) + if (unit && i->second) { //Teleport each player out DoTeleportPlayer(unit, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 10, float(rand() % 6)); @@ -723,7 +723,7 @@ public: Unit* unit = ObjectAccessor::GetUnit(*me, i->first); //Only apply to units in stomach - if (unit && i->second == true) + if (unit && i->second) { //Cast digestive acid on them DoCast(unit, SPELL_DIGESTIVE_ACID, true); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 2423ebe5e..1df865c6f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -105,8 +105,7 @@ public: //ChangeTarget_Timer if (Submerged && ChangeTarget_Timer <= diff) { - Unit* target = nullptr; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); if (target) me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), me->GetOrientation()); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 719b3ea1c..a7e73293a 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -475,7 +475,6 @@ public: uint32 Scorpions_Timer; int Rand; int RandX; - int RandY; Creature* Summoned; @@ -526,10 +525,11 @@ public: //Blizzard_Timer if (Blizzard_Timer <= diff) { - Unit* target = nullptr; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); if (target) + { DoCast(target, SPELL_BLIZZARD); + } Blizzard_Timer = 15000 + rand() % 15000; } else Blizzard_Timer -= diff; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp index c95dca1c8..ec90a17a2 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/mob_anubisath_sentinel.cpp @@ -15,7 +15,6 @@ EndScriptData */ #include "CellImpl.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" -#include "Item.h" #include "Player.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" diff --git a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp index 225558af1..16393c72c 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/instance_zulfarrak.cpp @@ -5,7 +5,6 @@ #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "InstanceScript.h" -#include "Player.h" #include "ScriptMgr.h" #include "TemporarySummon.h" #include "zulfarrak.h" diff --git a/src/server/scripts/Kalimdor/boss_azuregos.cpp b/src/server/scripts/Kalimdor/boss_azuregos.cpp index 86f02f071..3f29bdd01 100644 --- a/src/server/scripts/Kalimdor/boss_azuregos.cpp +++ b/src/server/scripts/Kalimdor/boss_azuregos.cpp @@ -79,8 +79,7 @@ public: { Talk(SAY_TELEPORT); ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList(); - ThreatContainer::StorageType::const_iterator i = threatlist.begin(); - for (i = threatlist.begin(); i != threatlist.end(); ++i) + for (auto i = threatlist.begin(); i != threatlist.end(); ++i) { Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid()); if (unit && (unit->GetTypeId() == TYPEID_PLAYER)) diff --git a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp index 112b38953..10cf08875 100644 --- a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp +++ b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp @@ -70,12 +70,10 @@ void AddSC_dustwallow_marsh(); void AddSC_felwood(); void AddSC_feralas(); void AddSC_moonglade(); -void AddSC_mulgore(); void AddSC_orgrimmar(); void AddSC_silithus(); void AddSC_stonetalon_mountains(); void AddSC_tanaris(); -void AddSC_teldrassil(); void AddSC_the_barrens(); void AddSC_thousand_needles(); void AddSC_thunder_bluff(); @@ -152,12 +150,10 @@ void AddKalimdorScripts() AddSC_felwood(); AddSC_feralas(); AddSC_moonglade(); - AddSC_mulgore(); AddSC_orgrimmar(); AddSC_silithus(); AddSC_stonetalon_mountains(); AddSC_tanaris(); - AddSC_teldrassil(); AddSC_the_barrens(); AddSC_thousand_needles(); AddSC_thunder_bluff(); diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index cdec326b3..1816d8eff 100644 --- a/src/server/scripts/Kalimdor/zone_desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -183,16 +183,19 @@ public: RemoveSummons(); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - Creature* cr = nullptr; - if ((cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me))) + if (Creature* cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me)) { cr->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); summons[0] = cr->GetGUID(); } - if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me))) + if (Creature* cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)) + { summons[1] = cr->GetGUID(); - if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me))) + } + if (Creature* cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)) + { summons[2] = cr->GetGUID(); + } SummonsFollow(); } diff --git a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp index 9a7d8ee8c..598099c12 100644 --- a/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp +++ b/src/server/scripts/Kalimdor/zone_dustwallow_marsh.cpp @@ -19,7 +19,6 @@ EndContentData */ #include "Player.h" #include "ScriptedCreature.h" -#include "ScriptedEscortAI.h" #include "ScriptedGossip.h" #include "ScriptMgr.h" #include "SpellScript.h" diff --git a/src/server/scripts/Kalimdor/zone_feralas.cpp b/src/server/scripts/Kalimdor/zone_feralas.cpp index c1e76b9cb..eb07a3cba 100644 --- a/src/server/scripts/Kalimdor/zone_feralas.cpp +++ b/src/server/scripts/Kalimdor/zone_feralas.cpp @@ -17,7 +17,6 @@ EndScriptData */ #include "ScriptedGossip.h" #include "ScriptMgr.h" #include "SpellScript.h" -#include "WorldSession.h" /*###### ## npc_oox22fe diff --git a/src/server/scripts/Kalimdor/zone_mulgore.cpp b/src/server/scripts/Kalimdor/zone_mulgore.cpp deleted file mode 100644 index 76f7bde28..000000000 --- a/src/server/scripts/Kalimdor/zone_mulgore.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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. - * Copyright (C) 2008-2016 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - */ - -#include "Player.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptMgr.h" -#include "SpellInfo.h" - -void AddSC_mulgore() -{ -} diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index cd51a1d23..a206f23e7 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -443,8 +443,11 @@ public: void HandleAnimation() { Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID); + if (!player) + { return; + } Creature* Fandral = player->FindNearestCreature(C_FANDRAL_STAGHELM, 100.0f); Creature* Arygos = player->FindNearestCreature(C_ARYGOS, 100.0f); @@ -455,7 +458,7 @@ public: return; AnimationTimer = EventAnim[AnimationCount].Timer; - if (eventEnd == false) + if (!eventEnd) { switch (AnimationCount) { @@ -636,10 +639,9 @@ public: case 51: { uint32 entries[4] = { 15423, 15424, 15414, 15422 }; - Unit* mob = nullptr; for (uint8 i = 0; i < 4; ++i) { - mob = player->FindNearestCreature(entries[i], 50, me); + Unit* mob = player->FindNearestCreature(entries[i], 50, me); while (mob) { mob->RemoveFromWorld(); @@ -675,8 +677,7 @@ public: me->GetMotionMaster()->MoveCharge(-8117.99f, 1532.24f, 3.94f, 4); break; case 60: - if (player) - Talk(ANACHRONOS_SAY_10, player); + Talk(ANACHRONOS_SAY_10, player); me->GetMotionMaster()->MoveCharge(-8113.46f, 1524.16f, 2.89f, 4); break; case 61: @@ -926,8 +927,6 @@ public: if (Group* EventGroup = player->GetGroup()) { - Player* groupMember = nullptr; - uint8 GroupMemberCount = 0; uint8 DeadMemberCount = 0; uint8 FailedMemberCount = 0; @@ -936,7 +935,7 @@ public: for (Group::member_citerator itr = members.begin(); itr != members.end(); ++itr) { - groupMember = ObjectAccessor::GetPlayer(*me, itr->guid); + Player* groupMember = ObjectAccessor::GetPlayer(*me, itr->guid); if (!groupMember) continue; if (!groupMember->IsWithinDistInMap(me, EVENT_AREA_RADIUS) && groupMember->GetQuestStatus(QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) == QUEST_STATUS_INCOMPLETE) @@ -997,7 +996,7 @@ void npc_qiraj_war_spawn::npc_qiraj_war_spawnAI::JustDied(Unit* /*slayer*/) if (Creature* mob = ObjectAccessor::GetCreature(*me, MobGUID)) if (npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI* triggerAI = CAST_AI(npc_anachronos_quest_trigger::npc_anachronos_quest_triggerAI, mob->AI())) triggerAI->LiveCounter(); -}; +} /*##### # go_crystalline_tear diff --git a/src/server/scripts/Kalimdor/zone_teldrassil.cpp b/src/server/scripts/Kalimdor/zone_teldrassil.cpp deleted file mode 100644 index 224c0ee11..000000000 --- a/src/server/scripts/Kalimdor/zone_teldrassil.cpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - * Copyright (C) 2008-2016 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - */ - -/* ScriptData -SDName: Teldrassil -SD%Complete: 100 -SDComment: Quest support: 938 -SDCategory: Teldrassil -EndScriptData */ - -/* ContentData -npc_mist -EndContentData */ - -#include "Player.h" -#include "ScriptedCreature.h" -#include "ScriptedFollowerAI.h" -#include "ScriptMgr.h" - -void AddSC_teldrassil() -{ -} diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index 0e560b90c..5779359a2 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -271,7 +271,6 @@ enum TwiggyFlathead NPC_BIG_WILL = 6238, NPC_AFFRAY_CHALLENGER = 6240, - SAY_BIG_WILL_READY = 0, SAY_TWIGGY_FLATHEAD_BEGIN = 0, SAY_TWIGGY_FLATHEAD_FRAY = 1, SAY_TWIGGY_FLATHEAD_DOWN = 2, @@ -466,7 +465,7 @@ public: EnterEvadeMode(); return; } - else if (creature) // Makes BIG WILL attackable. + else // Makes BIG WILL attackable. { creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);