aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_09_03_04_world_sai.sql4
-rw-r--r--sql/updates/world/2013_09_04_00_world_sai.sql52
-rw-r--r--sql/updates/world/2013_09_04_01_world_sai.sql41
-rw-r--r--sql/updates/world/2013_09_04_02_world_spawns_sai.sql38
-rw-r--r--sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql26
-rw-r--r--src/server/authserver/Main.cpp2
-rw-r--r--src/server/authserver/Realms/RealmList.h2
-rw-r--r--src/server/authserver/Server/AuthSocket.cpp23
-rw-r--r--src/server/authserver/Server/RealmSocket.cpp6
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp23
-rw-r--r--src/server/game/Battlefield/Battlefield.cpp2
-rw-r--r--src/server/game/Battlefield/Battlefield.h2
-rw-r--r--src/server/game/Battlefield/BattlefieldMgr.cpp7
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.h6
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp87
-rw-r--r--src/server/game/Calendar/CalendarMgr.h6
-rw-r--r--src/server/game/Entities/Creature/CreatureGroups.cpp14
-rw-r--r--src/server/game/Entities/Item/Item.cpp2
-rw-r--r--src/server/game/Entities/Object/Object.h2
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp6
-rw-r--r--src/server/game/Globals/ObjectMgr.h4
-rw-r--r--src/server/game/Guilds/Guild.cpp2
-rw-r--r--src/server/game/Guilds/Guild.h2
-rw-r--r--src/server/game/Loot/LootMgr.cpp2
-rw-r--r--src/server/game/Loot/LootMgr.h2
-rw-r--r--src/server/game/Maps/Map.cpp7
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp7
-rw-r--r--src/server/game/Spells/SpellEffects.cpp23
-rw-r--r--src/server/game/Spells/SpellMgr.cpp10
-rw-r--r--src/server/scripts/Commands/cs_account.cpp4
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp2
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp2
-rw-r--r--src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp2
-rw-r--r--src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp4
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp4
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.cpp3
-rw-r--r--src/server/shared/Utilities/Util.h8
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp5
-rw-r--r--src/tools/map_extractor/loadlib.cpp12
-rw-r--r--src/tools/mmaps_generator/MapBuilder.cpp21
43 files changed, 318 insertions, 165 deletions
diff --git a/sql/updates/world/2013_09_03_04_world_sai.sql b/sql/updates/world/2013_09_03_04_world_sai.sql
new file mode 100644
index 00000000000..7c39802caae
--- /dev/null
+++ b/sql/updates/world/2013_09_03_04_world_sai.sql
@@ -0,0 +1,4 @@
+DELETE FROM `smart_scripts` WHERE `entryorguid`= 24189 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
+(24189, 0, 0, 0, 19, 0, 100, 0, 11288, 0, 0, 0, 85, 43202, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ares - On target quest accepted 11288 - Cast spell Shining Light'),
+(24189, 0, 1, 0, 19, 0, 100, 0, 11289, 0, 0, 0, 85, 43228, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Ares - On target quest accepted 11289 - Cast Guided by the Oathbound QC');
diff --git a/sql/updates/world/2013_09_04_00_world_sai.sql b/sql/updates/world/2013_09_04_00_world_sai.sql
new file mode 100644
index 00000000000..a4614deca75
--- /dev/null
+++ b/sql/updates/world/2013_09_04_00_world_sai.sql
@@ -0,0 +1,52 @@
+-- Putting Olakin Back Together Again (13220)
+SET @QUEST := 13220;
+SET @NPC_OLAKIN := 31235; -- Crusader Olakin Sainrith
+SET @GO_CLEAVER := 193092; -- The Doctor's Cleaver
+SET @GO_SPOOL := 193091; -- Spool of Thread
+SET @EVENT_SCRIPT := 20269; -- Event from 58856 Reanimate Crusader Olakin
+SET @SPELL_FD := 35356; -- Feign Death
+SET @SPELL_FAKE_BLOOD := 37692; -- Fake Blood Spurt
+SET @SPELL_RESURRECTION := 58854; -- Resurrection
+
+DELETE FROM `gameobject` WHERE `id` IN (@GO_CLEAVER,@GO_SPOOL);
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(16974,@GO_SPOOL,571,1,1,6668.17,3268.54,669.539,2.54818,0,0,0.956304,0.292373,120,255, 1),
+(16976,@GO_CLEAVER,571,1,1,6601.1,3147.78,666.916,-2.77507,0,0,-0.983254,0.182238,120,255,1);
+
+DELETE FROM `event_scripts` WHERE `id`=@EVENT_SCRIPT;
+INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES
+(@EVENT_SCRIPT,0,10,@NPC_OLAKIN,60000,0,6636.792,3211.102,668.6439,0.8901179);
+
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_OLAKIN;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(@NPC_OLAKIN,0,0x0,0x1,'35356'); -- 31235 - 35356
+
+DELETE FROM `creature_text` WHERE `entry`=@NPC_OLAKIN;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_OLAKIN,0,0,'Thank the Light for granting me another chance. And thank you, $N.',12,0,100,1,0,0,'Crusader Olakin Sainrith'),
+(@NPC_OLAKIN,1,0,'Without your help, I would''ve been doomed to a life of undeath among the Lich King''s gruesome creations.', 12,0,100,1,0,0,'Crusader Olakin Sainrith'),
+(@NPC_OLAKIN,2,0,'There will be time for a proper thanks later, but there is still a battle to be fought!', 12,0,100,25,0,0,'Crusader Olakin Sainrith');
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC_OLAKIN;
+DELETE FROM `smart_scripts` WHERE (`source_type`=0 AND `entryorguid`=@NPC_OLAKIN) OR (`source_type`=9 AND `entryorguid`=@NPC_OLAKIN*100);
+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
+(@NPC_OLAKIN,0,0,0,54,0,100,0,0,0,0,0,80,@NPC_OLAKIN*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Just summoned - Run Script'),
+(@NPC_OLAKIN,0,1,0,40,0,100,0,3,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On WP Reached - Despawn'),
+-- 17,26
+(@NPC_OLAKIN*100,9,0,0,0,0,100,0,2000,2000,0,0,11,@SPELL_FAKE_BLOOD,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Cast Spell'),
+(@NPC_OLAKIN*100,9,1,0,0,0,100,0,2000,2000,0,0,11,@SPELL_RESURRECTION,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Cast Spell'),
+(@NPC_OLAKIN*100,9,2,0,0,0,100,0,0,0,0,0,28,@SPELL_FD,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Remove Aura'),
+(@NPC_OLAKIN*100,9,3,0,0,0,100,0,0,0,0,0,96,32,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Remove dynamic flag'),
+(@NPC_OLAKIN*100,9,4,0,0,0,100,0,1000,1000,0,0,19,1,1,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Remove Unit Flag_2 1 {dead)'),
+(@NPC_OLAKIN*100,9,5,0,0,0,100,0,4000,4000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Say 0'),
+(@NPC_OLAKIN*100,9,6,0,0,0,100,0,4000,4000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Say 1'),
+(@NPC_OLAKIN*100,9,7,0,0,0,100,0,4000,4000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Say 2'),
+(@NPC_OLAKIN*100,9,8,0,0,0,100,0,3000,3000,0,0,33,@NPC_OLAKIN,0,0,0,0,0,17,0,30,0,0,0,0,0,'Crusader Olakin Sainrith - On Script - Quest Credit'),
+(@NPC_OLAKIN*100,9,9,0,0,0,100,0,0,0,0,0,53,1,@NPC_OLAKIN,0,0,0,0,1,0,0,0,0,0,0,0,'Crusader Olakin Sainrith - On Script -Start WP movement');
+
+DELETE FROM `waypoints` WHERE entry =@NPC_OLAKIN;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(@NPC_OLAKIN, 1, 6632.227, 3223.6350, 666.7750,'Olakin'),
+(@NPC_OLAKIN, 2, 6624.2558, 3230.2343, 666.857, 'Olakin'),
+(@NPC_OLAKIN, 3, 6608.985, 3234.5588, 668.779, 'Olakin');
+
diff --git a/sql/updates/world/2013_09_04_01_world_sai.sql b/sql/updates/world/2013_09_04_01_world_sai.sql
new file mode 100644
index 00000000000..9d9412b87e7
--- /dev/null
+++ b/sql/updates/world/2013_09_04_01_world_sai.sql
@@ -0,0 +1,41 @@
+-- A Cleansing Song (12735)
+SET @KOOSU := 29034;
+SET @HA_KHALAN := 29018;
+SET @ATHA := 29033;
+
+-- Spirit of Koosu
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@KOOSU;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@KOOSU;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@KOOSU;
+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
+(@KOOSU,0,0,0,4,0,100,1,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Set Phase 1 - on Aggro'),
+(@KOOSU,0,1,0,4,1,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Stop Moving - on Aggro'),
+(@KOOSU,0,2,0,4,1,100,1,0,0,0,0,11,21971,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Koosu - Cast bolt - on Aggro'),
+(@KOOSU,0,3,0,9,1,100,0,5,30,3500,4100,11,21971,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Koosu - Cast bolt - In Range'),
+(@KOOSU,0,4,0,9,1,100,0,30,100,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Start Moving - When not in bolt Range'),
+(@KOOSU,0,5,0,9,1,100,0,9,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Stop Moving - 15 Yards'),
+(@KOOSU,0,6,0,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Start Moving - when not in bolt Range'),
+(@KOOSU,0,7,0,9,1,100,0,5,30,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Koosu - Stop Moving - when in bolt Range');
+
+-- Spirit of Ha-Khalan
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@HA_KHALAN;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@HA_KHALAN;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@HA_KHALAN;
+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
+(@HA_KHALAN,0,0,0,0,0,100,0,1000,1000,125000,125000,11,50502,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Ha-Khalan - IC - Cast Thick Hide'),
+(@HA_KHALAN,0,1,0,0,0,100,0,5000,10000,12000,16000,11,34370,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Ha-Khalan - IC - Cast Jagged Tooth Snap'),
+(@HA_KHALAN,0,2,0,0,0,100,0,3000,5000,7000,11000,11,48287,0,0,0,0,0,2,0,0,0,0,0,0,0,'Spirit of Ha-Khalan - IC - Cast Powerful Bite');
+
+-- Spirit of Atha
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ATHA;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ATHA;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ATHA;
+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
+(@ATHA,0,0,0,0,0,100,0,8000,13000,12000,16000,11,21790,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Atha - IC - Cast Aqua Jet'),
+(@ATHA,0,1,0,0,0,100,0,2000,4000,5000,7000,11,3391,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spirit of Atha - IC - Cast Thrash');
+
+UPDATE `creature_template` SET `unit_flags`=`unit_flags`|8 WHERE `entry`=29018; -- Spirit of Ha-Khalan
+-- Addon data for creature 29018 (Spirit of Ha-Khalan)
+DELETE FROM `creature_template_addon` WHERE `entry`=29018;
+INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(29018,0,0,1,0,''); -- Spirit of Ha-Khalan
diff --git a/sql/updates/world/2013_09_04_02_world_spawns_sai.sql b/sql/updates/world/2013_09_04_02_world_spawns_sai.sql
new file mode 100644
index 00000000000..40e238d04a2
--- /dev/null
+++ b/sql/updates/world/2013_09_04_02_world_spawns_sai.sql
@@ -0,0 +1,38 @@
+-- Corpulen Horror spawns in area The Fleshwerks
+SET @CGUID = 127272;
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=30696;
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=30696;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=30696;
+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
+(30696,0,0,0,9,0,100,0,8,40,3500,4100,11,50335,0,0,0,0,0,2,0,0,0,0,0,0,0,'Corpulent Horror - Cast Scourge Hook - In Range');
+
+DELETE FROM `creature_template_addon` WHERE `entry`=30696;
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(30696, 0, 0x0, 0x1, ''); -- Corpulent Horror
+
+UPDATE `creature_template` SET `faction_A`=2102, `faction_H`=2102, `speed_walk`=1.142857, `speed_run`=1, `rangeattacktime`=2000, `unit_flags`=32768, `dynamicflags`=0 WHERE `entry`=30696; -- Corpulent Horror
+DELETE FROM `creature` WHERE `id` = 30696;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`) VALUES
+(@CGUID+0, 30696, 571, 1, 1, 0, 0, 6975.386, 3462.006, 710.9403, 6.126106, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+1, 30696, 571, 1, 1, 0, 0, 6982.377, 3478.588, 710.9403, 5.811946, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+2, 30696, 571, 1, 1, 0, 0, 6920.697, 3446.544, 710.2005, 3.097477, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+3, 30696, 571, 1, 1, 0, 0, 6932.927, 3502.471, 705.0461, 3.281219, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+4, 30696, 571, 1, 1, 0, 0, 6903.668, 3478.428, 700.0414, 3.093731, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+5, 30696, 571, 1, 1, 0, 0, 6895.87, 3460.794, 700.7824, 1.592374, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+6, 30696, 571, 1, 1, 0, 0, 6868.874, 3435.562, 705.6059, 1.542484, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+7, 30696, 571, 1, 1, 0, 0, 6869.054, 3493.792, 695.7783, 5.440073, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+8, 30696, 571, 1, 1, 0, 0, 6875.154, 3513.065, 698.8162, 3.944444, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+9, 30696, 571, 1, 1, 0, 0, 6836.296, 3505.824, 690.3577, 0.5061455, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+10, 30696, 571, 1, 1, 0, 0, 6823.636, 3484.259, 688.4615, 6.278303, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+11, 30696, 571, 1, 1, 0, 0, 6729.185, 3433.822, 682.3103, 2.64319, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+12, 30696, 571, 1, 1, 0, 0, 6676.063, 3349.062, 704.616, 2.582512, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+13, 30696, 571, 1, 1, 0, 0, 6699.958, 3422.957, 679.4948, 3.363122, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+14, 30696, 571, 1, 1, 0, 0, 6548.099, 3309.558, 665.8171, 2.951326, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+15, 30696, 571, 1, 1, 0, 0, 6535.431, 3322.088, 664.9422, 5.877358, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+16, 30696, 571, 1, 1, 0, 0, 6530.748, 3296.081, 664.9409, 3.446935, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+17, 30696, 571, 1, 1, 0, 0, 6534.971, 3260.271, 666.9742, 0.2021571, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+18, 30696, 571, 1, 1, 0, 0, 6477.204, 3257.901, 643.6331, 3.804818, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+19, 30696, 571, 1, 1, 0, 0, 6488.242, 3194.719, 652.9039, 1.48353, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks)
+(@CGUID+20, 30696, 571, 1, 1, 0, 0, 6412.273, 3236.912, 640.3326, 0.7460284, 120, 0, 0, 0, 0, 0, 0, 0, 0), -- Corpulent Horror (Area: The Fleshwerks
+(@CGUID+21, 30696, 571, 1, 1, 0, 0, 6413.427, 3218.029, 638.4678, 0.122173, 120, 0, 0, 0, 0, 0, 0, 0, 0); -- Corpulent Horror (Area: The Fleshwerks)
diff --git a/sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql b/sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql
new file mode 100644
index 00000000000..471ee3adefb
--- /dev/null
+++ b/sql/updates/world/2013_09_04_03_world_isle_of_conquest.sql
@@ -0,0 +1,26 @@
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (66548,66549,66550,66551);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (66550,66551);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,66550,0,0,31,0,3,22515,0,0,0,0,'','Isle of Conquest - Teleport Fortress Out'),
+(13,1,66550,0,0,35,0,1,10,1,0,0,0,'','Isle of Conquest - Teleport Fortress Out'),
+(13,1,66551,0,0,31,0,3,22515,0,0,0,0,'','Isle of Conquest - Teleport Fortress In'),
+(13,1,66551,0,0,35,0,1,10,1,0,0,0,'','Isle of Conquest - Teleport Fortress In');
+
+SET @CGUID := 90179;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+13;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 22515, 628, 3, 1, 392.4965, -859.4583, 48.99871, 3.036873, 7200, 0, 0), -- A IN
+(@CGUID+1, 22515, 628, 3, 1, 313.2344, -918.0452, 48.85597, 4.869469, 7200, 0, 0), -- A OUT
+(@CGUID+2, 22515, 628, 3, 1, 279.8698, -832.8073, 51.55094, 0, 7200, 0, 0), -- A CENTER
+(@CGUID+3, 22515, 628, 3, 1, 323.4965, -883.8021, 48.99959, 1.466077, 7200, 0, 0), -- A IN
+(@CGUID+4, 22515, 628, 3, 1, 430.6007, -857.0052, 48.31177, 0.1396263, 7200, 0, 0), -- A OUT
+(@CGUID+5, 22515, 628, 3, 1, 325.9167, -781.8993, 49.00521, 4.590216, 7200, 0, 0), -- A IN
+(@CGUID+6, 22515, 628, 3, 1, 326.2135, -744.0243, 49.43576, 1.308997, 7200, 0, 0), -- A OUT
+(@CGUID+7, 22515, 628, 3, 1, 1139.498, -779.4739, 48.73496, 3.001966, 7200, 0, 0), -- H OUT
+(@CGUID+8, 22515, 628, 3, 1, 1162.913, -745.908, 48.71506, 0.1396263, 7200, 0, 0), -- H IN
+(@CGUID+9, 22515, 628, 3, 1, 1234.304, -688.2986, 49.22296, 4.677482, 7200, 0, 0), -- H IN
+(@CGUID+10, 22515, 628, 3, 1, 1232.524, -666.3246, 48.13402, 2.303835, 7200, 0, 0), -- H OUT
+(@CGUID+11, 22515, 628, 3, 1, 1233.106, -838.316, 48.99958, 1.466077, 7200, 0, 0), -- H IN
+(@CGUID+12, 22515, 628, 3, 1, 1232.387, -861.0243, 48.99959, 3.560472, 7200, 0, 0), -- H OUT
+(@CGUID+13, 22515, 628, 3, 1, 1296.526, -766.1823, 50.70293, 3.089233, 7200, 0, 0); -- H CENTER
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 9a6cc89fdd4..b16e86a7f9f 100644
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -298,7 +298,7 @@ bool StartDB()
}
// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever.
- if (!LoginDatabase.Open(dbstring.c_str(), uint8(worker_threads), uint8(synch_threads)))
+ if (!LoginDatabase.Open(dbstring, uint8(worker_threads), uint8(synch_threads)))
{
TC_LOG_ERROR(LOG_FILTER_AUTHSERVER, "Cannot connect to database");
return false;
diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h
index 68e6524c334..d59990135f2 100644
--- a/src/server/authserver/Realms/RealmList.h
+++ b/src/server/authserver/Realms/RealmList.h
@@ -66,7 +66,7 @@ public:
void UpdateIfNeed();
- void AddRealm(Realm NewRealm) {m_realms[NewRealm.name] = NewRealm;}
+ void AddRealm(const Realm& NewRealm) { m_realms[NewRealm.name] = NewRealm; }
RealmMap::const_iterator begin() const { return m_realms.begin(); }
RealmMap::const_iterator end() const { return m_realms.end(); }
diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp
index 93c03e26c88..1ab9ae6eb62 100644
--- a/src/server/authserver/Server/AuthSocket.cpp
+++ b/src/server/authserver/Server/AuthSocket.cpp
@@ -387,7 +387,7 @@ bool AuthSocket::_HandleLogonChallenge()
TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString());
TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Player address is '%s'", ip_address.c_str());
- if (strcmp(fields[4].GetCString(), ip_address.c_str()))
+ if (strcmp(fields[4].GetCString(), ip_address.c_str()) != 0)
{
TC_LOG_DEBUG(LOG_FILTER_AUTHSERVER, "[AuthChallenge] Account IP differs");
pkt << uint8(WOW_FAIL_LOCKED_ENFORCED);
@@ -930,12 +930,13 @@ bool AuthSocket::_HandleRealmList()
size_t RealmListSize = 0;
for (RealmList::RealmMap::const_iterator i = sRealmList->begin(); i != sRealmList->end(); ++i)
{
+ const Realm &realm = i->second;
// don't work with realms which not compatible with the client
- bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && i->second.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(i->second.gamebuild));
+ bool okBuild = ((_expversion & POST_BC_EXP_FLAG) && realm.gamebuild == _build) || ((_expversion & PRE_BC_EXP_FLAG) && !AuthHelper::IsPreBCAcceptedClientBuild(realm.gamebuild));
// No SQL injection. id of realm is controlled by the database.
- uint32 flag = i->second.flag;
- RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(i->second.gamebuild);
+ uint32 flag = realm.flag;
+ RealmBuildInfo const* buildInfo = AuthHelper::GetBuildInfo(realm.gamebuild);
if (!okBuild)
{
if (!buildInfo)
@@ -956,27 +957,27 @@ bool AuthSocket::_HandleRealmList()
}
// We don't need the port number from which client connects with but the realm's port
- clientAddr.set_port_number(i->second.ExternalAddress.get_port_number());
+ clientAddr.set_port_number(realm.ExternalAddress.get_port_number());
- uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0;
+ uint8 lock = (realm.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0;
uint8 AmountOfCharacters = 0;
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_NUM_CHARS_ON_REALM);
- stmt->setUInt32(0, i->second.m_ID);
+ stmt->setUInt32(0, realm.m_ID);
stmt->setUInt32(1, id);
result = LoginDatabase.Query(stmt);
if (result)
AmountOfCharacters = (*result)[0].GetUInt8();
- pkt << i->second.icon; // realm type
+ pkt << realm.icon; // realm type
if (_expversion & POST_BC_EXP_FLAG) // only 2.x and 3.x clients
pkt << lock; // if 1, then realm locked
pkt << uint8(flag); // RealmFlags
pkt << name;
- pkt << GetAddressString(GetAddressForClient(i->second, clientAddr));
- pkt << i->second.populationLevel;
+ pkt << GetAddressString(GetAddressForClient(realm, clientAddr));
+ pkt << realm.populationLevel;
pkt << AmountOfCharacters;
- pkt << i->second.timezone; // realm category
+ pkt << realm.timezone; // realm category
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
pkt << uint8(0x2C); // unk, may be realm number/id?
else
diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp
index 6710a6a88ae..88d81132306 100644
--- a/src/server/authserver/Server/RealmSocket.cpp
+++ b/src/server/authserver/Server/RealmSocket.cpp
@@ -45,8 +45,7 @@ RealmSocket::~RealmSocket(void)
// delete RealmSocketObject must never be called from our code.
closing_ = true;
- if (session_)
- delete session_;
+ delete session_;
peer().close();
}
@@ -286,8 +285,7 @@ int RealmSocket::handle_input(ACE_HANDLE)
void RealmSocket::set_session(Session* session)
{
- if (session_ != NULL)
- delete session_;
+ delete session_;
session_ = session;
}
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index cbb79b47958..75a1488ed45 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -75,6 +75,8 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToN
}
}
+ // Intended duplicated check, the code above this should select a victim
+ // If it can't find a suitable attack target then we should error out.
if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim())
{
TC_LOG_ERROR(LOG_FILTER_GENERAL, "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry());
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 76b87067bd9..c93ffe90add 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -785,8 +785,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
uint32 creatureSummonEntry = spellInfo->Effects[j].MiscValue;
if (e.action.killedMonster.creature == creatureSummonEntry)
- TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u summon: %u has already summon spell (SpellId: %u effect: %u)",
- e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.killedMonster.creature, spellInfo->Id, j);
+ TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u creature summon: %u has already summon spell (SpellId: %u effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.killedMonster.creature, spellInfo->Id, j);
}
}
}
@@ -848,6 +848,25 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SUMMON_GO:
if (!IsGameObjectValid(e, e.action.summonGO.entry))
return false;
+
+ for (uint32 i = 0; i < sSpellMgr->GetSpellInfoStoreSize(); ++i)
+ {
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(i);
+ if (!spellInfo)
+ continue;
+
+ for (uint32 j = 0; j < MAX_SPELL_EFFECTS; ++j)
+ {
+ if (spellInfo->Effects[j].Effect == SPELL_EFFECT_SUMMON_OBJECT_WILD)
+ {
+ uint32 goSummonEntry = spellInfo->Effects[j].MiscValue;
+
+ if (e.action.summonGO.entry == goSummonEntry)
+ TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u gameobject summon: %u has already summon spell (SpellId: %u effect: %u)",
+ e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonGO.entry, spellInfo->Id, j);
+ }
+ }
+ }
break;
case SMART_ACTION_ADD_ITEM:
case SMART_ACTION_REMOVE_ITEM:
diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp
index bff46b9de73..3deb9cd7c46 100644
--- a/src/server/game/Battlefield/Battlefield.cpp
+++ b/src/server/game/Battlefield/Battlefield.cpp
@@ -810,7 +810,7 @@ bool BfGraveyard::HasNpc(uint64 guid)
// ********************** Misc ***************************
// *******************************************************
-Creature* Battlefield::SpawnCreature(uint32 entry, Position pos, TeamId team)
+Creature* Battlefield::SpawnCreature(uint32 entry, const Position& pos, TeamId team)
{
return SpawnCreature(entry, pos.m_positionX, pos.m_positionY, pos.m_positionZ, pos.m_orientation, team);
}
diff --git a/src/server/game/Battlefield/Battlefield.h b/src/server/game/Battlefield/Battlefield.h
index 9b3542fca65..fd8e294a426 100644
--- a/src/server/game/Battlefield/Battlefield.h
+++ b/src/server/game/Battlefield/Battlefield.h
@@ -288,7 +288,7 @@ class Battlefield : public ZoneScript
// Misc methods
Creature* SpawnCreature(uint32 entry, float x, float y, float z, float o, TeamId team);
- Creature* SpawnCreature(uint32 entry, Position pos, TeamId team);
+ Creature* SpawnCreature(uint32 entry, const Position& pos, TeamId team);
GameObject* SpawnGameObject(uint32 entry, float x, float y, float z, float o);
Creature* GetCreature(uint64 GUID);
diff --git a/src/server/game/Battlefield/BattlefieldMgr.cpp b/src/server/game/Battlefield/BattlefieldMgr.cpp
index 28a72152e9d..53b3ce0a6d9 100644
--- a/src/server/game/Battlefield/BattlefieldMgr.cpp
+++ b/src/server/game/Battlefield/BattlefieldMgr.cpp
@@ -74,11 +74,12 @@ void BattlefieldMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid)
if (itr == m_BattlefieldMap.end())
return;
- if (itr->second->HasPlayer(player) || !itr->second->IsEnabled())
+ Battlefield* bf = itr->second;
+ if (bf->HasPlayer(player) || !bf->IsEnabled())
return;
- itr->second->HandlePlayerEnterZone(player, zoneid);
- TC_LOG_DEBUG(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId());
+ bf->HandlePlayerEnterZone(player, zoneid);
+ TC_LOG_DEBUG(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), bf->GetTypeId());
}
void BattlefieldMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid)
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h
index dbfe3b3c763..1c959d0e8c1 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.h
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -579,8 +579,8 @@ struct WintergraspBuildingSpawnData
struct WintergraspRebuildableBuildingData
{
- uint32 entry;
uint64 Guid;
+ uint32 entry;
uint32 WorldState;
float x;
float y;
@@ -1559,7 +1559,7 @@ struct WintergraspWorkshopData
}
// Spawning associate creature and store them
- void AddCreature(WintergraspObjectPositionData obj)
+ void AddCreature(const WintergraspObjectPositionData& obj)
{
if (Creature* creature = m_WG->SpawnCreature(obj.entryHorde, obj.x, obj.y, obj.z, obj.o, TEAM_HORDE))
m_CreatureOnPoint[TEAM_HORDE].insert(creature->GetGUID());
@@ -1569,7 +1569,7 @@ struct WintergraspWorkshopData
}
// Spawning Associate gameobject and store them
- void AddGameObject(WintergraspObjectPositionData obj)
+ void AddGameObject(const WintergraspObjectPositionData& obj)
{
if (GameObject* gameobject = m_WG->SpawnGameObject(obj.entryHorde, obj.x, obj.y, obj.z, obj.o))
m_GameObjectOnPoint[TEAM_HORDE].insert(gameobject->GetGUID());
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 9352b2d5710..f3df064cb77 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -384,8 +384,10 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
TC_LOG_ERROR(LOG_FILTER_BATTLEGROUND, "Player " UI64FMTD " has scoreboard entry for battleground %u but is not in battleground!", itr->first, bg->GetTypeID(true));
continue;
}
+
Player* player = ObjectAccessor::FindPlayer(itr->first);
ObjectGuid playerGUID = itr->first;
+ BattlegroundScore* score = itr->second;
data->WriteBit(0); // Unk 1
data->WriteBit(0); // Unk 2
@@ -402,18 +404,18 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
data->WriteBit(player->GetBGTeam() == HORDE ? 0 : 1);
data->WriteBit(playerGUID[7]);
- buff << uint32(itr->second->HealingDone); // healing done
- buff << uint32(itr->second->DamageDone); // damage done
+ buff << uint32(score->HealingDone); // healing done
+ buff << uint32(score->DamageDone); // damage done
if (!isArena)
{
- buff << uint32(itr->second->BonusHonor / 100);
- buff << uint32(itr->second->Deaths);
- buff << uint32(itr->second->HonorableKills);
+ buff << uint32(score->BonusHonor / 100);
+ buff << uint32(score->Deaths);
+ buff << uint32(score->HonorableKills);
}
buff.WriteByteSeq(playerGUID[4]);
- buff << uint32(itr->second->KillingBlows);
+ buff << uint32(score->KillingBlows);
// if (unk 5) << uint32() unk
buff.WriteByteSeq(playerGUID[5]);
// if (unk 6) << uint32() unk
@@ -421,7 +423,6 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
buff.WriteByteSeq(playerGUID[1]);
buff.WriteByteSeq(playerGUID[6]);
-
buff << int32(player->GetPrimaryTalentTree(player->GetActiveSpec()));
switch (bg->GetTypeID(true)) // Custom values
@@ -431,45 +432,45 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
{
case 489:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundWGScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundWGScore*)score)->FlagReturns); // flag returns
break;
case 566:
data->WriteBits(0x00000001, 24);
- buff << uint32(((BattlegroundEYScore*)itr->second)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundEYScore*)score)->FlagCaptures); // flag captures
break;
case 529:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundABScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundABScore*)score)->BasesDefended); // bases defended
break;
case 30:
data->WriteBits(0x00000005, 24);
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersDefended); // TowersDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsAssaulted); // GraveyardsAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsDefended); // GraveyardsDefended
+ buff << uint32(((BattlegroundAVScore*)score)->TowersAssaulted); // TowersAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->TowersDefended); // TowersDefended
+ buff << uint32(((BattlegroundAVScore*)score)->MinesCaptured); // MinesCaptured
break;
case 607:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundSAScore*)itr->second)->demolishers_destroyed);
- buff << uint32(((BattlegroundSAScore*)itr->second)->gates_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->demolishers_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->gates_destroyed);
break;
case 628: // IC
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundICScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundICScore*)score)->BasesDefended); // bases defended
break;
case 726:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundTPScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundTPScore*)score)->FlagReturns); // flag returns
break;
case 761:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesDefended); // bases defended
break;
default:
data->WriteBits(0, 24);
@@ -478,45 +479,45 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket* data, Battleground* bg)
break;
case BATTLEGROUND_AV:
data->WriteBits(0x00000005, 24);
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsAssaulted); // GraveyardsAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->GraveyardsDefended); // GraveyardsDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersAssaulted); // TowersAssaulted
- buff << uint32(((BattlegroundAVScore*)itr->second)->TowersDefended); // TowersDefended
- buff << uint32(((BattlegroundAVScore*)itr->second)->MinesCaptured); // MinesCaptured
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsAssaulted); // GraveyardsAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->GraveyardsDefended); // GraveyardsDefended
+ buff << uint32(((BattlegroundAVScore*)score)->TowersAssaulted); // TowersAssaulted
+ buff << uint32(((BattlegroundAVScore*)score)->TowersDefended); // TowersDefended
+ buff << uint32(((BattlegroundAVScore*)score)->MinesCaptured); // MinesCaptured
break;
case BATTLEGROUND_WS:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundWGScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundWGScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundWGScore*)score)->FlagReturns); // flag returns
break;
case BATTLEGROUND_AB:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundABScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundABScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundABScore*)score)->BasesDefended); // bases defended
break;
case BATTLEGROUND_EY:
data->WriteBits(0x00000001, 24);
- buff << uint32(((BattlegroundEYScore*)itr->second)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundEYScore*)score)->FlagCaptures); // flag captures
break;
case BATTLEGROUND_SA:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundSAScore*)itr->second)->demolishers_destroyed);
- buff << uint32(((BattlegroundSAScore*)itr->second)->gates_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->demolishers_destroyed);
+ buff << uint32(((BattlegroundSAScore*)score)->gates_destroyed);
break;
case BATTLEGROUND_IC:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundICScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundICScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundICScore*)score)->BasesDefended); // bases defended
break;
case BATTLEGROUND_TP:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagCaptures); // flag captures
- buff << uint32(((BattlegroundTPScore*)itr->second)->FlagReturns); // flag returns
+ buff << uint32(((BattlegroundTPScore*)score)->FlagCaptures); // flag captures
+ buff << uint32(((BattlegroundTPScore*)score)->FlagReturns); // flag returns
break;
case BATTLEGROUND_BFG:
data->WriteBits(0x00000002, 24);
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesAssaulted); // bases assaulted
- buff << uint32(((BattlegroundBFGScore*)itr->second)->BasesDefended); // bases defended
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesAssaulted); // bases assaulted
+ buff << uint32(((BattlegroundBFGScore*)score)->BasesDefended); // bases defended
break;
case BATTLEGROUND_NA:
case BATTLEGROUND_BE:
diff --git a/src/server/game/Calendar/CalendarMgr.h b/src/server/game/Calendar/CalendarMgr.h
index fac5a59d2f1..1974804e230 100644
--- a/src/server/game/Calendar/CalendarMgr.h
+++ b/src/server/game/Calendar/CalendarMgr.h
@@ -166,7 +166,7 @@ struct CalendarInvite
void SetStatusTime(time_t statusTime) { _statusTime = statusTime; }
time_t GetStatusTime() const { return _statusTime; }
- void SetText(std::string text) { _text = text; }
+ void SetText(const std::string& text) { _text = text; }
std::string GetText() const { return _text; }
void SetStatus(CalendarInviteStatus status) { _status = status; }
@@ -223,10 +223,10 @@ struct CalendarEvent
void SetGuildId(uint32 guildId) { _guildId = guildId; }
uint32 GetGuildId() const { return _guildId; }
- void SetTitle(std::string title) { _title = title; }
+ void SetTitle(const std::string& title) { _title = title; }
std::string GetTitle() const { return _title; }
- void SetDescription(std::string description) { _description = description; }
+ void SetDescription(const std::string& description) { _description = description; }
std::string GetDescription() const { return _description; }
void SetType(CalendarEventType type) { _type = type; }
diff --git a/src/server/game/Entities/Creature/CreatureGroups.cpp b/src/server/game/Entities/Creature/CreatureGroups.cpp
index f8966ba1923..2a3829b7aeb 100644
--- a/src/server/game/Entities/Creature/CreatureGroups.cpp
+++ b/src/server/game/Entities/Creature/CreatureGroups.cpp
@@ -176,18 +176,20 @@ void CreatureGroup::MemberAttackStart(Creature* member, Unit* target)
if (m_leader) // avoid crash if leader was killed and reset.
TC_LOG_DEBUG(LOG_FILTER_UNITS, "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
- //Skip one check
- if (itr->first == member)
+ Creature* other = itr->first;
+
+ // Skip self
+ if (other == member)
continue;
- if (!itr->first->IsAlive())
+ if (!other->IsAlive())
continue;
- if (itr->first->GetVictim())
+ if (other->GetVictim())
continue;
- if (itr->first->IsValidAttackTarget(target) && itr->first->AI())
- itr->first->AI()->AttackStart(target);
+ if (other->IsValidAttackTarget(target))
+ other->AI()->AttackStart(target);
}
}
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index ca87d6b4a19..f1180df1813 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -1539,7 +1539,7 @@ void Item::ItemContainerSaveLootToDB()
trans->Append(stmt_items);
// Now insert the items
- for (LootItemList::const_iterator _li = loot.items.begin(); _li != loot.items.end(); _li++)
+ for (LootItemList::const_iterator _li = loot.items.begin(); _li != loot.items.end(); ++_li)
{
// When an item is looted, it doesn't get removed from the items collection
// but we don't want to resave it.
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index e7f7be356a6..3c0f7adcfd8 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -512,7 +512,7 @@ struct MovementInfo
float splineElevation;
MovementInfo() :
- guid(0), flags(0), flags2(0), time(0), pitch(0.0f)
+ guid(0), flags(0), flags2(0), time(0), pitch(0.0f), splineElevation(0.0f)
{
pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
transport.Reset();
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index b7321b7c51d..81fac51132a 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1758,7 +1758,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float
return guid;
}
-bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos)
+bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, const Position& pos)
{
CreatureData& data = NewOrExistCreatureData(guid);
if (!data.id)
@@ -7331,7 +7331,7 @@ static LanguageType GetRealmLanguageType(bool create)
}
}
-bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
+bool isValidString(const std::wstring& wstr, uint32 strictMask, bool numericOrSpace, bool create = false)
{
if (strictMask == 0) // any language, ignore realm
{
@@ -7635,7 +7635,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel()
TC_LOG_INFO(LOG_FILTER_SERVER_LOADING, ">> Loaded %u areas for fishing base skill level in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-bool ObjectMgr::CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names)
+bool ObjectMgr::CheckDeclinedNames(const std::wstring& w_ownname, DeclinedName const& names)
{
// get main part of the name
std::wstring mainpart = GetMainPartOfName(w_ownname, 0);
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 622fbe339e4..99833a0a264 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -1134,7 +1134,7 @@ class ObjectMgr
void RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data);
uint32 AddGOData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0, float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0);
uint32 AddCreData(uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
- bool MoveCreData(uint32 guid, uint32 map, Position pos);
+ bool MoveCreData(uint32 guid, uint32 map, const Position& pos);
// reserved names
void LoadReservedPlayersNames();
@@ -1145,7 +1145,7 @@ class ObjectMgr
static PetNameInvalidReason CheckPetName(std::string const& name);
static bool IsValidCharterName(std::string const& name);
- static bool CheckDeclinedNames(std::wstring w_ownname, DeclinedName const& names);
+ static bool CheckDeclinedNames(const std::wstring& w_ownname, DeclinedName const& names);
GameTele const* GetGameTele(uint32 id) const
{
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index ef8e3712af8..af8e7255603 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -1679,7 +1679,7 @@ void Guild::HandleSetMemberNote(WorldSession* session, std::string const& note,
}
}
-void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots)
+void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, const GuildBankRightsAndSlotsVec& rightsAndSlots)
{
// Only leader can modify ranks
if (!_IsLeader(session->GetPlayer()))
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index 9bf52cb08f2..9f6503fcf21 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -778,7 +778,7 @@ public:
void HandleSetNewGuildMaster(WorldSession* session, std::string const& name);
void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string const& name, std::string const& icon);
void HandleSetMemberNote(WorldSession* session, std::string const& note, uint64 guid, bool isPublic);
- void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec rightsAndSlots);
+ void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, GuildBankRightsAndSlotsVec const& rightsAndSlots);
void HandleBuyBankTab(WorldSession* session, uint8 tabId);
void HandleInviteMember(WorldSession* session, std::string const& name);
void HandleAcceptMember(WorldSession* session);
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 75655dca170..037127d160e 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -1253,7 +1253,7 @@ void LootTemplate::AddEntry(LootStoreItem* item)
Entries.push_back(item);
}
-void LootTemplate::CopyConditions(ConditionList conditions)
+void LootTemplate::CopyConditions(const ConditionList& conditions)
{
for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i)
(*i)->conditions.clear();
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index d338f6f503b..c2f74aab701 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -228,7 +228,7 @@ class LootTemplate
void AddEntry(LootStoreItem* item);
// Rolls for every item in the template and adds the rolled items the the loot
void Process(Loot& loot, bool rate, uint16 lootMode, uint8 groupId = 0) const;
- void CopyConditions(ConditionList conditions);
+ void CopyConditions(const ConditionList& conditions);
void CopyConditions(LootItem* li) const;
// True if template includes at least 1 quest drop entry
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 65d9ee4f5ba..1fd762e7446 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -2412,6 +2412,8 @@ bool InstanceMap::AddPlayerToMap(Player* player)
mapSave = sInstanceSaveMgr->AddInstanceSave(GetId(), GetInstanceId(), Difficulty(GetSpawnMode()), 0, true);
}
+ ASSERT(mapSave);
+
// check for existing instance binds
InstancePlayerBind* playerBind = player->GetBoundInstance(GetId(), Difficulty(GetSpawnMode()));
if (playerBind && playerBind->perm)
@@ -2446,10 +2448,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
if (groupBind->save != mapSave)
{
TC_LOG_ERROR(LOG_FILTER_MAPS, "InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName().c_str(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty());
- if (mapSave)
- TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
- else
- TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave NULL");
+ TC_LOG_ERROR(LOG_FILTER_MAPS, "MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount());
if (groupBind->save)
TC_LOG_ERROR(LOG_FILTER_MAPS, "GroupBind save players: %d, group count: %d", groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount());
else
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 94128262388..ecedfe07305 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2283,14 +2283,15 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
// Handle damage modification, shapeshifted druids are not affected
if (target->GetTypeId() == TYPEID_PLAYER && !target->IsInFeralForm())
{
- if (Item* pItem = target->ToPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
+ Player* player = target->ToPlayer();
+ if (Item* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
{
uint8 attacktype = Player::GetAttackBySlot(slot);
if (attacktype < MAX_ATTACK)
{
- target->ToPlayer()->_ApplyWeaponDamage(slot, pItem->GetTemplate(), NULL, !apply);
- target->ToPlayer()->_ApplyWeaponDependentAuraMods(pItem, WeaponAttackType(attacktype), !apply);
+ player->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply);
+ player->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply);
}
}
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index db7e8b35f2f..df819de37c8 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -997,29 +997,6 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
if (!unitTarget || unitTarget->IsInFlight())
return;
- // Pre effects
- switch (m_spellInfo->Id)
- {
- case 66550: // teleports outside (Isle of Conquest)
- if (Player* target = unitTarget->ToPlayer())
- {
- if (target->GetTeamId() == TEAM_ALLIANCE)
- m_targets.SetDst(442.24f, -835.25f, 44.30f, 0.06f, 628);
- else
- m_targets.SetDst(1120.43f, -762.11f, 47.92f, 2.94f, 628);
- }
- break;
- case 66551: // teleports inside (Isle of Conquest)
- if (Player* target = unitTarget->ToPlayer())
- {
- if (target->GetTeamId() == TEAM_ALLIANCE)
- m_targets.SetDst(389.57f, -832.38f, 48.65f, 3.00f, 628);
- else
- m_targets.SetDst(1174.85f, -763.24f, 48.72f, 6.26f, 628);
- }
- break;
- }
-
// If not exist data for dest location - return
if (!m_targets.HasDst())
{
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 721a171917e..4bc390bd27e 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3049,8 +3049,9 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
break;
case 72293: // Mark of the Fallen Champion (Deathbringer Saurfang)
spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF0;
- break;
+ break;
case 38729: // Rod of Purification
+ case 51858: // Siphon of Acherus
case 96946: // Gaze of Occu'thar
case 101005: // Gaze of Occu'thar
spellInfo->AttributesCu |= SPELL_ATTR0_CU_TRIGGERED_BY_CASTER;
@@ -3762,6 +3763,13 @@ void SpellMgr::LoadSpellInfoCorrections()
case 101009: // Gaze of Occu'thar
spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1;
break;
+ // ISLE OF CONQUEST SPELLS
+ //
+ case 66551: // Teleport
+ spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13); // 50000yd
+ break;
+ // ENDOF ISLE OF CONQUEST SPELLS
+ //
default:
break;
}
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 40bfd46e19f..ada26e69c14 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -459,7 +459,7 @@ public:
return false;
}
- if ((pwConfig == PW_EMAIL || pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE)) && !emailConfirmation)
+ if ((pwConfig == PW_EMAIL || (pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE))) && !emailConfirmation)
{
handler->SendSysMessage(LANG_CMD_SYNTAX);
handler->SetSentErrorMessage(true);
@@ -479,7 +479,7 @@ public:
return false;
}
- if ((pwConfig == PW_EMAIL || pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE)) // Either PW_EMAIL or PW_RBAC with the Permission
+ if ((pwConfig == PW_EMAIL || (pwConfig == PW_RBAC && handler->HasPermission(RBAC_PERM_EMAIL_CONFIRM_FOR_PASS_CHANGE))) // Either PW_EMAIL or PW_RBAC with the Permission
&& !AccountMgr::CheckEmail(handler->GetSession()->GetAccountId(), std::string(emailConfirmation)))
{
handler->SendSysMessage(LANG_COMMAND_WRONGEMAIL);
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
index 23e7fa8eb98..1b9955ddaf2 100644
--- a/src/server/scripts/Commands/cs_disable.cpp
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -357,7 +357,7 @@ public:
if (!*args)
return false;
- return HandleAddDisables(handler, args, DISABLE_TYPE_MAP);
+ return HandleRemoveDisables(handler, args, DISABLE_TYPE_MAP);
}
static bool HandleRemoveDisableBattlegroundCommand(ChatHandler* handler, char const* args)
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index dbffaa52593..0994fd510ef 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1172,7 +1172,7 @@ public:
int32 amount = 0;
char *rankTxt = strtok(NULL, " ");
- if (!factionTxt || !rankTxt)
+ if (!factionId || !rankTxt)
return false;
amount = atoi(rankTxt);
diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
index a1f33e57907..1b5a42a83ef 100644
--- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
+++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp
@@ -79,7 +79,7 @@ public:
if (Creature* pBalinda = Unit::GetCreature(*me, balindaGUID))
if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
EnterEvadeMode();
- resetTimer = 5 * IN_MILLISECONDS;
+ resetTimer = 5 * IN_MILLISECONDS;
} else resetTimer -= diff;
DoMeleeAttackIfReady();
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 3f81b517721..84da194aa2d 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -1016,7 +1016,7 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript
else if (_icewall == 3)
me->AI()->Talk(SAY_JAINA_ESCAPE_5);
}
- else if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == ALLIANCE)
+ else if (_instance->GetData(DATA_TEAM_IN_INSTANCE) == HORDE)
{
if (_icewall == 1)
me->AI()->Talk(SAY_SYLVANAS_ESCAPE_3);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index 32a819e2e0d..c77d05e1150 100644
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -215,8 +215,6 @@ bool OutdoorPvPNA::SetupOutdoorPvP()
// halaa
m_obj = new OPvPCapturePointNA(this);
- if (!m_obj)
- return false;
AddCapturePoint(m_obj);
return true;
diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
index 2193d3841a6..54a1ccece51 100644
--- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
+++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
@@ -304,7 +304,7 @@ class instance_blood_furnace : public InstanceMapScript
HandleGameObject(PrisonCell8GUID, false);
}
- void ResetPrisoners(std::set<uint64> prisoners)
+ void ResetPrisoners(const std::set<uint64>& prisoners)
{
for (std::set<uint64>::iterator i = prisoners.begin(); i != prisoners.end(); ++i)
if (Creature* prisoner = instance->GetCreature(*i))
@@ -398,7 +398,7 @@ class instance_blood_furnace : public InstanceMapScript
}
}
- void ActivatePrisoners(std::set<uint64> prisoners)
+ void ActivatePrisoners(const std::set<uint64>& prisoners)
{
for (std::set<uint64>::iterator i = prisoners.begin(); i != prisoners.end(); ++i)
if (Creature* prisoner = instance->GetCreature(*i))
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 8804410d814..919046d3c38 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -2072,8 +2072,6 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader
{
uint32 spellId = 0;
- TC_LOG_DEBUG(LOG_FILTER_SPELLS_AURAS, "spell_q12641_death_comes_from_on_high:: Caster: %s (GUID: %u) On Hit Target: Creature: %s (Entry: %u GUID: %u)",
- GetOriginalCaster()->GetName().c_str(), GetOriginalCaster()->GetGUIDLow(), GetHitCreature()->GetName().c_str(), GetHitCreature()->GetEntry(), GetHitCreature()->GetGUIDLow());
switch (GetHitCreature()->GetEntry())
{
case NPC_NEW_AVALON_FORGE:
@@ -2092,7 +2090,7 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader
return;
}
- GetOriginalCaster()->CastSpell((Unit*)NULL, spellId, true);
+ GetCaster()->CastSpell((Unit*)NULL, spellId, true);
}
void Register() OVERRIDE
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp
index d4bd630ca25..f4da4093dfa 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.cpp
+++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp
@@ -350,13 +350,12 @@ void WheatyExceptionReport::PrintSystemInfo()
//===========================================================================
void WheatyExceptionReport::printTracesForAllThreads()
{
- HANDLE hThreadSnap = INVALID_HANDLE_VALUE;
THREADENTRY32 te32;
DWORD dwOwnerPID = GetCurrentProcessId();
m_hProcess = GetCurrentProcess();
// Take a snapshot of all running threads
- hThreadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
+ HANDLE hThreadSnap = CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0);
if (hThreadSnap == INVALID_HANDLE_VALUE)
return;
diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h
index 0ecc5a9f756..502846fad8e 100644
--- a/src/server/shared/Utilities/Util.h
+++ b/src/server/shared/Utilities/Util.h
@@ -242,7 +242,7 @@ inline bool isNumericOrSpace(wchar_t wchar)
return isNumeric(wchar) || wchar == L' ';
}
-inline bool isBasicLatinString(std::wstring wstr, bool numericOrSpace)
+inline bool isBasicLatinString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isBasicLatinCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
@@ -250,7 +250,7 @@ inline bool isBasicLatinString(std::wstring wstr, bool numericOrSpace)
return true;
}
-inline bool isExtendedLatinString(std::wstring wstr, bool numericOrSpace)
+inline bool isExtendedLatinString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isExtendedLatinCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
@@ -258,7 +258,7 @@ inline bool isExtendedLatinString(std::wstring wstr, bool numericOrSpace)
return true;
}
-inline bool isCyrillicString(std::wstring wstr, bool numericOrSpace)
+inline bool isCyrillicString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isCyrillicCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
@@ -266,7 +266,7 @@ inline bool isCyrillicString(std::wstring wstr, bool numericOrSpace)
return true;
}
-inline bool isEastAsianString(std::wstring wstr, bool numericOrSpace)
+inline bool isEastAsianString(const std::wstring &wstr, bool numericOrSpace)
{
for (size_t i = 0; i < wstr.size(); ++i)
if (!isEastAsianCharacter(wstr[i]) && (!numericOrSpace || !isNumericOrSpace(wstr[i])))
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index e136269e2a0..1ebb58eef1a 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -175,6 +175,8 @@ void CliRunnable::run()
{
#if PLATFORM == PLATFORM_WINDOWS
printf("TC>");
+#else
+ free(command_str);
#endif
continue;
}
@@ -184,6 +186,8 @@ void CliRunnable::run()
{
#if PLATFORM == PLATFORM_WINDOWS
printf("TC>");
+#else
+ free(command_str);
#endif
continue;
}
@@ -192,6 +196,7 @@ void CliRunnable::run()
sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished));
#if PLATFORM != PLATFORM_WINDOWS
add_history(command.c_str());
+ free(command_str);
#endif
}
else if (feof(stdin))
diff --git a/src/tools/map_extractor/loadlib.cpp b/src/tools/map_extractor/loadlib.cpp
index 6a47f2d2a30..d549a0c96f4 100644
--- a/src/tools/map_extractor/loadlib.cpp
+++ b/src/tools/map_extractor/loadlib.cpp
@@ -30,19 +30,17 @@ bool FileLoader::loadFile(HANDLE mpq, char* filename, bool log)
data_size = SFileGetFileSize(file, NULL);
data = new uint8[data_size];
- if (data)
+ SFileReadFile(file, data, data_size, NULL/*bytesRead*/, NULL);
+ if (prepareLoadedData())
{
- SFileReadFile(file, data, data_size, NULL/*bytesRead*/, NULL);
- if (prepareLoadedData())
- {
- SFileCloseFile(file);
- return true;
- }
+ SFileCloseFile(file);
+ return true;
}
printf("Error loading %s\n", filename);
SFileCloseFile(file);
free();
+
return false;
}
diff --git a/src/tools/mmaps_generator/MapBuilder.cpp b/src/tools/mmaps_generator/MapBuilder.cpp
index ab584e27e03..9c2dda51621 100644
--- a/src/tools/mmaps_generator/MapBuilder.cpp
+++ b/src/tools/mmaps_generator/MapBuilder.cpp
@@ -571,19 +571,7 @@ namespace MMAP
// merge per tile poly and detail meshes
rcPolyMesh** pmmerge = new rcPolyMesh*[TILES_PER_MAP * TILES_PER_MAP];
- if (!pmmerge)
- {
- printf("%s alloc pmmerge FIALED!\n", tileString);
- return;
- }
-
rcPolyMeshDetail** dmmerge = new rcPolyMeshDetail*[TILES_PER_MAP * TILES_PER_MAP];
- if (!dmmerge)
- {
- printf("%s alloc dmmerge FIALED!\n", tileString);
- return;
- }
-
int nmerge = 0;
// build all tiles
for (int y = 0; y < TILES_PER_MAP; ++y)
@@ -678,12 +666,9 @@ namespace MMAP
rcFreeContourSet(tile.cset);
tile.cset = NULL;
- if (tile.pmesh)
- {
- pmmerge[nmerge] = tile.pmesh;
- dmmerge[nmerge] = tile.dmesh;
- nmerge++;
- }
+ pmmerge[nmerge] = tile.pmesh;
+ dmmerge[nmerge] = tile.dmesh;
+ nmerge++;
}
}