aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2013-08-09 20:02:21 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2013-08-09 20:02:21 +0200
commit99aa4649d2f293672256c78b96eeff5be8e3a16c (patch)
tree822dc07f26dc020a947463df47d18baa2be5a2e5
parent80d7c093ebdf17b24390426c7b09c0b8a732949e (diff)
parent8aff3945f275b2285413ffadef616da1eb513faa (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/scripts/CMakeLists.txt
-rw-r--r--sql/old/3.3.5a/TDB41_to_TDB42_updates/world/2011_08_18_01_world_misc.sql2
-rw-r--r--sql/old/3.3.5a/TDB45_to_TDB46_updates/world/2012_01_24_00_world_misc.sql2
-rw-r--r--sql/old/3.3.5a/TDB47_to_TDB48_updates/world/2012_07_02_02_world_sai.sql6
-rw-r--r--sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_11_14_00_world_various_fixes.sql2
-rw-r--r--sql/updates/world/2013_08_06_05_world_misc.sql2
-rw-r--r--sql/updates/world/2013_08_09_00_world_sai.sql87
-rw-r--r--sql/updates/world/2013_08_09_01_world_sai.sql1
-rw-r--r--sql/updates/world/2013_08_09_02_world_cond_335.sql8
-rw-r--r--sql/updates/world/2013_08_09_03_world_sai.sql12
-rw-r--r--sql/updates/world/2013_08_09_04_world_sai.sql22
-rw-r--r--sql/updates/world/2013_08_09_05_world_sai.sql29
-rw-r--r--sql/updates/world/2013_08_09_06_world_ainame.sql8
-rw-r--r--sql/updates/world/2013_08_09_07_world_sai.sql41
-rw-r--r--sql/updates/world/2013_08_09_08_world_creature_template.sql7
-rw-r--r--sql/updates/world/2013_08_09_08_world_go_template.sql2
-rw-r--r--sql/updates/world/2013_08_09_09_world_sai.sql25
-rw-r--r--sql/updates/world/2013_08_09_10_world_sai.sql22
-rw-r--r--sql/updates/world/2013_08_09_11_world_disables.sql4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp10
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp5
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h11
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h3
-rw-r--r--src/server/game/Scripting/ScriptLoader.cpp19
-rw-r--r--src/server/game/Scripting/ScriptLoader.h1
-rw-r--r--src/server/scripts/CMakeLists.txt3
-rw-r--r--src/server/scripts/Pet/CMakeLists.txt20
-rw-r--r--src/server/scripts/Pet/pet_dk.cpp133
-rw-r--r--src/server/scripts/Pet/pet_hunter.cpp146
-rw-r--r--src/server/scripts/Pet/pet_mage.cpp83
-rw-r--r--src/server/scripts/Pet/pet_priest.cpp92
-rw-r--r--src/server/scripts/Pet/pet_shaman.cpp153
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp58
-rw-r--r--src/server/scripts/World/npcs_special.cpp446
33 files changed, 998 insertions, 467 deletions
diff --git a/sql/old/3.3.5a/TDB41_to_TDB42_updates/world/2011_08_18_01_world_misc.sql b/sql/old/3.3.5a/TDB41_to_TDB42_updates/world/2011_08_18_01_world_misc.sql
index 0a01fc87763..eaaeb6e505b 100644
--- a/sql/old/3.3.5a/TDB41_to_TDB42_updates/world/2011_08_18_01_world_misc.sql
+++ b/sql/old/3.3.5a/TDB41_to_TDB42_updates/world/2011_08_18_01_world_misc.sql
@@ -1,4 +1,4 @@
-UPDATE `creature_template` SET `npcflag`=`npcflag`|0x1000000,`VehicleId`=165,`spell1`=54420,`AIName`='SmartAI',`InhabitType`=5 WHERE `entry`=29403;
+UPDATE `creature_template` SET `npcflag`=`npcflag`|0x1000000,`VehicleId`=165,`spell1`=54420,`InhabitType`=5 WHERE `entry`=29403;
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=29403;
INSERT INTO `npc_spellclick_spells` VALUES
(29403,49641,0,0,0,1,0,0,0);
diff --git a/sql/old/3.3.5a/TDB45_to_TDB46_updates/world/2012_01_24_00_world_misc.sql b/sql/old/3.3.5a/TDB45_to_TDB46_updates/world/2012_01_24_00_world_misc.sql
index e93f33dfec4..7520b1b4f05 100644
--- a/sql/old/3.3.5a/TDB45_to_TDB46_updates/world/2012_01_24_00_world_misc.sql
+++ b/sql/old/3.3.5a/TDB45_to_TDB46_updates/world/2012_01_24_00_world_misc.sql
@@ -1,5 +1,5 @@
-- Make Dame Evniki Kapsalis show vendor gossip option only to players with Crusader title
-UPDATE `creature_template` SET `AIName` = 'SmartAI',`ScriptName` = '' WHERE `entry` = 34885;
+UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` = 34885;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10598;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`COMMENT`) VALUES
(15,10598,0,0,17,2816,0,0,0,'',"Evniki Kapsalis should only sell to Crusaders"),
diff --git a/sql/old/3.3.5a/TDB47_to_TDB48_updates/world/2012_07_02_02_world_sai.sql b/sql/old/3.3.5a/TDB47_to_TDB48_updates/world/2012_07_02_02_world_sai.sql
index 6b6b0eb587c..f1d0c3f8968 100644
--- a/sql/old/3.3.5a/TDB47_to_TDB48_updates/world/2012_07_02_02_world_sai.sql
+++ b/sql/old/3.3.5a/TDB47_to_TDB48_updates/world/2012_07_02_02_world_sai.sql
@@ -141,7 +141,7 @@ DELETE FROM `spell_target_position` WHERE `id`=57897; -- there was none, but jus
INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
(57897,571,6383.445801,229.091522,397.031127,1.660376);
-- Add info for Munch's Death Gate spell click
-UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30850;
+UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`npcflag`=16777216 WHERE `entry`=30850;
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30850;
INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
(30850,57897,2,1);
@@ -150,7 +150,7 @@ DELETE FROM `creature_template_addon` WHERE `entry`=30850;
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(30850,0,0,1,0, NULL); -- Death Gate (Munch)
-- Add info for Jayde's Death Gate spell click
-UPDATE `creature_template` SET `exp`=2,`speed_run`=1,`unit_flags`=567296,`minlevel`=80, `maxlevel`=80,`unit_flags`=567296, `speed_run`=1,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30852;
+UPDATE `creature_template` SET `exp`=2,`speed_run`=1,`unit_flags`=567296,`minlevel`=80, `maxlevel`=80,`unit_flags`=567296, `speed_run`=1,`npcflag`=16777216 WHERE `entry`=30852;
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30852;
INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
(30852,57897,2,1);
@@ -161,7 +161,7 @@ DELETE FROM `creature_template_addon` WHERE `entry`=30852;
INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES
(30852,0,0,1,0, NULL); -- Death Gate (Jayde)
-- Add info for Mograine's Death Gate spell click
-UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`AIName`="SmartAI",`npcflag`=16777216 WHERE `entry`=30841;
+UPDATE `creature_template` SET `unit_flags`=567296,`exp`=2,`speed_run`=1,`minlevel`=80, `maxlevel`=80,`npcflag`=16777216 WHERE `entry`=30841;
DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=30841;
INSERT INTO `npc_spellclick_spells` (`npc_entry`,`spell_id`,`cast_flags`,`user_type`) VALUES
(30841,57897,2,1);
diff --git a/sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_11_14_00_world_various_fixes.sql b/sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_11_14_00_world_various_fixes.sql
index 01655b674b1..903dafa3987 100644
--- a/sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_11_14_00_world_various_fixes.sql
+++ b/sql/old/3.3.5a/TDB49_to_TDB50_updates/world/2012_11_14_00_world_various_fixes.sql
@@ -24,7 +24,7 @@ SET @Saber :=10042; -- Big green cat
-- Add SAI support for Corrupted Kitten
UPDATE `creature_template` SET `AIName`='SmartAI',`gossip_menu_id`=@SGossip,`npcflag`=1 WHERE `entry`=@CorruptedKitten;
UPDATE `creature_template` SET `AIName`='SmartAI',`gossip_menu_id`=@SGossip,`npcflag`=1 WHERE `entry`=@CommonKitten;
-DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@CorruptedKitten,@CommonKitten);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@CorruptedKitten, @CommonKitten);
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
(@CommonKitten,0,0,1,54,0,100,0,0,0,0,0,36,@CorruptedKitten,0,0,0,0,0,1,0,0,0,0,0,0,0,'Common Kitten - On spawn - Change template to corrupted one'),
(@CommonKitten,0,1,2,61,0,100,0,0,0,0,0,11,@SpellVisual,0,0,0,0,0,1,0,0,0,0,0,0,0,'Common Kitten - On OOC of 10 sec - Cast Corrupted Saber visual to self'),
diff --git a/sql/updates/world/2013_08_06_05_world_misc.sql b/sql/updates/world/2013_08_06_05_world_misc.sql
index 15193cc2d09..505cb81e882 100644
--- a/sql/updates/world/2013_08_06_05_world_misc.sql
+++ b/sql/updates/world/2013_08_06_05_world_misc.sql
@@ -88,7 +88,7 @@ INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position
(@NEXT+70, 30593, 571, 1, 64, 6236.617383, 113.980854, 380.351959, 5.6035, 5, 60, 0, 1);
-- Frostbrood Destroyers 5
-UPDATE `creature_template` SET `maxlevel`=80,`minlevel`=80,`exp`=2,`InhabitType`=7,`speed_walk`=3,`mindmg` = 1170,`dmg_multiplier` = 2,`attackpower` = 342,`maxdmg` = 3470,`movementtype`=1,`faction_A`=2068, `faction_H`=2068,`AIName`= 'SmartAI' WHERE `entry`= 30575;
+UPDATE `creature_template` SET `maxlevel`=80,`minlevel`=80,`exp`=2,`InhabitType`=7,`speed_walk`=3,`mindmg` = 1170,`dmg_multiplier` = 2,`attackpower` = 342,`maxdmg` = 3470,`movementtype`=1,`faction_A`=2068, `faction_H`=2068 WHERE `entry`= 30575;
DELETE FROM `creature` WHERE `id`=30575;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
(@NEXT+71, 30575,571,1,64,6097.870117, 58.331299, 380.506012, 0.138359, 75,20,1),
diff --git a/sql/updates/world/2013_08_09_00_world_sai.sql b/sql/updates/world/2013_08_09_00_world_sai.sql
new file mode 100644
index 00000000000..8fcdfc6d49e
--- /dev/null
+++ b/sql/updates/world/2013_08_09_00_world_sai.sql
@@ -0,0 +1,87 @@
+DELETE FROM `creature` WHERE `id`=27715;
+UPDATE `creature_template` SET `faction_a`=14, `faction_h`=14, `AIName`='SmartAI' WHERE `entry` IN (27715, 27716, 27717, 27718);
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (27727, 27726);
+
+DELETE FROM `creature_text` WHERE `entry` IN (27719, 27727, 27726);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+(27719,0,0,"Ladies and gentlemen! Well... let's just say you don't want to miss this one!",14,0,100,0,0,0,'Grennix Shivwiggle - Quest Accepted'),
+(27727,0,0,"You went behind my back. You neglected my orders. You will pay the price.",12,0,100,0,0,0,'Conqueror Krenna - Say 0'),
+(27727,1,1,"Enough talk. By the time I'm though with you, not even the worgs will go near your corpse.",12,0,100,0,0,0,'Conqueror Krenna - Say 1'),
+(27726,0,0,"I used good judgment when you showed non. I don't want to see you lead us into ruin, Krenna!",12,0,100,0,0,0,'Gorgonna - Say 0'),
+(27726,1,1,"It doesn't have to end this way, you know?",12,0,100,0,0,0,'Gorgonna - Say 1'),
+(27726,2,2,"We'll see about that",12,0,100,0,0,0,'Gorgonna - Say 2'),
+(27726,3,3,"Why... why sister? Why did it have to come to this?",12,0,100,0,0,0,'Gorgonna - Say 3');
+
+-- SAI
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (27715,27716,27717,27718,27727,27719,27726);
+DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (27715,27716,27717,27718,27727,27719,27726);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27715,27716,27717,27718,27727,27719,27726);
+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
+(27715,0,0,0,9,0,100,0,8,25,17000,24000,11,32323,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Ironhide - Cast Charge'),
+(27715,0,1,0,0,0,100,0,5000,7000,7000,9000,11,34298,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Ironhide - Cast Maul'),
+(27715,0,2,0,9,0,100,0,0,5,7000,11000,11,31279,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Ironhide - Cast Swipe'),
+(27715,0,3,0,7,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ironhide - Evade - Unseen'),
+(27715,0,4,0,7,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ironhide - Evade - Despawn'),
+(27715,0,5,0,6,0,100,0,0,0,0,0,15,12427,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Ironhide - Death - Credit'),
+(27715,0,6,0,6,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Ironhide - Death - Unseen'),
+(27715,0,7,0,7,0,100,0,0,0,0,0,6,12427,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Ironhide - Evade - Quest Fail'),
+
+-- Torgg Thundertotem 27716
+(27716,0,0,0,0,0,100,0,1000,3000,6000,8000,11,16033,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Torgg Thundertotem - Cast Chain Lightning'),
+(27716,0,1,0,0,0,100,0,10000,20000,5000,15000,11,15982,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Torgg Thundertotem - Cast Healing Wave'),
+(27716,0,2,0,0,0,100,0,0,0,21000,21000,11,31991,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Torgg Thundertotem - Cast Corrupted Nova Totem'),
+(27716,0,3,0,0,0,100,0,4000,4000,12000,12000,11,15501,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Torgg Thundertotem - Cast Earth Shock'),
+(27716,0,4,0,7,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Torgg Thundertotem - Evade - Unseen'),
+(27716,0,5,0,7,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Torgg Thundertotem - Evade - Despawn'),
+(27716,0,6,0,6,0,100,0,0,0,0,0,15,12428,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Torgg Thundertotem - Credit'),
+(27716,0,7,0,6,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Torgg Thundertotem - Death - Unseen'),
+(27716,0,8,0,7,0,100,0,0,0,0,0,6,12428,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Torgg Thundertotem - Evade - Quest Fail'),
+
+-- Rustblood 27717
+(27717,0,0,0,0,0,100,0,5000,7000,5000,7000,11,42746,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rustblood - Cast Cleave'),
+(27717,0,1,0,9,0,100,0,0,5,22000,30000,11,49398,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rustblood - Cast Knockback'),
+(27717,0,2,0,0,0,100,0,12000,15000,18000,21000,11,14102,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rustblood - Cast Head Smash'),
+(27717,0,3,0,0,0,100,0,0,3000,12000,12000,11,61893,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Rustblood - Cast Lightning Bolt'),
+(27717,0,4,0,7,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rustblood - Evade - Unseen'),
+(27717,0,5,0,7,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rustblood - Evade - Despawn'),
+(27717,0,6,0,6,0,100,0,0,0,0,0,15,12429,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Rustblood - Death - Credit'),
+(27717,0,7,0,6,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Rustblood - Death - Unseen'),
+(27717,0,8,0,7,0,100,0,0,0,0,0,6,12429,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Rustblood - Evade - Quest Fail'),
+
+-- Horgrenn Hellcleave 27718
+(27718,0,0,0,9,0,100,0,0,10,21000,29000,11,16508,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Cast Intimidating Roar'),
+(27718,0,1,0,0,0,100,0,3000,6000,8000,12000,11,15572,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Cast Sunder Armor'),
+(27718,0,2,0,0,0,100,0,9000,12000,12000,16000,11,39171,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Cast Mortal Strike'),
+(27718,0,3,0,0,0,100,0,13000,15000,13000,18000,11,38618,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Cast Whirlwind'),
+(27718,0,4,0,7,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Evade - Unseen'),
+(27718,0,5,0,7,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Evade - Despawn'),
+(27718,0,6,0,6,0,100,0,0,0,0,0,15,12430,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Death - Credit'),
+(27718,0,7,0,6,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Death - Unseen'),
+(27718,0,8,0,7,0,100,0,0,0,0,0,6,12430,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Horgrenn Hellcleave - Evade - Quest Fail'),
+
+-- Conqueror Krenna 27727
+(27727,0,0,0,9,0,100,0,0,5,7000,9000,11,15284,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Conqueror Krenna - Cast Cleave'),
+(27727,0,1,0,0,0,100,0,9000,12000,12000,17000,11,11430,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Conqueror Krenna - Cast Slam'),
+(27727,0,2,0,13,0,100,0,14000,17000,14000,17000,11,12555,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Conqueror Krenna - Cast Pummel'),
+(27727,0,3,0,13,0,100,0,3000,6000,6000,11000,11,34719,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Conqueror Krenna - Cast Fixate'),
+(27727,0,4,0,54,0,100,0,0,0,0,0,12,27726,3,75000,0,0,0,8,0,0,0,3244.50,-2340.56,92.14,6.27, 'Conqueror Krenna - Summon Gorgonna'),
+(27727,0,5,0,54,0,100,0,0,0,0,0,1,0,18000,0,0,0,0,1,0,0,0,0,0,0,0, 'Conqueror Krenna - Summoned - Say 0'),
+(27727,0,6,0,52,0,100,0,0,27727,0,0,1,1,6000,0,0,0,0,1,0,0,0,0,0,0,0, 'Conqueror Krenna - Say 0 - Say 1'),
+(27727,0,7,0,1,0,100,1,35000,35000,1,1,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Conqueror Krenna - OOC 35 Sec - Enemy'),
+(27727,0,8,0,6,0,100,0,0,0,0,0,15,12431,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Conqueror Krenna - Death - Credit'),
+(27727,0,9,0,6,0,100,0,0,0,0,0,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Conqueror Krenna - Death - Unseen'),
+(27727,0,10,0,7,0,100,0,0,0,0,0,6,12431,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Conqueror Krenna - Evade - Quest Fail'),
+
+-- Gorgonna 27726
+(27726,0,0,0,1,0,100,1,6000,6000,1,1,1,0,6000,0,0,0,0,1,0,0,0,0,0,0,0,'Gorgonna - OOC 6 Sec - Say 0'),
+(27726,0,1,0,52,0,100,0,0,27726,0,0,1,1,18000,0,0,0,0,1,0,0,0,0,0,0,0,'Gorgonna - Say 0 - Say 1'),
+(27726,0,2,0,52,0,100,0,1,27726,0,0,1,2,15000,0,0,0,0,1,0,0,0,0,0,0,0,'Gorgonna - Say 1 - Say 2'),
+(27726,0,3,0,52,0,100,0,2,27726,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Gorgonna - Say 2 - Say 3'),
+
+-- Grennix Shivwiggle 27719
+(27719, 0, 0, 0, 19, 0, 100, 0, 12427, 0, 0, 0, 12, 27715, 7, 0, 0, 0, 0, 8, 0, 0, 0, 3242.77, -2340.98, 92.34, 0.98, 'Grennix Shivwiggle - Accepted Quest - Summon 27715'),
+(27719, 0, 1, 0, 19, 0, 100, 0, 12428, 0, 0, 0, 12, 27716, 7, 0, 0, 0, 0, 8, 0, 0, 0, 3242.77, -2340.98, 92.34, 0.98, 'Grennix Shivwiggle - Accepted Quest - Summon 27716'),
+(27719, 0, 2, 0, 19, 0, 100, 0, 12429, 0, 0, 0, 12, 27717, 7, 0, 0, 0, 0, 8, 0, 0, 0, 3242.77, -2340.98, 92.34, 0.98, 'Grennix Shivwiggle - Accepted Quest - Summon 27717'),
+(27719, 0, 3, 0, 19, 0, 100, 0, 12430, 0, 0, 0, 12, 27718, 7, 0, 0, 0, 0, 8, 0, 0, 0, 3242.77, -2340.98, 92.34, 0.98, 'Grennix Shivwiggle - Accepted Quest - Summon 27718'),
+(27719, 0, 4, 0, 19, 0, 100, 0, 12431, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Grennix Shivwiggle - Accepted Quest - Say 0'),
+(27719, 0, 5, 0, 19, 0, 100, 0, 12431, 0, 0, 0, 12, 27727, 7, 0, 0, 0, 0, 8, 0, 0, 0, 3251.91, -2340.61, 91.86, 3.1, 'Grennix Shivwiggle - Accepted Quest - Summon 27727');
diff --git a/sql/updates/world/2013_08_09_01_world_sai.sql b/sql/updates/world/2013_08_09_01_world_sai.sql
new file mode 100644
index 00000000000..2f4a1d914da
--- /dev/null
+++ b/sql/updates/world/2013_08_09_01_world_sai.sql
@@ -0,0 +1 @@
+UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=7664 AND `source_type`=0 AND `id`IN (3,5,7) AND `link` IN (4,6,8);
diff --git a/sql/updates/world/2013_08_09_02_world_cond_335.sql b/sql/updates/world/2013_08_09_02_world_cond_335.sql
new file mode 100644
index 00000000000..ba4ce6d5a8f
--- /dev/null
+++ b/sql/updates/world/2013_08_09_02_world_cond_335.sql
@@ -0,0 +1,8 @@
+UPDATE `quest_template` SET `PrevQuestId`=0 WHERE `Id`=8280;
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19,20) and `SourceEntry`=8280;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(20, 0, 8280, 0, 0, 8, 0, 8275, 0, 0, 0, 0, 0, '', 'Securing the Supply Lines can be taken if Taking Back Silithus (Alliance) Complete'),
+(19, 0, 8280, 0, 0, 8, 0, 8275, 0, 0, 0, 0, 0, '', 'Securing the Supply Lines can be taken if Taking Back Silithus (Alliance) Complete'),
+(20, 0, 8280, 0, 1, 8, 0, 8276, 0, 0, 0, 0, 0, '', 'Securing the Supply Lines can be taken if Taking Back Silithus (Horde) Complete'),
+(19, 0, 8280, 0, 1, 8, 0, 8276, 0, 0, 0, 0, 0, '', 'Securing the Supply Lines can be taken if Taking Back Silithus (Horde) Complete');
diff --git a/sql/updates/world/2013_08_09_03_world_sai.sql b/sql/updates/world/2013_08_09_03_world_sai.sql
new file mode 100644
index 00000000000..71b44ff8966
--- /dev/null
+++ b/sql/updates/world/2013_08_09_03_world_sai.sql
@@ -0,0 +1,12 @@
+SET @RavenousJaws=29392;
+
+UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry`=@RavenousJaws;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=6509;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(17,0,6509,0,0,1,1,47172,0,0,0,0,0,0,'Cast Gore Bladder only if Cosmetic - Underwater Blood (no sound) aura is active');
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@RavenousJaws 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
+(@RavenousJaws,0,0,0,0,0,100,0,2000,5000,4000,7000,11,3391,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ravenous Jaws - In combat - cast Thrash'),
+(@RavenousJaws,0,1,0,6,0,100,0,0,0,0,0,11,47172,2,0,0,0,0,1,0,0,0,0,0,0,0,'Ravenous Jaws - On death - cast Underwater Blood'),
+(@RavenousJaws,0,2,3,8,0,100,0,6509,0,0,0,28,47172,0,0,0,0,0,1,0,0,0,0,0,0,0,'Ravenous Jaws - On spell hit Gore Bladder - remove aura'),
+(@RavenousJaws,0,3,0,61,0,100,0,0,0,0,0,33,29391,0,0,0,0,0,7,0,0,0,0,0,0,0,'Ravenous Jaws - Link previous event - give quest credit');
diff --git a/sql/updates/world/2013_08_09_04_world_sai.sql b/sql/updates/world/2013_08_09_04_world_sai.sql
new file mode 100644
index 00000000000..57312d76910
--- /dev/null
+++ b/sql/updates/world/2013_08_09_04_world_sai.sql
@@ -0,0 +1,22 @@
+UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` =23162;
+
+DELETE FROM `creature_ai_scripts` WHERE `creature_id` =23162;
+DELETE FROM `smart_scripts` WHERE `entryorguid` =23162 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
+(23162, 0, 0,1,11,0, 100, 0, 0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - On Spawn - Say Emote'),
+(23162, 0, 1,2,61,0, 100, 0, 0,0,0,0,19,33088,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - Linked with Previous Event - Set Unit Flags'),
+(23162, 0, 2,0,61,0, 100, 0, 0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - Linked with Previous Event - Set Phase 1'),
+(23162, 0, 3,0, 0,1, 100, 0, 6500,9500,8500,11500,11,40420,0,0,0,0,0,2,0,0,0,0,0,0,0,'Vakkiz the Windrager - IC - Cast Lightning Breath (Phase 1)'),
+(23162, 0, 4,5, 2,1, 100, 0, 0,40,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - On 40% HP - Say Emote'),
+(23162, 0, 5,6,61,1, 100, 0, 0,0,0,0,3,0,21296,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - Linked with Previous Event - Change Model'),
+(23162, 0, 6,0,61,1, 100, 0, 0,0,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - Linked with Previous Event - Set Phase 2'),
+(23162, 0, 7,0, 0,2, 100, 0, 3000,7000,5000,9000,11,40419,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - IC - Cast Bone Spray (Phase 2)'),
+(23162, 0, 8,9, 7,0, 100, 0, 0,0,0,0,19,33088,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - On Evade - Set Unit Flags'),
+(23162, 0, 9,10,61,0, 100, 0, 0,0,0,0,3,0,20837,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - Linked with Previous Event - Set Model'),
+(23162, 0,10,0,61,0, 100, 0, 0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vakkiz the Windrager - Linked with Previous Event - Set Phase 1');
+
+DELETE FROM `creature_text` WHERE `entry` =23162;
+DELETE FROM `creature_ai_texts` WHERE `entry` IN (-234,-235);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+(23162, 0, 0, 'Furious winds envelop Vakkiz as he writhes menacingly towards you.', 16, 0, 100, 0, 0, 0, 'Vakkiz the Windrager'),
+(23162, 1, 0, '%s''s flesh shatters in an unearthly rage!', 16, 0, 100, 0, 0, 0, 'Vakkiz the Windrager');
diff --git a/sql/updates/world/2013_08_09_05_world_sai.sql b/sql/updates/world/2013_08_09_05_world_sai.sql
new file mode 100644
index 00000000000..889a0351181
--- /dev/null
+++ b/sql/updates/world/2013_08_09_05_world_sai.sql
@@ -0,0 +1,29 @@
+SET @DIBear=30292; -- Dead Icemaw Bear
+SET @LJBunny=30366; -- Lure Jormuttar Bunny
+
+-- WTF?! Spell Carve Bear Flank have no triggered spell
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=56562;
+-- Set Spell script
+DELETE FROM `spell_script_names` WHERE `spell_id`=56565;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(56565,'spell_q13011_bear_flank_master');
+-- Update Item's Target requirement
+UPDATE `conditions` SET `ConditionTypeOrReference`=31 ,`ConditionTarget`=1 ,`ConditionValue1` =3,`ConditionValue2`=@DIBear WHERE `SourceTypeOrReferenceId`=17 AND `SourceGroup`=0 AND `SourceEntry`=56562;
+-- Update creature_templates to use SAI
+UPDATE `creature_template` SET `ainame`='SmartAI' WHERE `entry` IN (@DIBear,@LJBunny);
+-- Update Icy Crater phaseMask
+UPDATE `gameobject` SET `phaseMask`=4 WHERE `guid`=99730;
+-- Add Dead Icemaw Bear SAI
+DELETE FROM `smart_scripts` WHERE `entryorguid`=30292 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
+(@DIBear,0,0,1,8,0,100,0,56562,0,0,0,11,56565,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dead Icemaw Bear - On Spell Hit - Cast Bear Flank Master'),
+(@DIBear,0,1,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dead Icemaw Bear - Link With Previous Event - Despawn'),
+(@DIBear,0,2,0,8,0,100,0,56569,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dead Icemaw Bear - On Spell Hit - Despawn');
+-- Add Lure Jormuttar Bunny SAI
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@LJBunny 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
+(@LJBunny,0,0,0,11,0,100,0,0,0,0,0,12,30340,2,120000,0,0,0,1,0,0,0,0,0,0,0,'Lure Jormuttar Bunny - On Spawn - Summon Jormuttar');
+-- Add Dead Icemaw Bear creature_text
+DELETE FROM `creature_text` WHERE `entry`=30292;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES
+(@DIBear,0,0,'This bear\'s flank is frozen solid... try again.',42,0,0,0,0,0,'');
diff --git a/sql/updates/world/2013_08_09_06_world_ainame.sql b/sql/updates/world/2013_08_09_06_world_ainame.sql
new file mode 100644
index 00000000000..fd25f912bd7
--- /dev/null
+++ b/sql/updates/world/2013_08_09_06_world_ainame.sql
@@ -0,0 +1,8 @@
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=29400; -- Corrupted Scarlet Onslaught (EAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=29403; -- Onslaught Gryphon (SAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=30210; -- Hodir's Helm KC Bunny (SAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=30575; -- Frostbrood Destroyer (SAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=30841; -- Death Gate (Mograine) (SAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=30850; -- Death Gate (Munch) (SAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=30852; -- Death Gate (Jayde) (SAI)
+UPDATE `creature_template` SET `AIName`='' WHERE `entry`=34885; -- Dame Evniki Kapsalis (SAI)
diff --git a/sql/updates/world/2013_08_09_07_world_sai.sql b/sql/updates/world/2013_08_09_07_world_sai.sql
new file mode 100644
index 00000000000..60699267c4f
--- /dev/null
+++ b/sql/updates/world/2013_08_09_07_world_sai.sql
@@ -0,0 +1,41 @@
+-- Random comment ™
+-- Corrupted Scarlet Onslaught
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29400;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 29400;
+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
+(29400,0,0,0,0,0,100,0,2000,15000,30000,45000,11,38056,2,0,0,0,0,2,0,0,0,0,0,0,0,'Corrupted Scarlet Onslaught - IC - Flesh Rip');
+
+-- Onslaught Raven Bishop
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29338;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=29338;
+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
+(29338,0,0,0,4,0,100,1,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Set Phase 1 - On Aggro'),
+(29338,0,1,0,4,1,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Stop Moving - On Aggro'),
+(29338,0,2,0,4,1,100,1,0,0,0,0,11,50740,0,0,0,0,0,2,0,0,0,0,0,0,0,'Raven Bishop - Cast bolt on Aggro'),
+(29338,0,3,0,9,1,100,0,0,40,3400,4700,11,50740,0,0,0,0,0,2,0,0,0,0,0,0,0,'Raven Bishop - Cast Raven Flock'),
+(29338,0,4,0,9,1,100,0,40,100,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Start Moving - When not in flock Range'),
+(29338,0,5,0,9,1,100,0,10,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Stop Moving - 15 Yards'),
+(29338,0,6,0,9,1,100,0,0,40,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Stop Moving - When in flock Range'),
+(29338,0,7,0,3,1,100,0,0,15,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Set Phase 2 - 15% Mana'),
+(29338,0,8,0,3,2,100,0,0,15,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Start Moving - 15% Mana'),
+(29338,0,9,0,3,2,100,0,30,100,100,100,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raven Bishop - Set Phase 1 - When Mana is above 30%'),
+(29338,0,10,0,2,1,100,0,10,50,2000,8000,11,50750,0,0,0,0,0,2,0,0,0,0,0,0,0,'Raven Bishop - Health Pct - Cast Raven Heal');
+
+-- Onslaught Paladin
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29329;
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 29329;
+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
+(29329,0,0,0,4,0,100,0,0,0,0,0,11,19131,2,0,0,0,0,2,0,0,0,0,0,0,0,'Onslaught Paladin - On Aggro - Cast Charge'),
+(29329,0,1,0,0,0,100,0,2000,9000,17000,30000,11,32774,2,0,0,0,0,2,0,0,0,0,0,0,0,'Onslaught Paladin - IC - Avenger''s Shield');
+
+-- Onslaught Harbor Guard
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=29330;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=29330;
+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
+(29330,0,0,0,4,0,100,1,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Harbor Guard - Set Phase 1 - On Aggro'),
+(29330,0,1,0,4,1,100,1,0,0,0,0,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,'Harbor Guard - Cast Shoot - On Aggro'),
+(29330,0,2,0,9,1,100,0,0,40,3400,4700,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,'Harbor Guard - Cast Shoot'),
+(29330,0,3,0,9,1,100,0,40,100,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Harbor Guard - Start Moving - When not in Shoot range'),
+(29330,0,4,0,9,1,100,0,10,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Harbor Guard - Stop Moving - 15 Yards'),
+(29330,0,5,0,9,1,100,0,0,40,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Harbor Guard - Stop Moving - When in bolt Range'),
+(29330,0,6,0,0,1,100,0,8000,8000,12000,14000,11,50750,0,0,0,0,0,1,0,0,0,0,0,0,0,'Harbor Guard - IC - Cast Frost Shot');
diff --git a/sql/updates/world/2013_08_09_08_world_creature_template.sql b/sql/updates/world/2013_08_09_08_world_creature_template.sql
new file mode 100644
index 00000000000..ab3b4fc2837
--- /dev/null
+++ b/sql/updates/world/2013_08_09_08_world_creature_template.sql
@@ -0,0 +1,7 @@
+UPDATE `creature_template` SET `ScriptName`='npc_pet_dk_ebon_gargoyle' WHERE `ScriptName`='npc_ebon_gargoyle';
+UPDATE `creature_template` SET `ScriptName`='npc_pet_hunter_snake_trap' WHERE `ScriptName`='npc_snake_trap_serpents';
+UPDATE `creature_template` SET `ScriptName`='npc_pet_mage_mirror_image' WHERE `ScriptName`='npc_mirror_image';
+UPDATE `creature_template` SET `ScriptName`='npc_pet_pri_lightwell' WHERE `ScriptName`='npc_lightwell';
+UPDATE `creature_template` SET `ScriptName`='npc_pet_pri_shadowfiend' WHERE `ScriptName`='npc_shadowfiend';
+UPDATE `creature_template` SET `ScriptName`='npc_pet_shaman_earth_elemental' WHERE `ScriptName`='npc_earth_elemental';
+UPDATE `creature_template` SET `ScriptName`='npc_pet_shaman_fire_elemental' WHERE `ScriptName`='npc_fire_elemental';
diff --git a/sql/updates/world/2013_08_09_08_world_go_template.sql b/sql/updates/world/2013_08_09_08_world_go_template.sql
new file mode 100644
index 00000000000..958d0125994
--- /dev/null
+++ b/sql/updates/world/2013_08_09_08_world_go_template.sql
@@ -0,0 +1,2 @@
+-- Change SpellFocus GO radius to 100y
+UPDATE `gameobject_template` SET `data1`=100 WHERE `entry`=300209;
diff --git a/sql/updates/world/2013_08_09_09_world_sai.sql b/sql/updates/world/2013_08_09_09_world_sai.sql
new file mode 100644
index 00000000000..619f2fa9d3f
--- /dev/null
+++ b/sql/updates/world/2013_08_09_09_world_sai.sql
@@ -0,0 +1,25 @@
+-- Archmage Pentarus SAI
+SET @ENTRY := 28160; -- NPC entry
+SET @SPELL := 50859; -- Flight to Sholazar
+UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid`=@ENTRY*100;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,62,0,100,0,10024,0,0,0,80,@ENTRY*100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Archmage Pentarus - On gossip option select - run script'),
+(@ENTRY*100,9,0,0,0,0,100,0,0,0,0,0,11,@SPELL,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Archmage Pentarus - Script - Cast Flight to Sholazar on player'),
+(@ENTRY*100,9,1,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Archmage Pentarus - Script - say 0');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=28160 AND `groupid`=0;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(28160,0,0, 'I''ll send you on my flying machine. Keep your eyes peeled for clues about what might''ve happened to Hemet!',12,0,100,25,0,0, 'Archmage Pentarus');
+-- Gossip conditions for Archmage Pentarus
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=10024;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,10024,0,0,28,12521,0,0,0,'','Show gossip option if player has quest Where in the World is Hemet Nesingwary?');
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=10024 AND `id`=1;
+-- Add spell target position
+DELETE FROM `spell_target_position` WHERE `id`=50859;
+INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES
+(50859,571,5832.892,482.8708,658.2753,0.9121326);
+-- Update Archmage Pentarus' Flying Machine
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=28192;
diff --git a/sql/updates/world/2013_08_09_10_world_sai.sql b/sql/updates/world/2013_08_09_10_world_sai.sql
new file mode 100644
index 00000000000..db48e519dbd
--- /dev/null
+++ b/sql/updates/world/2013_08_09_10_world_sai.sql
@@ -0,0 +1,22 @@
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (16977,16978);
+DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (16977,16978); -- clean old EAI
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (16977, 16978) 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
+(16977,0,0,0,25,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - prevent combat movement on spawn'),
+(16977,0,1,0,4,0,100,0,0,0,0,0,11,20823,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Arch Mage Xintor - cast fireball on aggro'),
+(16977,0,2,0,4,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - set phase 1 on aggro'),
+(16977,0,3,0,9,1,100,0,0,40,2400,3800,11,20823,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Arch Mage Xintor - cast fireball'),
+(16977,0,4,0,3,1,100,0,0,15,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - start normal attack on 15% mana'),
+(16977,0,5,0,3,1,100,0,0,15,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - set phase 2 on 15% mana'),
+(16977,0,6,0,9,1,100,0,35,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - combatmovement'),
+(16977,0,7,0,9,1,100,0,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - combatmovement'),
+(16977,0,8,0,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - combatmovement'),
+(16977,0,9,0,3,1,100,0,30,100,100,100,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - set phase 1 on 30% mana'),
+(16977,0,10,0,0,1,50,0,6000,8000,9000,12000,11,15735,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Arch Mage Xintor - cast arcane missles'),
+(16977,0,11,0,2,0,100,0,0,50,0,0,11,33245,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arch Mage Xintor - 50% hp - cast ice barrier'),
+(16977,0,12,0,2,0,100,0,0,50,0,0,11,29458,0,0,0,0,0,5,0,0,0,0,0,0,0, 'Arch Mage Xintor - 50% hp - cast blizzard'),
+(16977,0,13,0,2,0,100,0,0,15,0,0,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Arch Mage Xintor - flee on 15% hp'),
+(16977,0,14,0,7,0,100,0,0,0,0,0,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Arch Mage Xintor - set phase 0 on evade'),
+(16978,0,0,0,0,0,50,0,4000,4000,8000,8000,11,8242,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Lieutenant Commander Thalvos - Cast Shield Slam'),
+(16978,0,1,0,0,0,50,0,5000,5000,10000,10000,11,20823,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Lieutenant Commander Thalvos - Cast Strike'),
+(16978,0,2,0,25,0,100,0,0,0,0,0,11,27978,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Lieutenant Commander Thalvos - Shroud of Death');
diff --git a/sql/updates/world/2013_08_09_11_world_disables.sql b/sql/updates/world/2013_08_09_11_world_disables.sql
new file mode 100644
index 00000000000..81411aa00a2
--- /dev/null
+++ b/sql/updates/world/2013_08_09_11_world_disables.sql
@@ -0,0 +1,4 @@
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (38729,38736);
+INSERT INTO `disables`(`sourceType`,`entry`,`flags`,`comment`) VALUES
+(0,38729,64,'Ignore LOS on Rod of Purification'),
+(0,38736,64,'Ignore LOS on Rod of Purification');
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 1a445435d4e..261c4166a15 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -250,9 +250,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (IsUnit(*itr))
{
- (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.range > 0 ? true : false);
+ (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0 ? true : false);
TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u",
- (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound, e.action.sound.range);
+ (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound, e.action.sound.onlySelf);
}
}
@@ -1131,13 +1131,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
case SMART_ACTION_SET_VISIBILITY:
{
if (me)
- me->SetVisible(e.action.visibility.state ? true : false);
+ me->SetVisible(e.action.visibility.state);
break;
}
case SMART_ACTION_SET_ACTIVE:
{
- if (GetBaseObject())
- GetBaseObject()->setActive(true);
+ if (WorldObject* baseObj = GetBaseObject())
+ baseObj->setActive(e.action.active.state);
break;
}
case SMART_ACTION_ATTACK_START:
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index fe78c4fce06..f26d3bb328a 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -621,11 +621,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_ACTION_SOUND:
if (!IsSoundValid(e, e.action.sound.sound))
return false;
- if (e.action.sound.range > TEXT_RANGE_WORLD)
- {
- TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Text Range %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.sound.range);
- return false;
- }
break;
case SMART_ACTION_SET_EMOTE_STATE:
case SMART_ACTION_PLAY_EMOTE:
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index ede8101b522..cf208aa91df 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -386,7 +386,7 @@ enum SMART_ACTION
SMART_ACTION_TALK = 1, // groupID from creature_text, duration to wait before TEXT_OVER event is triggered
SMART_ACTION_SET_FACTION = 2, // FactionId (or 0 for default)
SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL = 3, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to demorph)
- SMART_ACTION_SOUND = 4, // SoundId, TextRange
+ SMART_ACTION_SOUND = 4, // SoundId, onlySelf
SMART_ACTION_PLAY_EMOTE = 5, // EmoteId
SMART_ACTION_FAIL_QUEST = 6, // QuestID
SMART_ACTION_ADD_QUEST = 7, // QuestID
@@ -430,7 +430,7 @@ enum SMART_ACTION
SMART_ACTION_SET_DATA = 45, // Field, Data (only creature @todo)
SMART_ACTION_MOVE_FORWARD = 46, // distance
SMART_ACTION_SET_VISIBILITY = 47, // on/off
- SMART_ACTION_SET_ACTIVE = 48, // No Params
+ SMART_ACTION_SET_ACTIVE = 48, // on/off
SMART_ACTION_ATTACK_START = 49, //
SMART_ACTION_SUMMON_GO = 50, // GameObjectID, DespawnTime in ms,
SMART_ACTION_KILL_UNIT = 51, //
@@ -520,7 +520,7 @@ struct SmartAction
struct
{
uint32 sound;
- uint32 range;
+ uint32 onlySelf;
} sound;
struct
@@ -728,6 +728,11 @@ struct SmartAction
} summonGO;
struct
+ {
+ uint32 state;
+ } active;
+
+ struct
{
uint32 id;
} taxi;
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index 209d2527e0d..10ccd6a77f3 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -907,6 +907,9 @@ namespace Trinity
AnyGroupedUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool raid) : _source(obj), _refUnit(funit), _range(range), _raid(raid) {}
bool operator()(Unit* u)
{
+ if (G3D::fuzzyEq(_range, 0))
+ return false;
+
if (_raid)
{
if (!_refUnit->IsInRaidWith(u))
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index 6d12a073824..d55ada7d090 100644
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -623,6 +623,13 @@ void AddSC_kezan();
// Events
void AddSC_event_childrens_week();
+// Pets
+void AddSC_deathknight_pet_scripts();
+void AddSC_hunter_pet_scripts();
+void AddSC_mage_pet_scripts();
+void AddSC_priest_pet_scripts();
+void AddSC_shaman_pet_scripts();
+
// battlegrounds
// outdoor pvp
@@ -651,6 +658,7 @@ void AddScripts()
AddNorthrendScripts();
AddMaelstromScripts();
AddEventScripts();
+ AddPetScripts();
AddBattlegroundScripts();
AddOutdoorPvPScripts();
AddCustomScripts();
@@ -1299,6 +1307,17 @@ void AddEventScripts()
#endif
}
+void AddPetScripts()
+{
+#ifdef SCRIPTS
+ AddSC_deathknight_pet_scripts();
+ AddSC_hunter_pet_scripts();
+ AddSC_mage_pet_scripts();
+ AddSC_priest_pet_scripts();
+ AddSC_shaman_pet_scripts();
+#endif
+}
+
void AddOutdoorPvPScripts()
{
#ifdef SCRIPTS
diff --git a/src/server/game/Scripting/ScriptLoader.h b/src/server/game/Scripting/ScriptLoader.h
index 5e1b829798e..7edba0445c4 100644
--- a/src/server/game/Scripting/ScriptLoader.h
+++ b/src/server/game/Scripting/ScriptLoader.h
@@ -29,6 +29,7 @@ void AddOutlandScripts();
void AddNorthrendScripts();
void AddMaelstromScripts();
void AddEventScripts();
+void AddPetScripts();
void AddBattlegroundScripts();
void AddOutdoorPvPScripts();
void AddCustomScripts();
diff --git a/src/server/scripts/CMakeLists.txt b/src/server/scripts/CMakeLists.txt
index 55abbec3025..5a483ccea33 100644
--- a/src/server/scripts/CMakeLists.txt
+++ b/src/server/scripts/CMakeLists.txt
@@ -37,8 +37,9 @@ if(SCRIPTS)
include(Kalimdor/CMakeLists.txt)
include(Outland/CMakeLists.txt)
include(Northrend/CMakeLists.txt)
- include(Events/CMakeLists.txt)
include(Maelstrom/CMakeLists.txt)
+ include(Events/CMakeLists.txt)
+ include(Pet/CMakeLists.txt)
endif()
message(STATUS "SCRIPT PREPARATION COMPLETE")
diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt
new file mode 100644
index 00000000000..b4a8eea77d8
--- /dev/null
+++ b/src/server/scripts/Pet/CMakeLists.txt
@@ -0,0 +1,20 @@
+# Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+set(scripts_STAT_SRCS
+ ${scripts_STAT_SRCS}
+ Pet/pet_dk.cpp
+ Pet/pet_hunter.cpp
+ Pet/pet_mage.cpp
+ Pet/pet_priest.cpp
+ Pet/pet_shaman.cpp
+)
+
+message(" -> Prepared: Pet")
diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp
new file mode 100644
index 00000000000..aac2eb0f89e
--- /dev/null
+++ b/src/server/scripts/Pet/pet_dk.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "npc_pet_dk_".
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "CombatAI.h"
+#include "GridNotifiers.h"
+
+enum DeathKnightSpells
+{
+ SPELL_DK_SUMMON_GARGOYLE_1 = 49206,
+ SPELL_DK_SUMMON_GARGOYLE_2 = 50514,
+ SPELL_DK_DISMISS_GARGOYLE = 50515,
+ SPELL_DK_SANCTUARY = 54661
+};
+
+class npc_pet_dk_ebon_gargoyle : public CreatureScript
+{
+ public:
+ npc_pet_dk_ebon_gargoyle() : CreatureScript("npc_pet_dk_ebon_gargoyle") { }
+
+ struct npc_pet_dk_ebon_gargoyleAI : CasterAI
+ {
+ npc_pet_dk_ebon_gargoyleAI(Creature* creature) : CasterAI(creature) { }
+
+ void InitializeAI() OVERRIDE
+ {
+ CasterAI::InitializeAI();
+ uint64 ownerGuid = me->GetOwnerGUID();
+ if (!ownerGuid)
+ return;
+
+ // Not needed to be despawned now
+ _despawnTimer = 0;
+ // Find victim of Summon Gargoyle spell
+ std::list<Unit*> targets;
+ Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30.0f);
+ Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, targets, u_check);
+ me->VisitNearbyObject(30.0f, searcher);
+ for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
+ if ((*iter)->GetAura(SPELL_DK_SUMMON_GARGOYLE_1, ownerGuid))
+ {
+ me->Attack((*iter), false);
+ break;
+ }
+ }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ // Stop Feeding Gargoyle when it dies
+ if (Unit* owner = me->GetOwner())
+ owner->RemoveAurasDueToSpell(SPELL_DK_SUMMON_GARGOYLE_2);
+ }
+
+ // Fly away when dismissed
+ void SpellHit(Unit* source, SpellInfo const* spell) OVERRIDE
+ {
+ if (spell->Id != SPELL_DK_DISMISS_GARGOYLE || !me->IsAlive())
+ return;
+
+ Unit* owner = me->GetOwner();
+ if (!owner || owner != source)
+ return;
+
+ // Stop Fighting
+ me->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE, true);
+
+ // Sanctuary
+ me->CastSpell(me, SPELL_DK_SANCTUARY, true);
+ me->SetReactState(REACT_PASSIVE);
+
+ //! HACK: Creature's can't have MOVEMENTFLAG_FLYING
+ // Fly Away
+ me->SetCanFly(true);
+ me->SetSpeed(MOVE_FLIGHT, 0.75f, true);
+ me->SetSpeed(MOVE_RUN, 0.75f, true);
+ float x = me->GetPositionX() + 20 * std::cos(me->GetOrientation());
+ float y = me->GetPositionY() + 20 * std::sin(me->GetOrientation());
+ float z = me->GetPositionZ() + 40;
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MovePoint(0, x, y, z);
+
+ // Despawn as soon as possible
+ _despawnTimer = 4 * IN_MILLISECONDS;
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (_despawnTimer > 0)
+ {
+ if (_despawnTimer > diff)
+ _despawnTimer -= diff;
+ else
+ me->DespawnOrUnsummon();
+ return;
+ }
+
+ CasterAI::UpdateAI(diff);
+ }
+
+ private:
+ uint32 _despawnTimer;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_dk_ebon_gargoyleAI(creature);
+ }
+};
+
+void AddSC_deathknight_pet_scripts()
+{
+ new npc_pet_dk_ebon_gargoyle();
+}
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp
new file mode 100644
index 00000000000..80551be9131
--- /dev/null
+++ b/src/server/scripts/Pet/pet_hunter.cpp
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "npc_pet_hun_".
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+
+enum HunterSpells
+{
+ SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper
+ SPELL_HUNTER_DEADLY_POISON = 34655, // Venomous Snake
+ SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper
+};
+
+enum HunterCreatures
+{
+ NPC_HUNTER_VIPER = 19921
+};
+
+class npc_pet_hunter_snake_trap : public CreatureScript
+{
+ public:
+ npc_pet_hunter_snake_trap() : CreatureScript("npc_pet_hunter_snake_trap") { }
+
+ struct npc_pet_hunter_snake_trapAI : public ScriptedAI
+ {
+ npc_pet_hunter_snake_trapAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void EnterCombat(Unit* /*who*/) OVERRIDE { }
+
+ void Reset() OVERRIDE
+ {
+ _spellTimer = 0;
+
+ CreatureTemplate const* Info = me->GetCreatureTemplate();
+
+ _isViper = Info->Entry == NPC_HUNTER_VIPER ? true : false;
+
+ me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f));
+ // Add delta to make them not all hit the same time
+ uint32 delta = (rand() % 7) * 100;
+ me->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, float(Info->baseattacktime + delta));
+ me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower));
+
+ // Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target
+ if (!me->GetVictim() && me->IsSummon())
+ if (Unit* Owner = me->ToTempSummon()->GetSummoner())
+ if (Owner->getAttackerForHelper())
+ AttackStart(Owner->getAttackerForHelper());
+ }
+
+ // Redefined for random target selection:
+ void MoveInLineOfSight(Unit* who) OVERRIDE
+ {
+ if (!me->GetVictim() && me->CanCreatureAttack(who))
+ {
+ if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
+ return;
+
+ float attackRadius = me->GetAttackDistance(who);
+ if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
+ {
+ if (!(rand() % 5))
+ {
+ me->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
+ _spellTimer = (rand() % 10) * 100;
+ AttackStart(who);
+ }
+ }
+ }
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me))
+ {
+ me->InterruptNonMeleeSpells(false);
+ return;
+ }
+
+ if (_spellTimer <= diff)
+ {
+ if (_isViper) // Viper
+ {
+ if (urand(0, 2) == 0) //33% chance to cast
+ {
+ uint32 spell;
+ if (urand(0, 1) == 0)
+ spell = SPELL_HUNTER_MIND_NUMBING_POISON;
+ else
+ spell = SPELL_HUNTER_CRIPPLING_POISON;
+
+ DoCastVictim(spell);
+ }
+
+ _spellTimer = 3000;
+ }
+ else // Venomous Snake
+ {
+ if (urand(0, 2) == 0) // 33% chance to cast
+ DoCastVictim(SPELL_HUNTER_DEADLY_POISON);
+ _spellTimer = 1500 + (rand() % 5) * 100;
+ }
+ }
+ else
+ _spellTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ bool _isViper;
+ uint32 _spellTimer;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_hunter_snake_trapAI(creature);
+ }
+};
+
+void AddSC_hunter_pet_scripts()
+{
+ new npc_pet_hunter_snake_trap();
+}
diff --git a/src/server/scripts/Pet/pet_mage.cpp b/src/server/scripts/Pet/pet_mage.cpp
new file mode 100644
index 00000000000..85247b29f84
--- /dev/null
+++ b/src/server/scripts/Pet/pet_mage.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "npc_pet_mag_".
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "CombatAI.h"
+#include "Pet.h"
+
+enum MageSpells
+{
+ SPELL_MAGE_CLONE_ME = 45204,
+ SPELL_MAGE_MASTERS_THREAT_LIST = 58838
+};
+
+class npc_pet_mage_mirror_image : public CreatureScript
+{
+ public:
+ npc_pet_mage_mirror_image() : CreatureScript("npc_pet_mage_mirror_image") { }
+
+ struct npc_pet_mage_mirror_imageAI : CasterAI
+ {
+ npc_pet_mage_mirror_imageAI(Creature* creature) : CasterAI(creature) { }
+
+ void InitializeAI() OVERRIDE
+ {
+ CasterAI::InitializeAI();
+ Unit* owner = me->GetOwner();
+ if (!owner)
+ return;
+ // Inherit Master's Threat List (not yet implemented)
+ owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true);
+ // here mirror image casts on summoner spell (not present in client dbc) 49866
+ // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcasted by mirror images (stats related?)
+ // Clone Me!
+ owner->CastSpell(me, SPELL_MAGE_CLONE_ME, false);
+ }
+
+ // Do not reload Creature templates on evade mode enter - prevent visual lost
+ void EnterEvadeMode() OVERRIDE
+ {
+ if (me->IsInEvadeMode() || !me->IsAlive())
+ return;
+
+ Unit* owner = me->GetCharmerOrOwner();
+
+ me->CombatStop(true);
+ if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW))
+ {
+ me->GetMotionMaster()->Clear(false);
+ me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
+ }
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_mage_mirror_imageAI(creature);
+ }
+};
+
+void AddSC_mage_pet_scripts()
+{
+ new npc_pet_mage_mirror_image();
+}
diff --git a/src/server/scripts/Pet/pet_priest.cpp b/src/server/scripts/Pet/pet_priest.cpp
new file mode 100644
index 00000000000..4b565aaec10
--- /dev/null
+++ b/src/server/scripts/Pet/pet_priest.cpp
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "npc_pet_pri_".
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "PassiveAI.h"
+#include "PetAI.h"
+
+enum PriestSpells
+{
+ SPELL_PRIEST_GLYPH_OF_SHADOWFIEND = 58228,
+ SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA = 58227,
+ SPELL_PRIEST_LIGHTWELL_CHARGES = 59907
+};
+
+class npc_pet_pri_lightwell : public CreatureScript
+{
+ public:
+ npc_pet_pri_lightwell() : CreatureScript("npc_pet_pri_lightwell") { }
+
+ struct npc_pet_pri_lightwellAI : public PassiveAI
+ {
+ npc_pet_pri_lightwellAI(Creature* creature) : PassiveAI(creature)
+ {
+ DoCast(me, SPELL_PRIEST_LIGHTWELL_CHARGES, false);
+ }
+
+ void EnterEvadeMode() OVERRIDE
+ {
+ if (!me->IsAlive())
+ return;
+
+ me->DeleteThreatList();
+ me->CombatStop(true);
+ me->ResetPlayerDamageReq();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_pri_lightwellAI(creature);
+ }
+};
+
+class npc_pet_pri_shadowfiend : public CreatureScript
+{
+ public:
+ npc_pet_pri_shadowfiend() : CreatureScript("npc_pet_pri_shadowfiend") { }
+
+ struct npc_pet_pri_shadowfiendAI : public PetAI
+ {
+ npc_pet_pri_shadowfiendAI(Creature* creature) : PetAI(creature) { }
+
+ void JustDied(Unit* /*killer*/) OVERRIDE
+ {
+ if (me->IsSummon())
+ if (Unit* owner = me->ToTempSummon()->GetSummoner())
+ if (owner->HasAura(SPELL_PRIEST_GLYPH_OF_SHADOWFIEND))
+ owner->CastSpell(owner, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_pri_shadowfiendAI(creature);
+ }
+};
+
+void AddSC_priest_pet_scripts()
+{
+ new npc_pet_pri_lightwell();
+ new npc_pet_pri_shadowfiend();
+}
diff --git a/src/server/scripts/Pet/pet_shaman.cpp b/src/server/scripts/Pet/pet_shaman.cpp
new file mode 100644
index 00000000000..c770be86692
--- /dev/null
+++ b/src/server/scripts/Pet/pet_shaman.cpp
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * Ordered alphabetically using scriptname.
+ * Scriptnames of files in this file should be prefixed with "npc_pet_sha_".
+ */
+
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+
+enum ShamanSpells
+{
+ SPELL_SHAMAN_ANGEREDEARTH = 36213,
+ SPELL_SHAMAN_FIREBLAST = 57984,
+ SPELL_SHAMAN_FIRENOVA = 12470,
+ SPELL_SHAMAN_FIRESHIELD = 13376
+};
+
+enum ShamanEvents
+{
+ // Earth Elemental
+ EVENT_SHAMAN_ANGEREDEARTH = 1,
+ // Fire Elemental
+ EVENT_SHAMAN_FIRENOVA = 1,
+ EVENT_SHAMAN_FIRESHIELD = 2,
+ EVENT_SHAMAN_FIREBLAST = 3
+};
+
+class npc_pet_shaman_earth_elemental : public CreatureScript
+{
+ public:
+ npc_pet_shaman_earth_elemental() : CreatureScript("npc_pet_shaman_earth_elemental") { }
+
+ struct npc_pet_shaman_earth_elementalAI : public ScriptedAI
+ {
+ npc_pet_shaman_earth_elementalAI(Creature* creature) : ScriptedAI(creature) { }
+
+
+ void Reset() OVERRIDE
+ {
+ _events.Reset();
+ _events.ScheduleEvent(EVENT_SHAMAN_ANGEREDEARTH, 0);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (_events.ExecuteEvent() == EVENT_SHAMAN_ANGEREDEARTH)
+ {
+ DoCastVictim(SPELL_SHAMAN_ANGEREDEARTH);
+ _events.ScheduleEvent(EVENT_SHAMAN_ANGEREDEARTH, urand(5000, 20000));
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_shaman_earth_elementalAI(creature);
+ }
+};
+
+class npc_pet_shaman_fire_elemental : public CreatureScript
+{
+ public:
+ npc_pet_shaman_fire_elemental() : CreatureScript("npc_pet_shaman_fire_elemental") { }
+
+ struct npc_pet_shaman_fire_elementalAI : public ScriptedAI
+ {
+ npc_pet_shaman_fire_elementalAI(Creature* creature) : ScriptedAI(creature) { }
+
+ void Reset() OVERRIDE
+ {
+ _events.Reset();
+ _events.ScheduleEvent(EVENT_SHAMAN_FIRENOVA, urand(5000, 20000));
+ _events.ScheduleEvent(EVENT_SHAMAN_FIREBLAST, urand(5000, 20000));
+ _events.ScheduleEvent(EVENT_SHAMAN_FIRESHIELD, 0);
+ me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
+ }
+
+ void UpdateAI(uint32 diff) OVERRIDE
+ {
+ if (!UpdateVictim())
+ return;
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_SHAMAN_FIRENOVA:
+ DoCastVictim(SPELL_SHAMAN_FIRENOVA);
+ _events.ScheduleEvent(EVENT_SHAMAN_FIRENOVA, urand(5000, 20000));
+ break;
+ case EVENT_SHAMAN_FIRESHIELD:
+ DoCastVictim(SPELL_SHAMAN_FIRESHIELD);
+ _events.ScheduleEvent(EVENT_SHAMAN_FIRESHIELD, 2000);
+ break;
+ case EVENT_SHAMAN_FIREBLAST:
+ DoCastVictim(SPELL_SHAMAN_FIREBLAST);
+ _events.ScheduleEvent(EVENT_SHAMAN_FIREBLAST, urand(5000, 20000));
+ break;
+ default:
+ break;
+ }
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ private:
+ EventMap _events;
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_pet_shaman_fire_elementalAI(creature);
+ }
+};
+
+void AddSC_shaman_pet_scripts()
+{
+ new npc_pet_shaman_earth_elemental();
+ new npc_pet_shaman_fire_elemental();
+}
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 10cc62a8a91..ca94f871d03 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1785,6 +1785,63 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader
}
};
+enum BearFlankMaster
+{
+ SPELL_BEAR_FLANK_MASTER = 56565,
+ SPELL_CREATE_BEAR_FLANK = 56566,
+ SPELL_BEAR_FLANK_FAIL = 56569
+};
+
+class spell_q13011_bear_flank_master : public SpellScriptLoader
+{
+ public:
+ spell_q13011_bear_flank_master() : SpellScriptLoader("spell_q13011_bear_flank_master") { }
+
+ class spell_q13011_bear_flank_master_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q13011_bear_flank_master_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_BEAR_FLANK_MASTER) ||
+ !sSpellMgr->GetSpellInfo(SPELL_CREATE_BEAR_FLANK))
+ return false;
+ return true;
+ }
+
+ bool Load() OVERRIDE
+ {
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ bool failed = RAND(0, 1); // 50% chance
+ Creature* creature = GetCaster()->ToCreature();
+ if (Player* player = GetHitPlayer())
+ {
+ if (failed)
+ {
+ player->CastSpell(creature, SPELL_BEAR_FLANK_FAIL);
+ creature->AI()->Talk(0, player->GetGUID());
+ }
+ else
+ player->CastSpell(player, SPELL_CREATE_BEAR_FLANK);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q13011_bear_flank_master_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q13011_bear_flank_master_SpellScript();
+ }
+};
+
class spell_q13086_cannons_target : public SpellScriptLoader
{
public:
@@ -1863,5 +1920,6 @@ void AddSC_quest_spell_scripts()
new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy();
new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon();
new spell_q12847_summon_soul_moveto_bunny();
+ new spell_q13011_bear_flank_master();
new spell_q13086_cannons_target();
}
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index b236c277251..1348e433de3 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -49,9 +49,7 @@ EndContentData */
#include "ObjectMgr.h"
#include "ScriptMgr.h"
#include "World.h"
-#include "PetAI.h"
#include "PassiveAI.h"
-#include "CombatAI.h"
#include "GameEventMgr.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
@@ -1596,124 +1594,6 @@ public:
};
-/*####
-## npc_snake_trap_serpents
-####*/
-
-enum SnakeTrapSerpents
-{
- SPELL_MIND_NUMBING_POISON = 25810, // Viper
- SPELL_DEADLY_POISON = 34655, // Venomous Snake
- SPELL_CRIPPLING_POISON = 30981, // Viper
-
- NPC_VIPER = 19921
-};
-
-class npc_snake_trap : public CreatureScript
-{
-public:
- npc_snake_trap() : CreatureScript("npc_snake_trap_serpents") { }
-
- struct npc_snake_trap_serpentsAI : public ScriptedAI
- {
- npc_snake_trap_serpentsAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 SpellTimer;
- bool IsViper;
-
- void EnterCombat(Unit* /*who*/) OVERRIDE {}
-
- void Reset() OVERRIDE
- {
- SpellTimer = 0;
-
- CreatureTemplate const* Info = me->GetCreatureTemplate();
-
- IsViper = Info->Entry == NPC_VIPER ? true : false;
-
- me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f));
- //Add delta to make them not all hit the same time
- uint32 delta = (rand() % 7) * 100;
- me->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, float(Info->baseattacktime + delta));
- me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower));
-
- // Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target
- if (!me->GetVictim() && me->IsSummon())
- if (Unit* Owner = me->ToTempSummon()->GetSummoner())
- if (Owner->getAttackerForHelper())
- AttackStart(Owner->getAttackerForHelper());
- }
-
- //Redefined for random target selection:
- void MoveInLineOfSight(Unit* who) OVERRIDE
-
- {
- if (!me->GetVictim() && me->CanCreatureAttack(who))
- {
- if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
- return;
-
- float attackRadius = me->GetAttackDistance(who);
- if (me->IsWithinDistInMap(who, attackRadius) && me->IsWithinLOSInMap(who))
- {
- if (!(rand() % 5))
- {
- me->setAttackTimer(BASE_ATTACK, (rand() % 10) * 100);
- SpellTimer = (rand() % 10) * 100;
- AttackStart(who);
- }
- }
- }
- }
-
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (!UpdateVictim())
- return;
-
- if (me->GetVictim()->HasBreakableByDamageCrowdControlAura(me))
- {
- me->InterruptNonMeleeSpells(false);
- return;
- }
-
- if (SpellTimer <= diff)
- {
- if (IsViper) //Viper
- {
- if (urand(0, 2) == 0) //33% chance to cast
- {
- uint32 spell;
- if (urand(0, 1) == 0)
- spell = SPELL_MIND_NUMBING_POISON;
- else
- spell = SPELL_CRIPPLING_POISON;
-
- DoCastVictim(spell);
- }
-
- SpellTimer = 3000;
- }
- else //Venomous Snake
- {
- if (urand(0, 2) == 0) //33% chance to cast
- DoCastVictim(SPELL_DEADLY_POISON);
- SpellTimer = 1500 + (rand() % 5) * 100;
- }
- }
- else
- SpellTimer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_snake_trap_serpentsAI(creature);
- }
-};
-
#define SAY_RANDOM_MOJO0 "Now that's what I call froggy-style!"
#define SAY_RANDOM_MOJO1 "Your lily pad or mine?"
#define SAY_RANDOM_MOJO2 "This won't take long, did it?"
@@ -1815,172 +1695,6 @@ public:
}
};
-class npc_mirror_image : public CreatureScript
-{
-public:
- npc_mirror_image() : CreatureScript("npc_mirror_image") { }
-
- struct npc_mirror_imageAI : CasterAI
- {
- npc_mirror_imageAI(Creature* creature) : CasterAI(creature) {}
-
- void InitializeAI() OVERRIDE
- {
- CasterAI::InitializeAI();
- Unit* owner = me->GetOwner();
- if (!owner)
- return;
- // Inherit Master's Threat List (not yet implemented)
- owner->CastSpell((Unit*)NULL, 58838, true);
- // here mirror image casts on summoner spell (not present in client dbc) 49866
- // here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcasted by mirror images (stats related?)
- // Clone Me!
- owner->CastSpell(me, 45204, false);
- }
-
- // Do not reload Creature templates on evade mode enter - prevent visual lost
- void EnterEvadeMode() OVERRIDE
- {
- if (me->IsInEvadeMode() || !me->IsAlive())
- return;
-
- Unit* owner = me->GetCharmerOrOwner();
-
- me->CombatStop(true);
- if (owner && !me->HasUnitState(UNIT_STATE_FOLLOW))
- {
- me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle(), MOTION_SLOT_ACTIVE);
- }
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_mirror_imageAI(creature);
- }
-};
-
-class npc_ebon_gargoyle : public CreatureScript
-{
-public:
- npc_ebon_gargoyle() : CreatureScript("npc_ebon_gargoyle") { }
-
- struct npc_ebon_gargoyleAI : CasterAI
- {
- npc_ebon_gargoyleAI(Creature* creature) : CasterAI(creature) {}
-
- uint32 despawnTimer;
-
- void InitializeAI() OVERRIDE
- {
- CasterAI::InitializeAI();
- uint64 ownerGuid = me->GetOwnerGUID();
- if (!ownerGuid)
- return;
- // Not needed to be despawned now
- despawnTimer = 0;
- // Find victim of Summon Gargoyle spell
- std::list<Unit*> targets;
- Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30);
- Trinity::UnitListSearcher<Trinity::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, targets, u_check);
- me->VisitNearbyObject(30, searcher);
- for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
- if ((*iter)->GetAura(49206, ownerGuid))
- {
- me->Attack((*iter), false);
- break;
- }
- }
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- // Stop Feeding Gargoyle when it dies
- if (Unit* owner = me->GetOwner())
- owner->RemoveAurasDueToSpell(50514);
- }
-
- // Fly away when dismissed
- void SpellHit(Unit* source, SpellInfo const* spell) OVERRIDE
- {
- if (spell->Id != 50515 || !me->IsAlive())
- return;
-
- Unit* owner = me->GetOwner();
-
- if (!owner || owner != source)
- return;
-
- // Stop Fighting
- me->ApplyModFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE, true);
- // Sanctuary
- me->CastSpell(me, 54661, true);
- me->SetReactState(REACT_PASSIVE);
-
- //! HACK: Creature's can't have MOVEMENTFLAG_FLYING
- // Fly Away
- me->SetCanFly(true);
- me->SetSpeed(MOVE_FLIGHT, 0.75f, true);
- me->SetSpeed(MOVE_RUN, 0.75f, true);
- float x = me->GetPositionX() + 20 * std::cos(me->GetOrientation());
- float y = me->GetPositionY() + 20 * std::sin(me->GetOrientation());
- float z = me->GetPositionZ() + 40;
- me->GetMotionMaster()->Clear(false);
- me->GetMotionMaster()->MovePoint(0, x, y, z);
-
- // Despawn as soon as possible
- despawnTimer = 4 * IN_MILLISECONDS;
- }
-
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (despawnTimer > 0)
- {
- if (despawnTimer > diff)
- despawnTimer -= diff;
- else
- me->DespawnOrUnsummon();
- return;
- }
- CasterAI::UpdateAI(diff);
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_ebon_gargoyleAI(creature);
- }
-};
-
-class npc_lightwell : public CreatureScript
-{
- public:
- npc_lightwell() : CreatureScript("npc_lightwell") { }
-
- struct npc_lightwellAI : public PassiveAI
- {
- npc_lightwellAI(Creature* creature) : PassiveAI(creature)
- {
- DoCast(me, 59907, false);
- }
-
- void EnterEvadeMode() OVERRIDE
- {
- if (!me->IsAlive())
- return;
-
- me->DeleteThreatList();
- me->CombatStop(true);
- me->ResetPlayerDamageReq();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_lightwellAI(creature);
- }
-};
-
enum TrainingDummy
{
NPC_ADVANCED_TARGET_DUMMY = 2674,
@@ -2065,159 +1779,6 @@ public:
};
/*######
-# npc_shadowfiend
-######*/
-#define GLYPH_OF_SHADOWFIEND_MANA 58227
-#define GLYPH_OF_SHADOWFIEND 58228
-
-class npc_shadowfiend : public CreatureScript
-{
- public:
- npc_shadowfiend() : CreatureScript("npc_shadowfiend") { }
-
- struct npc_shadowfiendAI : public PetAI
- {
- npc_shadowfiendAI(Creature* creature) : PetAI(creature) {}
-
- void JustDied(Unit* /*killer*/) OVERRIDE
- {
- if (me->IsSummon())
- if (Unit* owner = me->ToTempSummon()->GetSummoner())
- if (owner->HasAura(GLYPH_OF_SHADOWFIEND))
- owner->CastSpell(owner, GLYPH_OF_SHADOWFIEND_MANA, true);
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_shadowfiendAI(creature);
- }
-};
-
-/*######
-# npc_fire_elemental
-######*/
-
-enum FireElemental
-{
- SPELL_FIRENOVA = 12470,
- SPELL_FIRESHIELD = 13376,
- SPELL_FIREBLAST = 57984
-};
-
-class npc_fire_elemental : public CreatureScript
-{
-public:
- npc_fire_elemental() : CreatureScript("npc_fire_elemental") { }
-
- struct npc_fire_elementalAI : public ScriptedAI
- {
- npc_fire_elementalAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 FireNova_Timer;
- uint32 FireShield_Timer;
- uint32 FireBlast_Timer;
-
- void Reset() OVERRIDE
- {
- FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
- FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
- FireShield_Timer = 0;
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true);
- }
-
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (!UpdateVictim())
- return;
-
- if (me->HasUnitState(UNIT_STATE_CASTING))
- return;
-
- if (FireShield_Timer <= diff)
- {
- DoCastVictim(SPELL_FIRESHIELD);
- FireShield_Timer = 2 * IN_MILLISECONDS;
- }
- else
- FireShield_Timer -= diff;
-
- if (FireBlast_Timer <= diff)
- {
- DoCastVictim(SPELL_FIREBLAST);
- FireBlast_Timer = 5000 + rand() % 15000; // 5-20 sec cd
- }
- else
- FireBlast_Timer -= diff;
-
- if (FireNova_Timer <= diff)
- {
- DoCastVictim(SPELL_FIRENOVA);
- FireNova_Timer = 5000 + rand() % 15000; // 5-20 sec cd
- }
- else
- FireNova_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_fire_elementalAI(creature);
- }
-};
-
-/*######
-# npc_earth_elemental
-######*/
-
-enum EarthElemental
-{
- SPELL_ANGEREDEARTH = 36213
-};
-
-class npc_earth_elemental : public CreatureScript
-{
-public:
- npc_earth_elemental() : CreatureScript("npc_earth_elemental") { }
-
- struct npc_earth_elementalAI : public ScriptedAI
- {
- npc_earth_elementalAI(Creature* creature) : ScriptedAI(creature) {}
-
- uint32 AngeredEarth_Timer;
-
- void Reset() OVERRIDE
- {
- AngeredEarth_Timer = 0;
- me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
- }
-
- void UpdateAI(uint32 diff) OVERRIDE
- {
- if (!UpdateVictim())
- return;
-
- if (AngeredEarth_Timer <= diff)
- {
- DoCastVictim(SPELL_ANGEREDEARTH);
- AngeredEarth_Timer = 5000 + rand() % 15000; // 5-20 sec cd
- }
- else
- AngeredEarth_Timer -= diff;
-
- DoMeleeAttackIfReady();
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_earth_elementalAI(creature);
- }
-};
-
-/*######
# npc_wormhole
######*/
@@ -2987,19 +2548,12 @@ void AddSC_npcs_special()
new npc_steam_tonk();
new npc_tonk_mine();
new npc_brewfest_reveler();
- new npc_snake_trap();
- new npc_mirror_image();
- new npc_ebon_gargoyle();
- new npc_lightwell();
new npc_mojo();
new npc_training_dummy();
- new npc_shadowfiend();
new npc_wormhole();
new npc_pet_trainer();
new npc_locksmith();
new npc_experience();
- new npc_fire_elemental();
- new npc_earth_elemental();
new npc_firework();
new npc_spring_rabbit();
}