From 3b247f6bca38c5b0c9bfee5c57d346869542236f Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 15 Mar 2014 19:45:44 +0100 Subject: Scripts/ZulGurub/Jeklik: Add missing "break" --- src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp index 336599f2cc5..5d4bafb5f94 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp @@ -152,9 +152,11 @@ class boss_jeklik : public CreatureScript case EVENT_SONIC_BURST: DoCastVictim(SPELL_SONICBURST); events.ScheduleEvent(EVENT_SONIC_BURST, urand(8000, 13000), 0, PHASE_ONE); + break; case EVENT_SCREECH: DoCastVictim(SPELL_SCREECH); events.ScheduleEvent(EVENT_SCREECH, urand(18000, 26000), 0, PHASE_ONE); + break; case EVENT_SPAWN_BATS: if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) for (uint8 i = 0; i < 6; ++i) -- cgit v1.2.3 From 5f7e0f6929ea70fa97565c4bb38c0d63d40fc43a Mon Sep 17 00:00:00 2001 From: untaught Date: Sun, 16 Mar 2014 08:47:27 +0200 Subject: Instance Script/Stratholme: Correct logic in Baron Run event and add SAI for Ysida Harmon --- sql/updates/world/2014_03_16_02_world_sai.sql | 7 +++++++ .../Stratholme/instance_stratholme.cpp | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2014_03_16_02_world_sai.sql (limited to 'src/server/scripts/EasternKingdoms') diff --git a/sql/updates/world/2014_03_16_02_world_sai.sql b/sql/updates/world/2014_03_16_02_world_sai.sql new file mode 100644 index 00000000000..775c6aa1d0c --- /dev/null +++ b/sql/updates/world/2014_03_16_02_world_sai.sql @@ -0,0 +1,7 @@ +UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=16031; +DELETE FROM `smart_scripts` WHERE `entryorguid`=16031 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(16031,0,0,0,11,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ysida Harmon - On Respawn - Say Line 0'); +DELETE FROM `creature_text` WHERE `entry`=16031; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(16031,0,0,'You did it... you''ve slain Baron Rivendare! The Argent Dawn shall hear of your valiant deeds!',12,0,0,0,0,0,''); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index d8518085b26..9ceaf8cb85b 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -310,6 +310,15 @@ class instance_stratholme : public InstanceMapScript { HandleGameObject(ziggurat4GUID, false); HandleGameObject(ziggurat5GUID, false); + } + if (data == DONE || data == NOT_STARTED) + { + HandleGameObject(ziggurat4GUID, true); + HandleGameObject(ziggurat5GUID, true); + } + if (data == DONE) + { + HandleGameObject(portGauntletGUID, true); if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) { DoRemoveAurasDueToSpellOnPlayers(SPELL_BARON_ULTIMATUM); @@ -318,18 +327,13 @@ class instance_stratholme : public InstanceMapScript for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) if (Player* player = itr->GetSource()) if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) + { player->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); - + player->KilledMonsterCredit(NPC_YSIDA); + } SetData(TYPE_BARON_RUN, DONE); } } - if (data == DONE || data == NOT_STARTED) - { - HandleGameObject(ziggurat4GUID, true); - HandleGameObject(ziggurat5GUID, true); - } - if (data == DONE) - HandleGameObject(portGauntletGUID, true); EncounterState[5] = data; break; case TYPE_SH_AELMAR: -- cgit v1.2.3 From c31ffd774e0cf845b980d18f3a26b46150de1e4c Mon Sep 17 00:00:00 2001 From: untaught Date: Tue, 18 Mar 2014 08:31:23 +0200 Subject: Core/Scripts: Move 'The Defias Traitor' script to SAI --- sql/updates/world/2014_03_18_00_world_sai.sql | 62 ++++++++++++++++++ .../scripts/EasternKingdoms/zone_westfall.cpp | 75 +--------------------- 2 files changed, 63 insertions(+), 74 deletions(-) create mode 100644 sql/updates/world/2014_03_18_00_world_sai.sql (limited to 'src/server/scripts/EasternKingdoms') diff --git a/sql/updates/world/2014_03_18_00_world_sai.sql b/sql/updates/world/2014_03_18_00_world_sai.sql new file mode 100644 index 00000000000..126abb57f8c --- /dev/null +++ b/sql/updates/world/2014_03_18_00_world_sai.sql @@ -0,0 +1,62 @@ +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`=467; +DELETE FROM `smart_scripts` WHERE `entryorguid`=467 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(467,0,0,1,19,0,100,0,155,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - On Accepted Quest ''The Defias Brotherhood'' - Say Line 0'), +(467,0,1,2,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'The Defias Traitor - Link With Previous - Store Target List'), +(467,0,2,3,61,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - Link With Previous - Remove npcflag ''Quest Giver'), +(467,0,3,0,61,0,100,0,0,0,0,0,53,1,467,0,0,0,2,7,0,0,0,0,0,0,0,'The Defias Traitor - Link WIth Previous - Start WP'), +(467,0,4,0,40,0,100,0,36,467,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - On WP Reached 36 - Disable run'), +(467,0,5,0,40,0,100,0,37,467,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - On WP Reached 37 - Say Line 1'), +(467,0,6,7,40,0,100,0,45,467,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - On WP Reached 45 - Say Line 2'), +(467,0,7,8,61,0,100,0,0,0,0,0,15,155,0,0,0,0,0,12,1,0,0,0,0,0,0,'The Defias Traitor - Link With Previous - Area Explored Or Event Happens'), +(467,0,8,0,61,0,100,1,0,0,0,0,41,3000,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - Link WIth Previous - Despawn'), +(467,0,9,0,4,0,100,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'The Defias Traitor - On Aggro - Say Line 3'); + +DELETE FROM `script_waypoint` WHERE `entry`=467; +DELETE FROM `waypoints` WHERE `entry`=467; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(467,1,-10508.4,1068,55.21,''), +(467,2,-10518.3,1074.84,53.96,''), +(467,3,-10534.8,1081.92,49.88,''), +(467,4,-10546.5,1084.88,50.13,''), +(467,5,-10555.3,1084.45,45.75,''), +(467,6,-10566.6,1083.53,42.1,''), +(467,7,-10575.8,1082.34,39.46,''), +(467,8,-10585.7,1081.08,37.77,''), +(467,9,-10600.1,1078.19,36.23,''), +(467,10,-10608.7,1076.08,35.88,''), +(467,11,-10621.3,1073,35.4,''), +(467,12,-10638.1,1060.18,33.61,''), +(467,13,-10655.9,1038.99,33.48,''), +(467,14,-10664.7,1030.54,32.7,''), +(467,15,-10708.7,1033.86,33.32,''), +(467,16,-10754.4,1017.93,32.79,''), +(467,17,-10802.3,1018.01,32.16,''), +(467,18,-10832.6,1009.04,32.71,''), +(467,19,-10866.6,1006.51,31.71,''), +(467,20,-10880,1005.1,32.84,''), +(467,21,-10892.5,1001.32,34.46,''), +(467,22,-10906.1,997.11,36.15,''), +(467,23,-10922.3,1002.23,35.74,''), +(467,24,-10936.3,1023.38,36.52,''), +(467,25,-10933.3,1052.61,35.85,''), +(467,26,-10940.2,1077.66,36.49,''), +(467,27,-10957.1,1099.33,36.83,''), +(467,28,-10956.5,1119.9,36.73,''), +(467,29,-10939.3,1150.75,37.42,''), +(467,30,-10915.1,1202.09,36.55,''), +(467,31,-10892.6,1257.03,33.37,''), +(467,32,-10891.9,1306.66,35.45,''), +(467,33,-10896.2,1327.86,37.77,''), +(467,34,-10906,1368.05,40.91,''), +(467,35,-10910.2,1389.33,42.62,''), +(467,36,-10915.4,1417.72,42.93,''), +(467,37,-10926.4,1421.18,43.04,'walk here and say'), +(467,38,-10952.3,1421.74,43.4,''), +(467,39,-10980,1411.38,42.79,''), +(467,40,-11006.1,1420.47,43.26,''), +(467,41,-11022,1450.59,43.09,''), +(467,42,-11025.4,1491.59,43.15,''), +(467,43,-11036.1,1508.32,43.28,''), +(467,44,-11060.7,1526.72,43.19,''), +(467,45,-11072.8,1527.77,43.2,'say and quest credit'); diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp index 350ceead706..d01806028c6 100644 --- a/src/server/scripts/EasternKingdoms/zone_westfall.cpp +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp @@ -19,13 +19,12 @@ /* ScriptData SDName: Westfall SD%Complete: 90 -SDComment: Quest support: 155, 1651 +SDComment: Quest support: 1651 SDCategory: Westfall EndScriptData */ /* ContentData npc_daphne_stilwell -npc_defias_traitor EndContentData */ #include "ScriptMgr.h" @@ -202,79 +201,7 @@ public: }; }; -/*###### -## npc_defias_traitor -######*/ -enum DefiasSays -{ - SAY_START = 0, - SAY_PROGRESS = 1, - SAY_END = 2, - SAY_AGGRO = 3 -}; - - -#define QUEST_DEFIAS_BROTHERHOOD 155 - -class npc_defias_traitor : public CreatureScript -{ -public: - npc_defias_traitor() : CreatureScript("npc_defias_traitor") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE - { - if (quest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_defias_traitor::npc_defias_traitorAI, creature->AI())) - pEscortAI->Start(true, true, player->GetGUID()); - - creature->AI()->Talk(SAY_START, player); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_defias_traitorAI(creature); - } - - struct npc_defias_traitorAI : public npc_escortAI - { - npc_defias_traitorAI(Creature* creature) : npc_escortAI(creature) { Reset(); } - - void WaypointReached(uint32 waypointId) OVERRIDE - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 35: - SetRun(false); - break; - case 36: - Talk(SAY_PROGRESS, player); - break; - case 44: - Talk(SAY_END, player); - player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me); - break; - } - } - - void EnterCombat(Unit* who) OVERRIDE - { - Talk(SAY_AGGRO, who); - } - - void Reset() OVERRIDE { } - }; -}; - void AddSC_westfall() { new npc_daphne_stilwell(); - new npc_defias_traitor(); } -- cgit v1.2.3 From 8a9bfbba481dc61a229a04e0ad618911b9cd360f Mon Sep 17 00:00:00 2001 From: untaught Date: Thu, 20 Mar 2014 20:29:06 +0200 Subject: Core/Scripts: Move 'npc_deathly_usher' scripts to SAI. --- sql/updates/world/2014_03_20_01_world_sai.sql | 4 +++ .../scripts/EasternKingdoms/zone_blasted_lands.cpp | 33 +--------------------- 2 files changed, 5 insertions(+), 32 deletions(-) create mode 100644 sql/updates/world/2014_03_20_01_world_sai.sql (limited to 'src/server/scripts/EasternKingdoms') diff --git a/sql/updates/world/2014_03_20_01_world_sai.sql b/sql/updates/world/2014_03_20_01_world_sai.sql new file mode 100644 index 00000000000..8b8e318b524 --- /dev/null +++ b/sql/updates/world/2014_03_20_01_world_sai.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ainame`='SmartAI', `scriptname`='' WHERE `entry`=8816; +DELETE FROM `smart_scripts` WHERE `entryorguid`=8816 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(8816,0,0,0,62,0,100,0,1541,0,0,0,11,12885,2,0,0,0,0,7,0,0,0,0,0,0,0,'On Gossip Option Selected - Cast ''Teleport to Razelikh'''); diff --git a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp index 3fcd3c093b7..bc09983fee1 100644 --- a/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_blasted_lands.cpp @@ -17,11 +17,7 @@ /* Blasted_Lands -Quest support: 3628. Teleporter to Rise of the Defiler. -*/ - -/* -npc_deathly_usher +Quest support: 3628. */ #include "ScriptMgr.h" @@ -31,10 +27,6 @@ npc_deathly_usher #include "Player.h" #include "Group.h" -/*###### -## npc_deathly_usher -######*/ - enum DeathlyUsher { SPELL_TELEPORT_SINGLE = 12885, @@ -42,28 +34,6 @@ enum DeathlyUsher SPELL_TELEPORT_GROUP = 27686 }; -class npc_deathly_usher : public CreatureScript -{ -public: - npc_deathly_usher() : CreatureScript("npc_deathly_usher") { } - - struct npc_deathly_usherAI : public ScriptedAI - { - npc_deathly_usherAI(Creature* creature) : ScriptedAI(creature) { } - - void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) OVERRIDE - { - player->CLOSE_GOSSIP_MENU(); - me->CastSpell(player, SPELL_TELEPORT_GROUP, true); - } - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_deathly_usherAI(creature); - } -}; - /*##### # spell_razelikh_teleport_group #####*/ @@ -113,6 +83,5 @@ class spell_razelikh_teleport_group : public SpellScriptLoader void AddSC_blasted_lands() { - new npc_deathly_usher(); new spell_razelikh_teleport_group(); } -- cgit v1.2.3 From 6dcd8c8545a65a7bfbd0daaa16f650d8c3a90262 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sat, 22 Mar 2014 14:54:32 +0100 Subject: Core/Misc: Fix some static analysis issues Fix some static analysis issues about: - uninitialized values, most of which are false positives, always initialized before being accessed - unchecked return values - dead code never executed - bad formatting leading to wrong behavior Please ensure EventMap is never used with event id set to 0 or those events will never execute. --- src/server/collision/Models/GameObjectModel.h | 2 +- src/server/game/Entities/Unit/Unit.cpp | 6 ++---- src/server/game/Spells/Spell.cpp | 1 + .../EasternKingdoms/AlteracValley/boss_balinda.cpp | 7 ++++++- .../BlackrockSpire/boss_rend_blackhand.cpp | 7 ++++++- .../BlackwingLair/instance_blackwing_lair.cpp | 22 ++++++++++++++++++++++ .../ScarletMonastery/boss_headless_horseman.cpp | 6 +++++- .../BattleForMountHyjal/boss_anetheron.cpp | 2 ++ .../BattleForMountHyjal/boss_azgalor.cpp | 3 +++ .../Kalimdor/RazorfenKraul/razorfen_kraul.cpp | 6 +++++- .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 14 ++++++++++++++ .../Northrend/Nexus/Oculus/instance_oculus.cpp | 2 ++ .../Mechanar/boss_gatewatcher_ironhand.cpp | 6 +++--- src/server/scripts/Outland/zone_netherstorm.cpp | 10 +++++++++- src/server/shared/Database/AdhocStatement.cpp | 4 ++-- src/server/shared/Database/DatabaseWorkerPool.h | 3 +-- src/server/shared/Database/QueryHolder.cpp | 3 +-- 17 files changed, 85 insertions(+), 19 deletions(-) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/collision/Models/GameObjectModel.h b/src/server/collision/Models/GameObjectModel.h index 06a74cc6eb0..a1c0942dab4 100644 --- a/src/server/collision/Models/GameObjectModel.h +++ b/src/server/collision/Models/GameObjectModel.h @@ -45,7 +45,7 @@ class GameObjectModel /*, public Intersectable*/ float iScale; VMAP::WorldModel* iModel; - GameObjectModel() : phasemask(0), iModel(NULL) { } + GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(NULL) { } bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info); public: diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index e77c0507d26..c9c3a511d97 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1286,10 +1286,8 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam damageInfo->HitInfo |= HITINFO_AFFECTS_VICTIM; int32 resilienceReduction = damageInfo->damage; - if (attackType != RANGED_ATTACK) - ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE); - else - ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_RANGED); + // attackType is checked already for BASE_ATTACK or OFF_ATTACK so it can't be RANGED_ATTACK here + ApplyResilience(victim, NULL, &resilienceReduction, (damageInfo->hitOutCome == MELEE_HIT_CRIT), CR_CRIT_TAKEN_MELEE); resilienceReduction = damageInfo->damage - resilienceReduction; damageInfo->damage -= resilienceReduction; damageInfo->cleanDamage += resilienceReduction; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 8b88ec9af92..e215d2fc90f 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5120,6 +5120,7 @@ SpellCastResult Spell::CheckCast(bool strict) case SUMMON_CATEGORY_PET: if (m_caster->GetPetGUID()) return SPELL_FAILED_ALREADY_HAVE_SUMMON; + // intentional missing break, check both GetPetGUID() and GetCharmGUID for SUMMON_CATEGORY_PET case SUMMON_CATEGORY_PUPPET: if (m_caster->GetCharmGUID()) return SPELL_FAILED_ALREADY_HAVE_CHARM; diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index ab135a2fd78..0b031f54ea0 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -50,7 +50,12 @@ public: struct npc_water_elementalAI : public ScriptedAI { - npc_water_elementalAI(Creature* creature) : ScriptedAI(creature) { } + npc_water_elementalAI(Creature* creature) : ScriptedAI(creature) + { + waterBoltTimer = 3 * IN_MILLISECONDS; + resetTimer = 5 * IN_MILLISECONDS; + balindaGUID = 0; + } uint32 waterBoltTimer; uint64 balindaGUID; diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp index 8989a8065dc..0cb96a519e7 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/boss_rend_blackhand.cpp @@ -164,7 +164,12 @@ public: struct boss_rend_blackhandAI : public BossAI { - boss_rend_blackhandAI(Creature* creature) : BossAI(creature, DATA_WARCHIEF_REND_BLACKHAND) { } + boss_rend_blackhandAI(Creature* creature) : BossAI(creature, DATA_WARCHIEF_REND_BLACKHAND) + { + gythEvent = false; + victorGUID = 0; + portcullisGUID = 0; + } void Reset() OVERRIDE { diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp index 39d2a6d87d5..560f2e2e995 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/instance_blackwing_lair.cpp @@ -56,6 +56,28 @@ public: { instance_blackwing_lair_InstanceMapScript(Map* map) : InstanceScript(map) { + // Razorgore + EggCount = 0; + EggEvent = 0; + RazorgoreTheUntamedGUID = 0; + RazorgoreDoorGUID = 0; + // Vaelastrasz the Corrupt + VaelastraszTheCorruptGUID = 0; + VaelastraszDoorGUID = 0; + // Broodlord Lashlayer + BroodlordLashlayerGUID = 0; + BroodlordDoorGUID = 0; + // 3 Dragons + FiremawGUID = 0; + EbonrocGUID = 0; + FlamegorGUID = 0; + ChrommagusDoorGUID = 0; + // Chormaggus + ChromaggusGUID = 0; + NefarianDoorGUID = 0; + // Nefarian + LordVictorNefariusGUID = 0; + NefarianGUID = 0; SetBossNumber(EncounterCount); } diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 31219e18121..ad87b2d8d3d 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -787,7 +787,11 @@ public: struct npc_pulsing_pumpkinAI : public ScriptedAI { - npc_pulsing_pumpkinAI(Creature* creature) : ScriptedAI(creature) { } + npc_pulsing_pumpkinAI(Creature* creature) : ScriptedAI(creature) + { + sprouted = false; + debuffGUID = 0; + } bool sprouted; uint64 debuffGUID; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index c7803f23e1b..e5ddcd1c2ef 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -185,6 +185,8 @@ public: { npc_towering_infernalAI(Creature* creature) : ScriptedAI(creature) { + ImmolationTimer = 5000; + CheckTimer = 5000; instance = creature->GetInstanceScript(); AnetheronGUID = instance->GetData64(DATA_ANETHERON); } diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 4decce7482f..16002b59f1a 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -191,6 +191,9 @@ public: { npc_lesser_doomguardAI(Creature* creature) : hyjal_trashAI(creature) { + CrippleTimer = 50000; + WarstompTimer = 10000; + CheckTimer = 5000; instance = creature->GetInstanceScript(); AzgalorGUID = instance->GetData64(DATA_AZGALOR); } diff --git a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp index f04b71d1da9..1dc37e063ba 100644 --- a/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp +++ b/src/server/scripts/Kalimdor/RazorfenKraul/razorfen_kraul.cpp @@ -171,7 +171,11 @@ public: struct npc_snufflenose_gopherAI : public PetAI { - npc_snufflenose_gopherAI(Creature* creature) : PetAI(creature) { } + npc_snufflenose_gopherAI(Creature* creature) : PetAI(creature) + { + IsMovementActive = false; + TargetTubberGUID = 0; + } void Reset() OVERRIDE { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 9e3244cccdb..988436066b6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -898,6 +898,9 @@ public: { eye_tentacleAI(Creature* creature) : ScriptedAI(creature) { + MindflayTimer = 500; + KillSelfTimer = 35000; + Portal = 0; if (Creature* pPortal = me->SummonCreature(NPC_SMALL_PORTAL, *me, TEMPSUMMON_CORPSE_DESPAWN)) { @@ -974,6 +977,10 @@ public: { claw_tentacleAI(Creature* creature) : ScriptedAI(creature) { + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + SetCombatMovement(false); Portal = 0; @@ -1085,6 +1092,11 @@ public: { giant_claw_tentacleAI(Creature* creature) : ScriptedAI(creature) { + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + SetCombatMovement(false); Portal = 0; @@ -1205,6 +1217,8 @@ public: { giant_eye_tentacleAI(Creature* creature) : ScriptedAI(creature) { + BeamTimer = 500; + SetCombatMovement(false); Portal = 0; diff --git a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp index 2c809b17367..39dec9999cc 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/instance_oculus.cpp @@ -208,9 +208,11 @@ class instance_oculus : public InstanceMapScript break; case DATA_VAROS: if (state == DONE) + { DoUpdateWorldState(WORLD_STATE_CENTRIFUGE_CONSTRUCT_SHOW, 0); if (Creature* urom = instance->GetCreature(UromGUID)) urom->SetPhaseMask(1, true); + } break; case DATA_UROM: if (state == DONE) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index e34e4ebdb23..09eb261282f 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -48,9 +48,9 @@ enum Spells enum Events { - EVENT_STREAM_OF_MACHINE_FLUID = 0, - EVENT_JACKHAMMER = 1, - EVENT_SHADOW_POWER = 2 + EVENT_STREAM_OF_MACHINE_FLUID = 1, + EVENT_JACKHAMMER = 2, + EVENT_SHADOW_POWER = 3 }; class boss_gatewatcher_iron_hand : public CreatureScript diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 72e7332381b..8542b32d631 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -728,7 +728,15 @@ public: struct npc_phase_hunterAI : public ScriptedAI { - npc_phase_hunterAI(Creature* creature) : ScriptedAI(creature) { } + npc_phase_hunterAI(Creature* creature) : ScriptedAI(creature) + { + Weak = false; + Materialize = false; + Drained = false; + WeakPercent = 25; + PlayerGUID = 0; + ManaBurnTimer = 5000; + } bool Weak; bool Materialize; diff --git a/src/server/shared/Database/AdhocStatement.cpp b/src/server/shared/Database/AdhocStatement.cpp index 15732f20849..896fefde5b7 100644 --- a/src/server/shared/Database/AdhocStatement.cpp +++ b/src/server/shared/Database/AdhocStatement.cpp @@ -42,13 +42,13 @@ bool BasicStatementTask::Execute() if (m_has_result) { ResultSet* result = m_conn->Query(m_sql); - if (!result || !result->GetRowCount()) + if (!result || !result->GetRowCount() || !result->NextRow()) { delete result; m_result.set(QueryResult(NULL)); return false; } - result->NextRow(); + m_result.set(QueryResult(result)); return true; } diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 6c2e961d2ad..e2ebda9e8ae 100644 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -232,13 +232,12 @@ class DatabaseWorkerPool ResultSet* result = conn->Query(sql); conn->Unlock(); - if (!result || !result->GetRowCount()) + if (!result || !result->GetRowCount() || !result->NextRow()) { delete result; return QueryResult(NULL); } - result->NextRow(); return QueryResult(result); } diff --git a/src/server/shared/Database/QueryHolder.cpp b/src/server/shared/Database/QueryHolder.cpp index 0c80f70acd2..7b4105ee076 100644 --- a/src/server/shared/Database/QueryHolder.cpp +++ b/src/server/shared/Database/QueryHolder.cpp @@ -89,10 +89,9 @@ QueryResult SQLQueryHolder::GetResult(size_t index) if (index < m_queries.size()) { ResultSet* result = m_queries[index].second.qresult; - if (!result || !result->GetRowCount()) + if (!result || !result->GetRowCount() || !result->NextRow()) return QueryResult(NULL); - result->NextRow(); return QueryResult(result); } else -- cgit v1.2.3 From d9d088421d1ffdc29445c59ccaac520550f06c0c Mon Sep 17 00:00:00 2001 From: MitchesD Date: Sat, 22 Mar 2014 22:30:20 +0100 Subject: Scripts/ZulAman/Halazzi: convert text to create_text and fixed despawn of cat --- .../world/2014_03_22_02_world_creature_text.sql | 12 +++ .../EasternKingdoms/ZulAman/boss_halazzi.cpp | 99 +++++++--------------- 2 files changed, 43 insertions(+), 68 deletions(-) create mode 100644 sql/updates/world/2014_03_22_02_world_creature_text.sql (limited to 'src/server/scripts/EasternKingdoms') diff --git a/sql/updates/world/2014_03_22_02_world_creature_text.sql b/sql/updates/world/2014_03_22_02_world_creature_text.sql new file mode 100644 index 00000000000..89014367a71 --- /dev/null +++ b/sql/updates/world/2014_03_22_02_world_creature_text.sql @@ -0,0 +1,12 @@ +SET @ENTRY := 23557; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@ENTRY, 0, 0, "Get on your knees and bow to da fang and claw!", 14, 0, 100, 0, 0, 12020, "Halazzi - Aggro"), +(@ENTRY, 1, 0, "You gonna leave in pieces!", 14, 0, 100, 0, 0, 0, "Halazzi - Saber"), +(@ENTRY, 1, 1, "Me gonna carve ya now!", 14, 0, 100, 0, 0, 0, "Halazzi - Saber"), +(@ENTRY, 2, 0, "Me gonna carve ya now!", 14, 0, 100, 0, 0, 12021, "Halazzi - Split"), +(@ENTRY, 3, 0, "Spirit, come back to me!", 14, 0, 100, 0, 0, 12022, "Halazzi - Merge"), +(@ENTRY, 4, 0, "You cant fight the power!", 14, 0, 100, 0, 0, 12026, "Halazzi - Killed unit"), +(@ENTRY, 4, 1, "You gonna fail!", 14, 0, 100, 0, 0, 12027, "Halazzi - Killed unit"), +(@ENTRY, 5, 0, "Chaga... choka'jinn.", 14, 0, 100, 0, 0, 12028, "Halazzi - Death"), +(@ENTRY, 6, 0, "Whatch you be doing? Pissin' yourselves...", 14, 0, 100, 0, 0, 12025, "Halazzi - Death"); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp index 4e354b47be5..0c8eb663c9a 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp @@ -16,35 +16,11 @@ * with this program. If not, see . */ -/* ScriptData -SDName: boss_Halazzi -SD%Complete: 80 -SDComment: -SDCategory: Zul'Aman -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "zulaman.h" #include "SpellInfo.h" -#define YELL_AGGRO "Get on your knees and bow to da fang and claw!" -#define SOUND_AGGRO 12020 -#define YELL_SABER_ONE "You gonna leave in pieces!" -#define YELL_SABER_TWO "Me gonna carve ya now!" -#define YELL_SPLIT "Me gonna carve ya now!" -#define SOUND_SPLIT 12021 -#define YELL_MERGE "Spirit, come back to me!" -#define SOUND_MERGE 12022 -#define YELL_KILL_ONE "You cant fight the power!" -#define SOUND_KILL_ONE 12026 -#define YELL_KILL_TWO "You gonna fail!" -#define SOUND_KILL_TWO 12027 -#define YELL_DEATH "Chaga... choka'jinn." -#define SOUND_DEATH 12028 -#define YELL_BERSERK "Whatch you be doing? Pissin' yourselves..." -#define SOUND_BERSERK 12025 - enum Spells { SPELL_DUAL_WIELD = 29651, @@ -78,23 +54,32 @@ enum PhaseHalazzi PHASE_ENRAGE = 5 }; +enum Yells +{ + SAY_AGGRO = 0, + SAY_SABER = 1, + SAY_SPLIT = 2, + SAY_MERGE = 3, + SAY_KILL = 4, + SAY_DEATH = 5, + SAY_BERSERK = 6 +}; + class boss_halazzi : public CreatureScript { public: - - boss_halazzi() - : CreatureScript("boss_halazzi") - { - } + boss_halazzi() : CreatureScript("boss_halazzi") { } struct boss_halazziAI : public ScriptedAI { - boss_halazziAI(Creature* creature) : ScriptedAI(creature) + boss_halazziAI(Creature* creature) : ScriptedAI(creature), summons(me) { instance = creature->GetInstanceScript(); } InstanceScript* instance; + SummonList summons; + PhaseHalazzi Phase; uint32 FrenzyTimer; uint32 SaberlashTimer; @@ -102,16 +87,14 @@ class boss_halazzi : public CreatureScript uint32 TotemTimer; uint32 CheckTimer; uint32 BerserkTimer; - uint32 TransformCount; - PhaseHalazzi Phase; - uint64 LynxGUID; void Reset() OVERRIDE { instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED); + summons.DespawnAll(); LynxGUID = 0; TransformCount = 0; @@ -127,10 +110,7 @@ class boss_halazzi : public CreatureScript void EnterCombat(Unit* /*who*/) OVERRIDE { instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); - - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_AGGRO); - + Talk(SAY_AGGRO); EnterPhase(PHASE_LYNX); } @@ -139,6 +119,7 @@ class boss_halazzi : public CreatureScript summon->AI()->AttackStart(me->GetVictim()); if (summon->GetEntry() == NPC_SPIRIT_LYNX) LynxGUID = summon->GetGUID(); + summons.Summon(summon); } void DamageTaken(Unit* /*done_by*/, uint32 &damage) OVERRIDE @@ -155,7 +136,8 @@ class boss_halazzi : public CreatureScript void AttackStart(Unit* who) OVERRIDE { - if (Phase != PHASE_MERGE) ScriptedAI::AttackStart(who); + if (Phase != PHASE_MERGE) + ScriptedAI::AttackStart(who); } void EnterPhase(PhaseHalazzi NextPhase) @@ -180,8 +162,7 @@ class boss_halazzi : public CreatureScript TotemTimer = 12000; break; case PHASE_SPLIT: - me->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_SPLIT); + Talk(SAY_SPLIT); DoCast(me, SPELL_TRANSFORM_SPLIT, true); break; case PHASE_HUMAN: @@ -195,8 +176,7 @@ class boss_halazzi : public CreatureScript case PHASE_MERGE: if (Unit* pLynx = Unit::GetUnit(*me, LynxGUID)) { - me->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_MERGE); + Talk(SAY_MERGE); pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); pLynx->GetMotionMaster()->Clear(); pLynx->GetMotionMaster()->MoveFollow(me, 0, 0); @@ -211,15 +191,14 @@ class boss_halazzi : public CreatureScript Phase = NextPhase; } - void UpdateAI(uint32 diff) OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { if (!UpdateVictim()) return; if (BerserkTimer <= diff) { - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_BERSERK); + Talk(SAY_BERSERK); DoCast(me, SPELL_BERSERK, true); BerserkTimer = 60000; } else BerserkTimer -= diff; @@ -313,28 +292,18 @@ class boss_halazzi : public CreatureScript DoMeleeAttackIfReady(); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* victim) OVERRIDE { - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL_ONE); - break; - - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_KILL_TWO); - break; - } + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) OVERRIDE { instance->SetData(DATA_HALAZZIEVENT, DONE); - - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(me, SOUND_DEATH); + Talk(SAY_DEATH); } }; @@ -348,11 +317,7 @@ class boss_halazzi : public CreatureScript class npc_halazzi_lynx : public CreatureScript { public: - - npc_halazzi_lynx() - : CreatureScript("npc_halazzi_lynx") - { - } + npc_halazzi_lynx() : CreatureScript("npc_halazzi_lynx") { } struct npc_halazzi_lynxAI : public ScriptedAI { @@ -414,5 +379,3 @@ void AddSC_boss_halazzi() new boss_halazzi(); new npc_halazzi_lynx(); } - - -- cgit v1.2.3 From 8c44259fae2980598980a7935a3f3941130a5a10 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Thu, 27 Mar 2014 21:43:59 +0100 Subject: Core/Misc: Fix some static analysis issues Fix uninitialized values, most of which are false positives, always initialized before being accessed. Add some asserts and additional NULL checks as sanity checks. Use SpellMgr::EnsureSpellInfo() if the spell id is valid and always supposed to return a valid not-NULL SpellInfo* . --- src/server/game/AI/SmartScripts/SmartScript.cpp | 2 +- src/server/game/Conditions/ConditionMgr.cpp | 3 +-- src/server/game/Entities/Object/Object.cpp | 4 ++++ src/server/game/Entities/Pet/Pet.cpp | 3 +-- src/server/game/Entities/Player/Player.cpp | 3 +-- src/server/game/Entities/Unit/StatSystem.cpp | 4 ++-- src/server/game/Globals/ObjectMgr.cpp | 1 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 4 ++-- src/server/game/Spells/SpellEffects.cpp | 2 +- src/server/game/Spells/SpellMgr.h | 8 ++++++++ src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp | 11 +++++++---- src/server/scripts/Kalimdor/zone_silithus.cpp | 6 +++--- .../Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 2 +- .../IcecrownCitadel/boss_icecrown_gunship_battle.cpp | 8 +++++++- .../TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp | 7 ++++++- .../TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp | 7 ++++++- src/server/scripts/Spells/spell_dk.cpp | 4 ++-- src/server/scripts/Spells/spell_generic.cpp | 4 ++-- src/server/scripts/Spells/spell_mage.cpp | 4 ++-- src/server/scripts/Spells/spell_pet.cpp | 8 +++----- src/server/scripts/Spells/spell_priest.cpp | 3 +-- src/server/scripts/Spells/spell_rogue.cpp | 3 +-- src/server/scripts/Spells/spell_warlock.cpp | 6 ++---- src/server/scripts/Spells/spell_warrior.cpp | 3 +-- 24 files changed, 66 insertions(+), 44 deletions(-) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 6d6b43f7d2e..231f3808aa9 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -512,7 +512,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u // unless target is outside spell range, out of mana, or LOS. bool _allowMove = false; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(e.action.cast.spell); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(e.action.cast.spell); int32 mana = me->GetPower(POWER_MANA); if (me->GetDistance(*itr) > spellInfo->GetMaxRange(true) || diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index c3ef88fef05..bb1a722ec42 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -1078,8 +1078,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond) bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond) { uint32 conditionEffMask = cond->SourceGroup; - SpellInfo* spellInfo = const_cast(sSpellMgr->GetSpellInfo(cond->SourceEntry)); - ASSERT(spellInfo); + SpellInfo* spellInfo = const_cast(sSpellMgr->EnsureSpellInfo(cond->SourceEntry)); std::list sharedMasks; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 944498d0fed..12c8d0ba2ac 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -413,6 +413,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const // 0x40 if (flags & UPDATEFLAG_STATIONARY_POSITION) { + ASSERT(object); *data << object->GetStationaryX(); *data << object->GetStationaryY(); *data << object->GetStationaryZ(); @@ -486,6 +487,9 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const if (flags & UPDATEFLAG_VEHICLE) { /// @todo Allow players to aquire this updateflag. + ASSERT(unit); + ASSERT(unit->GetVehicleKit()); + ASSERT(unit->GetVehicleKit()->GetVehicleInfo()); *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID); if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) *data << float(unit->GetTransOffsetO()); diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 1d7db005a0b..19ac8dd57b5 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -2060,8 +2060,7 @@ void Pet::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs) continue; uint32 unSpellId = itr->first; - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(unSpellId); - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(unSpellId); // Not send cooldown for this spells if (spellInfo->IsCooldownStartedOnEvent()) diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d96439748e0..eb9392f0401 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -4204,8 +4204,7 @@ bool Player::Has310Flyer(bool checkAllSpells, uint32 excludeSpellId) if (_spell_idx->second->skillId != SKILL_MOUNTS) break; // We can break because mount spells belong only to one skillline (at least 310 flyers do) - spellInfo = sSpellMgr->GetSpellInfo(itr->first); - ASSERT(spellInfo); + spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED && spellInfo->Effects[i].CalcValue() == 310) diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 3afa6b016d2..04136221d0d 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1149,7 +1149,7 @@ bool Guardian::UpdateStats(Stats stat) if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue()); } } @@ -1318,7 +1318,7 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) if (itr != ToPet()->m_spells.end()) // If pet has Wild Hunt { - SpellInfo const* sProto = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + SpellInfo const* sProto = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value mod += CalculatePct(1.0f, sProto->Effects[1].CalcValue()); } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 2a3a79905fb..8784e2ca4e7 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1442,6 +1442,7 @@ bool ObjectMgr::SetCreatureLinkedRespawn(uint32 guidLow, uint32 linkedGuidLow) return false; const CreatureData* master = GetCreatureData(guidLow); + ASSERT(master); uint64 guid = MAKE_NEW_GUID(guidLow, master->id, HIGHGUID_UNIT); if (!linkedGuidLow) // we're removing the linking diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index b7aabcc7589..4ed742167a5 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -4772,7 +4772,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool uint32 spellId = 24659; if (apply && caster) { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId); + SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(spellId); for (uint32 i = 0; i < spell->StackAmount; ++i) caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID()); @@ -4787,7 +4787,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool uint32 spellId = 24662; if (apply && caster) { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId); + SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(spellId); for (uint32 i = 0; i < spell->StackAmount; ++i) caster->CastSpell(target, spell->Id, true, NULL, NULL, GetCasterGUID()); break; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 73d3c39148a..609c9ba05be 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1829,7 +1829,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs); for (std::set::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end();) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(*itr); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(*itr); if (spellInfo->SpellLevel < m_spellInfo->SpellLevel || spellInfo->SpellLevel > unitTarget->getLevel()) avalibleElixirs.erase(itr++); else if (sSpellMgr->IsSpellMemberOfSpellGroup(*itr, SPELL_GROUP_ELIXIR_SHATTRATH)) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 01fe7708db2..76d59bd1e85 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -690,6 +690,14 @@ class SpellMgr // SpellInfo object management SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; } + // Use this only with 100% valid spellIds + SpellInfo const* EnsureSpellInfo(uint32 spellId) const + { + ASSERT(spellId < GetSpellInfoStoreSize()); + SpellInfo const* spellInfo = mSpellInfoMap[spellId]; + ASSERT(spellInfo); + return spellInfo; + } uint32 GetSpellInfoStoreSize() const { return mSpellInfoMap.size(); } private: diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 241ac85faa2..b5c3bdd86d4 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -584,10 +584,13 @@ public: arca->MonsterYell(SAY_DIALOG_ARCANAGOS_8, LANG_UNIVERSAL, NULL); return 5000; case 12: - arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f); - arca->setActive(true); - arca->InterruptNonMeleeSpells(true); - arca->SetSpeed(MOVE_FLIGHT, 2.0f); + if (arca) + { + arca->GetMotionMaster()->MovePoint(0, -11010.82f, -1761.18f, 156.47f); + arca->setActive(true); + arca->InterruptNonMeleeSpells(true); + arca->SetSpeed(MOVE_FLIGHT, 2.0f); + } return 10000; case 13: me->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index b002bbe8a48..24d557222eb 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -649,11 +649,11 @@ public: Unit* mob = NULL; for (uint8 i = 0; i < 4; ++i) { - mob = player->FindNearestCreature(entries[i], 50, me); + mob = player->FindNearestCreature(entries[i], 50); while (mob) { mob->RemoveFromWorld(); - mob = player->FindNearestCreature(15423, 50, me); + mob = player->FindNearestCreature(15423, 50); } } break; @@ -1021,7 +1021,7 @@ public: { if (quest->GetQuestId() == QUEST_A_PAWN_ON_THE_ETERNAL_BOARD) { - if (Creature* trigger = go->FindNearestCreature(15454, 100, player)) + if (Creature* trigger = go->FindNearestCreature(15454, 100)) { Unit* Merithra = trigger->SummonCreature(15378, -8034.535f, 1535.14f, 2.61f, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); Unit* Caelestrasz = trigger->SummonCreature(15379, -8032.767f, 1533.148f, 2.61f, 1.5f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 220000); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 3d4ee279685..bbf3e8afc0f 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -800,7 +800,7 @@ class spell_blood_queen_pact_of_the_darkfallen_dmg : public SpellScriptLoader // this is an additional effect to be executed void PeriodicTick(AuraEffect const* aurEff) { - SpellInfo const* damageSpell = sSpellMgr->GetSpellInfo(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE); + SpellInfo const* damageSpell = sSpellMgr->EnsureSpellInfo(SPELL_PACT_OF_THE_DARKFALLEN_DAMAGE); int32 damage = damageSpell->Effects[EFFECT_0].CalcValue(); float multiplier = 0.3375f + 0.1f * uint32(aurEff->GetTickNumber()/10); // do not convert to 0.01f - we need tick number/10 as INT (damage increases every 10 ticks) damage = int32(damage * multiplier); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 4b938253584..0a9e207db36 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -849,6 +849,9 @@ class npc_high_overlord_saurfang_igb : public CreatureScript _controller.SetTransport(creature->GetTransport()); me->setRegeneratingHealth(false); me->m_CombatDistance = 70.0f; + _firstMageCooldown = time(NULL) + 60; + _axethrowersYellCooldown = time_t(0); + _rocketeersYellCooldown = time_t(0); } void InitializeAI() OVERRIDE @@ -1115,6 +1118,9 @@ class npc_muradin_bronzebeard_igb : public CreatureScript _controller.SetTransport(creature->GetTransport()); me->setRegeneratingHealth(false); me->m_CombatDistance = 70.0f; + _firstMageCooldown = time(NULL) + 60; + _riflemanYellCooldown = time_t(0); + _mortarYellCooldown = time_t(0); } void InitializeAI() OVERRIDE @@ -1837,7 +1843,7 @@ class spell_igb_rocket_pack : public SpellScriptLoader void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) { - SpellInfo const* damageInfo = sSpellMgr->GetSpellInfo(SPELL_ROCKET_PACK_DAMAGE); + SpellInfo const* damageInfo = sSpellMgr->EnsureSpellInfo(SPELL_ROCKET_PACK_DAMAGE); GetTarget()->CastCustomSpell(SPELL_ROCKET_PACK_DAMAGE, SPELLVALUE_BASE_POINT0, 2 * (damageInfo->Effects[EFFECT_0].CalcValue() + aurEff->GetTickNumber() * aurEff->GetAmplitude()), NULL, TRIGGERED_FULL_MASK); GetTarget()->CastSpell(NULL, SPELL_ROCKET_BURST, TRIGGERED_FULL_MASK); } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp index bfc304e6a99..18388341a36 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp @@ -59,11 +59,16 @@ class boss_dalliah_the_doomsayer : public CreatureScript struct boss_dalliah_the_doomsayerAI : public BossAI { - boss_dalliah_the_doomsayerAI(Creature* creature) : BossAI(creature, DATA_DALLIAH) { } + boss_dalliah_the_doomsayerAI(Creature* creature) : BossAI(creature, DATA_DALLIAH) + { + soccothratesTaunt = false; + soccothratesDeath = false; + } void Reset() OVERRIDE { _Reset(); + soccothratesTaunt = false; soccothratesDeath = false; } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp index 044be4c1534..6c96708c69d 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp @@ -82,7 +82,12 @@ class boss_wrath_scryer_soccothrates : public CreatureScript struct boss_wrath_scryer_soccothratesAI : public BossAI { - boss_wrath_scryer_soccothratesAI(Creature* creature) : BossAI(creature, DATA_SOCCOTHRATES) { } + boss_wrath_scryer_soccothratesAI(Creature* creature) : BossAI(creature, DATA_SOCCOTHRATES) + { + preFight = false; + dalliahTaunt = false; + dalliahDeath = false; + } void Reset() OVERRIDE { diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index e8108f03e7d..c100630a452 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -197,7 +197,7 @@ class spell_dk_anti_magic_zone : public SpellScriptLoader void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/) { - SpellInfo const* talentSpell = sSpellMgr->GetSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT); + SpellInfo const* talentSpell = sSpellMgr->EnsureSpellInfo(SPELL_DK_ANTI_MAGIC_SHELL_TALENT); amount = talentSpell->Effects[EFFECT_0].CalcValue(GetCaster()); if (Player* player = GetCaster()->ToPlayer()) amount += int32(2 * player->GetTotalAttackPowerValue(BASE_ATTACK)); @@ -1424,7 +1424,7 @@ class spell_dk_will_of_the_necropolis : public SpellScriptLoader { // min pct of hp is stored in effect 0 of talent spell uint8 rank = GetSpellInfo()->GetRank(); - SpellInfo const* talentProto = sSpellMgr->GetSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); + SpellInfo const* talentProto = sSpellMgr->EnsureSpellInfo(sSpellMgr->GetSpellWithRank(SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank)); int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage()); int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(talentProto->Effects[EFFECT_0].CalcValue(GetCaster()))); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 9a81582b0b9..68c16a1b2d6 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1192,7 +1192,7 @@ class spell_gen_defend : public SpellScriptLoader void Register() OVERRIDE { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); + SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(m_scriptSpellId); // Defend spells cast by NPCs (add visuals) if (spell->Effects[EFFECT_0].ApplyAuraName == SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN) @@ -2178,7 +2178,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader void Register() OVERRIDE { - SpellInfo const* spell = sSpellMgr->GetSpellInfo(m_scriptSpellId); + SpellInfo const* spell = sSpellMgr->EnsureSpellInfo(m_scriptSpellId); if (spell->HasEffect(SPELL_EFFECT_SCRIPT_EFFECT)) OnEffectHitTarget += SpellEffectFn(spell_gen_mounted_charge_SpellScript::HandleScriptEffect, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index ba59f701445..5f03c64eaf1 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -176,7 +176,7 @@ class spell_mage_cold_snap : public SpellScriptLoader const SpellCooldowns& cm = caster->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); if (spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (spellInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && @@ -388,7 +388,7 @@ class spell_mage_ignite : public SpellScriptLoader { PreventDefaultAction(); - SpellInfo const* igniteDot = sSpellMgr->GetSpellInfo(SPELL_MAGE_IGNITE); + SpellInfo const* igniteDot = sSpellMgr->EnsureSpellInfo(SPELL_MAGE_IGNITE); int32 pct = 8 * GetSpellInfo()->GetRank(); int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp index e50bc681352..491bb7100b2 100644 --- a/src/server/scripts/Spells/spell_pet.cpp +++ b/src/server/scripts/Spells/spell_pet.cpp @@ -897,7 +897,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value AddPct(mod, spellInfo->Effects[EFFECT_0].CalcValue()); } @@ -940,8 +940,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); } @@ -971,8 +970,7 @@ public: if (itr != pet->ToPet()->m_spells.end()) // If pet has Wild Hunt { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); // Then get the SpellProto and add the dummy effect value mod += CalculatePct(1.0f, spellInfo->Effects[EFFECT_1].CalcValue()); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 03d5cbc3f06..f12a57aa2ec 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -236,8 +236,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader { PreventDefaultAction(); - SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL); - ASSERT(triggeredSpellInfo); + SpellInfo const* triggeredSpellInfo = sSpellMgr->EnsureSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL); int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks()); GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 1773805b671..4c1a4d096b9 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -428,8 +428,7 @@ class spell_rog_preparation : public SpellScriptLoader const SpellCooldowns& cm = caster->GetSpellCooldownMap(); for (SpellCooldowns::const_iterator itr = cm.begin(); itr != cm.end();) { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first); - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(itr->first); if (spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE) { diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index b538d296c3d..0e3ada5d119 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -270,8 +270,7 @@ class spell_warl_demonic_circle_summon : public SpellScriptLoader // WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST; allowing him to cast the WARLOCK_DEMONIC_CIRCLE_TELEPORT. // If not in range remove the WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST. - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT); - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARLOCK_DEMONIC_CIRCLE_TELEPORT); if (GetTarget()->IsWithinDist(circle, spellInfo->GetMaxRange(true))) { @@ -362,8 +361,7 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader break; case CREATURE_FAMILY_VOIDWALKER: { - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER); int32 hp = int32(targetCreature->CountPctFromMaxHealth(GetCaster()->CalculateSpellDamage(targetCreature, spellInfo, 0))); targetCreature->CastCustomSpell(targetCreature, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER, &hp, NULL, NULL, true); //unitTarget->CastSpell(unitTarget, 54441, true); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index d309051114c..d0ba39e8b09 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -273,8 +273,7 @@ class spell_warr_deep_wounds : public SpellScriptLoader damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE); - SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC); - ASSERT(spellInfo); + SpellInfo const* spellInfo = sSpellMgr->EnsureSpellInfo(SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC); uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude; // Add remaining ticks to damage done -- cgit v1.2.3 From 0b615ec159eb5cb969bac92206d059c529642d8f Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sat, 29 Mar 2014 20:58:25 +0100 Subject: Scripts/Misc: Small code optimizations --- .../BlackwingLair/boss_nefarian.cpp | 2 +- .../MoltenCore/boss_majordomo_executus.cpp | 2 +- .../SunwellPlateau/boss_kalecgos.cpp | 4 ++-- .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 2 +- .../scripts/EasternKingdoms/zone_ghostlands.cpp | 2 +- src/server/scripts/Events/childrens_week.cpp | 2 +- src/server/scripts/Kalimdor/zone_darkshore.cpp | 2 +- src/server/scripts/Kalimdor/zone_silithus.cpp | 4 ++-- .../TrialOfTheChampion/trial_of_the_champion.cpp | 4 ++-- .../Northrend/DraktharonKeep/boss_novos.cpp | 2 +- .../HallsOfReflection/halls_of_reflection.cpp | 24 +++++++++++----------- .../IcecrownCitadel/boss_lady_deathwhisper.cpp | 2 +- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 4 ++-- .../Northrend/Nexus/Nexus/boss_magus_telestra.cpp | 6 +++--- .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 6 +++--- .../scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 2 +- .../scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp | 2 +- .../Northrend/Ulduar/Ulduar/boss_razorscale.cpp | 4 ++-- .../UtgardeKeep/UtgardePinnacle/boss_skadi.cpp | 2 +- .../scripts/Northrend/VioletHold/boss_zuramat.cpp | 2 +- .../scripts/Northrend/zone_borean_tundra.cpp | 2 +- .../scripts/Northrend/zone_howling_fjord.cpp | 4 ++-- src/server/scripts/Northrend/zone_icecrown.cpp | 2 +- .../scripts/Northrend/zone_sholazar_basin.cpp | 6 +++--- src/server/scripts/Northrend/zone_storm_peaks.cpp | 4 ++-- .../scripts/Outland/BlackTemple/black_temple.cpp | 4 ++-- .../Outland/BlackTemple/boss_teron_gorefiend.cpp | 2 +- .../BloodFurnace/boss_kelidan_the_breaker.cpp | 2 +- .../HellfireRamparts/boss_vazruden_the_herald.cpp | 2 +- .../scripts/Outland/TempestKeep/Eye/boss_alar.cpp | 2 +- 30 files changed, 55 insertions(+), 55 deletions(-) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 02662cd235c..fd56bf98274 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -342,7 +342,7 @@ public: nefarian->setActive(true); nefarian->SetCanFly(true); nefarian->SetDisableGravity(true); - nefarian->AI()->DoCastAOE(SPELL_SHADOWFLAME_INITIAL); + nefarian->CastSpell((Unit*)NULL, SPELL_SHADOWFLAME_INITIAL); nefarian->GetMotionMaster()->MovePoint(1, NefarianLoc[1]); } events.CancelEvent(EVENT_MIND_CONTROL); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp index d2bd82447dc..653992cacdf 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -107,7 +107,7 @@ class boss_majordomo : public CreatureScript { instance->UpdateEncounterState(ENCOUNTER_CREDIT_KILL_CREATURE, me->GetEntry(), me); me->setFaction(35); - me->AI()->EnterEvadeMode(); + EnterEvadeMode(); Talk(SAY_DEFEAT); _JustDied(); events.ScheduleEvent(EVENT_OUTRO_1, 32000); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 294443da0e7..46bd5bcbfdc 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -234,7 +234,7 @@ public: { if (me->GetDistance(CENTER_X, CENTER_Y, DRAGON_REALM_Z) >= 75) { - me->AI()->EnterEvadeMode(); + EnterEvadeMode(); return; } if (HealthBelowPct(10) && !isEnraged) @@ -733,7 +733,7 @@ public: Creature* Kalecgos = ObjectAccessor::GetCreature(*me, KalecgosGUID); if (Kalecgos && !Kalecgos->IsInCombat()) { - me->AI()->EnterEvadeMode(); + EnterEvadeMode(); return; } diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index dbdc0b8e5c7..9af8eeccc5c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -346,7 +346,7 @@ class boss_zuljin : public CreatureScript } } else - me->AI()->AttackStart(me->GetVictim()); + AttackStart(me->GetVictim()); if (NextPhase == 3) { me->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index a4f75ea23d4..86fb1677526 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -95,7 +95,7 @@ public: Summ1->Attack(me, true); Summ2->Attack(player, true); } - me->AI()->AttackStart(Summ1); + AttackStart(Summ1); } break; case 19: diff --git a/src/server/scripts/Events/childrens_week.cpp b/src/server/scripts/Events/childrens_week.cpp index 92e70cd028b..9a332fe335d 100644 --- a/src/server/scripts/Events/childrens_week.cpp +++ b/src/server/scripts/Events/childrens_week.cpp @@ -308,7 +308,7 @@ class npc_snowfall_glade_playmate : public CreatureScript break; case 4: orphan->AI()->Talk(TEXT_WOLVAR_ORPHAN_2); - orphan->AI()->DoCast(me, SPELL_SNOWBALL); + orphan->CastSpell(me, SPELL_SNOWBALL); timer = 5000; break; case 5: diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index ae98fbc4072..c19de7b8ab3 100644 --- a/src/server/scripts/Kalimdor/zone_darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -347,7 +347,7 @@ public: me->setFaction(FACTION_HOSTILE); if (Player* pHolder = GetLeaderForFollower()) - me->AI()->AttackStart(pHolder); + AttackStart(pHolder); SetFollowComplete(); } diff --git a/src/server/scripts/Kalimdor/zone_silithus.cpp b/src/server/scripts/Kalimdor/zone_silithus.cpp index 24d557222eb..ce5591ec5db 100644 --- a/src/server/scripts/Kalimdor/zone_silithus.cpp +++ b/src/server/scripts/Kalimdor/zone_silithus.cpp @@ -728,7 +728,7 @@ public: if (AnimationCount < 65) me->CombatStop(); if (AnimationCount == 65 || eventEnd) - me->AI()->EnterEvadeMode(); + EnterEvadeMode(); } }; @@ -830,7 +830,7 @@ public: } hasTarget = true; if (target) - me->AI()->AttackStart(target); + AttackStart(target); } if (!(me->FindNearestCreature(15379, 60))) DoCast(me, 33652); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index a60e69d6479..8b6cbb340e5 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -357,7 +357,7 @@ public: if (instance->GetData(BOSS_ARGENT_CHALLENGE_E) == NOT_STARTED && instance->GetData(BOSS_ARGENT_CHALLENGE_P) == NOT_STARTED) { if (instance->GetData(BOSS_GRAND_CHAMPIONS) == NOT_STARTED) - me->AI()->SetData(DATA_START, 0); + SetData(DATA_START, 0); if (instance->GetData(BOSS_GRAND_CHAMPIONS) == DONE) DoStartArgentChampionEncounter(); @@ -452,7 +452,7 @@ public: case VEHICLE_ORGRIMMAR_WOLF: case VEHICLE_SILVERMOON_HAWKSTRIDER: case VEHICLE_DARKSPEAR_RAPTOR: - me->AI()->SetData(DATA_LESSER_CHAMPIONS_DEFEATED, 0); + SetData(DATA_LESSER_CHAMPIONS_DEFEATED, 0); break; } } diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 09db3f89c26..f84f288d55a 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -231,7 +231,7 @@ public: if (Creature* crystalChannelTarget = crystal->FindNearestCreature(NPC_CRYSTAL_CHANNEL_TARGET, 5.0f)) { if (active) - crystalChannelTarget->AI()->DoCastAOE(SPELL_BEAM_CHANNEL); + crystalChannelTarget->CastSpell((Unit*)NULL, SPELL_BEAM_CHANNEL); else if (crystalChannelTarget->HasUnitState(UNIT_STATE_CASTING)) crystalChannelTarget->CastStop(); } diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index de14b930220..af459729eb8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -891,7 +891,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { lichking->AI()->Talk(SAY_LK_ESCAPE_3); - lichking->AI()->DoCast(me, SPELL_RAISE_DEAD); + lichking->CastSpell(me, SPELL_RAISE_DEAD); lichking->Attack(me, true); } _events.ScheduleEvent(EVENT_ESCAPE_13, 4000); @@ -899,15 +899,15 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript case EVENT_ESCAPE_13: if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { - lichking->AI()->DoCast(lichking, SPELL_REMORSELESS_WINTER, true); - lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); + lichking->CastSpell(lichking, SPELL_REMORSELESS_WINTER, true); + lichking->CastSpell(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); lichking->GetMotionMaster()->MoveIdle(); lichking->GetMotionMaster()->MoveChase(me); } if (Creature* walltarget = me->SummonCreature(NPC_ICE_WALL, IceWalls[0], TEMPSUMMON_MANUAL_DESPAWN, 720000)) { _walltargetGUID = walltarget->GetGUID(); - walltarget->AI()->DoCast(walltarget, SPELL_SUMMON_ICE_WALL); + walltarget->CastSpell(walltarget, SPELL_SUMMON_ICE_WALL); walltarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->Attack(walltarget, false); } @@ -948,7 +948,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript { lichking->StopMoving(); lichking->AI()->Talk(SAY_LK_ESCAPE_3); - lichking->AI()->DoCast(me, SPELL_RAISE_DEAD); + lichking->CastSpell(me, SPELL_RAISE_DEAD); } DestroyIceWall(); @@ -969,7 +969,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { if (_icewall && _icewall < 4) - lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); + lichking->CastSpell(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); lichking->GetMotionMaster()->MoveIdle(); lichking->GetMotionMaster()->MoveChase(me); lichking->SetReactState(REACT_PASSIVE); @@ -980,7 +980,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* walltarget = me->SummonCreature(NPC_ICE_WALL, IceWalls[_icewall], TEMPSUMMON_MANUAL_DESPAWN, 720000)) { _walltargetGUID = walltarget->GetGUID(); - walltarget->AI()->DoCast(walltarget, SPELL_SUMMON_ICE_WALL); + walltarget->CastSpell(walltarget, SPELL_SUMMON_ICE_WALL); walltarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); me->Attack(walltarget, false); } @@ -1018,9 +1018,9 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { if (_icewall && _icewall < 3) - lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); + lichking->CastSpell(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); else - lichking->AI()->DoCast(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); + lichking->CastSpell(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); } if (_icewall == 3) _events.ScheduleEvent(EVENT_ESCAPE_21, 16000); // last wall, really far @@ -1036,10 +1036,10 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { if (_icewall == 1) - lichking->AI()->DoCast(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); + lichking->CastSpell(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); else if (_icewall > 1 && _icewall < 4) { - lichking->AI()->DoCast(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); + lichking->CastSpell(lichking, SPELL_SUMMON_RISE_WITCH_DOCTOR); _events.ScheduleEvent(EVENT_ESCAPE_22, 1000); } } @@ -1048,7 +1048,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript if (Creature* lichking = ObjectAccessor::GetCreature(*me, _lichkingGUID)) { if (_icewall >= 2 && _icewall < 4) - lichking->AI()->DoCast(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); + lichking->CastSpell(lichking, SPELL_SUMMON_LUMBERING_ABOMINATION); } break; case EVENT_ESCAPE_23: // FINAL PART diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index f05f2c20b12..6b81bcc46a5 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -545,7 +545,7 @@ class boss_lady_deathwhisper : public CreatureScript void Summon(uint32 entry, const Position& pos) { if (TempSummon* summon = me->SummonCreature(entry, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) - summon->AI()->DoCast(summon, SPELL_TELEPORT_VISUAL); + summon->CastSpell(summon, SPELL_TELEPORT_VISUAL); } void SetGUID(uint64 guid, int32 id/* = 0*/) OVERRIDE diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 1df92618a3a..54a84158437 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -544,7 +544,7 @@ public: break; case PHASE_TWO: events.ScheduleEvent(EVENT_MOVE_TO_POINT_SURGE_P_TWO, 60*IN_MILLISECONDS, 0, _phase); - me->AI()->DoAction(ACTION_LIFT_IN_AIR); + DoAction(ACTION_LIFT_IN_AIR); break; case PHASE_THREE: events.ScheduleEvent(EVENT_ARCANE_PULSE, 7*IN_MILLISECONDS, 0, _phase); @@ -2325,7 +2325,7 @@ class spell_malygos_surge_of_power_warning_selector_25 : public SpellScriptLoade void ExecuteMainSpell() { - GetCaster()->ToCreature()->AI()->DoCastAOE(SPELL_SURGE_OF_POWER_PHASE_3_25); + GetCaster()->ToCreature()->CastSpell((Unit*)NULL, SPELL_SURGE_OF_POWER_PHASE_3_25); } void Register() OVERRIDE diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index cfa1b704c90..ee1524564a8 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -199,17 +199,17 @@ public: if (summon->GetGUID() == uiFireMagusGUID) { - me->AI()->DoAction(ACTION_MAGUS_DEAD); + DoAction(ACTION_MAGUS_DEAD); bFireMagusDead = true; } else if (summon->GetGUID() == uiFrostMagusGUID) { - me->AI()->DoAction(ACTION_MAGUS_DEAD); + DoAction(ACTION_MAGUS_DEAD); bFrostMagusDead = true; } else if (summon->GetGUID() == uiArcaneMagusGUID) { - me->AI()->DoAction(ACTION_MAGUS_DEAD); + DoAction(ACTION_MAGUS_DEAD); bArcaneMagusDead = true; } } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index a809eb4ddff..63d498de5eb 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -364,7 +364,7 @@ class npc_sanctum_sentry : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { me->AddThreat(target, 100.0f); - me->AI()->AttackStart(target); + AttackStart(target); DoCast(target, SPELL_SAVAGE_POUNCE); } events.ScheduleEvent(EVENT_POUNCE, urand(12000, 17000)); @@ -430,7 +430,7 @@ class npc_feral_defender : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { me->AddThreat(target, 100.0f); - me->AI()->AttackStart(target); + AttackStart(target); DoCast(target, SPELL_FERAL_POUNCE); } events.ScheduleEvent(EVENT_FERAL_POUNCE, urand(10000, 12000)); @@ -439,7 +439,7 @@ class npc_feral_defender : public CreatureScript if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) { me->AddThreat(target, 100.0f); - me->AI()->AttackStart(target); + AttackStart(target); DoCast(target, SPELL_FERAL_RUSH); } events.ScheduleEvent(EVENT_RUSH, urand(10000, 12000)); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 64ee385b7fc..7f3e6485eaf 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -1069,7 +1069,7 @@ class npc_detonating_lasher : public CreatureScript { // Switching to other target - modify aggro of new target by 20% from current target's aggro me->AddThreat(target, me->getThreatManager().getThreat(me->GetVictim(), false) * 1.2f); - me->AI()->AttackStart(target); + AttackStart(target); } changeTargetTimer = urand(5000, 10000); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 169a7085672..578a51fa1f8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -455,7 +455,7 @@ class boss_hodir : public CreatureScript if (Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid())) if (Aura* BitingColdAura = target->GetAura(SPELL_BITING_COLD_TRIGGERED)) if ((target->GetTypeId() == TYPEID_PLAYER) && (BitingColdAura->GetStackAmount() > 2)) - me->AI()->SetData(DATA_GETTING_COLD_IN_HERE, 0); + SetData(DATA_GETTING_COLD_IN_HERE, 0); gettingColdInHereTimer = 1000; } else diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp index e96cfaccc56..d1ed15bf8dd 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_razorscale.cpp @@ -211,8 +211,8 @@ class boss_razorscale_controller : public CreatureScript Harpoon3->RemoveFromWorld(); if (GameObject* Harpoon4 = ObjectAccessor::GetGameObject(*me, instance->GetData64(GO_RAZOR_HARPOON_4))) Harpoon4->RemoveFromWorld(); - me->AI()->DoAction(ACTION_HARPOON_BUILD); - me->AI()->DoAction(ACTION_PLACE_BROKEN_HARPOON); + DoAction(ACTION_HARPOON_BUILD); + DoAction(ACTION_PLACE_BROKEN_HARPOON); break; case SPELL_HARPOON_SHOT_1: case SPELL_HARPOON_SHOT_2: diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index b6438008dde..e9cf806118f 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -291,7 +291,7 @@ public: m_uiCrushTimer = 8000; m_uiPoisonedSpearTimer = 10000; m_uiWhirlwindTimer = 20000; - me->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM)); + AttackStart(SelectTarget(SELECT_TARGET_RANDOM)); } } } diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 6835228ca46..746680e32e6 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -189,7 +189,7 @@ public: void JustSummoned(Creature* summon) OVERRIDE { summon->AI()->AttackStart(me->GetVictim()); - summon->AI()->DoCastAOE(SPELL_ZURAMAT_ADD_2); + summon->CastSpell((Unit*)NULL, SPELL_ZURAMAT_ADD_2); summon->SetPhaseMask(17, true); } }; diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index f7f473297ef..6ea4490c79d 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -2415,7 +2415,7 @@ public: { me->setFaction(14); if (Player* player = ObjectAccessor::GetPlayer(*me, uiPlayerGUID)) - me->AI()->AttackStart(player); + AttackStart(player); } void UpdateAI(uint32 uiDiff) OVERRIDE diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 798801041f4..fd51237745e 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -458,10 +458,10 @@ class spell_mindless_abomination_explosion_fx_master : public SpellScriptLoader if (!caster) return; - caster->AI()->DoCast(caster, SPELL_COSMETIC_BLOOD_EXPLOSION_GREEN_LARGE); + caster->CastSpell(caster, SPELL_COSMETIC_BLOOD_EXPLOSION_GREEN_LARGE); for (uint8 i = 0; i < 10; ++i) - caster->AI()->DoCast(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON); + caster->CastSpell(caster, SPELL_RANDOM_CIRCUMFERENCE_POINT_POISON); caster->DespawnOrUnsummon(4000); } diff --git a/src/server/scripts/Northrend/zone_icecrown.cpp b/src/server/scripts/Northrend/zone_icecrown.cpp index f7894c58b3e..5284803c5f2 100644 --- a/src/server/scripts/Northrend/zone_icecrown.cpp +++ b/src/server/scripts/Northrend/zone_icecrown.cpp @@ -527,7 +527,7 @@ public: { me->setRegeneratingHealth(false); DoCast(SPELL_THREAT_PULSE); - me->AI()->Talk(BANNER_SAY); + Talk(BANNER_SAY); events.ScheduleEvent(EVENT_SPAWN, 3000); } diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp index 0298500e790..6e39d341c58 100644 --- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp @@ -1003,7 +1003,7 @@ enum ReconnaissanceFlight VIC_SAY_6 = 6, PLANE_EMOTE = 0, - AURA_ENGINE = 52255, // Engine on Fire + SPELL_ENGINE = 52255, // Engine on Fire SPELL_LAND = 52226, // Land Flying Machine SPELL_CREDIT = 53328 // Land Flying Machine Credit @@ -1054,8 +1054,8 @@ public: pilot->AI()->Talk(VIC_SAY_6); break; case 25: - me->AI()->Talk(PLANE_EMOTE); - me->AI()->DoCast(AURA_ENGINE); + Talk(PLANE_EMOTE); + DoCast(SPELL_ENGINE); break; } } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index bd80de627a8..838fa44ded4 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -504,7 +504,7 @@ public: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID)) { - voice->AI()->DoCast(voice, SPELL_RESURRECTION); + voice->CastSpell(voice, SPELL_RESURRECTION); if (Player* player = ObjectAccessor::GetPlayer(*me, playerGUID)) voice->AI()->Talk(SAY_VOICE_1, player); } @@ -546,7 +546,7 @@ public: break; case EVENT_SCRIPT_9: if (Creature* voice = ObjectAccessor::GetCreature(*me, voiceGUID)) - voice->AI()->DoCast(voice, SPELL_RESURRECTION); + voice->CastSpell(voice, SPELL_RESURRECTION); events.ScheduleEvent(EVENT_SCRIPT_10, 6000); break; case EVENT_SCRIPT_10: diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index ba8eb2194f5..c45a1a4f391 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -156,11 +156,11 @@ public: { for (std::list::const_iterator itr = bloodmage.begin(); itr != bloodmage.end(); ++itr) if (Creature* bloodmage = (Unit::GetCreature(*me, *itr))) - bloodmage->AI()->DoCast(SPELL_SUMMON_CHANNEL); + bloodmage->CastSpell((Unit*)NULL, SPELL_SUMMON_CHANNEL); for (std::list::const_iterator itr = deathshaper.begin(); itr != deathshaper.end(); ++itr) if (Creature* deathshaper = (Unit::GetCreature(*me, *itr))) - deathshaper->AI()->DoCast(SPELL_SUMMON_CHANNEL); + deathshaper->CastSpell((Unit*)NULL, SPELL_SUMMON_CHANNEL); events.ScheduleEvent(EVENT_SET_CHANNELERS, 12000); diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 8deac58461c..b95af29a43e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -186,7 +186,7 @@ public: if (target && me->IsWithinDistInMap(target, me->GetAttackDistance(target))) { DoCast(target, SPELL_ATROPHY); - me->AI()->AttackStart(target); + AttackStart(target); } } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 4c04c06b091..e9a8a68b116 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -135,7 +135,7 @@ class boss_kelidan_the_breaker : public CreatureScript me->SetReactState(REACT_AGGRESSIVE); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); if (killer) - me->AI()->AttackStart(killer); + AttackStart(killer); } uint64 GetChanneled(Creature* channeler1) diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 1193e45e73b..205158f606e 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -134,7 +134,7 @@ class boss_nazan : public CreatureScript me->SetWalk(true); me->GetMotionMaster()->Clear(); if (Unit* victim = SelectTarget(SELECT_TARGET_NEAREST, 0)) - me->AI()->AttackStart(victim); + AttackStart(victim); DoStartMovement(me->GetVictim()); Talk(EMOTE); return; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp index a961800025d..00c4577dab6 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_alar.cpp @@ -435,7 +435,7 @@ class boss_alar : public CreatureScript Unit* target = NULL; target = me->SelectNearestTargetInAttackDistance(5); if (target) - me->AI()->AttackStart(target); + AttackStart(target); else { DoCast(me, SPELL_FLAME_BUFFET, true); -- cgit v1.2.3