aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_06_07_00_world_gossip.sql2
-rw-r--r--sql/updates/world/2012_06_09_00_world_creature.sql21
-rw-r--r--sql/updates/world/2012_06_12_00_world_transport.sql82
-rw-r--r--sql/updates/world/2012_06_13_00_world_creature.sql71
-rw-r--r--sql/updates/world/2012_06_13_01_world_creature.sql11
-rw-r--r--sql/updates/world/2012_06_13_02_world_gossip.sql32
-rw-r--r--sql/updates/world/2012_06_13_03_world_sai.sql70
-rw-r--r--sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql5
-rw-r--r--sql/updates/world/2012_06_14_01_world_spell_linked_spell.sql51
-rw-r--r--sql/updates/world/2012_06_14_02_world_spell_bonus_data.sql102
-rw-r--r--sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql94
-rw-r--r--sql/updates/world/2012_06_14_03_world_spell_ranks.sql5
-rw-r--r--sql/updates/world/2012_06_14_04_world_spell_script_names.sql62
-rw-r--r--sql/updates/world/2012_06_14_05_world_spelldifficulty_dbc.sql6
-rw-r--r--sql/updates/world/2012_06_14_06_world_conditions.sql7
-rw-r--r--sql/updates/world/2012_06_14_07_world_spell_bonus_data.sql (renamed from sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql)0
-rw-r--r--sql/updates/world/2012_06_14_08_world_spell_script_names.sql (renamed from sql/updates/world/2012_06_09_00_world_spell_script_names.sql)0
-rw-r--r--src/server/game/AI/CoreAI/GameObjectAI.h3
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.cpp16
-rwxr-xr-xsrc/server/game/AI/CoreAI/PetAI.h1
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp5
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h51
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp13
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp1
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h12
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.cpp12
-rwxr-xr-xsrc/server/game/Battlegrounds/BattlegroundMgr.h2
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp49
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.h1
-rw-r--r--src/server/game/DungeonFinding/LFGScripts.cpp7
-rwxr-xr-xsrc/server/game/Entities/GameObject/GameObject.cpp8
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp8
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h1
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp94
-rwxr-xr-xsrc/server/game/Groups/Group.cpp14
-rwxr-xr-xsrc/server/game/Groups/Group.h8
-rwxr-xr-xsrc/server/game/Groups/GroupRefManager.h3
-rwxr-xr-xsrc/server/game/Groups/GroupReference.h1
-rwxr-xr-xsrc/server/game/Handlers/QuestHandler.cpp2
-rw-r--r--src/server/game/Server/Protocol/PacketLog.cpp3
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp265
-rwxr-xr-xsrc/server/game/Spells/Spell.cpp182
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp371
-rw-r--r--src/server/game/Spells/SpellInfo.cpp1
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp24
-rw-r--r--src/server/game/Warden/Warden.cpp6
-rwxr-xr-xsrc/server/game/World/World.cpp1
-rwxr-xr-xsrc/server/game/World/World.h1
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp46
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp140
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp102
-rwxr-xr-xsrc/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp62
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp66
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp39
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp42
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp86
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp78
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp42
-rw-r--r--src/server/scripts/Outland/GruulsLair/boss_gruul.cpp89
-rw-r--r--src/server/scripts/Outland/boss_doomlord_kazzak.cpp54
-rw-r--r--src/server/scripts/Outland/netherstorm.cpp8
-rw-r--r--src/server/scripts/Spells/CMakeLists.txt1
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp4
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp287
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp389
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp82
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp47
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp119
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp1544
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp46
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp100
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp104
-rw-r--r--src/server/worldserver/worldserver.conf.dist7
-rw-r--r--src/tools/map_extractor/System.cpp12
74 files changed, 4262 insertions, 1121 deletions
diff --git a/sql/updates/world/2012_06_07_00_world_gossip.sql b/sql/updates/world/2012_06_07_00_world_gossip.sql
index 1fe4a23bc5a..aac3ac53e74 100644
--- a/sql/updates/world/2012_06_07_00_world_gossip.sql
+++ b/sql/updates/world/2012_06_07_00_world_gossip.sql
@@ -9,7 +9,7 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_
(@NPC,0,2,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Charles Worth - On Gossip Select - Close Gossip');
-- Add missing Gossip for Charles Worth
DELETE FROM `gossip_menu` WHERE `entry` IN (10136,10138);
-DELETE FROM `gossip_menu` WHERE `entry`=14076 AND `text_id`=14076;
+DELETE FROM `gossip_menu` WHERE `entry`=10118 AND `text_id`=14076;
INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10136,14072),(10138,14074),(10118,14076);
-- Add Gossip Options
DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP AND `id` IN (2,3,4,5);
diff --git a/sql/updates/world/2012_06_09_00_world_creature.sql b/sql/updates/world/2012_06_09_00_world_creature.sql
new file mode 100644
index 00000000000..b2454b54163
--- /dev/null
+++ b/sql/updates/world/2012_06_09_00_world_creature.sql
@@ -0,0 +1,21 @@
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=36725; -- Nerub'ar Broodkeeper
+
+DELETE FROM `creature` WHERE `guid` IN (200939,200949,200956,201106,201127,201170);
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES
+(200939,36725,631,15,1,-210.3750,2202.675,75.09233,0.13962630,7200,0,0), -- Nerub'ar Broodkeeper
+(200949,36725,631,15,1,-220.3819,2177.068,81.70050,0.85521130,7200,0,0), -- Nerub'ar Broodkeeper
+(200956,36725,631,15,1,-216.4861,2245.405,81.70050,5.18362800,7200,0,0), -- Nerub'ar Broodkeeper
+(201106,36725,631,15,1,-211.2899,2219.420,75.09233,0.15707960,7200,0,0), -- Nerub'ar Broodkeeper
+(201127,36725,631,15,1,-249.8542,2219.672,86.27979,5.95157300,7200,0,0), -- Nerub'ar Broodkeeper
+(201170,36725,631,15,1,-250.6129,2203.800,86.27979,0.03490658,7200,0,0); -- Nerub'ar Broodkeeper
+
+DELETE FROM `creature_addon` WHERE `guid` IN (200912,200934,200939,200949,200956,201106,201127,201170);
+INSERT INTO `creature_addon` (`guid`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES
+(200912,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(200934,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(200939,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(200949,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(200956,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(201106,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(201127,0,0x3000000,0x1,''), -- Nerub'ar Broodkeeper
+(201170,0,0x3000000,0x1,''); -- Nerub'ar Broodkeeper
diff --git a/sql/updates/world/2012_06_12_00_world_transport.sql b/sql/updates/world/2012_06_12_00_world_transport.sql
new file mode 100644
index 00000000000..3099292f48d
--- /dev/null
+++ b/sql/updates/world/2012_06_12_00_world_transport.sql
@@ -0,0 +1,82 @@
+-- Zeppelin: <The Zephyr> "Durotar to Thunder Bluff"
+SET @GUID := 43468;
+DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+11;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
+(@GUID,3084,647,1,1,0,0,-4.83257,-4.312334,-17.63218,1.623156,180,0,0,1,0,0), -- Bluffwatcher
+(@GUID+1,3084,647,1,1,0,0,-5.206744,-11.34318,-17.61012,4.712389,180,0,0,1,0,0), -- Bluffwatcher
+(@GUID+2,24934,647,1,1,0,0,10.32099,-3.573514,-23.49413,3.176499,180,0,0,1,0,0), -- Snack-O-Matic IV
+(@GUID+3,24935,647,1,1,0,0,10.2871,-12.02722,-23.49424,3.106686,180,0,0,1,0,0), -- Vend-O-Tron D-Luxe
+(@GUID+4,25075,647,1,1,0,0,-3.396398,-7.905448,-23.69672,6.248279,180,0,0,1,0,0), -- Zeppelin Controls
+(@GUID+5,34715,647,1,1,0,0,-9.183155,-7.775729,-17.21699,3.281219,180,0,0,1,0,0), -- Sky-Captain "Dusty" Blastnut <The Zephyr>
+(@GUID+6,34717,647,1,1,0,0,-13.67017,-12.40177,-15.98756,4.590216,180,0,0,1,0,2), -- Crewman Pipewrench <The Zephyr>
+(@GUID+7,34718,647,1,1,0,0,13.74505,-5.128461,-24.04518,0.1396263,180,0,0,1,0,0), -- Crewman Deadbolt <The Zephyr>
+(@GUID+8,34719,647,1,1,0,0,7.623085,-5.025319,-17.67015,4.921828,180,0,0,1,0,0), -- Crewman Grit <The Zephyr>
+(@GUID+9,34721,647,1,1,0,0,-0.919197,-6.164221,-23.67286,3.577925,180,0,0,1,0,0), -- Chief Officer Ograh <The Zephyr>
+(@GUID+10,34723,647,1,1,0,0,-17.47968,-5.606984,-14.92807,3.228859,180,0,0,1,0,0), -- Watcher Tolwe <The Zephyr>
+(@GUID+11,34730,647,1,1,0,0,-2.166869,-7.854215,-23.6919,3.385939,180,0,0,1,0,0); -- Navigator Zippik <The Zephyr>
+DELETE FROM `creature_template_addon` WHERE `entry` IN (34718,34719);
+INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`,`emote`) VALUES
+(34718,3,1,0),(34719,0,1,133);
+-- Pathing for Crewman Pipewrench <The Zephyr> Entry: 34717
+SET @NPC := @GUID+6;
+SET @PATH := @NPC * 10;
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,1,69, '');
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,-13.66992,-12.40186,-16.09792,4.590216,26000,0,0,100,0),
+(@PATH,2,-14.49512,-9.873911,-15.99125,0,0,0,0,100,0),
+(@PATH,3,-14.49512,-6.373911,-15.99125,0,0,0,0,100,0),
+(@PATH,4,-14.31525,-3.41333,-15.88589,0,24000,0,0,100,0);
+-- Zeppelin: <The Zephyr> SAI
+SET @ENTRY := 190549;
+UPDATE `gameobject_template` SET `AIName`= 'SmartGameObjectAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=1;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100,@ENTRY*100+1,@ENTRY*100+2,@ENTRY*100+3) AND `source_type`=9;
+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
+(@ENTRY,1,0,0,71,0,100,0,21868,0,0,0,80,@ENTRY*100 ,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: <The Zephyr> - Event Dock Orgrimmar - Run Script'),
+(@ENTRY,1,1,0,71,0,100,0,21869,0,0,0,80,@ENTRY*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: <The Zephyr> - Event Leave Orgrimmar - Run Script'),
+(@ENTRY,1,2,0,71,0,100,0,21870,0,0,0,80,@ENTRY*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: <The Zephyr> - Event Dock Thunder Bluff - Run Script'),
+(@ENTRY,1,3,0,71,0,100,0,21871,0,0,0,80,@ENTRY*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeppelin: <The Zephyr> - Event Leave Thunder Bluff - Run Script'),
+-- Script 0
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 0'),
+(@ENTRY*100,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 1'),
+(@ENTRY*100,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34765,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Zelli Hotnozzle Say 0'),
+(@ENTRY*100,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut emote'),
+(@ENTRY*100,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote'),
+-- Script 1
+(@ENTRY*100+1,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 1'),
+(@ENTRY*100+1,9,1,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 0'),
+(@ENTRY*100+1,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote'),
+-- Script 2
+(@ENTRY*100+2,9,0,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 2'),
+(@ENTRY*100+2,9,1,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 1'),
+(@ENTRY*100+2,9,2,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,19,34766,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Krendle Bigpockets Say 0'),
+(@ENTRY*100+2,9,3,0,0,0,100,0,3000,3000,0,0,5,5,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut emote'),
+(@ENTRY*100+2,9,4,0,0,0,100,0,1000,1000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote'),
+-- Script 3
+(@ENTRY*100+3,9,0,0,0,0,100,0,0,0,0,0,1,3,0,0,0,0,0,19,34715,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Sky-Captain Blastnut Say 3'),
+(@ENTRY*100+3,9,1,0,0,0,100,0,0,0,0,0,1,2,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh Say 2'),
+(@ENTRY*100+3,9,2,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,19,34721,100,0,0,0,0,0,'Zeppelin: <The Zephyr> - Script Dock Orgrimmar - Chief Officer Ograh emote');
+-- Watcher Tolwe <The Zephyr> SAI
+SET @ENTRY := 34723;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY 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
+(@ENTRY,0,0,0,1,0,100,0,60000,120000,60000,120000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Watcher Tolwe <The Zephyr> - OOC - Say Random');
+-- Text for Watcher Tolwe, Sky-Captain Blastnut, Chief Officer Ograh, Krendle Bigpockets, & Zelli Hotnozzle
+DELETE FROM `creature_text` WHERE `entry` IN (34723,34715,34721,34766,34765);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(34723,0,0,'Dat cloud look like da Warchief.',12,1,100,25,0,0,'Watcher Tolwe - Random'),
+(34723,0,1,'Dere be a bug.',12,1,100,25,0,0,'Watcher Tolwe - Random'),
+(34723,0,2,'Ware da ship! A harpy! ...wait, dat be another bird.',12,1,100,25,0,0,'Watcher Tolwe - Random'),
+(34723,0,3,'Dere be a bird!',12,1,100,25,0,0,'Watcher Tolwe - Random'),
+(34715,0,0,'And there''s Orgrimmar, huge and menacing like always. Take a quick break, boys, then it''s back to the Bluff!',12,1,100,1,0,0,'Sky-Captain Blastnut - Dock at Orgrimmar'), -- wait 3 sec do emote 5
+(34715,1,0,'Next stop, Thunder Bluff',12,1,100,5,0,0,'Sky-Captain Blastnut - Leave for Thunder Bluff'),
+(34715,2,0,'Watch your step! Don''t want you becoming a smudge down there. Welcome to Thunder Bluff!',12,1,100,1,0,0,'Sky-Captain Blastnut - Dock at Thunder Bluff'), -- wait 3 sec do emote 5
+(34715,3,0,'Okay, boys, let''s get this baby over to Orgrimmar!',12,1,100,25,0,0,'Sky-Captain Blastnut - Leave for Orgrimmar'),
+(34721,0,0,'Move it, Zippik! We don''t have all day!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Thunder Bluff'),
+(34721,1,0,'Careful. CAREFUL! Did I feel a shudder? You''re going to knock that tower down, oaf!',12,1,100,5,0,0,'Chief Officer Ograh - Dock at Thunder Bluff'), -- wait 4 sec do emote 25
+(34721,2,0,'We''re behind schedule! Turn this tub east! EAST!',12,1,100,5,0,0,'Chief Officer Ograh - Leave for Orgrimmar'),
+(34766,0,0,'Step right up! The zeppelin to Orgrimmar has arrived! All aboard to Durotar!',14,0,100,22,0,11804,'Krendle Bigpockets - Dock at Thunder Bluff'),
+(34765,0,0,'The zeppelin to Thunder Bluff has arrived! All aboard for a smooth ride across the Barrens!',14,0,100,22,0,11804,'Zelli Hotnozzle - Dock at Orgrimmar');
diff --git a/sql/updates/world/2012_06_13_00_world_creature.sql b/sql/updates/world/2012_06_13_00_world_creature.sql
new file mode 100644
index 00000000000..0d2aa74c9c7
--- /dev/null
+++ b/sql/updates/world/2012_06_13_00_world_creature.sql
@@ -0,0 +1,71 @@
+-- Pathing for Violetta (32720)
+SET @NPC := 32720;
+SET @GUID := 12402;
+DELETE FROM `creature` WHERE `guid`=@GUID;
+DELETE FROM `creature` WHERE `id`=@NPC;
+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 (@GUID,@NPC,571,1,1,0,0,5693.527,680.9248,645.9013,4.681826,300,0,0,1,0,0,0,0,0);
+DELETE FROM `creature_template_addon` WHERE `entry`=@NPC;
+INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
+(@NPC,0,0,0,1,0,'');
+-- SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@NPC;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@NPC AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC*100+0,@NPC*100+1,@NPC*100+2,@NPC*100+3) AND `source_type`=9;
+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,0,0,1,25,0,100,0,0,0,0,0,71,1670,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On reset - Equip default"),
+(@NPC,0,1,0,61,0,100,0,0,0,0,0,88,@NPC*100+0,@NPC*100+1,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On reset - Run random script"),
+(@NPC,0,2,0,40,1,100,0,8,0,0,0,80,@NPC*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp8 - Run script"),
+(@NPC,0,3,0,40,2,100,0,8,0,0,0,80,@NPC*100+3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp8 - Run script"),
+(@NPC,0,4,0,58,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On wp end - Despawn"),
+(@NPC*100+0,9,0,0,0,0,100,0,0,0,0,0,53,0,@NPC*10+0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 1 - Start waypoint 1"),
+(@NPC*100+0,9,1,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 1 - Set phase 1"),
+(@NPC*100+1,9,0,0,0,0,100,0,0,0,0,0,53,0,@NPC*10+1,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 2 - Start waypoint 2"),
+(@NPC*100+1,9,1,0,0,0,100,0,0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script 2 - Set phase 2"),
+(@NPC*100+2,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Pause WP 10 seconds"),
+(@NPC*100+2,9,1,0,0,0,100,0,5000,5000,5000,5000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Emote talk"),
+(@NPC*100+2,9,2,0,0,0,100,0,3000,3000,3000,3000,71,0,0,44655,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Equip item"),
+(@NPC*100+3,9,0,0,0,0,100,0,0,0,0,0,54,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Pause WP 10 seconds"),
+(@NPC*100+3,9,1,0,0,0,100,0,5000,5000,5000,5000,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Emote talk"),
+(@NPC*100+3,9,2,0,0,0,100,0,3000,3000,3000,3000,71,0,0,40020,0,0,0,1,0,0,0,0,0,0,0,"Violetta - On script - Equip item");
+-- Waypoints
+DELETE FROM `waypoints` WHERE `entry` IN (@NPC*10+0,@NPC*10+1);
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@NPC*10+0,1,5693.35,675.1416,645.6994,'Violetta wp1'),
+(@NPC*10+0,2,5690.851,664.07,646.2488,'Violetta wp1'),
+(@NPC*10+0,3,5686.851,656.5425,646.5913,'Violetta wp1'),
+(@NPC*10+0,4,5679.384,648.7989,646.6834,'Violetta wp1'),
+(@NPC*10+0,5,5675.498,647.6321,647.0242,'Violetta wp1'),
+(@NPC*10+0,6,5669.809,645.4785,647.9725,'Violetta wp1'),
+(@NPC*10+0,7,5664.492,643.8845,647.98,'Violetta wp1'),
+(@NPC*10+0,8,5664.87,642.0466,647.98,'Violetta wp1'),
+(@NPC*10+0,9,5669.127,645.5728,647.9717,'Violetta wp1'),
+(@NPC*10+0,10,5675.875,647.3784,647.0391,'Violetta wp1'),
+(@NPC*10+0,11,5681.011,648.9694,646.6834,'Violetta wp1'),
+(@NPC*10+0,12,5683.774,658.9824,646.6004,'Violetta wp1'),
+(@NPC*10+0,13,5682.824,671.3663,647.0424,'Violetta wp1'),
+(@NPC*10+0,14,5677.113,674.4891,649.4763,'Violetta wp1'),
+(@NPC*10+0,15,5667.89,677.9095,652.0448,'Violetta wp1'),
+(@NPC*10+0,16,5655.117,684.3335,651.9886,'Violetta wp1'),
+(@NPC*10+0,17,5649.896,690.4983,651.9928,'Violetta wp1'),
+(@NPC*10+0,18,5646.092,697.507,651.9928,'Violetta wp1'),
+(@NPC*10+0,19,5646.725,700.2504,651.9928,'Violetta wp1'),
+(@NPC*10+1,1,5693.35,675.1416,645.6994,'Violetta wp2'),
+(@NPC*10+1,2,5690.851,664.07,646.2488,'Violetta wp2'),
+(@NPC*10+1,3,5686.851,656.5425,646.5913,'Violetta wp2'),
+(@NPC*10+1,4,5679.384,648.7989,646.6834,'Violetta wp2'),
+(@NPC*10+1,5,5675.498,647.6321,647.0242,'Violetta wp2'),
+(@NPC*10+1,6,5669.809,645.4785,647.9725,'Violetta wp2'),
+(@NPC*10+1,7,5664.369,644.7076,647.9811,'Violetta wp2'),
+(@NPC*10+1,8,5661.005,643.9919,647.9821,'Violetta wp2'),
+(@NPC*10+1,9,5669.143,645.5861,647.9418,'Violetta wp2'),
+(@NPC*10+1,10,5675.875,647.3784,647.0391,'Violetta wp2'),
+(@NPC*10+1,11,5681.011,648.9694,646.6834,'Violetta wp2'),
+(@NPC*10+1,12,5683.774,658.9824,646.6004,'Violetta wp2'),
+(@NPC*10+1,13,5682.824,671.3663,647.0424,'Violetta wp2'),
+(@NPC*10+1,14,5677.113,674.4891,649.4763,'Violetta wp2'),
+(@NPC*10+1,15,5667.89,677.9095,652.0448,'Violetta wp2'),
+(@NPC*10+1,16,5655.117,684.3335,651.9886,'Violetta wp2'),
+(@NPC*10+1,17,5649.896,690.4983,651.9928,'Violetta wp2'),
+(@NPC*10+1,18,5646.092,697.507,651.9928,'Violetta wp2'),
+(@NPC*10+1,19,5646.725,700.2504,651.9928,'Violetta wp2');
diff --git a/sql/updates/world/2012_06_13_01_world_creature.sql b/sql/updates/world/2012_06_13_01_world_creature.sql
new file mode 100644
index 00000000000..5ba3e0d34a2
--- /dev/null
+++ b/sql/updates/world/2012_06_13_01_world_creature.sql
@@ -0,0 +1,11 @@
+DELETE FROM `creature_template_addon` WHERE `entry` = 29975;
+INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES
+(29975, 0, 0x10000, 0x1, 54503); -- Lok'lira the Crone - Quest Invisibility 2
+
+DELETE FROM `creature` WHERE `id` = 29975 OR `guid` = 2593;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(2593, 29975, 571, 1, 1, 6922.175, -1534.575, 836.1568, 4.276057, 120, 0, 0); -- Lok'lira the Crone (Area: Brunnhildar Village)
+
+DELETE FROM `spell_area` WHERE `spell` = 54504;
+INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES
+(54504,4422,12921,1,0,0,0,2,1); -- cast see quest invisibility 2 after accepting the quest from lok'lira.
diff --git a/sql/updates/world/2012_06_13_02_world_gossip.sql b/sql/updates/world/2012_06_13_02_world_gossip.sql
new file mode 100644
index 00000000000..2cac9fe2a0a
--- /dev/null
+++ b/sql/updates/world/2012_06_13_02_world_gossip.sql
@@ -0,0 +1,32 @@
+-- Missing gossip for Krendle Bigpockets <Durotar Zeppelin Master> in Thunder Bluff
+UPDATE `creature_template` SET `gossip_menu_id`=10566 WHERE `entry`=34766;
+DELETE FROM `gossip_menu` WHERE `entry`=10566 AND `text_id`=14622;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10566,14622);
+-- Missing gossip
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=7368 AND `id` IN (3,4);
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES
+(7368,3,0,'Acteon, where is the best area to hunt for moongraze stags?',1,1,7423,0,0,0,''),
+(7368,4,0,'Acteon, where is the best place to hunt moongraze bucks?',1,1,7424,0,0,0,'');
+-- conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=7368 AND `SourceEntry` IN (3,4);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,7368,3,0,0,9,9454,0,0,0,0,'','Acteon - Show gossip option if player has quest 9454'),
+(15,7368,4,0,0,9,10324,0,0,0,0,'','Acteon - Show gossip option if player has quest 10324');
+-- Gossip Condition for Archmage Celindra <Portal Trainer>
+SET @GOSSIP := 9777;
+SET @TEXTNO := 13455;
+SET @TEXTYES := 13456;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,@GOSSIP,@TEXTNO,0,15,1407,0,0,0,'','Show gossip text if player is not a mage'),
+(14,@GOSSIP,@TEXTYES,0,15,128,0,0,0,'','Show gossip text if player is a mage');
+-- Update NPC 4217 Mathrengyl Bearwalker
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=1403 AND `id`=3;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES
+(1403,3,1,'I''d like to purchase more Tharlendris seeds.',3,128,0,0,0,0,'');
+-- conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1403 AND `SourceEntry`=3;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,1403,3,0,0,8,3781,0,0,0,0,'','Mathrengyl Bearwalker - Show gossip option if player has rewarded quest 3781'); -- available only for druids
+ -- Quest 3792 should only be available after quest 3791
+UPDATE `quest_template` SET `PrevQuestId`=3791 WHERE `id`=3792;
diff --git a/sql/updates/world/2012_06_13_03_world_sai.sql b/sql/updates/world/2012_06_13_03_world_sai.sql
new file mode 100644
index 00000000000..ad9642447c0
--- /dev/null
+++ b/sql/updates/world/2012_06_13_03_world_sai.sql
@@ -0,0 +1,70 @@
+-- Grand Anchorite Almonen SAI
+SET @ENTRY := 19216;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@ENTRY*100) AND `source_type`=9;
+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
+(@ENTRY,0,0,0,1,0,100,0,10000,10000,300000,300000,80,@ENTRY*100 ,0,0,0,0,0,1,0,0,0,0,0,0,0,'Sky-Captain Cloudkicker - OOC - Run Script'),
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.654867,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,1,0,0,0,100,0,9000,9000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - emote'),
+(@ENTRY*100,9,2,0,0,0,100,0,23000,23000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.72,5423.082,-10.45947,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,3,0,0,0,100,0,800,800,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.598,5411.999,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,4,0,0,0,100,0,5000,5000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.183628,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,5,0,0,0,100,0,100,100,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 0'),
+(@ENTRY*100,9,6,0,0,0,100,0,9000,9000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 1'),
+(@ENTRY*100,9,7,0,0,0,100,0,9000,9000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 2'),
+(@ENTRY*100,9,8,0,0,0,100,0,25000,25000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 3'),
+(@ENTRY*100,9,9,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.699,5413.06,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,10,0,0,0,100,0,100,100,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 4'),
+(@ENTRY*100,9,11,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1848.775,5412.81,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,12,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.276057,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,13,0,0,0,100,0,4000,4000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 5'),
+(@ENTRY*100,9,14,0,0,0,100,0,7000,7000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.574,5412.084,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,15,0,0,0,100,0,1900,1900,0,0,69,0,0,0,0,0,0,8,0,0,0,-1856.307,5410.266,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,16,0,0,0,100,0,1900,1900,0,0,69,0,0,0,0,0,0,8,0,0,0,-1859.002,5406.959,-12.42814,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,17,0,0,0,100,0,3000,3000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.707227,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,18,0,0,0,100,0,100,100,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 6'),
+(@ENTRY*100,9,19,0,0,0,100,0,10000,10000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 7'),
+(@ENTRY*100,9,20,0,0,0,100,0,9000,9000,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 8'),
+(@ENTRY*100,9,21,0,0,0,100,0,5000,5000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1855.089,5410.676,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,22,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1853.62,5409.833,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,23,0,0,0,100,0,3000,3000,0,0,1,9,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 9'),
+(@ENTRY*100,9,24,0,0,0,100,0,11000,11000,0,0,1,10,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 10'),
+(@ENTRY*100,9,25,0,0,0,100,0,9000,9000,0,0,1,11,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 11'),
+(@ENTRY*100,9,26,0,0,0,100,0,100,100,0,0,69,0,0,0,0,0,0,8,0,0,0,-1852.503,5412.286,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,27,0,0,0,100,0,1000,1000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1849.053,5415.075,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,28,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.340707,'Grand Anchorite Almonen - Script - Turn to'),
+(@ENTRY*100,9,29,0,0,0,100,0,5000,5000,0,0,1,12,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 12'),
+(@ENTRY*100,9,30,0,0,0,100,0,11000,11000,0,0,1,13,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 13'),
+(@ENTRY*100,9,31,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1851.643,5414.012,-12.42816,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,32,0,0,0,100,0,1200,1200,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.913,5412.682,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,33,0,0,0,100,0,800,800,0,0,69,0,0,0,0,0,0,8,0,0,0,-1854.408,5411.227,-12.42815,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,34,0,0,0,100,0,1000,1000,0,0,1,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 14'),
+(@ENTRY*100,9,35,0,0,0,100,0,10000,10000,0,0,1,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 15'),
+(@ENTRY*100,9,36,0,0,0,100,0,7000,7000,0,0,1,16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 16'),
+(@ENTRY*100,9,37,0,0,0,100,0,10000,10000,0,0,1,17,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 17'),
+(@ENTRY*100,9,38,0,0,0,100,0,11000,11000,0,0,1,18,0,0,0,0,0,1,0,0,0,0,0,0,0,'Grand Anchorite Almonen - Script - say 18'),
+(@ENTRY*100,9,39,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,-1853.137,5424.863,-10.47787,0,'Grand Anchorite Almonen - Script - move to'),
+(@ENTRY*100,9,40,0,0,0,100,0,6500,6500,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.6529,'Grand Anchorite Almonen - Script - Turn to');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=19216;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(19216,0,0, 'Friends, it is my great pleasure to welcome you to the temple today.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,1,0, 'A''dal has been most generous in his revelations to me, a humble servant of the Light.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,2,0, 'In accordance with my divine calling, I must share these revealed truths to all who would hear.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,3,0, 'It has been made known to me that inside each of us, the Light resides...',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,4,0, '...that it is a gift, given freely to all naturally born beings.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,5,0, 'It manifests itself as a feeling, small at first and easily ignored, that confirms truths and subtly prods one to do good.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,6,0, 'Simple kindnesses, charitable deeds, service to those in need. These are all fruits of the Light.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,7,0, 'It rewards those who heed its promptings with blessings, both seen and unseen.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,8,0, 'Personal reservoirs of hope and faith are strengthened, and one''s capacity for greater light increases.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,9,0, 'Over the course of time, through obedience to the Light''s guidance, one becomes more sensitive to its voice, and its power.',12,0,100,273,0,0, 'Grand Anchorite Almonen'),
+(19216,10,0, 'Great is the healing and blessing power of the Light''s most diligent followers.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,11,0, 'Sadly, there are those who wander through mortality in defiance of the Light.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,12,0, 'From these the Light withdraws, until only darkness remains.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,13,0, 'Where there is no light, despair, loathing and rage thrive.',12,0,100,5,0,0, 'Grand Anchorite Almonen'),
+(19216,14,0, 'We are born into a perilous age, where the forces of darkness are determined to bring about our destruction.',12,0,100,1,0,0, 'Grand Anchorite Almonen'),
+(19216,15,0, 'These are the times to find yourselves in unison with the Light.',12,0,100,5,0,0, 'Grand Anchorite Almonen'),
+(19216,16,0, 'Hear my words, and let the Light inside of you confirm the truth of them.',12,0,100,0,0,0, 'Grand Anchorite Almonen'),
+(19216,17,0, 'Embrace the light that is in you, my friends! Deny yourself all darkness...',12,0,100,5,0,0, 'Grand Anchorite Almonen'),
+(19216,18,0, 'We must endure these trying times faithfully, and one day we will find ourselves victorious.',12,0,100,5,0,0, 'Grand Anchorite Almonen');
diff --git a/sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql b/sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..85cae64c21d
--- /dev/null
+++ b/sql/updates/world/2012_06_14_00_world_spell_linked_spell.sql
@@ -0,0 +1,5 @@
+-- Fix Surge of Adrenaline
+DELETE FROM `spell_linked_spell` WHERE `spell_effect`=68667;
+INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES
+(-66683,68667,0, 'Icehowl - Surge of Adrenaline'),
+(-67660,68667,0, 'Icehowl - Surge of Adrenaline');
diff --git a/sql/updates/world/2012_06_14_01_world_spell_linked_spell.sql b/sql/updates/world/2012_06_14_01_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..6109c8db068
--- /dev/null
+++ b/sql/updates/world/2012_06_14_01_world_spell_linked_spell.sql
@@ -0,0 +1,51 @@
+-- delete 'Mangle - Remover'
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33876 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33878 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33982 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33983 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33986 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=33987 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48563 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-48566 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-48565 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33983 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33982 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48564 AND `spell_effect`=-33876 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48565 AND `spell_effect`=-33878 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-48564 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-48563 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33987 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33986 AND `type`=1;
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48566 AND `spell_effect`=-33878 AND `type`=1;
diff --git a/sql/updates/world/2012_06_14_02_world_spell_bonus_data.sql b/sql/updates/world/2012_06_14_02_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..b7f61f407b4
--- /dev/null
+++ b/sql/updates/world/2012_06_14_02_world_spell_bonus_data.sql
@@ -0,0 +1,102 @@
+-- Death Knight
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(58621, 47632, 47633, 50444, 70890, 50526, 48982, 59754, 49184);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(58621, 0, -1, 0.08, -1, 'Death Knight - Glyph of Chains of Ice'), -- Shouldn't scale with SP.
+(47632, 0, -1, 0.15, -1, 'Death Knight - Death Coil'), -- Shouldn't scale with SP.
+(47633, 0, -1, 0.15, -1, 'Death Knight - Death Coil (Heal)'), -- Shouldn't scale with SP.
+(50444, 0, -1, 0.105, -1, 'Death Knight - Corpse Explosion (Triggered)'), -- Shouldn't scale with SP.
+(70890, 0, -1, -1, -1, 'Death Knight - Scourge Strike (Shadow)'), -- Shouldn't scale with SP.
+(50526, 0, -1, -1, -1, 'Death Knight - Wandering Plague (Triggered)'), -- Shouldn't scale with SP.
+(48982, 0, -1, -1, -1, 'Death Knight - Rune Tap'), -- Shouldn't scale with SP.
+(59754, 0, -1, -1, -1, 'Death Knight - Glyph of Rune Tap (Triggered)'), -- Shouldn't scale with SP.
+(49184, 0, -1, 0.2, -1, 'Death Knight - Howling Blast'); -- Shouldn't scale with SP.
+
+-- Druid
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(48450, 48451); -- Lifebloom Rank 2, Rank 3
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(48567, 48568); -- Lacerate Rank 2, Rank 3
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(33745, 9007);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(33745, 0, 0, 0.01, 0.01, 'Druid - Lacerate ($AP*0.05/number of ticks)'), -- Direct damage should scale with AP, based on DrDamage addon(3.3.5a).
+(9007, -1, 0, -1, 0.03, 'Druid - Pounce Bleed (Triggered)'); -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+
+-- Hunter
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(56641, 42243, 3674, 19306, 1495, 63468, 136);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(56641, 0, -1, 0.1, -1, 'Hunter - Steady Shot'), -- Shouldn't scale with SP.
+(42243, 0, -1, 0.0837, -1, 'Hunter - Volley (Triggered)'), -- Shouldn't scale with SP.
+(3674, -1, 0, -1, 0.023, 'Hunter - Black Arrow ($RAP*0.1 / number of ticks)'), -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a).
+(19306, 0, -1, 0.2, -1, 'Hunter - Counterattack'), -- Shouldn't scale with SP.
+(1495, 0, -1, 0.2, -1, 'Hunter - Mongoose Bite'), -- Shouldn't scale with SP.
+(63468, -1, 0, -1, -1, 'Hunter - Piercing Shots'), -- Shouldn't scale with SP.
+(136, -1, 0, -1, -1, 'Hunter - Mend Pet'); -- Shouldn't scale with SP.
+
+-- Mage
+DELETE FROM `spell_bonus_data` WHERE `entry`=7269; -- Arcane Missiles Triggered Spell Rank 2
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(133, 44614, 44457, 44461);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(133, 1, 0, -1, -1, 'Mage - Fireball'), -- DoT componenet shouldn't scale.
+(44614, 0.8571, 0, -1, -1, 'Mage - Frostfire Bolt'), -- DoT componenet shouldn't scale.
+(44457, -1, 0.2, -1, -1, 'Mage - Living Bomb ($SP*0.8 / number of ticks)'), -- Direct damage bonus correction.
+(44461, 0.4286, -1, -1, -1, 'Mage - Living Bomb (Triggered)'); -- Direct damage bonus correction.
+
+-- Paladin
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(633, 54158, 20467, 20187, 31803, 53742, 31804, 53733);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(633, 0, -1, -1, -1, 'Paladin - Lay on Hands'), -- Shouldn't scale with SP.
+(54158, 0.27, -1, 0.175, -1, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), -- Increase coefficient, based on Wowwiki.com.
+(20467, 0.14, -1, 0.115, -1, 'Paladin - Judgement of Command'), -- Decrease coefficient, based on Wowwiki.com.
+(20187, 0.355, -1, 0.225, -1, 'Paladin - Judgement of Righteousness'), -- Increase coefficient, based on Wowwiki.com.
+(31803, -1, 0.0132, -1, 0.0252, 'Paladin - Holy Vengeance'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(53742, -1, 0.0132, -1, 0.0252, 'Paladin - Blood Corruption'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(31804, 0.24, -1, 0.15, -1, 'Paladin - Judgement of Vengeance'), -- Increase coefficient, based on Wowwiki.com.
+(53733, 0.24, -1, 0.15, -1, 'Paladin - Judgement of Corruption'); -- Increase coefficient, based on Wowwiki.com.
+
+-- Priest
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(52983, 52954, 58985); -- Penance Heal Rank 2, Rank 3, Rank 4
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(52998, 52999, 53000); -- Penance Hurt Rank 2, Rank 3, Rank 4
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(7001);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(7001, -1, 0.626, -1, -1, 'Priest - Lightwell Renew ($SP*1.878 / number of ticks)'); -- Increase coefficient, based on DrDamage addon(3.3.5a).
+
+-- Rogue
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(819, 11353, 11354, 25349, 26968, 27187, 57969, 57970); -- Deadly Poison Rank 2, Rank 3, etc.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(8685, 8689, 11335, 11336, 11337, 26890, 57964, 57965); -- Instant Poison Rank 2, Rank 3, etc.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(13222, 13223, 13224, 27189, 57974, 57975); -- Wound Poison Rank 2, Rank 3, etc.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN(32645, 2098, 703, 1776, 1943, 8680, 26688, 13218);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(32645, 0, -1, -1, -1, 'Rogue - Envenom'), -- Shouldn't scale with SP.
+(2098, 0, -1, -1, -1, 'Rogue - Eviscerate'), -- Shouldn't scale with SP.
+(703, -1, 0, -1, 0.07, 'Rogue - Garrote'), -- Shouldn't scale with SP.
+(1776, 0, -1, 0.21, -1, 'Rogue - Gouge'), -- Shouldn't scale with SP.
+(1943, -1, 0, -1, -1, 'Rogue - Rupture'), -- Shouldn't scale with SP.
+(8680, 0, -1, 0.1, -1, 'Rogue - Instant Poison'), -- Shouldn't scale with SP.
+(26688, 0, -1, 0, -1, 'Rogue - Anesthetic Poison'), -- Shouldn't scale with SP nor AP.
+(13218, 0, -1, 0.04, -1, 'Rogue - Wound Poison'); -- Shouldn't scale with SP.
+
+ -- Warlock Healthstones Shouldn't scale with SP.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (6262, 23468, 23469, 6263, 23470, 23471, 5720, 23472, 23473, 5723, 23474, 23475, 11732, 23476, 23477, 27235, 27236, 27237, 47874, 47873, 47872, 47875, 47876, 47877);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(6262, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 0/2 Improved Healthstone)'),
+(23468, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 1/2 Improved Healthstone)'),
+(23469, 0, -1, 0, -1, 'Warlock - HS - Minor Healthstone (with 2/2 Improved Healthstone)'),
+(6263, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 0/2 Improved Healthstone)'),
+(23470, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 1/2 Improved Healthstone)'),
+(23471, 0, -1, 0, -1, 'Warlock - HS - Lesser Healthstone (with 2/2 Improved Healthstone)'),
+(5720, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 0/2 Improved Healthstone)'),
+(23472, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 1/2 Improved Healthstone)'),
+(23473, 0, -1, 0, -1, 'Warlock - HS - Healthstone (with 2/2 Improved Healthstone)'),
+(5723, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 0/2 Improved Healthstone)'),
+(23474, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 1/2 Improved Healthstone)'),
+(23475, 0, -1, 0, -1, 'Warlock - HS - Greater Healthstone (with 2/2 Improved Healthstone)'),
+(11732, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 0/2 Improved Healthstone)'),
+(23476, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 1/2 Improved Healthstone)'),
+(23477, 0, -1, 0, -1, 'Warlock - HS - Major Healthstone (with 2/2 Improved Healthstone)'),
+(27235, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 0/2 Improved Healthstone)'),
+(27236, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 1/2 Improved Healthstone)'),
+(27237, 0, -1, 0, -1, 'Warlock - HS - Master Healthstone (with 2/2 Improved Healthstone)'),
+(47874, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 0/2 Improved Healthstone)'),
+(47873, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 1/2 Improved Healthstone)'),
+(47872, 0, -1, 0, -1, 'Warlock - HS - Demonic Healthstone (with 2/2 Improved Healthstone)'),
+(47875, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 0/2 Improved Healthstone)'),
+(47876, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 1/2 Improved Healthstone)'),
+(47877, 0, -1, 0, -1, 'Warlock - HS - Fel Healthstone (with 2/2 Improved Healthstone)');
diff --git a/sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql b/sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql
new file mode 100644
index 00000000000..dc59f152e33
--- /dev/null
+++ b/sql/updates/world/2012_06_14_03_world_spell_bonus_data.sql
@@ -0,0 +1,94 @@
+-- Death Knight
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (58621, 47632, 47633, 50444, 70890, 50526, 48982, 59754, 49184);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(58621, 0, 0, 0.08, 0, 'Death Knight - Glyph of Chains of Ice'), -- Shouldn't scale with SP.
+(47632, 0, 0, 0.15, 0, 'Death Knight - Death Coil'), -- Shouldn't scale with SP.
+(47633, 0, 0, 0.15, 0, 'Death Knight - Death Coil (Heal)'), -- Shouldn't scale with SP.
+(50444, 0, 0, 0.105, 0, 'Death Knight - Corpse Explosion (Triggered)'), -- Shouldn't scale with SP.
+(70890, 0, 0, 0, 0, 'Death Knight - Scourge Strike (Shadow)'), -- Shouldn't scale with SP.
+(50526, 0, 0, 0, 0, 'Death Knight - Wandering Plague (Triggered)'), -- Shouldn't scale with SP.
+(48982, 0, 0, 0, 0, 'Death Knight - Rune Tap'), -- Shouldn't scale with SP.
+(59754, 0, 0, 0, 0, 'Death Knight - Glyph of Rune Tap (Triggered)'), -- Shouldn't scale with SP.
+(49184, 0, 0, 0.2, 0, 'Death Knight - Howling Blast'); -- Shouldn't scale with SP.
+
+-- Druid
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (33745, 9007);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(33745, 0, 0, 0.01, 0.01, 'Druid - Lacerate ($AP*0.05/number of ticks)'), -- Direct damage should scale with AP, based on DrDamage addon(3.3.5a).
+(9007, 0, 0, 0, 0.03, 'Druid - Pounce Bleed (Triggered)'); -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+
+-- Hunter
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (56641, 42243, 3674, 19306, 1495, 63468, 136);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(56641, 0, 0, 0.1, 0, 'Hunter - Steady Shot'), -- Shouldn't scale with SP.
+(42243, 0, 0, 0.0837, 0, 'Hunter - Volley (Triggered)'), -- Shouldn't scale with SP.
+(3674, 0, 0, 0, 0.023, 'Hunter - Black Arrow ($RAP*0.1 / number of ticks)'), -- Shouldn't scale with SP. Increase AP coefficient, based on DrDamage addon(3.3.5a).
+(19306, 0, 0, 0.2, 0, 'Hunter - Counterattack'), -- Shouldn't scale with SP.
+(1495, 0, 0, 0.2, 0, 'Hunter - Mongoose Bite'), -- Shouldn't scale with SP.
+(63468, 0, 0, 0, 0, 'Hunter - Piercing Shots'), -- Shouldn't scale with SP.
+(136, 0, 0, 0, 0, 'Hunter - Mend Pet'); -- Shouldn't scale with SP.
+
+-- Mage
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (133, 44614, 44457, 44461);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(133, 1, 0, 0, 0, 'Mage - Fireball'), -- DoT componenet shouldn't scale.
+(44614, 0.8571, 0, 0, 0, 'Mage - Frostfire Bolt'), -- DoT componenet shouldn't scale.
+(44457, 0, 0.2, 0, 0, 'Mage - Living Bomb ($SP*0.8 / number of ticks)'), -- Direct damage bonus correction.
+(44461, 0.4286, 0, 0, 0, 'Mage - Living Bomb (Triggered)'); -- Direct damage bonus correction.
+
+-- Paladin
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (633, 54158, 20467, 20187, 31803, 53742, 31804, 53733);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(633, 0, 0, 0, 0, 'Paladin - Lay on Hands'), -- Shouldn't scale with SP.
+(54158, 0.27, 0, 0.175, 0, 'Paladin - Judgement (Seal of Light, Seal of Wisdom, Seal of Justice)'), -- Increase coefficient, based on Wowwiki.com.
+(20467, 0.14, 0, 0.115, 0, 'Paladin - Judgement of Command'), -- Decrease coefficient, based on Wowwiki.com.
+(20187, 0.355, 0, 0.225, 0, 'Paladin - Judgement of Righteousness'), -- Increase coefficient, based on Wowwiki.com.
+(31803, 0, 0.0132, 0, 0.0252, 'Paladin - Holy Vengeance'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(53742, 0, 0.0132, 0, 0.0252, 'Paladin - Blood Corruption'), -- Decrease coefficient, based on DrDamage addon(3.3.5a) and Wowwiki.com.
+(31804, 0.24, 0, 0.15, 0, 'Paladin - Judgement of Vengeance'), -- Increase coefficient, based on Wowwiki.com.
+(53733, 0.24, 0, 0.15, 0, 'Paladin - Judgement of Corruption'); -- Increase coefficient, based on Wowwiki.com.
+
+-- Priest
+DELETE FROM `spell_bonus_data` WHERE `entry` = 7001;
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(7001, 0, 0.626, 0, 0, 'Priest - Lightwell Renew ($SP*1.878 / number of ticks)'); -- Increase coefficient, based on DrDamage addon(3.3.5a).
+
+-- Rogue
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (32645, 2098, 703, 1776, 1943, 8680, 26688, 13218);
+INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
+(32645, 0, 0, 0, 0, 'Rogue - Envenom'), -- Shouldn't scale with SP.
+(2098, 0, 0, 0, 0, 'Rogue - Eviscerate'), -- Shouldn't scale with SP.
+(703, 0, 0, 0, 0.07, 'Rogue - Garrote'), -- Shouldn't scale with SP.
+(1776, 0, 0, 0.21, 0, 'Rogue - Gouge'), -- Shouldn't scale with SP.
+(1943, 0, 0, 0, 0, 'Rogue - Rupture'), -- Shouldn't scale with SP.
+(8680, 0, 0, 0.1, 0, 'Rogue - Instant Poison'), -- Shouldn't scale with SP.
+(26688, 0, 0, 0, 0, 'Rogue - Anesthetic Poison'), -- Shouldn't scale with SP nor AP.
+(13218, 0, 0, 0.04, 0, 'Rogue - Wound Poison'); -- Shouldn't scale with SP.
+
+ -- Warlock Healthstones Shouldn't scale with SP.
+DELETE FROM `spell_bonus_data` WHERE `entry` IN (6262, 23468, 23469, 6263, 23470, 23471, 5720, 23472, 23473, 5723, 23474, 23475, 11732, 23476, 23477, 27235, 27236, 27237, 47874, 47873, 47872, 47875, 47876, 47877);
+INSERT INTO `spell_bonus_data` (`entry`,`direct_bonus`,`dot_bonus`,`ap_bonus`,`ap_dot_bonus`,`comments`) VALUES
+(6262, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 0/2 Improved Healthstone)'),
+(23468, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 1/2 Improved Healthstone)'),
+(23469, 0, 0, 0, 0, 'Warlock - HS - Minor Healthstone (with 2/2 Improved Healthstone)'),
+(6263, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 0/2 Improved Healthstone)'),
+(23470, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 1/2 Improved Healthstone)'),
+(23471, 0, 0, 0, 0, 'Warlock - HS - Lesser Healthstone (with 2/2 Improved Healthstone)'),
+(5720, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 0/2 Improved Healthstone)'),
+(23472, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 1/2 Improved Healthstone)'),
+(23473, 0, 0, 0, 0, 'Warlock - HS - Healthstone (with 2/2 Improved Healthstone)'),
+(5723, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 0/2 Improved Healthstone)'),
+(23474, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 1/2 Improved Healthstone)'),
+(23475, 0, 0, 0, 0, 'Warlock - HS - Greater Healthstone (with 2/2 Improved Healthstone)'),
+(11732, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 0/2 Improved Healthstone)'),
+(23476, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 1/2 Improved Healthstone)'),
+(23477, 0, 0, 0, 0, 'Warlock - HS - Major Healthstone (with 2/2 Improved Healthstone)'),
+(27235, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 0/2 Improved Healthstone)'),
+(27236, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 1/2 Improved Healthstone)'),
+(27237, 0, 0, 0, 0, 'Warlock - HS - Master Healthstone (with 2/2 Improved Healthstone)'),
+(47874, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 0/2 Improved Healthstone)'),
+(47873, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 1/2 Improved Healthstone)'),
+(47872, 0, 0, 0, 0, 'Warlock - HS - Demonic Healthstone (with 2/2 Improved Healthstone)'),
+(47875, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 0/2 Improved Healthstone)'),
+(47876, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 1/2 Improved Healthstone)'),
+(47877, 0, 0, 0, 0, 'Warlock - HS - Fel Healthstone (with 2/2 Improved Healthstone)');
diff --git a/sql/updates/world/2012_06_14_03_world_spell_ranks.sql b/sql/updates/world/2012_06_14_03_world_spell_ranks.sql
new file mode 100644
index 00000000000..f6641f2f095
--- /dev/null
+++ b/sql/updates/world/2012_06_14_03_world_spell_ranks.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_ranks` WHERE `first_spell_id`=64694;
+INSERT INTO `spell_ranks` (`first_spell_id`,`spell_id`,`rank`) VALUES
+(64694,64694,1),
+(64694,65263,2),
+(64694,65264,3);
diff --git a/sql/updates/world/2012_06_14_04_world_spell_script_names.sql b/sql/updates/world/2012_06_14_04_world_spell_script_names.sql
new file mode 100644
index 00000000000..00ceb1df9e9
--- /dev/null
+++ b/sql/updates/world/2012_06_14_04_world_spell_script_names.sql
@@ -0,0 +1,62 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (-633,781,-746,1515,6495,-8050,-16972,31789,-34914,-44457,-48181,-30108,34438,34439,35183,43522,65812,68154,68155,68156,52610,61336,-33763,40133,40132,43421,52551,53608,57762,59990,66093,67957,67958,67959,7057,28832,28833,28834,28835,27831,55638,31447,32960,33654,33671,50810,61546,50811,61547,52942,59837,63322,47977,48025,54729,71342,72286,74856,75614,75973);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(-633, 'spell_pal_lay_on_hands'),
+(781, 'spell_hun_disengage'),
+(-746, 'spell_gen_bandage'),
+(1515, 'spell_hun_tame_beast'),
+(6495, 'spell_sha_sentry_totem'),
+(-8050, 'spell_sha_flame_shock'),
+(-16972,'spell_dru_predatory_strikes'),
+(31789, 'spell_pal_righteous_defense'),
+(-34914,'spell_pri_vampiric_touch'),
+(-44457,'spell_mage_living_bomb'),
+(-48181,'spell_warl_haunt'),
+(-30108,'spell_warl_unstable_affliction'),
+(34438, 'spell_warl_unstable_affliction'), -- using class spell script for generic spell because it uses class spell effect
+(34439, 'spell_warl_unstable_affliction'),
+(35183, 'spell_warl_unstable_affliction'),
+(43522, 'spell_hexlord_unstable_affliction'),
+(65812, 'spell_faction_champion_warl_unstable_affliction'),
+(68154, 'spell_faction_champion_warl_unstable_affliction'),
+(68155, 'spell_faction_champion_warl_unstable_affliction'),
+(68156, 'spell_faction_champion_warl_unstable_affliction'),
+(52610, 'spell_dru_savage_roar'),
+(61336, 'spell_dru_survival_instincts'),
+(-33763,'spell_dru_lifebloom'),
+(40133, 'spell_gen_summon_fire_elemental'),
+(40132, 'spell_gen_summon_earth_elemental'),
+(43421, 'spell_hexlord_lifebloom'),
+(52551, 'spell_tur_ragepaw_lifebloom'),
+(53608, 'spell_cenarion_scout_lifebloom'),
+(57762, 'spell_twisted_visage_lifebloom'),
+(59990, 'spell_twisted_visage_lifebloom'),
+(66093, 'spell_faction_champion_dru_lifebloom'),
+(67957, 'spell_faction_champion_dru_lifebloom'),
+(67958, 'spell_faction_champion_dru_lifebloom'),
+(67959, 'spell_faction_champion_dru_lifebloom'),
+(7057, 'spell_shadowfang_keep_haunting_spirits'),
+(28832, 'spell_four_horsemen_mark'),
+(28833, 'spell_four_horsemen_mark'),
+(28834, 'spell_four_horsemen_mark'),
+(28835, 'spell_four_horsemen_mark'),
+(27831, 'spell_gothik_shadow_bolt_volley'),
+(55638, 'spell_gothik_shadow_bolt_volley'),
+(31447, 'spell_mark_of_kazrogal'),
+(32960, 'spell_mark_of_kazzak'),
+(33654, 'spell_gruul_shatter'),
+(33671, 'spell_gruul_shatter_effect'),
+(50810, 'spell_krystallus_shatter'),
+(61546, 'spell_krystallus_shatter'),
+(50811, 'spell_krystallus_shatter_effect'),
+(61547, 'spell_krystallus_shatter_effect'),
+(52942, 'spell_loken_pulsing_shockwave'),
+(59837, 'spell_loken_pulsing_shockwave'),
+(63322, 'spell_general_vezax_saronite_vapors'),
+(47977, 'spell_magic_broom'),
+(48025, 'spell_headless_horseman_mount'),
+(54729, 'spell_winged_steed_of_the_ebon_blade'),
+(71342, 'spell_big_love_rocket'),
+(72286, 'spell_invincible'),
+(74856, 'spell_blazing_hippogryph'),
+(75614, 'spell_celestial_steed'),
+(75973, 'spell_x53_touring_rocket');
diff --git a/sql/updates/world/2012_06_14_05_world_spelldifficulty_dbc.sql b/sql/updates/world/2012_06_14_05_world_spelldifficulty_dbc.sql
new file mode 100644
index 00000000000..1f218027f91
--- /dev/null
+++ b/sql/updates/world/2012_06_14_05_world_spelldifficulty_dbc.sql
@@ -0,0 +1,6 @@
+SET @DIFF := 3268; -- set by TDB team
+DELETE FROM `spelldifficulty_dbc` WHERE `id` BETWEEN @DIFF+0 AND @DIFF+2;
+INSERT INTO `spelldifficulty_dbc` (`id`,`spellid0`,`spellid1`,`spellid2`,`spellid3`) VALUES
+(@DIFF+0,50811,61547,0,0),
+(@DIFF+1,57762,59990,0,0),
+(@DIFF+2,57763,61489,0,0);
diff --git a/sql/updates/world/2012_06_14_06_world_conditions.sql b/sql/updates/world/2012_06_14_06_world_conditions.sql
new file mode 100644
index 00000000000..43d422e9239
--- /dev/null
+++ b/sql/updates/world/2012_06_14_06_world_conditions.sql
@@ -0,0 +1,7 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (19938,30877);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,19938,0,0,1,1,17743,0,0,0,0,'','Awaken Peon'),
+(17,0,30877,0,0,31,1,3,17326,0,0,0,'','Tag Murloc');
+
+-- Lifebinder's Gift
+UPDATE `conditions` SET `SourceGroup`=7 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62584,64185);
diff --git a/sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql b/sql/updates/world/2012_06_14_07_world_spell_bonus_data.sql
index aa9c1b732c4..aa9c1b732c4 100644
--- a/sql/updates/world/2012_06_09_00_world_spell_bonus_data.sql
+++ b/sql/updates/world/2012_06_14_07_world_spell_bonus_data.sql
diff --git a/sql/updates/world/2012_06_09_00_world_spell_script_names.sql b/sql/updates/world/2012_06_14_08_world_spell_script_names.sql
index a9faa529143..a9faa529143 100644
--- a/sql/updates/world/2012_06_09_00_world_spell_script_names.sql
+++ b/sql/updates/world/2012_06_14_08_world_spell_script_names.sql
diff --git a/src/server/game/AI/CoreAI/GameObjectAI.h b/src/server/game/AI/CoreAI/GameObjectAI.h
index f4555649210..fbc8675cc47 100644
--- a/src/server/game/AI/CoreAI/GameObjectAI.h
+++ b/src/server/game/AI/CoreAI/GameObjectAI.h
@@ -53,7 +53,8 @@ class GameObjectAI
virtual uint64 GetData64(uint32 /*id*/) { return 0; }
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
virtual void OnGameEvent(bool /*start*/, uint16 /*eventId*/) {}
- virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) { }
+ virtual void OnStateChanged(uint32 /*state*/, Unit* /*unit*/) {}
+ virtual void EventInform(uint32 /*eventId*/) {}
};
class NullGameObjectAI : public GameObjectAI
diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp
index 160b406a6ea..97ae0581a18 100755
--- a/src/server/game/AI/CoreAI/PetAI.cpp
+++ b/src/server/game/AI/CoreAI/PetAI.cpp
@@ -532,3 +532,19 @@ bool PetAI::CanAttack(Unit* target)
// default, though we shouldn't ever get here
return false;
}
+
+void PetAI::ReceiveEmote(Player* player, uint32 emote)
+{
+ if (me->GetOwnerGUID() && me->GetOwnerGUID() == player->GetGUID())
+ switch (emote)
+ {
+ case TEXT_EMOTE_COWER:
+ if (me->isPet() && me->ToPet()->IsPetGhoul())
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
+ break;
+ case TEXT_EMOTE_ANGRY:
+ if (me->isPet() && me->ToPet()->IsPetGhoul())
+ me->HandleEmoteCommand(EMOTE_ONESHOT_COWER);
+ break;
+ }
+}
diff --git a/src/server/game/AI/CoreAI/PetAI.h b/src/server/game/AI/CoreAI/PetAI.h
index ed3e2305556..8e5311fa000 100755
--- a/src/server/game/AI/CoreAI/PetAI.h
+++ b/src/server/game/AI/CoreAI/PetAI.h
@@ -42,6 +42,7 @@ class PetAI : public CreatureAI
void MovementInform(uint32 moveType, uint32 data);
void OwnerDamagedBy(Unit* attacker);
void OwnerAttacked(Unit* target);
+ void ReceiveEmote(Player* player, uint32 textEmote);
private:
bool _isVisible(Unit*) const;
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 08f1b18ffad..98b5c0a6ba3 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -937,6 +937,11 @@ void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit)
GetScript()->ProcessEventsFor(SMART_EVENT_GO_STATE_CHANGED, unit, state);
}
+void SmartGameObjectAI::EventInform(uint32 eventId)
+{
+ GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, NULL, eventId);
+}
+
class SmartTrigger : public AreaTriggerScript
{
public:
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 435aa176d4d..3a3a7dc9510 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -235,30 +235,31 @@ class SmartAI : public CreatureAI
class SmartGameObjectAI : public GameObjectAI
{
-public:
- SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {}
- ~SmartGameObjectAI() {}
-
- void UpdateAI(uint32 diff);
- void InitializeAI();
- void Reset();
- SmartScript* GetScript() { return &mScript; }
- static int Permissible(const GameObject* g);
-
- bool GossipHello(Player* player);
- bool GossipSelect(Player* player, uint32 sender, uint32 action);
- bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/);
- bool QuestAccept(Player* player, Quest const* quest);
- bool QuestReward(Player* player, Quest const* quest, uint32 opt);
- uint32 GetDialogStatus(Player* /*player*/);
- void Destroyed(Player* player, uint32 eventId);
- void SetData(uint32 id, uint32 value);
- void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
- void OnGameEvent(bool start, uint16 eventId);
- void OnStateChanged(uint32 state, Unit* unit);
-
-protected:
- GameObject* const go;
- SmartScript mScript;
+ public:
+ SmartGameObjectAI(GameObject* g) : GameObjectAI(g), go(g) {}
+ ~SmartGameObjectAI() {}
+
+ void UpdateAI(uint32 diff);
+ void InitializeAI();
+ void Reset();
+ SmartScript* GetScript() { return &mScript; }
+ static int Permissible(const GameObject* g);
+
+ bool GossipHello(Player* player);
+ bool GossipSelect(Player* player, uint32 sender, uint32 action);
+ bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/);
+ bool QuestAccept(Player* player, Quest const* quest);
+ bool QuestReward(Player* player, Quest const* quest, uint32 opt);
+ uint32 GetDialogStatus(Player* /*player*/);
+ void Destroyed(Player* player, uint32 eventId);
+ void SetData(uint32 id, uint32 value);
+ void SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker);
+ void OnGameEvent(bool start, uint16 eventId);
+ void OnStateChanged(uint32 state, Unit* unit);
+ void EventInform(uint32 eventId);
+
+ protected:
+ GameObject* const go;
+ SmartScript mScript;
};
#endif
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 9feca1c073a..1b414029366 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -160,9 +160,6 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
case SMART_ACTION_TALK:
{
- if (!me)
- break;
-
ObjectList* targets = GetTargets(e, unit);
Creature* talker = me;
Player* targetPlayer = NULL;
@@ -185,6 +182,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
delete targets;
}
+ if (!talker)
+ break;
+
mTalkerEntry = talker->GetEntry();
mLastTextID = e.action.talk.textGroupID;
mTextTimer = e.action.talk.duration;
@@ -2771,6 +2771,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
ProcessAction(e, unit, var0, var1);
break;
}
+ case SMART_EVENT_GO_EVENT_INFORM:
+ {
+ if (e.event.eventInform.eventId != var0)
+ return;
+ ProcessAction(e, NULL, var0);
+ break;
+ }
default:
sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
break;
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index d529479d9dd..bf84f39747a 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -533,6 +533,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_EVENT_GO_STATE_CHANGED:
+ case SMART_EVENT_GO_EVENT_INFORM:
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
case SMART_EVENT_INSTANCE_PLAYER_ENTER:
case SMART_EVENT_TRANSPORT_RELOCATE:
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index 5b54a4d3048..b82d0724f53 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -153,9 +153,10 @@ enum SMART_EVENT
SMART_EVENT_IS_BEHIND_TARGET = 67, //1 // cooldownMin, CooldownMax
SMART_EVENT_GAME_EVENT_START = 68, //1 // game_event.Entry
SMART_EVENT_GAME_EVENT_END = 69, //1 // game_event.Entry
- SMART_EVENT_GO_STATE_CHANGED = 70, // go state
+ SMART_EVENT_GO_STATE_CHANGED = 70, //1 // go state
+ SMART_EVENT_GO_EVENT_INFORM = 71, //1 // eventId
- SMART_EVENT_END = 71,
+ SMART_EVENT_END = 72,
};
struct SmartEvent
@@ -352,6 +353,11 @@ struct SmartEvent
struct
{
+ uint32 eventId;
+ } eventInform;
+
+ struct
+ {
uint32 param1;
uint32 param2;
uint32 param3;
@@ -1166,7 +1172,7 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =
{SMART_EVENT_GAME_EVENT_START, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_GAME_EVENT_END, SMART_SCRIPT_TYPE_MASK_CREATURE + SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
{SMART_EVENT_GO_STATE_CHANGED, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
-
+ {SMART_EVENT_GO_EVENT_INFORM, SMART_SCRIPT_TYPE_MASK_GAMEOBJECT },
};
enum SmartEventFlags
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index a106f11ae82..2b2265dad84 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -55,7 +55,7 @@ BattlegroundMgr::BattlegroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTe
{
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
m_Battlegrounds[i].clear();
- m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
+ m_NextRatedArenaUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER);
m_Testing=false;
}
@@ -143,10 +143,10 @@ void BattlegroundMgr::Update(uint32 diff)
}
// if rating difference counts, maybe force-update queues
- if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER))
+ if (sWorld->getIntConfig(CONFIG_ARENA_MAX_RATING_DIFFERENCE) && sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER))
{
// it's time to force update
- if (m_NextRatingDiscardUpdate < diff)
+ if (m_NextRatedArenaUpdate < diff)
{
// forced update for rated arenas (scan all, but skipped non rated)
sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BattlegroundMgr: UPDATING ARENA QUEUES");
@@ -156,10 +156,10 @@ void BattlegroundMgr::Update(uint32 diff)
BATTLEGROUND_AA, BattlegroundBracketId(bracket),
BattlegroundMgr::BGArenaType(BattlegroundQueueTypeId(qtype)), true, 0);
- m_NextRatingDiscardUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
+ m_NextRatedArenaUpdate = sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER);
}
else
- m_NextRatingDiscardUpdate -= diff;
+ m_NextRatedArenaUpdate -= diff;
}
if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
{
@@ -1137,4 +1137,4 @@ BattlegroundTypeId BattlegroundMgr::WeekendHolidayIdToBGType(HolidayIds holiday)
bool BattlegroundMgr::IsBGWeekend(BattlegroundTypeId bgTypeId)
{
return IsHolidayActive(BGTypeToWeekendHolidayId(bgTypeId));
-} \ No newline at end of file
+}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h
index 7afb83da0a6..10a49408c06 100755
--- a/src/server/game/Battlegrounds/BattlegroundMgr.h
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.h
@@ -141,7 +141,7 @@ class BattlegroundMgr
BattlegroundSelectionWeightMap m_BGSelectionWeights;
std::vector<uint64> m_QueueUpdateScheduler;
std::set<uint32> m_ClientBattlegroundIds[MAX_BATTLEGROUND_TYPE_ID][MAX_BATTLEGROUND_BRACKETS]; //the instanceids just visible for the client
- uint32 m_NextRatingDiscardUpdate;
+ uint32 m_NextRatedArenaUpdate;
time_t m_NextAutoDistributionTime;
uint32 m_AutoDistributionTimeChecker;
bool m_ArenaTesting;
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 47c298d7467..a5ff89136b8 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -1417,6 +1417,10 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
waitTimesMap[(*it)->GetGUID()] = int32(joinTime - itQueue->second->joinTime);
}
+ // Set the dungeon difficulty
+ LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(pProposal->dungeonId);
+ ASSERT(dungeon);
+
// Create a new group (if needed)
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND);
Group* grp = pProposal->groupLowGuid ? sGroupMgr->GetGroupByGUID(pProposal->groupLowGuid) : NULL;
@@ -1427,6 +1431,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
Group* group = player->GetGroup();
if (sendUpdate)
player->GetSession()->SendLfgUpdateProposal(proposalId, pProposal);
+
if (group)
{
player->GetSession()->SendLfgUpdateParty(updateData);
@@ -1478,14 +1483,16 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
break;
}
}
+
m_teleport.push_back(pguid);
grp->SetLfgRoles(pguid, pProposal->players[pguid]->role);
SetState(pguid, LFG_STATE_DUNGEON);
+
+ // Add the cooldown spell if queued for a random dungeon
+ if (dungeon->type == LFG_TYPE_RANDOM)
+ player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false);
}
- // Set the dungeon difficulty
- LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(pProposal->dungeonId);
- ASSERT(dungeon);
grp->SetDungeonDifficulty(Difficulty(dungeon->difficulty));
uint64 gguid = grp->GetGUID();
SetDungeon(gguid, dungeon->Entry());
@@ -1626,6 +1633,7 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas
{
if (!grp)
return;
+
uint64 gguid = grp->GetGUID();
SetState(gguid, LFG_STATE_BOOT);
@@ -1635,7 +1643,6 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas
pBoot->reason = reason;
pBoot->victim = victim;
pBoot->votedNeeded = GetVotesNeeded(gguid);
- PlayerSet players;
// Set votes
for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
@@ -1651,15 +1658,11 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reas
else
{
pBoot->votes[guid] = LFG_ANSWER_PENDING; // Other members need to vote
- players.insert(plrg);
+ plrg->GetSession()->SendLfgBootPlayer(pBoot);
}
}
}
- // Notify players
- for (PlayerSet::const_iterator it = players.begin(); it != players.end(); ++it)
- (*it)->GetSession()->SendLfgBootPlayer(pBoot);
-
m_Boots[grp->GetLowGUID()] = pBoot;
}
@@ -1748,14 +1751,7 @@ void LFGMgr::UpdateBoot(Player* player, bool accept)
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::TeleportPlayer: [" UI64FMTD "] is being teleported %s", player->GetGUID(), out ? "out" : "in");
- if (out)
- {
- player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
- player->TeleportToBGEntryPoint();
- return;
- }
- // TODO Add support for LFG_TELEPORTERROR_FATIGUE
LfgTeleportError error = LFG_TELEPORTERROR_OK;
Group* grp = player->GetGroup();
@@ -1765,10 +1761,25 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
error = LFG_TELEPORTERROR_PLAYER_DEAD;
else if (player->IsFalling() || player->HasUnitState(UNIT_STATE_JUMPING))
error = LFG_TELEPORTERROR_FALLING;
+ else if (player->IsMirrorTimerActive(FATIGUE_TIMER))
+ error = LFG_TELEPORTERROR_FATIGUE;
else
{
- uint64 gguid = grp->GetGUID();
- LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(gguid));
+ LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(GetDungeon(grp->GetGUID()));
+
+ if (out)
+ {
+ // Player needs to be inside the LFG dungeon to be able to teleport out
+ if (dungeon && player->GetMapId() == uint32(dungeon->map))
+ {
+ player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW);
+ player->TeleportToBGEntryPoint();
+ }
+ else
+ player->GetSession()->SendLfgTeleportError(LFG_TELEPORTERROR_DONT_REPORT); // Not sure which error message to send
+
+ return;
+ }
if (!dungeon)
error = LFG_TELEPORTERROR_INVALID_LOCATION;
@@ -1817,7 +1828,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (error == LFG_TELEPORTERROR_OK)
{
- if (!player->GetMap()->IsDungeon() && !player->GetMap()->IsRaid())
+ if (!player->GetMap()->IsDungeon())
player->SetBattlegroundEntryPoint();
if (player->isInFlight())
diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h
index d10902b9553..f21818deb64 100755
--- a/src/server/game/DungeonFinding/LFGMgr.h
+++ b/src/server/game/DungeonFinding/LFGMgr.h
@@ -68,6 +68,7 @@ enum LfgTeleportError
LFG_TELEPORTERROR_OK = 0, // Internal use
LFG_TELEPORTERROR_PLAYER_DEAD = 1,
LFG_TELEPORTERROR_FALLING = 2,
+ LFG_TELEPORTERROR_DONT_REPORT = 3,
LFG_TELEPORTERROR_FATIGUE = 4,
LFG_TELEPORTERROR_INVALID_LOCATION = 6
};
diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp
index 6175addfae2..1fa7fe0ca9f 100644
--- a/src/server/game/DungeonFinding/LFGScripts.cpp
+++ b/src/server/game/DungeonFinding/LFGScripts.cpp
@@ -117,13 +117,14 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth
return;
}
+ uint32 state = sLFGMgr->GetState(gguid);
sLFGMgr->ClearState(guid);
sLFGMgr->SetState(guid, LFG_STATE_NONE);
if (Player* player = ObjectAccessor::FindPlayer(guid))
{
+ if (method == GROUP_REMOVEMETHOD_LEAVE && state != LFG_STATE_FINISHED_DUNGEON && player->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
+ player->CastSpell(player, LFG_SPELL_DUNGEON_DESERTER, false);
/*
- if (method == GROUP_REMOVEMETHOD_LEAVE)
- // Add deserter flag
else if (group->isLfgKickActive())
// Update internal kick cooldown of kicked
*/
@@ -134,7 +135,7 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth
sLFGMgr->TeleportPlayer(player, true);
}
- if (sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon
+ if (state != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon
sLFGMgr->OfferContinue(group);
}
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 58440095075..1d9958a6524 100755
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1711,7 +1711,13 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
void GameObject::EventInform(uint32 eventId)
{
- if (eventId && m_zoneScript)
+ if (!eventId)
+ return;
+
+ if (AI())
+ AI()->EventInform(eventId);
+
+ if (m_zoneScript)
m_zoneScript->ProcessEvent(this, eventId);
}
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 53defc0c017..42d342cbcf9 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -23362,7 +23362,7 @@ Player* Player::GetNextRandomRaidMember(float radius)
PartyResult Player::CanUninviteFromGroup() const
{
- const Group* grp = GetGroup();
+ Group const* grp = GetGroup();
if (!grp)
return ERR_NOT_IN_GROUP;
@@ -23385,8 +23385,12 @@ PartyResult Player::CanUninviteFromGroup() const
if (grp->isRollLootActive())
return ERR_PARTY_LFG_BOOT_LOOT_ROLLS;
+ // TODO: Should also be sent when anyone has recently left combat, with an aprox ~5 seconds timer.
+ for (GroupReference const* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
+ if (itr->getSource() && itr->getSource()->isInCombat())
+ return ERR_PARTY_LFG_BOOT_IN_COMBAT;
+
/* Missing support for these types
- return ERR_PARTY_LFG_BOOT_IN_COMBAT; // also have a cooldown (some secs after combat finish
return ERR_PARTY_LFG_BOOT_COOLDOWN_S;
return ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S;
*/
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index ed887994bca..b0cbb5c7927 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1970,6 +1970,7 @@ class Player : public Unit, public GridObject<Player>
StopMirrorTimer(BREATH_TIMER);
StopMirrorTimer(FIRE_TIMER);
}
+ bool IsMirrorTimerActive(MirrorTimerType type) { return m_MirrorTimer[type] == getMaxTimer(type); }
void SetMovement(PlayerMovementType pType);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index d133a2b6a38..82cdb73a5ba 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2465,12 +2465,12 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spell)
// Chance resist debuff
if (!spell->IsPositive())
{
- bool bNegativeAura = false;
+ bool bNegativeAura = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
- if (spell->Effects[i].ApplyAuraName != 0)
+ if (spell->Effects[i].ApplyAuraName == 0)
{
- bNegativeAura = true;
+ bNegativeAura = false;
break;
}
}
@@ -2893,7 +2893,7 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
InterruptSpell(CURRENT_AUTOREPEAT_SPELL);
m_AutoRepeatFirstCast = true;
}
- if ((pSpell->m_spellInfo->CalcCastTime(this) > 0) && IsNonMeleeSpellCasted(false, false, true))
+ if (pSpell->m_spellInfo->CalcCastTime(this) > 0)
AddUnitState(UNIT_STATE_CASTING);
break;
@@ -3602,87 +3602,6 @@ void Unit::RemoveAurasDueToSpellByDispel(uint32 spellId, uint32 dispellerSpellId
// Call AfterDispel hook on AuraScript
aura->CallScriptAfterDispel(&dispelInfo);
- switch (aura->GetSpellInfo()->SpellFamilyName)
- {
- case SPELLFAMILY_WARLOCK:
- {
- // Unstable Affliction (crash if before removeaura?)
- if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x0100)
- {
- Unit* caster = aura->GetCaster();
- if (!caster)
- break;
- if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_0))
- {
- int32 damage = aurEff->GetAmount() * 9;
- // backfire damage and silence
- caster->CastCustomSpell(dispeller, 31117, &damage, NULL, NULL, true, NULL, aurEff);
- }
- }
- break;
- }
- case SPELLFAMILY_DRUID:
- {
- // Lifebloom
- if (aura->GetSpellInfo()->SpellFamilyFlags[1] & 0x10)
- {
- if (AuraEffect const* aurEff = aura->GetEffect(EFFECT_1))
- {
- // final heal
- int32 healAmount = aurEff->GetAmount();
- if (Unit* caster = aura->GetCaster())
- {
- healAmount = caster->SpellHealingBonusDone(this, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges());
- healAmount = this->SpellHealingBonusTaken(caster, aura->GetSpellInfo(), healAmount, HEAL, dispelInfo.GetRemovedCharges());
- }
- CastCustomSpell(this, 33778, &healAmount, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
-
- // mana
- if (Unit* caster = aura->GetCaster())
- {
- int32 mana = CalculatePctU(caster->GetCreateMana(), aura->GetSpellInfo()->ManaCostPercentage) * chargesRemoved / 2;
- caster->CastCustomSpell(caster, 64372, &mana, NULL, NULL, true, NULL, NULL, aura->GetCasterGUID());
- }
- }
- }
- break;
- }
- case SPELLFAMILY_SHAMAN:
- {
- // Flame Shock
- if (aura->GetSpellInfo()->SpellFamilyFlags[0] & 0x10000000)
- {
- if (Unit* caster = aura->GetCaster())
- {
- uint32 triggeredSpellId = 0;
- // Lava Flows
- if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 3087, 0))
- {
- switch (aurEff->GetId())
- {
- case 51482: // Rank 3
- triggeredSpellId = 65264;
- break;
- case 51481: // Rank 2
- triggeredSpellId = 65263;
- break;
- case 51480: // Rank 1
- triggeredSpellId = 64694;
- break;
- default:
- sLog->outError("Unit::RemoveAurasDueToSpellByDispel: Unknown rank of Lava Flows (%d) found", aurEff->GetId());
- }
- }
-
- if (triggeredSpellId)
- caster->CastSpell(caster, triggeredSpellId, true);
- }
- }
- break;
- }
- default:
- break;
- }
return;
}
else
@@ -14525,6 +14444,11 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u
if (procSpell && (triggeredByAura->GetMiscValue() & procSpell->SchoolMask)) // School check
takeCharges = true;
break;
+ case SPELL_AURA_SPELL_MAGNET:
+ // Skip Melee hits and targets with magnet aura
+ if (procSpell && (triggeredByAura->GetBase()->GetUnitOwner()->ToUnit() == ToUnit())) // Magnet
+ takeCharges = true;
+ break;
case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT:
case SPELL_AURA_MOD_POWER_COST_SCHOOL:
// Skip melee hits and spells ws wrong school or zero cost
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 9a898dbfc4c..3a6390cd83a 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -2076,20 +2076,6 @@ bool Group::HasFreeSlotSubGroup(uint8 subgroup) const
return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE);
}
-Group::MemberSlotList const& Group::GetMemberSlots() const
-{
- return m_memberSlots;
-}
-
-GroupReference* Group::GetFirstMember()
-{
- return m_memberMgr.getFirst();
-}
-
-uint32 Group::GetMembersCount() const
-{
- return m_memberSlots.size();
-}
uint8 Group::GetMemberGroup(uint64 guid) const
{
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index 1f932567319..e5f174c4230 100755
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -230,9 +230,11 @@ class Group
bool SameSubGroup(Player const* member1, Player const* member2) const;
bool HasFreeSlotSubGroup(uint8 subgroup) const;
- MemberSlotList const& GetMemberSlots() const;
- GroupReference* GetFirstMember();
- uint32 GetMembersCount() const;
+ MemberSlotList const& GetMemberSlots() const { return m_memberSlots; }
+ GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
+ GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); }
+ uint32 GetMembersCount() const { return m_memberSlots.size(); }
+
uint8 GetMemberGroup(uint64 guid) const;
void ConvertToLFG();
diff --git a/src/server/game/Groups/GroupRefManager.h b/src/server/game/Groups/GroupRefManager.h
index 9bcc05f8724..d9fef8611de 100755
--- a/src/server/game/Groups/GroupRefManager.h
+++ b/src/server/game/Groups/GroupRefManager.h
@@ -28,7 +28,8 @@ class GroupReference;
class GroupRefManager : public RefManager<Group, Player>
{
public:
- GroupReference* getFirst() { return ((GroupReference*) RefManager<Group, Player>::getFirst()); }
+ GroupReference* getFirst() { return ((GroupReference*)RefManager<Group, Player>::getFirst()); }
+ GroupReference const* getFirst() const { return ((GroupReference const*)RefManager<Group, Player>::getFirst()); }
};
#endif
diff --git a/src/server/game/Groups/GroupReference.h b/src/server/game/Groups/GroupReference.h
index 2048fd9cb0d..7960dd21035 100755
--- a/src/server/game/Groups/GroupReference.h
+++ b/src/server/game/Groups/GroupReference.h
@@ -35,6 +35,7 @@ class GroupReference : public Reference<Group, Player>
GroupReference() : Reference<Group, Player>(), iSubGroup(0) {}
~GroupReference() { unlink(); }
GroupReference* next() { return (GroupReference*)Reference<Group, Player>::next(); }
+ GroupReference const* next() const { return (GroupReference const*)Reference<Group, Player>::next(); }
uint8 getSubGroup() const { return iSubGroup; }
void setSubGroup(uint8 pSubGroup) { iSubGroup = pSubGroup; }
};
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index ca5a5c311c5..d13c2fb0956 100755
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -343,7 +343,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
// Send next quest
if (Quest const* nextQuest = _player->GetNextQuest(guid, quest))
{
- if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(quest, true))
+ if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
{
_player->AddQuest(nextQuest, object);
if (_player->CanCompleteQuest(nextQuest->GetQuestId()))
diff --git a/src/server/game/Server/Protocol/PacketLog.cpp b/src/server/game/Server/Protocol/PacketLog.cpp
index bede48ace87..cb6dcdbdb9e 100644
--- a/src/server/game/Server/Protocol/PacketLog.cpp
+++ b/src/server/game/Server/Protocol/PacketLog.cpp
@@ -18,6 +18,7 @@
#include "PacketLog.h"
#include "Config.h"
#include "ByteBuffer.h"
+#include "WorldPacket.h"
PacketLog::PacketLog() : _file(NULL)
{
@@ -50,7 +51,7 @@ void PacketLog::LogPacket(WorldPacket const& packet, Direction direction)
ByteBuffer data(4+4+4+1+packet.size());
data << int32(packet.GetOpcode());
data << int32(packet.size());
- data << int32(time(NULL));
+ data << uint32(time(NULL));
data << uint8(direction);
for (uint32 i = 0; i < packet.size(); i++)
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index efbaf76406c..e1285eb2db9 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -781,33 +781,18 @@ void AuraEffect::CalculatePeriodic(Unit* caster, bool create, bool load)
m_amplitude = 1 * IN_MILLISECONDS;
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_HEAL:
- case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_OBS_MOD_HEALTH:
+ case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
+ case SPELL_AURA_PERIODIC_ENERGIZE:
case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
case SPELL_AURA_PERIODIC_MANA_LEECH:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_POWER_BURN:
- m_isPeriodic = true;
- break;
- case SPELL_AURA_PERIODIC_TRIGGER_SPELL:
- if (GetId() == 51912)
- m_amplitude = 3000;
- m_isPeriodic = true;
- break;
- case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
case SPELL_AURA_PERIODIC_DUMMY:
+ case SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE:
m_isPeriodic = true;
break;
- case SPELL_AURA_DUMMY:
- // Haunting Spirits - perdiodic trigger demon
- if (GetId() == 7057)
- {
- m_isPeriodic = true;
- m_amplitude = irand (0, 60) + 30;
- m_amplitude *= IN_MILLISECONDS;
- }
- break;
default:
break;
}
@@ -1103,14 +1088,6 @@ void AuraEffect::UpdatePeriodic(Unit* caster)
{
switch (GetAuraType())
{
- case SPELL_AURA_DUMMY:
- // Haunting Spirits
- if (GetId() == 7057)
- {
- m_amplitude = irand (0, 60) + 30;
- m_amplitude *= IN_MILLISECONDS;
- }
- break;
case SPELL_AURA_PERIODIC_DUMMY:
switch (GetSpellInfo()->SpellFamilyName)
{
@@ -1312,11 +1289,6 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit* caster) const
case SPELL_AURA_POWER_BURN:
HandlePeriodicPowerBurnAuraTick(target, caster);
break;
- case SPELL_AURA_DUMMY:
- // Haunting Spirits
- if (GetId() == 7057)
- target->CastSpell((Unit*)NULL, GetAmount(), true);
- break;
default:
break;
}
@@ -3377,7 +3349,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
case 96:
case 1615:
{
- if (GetBaseAmount())
+ if (GetAmount())
{
mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
| (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
@@ -3486,7 +3458,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
}
case 1630:
{
- if (!GetBaseAmount())
+ if (!GetAmount())
{
target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, apply);
aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
@@ -3524,7 +3496,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
case 477:
case 1733:
{
- if (!GetBaseAmount())
+ if (!GetAmount())
{
mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
| (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
@@ -3558,7 +3530,7 @@ void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8
}
case 878:
{
- if (GetBaseAmount() == 1)
+ if (GetAmount() == 1)
{
mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN)
| (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE);
@@ -5011,38 +4983,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
if (Unit* spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget()))
target->CastSpell(spellTarget, 51699, true);
break;
- case 28832: // Mark of Korth'azz
- case 28833: // Mark of Blaumeux
- case 28834: // Mark of Rivendare
- case 28835: // Mark of Zeliek
- if (caster) // actually we can also use cast(this, originalcasterguid)
- {
- int32 damage;
- switch (GetBase()->GetStackAmount())
- {
- case 1: damage = 0; break;
- case 2: damage = 500; break;
- case 3: damage = 1000; break;
- case 4: damage = 1500; break;
- case 5: damage = 4000; break;
- case 6: damage = 12000; break;
- default:damage = 20000 + 1000 * (GetBase()->GetStackAmount() - 7); break;
- }
- if (damage)
- caster->CastCustomSpell(28836, SPELLVALUE_BASE_POINT0, damage, target);
- }
- break;
- case 63322: // Saronite Vapors
- {
- if (caster)
- {
- int32 mana = int32(GetAmount() * pow(2.0f, GetBase()->GetStackAmount())); // mana restore - bp * 2^stackamount
- int32 damage = mana * 2; // damage
- caster->CastCustomSpell(target, 63337, &mana, NULL, NULL, true);
- caster->CastCustomSpell(target, 63338, &damage, NULL, NULL, true);
- }
- break;
- }
case 71563:
if (Aura* newAura = target->AddAura(71564, target))
newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount);
@@ -5136,57 +5076,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
break;
}
break;
- case SPELLFAMILY_MAGE:
- // Living Bomb
- if (m_spellInfo->SpellFamilyFlags[1] & 0x20000)
- {
- AuraRemoveMode removeMode = aurApp->GetRemoveMode();
- if (caster && (removeMode == AURA_REMOVE_BY_ENEMY_SPELL || removeMode == AURA_REMOVE_BY_EXPIRE))
- caster->CastSpell(target, GetAmount(), true);
- }
- break;
- case SPELLFAMILY_PRIEST:
- // Vampiric Touch
- if (m_spellInfo->SpellFamilyFlags[1] & 0x0400 && aurApp->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && GetEffIndex() == 0)
- if (AuraEffect const* aurEff = GetBase()->GetEffect(1))
- {
- int32 damage = aurEff->GetAmount() * 8;
- // backfire damage
- target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID());
- }
- break;
- case SPELLFAMILY_WARLOCK:
- // Haunt
- if (m_spellInfo->SpellFamilyFlags[1] & 0x40000)
- if (caster)
- target->CastCustomSpell(caster, 48210, &m_amount, 0, 0, true, NULL, this, GetCasterGUID());
- break;
- case SPELLFAMILY_DRUID:
- // Lifebloom
- if (GetSpellInfo()->SpellFamilyFlags[1] & 0x10)
- {
- // Final heal only on duration end
- if (aurApp->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
- return;
-
- // final heal
- int32 stack = GetBase()->GetStackAmount();
- int32 heal = m_amount;
- if (caster)
- {
- heal = caster->SpellHealingBonusDone(target, GetSpellInfo(), heal, HEAL, stack);
- heal = target->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, HEAL, stack);
- }
- target->CastCustomSpell(target, 33778, &heal, &stack, NULL, true, NULL, this, GetCasterGUID());
-
- // restore mana
- if (caster)
- {
- int32 returnmana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
- caster->CastCustomSpell(caster, 64372, &returnmana, NULL, NULL, true, NULL, this, GetCasterGUID());
- }
- }
- break;
case SPELLFAMILY_DEATHKNIGHT:
// Summon Gargoyle (Dismiss Gargoyle at remove)
if (GetId() == 61777)
@@ -5262,48 +5151,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
target->SetEntry(apply ? 17654 : 17326);
break;
}
- //Summon Fire Elemental
- case 40133:
- {
- if (!caster)
- break;
-
- Unit* owner = caster->GetOwner();
- if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- {
- if (apply)
- owner->CastSpell(owner, 8985, true);
- else
- owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
- }
- break;
- }
- //Summon Earth Elemental
- case 40132 :
- {
- if (!caster)
- break;
-
- Unit* owner = caster->GetOwner();
- if (owner && owner->GetTypeId() == TYPEID_PLAYER)
- {
- if (apply)
- owner->CastSpell(owner, 19704, true);
- else
- owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
- }
- break;
- }
- case 57723: // Exhaustion
- case 57724: // Sated
- {
- switch (GetId())
- {
- case 57723: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 32182, apply); break; // Heroism
- case 57724: target->ApplySpellImmune(GetId(), IMMUNITY_ID, 2825, apply); break; // Bloodlust
- }
- break;
- }
case 57819: // Argent Champion
case 57820: // Ebon Champion
case 57821: // Champion of the Kirin Tor
@@ -5396,69 +5243,14 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
}
case SPELLFAMILY_DRUID:
{
- if (!(mode & AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK))
- break;
- switch (GetId())
- {
- case 52610: // Savage Roar
- {
- uint32 spellId = 62071;
- if (apply)
- {
- if (target->GetShapeshiftForm() != FORM_CAT)
- break;
-
- target->CastSpell(target, spellId, true, NULL, NULL, GetCasterGUID());
- break;
- }
- target->RemoveAurasDueToSpell(spellId);
- break;
- }
- case 61336: // Survival Instincts
- {
- if (!(mode & AURA_EFFECT_HANDLE_REAL))
- break;
-
- if (apply)
- {
- if (!target->IsInFeralForm())
- break;
-
- int32 bp0 = int32(target->CountPctFromMaxHealth(GetAmount()));
- target->CastCustomSpell(target, 50322, &bp0, NULL, NULL, true);
- }
- else
- target->RemoveAurasDueToSpell(50322);
- break;
- }
- }
- // Predatory Strikes
- if (target->GetTypeId() == TYPEID_PLAYER && GetSpellInfo()->SpellIconID == 1563)
- {
- target->ToPlayer()->UpdateAttackPowerAndDamage();
- }
+ //if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ //break;
break;
}
case SPELLFAMILY_SHAMAN:
{
- if (!(mode & AURA_EFFECT_HANDLE_REAL))
- break;
- // Sentry Totem
- if (GetId() == 6495 && caster && caster->GetTypeId() == TYPEID_PLAYER)
- {
- if (apply)
- {
- if (uint64 guid = caster->m_SummonSlot[4])
- {
- if (Creature* totem = caster->GetMap()->GetCreature(guid))
- if (totem->isTotem())
- caster->ToPlayer()->CastSpell(totem, 6277, true);
- }
- }
- else
- caster->ToPlayer()->StopCastingBindSight();
- return;
- }
+ //if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ //break;
break;
}
case SPELLFAMILY_PALADIN:
@@ -6088,14 +5880,6 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster)
if (caster)
caster->CastCustomSpell(29879, SPELLVALUE_BASE_POINT0, int32(target->CountPctFromMaxHealth(21)), target, true, NULL, this);
return;
- // Detonate Mana
- case 27819:
- if (int32 mana = (int32)(target->GetMaxPower(POWER_MANA) / 10))
- {
- mana = target->ModifyPower(POWER_MANA, -mana);
- target->CastCustomSpell(27820, SPELLVALUE_BASE_POINT0, -mana*10, target, true, NULL, this);
- }
- return;
// Inoculate Nestlewood Owlkin
case 29528:
if (target->GetTypeId() != TYPEID_UNIT) // prevent error reports in case ignored player target
@@ -6760,33 +6544,6 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con
target->AddThreat(caster, float(gainedAmount) * 0.5f, GetSpellInfo()->GetSchoolMask(), GetSpellInfo());
}
- // spell-specific code
- switch (GetId())
- {
- case 31447: // Mark of Kaz'rogal
- if (target->GetPower(powerType) == 0)
- {
- target->CastSpell(target, 31463, true, 0, this);
- // Remove aura
- GetBase()->SetDuration(0);
- }
- break;
- case 32960: // Mark of Kazzak
- {
- int32 modifier = int32(target->GetPower(powerType) * 0.05f);
- target->ModifyPower(powerType, -modifier);
-
- if (target->GetPower(powerType) == 0)
- {
- target->CastSpell(target, 32961, true, 0, this);
- // Remove aura
- GetBase()->SetDuration(0);
- }
- break;
- }
- default:
- break;
- }
// Drain Mana
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK
&& m_spellInfo->SpellFamilyFlags[0] & 0x00000010)
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 58a89f75fd3..f823e45525d 100755
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1286,18 +1286,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
maxSize = m_caster->HasAura(62970) ? 6 : 5; // Glyph of Wild Growth
power = POWER_HEALTH;
}
- else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall
- {
- // Remove targets not in LoS or in stealth
- for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
- {
- if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster))
- itr = unitTargets.erase(itr);
- else
- ++itr;
- }
- break;
- }
else
break;
@@ -1338,6 +1326,11 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
}
}
+ // todo: move to scripts, but we must call it before resize list by MaxAffectedTargets
+ // Intimidating Shout
+ if (m_spellInfo->Id == 5246 && effIndex != EFFECT_0)
+ unitTargets.remove(m_targets.GetUnitTarget());
+
// Other special target selection goes here
if (uint32 maxTargets = m_spellValue->MaxAffectedTargets)
{
@@ -1346,8 +1339,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
if ((*j)->IsAffectedOnSpell(m_spellInfo))
maxTargets += (*j)->GetAmount();
- if (m_spellInfo->Id == 5246) //Intimidating Shout
- unitTargets.remove(m_targets.GetUnitTarget());
Trinity::Containers::RandomResizeList(unitTargets, maxTargets);
}
@@ -2473,12 +2464,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
caster->ToPlayer()->CastItemCombatSpell(unitTarget, m_attackType, procVictim, procEx);
}
- // Haunt
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[1] & 0x40000 && m_spellAura && m_spellAura->GetEffect(1))
- {
- AuraEffect* aurEff = m_spellAura->GetEffect(1);
- aurEff->SetAmount(CalculatePctU(aurEff->GetAmount(), damageInfo.damage));
- }
m_damage = damageInfo.damage;
@@ -2547,12 +2532,31 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
return SPELL_MISS_EVADE;
// For delayed spells immunity may be applied between missile launch and hit - check immunity for that case
+ if (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo)))
+ return SPELL_MISS_IMMUNE;
+
// disable effects to which unit is immune
+ SpellMissInfo returnVal = SPELL_MISS_IMMUNE;
for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber)
- if (effectMask & (1 << effectNumber) && unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber))
- effectMask &= ~(1 << effectNumber);
- if (!effectMask || (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo))))
- return SPELL_MISS_IMMUNE;
+ {
+ if (effectMask & (1 << effectNumber))
+ if (unit->IsImmunedToSpellEffect(m_spellInfo, effectNumber))
+ effectMask &= ~(1 << effectNumber);
+ else if (m_spellInfo->Effects[effectNumber].IsAura() && !m_spellInfo->IsPositiveEffect(effectNumber))
+ {
+ int32 debuff_resist_chance = unit->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel));
+ debuff_resist_chance += unit->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel));
+
+ if (debuff_resist_chance > 0)
+ if (irand(0,10000) <= (debuff_resist_chance * 100))
+ {
+ effectMask &= ~(1 << effectNumber);
+ returnVal = SPELL_MISS_RESIST;
+ }
+ }
+ }
+ if (!effectMask)
+ return returnVal;
PrepareScriptHitHandlers();
CallScriptBeforeHitHandlers();
@@ -4839,19 +4843,9 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!(m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS) && VMAP::VMapFactory::checkSpellForLoS(m_spellInfo->Id) && !m_caster->IsWithinLOSInMap(target))
return SPELL_FAILED_LINE_OF_SIGHT;
}
- else
- {
- if (m_caster->GetTypeId() == TYPEID_PLAYER) // Target - is player caster
- {
- // Lay on Hands - cannot be self-cast on paladin with Forbearance or after using Avenging Wrath
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellInfo->SpellFamilyFlags[0] & 0x0008000)
- if (target->HasAura(61988)) // Immunity shield marker
- return SPELL_FAILED_TARGET_AURASTATE;
- }
- }
}
- //Check for line of sight for spells with dest
+ // Check for line of sight for spells with dest
if (m_targets.HasDst())
{
float x, y, z;
@@ -4950,7 +4944,8 @@ SpellCastResult Spell::CheckCast(bool strict)
bool hasDispellableAura = false;
bool hasNonDispelEffect = false;
- for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ uint32 dispelMask = 0;
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL)
{
if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->AttributesEx & SPELL_ATTR1_MELEE_COMBAT_START)
@@ -4958,17 +4953,8 @@ SpellCastResult Spell::CheckCast(bool strict)
hasDispellableAura = true;
break;
}
- if (Unit* target = m_targets.GetUnitTarget())
- {
- DispelChargesList dispelList;
- uint32 dispelMask = SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
- target->GetDispellableAuraList(m_caster, dispelMask, dispelList);
- if (!dispelList.empty())
- {
- hasDispellableAura = true;
- break;
- }
- }
+
+ dispelMask |= SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
}
else if (m_spellInfo->Effects[i].IsEffect())
{
@@ -4976,34 +4962,22 @@ SpellCastResult Spell::CheckCast(bool strict)
break;
}
- if (!hasNonDispelEffect && !hasDispellableAura && m_spellInfo->HasEffect(SPELL_EFFECT_DISPEL) && !IsTriggered())
- return SPELL_FAILED_NOTHING_TO_DISPEL;
+ if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered())
+ {
+ if (Unit* target = m_targets.GetUnitTarget())
+ {
+ DispelChargesList dispelList;
+ target->GetDispellableAuraList(m_caster, dispelMask, dispelList);
+ if (dispelList.empty())
+ return SPELL_FAILED_NOTHING_TO_DISPEL;
+ }
+ }
- for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
// for effects of spells that have only one target
switch (m_spellInfo->Effects[i].Effect)
{
- case SPELL_EFFECT_DUMMY:
- {
- if (m_spellInfo->Id == 19938) // Awaken Peon
- {
- Unit* unit = m_targets.GetUnitTarget();
- if (!unit || !unit->HasAura(17743))
- return SPELL_FAILED_BAD_TARGETS;
- }
- else if (m_spellInfo->Id == 31789) // Righteous Defense
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return SPELL_FAILED_DONT_REPORT;
-
- Unit* target = m_targets.GetUnitTarget();
- if (!target || !target->IsFriendlyTo(m_caster) || target->getAttackers().empty())
- return SPELL_FAILED_BAD_TARGETS;
-
- }
- break;
- }
case SPELL_EFFECT_LEARN_SPELL:
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -5320,10 +5294,6 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_EFFECT_LEAP_BACK:
{
- // Spell 781 (Disengage) requires player to be in combat
- if (m_caster->GetTypeId() == TYPEID_PLAYER && m_spellInfo->Id == 781 && !m_caster->isInCombat())
- return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
-
if (m_caster->HasUnitState(UNIT_STATE_ROOT))
{
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -5345,66 +5315,10 @@ SpellCastResult Spell::CheckCast(bool strict)
}
}
- for (int i = 0; i < MAX_SPELL_EFFECTS; i++)
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
switch (m_spellInfo->Effects[i].ApplyAuraName)
{
- case SPELL_AURA_DUMMY:
- {
- //custom check
- switch (m_spellInfo->Id)
- {
- // Tag Murloc
- case 30877:
- {
- Unit* target = m_targets.GetUnitTarget();
- if (!target || target->GetEntry() != 17326)
- return SPELL_FAILED_BAD_TARGETS;
- break;
- }
- case 61336:
- if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_caster->ToPlayer()->IsInFeralForm())
- return SPELL_FAILED_ONLY_SHAPESHIFT;
- break;
- case 1515:
- {
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return SPELL_FAILED_BAD_TARGETS;
-
- if (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget()->GetTypeId() == TYPEID_PLAYER)
- return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
-
- Creature* target = m_targets.GetUnitTarget()->ToCreature();
-
- if (target->getLevel() > m_caster->getLevel())
- return SPELL_FAILED_HIGHLEVEL;
-
- // use SMSG_PET_TAME_FAILURE?
- if (!target->GetCreatureTemplate()->isTameable (m_caster->ToPlayer()->CanTameExoticPets()))
- return SPELL_FAILED_BAD_TARGETS;
-
- if (m_caster->GetPetGUID())
- return SPELL_FAILED_ALREADY_HAVE_SUMMON;
-
- if (m_caster->GetCharmGUID())
- return SPELL_FAILED_ALREADY_HAVE_CHARM;
-
- break;
- }
- case 44795: // Parachute
- {
- float x, y, z;
- m_caster->GetPosition(x, y, z);
- float ground_Z = m_caster->GetMap()->GetHeight(m_caster->GetPhaseMask(), x, y, z);
- if (fabs(ground_Z - z) < 0.1f)
- return SPELL_FAILED_DONT_REPORT;
- break;
- }
- default:
- break;
- }
- break;
- }
case SPELL_AURA_MOD_POSSESS_PET:
{
if (m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -7164,12 +7078,6 @@ void Spell::PrepareTriggersExecutedOnHit()
// todo: move this to scripts
switch (m_spellInfo->SpellFamilyName)
{
- case SPELLFAMILY_GENERIC:
- {
- if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages
- m_preCastSpell = 11196; // Recently Bandaged
- break;
- }
case SPELLFAMILY_MAGE:
{
// Permafrost
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 0d5dac8f8e0..e08c7dc6d55 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -353,43 +353,6 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
return;
break;
}
- case 33671: // gruul's shatter
- case 50811: // krystallus shatter ( Normal )
- case 61547: // krystallus shatter ( Heroic )
- {
- // don't damage self and only players
- if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- float radius = m_spellInfo->Effects[EFFECT_0].CalcRadius(m_caster);
- if (!radius)
- return;
- float distance = m_caster->GetDistance2d(unitTarget);
- damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * ((radius - distance)/radius));
- break;
- }
- // Loken Pulsing Shockwave
- case 59837:
- case 52942:
- {
- // don't damage self and only players
- if (unitTarget->GetGUID() == m_caster->GetGUID() || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- float radius = m_spellInfo->Effects[EFFECT_0].CalcRadius(m_caster);
- if (!radius)
- return;
- float distance = m_caster->GetDistance2d(unitTarget);
- damage = (distance > radius) ? 0 : int32(m_spellInfo->Effects[EFFECT_0].CalcValue(m_caster) * distance);
- break;
- }
- // TODO: add spell specific target requirement hook for spells
- // Shadowbolts only affects targets with Shadow Mark (Gothik)
- case 27831:
- case 55638:
- if (!unitTarget->HasAura(27825))
- return;
- break;
// Gargoyle Strike
case 51963:
{
@@ -3574,15 +3537,6 @@ void Spell::EffectHealMaxHealth(SpellEffIndex /*effIndex*/)
return;
int32 addhealth = 0;
- if (m_spellInfo->SpellFamilyName == SPELLFAMILY_PALADIN) // Lay on Hands
- {
- if (m_caster->GetGUID() == unitTarget->GetGUID())
- {
- m_caster->CastSpell(m_caster, 25771, true); // Forbearance
- m_caster->CastSpell(m_caster, 61988, true); // Immune shield marker (serverside)
- m_caster->CastSpell(m_caster, 61987, true); // Avenging Wrath marker
- }
- }
// damage == 0 - heal for caster max health
if (damage == 0)
@@ -3813,12 +3767,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (!itemTarget && m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- uint32 spell_id = 0;
- switch (urand(1, 5))
- {
- case 1: spell_id = 8854; break;
- default: spell_id = 8855; break;
- }
+ uint32 spell_id = roll_chance_i(20) ? 8854 : 8855;
m_caster->CastSpell(m_caster, spell_id, true, NULL);
return;
@@ -3865,10 +3814,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE);
return;
}
- // Escape artist
- case 20589:
- m_caster->RemoveMovementImpairingAuras();
- return;
// Decimate
case 28374:
case 54426:
@@ -3899,15 +3844,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
DoCreateItem(effIndex, item);
break;
}
- // Improved Sprint
- case 30918:
- {
- // Removes snares and roots.
- unitTarget->RemoveMovementImpairingAuras();
- break;
- }
- // Spirit Walk
- case 58876:
+ case 20589: // Escape artist
+ case 30918: // Improved Sprint
{
// Removes snares and roots.
unitTarget->RemoveMovementImpairingAuras();
@@ -3925,96 +3863,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
}
}
break;
- case 48025: // Headless Horseman's Mount
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 51621, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 48024, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 51617, true);
- else
- unitTarget->CastSpell(unitTarget, 48024, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 48023, true);
- else
- unitTarget->CastSpell(unitTarget, 48024, true);
- }break;
- }
- return;
- }
- case 47977: // Magic Broom
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 42680, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 42683, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 42667, true);
- else
- unitTarget->CastSpell(unitTarget, 42683, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 42668, true);
- else
- unitTarget->CastSpell(unitTarget, 42683, true);
- }break;
- }
- return;
- }
// Mug Transformation
case 41931:
{
@@ -4206,25 +4054,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
if (unitTarget)
unitTarget->CastSpell(m_caster, damage, true);
return;
- // Winged Steed of the Ebon Blade
- case 54729:
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill
- if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
- {
- if (skillval >= 300)
- unitTarget->CastSpell(unitTarget, 54727, true);
- else
- unitTarget->CastSpell(unitTarget, 54726, true);
- }
- return;
- }
case 57347: // Retrieving (Wintergrasp RP-GG pickup spell)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || m_caster->GetTypeId() != TYPEID_PLAYER)
@@ -4307,188 +4136,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
m_caster->CastSpell(m_caster, 63919, true);
return;
}
- case 71342: // Big Love Rocket
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 0: unitTarget->CastSpell(unitTarget, 71343, true); break;
- case 75: unitTarget->CastSpell(unitTarget, 71344, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 71345, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 71346, true);
- else
- unitTarget->CastSpell(unitTarget, 71345, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 71347, true);
- else
- unitTarget->CastSpell(unitTarget, 71345, true);
- }break;
- }
- return;
- }
- case 72286: // Invincible
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 72281, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 72282, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 72283, true);
- else
- unitTarget->CastSpell(unitTarget, 72282, true);
- }break;
- case 300:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 72284, true);
- else
- unitTarget->CastSpell(unitTarget, 72282, true);
- }break;
- }
- return;
- }
- case 74856: // Blazing Hippogryph
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill
- if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
- {
- if (skillval >= 300)
- unitTarget->CastSpell(unitTarget, 74855, true);
- else
- unitTarget->CastSpell(unitTarget, 74854, true);
- }
- return;
- }
- case 75614: // Celestial Steed
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts and client crashes upon dismounting
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill and zone
- bool canFly = true;
- uint32 v_map = GetVirtualMapForMapAndZone(unitTarget->GetMapId(), unitTarget->GetZoneId());
- if (v_map != 530 && v_map != 571)
- canFly = false;
-
- if (canFly && v_map == 571 && !unitTarget->ToPlayer()->HasSpell(54197))
- canFly = false;
-
- float x, y, z;
- unitTarget->GetPosition(x, y, z);
- uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
- AreaTableEntry const* pArea = sAreaStore.LookupEntry(areaFlag);
- if (!pArea || (canFly && (pArea->flags & AREA_FLAG_NO_FLY_ZONE)))
- canFly = false;
-
- switch (unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
- {
- case 75: unitTarget->CastSpell(unitTarget, 75619, true); break;
- case 150: unitTarget->CastSpell(unitTarget, 75620, true); break;
- case 225:
- {
- if (canFly)
- unitTarget->CastSpell(unitTarget, 75617, true);
- else
- unitTarget->CastSpell(unitTarget, 75620, true);
- }break;
- case 300:
- {
- if (canFly)
- {
- if (unitTarget->ToPlayer()->Has310Flyer(false))
- unitTarget->CastSpell(unitTarget, 76153, true);
- else
- unitTarget->CastSpell(unitTarget, 75618, true);
- }
- else
- unitTarget->CastSpell(unitTarget, 75620, true);
- }break;
- }
- return;
- }
- case 75973: // X-53 Touring Rocket
- {
- if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
- return;
-
- // Prevent stacking of mounts
- unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED);
-
- // Triggered spell id dependent on riding skill
- if (uint16 skillval = unitTarget->ToPlayer()->GetSkillValue(SKILL_RIDING))
- {
- if (skillval >= 300)
- {
- if (unitTarget->ToPlayer()->Has310Flyer(false))
- unitTarget->CastSpell(unitTarget, 76154, true);
- else
- unitTarget->CastSpell(unitTarget, 75972, true);
- }
- else
- unitTarget->CastSpell(unitTarget, 75957, true);
- }
- return;
- }
case 59317: // Teleporting
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
@@ -5104,16 +4751,14 @@ void Spell::EffectDisEnchant(SpellEffIndex /*effIndex*/)
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
return;
- if (m_caster->GetTypeId() != TYPEID_PLAYER)
- return;
-
- Player* p_caster = (Player*)m_caster;
if (!itemTarget || !itemTarget->GetTemplate()->DisenchantID)
return;
- p_caster->UpdateCraftSkill(m_spellInfo->Id);
-
- m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING);
+ if (Player* caster = m_caster->ToPlayer())
+ {
+ caster->UpdateCraftSkill(m_spellInfo->Id);
+ caster->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING);
+ }
// item will be removed at disenchanting end
}
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index a931f759163..7995087f2c1 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -450,6 +450,7 @@ int32 SpellEffectInfo::CalcValue(Unit const* caster, int32 const* bp, Unit const
if (!basePointsPerLevel && (_spellInfo->Attributes & SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION && _spellInfo->SpellLevel) &&
Effect != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE &&
Effect != SPELL_EFFECT_KNOCK_BACK &&
+ Effect != SPELL_EFFECT_ADD_EXTRA_ATTACKS &&
ApplyAuraName != SPELL_AURA_MOD_SPEED_ALWAYS &&
ApplyAuraName != SPELL_AURA_MOD_SPEED_NOT_STACK &&
ApplyAuraName != SPELL_AURA_MOD_INCREASE_SPEED &&
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index d9459b11ba1..834da088c56 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -2960,8 +2960,10 @@ void SpellMgr::LoadDbcDataCorrections()
switch (spellInfo->Id)
{
- case 40244: case 40245: // Simon Game Visual
- case 40246: case 40247: // Simon Game Visual
+ case 40244: // Simon Game Visual
+ case 40245: // Simon Game Visual
+ case 40246: // Simon Game Visual
+ case 40247: // Simon Game Visual
case 42835: // Spout, remove damage effect, only anim is needed
spellInfo->Effect[0] = 0;
break;
@@ -2973,7 +2975,6 @@ void SpellMgr::LoadDbcDataCorrections()
spellInfo->EffectImplicitTargetB[0] = 0;
break;
case 63665: // Charge (Argent Tournament emote on riders)
- case 31447: // Mark of Kaz'rogal (needs target selection script)
case 31298: // Sleep (needs target selection script)
case 51904: // Summon Ghouls On Scarlet Crusade (this should use conditions table, script for this spell needs to be fixed)
case 2895: // Wrath of Air Totem rank 1 (Aura)
@@ -3128,6 +3129,9 @@ void SpellMgr::LoadDbcDataCorrections()
case 51852: // The Eye of Acherus (no spawn in phase 2 in db)
spellInfo->EffectMiscValue[0] |= 1;
break;
+ case 51912: // Crafty's Ultra-Advanced Proto-Typical Shortening Blaster
+ spellInfo->EffectAmplitude[0] = 3000;
+ break;
case 29809: // Desecration Arm - 36 instead of 37 - typo? :/
spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_7_YARDS;
break;
@@ -3258,6 +3262,10 @@ void SpellMgr::LoadDbcDataCorrections()
case 53313: // Entangling Roots (Rank 8) -- Nature's Grasp Proc
spellInfo->CastingTimeIndex = 1;
break;
+ case 59414: // Pulsing Shockwave Aura (Loken)
+ // this flag breaks movement, remove it
+ spellInfo->AttributesEx &= ~SPELL_ATTR1_CHANNELED_1;
+ break;
case 61719: // Easter Lay Noblegarden Egg Aura - Interrupt flags copied from aura which this aura is linked with
spellInfo->AuraInterruptFlags = AURA_INTERRUPT_FLAG_HITBYSPELL | AURA_INTERRUPT_FLAG_TAKE_DAMAGE;
break;
@@ -3299,11 +3307,6 @@ void SpellMgr::LoadDbcDataCorrections()
// that will be clear if we get more spells with problem like this
spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY;
break;
- case 62584: // Lifebinder's Gift
- case 64185: // Lifebinder's Gift
- spellInfo->EffectImplicitTargetB[1] = TARGET_UNIT_NEARBY_ENTRY;
- spellInfo->EffectImplicitTargetB[2] = TARGET_UNIT_NEARBY_ENTRY;
- break;
case 62301: // Cosmic Smash (Algalon the Observer)
spellInfo->MaxAffectedTargets = 1;
break;
@@ -3545,11 +3548,6 @@ void SpellMgr::LoadDbcDataCorrections()
switch (spellInfo->SpellFamilyName)
{
- case SPELLFAMILY_DRUID:
- // Starfall Target Selection
- if (spellInfo->SpellFamilyFlags[2] & 0x100)
- spellInfo->MaxAffectedTargets = 2;
- break;
case SPELLFAMILY_PALADIN:
// Seals of the Pure should affect Seal of Righteousness
if (spellInfo->SpellIconID == 25 && spellInfo->Attributes & SPELL_ATTR0_PASSIVE)
diff --git a/src/server/game/Warden/Warden.cpp b/src/server/game/Warden/Warden.cpp
index 0734e0a0f63..cc1c2ff50c6 100644
--- a/src/server/game/Warden/Warden.cpp
+++ b/src/server/game/Warden/Warden.cpp
@@ -188,7 +188,11 @@ std::string Warden::Penalty(WardenCheck* check /*= NULL*/)
std::string accountName;
AccountMgr::GetName(_session->GetAccountId(), accountName);
std::stringstream banReason;
- banReason << "Warden Anticheat Violation: " << check->Comment << " (CheckId: " << check->CheckId << ")";
+ banReason << "Warden Anticheat Violation";
+ // Check can be NULL, for example if the client sent a wrong signature in the warden packet (CHECKSUM FAIL)
+ if (check)
+ banReason << ": " << check->Comment << " (CheckId: " << check->CheckId << ")";
+
sWorld->BanAccount(BAN_ACCOUNT, accountName, duration.str(), banReason.str(),"Server");
return "Ban";
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 5bd5961a05b..3aee1dc429e 100755
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1022,6 +1022,7 @@ void World::LoadConfigSettings(bool reload)
m_bool_configs[CONFIG_BG_XP_FOR_KILL] = ConfigMgr::GetBoolDefault("Battleground.GiveXPForKills", false);
m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = ConfigMgr::GetIntDefault ("Arena.MaxRatingDifference", 150);
m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS);
+ m_int_configs[CONFIG_ARENA_RATED_UPDATE_TIMER] = ConfigMgr::GetIntDefault ("Arena.RatedUpdateTimer", 5 * IN_MILLISECONDS);
m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = ConfigMgr::GetBoolDefault("Arena.AutoDistributePoints", false);
m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = ConfigMgr::GetIntDefault ("Arena.AutoDistributeInterval", 7);
m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = ConfigMgr::GetBoolDefault("Arena.QueueAnnouncer.Enable", false);
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 95e9fbda8ca..f0dbc3c84ad 100755
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -279,6 +279,7 @@ enum WorldIntConfigs
CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH,
CONFIG_ARENA_MAX_RATING_DIFFERENCE,
CONFIG_ARENA_RATING_DISCARD_TIMER,
+ CONFIG_ARENA_RATED_UPDATE_TIMER,
CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS,
CONFIG_ARENA_SEASON_ID,
CONFIG_ARENA_START_RATING,
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index 63e753a18ba..676cd7be4f0 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
@@ -27,7 +27,11 @@ EndScriptData */
npc_shadowfang_prisoner
EndContentData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "ScriptedEscortAI.h"
#include "shadowfang_keep.h"
@@ -193,8 +197,48 @@ public:
};
+class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader
+{
+ public:
+ spell_shadowfang_keep_haunting_spirits() : SpellScriptLoader("spell_shadowfang_keep_haunting_spirits") { }
+
+ class spell_shadowfang_keep_haunting_spirits_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_shadowfang_keep_haunting_spirits_AuraScript);
+
+ void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
+ {
+ isPeriodic = true;
+ amplitude = (irand(0, 60) + 30) * IN_MILLISECONDS;
+ }
+
+ void HandleDummyTick(AuraEffect const* aurEff)
+ {
+ GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true);
+ }
+
+ void HandleUpdatePeriodic(AuraEffect* aurEff)
+ {
+ aurEff->CalculatePeriodic(GetCaster());
+ }
+
+ void Register()
+ {
+ DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleDummyTick, EFFECT_0, SPELL_AURA_DUMMY);
+ OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_shadowfang_keep_haunting_spirits_AuraScript::HandleUpdatePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_shadowfang_keep_haunting_spirits_AuraScript();
+ }
+};
+
void AddSC_shadowfang_keep()
{
new npc_shadowfang_prisoner();
new npc_arugal_voidwalker();
+ new spell_shadowfang_keep_haunting_spirits();
}
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index b5698d851f8..4fcfa8a046e 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -23,7 +23,10 @@ SDComment:
SDCategory: Zul'Aman
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "zulaman.h"
#define YELL_AGGRO "Da shadow gonna fall on you... "
@@ -47,54 +50,58 @@ EndScriptData */
//Defines for various powers he uses after using soul drain
-//Druid
-#define SPELL_DR_LIFEBLOOM 43421
-#define SPELL_DR_THORNS 43420
-#define SPELL_DR_MOONFIRE 43545
-
-//Hunter
-#define SPELL_HU_EXPLOSIVE_TRAP 43444
-#define SPELL_HU_FREEZING_TRAP 43447
-#define SPELL_HU_SNAKE_TRAP 43449
-
-//Mage
-#define SPELL_MG_FIREBALL 41383
-#define SPELL_MG_FROSTBOLT 43428
-#define SPELL_MG_FROST_NOVA 43426
-#define SPELL_MG_ICE_LANCE 43427
-
-//Paladin
-#define SPELL_PA_CONSECRATION 43429
-#define SPELL_PA_HOLY_LIGHT 43451
-#define SPELL_PA_AVENGING_WRATH 43430
-
-//Priest
-#define SPELL_PR_HEAL 41372
-#define SPELL_PR_MIND_CONTROL 43550
-#define SPELL_PR_MIND_BLAST 41374
-#define SPELL_PR_SW_DEATH 41375
-#define SPELL_PR_PSYCHIC_SCREAM 43432
-#define SPELL_PR_PAIN_SUPP 44416
-
-//Rogue
-#define SPELL_RO_BLIND 43433
-#define SPELL_RO_SLICE_DICE 43457
-#define SPELL_RO_WOUND_POISON 39665
-
-//Shaman
-#define SPELL_SH_FIRE_NOVA 43436
-#define SPELL_SH_HEALING_WAVE 43548
-#define SPELL_SH_CHAIN_LIGHT 43435
-
-//Warlock
-#define SPELL_WL_CURSE_OF_DOOM 43439
-#define SPELL_WL_RAIN_OF_FIRE 43440
-#define SPELL_WL_UNSTABLE_AFFL 35183
-
-//Warrior
-#define SPELL_WR_SPELL_REFLECT 43443
-#define SPELL_WR_WHIRLWIND 43442
-#define SPELL_WR_MORTAL_STRIKE 43441
+enum Spells
+{
+ // Druid
+ SPELL_DR_THORNS = 43420,
+ SPELL_DR_LIFEBLOOM = 43421,
+ SPELL_DR_MOONFIRE = 43545,
+
+ // Hunter
+ SPELL_HU_EXPLOSIVE_TRAP = 43444,
+ SPELL_HU_FREEZING_TRAP = 43447,
+ SPELL_HU_SNAKE_TRAP = 43449,
+
+ // Mage
+ SPELL_MG_FIREBALL = 41383,
+ SPELL_MG_FROST_NOVA = 43426,
+ SPELL_MG_ICE_LANCE = 43427,
+ SPELL_MG_FROSTBOLT = 43428,
+
+ // Paladin
+ SPELL_PA_CONSECRATION = 43429,
+ SPELL_PA_AVENGING_WRATH = 43430,
+ SPELL_PA_HOLY_LIGHT = 43451,
+
+ // Priest
+ SPELL_PR_HEAL = 41372,
+ SPELL_PR_MIND_BLAST = 41374,
+ SPELL_PR_SW_DEATH = 41375,
+ SPELL_PR_PSYCHIC_SCREAM = 43432,
+ SPELL_PR_MIND_CONTROL = 43550,
+ SPELL_PR_PAIN_SUPP = 44416,
+
+ // Rogue
+ SPELL_RO_BLIND = 43433,
+ SPELL_RO_SLICE_DICE = 43457,
+ SPELL_RO_WOUND_POISON = 43461,
+
+ // Shaman
+ SPELL_SH_CHAIN_LIGHT = 43435,
+ SPELL_SH_FIRE_NOVA = 43436,
+ SPELL_SH_HEALING_WAVE = 43548,
+
+ // Warlock
+ SPELL_WL_CURSE_OF_DOOM = 43439,
+ SPELL_WL_RAIN_OF_FIRE = 43440,
+ SPELL_WL_UNSTABLE_AFFL = 43522,
+ SPELL_WL_UNSTABLE_AFFL_DISPEL = 43523,
+
+ // Warrior
+ SPELL_WR_MORTAL_STRIKE = 43441,
+ SPELL_WR_WHIRLWIND = 43442,
+ SPELL_WR_SPELL_REFLECT = 43443
+};
#define ORIENT 1.5696f
#define POS_Y 921.2795f
@@ -936,6 +943,40 @@ class boss_koragg : public CreatureScript
}
};
+class spell_hexlord_unstable_affliction : public SpellScriptLoader
+{
+ public:
+ spell_hexlord_unstable_affliction() : SpellScriptLoader("spell_hexlord_unstable_affliction") { }
+
+ class spell_hexlord_unstable_affliction_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hexlord_unstable_affliction_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_WL_UNSTABLE_AFFL_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(dispelInfo->GetDispeller(), SPELL_WL_UNSTABLE_AFFL_DISPEL, true, NULL, GetEffect(EFFECT_0));
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_hexlord_unstable_affliction_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hexlord_unstable_affliction_AuraScript();
+ }
+};
+
void AddSC_boss_hex_lord_malacrass()
{
new boss_hexlord_malacrass();
@@ -947,5 +988,6 @@ void AddSC_boss_hex_lord_malacrass()
new boss_fenstalker();
new boss_koragg();
new boss_alyson_antille();
+ new spell_hexlord_unstable_affliction();
}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
index 407faa19eaa..c1ae04cf4c0 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp
@@ -15,13 +15,20 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
#include "hyjal.h"
#include "hyjal_trash.h"
-#define SPELL_CLEAVE 31436
-#define SPELL_WARSTOMP 31480
-#define SPELL_MARK 31447
+enum Spells
+{
+ SPELL_CLEAVE = 31436,
+ SPELL_WARSTOMP = 31480,
+ SPELL_MARK = 31447,
+ SPELL_MARK_DAMAGE = 31463
+};
#define SOUND_ONDEATH 11018
@@ -162,22 +169,10 @@ public:
WarStompTimer = 60000;
} else WarStompTimer -= diff;
- if (me->HasAura(SPELL_MARK))
- me->RemoveAurasDueToSpell(SPELL_MARK);
if (MarkTimer <= diff)
{
- //cast dummy, useful for bos addons
- me->CastCustomSpell(me, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, me->GetGUID());
+ DoCastAOE(SPELL_MARK);
- std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
- for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
- {
- Unit* target = Unit::GetUnit(*me, (*itr)->getUnitGuid());
- if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
- {
- target->CastSpell(target, SPELL_MARK, true);//only cast on mana users
- }
- }
MarkTimerBase -= 5000;
if (MarkTimerBase < 5500)
MarkTimerBase = 5500;
@@ -201,7 +196,80 @@ public:
};
+class MarkTargetFilter
+{
+ public:
+ bool operator()(Unit* target) const
+ {
+ if (target->getPowerType() != POWER_MANA)
+ return true;
+
+ return false;
+ }
+};
+
+class spell_mark_of_kazrogal : public SpellScriptLoader
+{
+ public:
+ spell_mark_of_kazrogal() : SpellScriptLoader("spell_mark_of_kazrogal") { }
+
+ class spell_mark_of_kazrogal_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_mark_of_kazrogal_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(MarkTargetFilter());
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_mark_of_kazrogal_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ }
+ };
+
+ class spell_mark_of_kazrogal_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mark_of_kazrogal_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MARK_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void OnPeriodic(AuraEffect const* aurEff)
+ {
+ Unit* target = GetTarget();
+
+ if (target->GetPower(POWER_MANA) == 0)
+ {
+ target->CastSpell(target, SPELL_MARK_DAMAGE, true, NULL, aurEff);
+ // Remove aura
+ SetDuration(0);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazrogal_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_mark_of_kazrogal_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_mark_of_kazrogal_AuraScript();
+ }
+};
+
void AddSC_boss_kazrogal()
{
new boss_kazrogal();
+ new spell_mark_of_kazrogal();
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
index 79bbb470edf..3b0aeb958cb 100755
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp
@@ -27,7 +27,10 @@ EndScriptData */
// All - untested
// Pets aren't being summoned by their masters
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "trial_of_the_crusader.h"
enum eYell
@@ -945,18 +948,18 @@ public:
};
-enum eWarlockSpells
+enum WarlockSpells
{
- SPELL_HELLFIRE = 65816,
- SPELL_CORRUPTION = 65810,
- SPELL_CURSE_OF_AGONY = 65814,
- SPELL_CURSE_OF_EXHAUSTION = 65815,
- SPELL_FEAR = 65809, //8s
- SPELL_SEARING_PAIN = 65819,
- SPELL_SHADOW_BOLT = 65821,
- SPELL_UNSTABLE_AFFLICTION = 65812,
- SPELL_SUMMON_FELHUNTER = 67514,
- H_SPELL_UNSTABLE_AFFLICTION = 68155, //15s
+ SPELL_HELLFIRE = 65816,
+ SPELL_CORRUPTION = 65810,
+ SPELL_CURSE_OF_AGONY = 65814,
+ SPELL_CURSE_OF_EXHAUSTION = 65815,
+ SPELL_FEAR = 65809, // 8s
+ SPELL_SEARING_PAIN = 65819,
+ SPELL_SHADOW_BOLT = 65821,
+ SPELL_UNSTABLE_AFFLICTION = 65812, // 15s
+ SPELL_UNSTABLE_AFFLICTION_DISPEL = 65813,
+ SPELL_SUMMON_FELHUNTER = 67514,
};
class mob_toc_warlock : public CreatureScript
@@ -2030,6 +2033,40 @@ public:
};
};
+class spell_faction_champion_warl_unstable_affliction : public SpellScriptLoader
+{
+ public:
+ spell_faction_champion_warl_unstable_affliction() : SpellScriptLoader("spell_faction_champion_warl_unstable_affliction") { }
+
+ class spell_faction_champion_warl_unstable_affliction_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_faction_champion_warl_unstable_affliction_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_UNSTABLE_AFFLICTION_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(dispelInfo->GetDispeller(), SPELL_UNSTABLE_AFFLICTION_DISPEL, true, NULL, GetEffect(EFFECT_0));
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_faction_champion_warl_unstable_affliction_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_faction_champion_warl_unstable_affliction_AuraScript();
+ }
+};
+
void AddSC_boss_faction_champions()
{
new boss_toc_champion_controller();
@@ -2049,4 +2086,5 @@ void AddSC_boss_faction_champions()
new mob_toc_retro_paladin();
new mob_toc_pet_warlock();
new mob_toc_pet_hunter();
+ new spell_faction_champion_warl_unstable_affliction();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index 17ed6a79c76..f81ddbf6bf8 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -15,7 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "SpellAuraEffects.h"
#include "naxxramas.h"
enum Horsemen
@@ -26,6 +29,11 @@ enum Horsemen
HORSEMEN_SIR,
};
+enum Spells
+{
+ SPELL_MARK_DAMAGE = 28836
+};
+
enum Events
{
EVENT_NONE,
@@ -395,7 +403,63 @@ public:
};
+class spell_four_horsemen_mark : public SpellScriptLoader
+{
+ public:
+ spell_four_horsemen_mark() : SpellScriptLoader("spell_four_horsemen_mark") { }
+
+ class spell_four_horsemen_mark_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_four_horsemen_mark_AuraScript);
+
+ void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ int32 damage;
+ switch (GetStackAmount())
+ {
+ case 1:
+ damage = 0;
+ break;
+ case 2:
+ damage = 500;
+ break;
+ case 3:
+ damage = 1000;
+ break;
+ case 4:
+ damage = 1500;
+ break;
+ case 5:
+ damage = 4000;
+ break;
+ case 6:
+ damage = 12000;
+ break;
+ default:
+ damage = 20000 + 1000 * (GetStackAmount() - 7);
+ break;
+ }
+ if (damage)
+ caster->CastCustomSpell(SPELL_MARK_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetTarget());
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_four_horsemen_mark_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_four_horsemen_mark_AuraScript();
+ }
+};
+
void AddSC_boss_four_horsemen()
{
new boss_four_horsemen();
+ new spell_four_horsemen_mark();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
index 8d23de5427c..7f4915cb3f1 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp
@@ -15,7 +15,11 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
+#include "GridNotifiers.h"
+#include "CombatAI.h"
#include "naxxramas.h"
enum Yells
@@ -25,6 +29,7 @@ enum Yells
SAY_DEATH = -1533042,
SAY_TELEPORT = -1533043
};
+
//Gothik
enum Spells
{
@@ -36,8 +41,11 @@ enum Spells
SPELL_INFORM_LIVE_RIDER = 27935,
SPELL_INFORM_DEAD_TRAINEE = 27915,
SPELL_INFORM_DEAD_KNIGHT = 27931,
- SPELL_INFORM_DEAD_RIDER = 27937
+ SPELL_INFORM_DEAD_RIDER = 27937,
+
+ SPELL_SHADOW_MARK = 27825
};
+
enum Creatures
{
MOB_LIVE_TRAINEE = 16124,
@@ -585,8 +593,35 @@ class mob_gothik_minion : public CreatureScript
}
};
+class spell_gothik_shadow_bolt_volley : public SpellScriptLoader
+{
+ public:
+ spell_gothik_shadow_bolt_volley() : SpellScriptLoader("spell_gothik_shadow_bolt_volley") { }
+
+ class spell_gothik_shadow_bolt_volley_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gothik_shadow_bolt_volley_SpellScript);
+
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ unitList.remove_if(Trinity::UnitAuraCheck(false, SPELL_SHADOW_MARK));
+ }
+
+ void Register()
+ {
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_gothik_shadow_bolt_volley_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gothik_shadow_bolt_volley_SpellScript();
+ }
+};
+
void AddSC_boss_gothik()
{
new boss_gothik();
new mob_gothik_minion();
+ new spell_gothik_shadow_bolt_volley();
}
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
index 0a4fdec7222..38c22a93ac4 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp
@@ -86,6 +86,7 @@ enum Spells
SPELL_SHADOW_FISURE = 27810,
SPELL_VOID_BLAST = 27812,
SPELL_MANA_DETONATION = 27819,
+ SPELL_MANA_DETONATION_DAMAGE = 27820,
SPELL_FROST_BLAST = 27808,
SPELL_CHAINS_OF_KELTHUZAD = 28410, //28408 script effect
SPELL_KELTHUZAD_CHANNEL = 29423,
@@ -773,6 +774,46 @@ class npc_kelthuzad_abomination : public CreatureScript
}
};
+class spell_kelthuzad_detonate_mana : public SpellScriptLoader
+{
+ public:
+ spell_kelthuzad_detonate_mana() : SpellScriptLoader("spell_kelthuzad_detonate_mana") { }
+
+ class spell_kelthuzad_detonate_mana_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_kelthuzad_detonate_mana_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MANA_DETONATION_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void HandleScript(AuraEffect const* aurEff)
+ {
+ PreventDefaultAction();
+
+ Unit* target = GetTarget();
+ if (int32 mana = int32(target->GetMaxPower(POWER_MANA) / 10))
+ {
+ mana = target->ModifyPower(POWER_MANA, -mana);
+ target->CastCustomSpell(SPELL_MANA_DETONATION_DAMAGE, SPELLVALUE_BASE_POINT0, -mana * 10, target, true, NULL, aurEff);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_kelthuzad_detonate_mana_AuraScript::HandleScript, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_kelthuzad_detonate_mana_AuraScript();
+ }
+};
+
class achievement_just_cant_get_enough : public AchievementCriteriaScript
{
public:
@@ -796,5 +837,6 @@ void AddSC_boss_kelthuzad()
new boss_kelthuzad();
new at_kelthuzad_center();
new npc_kelthuzad_abomination();
+ new spell_kelthuzad_detonate_mana();
new achievement_just_cant_get_enough();
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index 2e2744baa3c..bdaaa002b3f 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
@@ -19,11 +19,13 @@
/* ScriptData
SDName: Boss Loken
SD%Complete: 60%
-SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414)
+SDComment: Missing intro.
SDCategory: Halls of Lightning
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "halls_of_lightning.h"
enum eEnums
@@ -73,23 +75,17 @@ public:
InstanceScript* instance;
- bool m_bIsAura;
-
uint32 m_uiArcLightning_Timer;
uint32 m_uiLightningNova_Timer;
- uint32 m_uiPulsingShockwave_Timer;
uint32 m_uiResumePulsingShockwave_Timer;
uint32 m_uiHealthAmountModifier;
void Reset()
{
- m_bIsAura = false;
-
m_uiArcLightning_Timer = 15000;
m_uiLightningNova_Timer = 20000;
- m_uiPulsingShockwave_Timer = 2000;
- m_uiResumePulsingShockwave_Timer = 15000;
+ m_uiResumePulsingShockwave_Timer = 1000;
m_uiHealthAmountModifier = 1;
@@ -116,7 +112,10 @@ public:
Talk(SAY_DEATH);
if (instance)
+ {
instance->SetData(TYPE_LOKEN, DONE);
+ instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_PULSING_SHOCKWAVE_AURA);
+ }
}
void KilledUnit(Unit* /*victim*/)
@@ -130,44 +129,13 @@ public:
if (!UpdateVictim())
return;
- if (m_bIsAura)
- {
- // workaround for PULSING_SHOCKWAVE
- if (m_uiPulsingShockwave_Timer <= uiDiff)
- {
- Map* map = me->GetMap();
- if (map->IsDungeon())
- {
- Map::PlayerList const &PlayerList = map->GetPlayers();
-
- if (PlayerList.isEmpty())
- return;
-
- for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
- if (i->getSource() && i->getSource()->isAlive() && i->getSource()->isTargetableForAttack())
- {
- int32 dmg;
- float m_fDist = me->GetExactDist(i->getSource()->GetPositionX(), i->getSource()->GetPositionY(), i->getSource()->GetPositionZ());
-
- dmg = DUNGEON_MODE(100, 150); // need to correct damage
- if (m_fDist > 1.0f) // Further from 1 yard
- dmg = int32(dmg*m_fDist);
-
- me->CastCustomSpell(i->getSource(), DUNGEON_MODE(52942, 59837), &dmg, 0, 0, false);
- }
- }
- m_uiPulsingShockwave_Timer = 2000;
- } else m_uiPulsingShockwave_Timer -= uiDiff;
- }
- else
+ if (m_uiResumePulsingShockwave_Timer)
{
if (m_uiResumePulsingShockwave_Timer <= uiDiff)
{
- //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement?
DoCast(me, SPELL_PULSING_SHOCKWAVE_AURA, true);
- DoCast(me, SPELL_PULSING_SHOCKWAVE_N); // need core support
- m_bIsAura = true;
+ DoCast(me, SPELL_PULSING_SHOCKWAVE_N, true);
m_uiResumePulsingShockwave_Timer = 0;
}
else
@@ -190,7 +158,7 @@ public:
Talk(EMOTE_NOVA);
DoCast(me, SPELL_LIGHTNING_NOVA_N);
- m_bIsAura = false;
+ me->RemoveAurasDueToSpell(DUNGEON_MODE<uint32>(SPELL_PULSING_SHOCKWAVE_N, SPELL_PULSING_SHOCKWAVE_H));
m_uiResumePulsingShockwave_Timer = DUNGEON_MODE(5000, 4000); // Pause Pulsing Shockwave aura
m_uiLightningNova_Timer = urand(20000, 21000);
}
@@ -216,7 +184,39 @@ public:
};
+class spell_loken_pulsing_shockwave : public SpellScriptLoader
+{
+ public:
+ spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { }
+
+ class spell_loken_pulsing_shockwave_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript);
+
+ void CalculateDamage()
+ {
+ if (!GetHitUnit())
+ return;
+
+ float distance = GetCaster()->GetDistance2d(GetHitUnit());
+ if (distance > 1.0f)
+ SetHitDamage(int32(GetHitDamage() * distance));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_loken_pulsing_shockwave_SpellScript();
+ }
+};
+
void AddSC_boss_loken()
{
new boss_loken();
+ new spell_loken_pulsing_shockwave();
}
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
index bc57ce21a4d..e5e3daede91 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_krystallus.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory:
Script Data End */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "halls_of_stone.h"
enum Spells
@@ -162,12 +164,7 @@ public:
//this part should be in the core
if (pSpell->Id == SPELL_SHATTER || pSpell->Id == H_SPELL_SHATTER)
{
- //this spell must have custom handling in the core, dealing damage based on distance
- target->CastSpell(target, DUNGEON_MODE(SPELL_SHATTER_EFFECT, H_SPELL_SHATTER_EFFECT), true);
-
- if (target->HasAura(SPELL_STONED))
- target->RemoveAurasDueToSpell(SPELL_STONED);
-
+ // todo: we need eventmap to kill this stuff
//clear this, if we are still performing
if (bIsSlam)
{
@@ -186,7 +183,74 @@ public:
};
+class spell_krystallus_shatter : public SpellScriptLoader
+{
+ public:
+ spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { }
+
+ class spell_krystallus_shatter_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_krystallus_shatter_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ target->RemoveAurasDueToSpell(SPELL_STONED);
+ target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_krystallus_shatter_SpellScript();
+ }
+};
+
+class spell_krystallus_shatter_effect : public SpellScriptLoader
+{
+ public:
+ spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { }
+
+ class spell_krystallus_shatter_effect_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript);
+
+ void CalculateDamage()
+ {
+ if (!GetHitUnit())
+ return;
+
+ float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
+ if (!radius)
+ return;
+
+ float distance = GetCaster()->GetDistance2d(GetHitUnit());
+ if (distance > 1.0f)
+ SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_krystallus_shatter_effect_SpellScript::CalculateDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_krystallus_shatter_effect_SpellScript();
+ }
+};
+
void AddSC_boss_krystallus()
{
new boss_krystallus();
+ new spell_krystallus_shatter();
+ new spell_krystallus_shatter_effect();
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
index 3556bf188de..8090b9e8a3e 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp
@@ -51,6 +51,8 @@ enum VezaxSpells
SPELL_SHADOW_CRASH_HIT = 62659,
SPELL_SURGE_OF_DARKNESS = 62662,
SPELL_SARONITE_VAPORS = 63323,
+ SPELL_SARONITE_VAPORS_ENERGIZE = 63337,
+ SPELL_SARONITE_VAPORS_DAMAGE = 63338,
SPELL_SUMMON_SARONITE_VAPORS = 63081,
SPELL_BERSERK = 26662,
@@ -463,6 +465,45 @@ class spell_mark_of_the_faceless : public SpellScriptLoader
}
};
+class spell_general_vezax_saronite_vapors : public SpellScriptLoader
+{
+ public:
+ spell_general_vezax_saronite_vapors() : SpellScriptLoader("spell_general_vezax_saronite_vapors") { }
+
+ class spell_general_vezax_saronite_vapors_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_general_vezax_saronite_vapors_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_ENERGIZE) || !sSpellMgr->GetSpellInfo(SPELL_SARONITE_VAPORS_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ int32 mana = int32(aurEff->GetAmount() * pow(2.0f, GetStackAmount())); // mana restore - bp * 2^stackamount
+ int32 damage = mana * 2;
+ caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_ENERGIZE, &mana, NULL, NULL, true);
+ caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DAMAGE, &damage, NULL, NULL, true);
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_general_vezax_saronite_vapors_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_general_vezax_saronite_vapors_AuraScript();
+ }
+};
+
class achievement_shadowdodger : public AchievementCriteriaScript
{
public:
@@ -509,6 +550,7 @@ void AddSC_boss_general_vezax()
new boss_saronite_animus();
new npc_saronite_vapors();
new spell_mark_of_the_faceless();
+ new spell_general_vezax_saronite_vapors();
new achievement_shadowdodger();
new achievement_smell_saronite();
}
diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
index 0e654ade995..3443103fa70 100644
--- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
+++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp
@@ -19,11 +19,13 @@
/* ScriptData
SDName: Boss_Gruul
SD%Complete: 60
-SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to the core)
+SDComment: Ground Slam need further development (knock back effect must be added to the core)
SDCategory: Gruul's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellScript.h"
#include "gruuls_lair.h"
enum eEnums
@@ -144,12 +146,7 @@ public:
//this part should be in the core
if (pSpell->Id == SPELL_SHATTER)
{
- //this spell must have custom handling in the core, dealing damage based on distance
- target->CastSpell(target, SPELL_SHATTER_EFFECT, true);
-
- if (target->HasAura(SPELL_STONED))
- target->RemoveAurasDueToSpell(SPELL_STONED);
-
+ // todo: use eventmap to kill this stuff
//clear this, if we are still performing
if (m_bPerformingGroundSlam)
{
@@ -258,7 +255,83 @@ public:
};
+class spell_gruul_shatter : public SpellScriptLoader
+{
+ public:
+ spell_gruul_shatter() : SpellScriptLoader("spell_gruul_shatter") { }
+
+ class spell_gruul_shatter_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gruul_shatter_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_STONED))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_SHATTER_EFFECT))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* target = GetHitUnit())
+ {
+ target->RemoveAurasDueToSpell(SPELL_STONED);
+ target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gruul_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gruul_shatter_SpellScript();
+ }
+};
+
+class spell_gruul_shatter_effect : public SpellScriptLoader
+{
+ public:
+ spell_gruul_shatter_effect() : SpellScriptLoader("spell_gruul_shatter_effect") { }
+
+ class spell_gruul_shatter_effect_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gruul_shatter_effect_SpellScript);
+
+ void CalculateDamage()
+ {
+ if (!GetHitUnit())
+ return;
+
+ float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
+ if (!radius)
+ return;
+
+ float distance = GetCaster()->GetDistance2d(GetHitUnit());
+ if (distance > 1.0f)
+ SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_gruul_shatter_effect_SpellScript::CalculateDamage);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gruul_shatter_effect_SpellScript();
+ }
+};
+
void AddSC_boss_gruul()
{
new boss_gruul();
+ new spell_gruul_shatter();
+ new spell_gruul_shatter_effect();
}
diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
index a213713ae1a..ab568249027 100644
--- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
+++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
@@ -16,7 +16,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "SpellAuraEffects.h"
+#include "SpellScript.h"
enum Texts
{
@@ -36,6 +39,7 @@ enum Spells
SPELL_THUNDERCLAP = 36706,
SPELL_VOID_BOLT = 39329,
SPELL_MARK_OF_KAZZAK = 32960,
+ SPELL_MARK_OF_KAZZAK_DAMAGE = 32961,
SPELL_ENRAGE = 32964,
SPELL_CAPTURE_SOUL = 32966,
SPELL_TWISTED_REFLECTION = 21063,
@@ -171,7 +175,55 @@ class boss_doomlord_kazzak : public CreatureScript
}
};
+class spell_mark_of_kazzak : public SpellScriptLoader
+{
+ public:
+ spell_mark_of_kazzak() : SpellScriptLoader("spell_mark_of_kazzak") { }
+
+ class spell_mark_of_kazzak_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mark_of_kazzak_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_KAZZAK_DAMAGE))
+ return false;
+ return true;
+ }
+
+ void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* owner = GetUnitOwner())
+ amount = CalculatePctU(owner->GetPower(POWER_MANA), 5);
+ }
+
+ void OnPeriodic(AuraEffect const* aurEff)
+ {
+ Unit* target = GetTarget();
+
+ if (target->GetPower(POWER_MANA) == 0)
+ {
+ target->CastSpell(target, SPELL_MARK_OF_KAZZAK_DAMAGE, true, NULL, aurEff);
+ // Remove aura
+ SetDuration(0);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mark_of_kazzak_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazzak_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_mark_of_kazzak_AuraScript();
+ }
+};
+
void AddSC_boss_doomlordkazzak()
{
new boss_doomlord_kazzak();
+ new spell_mark_of_kazzak();
}
diff --git a/src/server/scripts/Outland/netherstorm.cpp b/src/server/scripts/Outland/netherstorm.cpp
index afc18c71b92..16dac13d1a9 100644
--- a/src/server/scripts/Outland/netherstorm.cpp
+++ b/src/server/scripts/Outland/netherstorm.cpp
@@ -777,10 +777,10 @@ public:
PlayerGUID = who->GetGUID();
}
- void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/)
- {
- DoCast(me, SPELL_DE_MATERIALIZE);
- }
+ //void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/)
+ //{
+ // DoCast(me, SPELL_DE_MATERIALIZE);
+ //}
void UpdateAI(const uint32 diff)
{
diff --git a/src/server/scripts/Spells/CMakeLists.txt b/src/server/scripts/Spells/CMakeLists.txt
index 04dcee9287c..2bb695bd8a9 100644
--- a/src/server/scripts/Spells/CMakeLists.txt
+++ b/src/server/scripts/Spells/CMakeLists.txt
@@ -24,6 +24,7 @@ set(scripts_STAT_SRCS
Spells/spell_paladin.cpp
Spells/spell_item.cpp
Spells/spell_holiday.cpp
+ Spells/spell_pet.cpp
)
message(" -> Prepared: Spells")
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index c33ca548d73..118097a38cb 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -738,14 +738,14 @@ class spell_dk_death_coil : public SpellScriptLoader
{
PrepareSpellScript(spell_dk_death_coil_SpellScript);
- bool Validate(SpellInfo const* /*SpellEntry*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_DAMAGE) || !sSpellMgr->GetSpellInfo(SPELL_DEATH_COIL_HEAL))
return false;
return true;
}
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
Unit* caster = GetCaster();
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 898350dbd71..9dedeaf5bd7 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -28,7 +28,11 @@
enum DruidSpells
{
DRUID_INCREASED_MOONFIRE_DURATION = 38414,
- DRUID_NATURES_SPLENDOR = 57865
+ DRUID_NATURES_SPLENDOR = 57865,
+ DRUID_LIFEBLOOM_FINAL_HEAL = 33778,
+ DRUID_LIFEBLOOM_ENERGIZE = 64372,
+ DRUID_SURVIVAL_INSTINCTS = 50322,
+ DRUID_SAVAGE_ROAR = 62071
};
// 54846 Glyph of Starfire
@@ -154,7 +158,7 @@ class spell_dru_primal_tenacity : public SpellScriptLoader
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
// reduces all damage taken while Stunned in Cat Form
- if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
+ if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
}
@@ -328,6 +332,26 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
+class StarfallDummyTargetFilter
+{
+ public:
+ StarfallDummyTargetFilter(Unit* caster) : _caster(caster) { }
+
+ bool operator()(Unit* target) const
+ {
+ if (target->HasStealthAura() || target->HasInvisibilityAura())
+ return true;
+
+ if (!target->IsWithinLOSInMap(_caster))
+ return true;
+
+ return false;
+ }
+
+ private:
+ Unit* _caster;
+};
+
class spell_dru_starfall_dummy : public SpellScriptLoader
{
public:
@@ -337,7 +361,14 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
{
PrepareSpellScript(spell_dru_starfall_dummy_SpellScript);
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void FilterTargets(std::list<Unit*>& unitList)
+ {
+ // Remove targets not in LoS or in stealth
+ unitList.remove_if(StarfallDummyTargetFilter(GetCaster()));
+ Trinity::Containers::RandomResizeList(unitList, 2);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
// Shapeshifting into an animal form or mounting cancels the effect
@@ -348,15 +379,16 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
return;
}
- //Any effect which causes you to lose control of your character will supress the starfall effect.
+ // Any effect which causes you to lose control of your character will supress the starfall effect.
if (caster->HasUnitState(UNIT_STATE_CONTROLLED))
return;
- caster->CastSpell(GetHitUnit(), GetEffectValue(), true);
+ caster->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
}
void Register()
{
+ OnUnitTargetSelect += SpellUnitTargetFn(spell_dru_starfall_dummy_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_dru_starfall_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
@@ -367,6 +399,247 @@ class spell_dru_starfall_dummy : public SpellScriptLoader
}
};
+class spell_dru_lifebloom : public SpellScriptLoader
+{
+ public:
+ spell_dru_lifebloom() : SpellScriptLoader("spell_dru_lifebloom") { }
+
+ class spell_dru_lifebloom_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_lifebloom_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_FINAL_HEAL))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(DRUID_LIFEBLOOM_ENERGIZE))
+ return false;
+ return true;
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ // final heal
+ int32 stack = GetStackAmount();
+ int32 healAmount = aurEff->GetAmount();
+ Unit* caster = GetCaster();
+ if (caster)
+ {
+ healAmount = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), healAmount, HEAL, stack);
+ healAmount = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, stack);
+ }
+
+ GetTarget()->CastCustomSpell(GetTarget(), DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+
+ // restore mana
+ if (caster)
+ {
+ int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * stack / 2;
+ caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+ }
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* target = GetUnitOwner())
+ {
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
+ {
+ // final heal
+ int32 healAmount = aurEff->GetAmount();
+ Unit* caster = GetCaster();
+ if (caster)
+ {
+ healAmount = caster->SpellHealingBonusDone(target, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
+ healAmount = target->SpellHealingBonusTaken(caster, GetSpellInfo(), healAmount, HEAL, dispelInfo->GetRemovedCharges());
+ }
+
+ target->CastCustomSpell(target, DRUID_LIFEBLOOM_FINAL_HEAL, &healAmount, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+
+ // restore mana
+ if (caster)
+ {
+ int32 returnMana = CalculatePctU(caster->GetCreateMana(), GetSpellInfo()->ManaCostPercentage) * dispelInfo->GetRemovedCharges() / 2;
+ caster->CastCustomSpell(caster, DRUID_LIFEBLOOM_ENERGIZE, &returnMana, NULL, NULL, true, NULL, NULL, GetCasterGUID());
+ }
+ }
+ }
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_lifebloom_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterDispel += AuraDispelFn(spell_dru_lifebloom_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_lifebloom_AuraScript();
+ }
+};
+
+class spell_dru_predatory_strikes : public SpellScriptLoader
+{
+ public:
+ spell_dru_predatory_strikes() : SpellScriptLoader("spell_dru_predatory_strikes") { }
+
+ class spell_dru_predatory_strikes_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_predatory_strikes_AuraScript);
+
+ void UpdateAmount(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Player* target = GetTarget()->ToPlayer())
+ target->UpdateAttackPowerAndDamage();
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_predatory_strikes_AuraScript::UpdateAmount, EFFECT_ALL, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_predatory_strikes_AuraScript();
+ }
+};
+
+class spell_dru_savage_roar : public SpellScriptLoader
+{
+ public:
+ spell_dru_savage_roar() : SpellScriptLoader("spell_dru_savage_roar") { }
+
+ class spell_dru_savage_roar_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_savage_roar_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetShapeshiftForm() != FORM_CAT)
+ return SPELL_FAILED_ONLY_SHAPESHIFT;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_dru_savage_roar_SpellScript::CheckCast);
+ }
+ };
+
+ class spell_dru_savage_roar_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_savage_roar_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DRUID_SAVAGE_ROAR))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->CastSpell(target, DRUID_SAVAGE_ROAR, true, NULL, aurEff, GetCasterGUID());
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(DRUID_SAVAGE_ROAR);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_dru_savage_roar_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_savage_roar_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_savage_roar_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_savage_roar_AuraScript();
+ }
+};
+
+class spell_dru_survival_instincts : public SpellScriptLoader
+{
+ public:
+ spell_dru_survival_instincts() : SpellScriptLoader("spell_dru_survival_instincts") { }
+
+ class spell_dru_survival_instincts_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_dru_survival_instincts_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (!caster->IsInFeralForm())
+ return SPELL_FAILED_ONLY_SHAPESHIFT;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_dru_survival_instincts_SpellScript::CheckCast);
+ }
+ };
+
+ class spell_dru_survival_instincts_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dru_survival_instincts_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(DRUID_SURVIVAL_INSTINCTS))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
+ target->CastCustomSpell(target, DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ GetTarget()->RemoveAurasDueToSpell(DRUID_SURVIVAL_INSTINCTS);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_dru_survival_instincts_AuraScript::AfterApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_dru_survival_instincts_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_dru_survival_instincts_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dru_survival_instincts_AuraScript();
+ }
+};
+
void AddSC_druid_spell_scripts()
{
new spell_dru_glyph_of_starfire();
@@ -377,4 +650,8 @@ void AddSC_druid_spell_scripts()
new spell_dru_starfall_aoe();
new spell_dru_swift_flight_passive();
new spell_dru_starfall_dummy();
+ new spell_dru_lifebloom();
+ new spell_dru_predatory_strikes();
+ new spell_dru_savage_roar();
+ new spell_dru_survival_instincts();
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index e23e21cf2cd..f254908fe55 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -239,7 +239,7 @@ class spell_gen_parachute : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_parachute_AuraScript);
- bool Validate(SpellInfo const* /*spellEntry*/)
+ bool Validate(SpellInfo const* /*spell*/)
{
if (!sSpellMgr->GetSpellInfo(SPELL_PARACHUTE) || !sSpellMgr->GetSpellInfo(SPELL_PARACHUTE_BUFF))
return false;
@@ -252,7 +252,12 @@ class spell_gen_parachute : public SpellScriptLoader
if (target->IsFalling())
{
target->RemoveAurasDueToSpell(SPELL_PARACHUTE);
- target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
+
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ float groundZ = target->GetMap()->GetHeight(target->GetPhaseMask(), x, y, z);
+ if (fabs(groundZ - z) > 0.1f)
+ target->CastSpell(target, SPELL_PARACHUTE_BUFF, true);
}
}
@@ -660,22 +665,16 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
return true;
}
- void HandleScript(SpellEffIndex /*effIndex*/)
+ void HandleScript()
{
- Player* caster = GetCaster()->ToPlayer();
- SpellInfo const* spellInfo = GetSpellInfo();
- caster->AddSpellCooldown(spellInfo->Id, 0, time(NULL) + sSpellMgr->GetSpellInfo(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)->GetRecoveryTime() / IN_MILLISECONDS);
- WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
- data << uint64(caster->GetGUID());
- data << uint8(0);
- data << uint32(spellInfo->Id);
- data << uint32(0);
- caster->GetSession()->SendPacket(&data);
+ // This is only needed because spells cast from spell_linked_spell are triggered by default
+ // Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
+ GetCaster()->ToPlayer()->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell());
}
void Register()
{
- OnEffectHit += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
+ AfterCast += SpellCastFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript);
}
};
@@ -2697,7 +2696,7 @@ public:
{
PrepareSpellScript(spell_gen_touch_the_nightmare_SpellScript);
- void HandleDamageCalc(SpellEffIndex effIndex)
+ void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
uint32 bp = GetCaster()->GetMaxHealth() * 0.3f;
SetHitDamage(bp);
@@ -2745,6 +2744,352 @@ public:
}
};
+enum GenericBandage
+{
+ SPELL_RECENTLY_BANDAGED = 11196,
+};
+
+class spell_gen_bandage : public SpellScriptLoader
+{
+ public:
+ spell_gen_bandage() : SpellScriptLoader("spell_gen_bandage") { }
+
+ class spell_gen_bandage_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_bandage_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_RECENTLY_BANDAGED))
+ return false;
+ return true;
+ }
+
+ SpellCastResult CheckCast()
+ {
+ if (Unit* target = GetExplTargetUnit())
+ {
+ if (target->HasAura(SPELL_RECENTLY_BANDAGED))
+ return SPELL_FAILED_TARGET_AURASTATE;
+ }
+ return SPELL_CAST_OK;
+ }
+
+ void HandleScript()
+ {
+ if (Unit* target = GetHitUnit())
+ GetCaster()->CastSpell(target, SPELL_RECENTLY_BANDAGED, true);
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_gen_bandage_SpellScript::CheckCast);
+ AfterHit += SpellHitFn(spell_gen_bandage_SpellScript::HandleScript);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_bandage_SpellScript();
+ }
+};
+
+enum GenericLifebloom
+{
+ SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422,
+ SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL = 52552,
+ SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL = 53692,
+ SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL = 57763,
+ SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL = 66094,
+};
+
+class spell_gen_lifebloom : public SpellScriptLoader
+{
+ public:
+ spell_gen_lifebloom(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+
+ class spell_gen_lifebloom_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_lifebloom_AuraScript);
+
+ public:
+ spell_gen_lifebloom_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(_spellId))
+ return false;
+ return true;
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ // Final heal only on duration end
+ if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ // final heal
+ GetTarget()->CastSpell(GetTarget(), _spellId, true, NULL, aurEff, GetCasterGUID());
+ }
+
+ void HandleDispel(DispelInfo* /*dispelInfo*/)
+ {
+ // final heal
+ if (Unit* target = GetUnitOwner())
+ target->CastSpell(target, _spellId, true, NULL, GetEffect(EFFECT_0), GetCasterGUID());
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_gen_lifebloom_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_HEAL, AURA_EFFECT_HANDLE_REAL);
+ AfterDispel += AuraDispelFn(spell_gen_lifebloom_AuraScript::HandleDispel);
+ }
+
+ private:
+ uint32 _spellId;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_lifebloom_AuraScript(_spellId);
+ }
+
+ private:
+ uint32 _spellId;
+};
+
+enum SummonElemental
+{
+ SPELL_SUMMON_FIRE_ELEMENTAL = 8985,
+ SPELL_SUMMON_EARTH_ELEMENTAL = 19704
+};
+
+class spell_gen_summon_elemental : public SpellScriptLoader
+{
+ public:
+ spell_gen_summon_elemental(const char* name, uint32 spellId) : SpellScriptLoader(name), _spellId(spellId) { }
+
+ class spell_gen_summon_elemental_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_gen_summon_elemental_AuraScript);
+
+ public:
+ spell_gen_summon_elemental_AuraScript(uint32 spellId) : AuraScript(), _spellId(spellId) { }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(_spellId))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetCaster())
+ if (Unit* owner = GetCaster()->GetOwner())
+ if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong
+ owner->CastSpell(owner, _spellId, true);
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (GetCaster())
+ if (Unit* owner = GetCaster()->GetOwner())
+ if (owner->GetTypeId() == TYPEID_PLAYER) // todo: this check is maybe wrong
+ owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true);
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_gen_summon_elemental_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_gen_summon_elemental_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+
+ private:
+ uint32 _spellId;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_gen_summon_elemental_AuraScript(_spellId);
+ }
+
+ private:
+ uint32 _spellId;
+};
+
+enum Mounts
+{
+ SPELL_COLD_WEATHER_FLYING = 54197,
+
+ // Magic Broom
+ SPELL_MAGIC_BROOM_60 = 42680,
+ SPELL_MAGIC_BROOM_100 = 42683,
+ SPELL_MAGIC_BROOM_150 = 42667,
+ SPELL_MAGIC_BROOM_280 = 42668,
+
+ // Headless Horseman's Mount
+ SPELL_HEADLESS_HORSEMAN_MOUNT_60 = 51621,
+ SPELL_HEADLESS_HORSEMAN_MOUNT_100 = 48024,
+ SPELL_HEADLESS_HORSEMAN_MOUNT_150 = 51617,
+ SPELL_HEADLESS_HORSEMAN_MOUNT_280 = 48023,
+
+ // Winged Steed of the Ebon Blade
+ SPELL_WINGED_STEED_150 = 54726,
+ SPELL_WINGED_STEED_280 = 54727,
+
+ // Big Love Rocket
+ SPELL_BIG_LOVE_ROCKET_0 = 71343,
+ SPELL_BIG_LOVE_ROCKET_60 = 71344,
+ SPELL_BIG_LOVE_ROCKET_100 = 71345,
+ SPELL_BIG_LOVE_ROCKET_150 = 71346,
+ SPELL_BIG_LOVE_ROCKET_310 = 71347,
+
+ // Invincible
+ SPELL_INVINCIBLE_60 = 72281,
+ SPELL_INVINCIBLE_100 = 72282,
+ SPELL_INVINCIBLE_150 = 72283,
+ SPELL_INVINCIBLE_310 = 72284,
+
+ // Blazing Hippogryph
+ SPELL_BLAZING_HIPPOGRYPH_150 = 74854,
+ SPELL_BLAZING_HIPPOGRYPH_280 = 74855,
+
+ // Celestial Steed
+ SPELL_CELESTIAL_STEED_60 = 75619,
+ SPELL_CELESTIAL_STEED_100 = 75620,
+ SPELL_CELESTIAL_STEED_150 = 75617,
+ SPELL_CELESTIAL_STEED_280 = 75618,
+ SPELL_CELESTIAL_STEED_310 = 76153,
+
+ // X-53 Touring Rocket
+ SPELL_X53_TOURING_ROCKET_150 = 75957,
+ SPELL_X53_TOURING_ROCKET_280 = 75972,
+ SPELL_X53_TOURING_ROCKET_310 = 76154,
+};
+
+class spell_gen_mount : public SpellScriptLoader
+{
+ public:
+ spell_gen_mount(const char* name, uint32 mount0 = 0, uint32 mount60 = 0, uint32 mount100 = 0, uint32 mount150 = 0, uint32 mount280 = 0, uint32 mount310 = 0) : SpellScriptLoader(name),
+ _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
+
+ class spell_gen_mount_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_mount_SpellScript);
+
+ public:
+ spell_gen_mount_SpellScript(uint32 mount0, uint32 mount60, uint32 mount100, uint32 mount150, uint32 mount280, uint32 mount310) : SpellScript(),
+ _mount0(mount0), _mount60(mount60), _mount100(mount100), _mount150(mount150), _mount280(mount280), _mount310(mount310) { }
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (_mount0 && !sSpellMgr->GetSpellInfo(_mount0))
+ return false;
+ if (_mount60 && !sSpellMgr->GetSpellInfo(_mount60))
+ return false;
+ if (_mount100 && !sSpellMgr->GetSpellInfo(_mount100))
+ return false;
+ if (_mount150 && !sSpellMgr->GetSpellInfo(_mount150))
+ return false;
+ if (_mount280 && !sSpellMgr->GetSpellInfo(_mount280))
+ return false;
+ if (_mount310 && !sSpellMgr->GetSpellInfo(_mount310))
+ return false;
+ return true;
+ }
+
+ void HandleMount(SpellEffIndex effIndex)
+ {
+ PreventHitDefaultEffect(effIndex);
+
+ if (Player* target = GetHitPlayer())
+ {
+ // Prevent stacking of mounts and client crashes upon dismounting
+ target->RemoveAurasByType(SPELL_AURA_MOUNTED, 0, GetHitAura());
+
+ // Triggered spell id dependent on riding skill and zone
+ bool canFly = false;
+ uint32 vmap = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
+ if (vmap == 530 || (vmap == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
+ canFly = true;
+
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ uint32 areaFlag = target->GetBaseMap()->GetAreaFlag(x, y, z);
+ AreaTableEntry const* area = sAreaStore.LookupEntry(areaFlag);
+ if (!area || (canFly && (area->flags & AREA_FLAG_NO_FLY_ZONE)))
+ canFly = false;
+
+ uint32 mount = 0;
+ switch (target->GetBaseSkillValue(SKILL_RIDING))
+ {
+ case 0:
+ mount = _mount0;
+ break;
+ case 75:
+ mount = _mount60;
+ break;
+ case 150:
+ mount = _mount100;
+ break;
+ case 225:
+ if (canFly)
+ mount = _mount150;
+ else
+ mount = _mount100;
+ break;
+ case 300:
+ if (canFly)
+ {
+ if (_mount310 && target->Has310Flyer(false))
+ mount = _mount310;
+ else
+ mount = _mount280;
+ }
+ else
+ mount = _mount100;
+ break;
+ default:
+ break;
+ }
+
+ if (mount)
+ {
+ PreventHitAura();
+ target->CastSpell(target, mount, true);
+ }
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_mount_SpellScript::HandleMount, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+
+ private:
+ uint32 _mount0;
+ uint32 _mount60;
+ uint32 _mount100;
+ uint32 _mount150;
+ uint32 _mount280;
+ uint32 _mount310;
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_mount_SpellScript(_mount0, _mount60, _mount100, _mount150, _mount280, _mount310);
+ }
+
+ private:
+ uint32 _mount0;
+ uint32 _mount60;
+ uint32 _mount100;
+ uint32 _mount150;
+ uint32 _mount280;
+ uint32 _mount310;
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -2801,4 +3146,20 @@ void AddSC_generic_spell_scripts()
new spell_gen_despawn_self();
new spell_gen_touch_the_nightmare();
new spell_gen_dream_funnel();
+ new spell_gen_bandage();
+ new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_twisted_visage_lifebloom", SPELL_TWISTED_VISAGE_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_lifebloom("spell_faction_champion_dru_lifebloom", SPELL_FACTION_CHAMPIONS_DRU_LIFEBLOOM_FINAL_HEAL);
+ new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL);
+ new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL);
+ new spell_gen_mount("spell_magic_broom", 0, SPELL_MAGIC_BROOM_60, SPELL_MAGIC_BROOM_100, SPELL_MAGIC_BROOM_150, SPELL_MAGIC_BROOM_280);
+ new spell_gen_mount("spell_headless_horseman_mount", 0, SPELL_HEADLESS_HORSEMAN_MOUNT_60, SPELL_HEADLESS_HORSEMAN_MOUNT_100, SPELL_HEADLESS_HORSEMAN_MOUNT_150, SPELL_HEADLESS_HORSEMAN_MOUNT_280);
+ new spell_gen_mount("spell_winged_steed_of_the_ebon_blade", 0, 0, 0, SPELL_WINGED_STEED_150, SPELL_WINGED_STEED_280);
+ new spell_gen_mount("spell_big_love_rocket", SPELL_BIG_LOVE_ROCKET_0, SPELL_BIG_LOVE_ROCKET_60, SPELL_BIG_LOVE_ROCKET_100, SPELL_BIG_LOVE_ROCKET_150, SPELL_BIG_LOVE_ROCKET_310);
+ new spell_gen_mount("spell_invincible", 0, SPELL_INVINCIBLE_60, SPELL_INVINCIBLE_100, SPELL_INVINCIBLE_150, SPELL_INVINCIBLE_310);
+ new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280);
+ new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310);
+ new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
}
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 896ed331bde..a2ee6c1c3a3 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -618,6 +618,86 @@ class spell_hun_misdirection_proc : public SpellScriptLoader
}
};
+class spell_hun_disengage : public SpellScriptLoader
+{
+ public:
+ spell_hun_disengage() : SpellScriptLoader("spell_hun_disengage") { }
+
+ class spell_hun_disengage_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_disengage_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetTypeId() == TYPEID_PLAYER && !caster->isInCombat())
+ return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_hun_disengage_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_hun_disengage_SpellScript();
+ }
+};
+
+class spell_hun_tame_beast : public SpellScriptLoader
+{
+ public:
+ spell_hun_tame_beast() : SpellScriptLoader("spell_hun_tame_beast") { }
+
+ class spell_hun_tame_beast_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_tame_beast_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_DONT_REPORT;
+
+ if (!GetExplTargetUnit())
+ return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
+
+ if (Creature* target = GetExplTargetUnit()->ToCreature())
+ {
+ if (target->getLevel() > caster->getLevel())
+ return SPELL_FAILED_HIGHLEVEL;
+
+ // use SMSG_PET_TAME_FAILURE?
+ if (!target->GetCreatureTemplate()->isTameable(caster->ToPlayer()->CanTameExoticPets()))
+ return SPELL_FAILED_BAD_TARGETS;
+
+ if (caster->GetPetGUID())
+ return SPELL_FAILED_ALREADY_HAVE_SUMMON;
+
+ if (caster->GetCharmGUID())
+ return SPELL_FAILED_ALREADY_HAVE_CHARM;
+ }
+ else
+ return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_hun_tame_beast_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_hun_tame_beast_SpellScript();
+ }
+};
void AddSC_hunter_spell_scripts()
{
@@ -633,4 +713,6 @@ void AddSC_hunter_spell_scripts()
new spell_hun_pet_carrion_feeder();
new spell_hun_misdirection();
new spell_hun_misdirection_proc();
+ new spell_hun_disengage();
+ new spell_hun_tame_beast();
}
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index 050741ffaba..0edfbaee437 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -342,13 +342,52 @@ public:
}
};
+class spell_mage_living_bomb : public SpellScriptLoader
+{
+ public:
+ spell_mage_living_bomb() : SpellScriptLoader("spell_mage_living_bomb") { }
+
+ class spell_mage_living_bomb_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_mage_living_bomb_AuraScript);
+
+ bool Validate(SpellInfo const* spell)
+ {
+ if (!sSpellMgr->GetSpellInfo(uint32(spell->Effects[EFFECT_1].CalcValue())))
+ return false;
+ return true;
+ }
+
+ void AfterRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode();
+ if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE)
+ return;
+
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(GetTarget(), uint32(aurEff->GetAmount()), true, NULL, aurEff);
+ }
+
+ void Register()
+ {
+ AfterEffectRemove += AuraEffectRemoveFn(spell_mage_living_bomb_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_mage_living_bomb_AuraScript();
+ }
+};
+
void AddSC_mage_spell_scripts()
{
- new spell_mage_blast_wave;
- new spell_mage_cold_snap;
+ new spell_mage_blast_wave();
+ new spell_mage_cold_snap();
new spell_mage_frost_warding_trigger();
new spell_mage_incanters_absorbtion_absorb();
new spell_mage_incanters_absorbtion_manashield();
- new spell_mage_polymorph_cast_visual;
- new spell_mage_summon_water_elemental;
+ new spell_mage_polymorph_cast_visual();
+ new spell_mage_summon_water_elemental();
+ new spell_mage_living_bomb();
}
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 4baa1eb3735..fe681032c1c 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -43,6 +43,10 @@ enum PaladinSpells
SPELL_DIVINE_STORM = 53385,
SPELL_DIVINE_STORM_DUMMY = 54171,
SPELL_DIVINE_STORM_HEAL = 54172,
+
+ SPELL_FORBEARANCE = 25771,
+ SPELL_AVENGING_WRATH_MARKER = 61987,
+ SPELL_IMMUNE_SHIELD_MARKER = 61988,
};
// 31850 - Ardent Defender
@@ -255,17 +259,18 @@ class spell_pal_holy_shock : public SpellScriptLoader
class spell_pal_holy_shock_SpellScript : public SpellScript
{
- PrepareSpellScript(spell_pal_holy_shock_SpellScript)
- bool Validate(SpellInfo const* spellEntry)
+ PrepareSpellScript(spell_pal_holy_shock_SpellScript);
+
+ bool Validate(SpellInfo const* spell)
{
if (!sSpellMgr->GetSpellInfo(PALADIN_SPELL_HOLY_SHOCK_R1))
return false;
// can't use other spell than holy shock due to spell_ranks dependency
- if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spellEntry->Id))
+ if (sSpellMgr->GetFirstSpellInChain(PALADIN_SPELL_HOLY_SHOCK_R1) != sSpellMgr->GetFirstSpellInChain(spell->Id))
return false;
- uint8 rank = sSpellMgr->GetSpellRank(spellEntry->Id);
+ uint8 rank = sSpellMgr->GetSpellRank(spell->Id);
if (!sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_DAMAGE, rank, true) || !sSpellMgr->GetSpellWithRank(PALADIN_SPELL_HOLY_SHOCK_R1_HEALING, rank, true))
return false;
@@ -287,7 +292,7 @@ class spell_pal_holy_shock : public SpellScriptLoader
SpellCastResult CheckCast()
{
- Player* caster = GetCaster()->ToPlayer();
+ Unit* caster = GetCaster();
if (Unit* target = GetExplTargetUnit())
{
if (!caster->IsFriendlyTo(target))
@@ -433,6 +438,108 @@ class spell_pal_divine_storm_dummy : public SpellScriptLoader
}
};
+class spell_pal_lay_on_hands : public SpellScriptLoader
+{
+ public:
+ spell_pal_lay_on_hands() : SpellScriptLoader("spell_pal_lay_on_hands") { }
+
+ class spell_pal_lay_on_hands_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_lay_on_hands_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_FORBEARANCE))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_AVENGING_WRATH_MARKER))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SPELL_IMMUNE_SHIELD_MARKER))
+ return false;
+ return true;
+ }
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (Unit* target = GetExplTargetUnit())
+ {
+ if (caster == target)
+ {
+ if (target->HasAura(SPELL_FORBEARANCE))
+ return SPELL_FAILED_TARGET_AURASTATE;
+
+ if (target->HasAura(SPELL_AVENGING_WRATH_MARKER))
+ return SPELL_FAILED_TARGET_AURASTATE;
+
+ if (target->HasAura(SPELL_IMMUNE_SHIELD_MARKER))
+ return SPELL_FAILED_TARGET_AURASTATE;
+ }
+ }
+ return SPELL_CAST_OK;
+ }
+
+ void HandleScript()
+ {
+ Unit* caster = GetCaster();
+ if (caster == GetHitUnit())
+ {
+ caster->CastSpell(caster, SPELL_FORBEARANCE, true);
+ caster->CastSpell(caster, SPELL_AVENGING_WRATH_MARKER, true);
+ caster->CastSpell(caster, SPELL_IMMUNE_SHIELD_MARKER, true);
+ }
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_pal_lay_on_hands_SpellScript::CheckCast);
+ AfterHit += SpellHitFn(spell_pal_lay_on_hands_SpellScript::HandleScript);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pal_lay_on_hands_SpellScript();
+ }
+};
+
+class spell_pal_righteous_defense : public SpellScriptLoader
+{
+ public:
+ spell_pal_righteous_defense() : SpellScriptLoader("spell_pal_righteous_defense") { }
+
+ class spell_pal_righteous_defense_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_pal_righteous_defense_SpellScript);
+
+ SpellCastResult CheckCast()
+ {
+ Unit* caster = GetCaster();
+ if (caster->GetTypeId() != TYPEID_PLAYER)
+ return SPELL_FAILED_DONT_REPORT;
+
+ if (Unit* target = GetExplTargetUnit())
+ {
+ if (!target->IsFriendlyTo(caster) || target->getAttackers().empty())
+ return SPELL_FAILED_BAD_TARGETS;
+ }
+ else
+ return SPELL_FAILED_BAD_TARGETS;
+
+ return SPELL_CAST_OK;
+ }
+
+ void Register()
+ {
+ OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pal_righteous_defense_SpellScript();
+ }
+};
+
void AddSC_paladin_spell_scripts()
{
new spell_pal_ardent_defender();
@@ -443,4 +550,6 @@ void AddSC_paladin_spell_scripts()
new spell_pal_judgement_of_command();
new spell_pal_divine_storm();
new spell_pal_divine_storm_dummy();
+ new spell_pal_lay_on_hands();
+ new spell_pal_righteous_defense();
}
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 27cb0d3bb71..6ed0f18c785 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -24,6 +24,9 @@
#include "ScriptMgr.h"
#include "SpellScript.h"
#include "SpellAuraEffects.h"
+#include "Unit.h"
+#include "Player.h"
+#include "Pet.h"
enum HunterPetCalculate
{
@@ -36,6 +39,7 @@ enum HunterPetCalculate
SPELL_HUNTER_PET_SCALING_02 = 34903,
SPELL_HUNTER_PET_SCALING_03 = 34904,
SPELL_HUNTER_PET_SCALING_04 = 61017,
+ SPELL_HUNTER_ANIMAL_HANDLER = 34453,
};
enum WarlockPetCalculate
@@ -47,13 +51,23 @@ enum WarlockPetCalculate
SPELL_WARLOCK_PET_SCALING_03 = 34957,
SPELL_WARLOCK_PET_SCALING_04 = 34958,
SPELL_WARLOCK_PET_SCALING_05 = 61013,
+ ENTRY_FELGUARD = 17252,
+ ENTRY_VOIDWALKER = 1860,
+ ENTRY_FELHUNTER = 417,
+ ENTRY_SUCCUBUS = 1863,
+ ENTRY_IMP = 416,
+ SPELL_WARLOCK_GLYPH_OF_VOIDWALKER = 56247,
};
enum DKPetCalculate
{
+ SPELL_DEATH_KNIGHT_RUNE_WEAPON_02 = 51906,
SPELL_DEATH_KNIGHT_PET_SCALING_01 = 54566,
SPELL_DEATH_KNIGHT_PET_SCALING_02 = 51996,
SPELL_DEATH_KNIGHT_PET_SCALING_03 = 61697,
+ SPELL_NIGHT_OF_THE_DEAD = 55620,
+ ENTRY_ARMY_OF_THE_DEAD_GHOUL = 24207,
+ SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL = 58686,
};
enum ShamanPetCalculate
@@ -69,7 +83,7 @@ enum MiscPetCalculate
SPELL_MAGE_PET_PASSIVE_ELEMENTAL = 44559,
SPELL_PET_HEALTH_SCALING = 61679,
SPELL_PET_UNK_01 = 67561,
- SPELL_PET_UNK_01 = 67557,
+ SPELL_PET_UNK_02 = 67557,
};
class spell_gen_pet_calculate : public SpellScriptLoader
@@ -190,7 +204,7 @@ class spell_gen_pet_calculate : public SpellScriptLoader
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE);
break;
case SPELL_DEATH_KNIGHT_PET_SCALING_03:
- case SPELL_SHAMAN_PET_HIT:
+// case SPELL_SHAMAN_PET_HIT:
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE);
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_gen_pet_calculate_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE);
break;
@@ -206,6 +220,1532 @@ class spell_gen_pet_calculate : public SpellScriptLoader
}
};
+class spell_warl_pet_scaling_01 : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_scaling_01() : SpellScriptLoader("spell_warl_pet_scaling_01") { }
+
+ class spell_warl_pet_scaling_01_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_scaling_01_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ _tempBonus = 0;
+ return true;
+ }
+
+ void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = CalculatePctN(owner->GetStat(STAT_STAMINA), 75);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (_tempBonus)
+ {
+ PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
+ uint32 healthMod = 0;
+ uint32 baseHealth = pInfo->health;
+ switch (pet->GetEntry())
+ {
+ case ENTRY_IMP:
+ healthMod = uint32(_tempBonus * 8.4f);
+ break;
+ case ENTRY_FELGUARD:
+ case ENTRY_VOIDWALKER:
+ healthMod = _tempBonus * 11;
+ break;
+ case ENTRY_SUCCUBUS:
+ healthMod = uint32(_tempBonus * 9.1f);
+ break;
+ case ENTRY_FELHUNTER:
+ healthMod = uint32(_tempBonus * 9.5f);
+ break;
+ default:
+ healthMod = 0;
+ break;
+ }
+ if (healthMod)
+ pet->ToPet()->SetCreateHealth(baseHealth + healthMod);
+ }
+ }
+
+ void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ {
+ PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
+ pet->ToPet()->SetCreateHealth(pInfo->health);
+ }
+ }
+
+ void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
+ int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
+ int32 maximum = (fire > shadow) ? fire : shadow;
+ if (maximum < 0)
+ maximum = 0;
+ float bonusAP = maximum * 0.57f;
+
+ amount += bonusAP;
+
+ // Glyph of felguard
+ if (pet->GetEntry() == ENTRY_FELGUARD)
+ {
+ if (AuraEffect* aurEffect = owner->GetAuraEffect(56246, EFFECT_0))
+ {
+ float base_attPower = pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE) * pet->GetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_PCT);
+ amount += CalculatePctN(amount+base_attPower, aurEffect->GetAmount());
+ }
+ }
+ }
+ }
+
+ void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ //the damage bonus used for pets is either fire or shadow damage, whatever is higher
+ int32 fire = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_FIRE);
+ int32 shadow = int32(owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW)) - owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + SPELL_SCHOOL_SHADOW);
+ int32 maximum = (fire > shadow) ? fire : shadow;
+ float bonusDamage = 0.0f;
+
+ if (maximum > 0)
+ bonusDamage = maximum * 0.15f;
+
+ amount += bonusDamage;
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_warl_pet_scaling_01_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectApply += AuraEffectApplyFn(spell_warl_pet_scaling_01_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_01_AuraScript::CalculateStaminaAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_01_AuraScript::CalculateAttackPowerAmount, EFFECT_1, SPELL_AURA_MOD_ATTACK_POWER);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_01_AuraScript::CalculateDamageDoneAmount, EFFECT_2, SPELL_AURA_MOD_DAMAGE_DONE);
+ }
+
+ private:
+ uint32 _tempBonus;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_scaling_01_AuraScript();
+ }
+};
+
+class spell_warl_pet_scaling_02 : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_scaling_02() : SpellScriptLoader("spell_warl_pet_scaling_02") { }
+
+ class spell_warl_pet_scaling_02_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_scaling_02_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ _tempBonus = 0;
+ return true;
+ }
+
+ void CalculateIntellectAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetStat(STAT_INTELLECT), 30);
+
+ amount += ownerBonus;
+ _tempBonus = ownerBonus;
+ }
+ }
+
+ void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (_tempBonus)
+ {
+ PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
+ uint32 manaMod = 0;
+ uint32 baseMana = pInfo->mana;
+ switch (pet->GetEntry())
+ {
+ case ENTRY_IMP:
+ manaMod = uint32(_tempBonus * 4.9f);
+ break;
+ case ENTRY_VOIDWALKER:
+ case ENTRY_SUCCUBUS:
+ case ENTRY_FELHUNTER:
+ case ENTRY_FELGUARD:
+ manaMod = uint32(_tempBonus * 11.5f);
+ break;
+ default:
+ manaMod = 0;
+ break;
+ }
+ if (manaMod)
+ pet->ToPet()->SetCreateMana(baseMana + manaMod);
+ }
+ }
+
+ void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ {
+ PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
+ pet->ToPet()->SetCreateMana(pInfo->mana);
+ }
+ }
+
+ void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetArmor(), 35);
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
+ amount += ownerBonus;
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_warl_pet_scaling_02_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectApply += AuraEffectApplyFn(spell_warl_pet_scaling_02_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_02_AuraScript::CalculateIntellectAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_02_AuraScript::CalculateArmorAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_02_AuraScript::CalculateFireResistanceAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE);
+ }
+
+ private:
+ uint32 _tempBonus;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_scaling_02_AuraScript();
+ }
+};
+
+class spell_warl_pet_scaling_03 : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_scaling_03() : SpellScriptLoader("spell_warl_pet_scaling_03") { }
+
+ class spell_warl_pet_scaling_03_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_scaling_03_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
+ amount += ownerBonus;
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_03_AuraScript::CalculateFrostResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_03_AuraScript::CalculateArcaneResistanceAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_03_AuraScript::CalculateNatureResistanceAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_scaling_03_AuraScript();
+ }
+};
+
+
+class spell_warl_pet_scaling_04 : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_scaling_04() : SpellScriptLoader("spell_warl_pet_scaling_04") { }
+
+ class spell_warl_pet_scaling_04_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_scaling_04_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ {
+ float ownerBonus = 0.0f;
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
+ amount += ownerBonus;
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_04_AuraScript::CalculateShadowResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_scaling_04_AuraScript();
+ }
+};
+
+class spell_warl_pet_scaling_05 : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_scaling_05() : SpellScriptLoader("spell_warl_pet_scaling_05") { }
+
+ class spell_warl_pet_scaling_05_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_scaling_05_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitMelee = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ // Increase hit spell from spell hit ratings
+ HitMelee += owner->GetRatingBonusValue(CR_HIT_SPELL);
+
+ amount += int32(HitMelee);
+ }
+ }
+
+ void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitSpell = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ // Increase hit spell from spell hit ratings
+ HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL);
+
+ amount += int32(HitSpell);
+ }
+ }
+
+ void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float Expertise = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ Expertise += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ // Increase hit spell from spell hit ratings
+ Expertise += owner->GetRatingBonusValue(CR_HIT_SPELL);
+
+ amount += int32(Expertise);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_05_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_05_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_scaling_05_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_scaling_05_AuraScript();
+ }
+};
+
+class spell_warl_pet_passive : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_passive() : SpellScriptLoader("spell_warl_pet_passive") { }
+
+ class spell_warl_pet_passive_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_passive_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float CritSpell = 0.0f;
+ // Crit from Intellect
+ CritSpell += owner->GetSpellCritFromIntellect();
+ // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
+ CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
+ // Increase crit from SPELL_AURA_MOD_CRIT_PCT
+ CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT);
+ // Increase crit spell from spell crit ratings
+ CritSpell += owner->GetRatingBonusValue(CR_CRIT_SPELL);
+
+ if (AuraApplication* improvedDemonicTacticsApp = owner->GetAuraApplicationOfRankedSpell(54347))
+ if (Aura* improvedDemonicTactics = improvedDemonicTacticsApp->GetBase())
+ if (AuraEffect* improvedDemonicTacticsEffect = improvedDemonicTactics->GetEffect(EFFECT_0))
+ amount += CalculatePctN(CritSpell, improvedDemonicTacticsEffect->GetAmount());
+ }
+ }
+
+ void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float CritMelee = 0.0f;
+ // Crit from Agility
+ CritMelee += owner->GetMeleeCritFromAgility();
+ // Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
+ CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
+ // Increase crit from SPELL_AURA_MOD_CRIT_PCT
+ CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT);
+ // Increase crit melee from melee crit ratings
+ CritMelee += owner->GetRatingBonusValue(CR_CRIT_MELEE);
+
+ if (AuraApplication* improvedDemonicTacticsApp = owner->GetAuraApplicationOfRankedSpell(54347))
+ if (Aura* improvedDemonicTactics = improvedDemonicTacticsApp->GetBase())
+ if (AuraEffect* improvedDemonicTacticsEffect = improvedDemonicTactics->GetEffect(EFFECT_0))
+ amount += CalculatePctN(CritMelee, improvedDemonicTacticsEffect->GetAmount());
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_AuraScript::CalculateAmountCritSpell, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_AuraScript::CalculateAmountCritMelee, EFFECT_1, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_passive_AuraScript();
+ }
+};
+// this doesnt actually fit in here
+class spell_warl_pet_passive_damage_done : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_passive_damage_done() : SpellScriptLoader("spell_warl_pet_passive_damage_done") { }
+
+ class spell_warl_pet_passive_damage_done_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_passive_damage_done_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ switch (GetCaster()->GetEntry())
+ {
+ case ENTRY_VOIDWALKER:
+ amount += -16;
+ break;
+ case ENTRY_FELHUNTER:
+ amount += -20;
+ break;
+ case ENTRY_SUCCUBUS:
+ case ENTRY_FELGUARD:
+ amount += 5;
+ break;
+ }
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_damage_done_AuraScript::CalculateAmountDamageDone, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_damage_done_AuraScript::CalculateAmountDamageDone, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_passive_damage_done_AuraScript();
+ }
+};
+
+class spell_warl_pet_passive_voidwalker : public SpellScriptLoader
+{
+public:
+ spell_warl_pet_passive_voidwalker() : SpellScriptLoader("spell_warl_pet_passive_voidwalker") { }
+
+ class spell_warl_pet_passive_voidwalker_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_pet_passive_voidwalker_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (pet->isPet())
+ if (Unit* owner = pet->ToPet()->GetOwner())
+ if (AuraEffect* aurEffect = owner->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_VOIDWALKER, EFFECT_0))
+ amount += aurEffect->GetAmount();
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_pet_passive_voidwalker_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_pet_passive_voidwalker_AuraScript();
+ }
+};
+
+
+class spell_sha_pet_scaling_04 : public SpellScriptLoader
+{
+public:
+ spell_sha_pet_scaling_04() : SpellScriptLoader("spell_sha_pet_scaling_04") { }
+
+ class spell_sha_pet_scaling_04_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_pet_scaling_04_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitMelee = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_HIT_CHANCE
+ HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
+ // Increase hit melee from meele hit ratings
+ HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE);
+
+ amount += int32(HitMelee);
+ }
+ }
+
+ void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitSpell = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ // Increase hit spell from spell hit ratings
+ HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL);
+
+ amount += int32(HitSpell);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_pet_scaling_04_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_pet_scaling_04_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_sha_pet_scaling_04_AuraScript();
+ }
+};
+
+class spell_hun_pet_scaling_01 : public SpellScriptLoader
+{
+public:
+ spell_hun_pet_scaling_01() : SpellScriptLoader("spell_hun_pet_scaling_01") { }
+
+ class spell_hun_pet_scaling_01_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_pet_scaling_01_AuraScript);
+
+ void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float mod = 0.45f;
+ float ownerBonus = 0.0f;
+
+ PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
+ if (itr == pet->ToPet()->m_spells.end())
+ itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
+
+ 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
+ AddPctN(mod, spellInfo->Effects[EFFECT_0].CalcValue());
+ }
+
+ ownerBonus = owner->GetStat(STAT_STAMINA)*mod;
+
+ amount += ownerBonus;
+ }
+ }
+
+ void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (_tempHealth)
+ pet->SetHealth(_tempHealth);
+ }
+
+ void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ _tempHealth = pet->GetHealth();
+ }
+
+ void CalculateAttackPowerAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float mod = 1.0f; //Hunter contribution modifier
+ float bonusAP = 0.0f;
+
+ PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
+ if (itr == pet->ToPet()->m_spells.end())
+ itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
+
+ 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
+ mod += CalculatePctN(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
+ }
+
+ bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod;
+
+ amount += bonusAP;
+ }
+ }
+
+ void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float mod = 1.0f; //Hunter contribution modifier
+ float bonusDamage = 0.0f;
+
+ PetSpellMap::const_iterator itr = (pet->ToPet()->m_spells.find(62758)); // Wild Hunt rank 1
+ if (itr == pet->ToPet()->m_spells.end())
+ itr = pet->ToPet()->m_spells.find(62762); // Wild Hunt rank 2
+
+ 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
+ mod += CalculatePctN(1.0f, spellInfo->Effects[EFFECT_1].CalcValue());
+ }
+
+ bonusDamage = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod;
+
+ amount += bonusDamage;
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_hun_pet_scaling_01_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectApply += AuraEffectApplyFn(spell_hun_pet_scaling_01_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateStaminaAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateAttackPowerAmount, EFFECT_1, SPELL_AURA_MOD_ATTACK_POWER);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_01_AuraScript::CalculateDamageDoneAmount, EFFECT_2, SPELL_AURA_MOD_DAMAGE_DONE);
+ }
+
+ private:
+ uint32 _tempHealth;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_pet_scaling_01_AuraScript();
+ }
+};
+
+class spell_hun_pet_scaling_02 : public SpellScriptLoader
+{
+public:
+ spell_hun_pet_scaling_02() : SpellScriptLoader("spell_hun_pet_scaling_02") { }
+
+ class spell_hun_pet_scaling_02_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_pet_scaling_02_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateFrostResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FROST), 40);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateFireResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_FIRE), 40);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateNatureResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_NATURE), 40);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_02_AuraScript::CalculateFrostResistanceAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_02_AuraScript::CalculateFireResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_02_AuraScript::CalculateNatureResistanceAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_pet_scaling_02_AuraScript();
+ }
+};
+
+class spell_hun_pet_scaling_03 : public SpellScriptLoader
+{
+public:
+ spell_hun_pet_scaling_03() : SpellScriptLoader("spell_hun_pet_scaling_03") { }
+
+ class spell_hun_pet_scaling_03_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_pet_scaling_03_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateShadowResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_SHADOW), 40);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateArcaneResistanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetResistance(SPELL_SCHOOL_ARCANE), 40);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void CalculateArmorAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isPet())
+ return;
+
+ Unit* owner = pet->ToPet()->GetOwner();
+ if (!owner)
+ return;
+
+ float ownerBonus = 0.0f;
+
+ ownerBonus = CalculatePctN(owner->GetArmor(), 35);
+
+ amount += ownerBonus;
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_03_AuraScript::CalculateShadowResistanceAmount, EFFECT_0, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_03_AuraScript::CalculateArcaneResistanceAmount, EFFECT_1, SPELL_AURA_MOD_RESISTANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_03_AuraScript::CalculateArmorAmount, EFFECT_2, SPELL_AURA_MOD_RESISTANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_pet_scaling_03_AuraScript();
+ }
+};
+
+class spell_hun_pet_scaling_04 : public SpellScriptLoader
+{
+public:
+ spell_hun_pet_scaling_04() : SpellScriptLoader("spell_hun_pet_scaling_04") { }
+
+ class spell_hun_pet_scaling_04_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_pet_scaling_04_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitMelee = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_HIT_CHANCE
+ HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
+ // Increase hit melee from meele hit ratings
+ HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE);
+
+ amount += int32(HitMelee);
+ }
+ }
+
+ void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitSpell = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ // Increase hit spell from spell hit ratings
+ HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL);
+
+ amount += int32(HitSpell);
+ }
+ }
+
+ void CalculateAmountExpertise(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float Expertise = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_EXPERTISE
+ Expertise += owner->GetTotalAuraModifier(SPELL_AURA_MOD_EXPERTISE);
+ // Increase Expertise from Expertise ratings
+ Expertise += owner->GetRatingBonusValue(CR_EXPERTISE);
+
+ amount += int32(Expertise);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_04_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_04_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_scaling_04_AuraScript::CalculateAmountExpertise, EFFECT_2, SPELL_AURA_MOD_EXPERTISE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_pet_scaling_04_AuraScript();
+ }
+};
+
+class spell_hun_pet_passive_crit : public SpellScriptLoader
+{
+public:
+ spell_hun_pet_passive_crit() : SpellScriptLoader("spell_hun_pet_passive_crit") { }
+
+ class spell_hun_pet_passive_crit_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_pet_passive_crit_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountCritSpell(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float CritSpell = 0.0f;
+ // Crit from Intellect
+ // CritSpell += owner->GetSpellCritFromIntellect();
+ // Increase crit from SPELL_AURA_MOD_SPELL_CRIT_CHANCE
+ // CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
+ // Increase crit from SPELL_AURA_MOD_CRIT_PCT
+ // CritSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT);
+ // Increase crit spell from spell crit ratings
+ // CritSpell += owner->GetRatingBonusValue(CR_CRIT_SPELL);
+
+ amount += (CritSpell*0.8f);
+ }
+ }
+
+ void CalculateAmountCritMelee(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float CritMelee = 0.0f;
+ // Crit from Agility
+ // CritMelee += owner->GetMeleeCritFromAgility();
+ // Increase crit from SPELL_AURA_MOD_WEAPON_CRIT_PERCENT
+ // CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
+ // Increase crit from SPELL_AURA_MOD_CRIT_PCT
+ // CritMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_CRIT_PCT);
+ // Increase crit melee from melee crit ratings
+ // CritMelee += owner->GetRatingBonusValue(CR_CRIT_MELEE);
+
+ amount += (CritMelee*0.8f);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_passive_crit_AuraScript::CalculateAmountCritSpell, EFFECT_1, SPELL_AURA_MOD_SPELL_CRIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_passive_crit_AuraScript::CalculateAmountCritMelee, EFFECT_0, SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_pet_passive_crit_AuraScript();
+ }
+};
+
+class spell_hun_pet_passive_damage_done : public SpellScriptLoader
+{
+public:
+ spell_hun_pet_passive_damage_done() : SpellScriptLoader("spell_hun_pet_passive_damage_done") { }
+
+ class spell_hun_pet_passive_damage_done_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_pet_passive_damage_done_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // Pet's base damage changes depending on happiness
+ if (GetCaster()->isPet() && GetCaster()->ToPet()->isHunterPet())
+ {
+ switch (GetCaster()->ToPet()->GetHappinessState())
+ {
+ case HAPPY:
+ // 125% of normal damage
+ amount += 25.0f;
+ break;
+ case CONTENT:
+ // 100% of normal damage, nothing to modify
+ break;
+ case UNHAPPY:
+ // 75% of normal damage
+ amount += -25.0f;
+ break;
+ }
+ }
+ // Cobra Reflexes
+ if (AuraEffect* cobraReflexes = GetCaster()->GetAuraEffectOfRankedSpell(61682, EFFECT_0))
+ amount -= cobraReflexes->GetAmount();
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_pet_passive_damage_done_AuraScript::CalculateAmountDamageDone, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_pet_passive_damage_done_AuraScript();
+ }
+};
+
+class spell_hun_animal_handler : public SpellScriptLoader
+{
+public:
+ spell_hun_animal_handler() : SpellScriptLoader("spell_hun_animal_handler") { }
+
+ class spell_hun_animal_handler_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_animal_handler_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountDamageDone(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ if (AuraEffect* aurEffect = owner->GetAuraEffectOfRankedSpell(SPELL_HUNTER_ANIMAL_HANDLER, EFFECT_1))
+ amount = aurEffect->GetAmount();
+ else
+ amount = 0;
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_hun_animal_handler_AuraScript::CalculateAmountDamageDone, EFFECT_0, SPELL_AURA_MOD_ATTACK_POWER_PCT);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_hun_animal_handler_AuraScript();
+ }
+};
+
+
+class spell_dk_avoidance_passive : public SpellScriptLoader
+{
+public:
+ spell_dk_avoidance_passive() : SpellScriptLoader("spell_dk_avoidance_passive") { }
+
+ class spell_dk_avoidance_passive_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_avoidance_passive_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAvoidanceAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (Unit* owner = pet->GetOwner())
+
+ // Army of the dead ghoul
+ if (pet->GetEntry() == ENTRY_ARMY_OF_THE_DEAD_GHOUL)
+ amount = -90;
+ // Night of the dead
+ else if ( Aura * aur = owner->GetAuraOfRankedSpell(SPELL_NIGHT_OF_THE_DEAD))
+ amount = aur->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_avoidance_passive_AuraScript::CalculateAvoidanceAmount, EFFECT_0, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dk_avoidance_passive_AuraScript();
+ }
+};
+
+class spell_dk_pet_scaling_01 : public SpellScriptLoader
+{
+public:
+ spell_dk_pet_scaling_01() : SpellScriptLoader("spell_dk_pet_scaling_01") { }
+
+ class spell_dk_pet_scaling_01_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_pet_scaling_01_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ _tempHealth = 0;
+ return true;
+ }
+
+ void CalculateStaminaAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (pet->isGuardian())
+ {
+ if (Unit* owner = pet->GetOwner())
+ {
+ float mod = 0.3f;
+
+ // Ravenous Dead. Check just if owner has Ravenous Dead since it's effect is not an aura
+ if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0))
+ {
+ mod += aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()/100; // Ravenous Dead edits the original scale
+ }
+ // Glyph of the Ghoul
+ if (AuraEffect const* aurEff = owner->GetAuraEffect(SPELL_DEATH_KNIGHT_GLYPH_OF_GHOUL, 0))
+ mod += aurEff->GetAmount()/100;
+
+ float ownerBonus = float(owner->GetStat(STAT_STAMINA)) * mod;
+ amount += ownerBonus;
+ }
+ }
+ }
+ }
+
+ void ApplyEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ if (_tempHealth)
+ pet->SetHealth(_tempHealth);
+ }
+
+ void RemoveEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ _tempHealth = pet->GetHealth();
+ }
+
+ void CalculateStrengthAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ if (!pet->isGuardian())
+ return;
+
+ Unit* owner = pet->GetOwner();
+ if (!owner)
+ return;
+
+ float mod = 0.7f;
+
+ // Ravenous Dead
+ AuraEffect const* aurEff = NULL;
+ // Check just if owner has Ravenous Dead since it's effect is not an aura
+ aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
+ if (aurEff)
+ {
+ mod += CalculatePctN(mod, aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue()); // Ravenous Dead edits the original scale
+ }
+ // Glyph of the Ghoul
+ aurEff = owner->GetAuraEffect(58686, 0);
+ if (aurEff)
+ mod += CalculatePctN(1.0f, aurEff->GetAmount()); // Glyph of the Ghoul adds a flat value to the scale mod
+ float ownerBonus = float(owner->GetStat(STAT_STRENGTH)) * mod;
+ amount += ownerBonus;
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectRemoveFn(spell_dk_pet_scaling_01_AuraScript::RemoveEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ AfterEffectApply += AuraEffectApplyFn(spell_dk_pet_scaling_01_AuraScript::ApplyEffect, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_01_AuraScript::CalculateStaminaAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_01_AuraScript::CalculateStrengthAmount, EFFECT_1, SPELL_AURA_MOD_STAT);
+ }
+
+ private:
+ uint32 _tempHealth;
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dk_pet_scaling_01_AuraScript();
+ }
+};
+
+class spell_dk_pet_scaling_02 : public SpellScriptLoader
+{
+public:
+ spell_dk_pet_scaling_02() : SpellScriptLoader("spell_dk_pet_scaling_02") { }
+
+ class spell_dk_pet_scaling_02_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_pet_scaling_02_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HasteMelee = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_HIT_CHANCE
+ HasteMelee += (1-owner->m_modAttackSpeedPct[BASE_ATTACK])*100;
+
+ amount += int32(HasteMelee);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_02_AuraScript::CalculateAmountMeleeHaste, EFFECT_1, SPELL_AURA_MELEE_SLOW);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dk_pet_scaling_02_AuraScript();
+ }
+};
+
+class spell_dk_pet_scaling_03 : public SpellScriptLoader
+{
+public:
+ spell_dk_pet_scaling_03() : SpellScriptLoader("spell_dk_pet_scaling_03") { }
+
+ class spell_dk_pet_scaling_03_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_pet_scaling_03_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateAmountMeleeHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitMelee = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_HIT_CHANCE
+ HitMelee += owner->GetTotalAuraModifier(SPELL_AURA_MOD_HIT_CHANCE);
+ // Increase hit melee from meele hit ratings
+ HitMelee += owner->GetRatingBonusValue(CR_HIT_MELEE);
+
+ amount += int32(HitMelee);
+ }
+ }
+
+ void CalculateAmountSpellHit(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HitSpell = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_SPELL_HIT_CHANCE
+ HitSpell += owner->GetTotalAuraModifier(SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ // Increase hit spell from spell hit ratings
+ HitSpell += owner->GetRatingBonusValue(CR_HIT_SPELL);
+
+ amount += int32(HitSpell);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_03_AuraScript::CalculateAmountMeleeHit, EFFECT_0, SPELL_AURA_MOD_HIT_CHANCE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling_03_AuraScript::CalculateAmountSpellHit, EFFECT_1, SPELL_AURA_MOD_SPELL_HIT_CHANCE);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dk_pet_scaling_03_AuraScript();
+ }
+};
+
+class spell_dk_rune_weapon_scaling_02 : public SpellScriptLoader
+{
+public:
+ spell_dk_rune_weapon_scaling_02() : SpellScriptLoader("spell_dk_rune_weapon_scaling_02") { }
+
+ class spell_dk_rune_weapon_scaling_02_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_dk_rune_weapon_scaling_02_AuraScript);
+
+ bool Load()
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner() || GetCaster()->GetOwner()->GetTypeId() != TYPEID_PLAYER)
+ return false;
+ return true;
+ }
+
+ void CalculateDamageDoneAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (Unit* pet = GetUnitOwner())
+ {
+ Unit* owner = pet->GetOwner();
+ if (!owner)
+ return;
+
+ if (pet->isGuardian())
+ ((Guardian*)pet)->SetBonusDamage(owner->GetTotalAttackPowerValue(BASE_ATTACK));
+
+ amount += owner->CalculateDamage(BASE_ATTACK, true, true);;
+ }
+ }
+
+ void CalculateAmountMeleeHaste(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
+ {
+ if (!GetCaster() || !GetCaster()->GetOwner())
+ return;
+ if (Player* owner = GetCaster()->GetOwner()->ToPlayer())
+ {
+ // For others recalculate it from:
+ float HasteMelee = 0.0f;
+ // Increase hit from SPELL_AURA_MOD_HIT_CHANCE
+ HasteMelee += (1-owner->m_modAttackSpeedPct[BASE_ATTACK])*100;
+
+ amount += int32(HasteMelee);
+ }
+ }
+
+ void Register()
+ {
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_rune_weapon_scaling_02_AuraScript::CalculateDamageDoneAmount, EFFECT_0, SPELL_AURA_MOD_DAMAGE_DONE);
+ DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_rune_weapon_scaling_02_AuraScript::CalculateAmountMeleeHaste, EFFECT_1, SPELL_AURA_MELEE_SLOW);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_dk_rune_weapon_scaling_02_AuraScript();
+ }
+};
+
void AddSC_pet_spell_scripts()
{
new spell_gen_pet_calculate();
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index cb9f2ad1753..dbc3a91012b 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -34,6 +34,7 @@ enum PriestSpells
PRIEST_SPELL_PENANCE_R1_HEAL = 47757,
PRIEST_SPELL_REFLECTIVE_SHIELD_TRIGGERED = 33619,
PRIEST_SPELL_REFLECTIVE_SHIELD_R1 = 33201,
+ PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL = 64085,
PRIEST_SPELL_EMPOWERED_RENEW = 63544,
PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021,
};
@@ -332,6 +333,50 @@ public:
}
};
+class spell_pri_vampiric_touch : public SpellScriptLoader
+{
+ public:
+ spell_pri_vampiric_touch() : SpellScriptLoader("spell_pri_vampiric_touch") { }
+
+ class spell_pri_vampiric_touch_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_pri_vampiric_touch_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* /*dispelInfo*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ if (Unit* target = GetUnitOwner())
+ {
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_1))
+ {
+ int32 damage = aurEff->GetAmount() * 8;
+ // backfire damage
+ caster->CastCustomSpell(target, PRIEST_SPELL_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
+ }
+ }
+ }
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_pri_vampiric_touch_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_pri_vampiric_touch_AuraScript();
+ }
+};
+
class spell_priest_renew : public SpellScriptLoader
{
public:
@@ -383,5 +428,6 @@ void AddSC_priest_spell_scripts()
new spell_pri_reflective_shield_trigger();
new spell_pri_mind_sear();
new spell_pri_prayer_of_mending_heal();
+ new spell_pri_vampiric_touch();
new spell_priest_renew();
}
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index c9c036d5329..da15c5c5046 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -42,6 +42,12 @@ enum ShamanSpells
// For Earthen Power
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474,
SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,
+
+ SHAMAN_BIND_SIGHT = 6277,
+
+ ICON_ID_SHAMAN_LAVA_FLOW = 3087,
+ SHAMAN_LAVA_FLOWS_R1 = 51480,
+ SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694,
};
// 51474 - Astral shift
@@ -652,6 +658,98 @@ class spell_sha_chain_heal : public SpellScriptLoader
}
};
+class spell_sha_flame_shock : public SpellScriptLoader
+{
+ public:
+ spell_sha_flame_shock() : SpellScriptLoader("spell_sha_flame_shock") { }
+
+ class spell_sha_flame_shock_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_flame_shock_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_R1))
+ return false;
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_LAVA_FLOWS_TRIGGERED_R1))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* /*dispelInfo*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ // Lava Flows
+ if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, ICON_ID_SHAMAN_LAVA_FLOW, 0))
+ {
+ if (sSpellMgr->GetFirstSpellInChain(SHAMAN_LAVA_FLOWS_R1) != sSpellMgr->GetFirstSpellInChain(aurEff->GetId()))
+ return;
+
+ uint8 rank = sSpellMgr->GetSpellRank(aurEff->GetId());
+ caster->CastSpell(caster, sSpellMgr->GetSpellWithRank(SHAMAN_LAVA_FLOWS_TRIGGERED_R1, rank), true);
+ }
+ }
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_sha_flame_shock_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_sha_flame_shock_AuraScript();
+ }
+};
+
+class spell_sha_sentry_totem : public SpellScriptLoader
+{
+ public:
+ spell_sha_sentry_totem() : SpellScriptLoader("spell_sha_sentry_totem") { }
+
+ class spell_sha_sentry_totem_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_sha_sentry_totem_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SHAMAN_BIND_SIGHT))
+ return false;
+ return true;
+ }
+
+ void AfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[4]))
+ if (totem->isTotem())
+ caster->CastSpell(totem, SHAMAN_BIND_SIGHT, true);
+ }
+ }
+
+ void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ if (caster->GetTypeId() == TYPEID_PLAYER)
+ caster->ToPlayer()->StopCastingBindSight();
+ }
+
+ void Register()
+ {
+ AfterEffectApply += AuraEffectApplyFn(spell_sha_sentry_totem_AuraScript::AfterApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ AfterEffectRemove += AuraEffectRemoveFn(spell_sha_sentry_totem_AuraScript::AfterRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_sha_sentry_totem_AuraScript();
+ }
+};
+
void AddSC_shaman_spell_scripts()
{
new spell_sha_astral_shift();
@@ -667,4 +765,6 @@ void AddSC_shaman_spell_scripts()
new spell_sha_mana_spring_totem();
new spell_sha_lava_lash();
new spell_sha_chain_heal();
+ new spell_sha_flame_shock();
+ new spell_sha_sentry_totem();
}
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index 838b9e4f932..1b24a9ec09f 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -37,6 +37,8 @@ enum WarlockSpells
WARLOCK_DEMONIC_CIRCLE_SUMMON = 48018,
WARLOCK_DEMONIC_CIRCLE_TELEPORT = 48020,
WARLOCK_DEMONIC_CIRCLE_ALLOW_CAST = 62388,
+ WARLOCK_HAUNT_HEAL = 48210,
+ WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117,
};
class spell_warl_banish : public SpellScriptLoader
@@ -523,6 +525,106 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader
}
};
+class spell_warl_haunt : public SpellScriptLoader
+{
+ public:
+ spell_warl_haunt() : SpellScriptLoader("spell_warl_haunt") { }
+
+ class spell_warl_haunt_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warl_haunt_SpellScript);
+
+ void HandleOnHit()
+ {
+ if (Aura* aura = GetHitAura())
+ if (AuraEffect* aurEff = aura->GetEffect(EFFECT_1))
+ aurEff->SetAmount(CalculatePctN(aurEff->GetAmount(), GetHitDamage()));
+ }
+
+ void Register()
+ {
+ OnHit += SpellHitFn(spell_warl_haunt_SpellScript::HandleOnHit);
+ }
+ };
+
+ class spell_warl_haunt_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_haunt_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_HAUNT_HEAL))
+ return false;
+ return true;
+ }
+
+ void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ int32 amount = aurEff->GetAmount();
+ GetTarget()->CastCustomSpell(caster, WARLOCK_HAUNT_HEAL, &amount, NULL, NULL, true, NULL, aurEff, GetCasterGUID());
+ }
+ }
+
+ void Register()
+ {
+ OnEffectRemove += AuraEffectApplyFn(spell_warl_haunt_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warl_haunt_SpellScript();
+ }
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_haunt_AuraScript();
+ }
+};
+
+class spell_warl_unstable_affliction : public SpellScriptLoader
+{
+ public:
+ spell_warl_unstable_affliction() : SpellScriptLoader("spell_warl_unstable_affliction") { }
+
+ class spell_warl_unstable_affliction_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_warl_unstable_affliction_AuraScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(WARLOCK_UNSTABLE_AFFLICTION_DISPEL))
+ return false;
+ return true;
+ }
+
+ void HandleDispel(DispelInfo* dispelInfo)
+ {
+ if (Unit* caster = GetCaster())
+ {
+ if (AuraEffect const* aurEff = GetEffect(EFFECT_0))
+ {
+ int32 damage = aurEff->GetAmount() * 9;
+ // backfire damage and silence
+ caster->CastCustomSpell(dispelInfo->GetDispeller(), WARLOCK_UNSTABLE_AFFLICTION_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
+ }
+ }
+ }
+
+ void Register()
+ {
+ AfterDispel += AuraDispelFn(spell_warl_unstable_affliction_AuraScript::HandleDispel);
+ }
+ };
+
+ AuraScript* GetAuraScript() const
+ {
+ return new spell_warl_unstable_affliction_AuraScript();
+ }
+};
+
void AddSC_warlock_spell_scripts()
{
new spell_warl_banish();
@@ -535,4 +637,6 @@ void AddSC_warlock_spell_scripts()
new spell_warl_life_tap();
new spell_warl_demonic_circle_summon();
new spell_warl_demonic_circle_teleport();
+ new spell_warl_haunt();
+ new spell_warl_unstable_affliction();
}
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index b14038c9571..cc4c4a555c2 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2515,6 +2515,13 @@ Arena.MaxRatingDifference = 150
Arena.RatingDiscardTimer = 600000
#
+# Arena.RatedUpdateTimer
+# Description: Time (in milliseconds) between checks for matchups in rated arena
+# Default: 5000 - (5 seconds)
+
+Arena.RatedUpdateTimer = 5000
+
+#
# Arena.AutoDistributePoints
# Description: Automatically distribute arena points.
# Default: 0 - (Disabled)
diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp
index 1505f2c2cee..d64276c6363 100644
--- a/src/tools/map_extractor/System.cpp
+++ b/src/tools/map_extractor/System.cpp
@@ -48,9 +48,9 @@ char output_path[128] = ".";
char input_path[128] = ".";
uint32 maxAreaId = 0;
-//**************************************************
+// **************************************************
// Extractor options
-//**************************************************
+// **************************************************
enum Extract
{
EXTRACT_MAP = 1,
@@ -221,7 +221,7 @@ uint32 ReadMapDBC()
map_ids[x].id = dbc.getRecord(x).getUInt(0);
strcpy(map_ids[x].name, dbc.getRecord(x).getString(1));
}
- printf("Done! (%u maps loaded)\n", map_count);
+ printf("Done! (%zu maps loaded)\n", map_count);
return map_count;
}
@@ -246,7 +246,7 @@ void ReadAreaTableDBC()
maxAreaId = dbc.getMaxId();
- printf("Done! (%u areas loaded)\n", area_count);
+ printf("Done! (%zu areas loaded)\n", area_count);
}
void ReadLiquidTypeTableDBC()
@@ -267,7 +267,7 @@ void ReadLiquidTypeTableDBC()
for(uint32 x = 0; x < liqTypeCount; ++x)
LiqType[dbc.getRecord(x).getUInt(0)] = dbc.getRecord(x).getUInt(3);
- printf("Done! (%u LiqTypes loaded)\n", liqTypeCount);
+ printf("Done! (%zu LiqTypes loaded)\n", liqTypeCount);
}
//
@@ -572,7 +572,7 @@ bool ConvertADT(char *filename, char *filename2, int /*cell_y*/, int /*cell_x*/,
// Try store as packed in uint16 or uint8 values
if (!(heightHeader.flags & MAP_HEIGHT_NO_HEIGHT))
{
- float step;
+ float step = 0;
// Try Store as uint values
if (CONF_allow_float_to_int)
{