aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_06_17_00_world_creature.sql3
-rw-r--r--sql/updates/world/2012_06_17_01_world_creature.sql4
-rw-r--r--sql/updates/world/2012_06_17_02_world_creature.sql9
-rw-r--r--sql/updates/world/2012_06_18_00_world_creature.sql26
-rw-r--r--sql/updates/world/2012_06_18_01_world_spell_script_names.sql3
-rw-r--r--sql/updates/world/2012_06_18_02_world_sai.sql41
-rw-r--r--sql/updates/world/2012_06_18_03_world_sai.sql39
-rw-r--r--sql/updates/world/2012_06_19_00_world_sai.sql25
-rw-r--r--sql/updates/world/2012_06_19_01_world_gossip.sql161
-rw-r--r--sql/updates/world/2012_06_19_02_world_misc.sql98
-rw-r--r--sql/updates/world/2012_06_20_00_world_gossip.sql132
-rw-r--r--sql/updates/world/2012_06_20_01_world_sai.sql26
-rw-r--r--sql/updates/world/2012_06_20_02_world_gossip.sql17
-rwxr-xr-xsrc/server/game/AI/CreatureAI.h4
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp28
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp25
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp76
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.h179
-rwxr-xr-xsrc/server/game/Achievements/AchievementMgr.cpp6
-rwxr-xr-xsrc/server/game/Chat/Chat.cpp101
-rwxr-xr-xsrc/server/game/Chat/Chat.h71
-rwxr-xr-xsrc/server/game/Chat/Commands/Level0.cpp30
-rwxr-xr-xsrc/server/game/Chat/Commands/Level2.cpp231
-rwxr-xr-xsrc/server/game/Chat/Commands/Level3.cpp648
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp4
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp10
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h8
-rwxr-xr-xsrc/server/game/Miscellaneous/SharedDefines.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp5
-rwxr-xr-xsrc/server/game/Scripting/ScriptLoader.cpp8
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp5
-rw-r--r--src/server/scripts/Commands/CMakeLists.txt7
-rw-r--r--src/server/scripts/Commands/cs_cast.cpp310
-rw-r--r--src/server/scripts/Commands/cs_character.cpp681
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp193
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp2
-rw-r--r--src/server/scripts/Commands/cs_server.cpp431
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp9
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp23
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp11
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp3
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp3
-rw-r--r--src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp3
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp39
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp39
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp58
-rw-r--r--src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp57
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp279
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp107
-rw-r--r--src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h12
-rw-r--r--src/server/scripts/Kalimdor/ashenvale.cpp6
-rw-r--r--src/server/scripts/Kalimdor/dustwallow_marsh.cpp90
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp136
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp5
-rwxr-xr-xsrc/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp5
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp20
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp7
-rw-r--r--src/server/scripts/Spells/spell_pet.cpp2
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp55
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp452
63 files changed, 2866 insertions, 2210 deletions
diff --git a/sql/updates/world/2012_06_17_00_world_creature.sql b/sql/updates/world/2012_06_17_00_world_creature.sql
new file mode 100644
index 00000000000..53e101c5d60
--- /dev/null
+++ b/sql/updates/world/2012_06_17_00_world_creature.sql
@@ -0,0 +1,3 @@
+-- Fix Storm Totem flags
+UPDATE `creature_template` SET `npcflag`=`npcflag`|16777216 WHERE `entry`=26048;
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`&~16777216 WHERE `entry`=26048;
diff --git a/sql/updates/world/2012_06_17_01_world_creature.sql b/sql/updates/world/2012_06_17_01_world_creature.sql
new file mode 100644
index 00000000000..c5d50fdde1e
--- /dev/null
+++ b/sql/updates/world/2012_06_17_01_world_creature.sql
@@ -0,0 +1,4 @@
+-- Add aura missing aura to Nerub'ar Scarab
+DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM creature WHERE id=25652);
+DELETE FROM `creature_template_addon` WHERE `entry`=25652;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (25652,1,'45814');
diff --git a/sql/updates/world/2012_06_17_02_world_creature.sql b/sql/updates/world/2012_06_17_02_world_creature.sql
new file mode 100644
index 00000000000..a309ada3498
--- /dev/null
+++ b/sql/updates/world/2012_06_17_02_world_creature.sql
@@ -0,0 +1,9 @@
+-- Add missing Gan'jo spawn to Grizzly Hills
+SET @GUID := 42187;
+SET @ENTRY := 26924;
+DELETE FROM `creature` WHERE `guid`=@GUID;
+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,@ENTRY,571,1,2,0,0,4834.98,-4754.5,32.5689,3.97935,180,0,0,1,0,0);
+-- Add Aura to Gan'jo
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`auras`) VALUES (@ENTRY,1,'17327');
diff --git a/sql/updates/world/2012_06_18_00_world_creature.sql b/sql/updates/world/2012_06_18_00_world_creature.sql
new file mode 100644
index 00000000000..23538c33f73
--- /dev/null
+++ b/sql/updates/world/2012_06_18_00_world_creature.sql
@@ -0,0 +1,26 @@
+SET @CGUID := 88615;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+00 AND @CGUID+22;
+INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES
+(@CGUID+00,39190,631,12,1,505.1563,-2536.863,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+01,39190,631,12,1,502.6493,-2531.328,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+02,39190,631,12,1,503.8246,-2508.141,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+03,39190,631,12,1,495.3629,-2538.215,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+04,39190,631,12,1,506.8715,-2515.552,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+05,39190,631,12,1,481.3021,-2509.222,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+06,39190,631,12,1,481.5382,-2527.332,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+07,39190,631,12,1,500.0807,-2523.289,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+08,39190,631,12,1,486.6632,-2517.747,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+09,39190,631,12,1,513.8802,-2511.795,1069.596,0,10,10,1), -- Wicked Spirit
+(@CGUID+10,39190,631,12,1,499.6406,-2500.783,1069.656,0,10,10,1), -- Wicked Spirit
+(@CGUID+11,39190,631,12,1,513.7101,-2530.931,1069.596,0,10,10,1), -- Wicked Spirit
+(@CGUID+12,39190,631,12,1,502.6811,-2522.542,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+13,39190,631,12,1,518.7483,-2521.240,1069.596,0,10,10,1), -- Wicked Spirit
+(@CGUID+14,39190,631,12,1,478.9774,-2517.446,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+15,39190,631,12,1,489.0104,-2538.535,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+16,39190,631,12,1,511.6320,-2522.373,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+17,39190,631,12,1,500.8976,-2527.198,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+18,39190,631,12,1,484.7934,-2533.592,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+19,39190,631,12,1,490.4132,-2504.323,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+20,39190,631,12,1,485.0298,-2527.724,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+21,39190,631,12,1,494.2899,-2511.384,1069.598,0,10,10,1), -- Wicked Spirit
+(@CGUID+22,39190,631,12,1,491.7170,-2532.490,1069.598,0,10,10,1); -- Wicked Spirit
diff --git a/sql/updates/world/2012_06_18_01_world_spell_script_names.sql b/sql/updates/world/2012_06_18_01_world_spell_script_names.sql
new file mode 100644
index 00000000000..5f227a887d7
--- /dev/null
+++ b/sql/updates/world/2012_06_18_01_world_spell_script_names.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` = 23880;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(23880, 'spell_warr_bloodthirst_heal');
diff --git a/sql/updates/world/2012_06_18_02_world_sai.sql b/sql/updates/world/2012_06_18_02_world_sai.sql
new file mode 100644
index 00000000000..0c036d3d5f0
--- /dev/null
+++ b/sql/updates/world/2012_06_18_02_world_sai.sql
@@ -0,0 +1,41 @@
+-- Fix quest 11895 "Master the Storm"
+-- Storm Totem SAI
+SET @ENTRY := 26048;
+UPDATE `creature_template` SET `npcflag`=`npcflag`&~16777216,`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,11,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - set npcflag'),
+(@ENTRY,0,1,2,73,0,100,0,0,0,0,0,12,26045,2,300000,0,0,0,8,0,0,0,3403.829,4133.074,18.13754,5.759586,'Storm Totem - On Spellclick - Spawn Storm Tempest'),
+(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,81,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - remove npcflag');
+-- Storm Tempest SAI
+SET @ENTRY := 26045;
+UPDATE `creature_template` SET `unit_flags`=0,`AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=26045;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@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,63,0,100,0,0,0,0,0,11,8609,2,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On spawn - cast aura'),
+(@ENTRY,0,1,0,1,0,100,1,1000,1000,1000,1000,12,23837,2,120000,0,0,0,8,0,0,0,3403.871,4133.031,18.13754,5.67232,'Storm Totem - OOC - Spawn ELM General Purpose Bunny'),
+(@ENTRY,0,2,0,60,0,100,1,1000,1000,7000,8000,11,40136,2,0,0,0,0,19,23837,5,0,0,0,0,0,'Storm Totem - Update Event - cast aura'),
+(@ENTRY,0,3,4,4,0,100,1,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - On Aggro - Say 0'),
+(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Storm Totem - On Aggro - Prevent combat movement'),
+(@ENTRY,0,5,0,0,0,100,0,0,30,6000,7500,11,15659,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Chain Lightning'),
+(@ENTRY,0,6,0,0,0,100,0,8000,11000,9000,14000,11,31272,0,0,0,0,0,2,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Wind Shock'),
+(@ENTRY,0,7,8,6,0,100,0,0,0,0,0,51,0,0,0,0,0,0,9,23837,0,10,0,0,0,0,'Storm Totem - On death - despawn trigger'),
+(@ENTRY,0,8,9,61,0,100,0,0,0,0,0,81,16777216,0,0,0,0,0,19,26048,10,0,0,0,0,0,'Storm Totem - On death - set npc flags on totem'),
+(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,85,46424,2,0,0,0,0,16,0,0,0,0,0,0,0,'Storm Totem - Combat - Cast Power of the Storm');
+-- Sage Earth and Sky SAI
+SET @ENTRY := 25982;
+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,20,0,100,0,11895,0,0,0,28,46424,0,0,0,0,0,7,0,0,0,0,0,0,0,'Sage Earth and Sky - On Quest reward - remove aura from player');
+-- NPC talk text insert from sniff
+DELETE FROM `creature_text` WHERE `entry`=26045;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(26045,0,0, 'You will not master me, puny $r!',12,0,100,0,0,0, 'Storm Tempest');
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=26048;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22,2,26048,0,0,9,0,11895,0,0,0,0, '', 'Storm Totem - Allow sai action only if quest has been taken'),
+(22,2,26048,0,0,28,0,11895,0,0,1,0, '', 'Storm Totem - Allow sai action only if quest has not been completed');
diff --git a/sql/updates/world/2012_06_18_03_world_sai.sql b/sql/updates/world/2012_06_18_03_world_sai.sql
new file mode 100644
index 00000000000..833c64c8d9d
--- /dev/null
+++ b/sql/updates/world/2012_06_18_03_world_sai.sql
@@ -0,0 +1,39 @@
+-- Fix Quest 13231 The Broken Front and 13232 Finish Me!
+-- Dying Soldier SAI
+SET @ENTRY := 31304;
+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,62,0,100,0,10040,0,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'),
+(@ENTRY,0,1,2,62,0,100,0,10040,3,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'),
+(@ENTRY,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,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,3,4,62,0,100,0,10040,1,0,0,85,59226,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Player cast Finish It on npc'),
+(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,6,7,8,0,100,0,59226,0,0,0,11,3240,2,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spellhit - Cast Bloody Explosion on self'),
+(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,33,31312,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Give Kill credit to player');
+-- Update Gossip
+SET @GOSSIP := 10040;
+-- Add conditions for gossip text
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=@GOSSIP;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,@GOSSIP,13948,0,28,13231,0,0,0,0,'','Only show gossip text 13948 if player has quest 13231 Complete'),
+(14,@GOSSIP,13948,0,14,13232,0,0,0,0,'','Only show gossip text 13948 if player has quest 13232 Not Taken'),
+(14,@GOSSIP,14035,0,9,13232,0,0,0,0,'','Only show gossip text 14035 if player has quest 13232 active');
+-- Add conditions for gossip options
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(15,@GOSSIP,0,0,9,13231,0,0,0,0,'','Only show gossip option 0 if player has if player has quest 13231 active'),
+(15,@GOSSIP,1,0,9,13232,0,0,0,0,'','Only show gossip option 1 if player has if player has quest 13232 active'),
+(15,@GOSSIP,3,0,28,13231,0,0,0,0,'','Only show gossip option 3 if player has quest 13231 Complete'),
+(15,@GOSSIP,3,0,14,13232,0,0,0,0,'','Only show gossip option 3 if player has quest 13232 Not Taken');
+-- Update Gossip options
+UPDATE `gossip_menu_option` SET `action_menu_id`=10041 WHERE `menu_id`=10040 AND `id`=0;
+-- Fix npcflags for Dying Soldier
+UPDATE `creature_template` SET `npcflag`=1 WHERE `entry`=31304;
+UPDATE `creature` SET `npcflag`=3 WHERE `guid`=122230;
+UPDATE `creature` SET `npcflag`=0 WHERE `guid`=122233;
+-- Quest conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19,20) AND `SourceEntry`=13232;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(19,0,13232,0,28,13231,0,0,0,0, '', 'Quest 13232 Finish Me! Requires Quest 13231 The Broken Front to be complete'),
+(20,0,13232,0,28,13231,0,0,0,0, '', 'Quest 13232 Finish Me! Requires Quest 13231 The Broken Front to be complete');
diff --git a/sql/updates/world/2012_06_19_00_world_sai.sql b/sql/updates/world/2012_06_19_00_world_sai.sql
new file mode 100644
index 00000000000..fdfc5aec5f8
--- /dev/null
+++ b/sql/updates/world/2012_06_19_00_world_sai.sql
@@ -0,0 +1,25 @@
+-- Fix Quest 13231 The Broken Front and 13232 Finish Me!
+-- Dying Soldier SAI
+SET @ENTRY := 31304;
+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,62,0,100,0,10040,0,0,0,11,58955,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Cast Alliance Quest Aura on player'),
+(@ENTRY,0,1,2,62,0,100,0,10040,3,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Set npcflag'),
+(@ENTRY,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,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,3,4,62,0,100,0,10040,1,0,0,85,59226,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Player cast Finish It on npc'),
+(@ENTRY,0,4,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Close Gossip'),
+(@ENTRY,0,6,7,8,0,100,0,59226,0,0,0,11,3240,2,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spellhit - Cast Bloody Explosion on self'),
+(@ENTRY,0,7,0,61,0,100,0,0,0,0,0,33,31312,0,0,0,0,0,7,0,0,0,0,0,0,0,'Dying Soldier - On Gossip Option Select - Give Kill credit to player'),
+(@ENTRY,0,8,9,25,0,100,0,0,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spawn - Set npcflag'),
+(@ENTRY,0,9,0,61,0,100,0,0,0,0,0,8,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Spawn - Set react state'),
+(@ENTRY,0,10,0,19,0,100,0,13232,0,0,0,81,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Dying Soldier - On Quest accept - Set npcflag');
+-- Creature updates
+UPDATE `creature_template` SET `npcflag`=3,`RegenHealth`=0 WHERE `entry`=31304;
+UPDATE `creature` SET `npcflag`=0 WHERE `guid`=122230;
+UPDATE `creature` SET `curhealth`=37 WHERE `id`=31304;
+
+-- Start Fixing Quest 13228 The Broken Front and 13230 No Mercy!
+-- Creature updates
+UPDATE `creature_template` SET `npcflag`=3,`RegenHealth`=0 WHERE `entry`=31273;
+UPDATE `creature` SET `curhealth`=37 WHERE `id`=31273;
diff --git a/sql/updates/world/2012_06_19_01_world_gossip.sql b/sql/updates/world/2012_06_19_01_world_gossip.sql
new file mode 100644
index 00000000000..7800d2a9740
--- /dev/null
+++ b/sql/updates/world/2012_06_19_01_world_gossip.sql
@@ -0,0 +1,161 @@
+-- Creature Gossip_menu_id Update from sniff
+UPDATE `creature_template` SET `gossip_menu_id`=8871 WHERE `entry`=4501; -- Draz'Zilb
+UPDATE `creature_template` SET `gossip_menu_id`=4004 WHERE `entry`=4885; -- Gregor MacVince
+UPDATE `creature_template` SET `gossip_menu_id`=541 WHERE `entry`=4895; -- Smiling Jim
+UPDATE `creature_template` SET `gossip_menu_id`=4122 WHERE `entry`=4900; -- Alchemist Narett
+UPDATE `creature_template` SET `gossip_menu_id`=8840 WHERE `entry`=4921; -- Guard Byron
+UPDATE `creature_template` SET `gossip_menu_id`=1186 WHERE `entry`=4926; -- Krog
+UPDATE `creature_template` SET `gossip_menu_id`=1161 WHERE `entry`=4944; -- Captain Garran Vimes
+UPDATE `creature_template` SET `gossip_menu_id`=5301 WHERE `entry`=4967; -- Archmage Tervosh
+UPDATE `creature_template` SET `gossip_menu_id`=2465 WHERE `entry`=4968; -- Lady Jaina Proudmoore
+UPDATE `creature_template` SET `gossip_menu_id`=8793 WHERE `entry`=5086; -- Captain Wymor
+UPDATE `creature_template` SET `gossip_menu_id`=2916 WHERE `entry`=6546; -- Tabetha
+UPDATE `creature_template` SET `gossip_menu_id`=4091 WHERE `entry`=8141; -- Captain Evencane
+UPDATE `creature_template` SET `gossip_menu_id`=4355 WHERE `entry`=11052; -- Timothy Worthington
+UPDATE `creature_template` SET `gossip_menu_id`=5382 WHERE `entry`=12939; -- Doctor Gustaf VanHowzen
+UPDATE `creature_template` SET `gossip_menu_id`=8761 WHERE `entry`=23567; -- Inspector Tarem
+UPDATE `creature_template` SET `gossip_menu_id`=8788 WHERE `entry`=23568; -- Captain Darill
+UPDATE `creature_template` SET `gossip_menu_id`=8837 WHERE `entry`=23569; -- Renn McGill
+UPDATE `creature_template` SET `gossip_menu_id`=8801 WHERE `entry`=23579; -- Brogg
+UPDATE `creature_template` SET `gossip_menu_id`=8811 WHERE `entry`=23600; -- Apprentice Morlann
+UPDATE `creature_template` SET `gossip_menu_id`=8812 WHERE `entry`=23601; -- Apprentice Garion
+UPDATE `creature_template` SET `gossip_menu_id`=8762 WHERE `entry`=23602; -- Deserter Agitator
+UPDATE `creature_template` SET `gossip_menu_id`=8782 WHERE `entry`=23704; -- Cassa Crimsonwing
+UPDATE `creature_template` SET `gossip_menu_id`=8787 WHERE `entry`=23723; -- Sergeant Lukas
+UPDATE `creature_template` SET `gossip_menu_id`=8830 WHERE `entry`=23797; -- Moxie Steelgrille
+UPDATE `creature_template` SET `gossip_menu_id`=8831 WHERE `entry`=23835; -- Sergeant Amelyn
+UPDATE `creature_template` SET `gossip_menu_id`=8826 WHERE `entry`=23896; -- "Dirty" Michael Crowe
+UPDATE `creature_template` SET `gossip_menu_id`=8835 WHERE `entry`=23949; -- Lieutenant Nath
+UPDATE `creature_template` SET `gossip_menu_id`=8836 WHERE `entry`=23950; -- Lieutenant Khand
+UPDATE `creature_template` SET `gossip_menu_id`=8912 WHERE `entry`=24208; -- "Little" Logok
+UPDATE `creature_template` SET `gossip_menu_id`=9342 WHERE `entry`=26546; -- Ludin Farrow
+
+-- Gossip Menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=541 AND `text_id`=1058;
+DELETE FROM `gossip_menu` WHERE `entry`=1161 AND `text_id`=1793;
+DELETE FROM `gossip_menu` WHERE `entry`=1162 AND `text_id`=1794;
+DELETE FROM `gossip_menu` WHERE `entry`=1186 AND `text_id`=1818;
+DELETE FROM `gossip_menu` WHERE `entry`=1187 AND `text_id`=1819;
+DELETE FROM `gossip_menu` WHERE `entry`=1188 AND `text_id`=1820;
+DELETE FROM `gossip_menu` WHERE `entry`=2465 AND `text_id`=3157;
+DELETE FROM `gossip_menu` WHERE `entry`=2916 AND `text_id`=3590;
+DELETE FROM `gossip_menu` WHERE `entry`=4004 AND `text_id`=5855;
+DELETE FROM `gossip_menu` WHERE `entry`=4091 AND `text_id`=4991;
+DELETE FROM `gossip_menu` WHERE `entry`=4122 AND `text_id`=5049;
+DELETE FROM `gossip_menu` WHERE `entry`=4355 AND `text_id`=5571;
+DELETE FROM `gossip_menu` WHERE `entry`=5301 AND `text_id`=6333;
+DELETE FROM `gossip_menu` WHERE `entry`=5382 AND `text_id`=6414;
+DELETE FROM `gossip_menu` WHERE `entry`=8761 AND `text_id`=11126;
+DELETE FROM `gossip_menu` WHERE `entry`=8762 AND `text_id`=11136;
+DELETE FROM `gossip_menu` WHERE `entry`=8782 AND `text_id`=11224;
+DELETE FROM `gossip_menu` WHERE `entry`=8787 AND `text_id`=11243;
+DELETE FROM `gossip_menu` WHERE `entry`=8788 AND `text_id`=11245;
+DELETE FROM `gossip_menu` WHERE `entry`=8793 AND `text_id`=11264;
+DELETE FROM `gossip_menu` WHERE `entry`=8801 AND `text_id`=11281;
+DELETE FROM `gossip_menu` WHERE `entry`=8811 AND `text_id`=11309;
+DELETE FROM `gossip_menu` WHERE `entry`=8812 AND `text_id`=11311;
+DELETE FROM `gossip_menu` WHERE `entry`=8826 AND `text_id`=11376;
+DELETE FROM `gossip_menu` WHERE `entry`=8830 AND `text_id`=11403;
+DELETE FROM `gossip_menu` WHERE `entry`=8831 AND `text_id`=11406;
+DELETE FROM `gossip_menu` WHERE `entry`=8835 AND `text_id`=11426;
+DELETE FROM `gossip_menu` WHERE `entry`=8836 AND `text_id`=11428;
+DELETE FROM `gossip_menu` WHERE `entry`=8837 AND `text_id`=11432;
+DELETE FROM `gossip_menu` WHERE `entry`=8840 AND `text_id`=11457;
+DELETE FROM `gossip_menu` WHERE `entry`=8871 AND `text_id`=11567;
+DELETE FROM `gossip_menu` WHERE `entry`=8912 AND `text_id`=11797;
+DELETE FROM `gossip_menu` WHERE `entry`=9342 AND `text_id`=12642;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(541,1058),
+(1161,1793),
+(1162,1794),
+(1186,1818),
+(1187,1819),
+(1188,1820),
+(2465,3157),
+(2916,3590),
+(4004,5855),
+(4091,4991),
+(4122,5049),
+(4355,5571),
+(5301,6333),
+(5382,6414),
+(8761,11126),
+(8762,11136),
+(8782,11224),
+(8787,11243),
+(8788,11245),
+(8793,11264),
+(8801,11281),
+(8811,11309),
+(8812,11311),
+(8826,11376),
+(8830,11403),
+(8831,11406),
+(8835,11426),
+(8836,11428),
+(8837,11432),
+(8840,11457),
+(8871,11567),
+(8912,11797),
+(9342,12642);
+
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1161,4122,4355,5382,8761,8762) AND `id`=0;
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1186,8826,8912) AND `id` IN (0,1);
+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
+(1161,0,0,'What have you heard of the Shady Rest Inn?',1,1,1162,0,0,0,''),
+(1186,0,0,'The Burning Inn.',1,1,1187,0,0,0,''),
+(1186,1,0,'Paval Reethe.',1,1,1188,0,0,0,''),
+(4122,0,3,'Train me.',5,16,0,0,0,0,''),
+(4355,0,3,'Train me.',5,16,0,0,0,0,''),
+(5382,0,3,'Train me.',5,16,0,0,0,0,''),
+(8761,0,0,'Can you spread the reflective dust again?',1,1,0,0,0,0,''),
+(8762,0,0,'Your propaganda won''t work on me. Spout your treasonous filth elsewhere, traitor!',1,1,0,0,0,0,''),
+(8826,0,3,'Train me.',5,16,0,0,0,0,''),
+(8826,1,1,'Show me what you have for sale.',3,128,0,0,0,0,''),
+(8912,0,5,'Make this inn your home.',8,65536,0,0,0,0,''),
+(8912,1,1,'I want to browse your goods.',3,128,0,0,0,0,'');
+
+SET @NPC_DESERTER := 23602;
+SET @NPC_INSPECTOR := 23567;
+SET @SPELL_DISCOVERED_SUB := 42219;
+
+-- Insert creature_text from sniff
+DELETE FROM `creature_text` WHERE `entry`=@NPC_DESERTER;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(@NPC_DESERTER,0,0,'It''s good to see you defending Theramore with pride, friend.',12,7,100,25,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,0,1,'When you''re off duty, let''s go to the inn. I''ll buy a round and we can reminisce about the good old days.',12,7,100,1,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,0,2,'Wouldn''t you like to bring those days back? I have some friends who know just the way to do that...''',12,7,100,1,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,0,'These people will know Admiral Proudmoore for the true hero he was!',12,7,100,5,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,1,'You can''t stop us from exposing the truth about Jaina''s cowardice!',12,7,100,5,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,2,'If you think you can stop us, you''re mistaken, ''friend.''',12,7,100,5,0,0,'Deserter Agitator'),
+(@NPC_DESERTER,1,3,'It''s people like you who weaken the Alliance and invite the Horde to take away all we''ve fought for!',12,7,100,5,0,0,'Deserter Agitator');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry`=@SPELL_DISCOVERED_SUB;
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=8762 AND `SourceEntry`=0;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(13,1,@SPELL_DISCOVERED_SUB,0,0,31,0,3,23602,0,0,0,'','Spell Discovered (Sub) only targets Deserter Agitator'),
+(15,8762,0,0,0,9,0,11126,0,0,0,0,'','Show gossip option only if player has taken quest 11126');
+
+-- SmartAI
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_INSPECTOR,@NPC_DESERTER) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_DESERTER*100,@NPC_DESERTER*100+1) 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_INSPECTOR,0,0,1,62,0,100,0,8761,0,0,0,11,42169,0,0,0,0,0,7,0,0,0,0,0,0,0,'Inspector Tarem - On Gossip option select - Cast Reflective Dust'),
+(@NPC_INSPECTOR,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Inspector Tarem - On Gossip option select - Close Gossip'),
+
+(@NPC_DESERTER,0,0,0,25,0,100,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On reset - Set faction default'),
+(@NPC_DESERTER,0,1,0,1,0,100,0,0,1,30000,40000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On update OOC - Say line'),
+(@NPC_DESERTER,0,2,3,62,0,100,0,8762,0,0,0,11,42203,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On Gossip option select - Cast Discovered'),
+(@NPC_DESERTER,0,3,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On Gossip option select - Close Gossip'),
+(@NPC_DESERTER,0,4,5,8,0,100,0,@SPELL_DISCOVERED_SUB,0,0,0,66,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Turn to invoker'),
+(@NPC_DESERTER,0,5,6,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Say line'),
+(@NPC_DESERTER,0,6,0,61,0,100,0,0,0,0,0,87,@NPC_DESERTER*100,@NPC_DESERTER*100+1,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator - On spellhit Discovered (Sub) - Run script'),
+
+(@NPC_DESERTER*100,9,0,0,0,0,100,0,2000,2000,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 0 - Set faction monster'),
+(@NPC_DESERTER*100,9,1,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator''s script 0 - Attack'),
+
+(@NPC_DESERTER*100+1,9,0,0,0,0,100,0,0,0,0,0,83,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Remove npcflag gossip'),
+(@NPC_DESERTER*100+1,9,1,0,0,0,100,0,0,0,0,0,33,@NPC_DESERTER,0,0,0,0,0,7,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Credit'),
+(@NPC_DESERTER*100+1,9,2,0,0,0,100,0,30000,30000,0,0,82,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Deserter Agitator''s script 1 - Add npcflag gossip');
diff --git a/sql/updates/world/2012_06_19_02_world_misc.sql b/sql/updates/world/2012_06_19_02_world_misc.sql
new file mode 100644
index 00000000000..32aa493f4f7
--- /dev/null
+++ b/sql/updates/world/2012_06_19_02_world_misc.sql
@@ -0,0 +1,98 @@
+-- Add missing spawns
+SET @GUID := 42875;
+SET @ENTRY := 26257;
+DELETE FROM `creature` WHERE `guid` IN (@GUID,@GUID+1);
+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,@ENTRY,571,1,1,0,0,3369.694,2528.735,197.4004,3.490659,180,0,0,1,0,0),
+(@GUID+1,@ENTRY,571,1,1,0,0,3346.363,2534.127,197.4004,4.258604,180,0,0,1,0,0);
+-- Add SAI
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-42875,-42876,-109574,-109575) 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
+(-42875,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-42875,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'),
+(-42876,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-42876,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'),
+(-109574,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-109574,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim'),
+(-109575,0,0,0,1,0,100,1,1000,1000,30000,30000,11,46906,2,0,0,0,0,10,115101,27853,0,0,0,0,0,'Surge Needle Sorcerer - OOC - Cast Surge Needle Beam'),
+(-109575,0,1,0,0,0,100,0,3000,4000,3000,5000,11,51797,0,0,0,0,0,2,0,0,0,0,0,0,0,'Surge Needle Sorcerer - Combat - Cast Arcane Blast on victim');
+-- Add missing go
+SET @GUID := 325;
+SET @ENTRY := 188448;
+DELETE FROM `gameobject` WHERE `guid` IN (@GUID);
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES
+(@GUID,@ENTRY,571,1,1,3346.398,2534.092,197.3171,2.82743,0,0,0.9876881,0.1564362,180,255,1);
+
+-- Pathing for Nexus Guardian
+SET @NPC := 111304;
+SET @PATH := @NPC*10;
+DELETE FROM `creature` WHERE `guid`=@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`) VALUES
+(@NPC,26276,571,1,1,0,0,3560.472,1769.351,171.9977,1.91463,120,0,0,1,0,2);
+DELETE FROM `creature_addon` WHERE `guid`=@NPC;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes1`,`bytes2`) VALUES (@NPC,@PATH,50331648,1);
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,3560.472,1769.351,171.9977,0,0,0,100,0),
+(@PATH,2,3567.688,1720.065,171.9977,0,0,0,100,0),
+(@PATH,3,3575.305,1671.264,171.9977,0,0,0,100,0),
+(@PATH,4,3614.985,1641.572,171.9977,0,0,0,100,0),
+(@PATH,5,3661.11,1627.888,179.4142,0,0,0,100,0),
+(@PATH,6,3710.721,1625.472,184.0807,0,0,0,100,0),
+(@PATH,7,3758.05,1626.899,186.8029,0,0,0,100,0),
+(@PATH,8,3806.817,1636.863,186.8029,0,0,0,100,0),
+(@PATH,9,3855.013,1638.274,186.8029,0,0,0,100,0),
+(@PATH,10,3893.953,1607.221,186.8029,0,0,0,100,0),
+(@PATH,11,3908.07,1563.533,186.8029,0,0,0,100,0),
+(@PATH,12,3892.732,1516.304,186.8029,0,0,0,100,0),
+(@PATH,13,3853.05,1486.712,186.8029,0,0,0,100,0),
+(@PATH,14,3804.016,1484.734,186.8029,0,0,0,100,0),
+(@PATH,15,3768.95,1518.886,186.8029,0,0,0,100,0),
+(@PATH,16,3741.332,1558.961,193.6083,0,0,0,100,0),
+(@PATH,17,3735.918,1607.949,197.9415,0,0,0,100,0),
+(@PATH,18,3726.846,1656.945,201.9971,0,0,0,100,0),
+(@PATH,19,3706.031,1701.895,208.3303,0,0,0,100,0),
+(@PATH,20,3693.807,1748.982,208.3303,0,0,0,100,0),
+(@PATH,21,3686.946,1791.952,208.3303,0,0,0,100,0),
+(@PATH,22,3684.135,1840.943,208.3303,0,0,0,100,0),
+(@PATH,23,3693.31,1889.799,208.3303,0,0,0,100,0),
+(@PATH,24,3710.331,1936.957,208.3303,0,0,0,100,0),
+(@PATH,25,3708.896,1985.871,203.9415,0,0,0,100,0),
+(@PATH,26,3711.546,2034.778,199.0248,0,0,0,100,0),
+(@PATH,27,3700.25,2079.795,185.8581,0,0,0,100,0),
+(@PATH,28,3671.014,2118.18,175.6918,0,0,0,100,0),
+(@PATH,29,3627.495,2141.961,170.8588,0,0,0,100,0),
+(@PATH,30,3582.266,2162.844,165.0257,0,0,0,100,0),
+(@PATH,31,3536.079,2181.72,161.0814,0,0,0,100,0),
+(@PATH,32,3492.185,2203.827,153.3039,0,0,0,100,0),
+(@PATH,33,3449.847,2227.899,147.0816,0,0,0,100,0),
+(@PATH,34,3411.07,2258.388,138.6929,0,0,0,100,0),
+(@PATH,35,3372.244,2288.043,130.0542,0,0,0,100,0),
+(@PATH,36,3334.966,2320.363,127.8878,0,0,0,100,0),
+(@PATH,37,3302.867,2358.885,123.2211,0,0,0,100,0),
+(@PATH,38,3272.494,2397.996,120.9432,0,0,0,100,0),
+(@PATH,39,3239.637,2434.888,118.8322,0,0,0,100,0),
+(@PATH,40,3212.678,2476.519,116.0821,0,0,0,100,0),
+(@PATH,41,3211.545,2525.56,108.0818,0,0,0,100,0),
+(@PATH,42,3250.958,2578.278,107.5538,0,0,0,100,0),
+(@PATH,43,3293.958,2602.603,107.5538,0,0,0,100,0),
+(@PATH,44,3342.687,2610.276,112.9983,0,0,0,100,0),
+(@PATH,45,3386.911,2594.68,123.2483,0,0,0,100,0),
+(@PATH,46,3415.89,2554.956,128.7483,0,0,0,100,0),
+(@PATH,47,3424.978,2506.423,128.7483,0,0,0,100,0),
+(@PATH,48,3417.17,2457.855,128.7483,0,0,0,100,0),
+(@PATH,49,3403.204,2427.43,128.7483,0,0,0,100,0),
+(@PATH,50,3373.681,2392.189,128.7483,0,0,0,100,0),
+(@PATH,51,3355.053,2347.842,128.7483,0,0,0,100,0),
+(@PATH,52,3358.651,2298.717,128.7483,0,0,0,100,0),
+(@PATH,53,3365.574,2249.818,135.9983,0,0,0,100,0),
+(@PATH,54,3382.769,2202.925,136.9983,0,0,0,100,0),
+(@PATH,55,3406.081,2159.531,144.9981,0,0,0,100,0),
+(@PATH,56,3435.854,2119.649,151.8868,0,0,0,100,0),
+(@PATH,57,3465.756,2080.089,151.8868,0,0,0,100,0),
+(@PATH,58,3482.463,2041.774,142.5257,0,0,0,100,0),
+(@PATH,59,3503.596,1996.099,137.0257,0,0,0,100,0),
+(@PATH,60,3521.709,1951.099,137.0257,0,0,0,100,0),
+(@PATH,61,3531.027,1914.229,150.5535,0,0,0,100,0),
+(@PATH,62,3542.625,1866.008,158.9424,0,0,0,100,0),
+(@PATH,63,3550.662,1817.174,163.9979,0,0,0,100,0);
diff --git a/sql/updates/world/2012_06_20_00_world_gossip.sql b/sql/updates/world/2012_06_20_00_world_gossip.sql
new file mode 100644
index 00000000000..b4d61887223
--- /dev/null
+++ b/sql/updates/world/2012_06_20_00_world_gossip.sql
@@ -0,0 +1,132 @@
+-- Insert npc_text from sniff
+DELETE FROM `npc_text` WHERE `ID`=11428;
+INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES
+(11428,'Are you here to relieve me? I''m certain it''s almost time. Well, if you want to relieve me anyway, let me know. I could use a drink or three.','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,12340);
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=23567;
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=23602;
+
+-- Creature Gossip_menu_id Update from sniff
+UPDATE `creature_template` SET `gossip_menu_id`=7981 WHERE `entry`=19217; -- Ravandwyr <Kirin Tor Apprentice>
+UPDATE `creature_template` SET `gossip_menu_id`=7996 WHERE `entry`=19488; -- Custodian Dieworth <Keeper of Kirin'Var>
+UPDATE `creature_template` SET `gossip_menu_id`=7995 WHERE `entry`=19489; -- Lieutenant-Sorcerer Morran
+UPDATE `creature_template` SET `gossip_menu_id`=7991 WHERE `entry`=19569; -- Netherologist Coppernickels <B.O.O.M.>
+UPDATE `creature_template` SET `gossip_menu_id`=7994 WHERE `entry`=19578; -- Bot-Specialist Alley <B.O.O.M.>
+UPDATE `creature_template` SET `gossip_menu_id`=8001 WHERE `entry`=19617; -- Boots <B.O.O.M. Master Mixologist>
+UPDATE `creature_template` SET `gossip_menu_id`=8003 WHERE `entry`=19634; -- Lead Sapper Blastfizzle <B.O.O.M. Sap Foreman>
+UPDATE `creature_template` SET `gossip_menu_id`=8024 WHERE `entry`=19644; -- Image of Archmage Vargoth
+UPDATE `creature_template` SET `gossip_menu_id`=8008 WHERE `entry`=19645; -- Papa Wheeler <B.O.O.M. Mech Tech>
+UPDATE `creature_template` SET `gossip_menu_id`=8030 WHERE `entry`=19709; -- Chief Engineer Trep <B.O.O.M. Engineering>
+UPDATE `creature_template` SET `gossip_menu_id`=8032 WHERE `entry`=19728; -- Mama Wheeler <B.O.O.M. Mech Tech>
+UPDATE `creature_template` SET `gossip_menu_id`=8048 WHERE `entry`=19880; -- Nether-Stalker Khay'ji
+UPDATE `creature_template` SET `gossip_menu_id`=8054 WHERE `entry`=20066; -- Gahruj
+UPDATE `creature_template` SET `gossip_menu_id`=8055 WHERE `entry`=20067; -- Zuben Elgenubi
+UPDATE `creature_template` SET `gossip_menu_id`=8056 WHERE `entry`=20068; -- Zuben Eschamali
+UPDATE `creature_template` SET `gossip_menu_id`=8071 WHERE `entry`=20071; -- Wind Trader Marid
+UPDATE `creature_template` SET `gossip_menu_id`=8063 WHERE `entry`=20092; -- Dealer Hazzin <General Provisioner>
+UPDATE `creature_template` SET `gossip_menu_id`=8068 WHERE `entry`=20110; -- Tyri
+UPDATE `creature_template` SET `gossip_menu_id`=8070 WHERE `entry`=20112; -- Wind Trader Tuluman <Weapon Merchant>
+UPDATE `creature_template` SET `gossip_menu_id`=8084 WHERE `entry`=20194; -- Dealer Dunar <General Provisioner>
+UPDATE `creature_template` SET `gossip_menu_id`=8101 WHERE `entry`=20281; -- Drijya
+UPDATE `creature_template` SET `gossip_menu_id`=8106 WHERE `entry`=20389; -- Lee Sparks <The Taskmaster>
+UPDATE `creature_template` SET `gossip_menu_id`=8107 WHERE `entry`=20393; -- Foreman Sundown
+UPDATE `creature_template` SET `gossip_menu_id`=8120 WHERE `entry`=20448; -- Commander Ameer <The Protectorate>
+UPDATE `creature_template` SET `gossip_menu_id`=8180 WHERE `entry`=20449; -- Researcher Navuud <The Protectorate>
+UPDATE `creature_template` SET `gossip_menu_id`=8183 WHERE `entry`=20450; -- Flesh Handler Viridius
+UPDATE `creature_template` SET `gossip_menu_id`=8126 WHERE `entry`=20463; -- Apprentice Andrethan
+UPDATE `creature_template` SET `gossip_menu_id`=8128 WHERE `entry`=20551; -- Agent Araxes <The Protectorate>
+UPDATE `creature_template` SET `gossip_menu_id`=8231 WHERE `entry`=20810; -- Mehrdad
+UPDATE `creature_template` SET `gossip_menu_id`=8229 WHERE `entry`=20903; -- Protectorate Nether Drake
+UPDATE `creature_template` SET `gossip_menu_id`=8207 WHERE `entry`=20907; -- Professor Dabiri
+UPDATE `creature_template` SET `gossip_menu_id`=8228 WHERE `entry`=20985; -- Captain Saeed
+UPDATE `creature_template` SET `gossip_menu_id`=8308 WHERE `entry`=21493; -- Kablamm Farflinger <Transportation Engineer>
+UPDATE `creature_template` SET `gossip_menu_id`=8542 WHERE `entry`=22427; -- Zarevhi
+UPDATE `creature_template` SET `gossip_menu_id`=8710 WHERE `entry`=23396; -- Krixel Pinchwhistle <Classic Alliance Mail & Plate>
+UPDATE `creature_template` SET `gossip_menu_id`=9781 WHERE `entry`=29145; -- Pulik Swiftsnip <Barber>
+
+-- Gossip Menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=7981 AND `text_id` IN (9826,9828);
+DELETE FROM `gossip_menu` WHERE `entry`=7991 AND `text_id`=9841;
+DELETE FROM `gossip_menu` WHERE `entry`=7994 AND `text_id`=9846;
+DELETE FROM `gossip_menu` WHERE `entry`=7995 AND `text_id`=9847;
+DELETE FROM `gossip_menu` WHERE `entry`=7996 AND `text_id`=9848;
+DELETE FROM `gossip_menu` WHERE `entry`=8001 AND `text_id`=9863;
+DELETE FROM `gossip_menu` WHERE `entry`=8003 AND `text_id`=9869;
+DELETE FROM `gossip_menu` WHERE `entry`=8008 AND `text_id`=9875;
+DELETE FROM `gossip_menu` WHERE `entry`=8024 AND `text_id`=9901;
+DELETE FROM `gossip_menu` WHERE `entry`=8030 AND `text_id`=9916;
+DELETE FROM `gossip_menu` WHERE `entry`=8032 AND `text_id`=9919;
+DELETE FROM `gossip_menu` WHERE `entry`=8048 AND `text_id`=9937;
+DELETE FROM `gossip_menu` WHERE `entry`=8054 AND `text_id`=9947;
+DELETE FROM `gossip_menu` WHERE `entry`=8055 AND `text_id`=9948;
+DELETE FROM `gossip_menu` WHERE `entry`=8056 AND `text_id`=9949;
+DELETE FROM `gossip_menu` WHERE `entry`=8063 AND `text_id`=9959;
+DELETE FROM `gossip_menu` WHERE `entry`=8068 AND `text_id`=9968;
+DELETE FROM `gossip_menu` WHERE `entry`=8070 AND `text_id`=9970;
+DELETE FROM `gossip_menu` WHERE `entry`=8071 AND `text_id`=9971;
+DELETE FROM `gossip_menu` WHERE `entry`=8084 AND `text_id`=9994;
+DELETE FROM `gossip_menu` WHERE `entry`=8101 AND `text_id`=10019;
+DELETE FROM `gossip_menu` WHERE `entry`=8106 AND `text_id`=10031;
+DELETE FROM `gossip_menu` WHERE `entry`=8107 AND `text_id`=10032;
+DELETE FROM `gossip_menu` WHERE `entry`=8120 AND `text_id`=10058;
+DELETE FROM `gossip_menu` WHERE `entry`=8121 AND `text_id`=10061;
+DELETE FROM `gossip_menu` WHERE `entry`=8122 AND `text_id`=10060;
+DELETE FROM `gossip_menu` WHERE `entry`=8123 AND `text_id`=10059;
+DELETE FROM `gossip_menu` WHERE `entry`=8126 AND `text_id`=10064;
+DELETE FROM `gossip_menu` WHERE `entry`=8128 AND `text_id`=10065;
+DELETE FROM `gossip_menu` WHERE `entry`=8180 AND `text_id`=10152;
+DELETE FROM `gossip_menu` WHERE `entry`=8183 AND `text_id`=10179;
+DELETE FROM `gossip_menu` WHERE `entry`=8207 AND `text_id`=10202;
+DELETE FROM `gossip_menu` WHERE `entry`=8228 AND `text_id`=10229;
+DELETE FROM `gossip_menu` WHERE `entry`=8229 AND `text_id`=10230;
+DELETE FROM `gossip_menu` WHERE `entry`=8231 AND `text_id`=10233;
+DELETE FROM `gossip_menu` WHERE `entry`=8308 AND `text_id`=10365;
+DELETE FROM `gossip_menu` WHERE `entry`=8542 AND `text_id`=10687;
+DELETE FROM `gossip_menu` WHERE `entry`=8710 AND `text_id`=10957;
+DELETE FROM `gossip_menu` WHERE `entry`=9781 AND `text_id`=13459;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(7981,9828),(7981, 9826),(7991,9841),(7994,9846),(7995,9847),
+(7996,9848),(8001,9863),(8003,9869),(8008,9875),(8024,9901),
+(8030,9916),(8032,9919),(8048,9937),(8054,9947),(8055,9948),
+(8056,9949),(8063,9959),(8068,9968),(8070,9970),(8071,9971),
+(8084,9994),(8101,10019),(8106,10031),(8107,10032),(8120,10058),
+(8121,10061),(8122,10060),(8123,10059),(8126,10064),(8128,10065),
+(8180,10152),(8183,10179),(8207,10202),(8228,10229),(8229,10230),
+(8231,10233),(8308,10365),(8542,10687),(8710,10957),(9781,13459);
+
+-- Insert npc_text from sniff
+DELETE FROM `npc_text` WHERE `ID` IN (10059,10061);
+INSERT INTO `npc_text` (`ID`,`text0_0`,`text0_1`,`lang0`,`prob0`,`em0_0`,`em0_1`,`em0_2`,`em0_3`,`em0_4`,`em0_5`,`text1_0`,`text1_1`,`lang1`,`prob1`,`em1_0`,`em1_1`,`em1_2`,`em1_3`,`em1_4`,`em1_5`,`text2_0`,`text2_1`,`lang2`,`prob2`,`em2_0`,`em2_1`,`em2_2`,`em2_3`,`em2_4`,`em2_5`,`text3_0`,`text3_1`,`lang3`,`prob3`,`em3_0`,`em3_1`,`em3_2`,`em3_3`,`em3_4`,`em3_5`,`text4_0`,`text4_1`,`lang4`,`prob4`,`em4_0`,`em4_1`,`em4_2`,`em4_3`,`em4_4`,`em4_5`,`text5_0`,`text5_1`,`lang5`,`prob5`,`em5_0`,`em5_1`,`em5_2`,`em5_3`,`em5_4`,`em5_5`,`text6_0`,`text6_1`,`lang6`,`prob6`,`em6_0`,`em6_1`,`em6_2`,`em6_3`,`em6_4`,`em6_5`,`text7_0`,`text7_1`,`lang7`,`prob7`,`em7_0`,`em7_1`,`em7_2`,`em7_3`,`em7_4`,`em7_5`,`WDBVerified`) VALUES
+(10059,'The Ethereum were the ruling class of ethereal on my homeworld of K''aresh. Tragically, we were forced to evacuate K''aresh shortly before the void lord, Dimensius, unleashed his void armies upon the world and utterly decimated all that stood in his way. For this act, the Ethereum vowed vengeance. They have been tracking Dimensius ever since...$B$BThe Protectorate, however, were not a reaction to Dimensius. We were a reaction to Ethereum.','',0,1,0,1,0,1,0,1,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,1,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340),
+(10061,'We feel that the Ethereum are as great a threat to our existence as Dimensius. Both must be stopped...','',0,1,0,1,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,'','',0,0,0,0,0,0,0,0,12340);
+
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (8001,8063,8070,8084,8103,8120,8121,8122,8123,8126,8710) AND `id`=0;
+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
+(8001, 0, 1, 'Boots, what do you have back there that goes down smooth?', 3, 128, 0, 0, 0, 0, ''),
+(8063, 0, 1, 'Dealer Hazzin, what do you have to offer?', 3, 128, 0, 0, 0, 0, ''),
+(8070, 0, 1, 'What do you have to sell, Tuluman?', 3, 128, 0, 0, 0, 0, ''),
+(8084, 0, 1, 'Dealer Dunar, I wish to browse your wares.', 3, 128, 0, 0, 0, 0, ''),
+(8103, 0, 5, 'Make this inn your home.', 8, 65536, 0, 0, 0, 0, ''),
+(8120, 0, 0, 'What are Ethereum?', 1, 1, 8123, 0, 0, 0, ''),
+(8121, 0, 0, 'I think I understand now. Can I help with any of this? The Ethereum and void creatures are a threat to our survival as well.', 1, 1, 8120, 0, 0, 0, ''),
+(8122, 0, 0, 'So what is your purpose?', 1, 1, 8121, 0, 0, 0, ''),
+(8123, 0, 0, 'I don''t understand. What do you mean, Ameer?', 1, 1, 8122, 0, 0, 0, ''),
+(8126, 0, 1, 'I wish to browse your wares.', 3, 128, 0, 0, 0, 0, ''),
+(8710, 0, 1, 'Let me browse your goods.', 3, 128, 0, 0, 0, 0, '');
+
+-- Conditions
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7981 AND `SourceEntry`=9828;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(14,7981,9828,0,0,9,0,10173,0,0,0,0,'','Ravandwyr - Show different gossip if player has taken quest 10173');
+
+-- Remove some old script text
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000649 AND -1000641;
+
+-- Add missing loot
+DELETE FROM `creature_loot_template` WHERE `entry`=30524 AND `item`=35490;
+INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES
+(30524,35490,-100,1,0,1,1);
+
+-- Add a missing gossip
+UPDATE `creature_template` SET `gossip_menu_id`=1100 WHERE `entry`=4963;
diff --git a/sql/updates/world/2012_06_20_01_world_sai.sql b/sql/updates/world/2012_06_20_01_world_sai.sql
new file mode 100644
index 00000000000..989550de185
--- /dev/null
+++ b/sql/updates/world/2012_06_20_01_world_sai.sql
@@ -0,0 +1,26 @@
+-- Razormaw SAI fixes quest 9689
+SET @ENTRY := 17592;
+UPDATE `creature_template` SET `AIName`= 'SmartAI',`ScriptName`='' WHERE `entry`=@ENTRY;
+DELETE FROM `creature_template_addon` WHERE `entry`=@ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`) VALUES (@ENTRY,50331648,1);
+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,0,0,100,0,6000,6000,7000,9000,11,31279,0,0,0,0,0,2,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Swipe'),
+(@ENTRY,0,1,0,0,0,100,0,26000,30000,26000,30000,11,8873,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Flame Breath'),
+(@ENTRY,0,2,0,0,0,50,0,12000,12000,12000,12000,11,14100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - Combat - Cast Terrifying Roar'),
+(@ENTRY,0,3,0,11,0,100,0,0,0,0,0,53,1,@ENTRY,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On spawn - Load Path'),
+(@ENTRY,0,4,0,40,0,100,0,10,@ENTRY,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Razormaw - On Reach waypoint - Remove unitflag');
+-- Waypoints for Razormaw
+DELETE FROM `waypoints` WHERE `entry` IN (@ENTRY);
+INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES
+(@ENTRY,1,-1045.958,-12583.85,111.7434, 'Razormaw'),
+(@ENTRY,2,-1045.115,-12583.31,111.7434, 'Razormaw'),
+(@ENTRY,3,-1213.006,-12663.19,200.4278, 'Razormaw'),
+(@ENTRY,4,-1204.485,-12626.66,200.4278, 'Razormaw'),
+(@ENTRY,5,-1204.906,-12599.65,188.7889, 'Razormaw'),
+(@ENTRY,6,-1206.845,-12579.84,173.2892, 'Razormaw'),
+(@ENTRY,7,-1203.169,-12555.49,160.956, 'Razormaw'),
+(@ENTRY,8,-1201.284,-12529.25,134.3167, 'Razormaw'),
+(@ENTRY,9,-1204.178,-12483.84,115.039, 'Razormaw'),
+(@ENTRY,10,-1204.349,-12465.61,104.7762, 'Razormaw'),
+(@ENTRY,11,-1205.651,-12460.52,97.53908, 'Razormaw');
diff --git a/sql/updates/world/2012_06_20_02_world_gossip.sql b/sql/updates/world/2012_06_20_02_world_gossip.sql
new file mode 100644
index 00000000000..c20cb99aa4a
--- /dev/null
+++ b/sql/updates/world/2012_06_20_02_world_gossip.sql
@@ -0,0 +1,17 @@
+ -- Prince Toreth <Dragon Riders of Loreth'Aran>
+UPDATE `creature_template` SET `gossip_menu_id`=7478 WHERE `entry`=17674;
+-- Creature Gossip_menu insert from sniff
+DELETE FROM `gossip_menu` WHERE `entry`=7474 AND `text_id`=9060;
+DELETE FROM `gossip_menu` WHERE `entry`=7475 AND `text_id`=9059;
+DELETE FROM `gossip_menu` WHERE `entry`=7476 AND `text_id`=9058;
+DELETE FROM `gossip_menu` WHERE `entry`=7477 AND `text_id`=9057;
+DELETE FROM `gossip_menu` WHERE `entry`=7478 AND `text_id`=9056;
+INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES
+(7474,9060),(7475, 9059),(7476,9058),(7477,9057),(7478,9056);
+-- Creature Gossip_menu_option insert from sniff
+DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (7478,7477,7476,7475) AND `id`=0;
+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
+(7478,0,0, 'Why do you suffer?',1,1,7477,0,0,0, ''),
+(7477,0,0, 'What is Ysera and how were you blessed?',1,1,7476,0,0,0, ''),
+(7476,0,0, 'Until what?',1,1,7475,0,0,0, ''),
+(7475,0,0, 'So why are you still here?',1,1,7474,0,0,0, '');
diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h
index 94ac452b9f3..68752b82e7f 100755
--- a/src/server/game/AI/CreatureAI.h
+++ b/src/server/game/AI/CreatureAI.h
@@ -128,8 +128,6 @@ class CreatureAI : public UnitAI
void OnCharmed(bool apply);
- //virtual void SpellClick(Player* player) {}
-
// Called at reaching home after evade
virtual void JustReachedHome() {}
@@ -171,6 +169,8 @@ class CreatureAI : public UnitAI
virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {}
+ virtual void OnSpellClick(Unit* /*clicker*/) { }
+
virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }
protected:
virtual void MoveInLineOfSight(Unit* /*who*/);
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 98b5c0a6ba3..96fc43e0572 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -696,8 +696,9 @@ void SmartAI::OnCharmed(bool apply)
GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply);
}
-void SmartAI::DoAction(const int32 /*param*/)
+void SmartAI::DoAction(const int32 param)
{
+ GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, NULL, param);
}
uint32 SmartAI::GetData(uint32 /*id*/)
@@ -825,27 +826,10 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId)
GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);
}
-/*
-SMART_EVENT_UPDATE_OOC
-SMART_EVENT_SPELLHIT
-SMART_EVENT_RANGE
-SMART_EVENT_RESPAWN
-SMART_EVENT_SUMMONED_UNIT
-SMART_EVENT_ACCEPTED_QUEST
-SMART_EVENT_REWARD_QUEST
-SMART_EVENT_TARGET_BUFFED
-SMART_EVENT_SUMMON_DESPAWNED
-SMART_EVENT_AI_INIT
-SMART_EVENT_DATA_SET
-SMART_EVENT_TEXT_OVER
-SMART_EVENT_TIMED_EVENT_TRIGGERED
-SMART_EVENT_UPDATE
-SMART_EVENT_LINK
-SMART_EVENT_GOSSIP_SELECT
-SMART_EVENT_JUST_CREATED
-SMART_EVENT_GOSSIP_HELLO
-SMART_EVENT_DEATH
-*/
+void SmartAI::OnSpellClick(Unit* clicker)
+{
+ GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);
+}
int SmartGameObjectAI::Permissible(const GameObject* g)
{
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index 3a3a7dc9510..79cef0c3b37 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -198,6 +198,8 @@ class SmartAI : public CreatureAI
void RemoveAuras();
+ void OnSpellClick(Unit* clicker);
+
private:
uint32 mFollowCreditType;
uint32 mFollowArrivedTimer;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 1b414029366..b6624586551 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -2534,6 +2534,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
case SMART_EVENT_JUST_CREATED:
case SMART_EVENT_GOSSIP_HELLO:
case SMART_EVENT_FOLLOW_COMPLETED:
+ case SMART_EVENT_ON_SPELLCLICK:
ProcessAction(e, unit, var0, var1, bvar, spell, gob);
break;
case SMART_EVENT_IS_BEHIND_TARGET:
@@ -2778,6 +2779,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
ProcessAction(e, NULL, var0);
break;
}
+ case SMART_EVENT_ACTION_DONE:
+ {
+ if (e.event.doAction.eventId != var0)
+ return;
+ ProcessAction(e, unit, var0);
+ break;
+ }
default:
sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
break;
@@ -2894,23 +2902,6 @@ void SmartScript::InstallEvents()
}
}
-bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3)
-{
- if (c == 0)
- return true;
-
- if (!u || !u->ToPlayer())
- return false;
-
- Condition cond;
- cond.ConditionType = ConditionTypes(uint32(c));
- cond.ConditionValue1 = uint32(v1);
- cond.ConditionValue1 = uint32(v2);
- cond.ConditionValue1 = uint32(v3);
- ConditionSourceInfo srcInfo = ConditionSourceInfo(u->ToPlayer());
- return cond.Meets(srcInfo);
-}
-
void SmartScript::OnUpdate(uint32 const diff)
{
if ((mScriptType == SMART_SCRIPT_TYPE_CREATURE || mScriptType == SMART_SCRIPT_TYPE_GAMEOBJECT) && !GetBaseObject())
diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h
index 5fb691c87f2..03d533e69e5 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.h
+++ b/src/server/game/AI/SmartScripts/SmartScript.h
@@ -83,8 +83,6 @@ class SmartScript
return obj && obj->GetTypeId() == TYPEID_GAMEOBJECT;
}
- bool ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3);
-
void OnUpdate(const uint32 diff);
void OnMoveInLineOfSight(Unit* who);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index bf84f39747a..de766d2a7e1 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -475,63 +475,76 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_EVENT_TRANSPORT_ADDCREATURE:
- {
- if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature))
- return false;
- break;
- }
+ {
+ if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature))
+ return false;
+ break;
+ }
case SMART_EVENT_MOVEMENTINFORM:
+ {
+ if (e.event.movementInform.type > NULL_MOTION_TYPE)
{
- if (e.event.movementInform.type > NULL_MOTION_TYPE)
- {
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
- return false;
- }
- break;
+ sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Motion type %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.movementInform.type);
+ return false;
}
+ break;
+ }
case SMART_EVENT_DATA_SET:
- {
- if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax))
- return false;
- break;
- }
+ {
+ if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax))
+ return false;
+ break;
+ }
case SMART_EVENT_AREATRIGGER_ONTRIGGER:
- {
- if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id))
- return false;
- break;
- }
+ {
+ if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id))
+ return false;
+ break;
+ }
case SMART_EVENT_TEXT_OVER:
//if (e.event.textOver.textGroupID && !IsTextValid(e, e.event.textOver.textGroupID)) return false;// 0 is a valid text group!
break;
case SMART_EVENT_LINK:
+ {
+ if (e.link && e.link == e.event_id)
{
- if (e.link && e.link == e.event_id)
- {
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
- return false;
- }
- break;
+ sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u, Event %u, Link Event is linking self (infinite loop), skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id);
+ return false;
}
+ break;
+ }
case SMART_EVENT_DUMMY_EFFECT:
+ {
if (!IsSpellValid(e, e.event.dummy.spell))
return false;
if (e.event.dummy.effIndex > EFFECT_2)
return false;
break;
+ }
case SMART_EVENT_IS_BEHIND_TARGET:
+ {
if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax))
return false;
break;
+ }
case SMART_EVENT_GAME_EVENT_START:
case SMART_EVENT_GAME_EVENT_END:
+ {
+ GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
+ if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid())
+ return false;
+ break;
+ }
+ case SMART_EVENT_ACTION_DONE:
+ {
+ if (e.event.doAction.eventId > EVENT_CHARGE)
{
- GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
- if (e.event.gameEvent.gameEventId >= events.size() || !events[e.event.gameEvent.gameEventId].isValid())
- return false;
- break;
+ sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid event id %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.doAction.eventId);
+ return false;
}
+ break;
+ }
case SMART_EVENT_GO_STATE_CHANGED:
case SMART_EVENT_GO_EVENT_INFORM:
case SMART_EVENT_TIMED_EVENT_TRIGGERED:
@@ -564,6 +577,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_GOSSIP_HELLO:
case SMART_EVENT_JUST_CREATED:
case SMART_EVENT_FOLLOW_COMPLETED:
+ case SMART_EVENT_ON_SPELLCLICK:
break;
default:
sLog->outErrorDb("SmartAIMgr: Not handled event_type(%u), Entry %d SourceType %u Event %u Action %u, skipped.", e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
index b82d0724f53..d71d71ce519 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h
@@ -22,7 +22,6 @@
#include "Creature.h"
#include "CreatureAI.h"
#include "Unit.h"
-#include "ConditionMgr.h"
#include "Spell.h"
//#include "SmartScript.h"
@@ -82,81 +81,82 @@ const uint32 SmartPhaseMask[SMART_EVENT_PHASE_COUNT][2] =
enum SMART_EVENT
{
- SMART_EVENT_UPDATE_IC = 0, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax
- SMART_EVENT_UPDATE_OOC = 1, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax
- SMART_EVENT_HEALT_PCT = 2, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax
- SMART_EVENT_MANA_PCT = 3, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax
- SMART_EVENT_AGGRO = 4, //1 // NONE
- SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3
- SMART_EVENT_DEATH = 6, //1 // NONE
- SMART_EVENT_EVADE = 7, //1 // NONE
- SMART_EVENT_SPELLHIT = 8, //1 // SpellID, School, CooldownMin, CooldownMax
- SMART_EVENT_RANGE = 9, //1 // MinDist, MaxDist, RepeatMin, RepeatMax
- SMART_EVENT_OOC_LOS = 10, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax
- SMART_EVENT_RESPAWN = 11, //1 // type, MapId, ZoneId
- SMART_EVENT_TARGET_HEALTH_PCT = 12, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax
- SMART_EVENT_TARGET_CASTING = 13, //1 // RepeatMin, RepeatMax
- SMART_EVENT_FRIENDLY_HEALTH = 14, //1 // HPDeficit, Radius, RepeatMin, RepeatMax
- SMART_EVENT_FRIENDLY_IS_CC = 15, //1 // Radius, RepeatMin, RepeatMax
- SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, //1 // SpellId, Radius, RepeatMin, RepeatMax
- SMART_EVENT_SUMMONED_UNIT = 17, //1 // CreatureId(0 all), CooldownMin, CooldownMax
- SMART_EVENT_TARGET_MANA_PCT = 18, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax
- SMART_EVENT_ACCEPTED_QUEST = 19, //1 // QuestID(0any)
- SMART_EVENT_REWARD_QUEST = 20, //1 // QuestID(0any)
- SMART_EVENT_REACHED_HOME = 21, //1 // NONE
- SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
- SMART_EVENT_HAS_AURA = 23, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
- SMART_EVENT_TARGET_BUFFED = 24, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
- SMART_EVENT_RESET = 25, //1 // Called after combat, when the creature respawn and spawn.
-
- SMART_EVENT_IC_LOS = 26, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax
- SMART_EVENT_PASSENGER_BOARDED = 27, //1 // CooldownMin, CooldownMax
- SMART_EVENT_PASSENGER_REMOVED = 28, //1 // CooldownMin, CooldownMax
- SMART_EVENT_CHARMED = 29, //1 // NONE
- SMART_EVENT_CHARMED_TARGET = 30, //1 // NONE
- SMART_EVENT_SPELLHIT_TARGET = 31, //1 // SpellID, School, CooldownMin, CooldownMax
- SMART_EVENT_DAMAGED = 32, //1 // MinDmg, MaxDmg, CooldownMin, CooldownMax
- SMART_EVENT_DAMAGED_TARGET = 33, //1 // MinDmg, MaxDmg, CooldownMin, CooldownMax
- SMART_EVENT_MOVEMENTINFORM = 34, //1 // MovementType(any), PointID
- SMART_EVENT_SUMMON_DESPAWNED = 35, //1 // Entry, CooldownMin, CooldownMax
- SMART_EVENT_CORPSE_REMOVED = 36, //1 // NONE
- SMART_EVENT_AI_INIT = 37, //1 // NONE
- SMART_EVENT_DATA_SET = 38, //1 // Id, Value, CooldownMin, CooldownMax
- SMART_EVENT_WAYPOINT_START = 39, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_REACHED = 40, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_TRANSPORT_ADDPLAYER = 41, //1 // NONE
- SMART_EVENT_TRANSPORT_ADDCREATURE = 42, //1 // Entry (0 any)
- SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, //1 // NONE
- SMART_EVENT_TRANSPORT_RELOCATE = 44, //1 // PointId
- SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, //1 // Team (0 any), CooldownMin, CooldownMax
- SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, //1 // TriggerId(0 any)
- SMART_EVENT_QUEST_ACCEPTED = 47, //1 // none
- SMART_EVENT_QUEST_OBJ_COPLETETION = 48, //1 // none
- SMART_EVENT_QUEST_COMPLETION = 49, //1 // none
- SMART_EVENT_QUEST_REWARDED = 50, //1 // none
- SMART_EVENT_QUEST_FAIL = 51, //1 // none
- SMART_EVENT_TEXT_OVER = 52, //1 // GroupId from creature_text, creature entry who talks (0 any)
- SMART_EVENT_RECEIVE_HEAL = 53, //1 // MinHeal, MaxHeal, CooldownMin, CooldownMax
- SMART_EVENT_JUST_SUMMONED = 54, //1 // none
- SMART_EVENT_WAYPOINT_PAUSED = 55, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_RESUMED = 56, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_STOPPED = 57, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_WAYPOINT_ENDED = 58, //1 // PointId(0any), pathID(0any)
- SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, //1 // id
- SMART_EVENT_UPDATE = 60, //1 // InitialMin, InitialMax, RepeatMin, RepeatMax
- SMART_EVENT_LINK = 61, //1 // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly
- SMART_EVENT_GOSSIP_SELECT = 62, //1 // menuID, actionID
- SMART_EVENT_JUST_CREATED = 63, //1 // none
- SMART_EVENT_GOSSIP_HELLO = 64, //1 // none
- SMART_EVENT_FOLLOW_COMPLETED = 65, //1 // none
- SMART_EVENT_DUMMY_EFFECT = 66, //1 // spellId, effectIndex
- 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, //1 // go state
- SMART_EVENT_GO_EVENT_INFORM = 71, //1 // eventId
-
- SMART_EVENT_END = 72,
+ SMART_EVENT_UPDATE_IC = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ SMART_EVENT_UPDATE_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ SMART_EVENT_HEALT_PCT = 2, // HPMin%, HPMax%, RepeatMin, RepeatMax
+ SMART_EVENT_MANA_PCT = 3, // ManaMin%, ManaMax%, RepeatMin, RepeatMax
+ SMART_EVENT_AGGRO = 4, // NONE
+ SMART_EVENT_KILL = 5, // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3
+ SMART_EVENT_DEATH = 6, // NONE
+ SMART_EVENT_EVADE = 7, // NONE
+ SMART_EVENT_SPELLHIT = 8, // SpellID, School, CooldownMin, CooldownMax
+ SMART_EVENT_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax
+ SMART_EVENT_OOC_LOS = 10, // NoHostile, MaxRnage, CooldownMin, CooldownMax
+ SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId
+ SMART_EVENT_TARGET_HEALTH_PCT = 12, // HPMin%, HPMax%, RepeatMin, RepeatMax
+ SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax
+ SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax
+ SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax
+ SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax
+ SMART_EVENT_SUMMONED_UNIT = 17, // CreatureId(0 all), CooldownMin, CooldownMax
+ SMART_EVENT_TARGET_MANA_PCT = 18, // ManaMin%, ManaMax%, RepeatMin, RepeatMax
+ SMART_EVENT_ACCEPTED_QUEST = 19, // QuestID(0any)
+ SMART_EVENT_REWARD_QUEST = 20, // QuestID(0any)
+ SMART_EVENT_REACHED_HOME = 21, // NONE
+ SMART_EVENT_RECEIVE_EMOTE = 22, // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3
+ SMART_EVENT_HAS_AURA = 23, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
+ SMART_EVENT_TARGET_BUFFED = 24, // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax
+ SMART_EVENT_RESET = 25, // Called after combat, when the creature respawn and spawn.
+ SMART_EVENT_IC_LOS = 26, // NoHostile, MaxRnage, CooldownMin, CooldownMax
+ SMART_EVENT_PASSENGER_BOARDED = 27, // CooldownMin, CooldownMax
+ SMART_EVENT_PASSENGER_REMOVED = 28, // CooldownMin, CooldownMax
+ SMART_EVENT_CHARMED = 29, // NONE
+ SMART_EVENT_CHARMED_TARGET = 30, // NONE
+ SMART_EVENT_SPELLHIT_TARGET = 31, // SpellID, School, CooldownMin, CooldownMax
+ SMART_EVENT_DAMAGED = 32, // MinDmg, MaxDmg, CooldownMin, CooldownMax
+ SMART_EVENT_DAMAGED_TARGET = 33, // MinDmg, MaxDmg, CooldownMin, CooldownMax
+ SMART_EVENT_MOVEMENTINFORM = 34, // MovementType(any), PointID
+ SMART_EVENT_SUMMON_DESPAWNED = 35, // Entry, CooldownMin, CooldownMax
+ SMART_EVENT_CORPSE_REMOVED = 36, // NONE
+ SMART_EVENT_AI_INIT = 37, // NONE
+ SMART_EVENT_DATA_SET = 38, // Id, Value, CooldownMin, CooldownMax
+ SMART_EVENT_WAYPOINT_START = 39, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_REACHED = 40, // PointId(0any), pathID(0any)
+ SMART_EVENT_TRANSPORT_ADDPLAYER = 41, // NONE
+ SMART_EVENT_TRANSPORT_ADDCREATURE = 42, // Entry (0 any)
+ SMART_EVENT_TRANSPORT_REMOVE_PLAYER = 43, // NONE
+ SMART_EVENT_TRANSPORT_RELOCATE = 44, // PointId
+ SMART_EVENT_INSTANCE_PLAYER_ENTER = 45, // Team (0 any), CooldownMin, CooldownMax
+ SMART_EVENT_AREATRIGGER_ONTRIGGER = 46, // TriggerId(0 any)
+ SMART_EVENT_QUEST_ACCEPTED = 47, // none
+ SMART_EVENT_QUEST_OBJ_COPLETETION = 48, // none
+ SMART_EVENT_QUEST_COMPLETION = 49, // none
+ SMART_EVENT_QUEST_REWARDED = 50, // none
+ SMART_EVENT_QUEST_FAIL = 51, // none
+ SMART_EVENT_TEXT_OVER = 52, // GroupId from creature_text, creature entry who talks (0 any)
+ SMART_EVENT_RECEIVE_HEAL = 53, // MinHeal, MaxHeal, CooldownMin, CooldownMax
+ SMART_EVENT_JUST_SUMMONED = 54, // none
+ SMART_EVENT_WAYPOINT_PAUSED = 55, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_RESUMED = 56, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_STOPPED = 57, // PointId(0any), pathID(0any)
+ SMART_EVENT_WAYPOINT_ENDED = 58, // PointId(0any), pathID(0any)
+ SMART_EVENT_TIMED_EVENT_TRIGGERED = 59, // id
+ SMART_EVENT_UPDATE = 60, // InitialMin, InitialMax, RepeatMin, RepeatMax
+ SMART_EVENT_LINK = 61, // INTERNAL USAGE, no params, used to link together multiple events, does not use any extra resources to iterate event lists needlessly
+ SMART_EVENT_GOSSIP_SELECT = 62, // menuID, actionID
+ SMART_EVENT_JUST_CREATED = 63, // none
+ SMART_EVENT_GOSSIP_HELLO = 64, // none
+ SMART_EVENT_FOLLOW_COMPLETED = 65, // none
+ SMART_EVENT_DUMMY_EFFECT = 66, // spellId, effectIndex
+ SMART_EVENT_IS_BEHIND_TARGET = 67, // cooldownMin, CooldownMax
+ SMART_EVENT_GAME_EVENT_START = 68, // game_event.Entry
+ SMART_EVENT_GAME_EVENT_END = 69, // game_event.Entry
+ SMART_EVENT_GO_STATE_CHANGED = 70, // go state
+ SMART_EVENT_GO_EVENT_INFORM = 71, // eventId
+ SMART_EVENT_ACTION_DONE = 72, // eventId (SharedDefines.EventId)
+ SMART_EVENT_ON_SPELLCLICK = 73, // clicker (unit)
+
+ SMART_EVENT_END = 74,
};
struct SmartEvent
@@ -356,6 +356,11 @@ struct SmartEvent
uint32 eventId;
} eventInform;
+ struct
+ {
+ uint32 eventId;
+ } doAction;
+
struct
{
uint32 param1;
@@ -1173,6 +1178,8 @@ const uint32 SmartAIEventMask[SMART_EVENT_END][2] =
{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 },
+ {SMART_EVENT_ACTION_DONE, SMART_SCRIPT_TYPE_MASK_CREATURE },
+ {SMART_EVENT_ON_SPELLCLICK, SMART_SCRIPT_TYPE_MASK_CREATURE },
};
enum SmartEventFlags
@@ -1385,26 +1392,6 @@ class SmartAIMgr
}
return true;
}
- /*inline bool IsConditionValid(SmartScriptHolder e, int32 t, int32 v1, int32 v2, int32 v3)
- {
- bool error = false;
- if (t > 0 && v1 >= 0 && v2 >= 0 && v3 >= 0)
- {
- Condition cond;
- cond.mConditionType = ConditionType(t);
- cond.mConditionValue1 = uint32(v1);
- cond.mConditionValue2 = uint32(v2);
- cond.mConditionValue3 = uint32(v3);
- if (!sConditionMgr->isConditionTypeValid(&cond))
- error = true;
- }
- if (error)
- {
- sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses invalid Condition, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
- return false;
- }
- return true;
- }*/
bool IsTextEmoteValid(SmartScriptHolder const& e, uint32 entry)
{
diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp
index 2a9f4212f46..450c05329b4 100755
--- a/src/server/game/Achievements/AchievementMgr.cpp
+++ b/src/server/game/Achievements/AchievementMgr.cpp
@@ -2208,7 +2208,6 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList()
for (uint32 entryId = 0; entryId < sAchievementCriteriaStore.GetNumRows(); ++entryId)
{
-
AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId);
if (!criteria)
continue;
@@ -2239,7 +2238,6 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
for (uint32 entryId = 0; entryId < sAchievementStore.GetNumRows(); ++entryId)
{
-
AchievementEntry const* achievement = sAchievementStore.LookupEntry(entryId);
if (!achievement || !achievement->refAchievement)
continue;
@@ -2248,6 +2246,10 @@ void AchievementGlobalMgr::LoadAchievementReferenceList()
++count;
}
+ // Once Bitten, Twice Shy (10 player) - Icecrown Citadel
+ if (AchievementEntry const* achievement = sAchievementStore.LookupEntry(4539))
+ const_cast<AchievementEntry*>(achievement)->mapID = 631; // Correct map requirement (currently has Ulduar)
+
sLog->outString(">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index cc64a8e22dd..f96199f9bd3 100755
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -92,40 +92,6 @@ ChatCommand* ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand castCommandTable[] =
- {
- { "back", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastBackCommand>, "", NULL },
- { "dist", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDistCommand>, "", NULL },
- { "self", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastSelfCommand>, "", NULL },
- { "target", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastTargetCommand>, "", NULL },
- { "dest", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastDestCommand>, "", NULL },
- { "", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleCastCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand characterDeletedCommandTable[] =
- {
- { "delete", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedDeleteCommand>, "", NULL },
- { "list", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedListCommand>, "", NULL },
- { "restore", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterDeletedRestoreCommand>, "", NULL },
- { "old", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterDeletedOldCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand characterCommandTable[] =
- {
- { "customize", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterCustomizeCommand>, "", NULL },
- { "changefaction", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeFactionCommand>, "", NULL },
- { "changerace", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterChangeRaceCommand>, "", NULL },
- { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable},
- { "erase", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleCharacterEraseCommand>, "", NULL },
- { "level", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleCharacterLevelCommand>, "", NULL },
- { "rename", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterRenameCommand>, "", NULL },
- { "reputation", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterReputationCommand>, "", NULL },
- { "titles", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleCharacterTitlesCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
static ChatCommand channelSetCommandTable[] =
{
{ "ownership", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleChannelSetOwnership>, "", NULL },
@@ -156,15 +122,6 @@ ChatCommand* ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand instanceCommandTable[] =
- {
- { "listbinds", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceListBindsCommand>, "", NULL },
- { "unbind", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceUnbindCommand>, "", NULL },
- { "stats", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleInstanceStatsCommand>, "", NULL },
- { "savedata", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleInstanceSaveDataCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
static ChatCommand listCommandTable[] =
{
{ "creature", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleListCreatureCommand>, "", NULL },
@@ -238,60 +195,6 @@ ChatCommand* ChatHandler::getCommandTable()
{ NULL, 0, false, NULL, "", NULL }
};
- static ChatCommand serverIdleRestartCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverIdleShutdownCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverRestartCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverShutdownCommandTable[] =
- {
- { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
- { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverSetCommandTable[] =
- {
- { "difftime", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetDiffTimeCommand>, "", NULL },
- { "loglevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogLevelCommand>, "", NULL },
- { "logfilelevel", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerSetLogFileLevelCommand>, "", NULL },
- { "motd", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetMotdCommand>, "", NULL },
- { "closed", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerSetClosedCommand>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
- static ChatCommand serverCommandTable[] =
- {
- { "corpses", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleServerCorpsesCommand>, "", NULL },
- { "exit", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerExitCommand>, "", NULL },
- { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
- { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
- { "info", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerInfoCommand>, "", NULL },
- { "motd", SEC_PLAYER, true, OldHandler<&ChatHandler::HandleServerMotdCommand>, "", NULL },
- { "plimit", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerPLimitCommand>, "", NULL },
- { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
- { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
- { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
- { "togglequerylog", SEC_CONSOLE, true, OldHandler<&ChatHandler::HandleServerToggleQueryLogging>, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
- };
-
static ChatCommand unbanCommandTable[] =
{
{ "account", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleUnBanAccountCommand>, "", NULL },
@@ -331,16 +234,12 @@ ChatCommand* ChatHandler::getCommandTable()
static ChatCommand commandTable[] =
{
- { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable},
{ "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
{ "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
{ "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
{ "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
{ "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable },
- { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
{ "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable },
- { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
- { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
{ "channel", SEC_ADMINISTRATOR, true, NULL, "", channelCommandTable },
diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h
index e88914a2daf..c43b0fa9aca 100755
--- a/src/server/game/Chat/Chat.h
+++ b/src/server/game/Chat/Chat.h
@@ -119,10 +119,13 @@ class ChatHandler
GameObject* GetNearbyGameObject();
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry);
- bool HasSentErrorMessage() const { return sentErrorMessage;}
- void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
- static bool LoadCommandTable() { return load_command_table;}
- static void SetLoadCommandTable(bool val){ load_command_table = val;};
+ bool HasSentErrorMessage() const { return sentErrorMessage; }
+ void SetSentErrorMessage(bool val){ sentErrorMessage = val; }
+ static bool LoadCommandTable() { return load_command_table; }
+ static void SetLoadCommandTable(bool val) { load_command_table = val; }
+
+ // cs_character
+ void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel);
protected:
explicit ChatHandler() : m_session(NULL) {} // for CLI subclass
@@ -147,26 +150,6 @@ class ChatHandler
bool HandleBanListCharacterCommand(const char* args);
bool HandleBanListIPCommand(const char* args);
- bool HandleCastCommand(const char *args);
- bool HandleCastBackCommand(const char *args);
- bool HandleCastDistCommand(const char *args);
- bool HandleCastSelfCommand(const char *args);
- bool HandleCastTargetCommand(const char *args);
- bool HandleCastDestCommand(const char *args);
-
- bool HandleCharacterCustomizeCommand(const char* args);
- bool HandleCharacterChangeFactionCommand(const char* args);
- bool HandleCharacterChangeRaceCommand(const char * args);
- bool HandleCharacterDeletedDeleteCommand(const char* args);
- bool HandleCharacterDeletedListCommand(const char* args);
- bool HandleCharacterDeletedRestoreCommand(const char* args);
- bool HandleCharacterDeletedOldCommand(const char* args);
- bool HandleCharacterEraseCommand(const char* args);
- bool HandleCharacterLevelCommand(const char* args);
- bool HandleCharacterRenameCommand(const char* args);
- bool HandleCharacterReputationCommand(const char* args);
- bool HandleCharacterTitlesCommand(const char* args);
-
bool HandleChannelSetOwnership(const char *args);
bool HandlePossessCommand(const char* args);
@@ -180,11 +163,6 @@ class ChatHandler
bool HandleGuildRankCommand(const char* args);
bool HandleGuildDeleteCommand(const char* args);
- bool HandleInstanceListBindsCommand(const char* args);
- bool HandleInstanceUnbindCommand(const char* args);
- bool HandleInstanceStatsCommand(const char* args);
- bool HandleInstanceSaveDataCommand(const char * args);
-
bool HandleListAurasCommand(const char * args);
bool HandleListCreatureCommand(const char* args);
bool HandleListItemCommand(const char* args);
@@ -224,24 +202,6 @@ class ChatHandler
bool HandleSendMessageCommand(const char * args);
bool HandleSendMoneyCommand(const char* args);
- bool HandleServerCorpsesCommand(const char* args);
- bool HandleServerExitCommand(const char* args);
- bool HandleServerIdleRestartCommand(const char* args);
- bool HandleServerIdleShutDownCommand(const char* args);
- bool HandleServerInfoCommand(const char* args);
- bool HandleServerMotdCommand(const char* args);
- bool HandleServerPLimitCommand(const char* args);
- bool HandleServerRestartCommand(const char* args);
- bool HandleServerSetLogLevelCommand(const char* args);
- bool HandleServerSetMotdCommand(const char* args);
- bool HandleServerShutDownCommand(const char* args);
- bool HandleServerShutDownCancelCommand(const char* args);
- bool HandleServerSetClosedCommand(const char* args);
- bool HandleServerToggleQueryLogging(const char* args);
-
- bool HandleServerSetLogFileLevelCommand(const char* args);
- bool HandleServerSetDiffTimeCommand(const char* args);
-
bool HandleUnBanAccountCommand(const char* args);
bool HandleUnBanAccountByCharCommand(const char* args);
bool HandleUnBanCharacterCommand(const char* args);
@@ -354,25 +314,8 @@ class ChatHandler
bool HandleBanHelper(BanMode mode, char const* args);
bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
bool HandleUnBanHelper(BanMode mode, char const* args);
- void HandleCharacterLevel(Player* player, uint64 playerGuid, uint32 oldLevel, uint32 newLevel);
void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id);
- // Stores informations about a deleted character
- struct DeletedInfo
- {
- uint32 lowguid; ///< the low GUID from the character
- std::string name; ///< the character name
- uint32 accountId; ///< the account id
- std::string accountName; ///< the account name
- time_t deleteDate; ///< the date at which the character has been deleted
- };
-
- typedef std::list<DeletedInfo> DeletedInfoList;
- bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString = "");
- std::string GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end);
- void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList);
- void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo);
-
private:
bool _HandleGMTicketResponseAppendCommand(const char* args, bool newLine);
diff --git a/src/server/game/Chat/Commands/Level0.cpp b/src/server/game/Chat/Commands/Level0.cpp
index b2ac090c313..b05ba9b4194 100755
--- a/src/server/game/Chat/Commands/Level0.cpp
+++ b/src/server/game/Chat/Commands/Level0.cpp
@@ -80,29 +80,6 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/)
return true;
}
-bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
-{
- uint32 playersNum = sWorld->GetPlayerCount();
- uint32 maxPlayersNum = sWorld->GetMaxPlayerCount();
- uint32 activeClientsNum = sWorld->GetActiveSessionCount();
- uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
- uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
- uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount();
- std::string uptime = secsToTimeString(sWorld->GetUptime());
- uint32 updateTime = sWorld->GetUpdateTime();
-
- SendSysMessage(_FULLVERSION);
- PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
- PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
- PSendSysMessage(LANG_UPTIME, uptime.c_str());
- PSendSysMessage(LANG_UPDATE_DIFF, updateTime);
- //! Can't use sWorld->ShutdownMsg here in case of console command
- if (sWorld->IsShuttingDown())
- PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str());
-
- return true;
-}
-
bool ChatHandler::HandleDismountCommand(const char* /*args*/)
{
Player* player = m_session->GetPlayer();
@@ -150,10 +127,3 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
return true;
}
-/// Display the 'Message of the day' for the realm
-bool ChatHandler::HandleServerMotdCommand(const char* /*args*/)
-{
- PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd());
- return true;
-}
-
diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp
index 52bdcd15163..42a379753d5 100755
--- a/src/server/game/Chat/Commands/Level2.cpp
+++ b/src/server/game/Chat/Commands/Level2.cpp
@@ -456,190 +456,6 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
return true;
}
-//rename characters
-bool ChatHandler::HandleCharacterRenameCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- if (target)
- {
- // check online security
- if (HasLowerSecurity(target, 0))
- return false;
-
- PSendSysMessage(LANG_RENAME_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_RENAME);
- }
- else
- {
- // check offline security
- if (HasLowerSecurity(NULL, targetGuid))
- return false;
-
- std::string oldNameLink = playerLink(targetName);
-
- PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
-
- CharacterDatabase.Execute(stmt);
- }
-
- return true;
-}
-
-// customize characters
-bool ChatHandler::HandleCharacterCustomizeCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
-
- if (target)
- {
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
-
- stmt->setUInt32(1, target->GetGUIDLow());
- }
- else
- {
- std::string oldNameLink = playerLink(targetName);
-
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
-
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
- }
-
- CharacterDatabase.Execute(stmt);
-
- return true;
-}
-
-bool ChatHandler::HandleCharacterChangeFactionCommand(const char* args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
-
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
-
- if (target)
- {
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
-
- stmt->setUInt32(1, target->GetGUIDLow());
- }
- else
- {
- std::string oldNameLink = playerLink(targetName);
-
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
-
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
- }
-
- CharacterDatabase.Execute(stmt);
-
- return true;
-}
-
-bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
-{
- Player* target;
- uint64 targetGuid;
- std::string targetName;
- if (!extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
- return false;
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
-
- stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
-
- if (target)
- {
- // TODO : add text into database
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER, GetNameLink(target).c_str());
- target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
-
- stmt->setUInt32(1, target->GetGUIDLow());
- }
- else
- {
- std::string oldNameLink = playerLink(targetName);
-
- // TODO : add text into database
- PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
-
- stmt->setUInt32(1, GUID_LOPART(targetGuid));
- }
-
- CharacterDatabase.Execute(stmt);
-
- return true;
-}
-
-bool ChatHandler::HandleCharacterReputationCommand(const char* args)
-{
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- LocaleConstant loc = GetSessionDbcLocale();
-
- FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
- for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
- {
- const FactionState& faction = itr->second;
- FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
- char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
- ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
- std::string rankName = GetTrinityString(ReputationRankStrIndex[rank]);
- std::ostringstream ss;
- if (m_session)
- ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r";
- else
- ss << faction.ID << " - " << factionName << ' ' << localeNames[loc];
-
- ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
-
- if (faction.Flags & FACTION_FLAG_VISIBLE)
- ss << GetTrinityString(LANG_FACTION_VISIBLE);
- if (faction.Flags & FACTION_FLAG_AT_WAR)
- ss << GetTrinityString(LANG_FACTION_ATWAR);
- if (faction.Flags & FACTION_FLAG_PEACE_FORCED)
- ss << GetTrinityString(LANG_FACTION_PEACE_FORCED);
- if (faction.Flags & FACTION_FLAG_HIDDEN)
- ss << GetTrinityString(LANG_FACTION_HIDDEN);
- if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED)
- ss << GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
- if (faction.Flags & FACTION_FLAG_INACTIVE)
- ss << GetTrinityString(LANG_FACTION_INACTIVE);
-
- SendSysMessage(ss.str().c_str());
- }
- return true;
-}
-
bool ChatHandler::HandleLookupEventCommand(const char* args)
{
if (!*args)
@@ -846,13 +662,6 @@ bool ChatHandler::LookupPlayerSearchCommand(PreparedQueryResult result, int32 li
return true;
}
-/// Triggering corpses expire check in world
-bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
-{
- sObjectAccessor->RemoveOldCorpses();
- return true;
-}
-
bool ChatHandler::HandleRepairitemsCommand(const char* args)
{
Player* target;
@@ -1128,43 +937,3 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
SendSysMessage(LANG_COMMAND_NOTITLEFOUND);
return true;
}
-
-bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
-{
- if (!*args)
- return false;
-
- Player* target;
- if (!extractPlayerTarget((char*)args, &target))
- return false;
-
- LocaleConstant loc = GetSessionDbcLocale();
- char const* targetName = target->GetName();
- char const* knownStr = GetTrinityString(LANG_KNOWN);
-
- // Search in CharTitles.dbc
- for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
- {
- CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
- if (titleInfo && target->HasTitle(titleInfo))
- {
- std::string name = titleInfo->name[loc];
- if (name.empty())
- continue;
-
- char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
- ? GetTrinityString(LANG_ACTIVE)
- : "";
-
- char titleNameStr[80];
- snprintf(titleNameStr, 80, name.c_str(), targetName);
-
- // send title in "id (idx:idx) - [namedlink locale]" format
- if (m_session)
- PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
- else
- PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
- }
- }
- return true;
-}
diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp
index 4b2f1c5e7bb..33855a96617 100755
--- a/src/server/game/Chat/Commands/Level3.cpp
+++ b/src/server/game/Chat/Commands/Level3.cpp
@@ -2198,47 +2198,6 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 playerGuid, uint32
}
}
-bool ChatHandler::HandleCharacterLevelCommand(const char *args)
-{
- char* nameStr;
- char* levelStr;
- extractOptFirstArg((char*)args, &nameStr, &levelStr);
- if (!levelStr)
- return false;
-
- // exception opt second arg: .character level $name
- if (isalpha(levelStr[0]))
- {
- nameStr = levelStr;
- levelStr = NULL; // current level will used
- }
-
- Player* target;
- uint64 target_guid;
- std::string target_name;
- if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
- return false;
-
- int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid);
- int32 newlevel = levelStr ? atoi(levelStr) : oldlevel;
-
- if (newlevel < 1)
- return false; // invalid level
-
- if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
- newlevel = STRONG_MAX_LEVEL;
-
- HandleCharacterLevel(target, target_guid, oldlevel, newlevel);
-
- if (!m_session || m_session->GetPlayer() != target) // including player == NULL
- {
- std::string nameLink = playerLink(target_name);
- PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
- }
-
- return true;
-}
-
bool ChatHandler::HandleLevelUpCommand(const char *args)
{
char* nameStr;
@@ -2698,152 +2657,6 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
return true;
}
-bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/)
-{
- sWorld->ShutdownCancel();
- return true;
-}
-
-bool ChatHandler::HandleServerShutDownCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, 0, exitcode);
- }
- else
- sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleServerRestartCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode);
- }
- else
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleServerIdleRestartCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
- }
- else
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
- return true;
-}
-
-bool ChatHandler::HandleServerIdleShutDownCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char* time_str = strtok ((char*) args, " ");
- char* exitcode_str = strtok (NULL, "");
-
- int32 time = atoi (time_str);
-
- ///- Prevent interpret wrong arg value as 0 secs shutdown time
- if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
- return false;
-
- if (exitcode_str)
- {
- int32 exitcode = atoi (exitcode_str);
-
- // Handle atoi() errors
- if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
- return false;
-
- // Exit code should be in range of 0-125, 126-255 is used
- // in many shells for their own return codes and code > 255
- // is not supported in many others
- if (exitcode < 0 || exitcode > 125)
- return false;
-
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode);
- }
- else
- sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
- return true;
-}
-
bool ChatHandler::HandleBanAccountCommand(const char *args)
{
return HandleBanHelper(BAN_ACCOUNT, args);
@@ -3764,277 +3577,6 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
return true;
}
-bool ChatHandler::HandleServerPLimitCommand(const char *args)
-{
- if (*args)
- {
- char* param = strtok((char*)args, " ");
- if (!param)
- return false;
-
- int l = strlen(param);
-
- if (strncmp(param, "player", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_PLAYER);
- else if (strncmp(param, "moderator", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_MODERATOR);
- else if (strncmp(param, "gamemaster", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER);
- else if (strncmp(param, "administrator", l) == 0)
- sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
- else if (strncmp(param, "reset", l) == 0)
- {
- sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100));
- sWorld->LoadDBAllowedSecurityLevel();
- }
- else
- {
- int val = atoi(param);
- if (val < 0)
- sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
- else
- sWorld->SetPlayerAmountLimit(uint32(val));
- }
- }
-
- uint32 pLimit = sWorld->GetPlayerAmountLimit();
- AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
- char const* secName = "";
- switch (allowedAccountType)
- {
- case SEC_PLAYER: secName = "Player"; break;
- case SEC_MODERATOR: secName = "Moderator"; break;
- case SEC_GAMEMASTER: secName = "Gamemaster"; break;
- case SEC_ADMINISTRATOR: secName = "Administrator"; break;
- default: secName = "<unknown>"; break;
- }
-
- PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName);
-
- return true;
-}
-
-bool ChatHandler::HandleCastCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Unit* target = getSelectedUnit();
-
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell)
- return false;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (!spellInfo)
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- m_session->GetPlayer()->CastSpell(target, spell, triggered);
-
- return true;
-}
-
-bool ChatHandler::HandleCastBackCommand(const char *args)
-{
- Creature* caster = getSelectedCreature();
-
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellMgr->GetSpellInfo(spell))
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- caster->CastSpell(m_session->GetPlayer(), spell, triggered);
-
- return true;
-}
-
-bool ChatHandler::HandleCastDistCommand(const char *args)
-{
- if (!*args)
- return false;
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell)
- return false;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (!spellInfo)
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
- SetSentErrorMessage(true);
- return false;
- }
-
- char *distStr = strtok(NULL, " ");
-
- float dist = 0;
-
- if (distStr)
- sscanf(distStr, "%f", &dist);
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- float x, y, z;
- m_session->GetPlayer()->GetClosePoint(x, y, z, dist);
-
- m_session->GetPlayer()->CastSpell(x, y, z, spell, triggered);
- return true;
-}
-
-bool ChatHandler::HandleCastTargetCommand(const char *args)
-{
- Creature* caster = getSelectedCreature();
-
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!caster->getVictim())
- {
- SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellMgr->GetSpellInfo(spell))
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- caster->CastSpell(caster->getVictim(), spell, triggered);
-
- return true;
-}
-
-bool ChatHandler::HandleCastDestCommand(const char *args)
-{
- Unit* caster = getSelectedUnit();
- if (!caster)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell || !sSpellMgr->GetSpellInfo(spell))
- {
- PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
- SetSentErrorMessage(true);
- return false;
- }
-
- char* px = strtok(NULL, " ");
- char* py = strtok(NULL, " ");
- char* pz = strtok(NULL, " ");
-
- if (!px || !py || !pz)
- return false;
-
- float x = (float)atof(px);
- float y = (float)atof(py);
- float z = (float)atof(pz);
-
- char* trig_str = strtok(NULL, " ");
- if (trig_str)
- {
- int l = strlen(trig_str);
- if (strncmp(trig_str, "triggered", l) != 0)
- return false;
- }
-
- bool triggered = (trig_str != NULL);
-
- caster->CastSpell(x, y, z, spell, triggered);
-
- return true;
-}
-
/*
ComeToMe command REQUIRED for 3rd party scripting library to have access to PointMovementGenerator
Without this function 3rd party scripting library will get linking errors (unresolved external)
@@ -4061,196 +3603,6 @@ bool ChatHandler::HandleComeToMeCommand(const char *args)
return true;
}
-bool ChatHandler::HandleCastSelfCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Unit* target = getSelectedUnit();
-
- if (!target)
- {
- SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
- SetSentErrorMessage(true);
- return false;
- }
-
- // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
- uint32 spell = extractSpellIdFromLink((char*)args);
- if (!spell)
- return false;
-
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell);
- if (!spellInfo)
- return false;
-
- if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer()))
- {
- PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell);
- SetSentErrorMessage(true);
- return false;
- }
-
- target->CastSpell(target, spell, false);
-
- return true;
-}
-
-std::string GetTimeString(uint64 time)
-{
- uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE;
- std::ostringstream ss;
- if (days) ss << days << "d ";
- if (hours) ss << hours << "h ";
- ss << minute << 'm';
- return ss.str();
-}
-
-bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
-{
- Player* player = getSelectedPlayer();
- if (!player) player = m_session->GetPlayer();
- uint32 counter = 0;
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
- for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
- {
- InstanceSave* save = itr->second.save;
- std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
- PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
- counter++;
- }
- }
- PSendSysMessage("player binds: %d", counter);
- counter = 0;
- Group* group = player->GetGroup();
- if (group)
- {
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i));
- for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
- {
- InstanceSave* save = itr->second.save;
- std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
- PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
- counter++;
- }
- }
- }
- PSendSysMessage("group binds: %d", counter);
-
- return true;
-}
-
-bool ChatHandler::HandleInstanceUnbindCommand(const char *args)
-{
- if (!*args)
- return false;
-
- Player* player = getSelectedPlayer();
- if (!player)
- player = m_session->GetPlayer();
-
- char* map = strtok((char*)args, " ");
- char* pDiff = strtok(NULL, " ");
- int8 diff = -1;
- if (pDiff)
- diff = atoi(pDiff);
- uint16 counter = 0;
- uint16 MapId = 0;
-
- if (strcmp(map, "all"))
- {
- MapId = uint16(atoi(map));
- if (!MapId)
- return false;
- }
-
- for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
- {
- Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
- for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
- {
- InstanceSave* save = itr->second.save;
- if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
- {
- std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
- PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
- player->UnbindInstance(itr, Difficulty(i));
- counter++;
- }
- else
- ++itr;
- }
- }
- PSendSysMessage("instances unbound: %d", counter);
- return true;
-}
-
-bool ChatHandler::HandleInstanceStatsCommand(const char* /*args*/)
-{
- PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances());
- PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances());
- PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves());
- PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal());
- PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal());
- return true;
-}
-
-bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
-{
- Player* player = m_session->GetPlayer();
-
- Map* map = player->GetMap();
- if (!map->IsDungeon())
- {
- PSendSysMessage("Map is not a dungeon.");
- SetSentErrorMessage(true);
- return false;
- }
-
- if (!((InstanceMap*)map)->GetInstanceScript())
- {
- PSendSysMessage("Map has no instance data.");
- SetSentErrorMessage(true);
- return false;
- }
-
- ((InstanceMap*)map)->GetInstanceScript()->SaveToDB();
- return true;
-}
-
-/// Define the 'Message of the day' for the realm
-bool ChatHandler::HandleServerSetMotdCommand(const char *args)
-{
- sWorld->SetMotd(args);
- PSendSysMessage(LANG_MOTD_NEW, args);
- return true;
-}
-
-/// Set whether we accept new clients
-bool ChatHandler::HandleServerSetClosedCommand(const char *args)
-{
- if (strncmp(args, "on", 3) == 0)
- {
- SendSysMessage(LANG_WORLD_CLOSED);
- sWorld->SetClosed(true);
- return true;
- }
- else if (strncmp(args, "off", 4) == 0)
- {
- SendSysMessage(LANG_WORLD_OPENED);
- sWorld->SetClosed(false);
- return true;
- }
-
- SendSysMessage(LANG_USE_BOL);
- SetSentErrorMessage(true);
- return false;
-}
-
//Send items by mail
bool ChatHandler::HandleSendItemsCommand(const char *args)
{
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 07e8e37e82a..4d54d1599a8 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1676,11 +1676,15 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo)
// the check of mechanic immunity on DB (tested) because GetCreatureTemplate()->MechanicImmuneMask and m_spellImmune[IMMUNITY_MECHANIC] don't have same data.
bool immunedToAllEffects = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (!spellInfo->Effects[i].IsEffect())
+ continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immunedToAllEffects = false;
break;
}
+ }
if (immunedToAllEffects)
return true;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2646eae5351..d8e7e1c9717 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -8865,12 +8865,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
CastSpell(this, 70721, true);
break;
}
- // Bloodthirst (($m/100)% of max health)
- case 23880:
- {
- basepoints0 = int32(CountPctFromMaxHealth(triggerAmount));
- break;
- }
// Shamanistic Rage triggered spell
case 30824:
{
@@ -11457,6 +11451,8 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo)
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
+ if (!spellInfo->Effects[i].IsEffect())
+ continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immuneToAllEffects = false;
@@ -16933,7 +16929,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
Creature* creature = ToCreature();
if (creature && creature->IsAIEnabled)
- creature->AI()->DoAction(EVENT_SPELLCLICK);
+ creature->AI()->OnSpellClick(clicker);
return true;
}
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 9b63de0cdb8..98088f9ef6a 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1337,10 +1337,10 @@ class Unit : public WorldObject
uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); }
bool IsFullHealth() const { return GetHealth() == GetMaxHealth(); }
- bool HealthBelowPct(int32 pct) const { return GetHealth() * uint64(100) < GetMaxHealth() * uint64(pct); }
- bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return (int32(GetHealth()) - damage) * int64(100) < GetMaxHealth() * int64(pct); }
- bool HealthAbovePct(int32 pct) const { return GetHealth() * uint64(100) > GetMaxHealth() * uint64(pct); }
- bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return (GetHealth() + heal) * uint64(100) > GetMaxHealth() * uint64(pct); }
+ bool HealthBelowPct(int32 pct) const { return GetHealth() < CountPctFromMaxHealth(pct); }
+ bool HealthBelowPctDamaged(int32 pct, uint32 damage) const { return int64(GetHealth()) - int64(damage) < int64(CountPctFromMaxHealth(pct)); }
+ bool HealthAbovePct(int32 pct) const { return GetHealth() > CountPctFromMaxHealth(pct); }
+ bool HealthAbovePctHealed(int32 pct, uint32 heal) const { return uint64(GetHealth()) + uint64(heal) > CountPctFromMaxHealth(pct); }
float GetHealthPct() const { return GetMaxHealth() ? 100.f * GetHealth() / GetMaxHealth() : 0.0f; }
uint32 CountPctFromMaxHealth(int32 pct) const { return CalculatePctN(GetMaxHealth(), pct); }
uint32 CountPctFromCurHealth(int32 pct) const { return CalculatePctN(GetHealth(), pct); }
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 06aca10879d..f74d6c44be7 100755
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -3151,8 +3151,6 @@ enum SummonType
enum EventId
{
- EVENT_SPELLCLICK = 1001,
- EVENT_FALL_GROUND = 1002,
EVENT_CHARGE = 1003,
};
diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
index 0496d0862af..07a5761517e 100755
--- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
@@ -93,11 +93,6 @@ void PointMovementGenerator<T>::MovementInform(T & /*unit*/)
template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
{
- //if (id == EVENT_FALL_GROUND)
- //{
- // unit.setDeathState(JUST_DIED);
- // unit.SetFlying(true);
- //}
if (unit.AI())
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
}
diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp
index f64d0953e86..94da23110b8 100755
--- a/src/server/game/Scripting/ScriptLoader.cpp
+++ b/src/server/game/Scripting/ScriptLoader.cpp
@@ -46,12 +46,14 @@ void AddSC_SmartSCripts();
//Commands
void AddSC_account_commandscript();
void AddSC_achievement_commandscript();
+void AddSC_cast_commandscript();
void AddSC_debug_commandscript();
void AddSC_event_commandscript();
void AddSC_gm_commandscript();
void AddSC_go_commandscript();
void AddSC_gobject_commandscript();
void AddSC_honor_commandscript();
+void AddSC_instance_commandscript();
void AddSC_learn_commandscript();
void AddSC_misc_commandscript();
void AddSC_modify_commandscript();
@@ -59,8 +61,10 @@ void AddSC_npc_commandscript();
void AddSC_quest_commandscript();
void AddSC_reload_commandscript();
void AddSC_tele_commandscript();
+void AddSC_server_commandscript();
void AddSC_titles_commandscript();
void AddSC_wp_commandscript();
+void AddSC_character_commandscript();
#ifdef SCRIPTS
//world
@@ -648,12 +652,14 @@ void AddCommandScripts()
{
AddSC_account_commandscript();
AddSC_achievement_commandscript();
+ AddSC_cast_commandscript();
AddSC_debug_commandscript();
AddSC_event_commandscript();
AddSC_gm_commandscript();
AddSC_go_commandscript();
AddSC_gobject_commandscript();
AddSC_honor_commandscript();
+ AddSC_instance_commandscript();
AddSC_learn_commandscript();
AddSC_misc_commandscript();
AddSC_modify_commandscript();
@@ -661,8 +667,10 @@ void AddCommandScripts()
AddSC_quest_commandscript();
AddSC_reload_commandscript();
AddSC_tele_commandscript();
+ AddSC_server_commandscript();
AddSC_titles_commandscript();
AddSC_wp_commandscript();
+ AddSC_character_commandscript();
}
void AddWorldScripts()
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index b4a1ba19a08..84c1401bb5b 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -365,11 +365,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
}
case SPELLFAMILY_WARRIOR:
{
- // Bloodthirst
- if (m_spellInfo->SpellFamilyFlags[1] & 0x400)
- ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
// Shield Slam
- else if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
+ if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
{
uint8 level = m_caster->getLevel();
uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f));
diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt
index 86fe984e197..86e1baeb52d 100644
--- a/src/server/scripts/Commands/CMakeLists.txt
+++ b/src/server/scripts/Commands/CMakeLists.txt
@@ -12,12 +12,14 @@ set(scripts_STAT_SRCS
${scripts_STAT_SRCS}
Commands/cs_account.cpp
Commands/cs_achievement.cpp
+ Commands/cs_cast.cpp
Commands/cs_debug.cpp
Commands/cs_event.cpp
Commands/cs_gm.cpp
Commands/cs_go.cpp
Commands/cs_gobject.cpp
Commands/cs_honor.cpp
+ Commands/cs_instance.cpp
Commands/cs_learn.cpp
Commands/cs_misc.cpp
Commands/cs_modify.cpp
@@ -25,16 +27,15 @@ set(scripts_STAT_SRCS
Commands/cs_quest.cpp
Commands/cs_reload.cpp
Commands/cs_tele.cpp
+ Commands/cs_server.cpp
Commands/cs_titles.cpp
Commands/cs_wp.cpp
-# Commands/cs_character.cpp
+ Commands/cs_character.cpp
# Commands/cs_list.cpp
# Commands/cs_lookup.cpp
# Commands/cs_pdump.cpp
# Commands/cs_guild.cpp
-# Commands/cs_cast.cpp
# Commands/cs_reset.cpp
-# Commands/cs_instance.cpp
# Commands/cs_server.cpp
# Commands/cs_channel.cpp
# Commands/cs_pet.cpp
diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp
new file mode 100644
index 00000000000..33983411427
--- /dev/null
+++ b/src/server/scripts/Commands/cs_cast.cpp
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2008-2012 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/>.
+ */
+
+/* ScriptData
+Name: cast_commandscript
+%Complete: 100
+Comment: All cast related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+
+class cast_commandscript : public CommandScript
+{
+public:
+ cast_commandscript() : CommandScript("cast_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand castCommandTable[] =
+ {
+ { "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "", NULL },
+ { "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "", NULL },
+ { "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "", NULL },
+ { "target", SEC_ADMINISTRATOR, false, &HandleCastTargetCommad, "", NULL },
+ { "dest", SEC_ADMINISTRATOR, false, &HandleCastDestCommand, "", NULL },
+ { "", SEC_ADMINISTRATOR, false, &HandleCastCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ static ChatCommand commandTable[] =
+ {
+ { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ static bool HandleCastCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Unit* target = handler->getSelectedUnit();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastBackCommand(ChatHandler* handler, char const* args)
+ {
+ Creature* caster = handler->getSelectedCreature();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastDistCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo)
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* distStr = strtok(NULL, " ");
+
+ float dist = 0;
+
+ if (distStr)
+ sscanf(distStr, "%f", &dist);
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ float x, y, z;
+ handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist);
+
+ handler->GetSession()->GetPlayer()->CastSpell(x, y, z, spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastSelfCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Unit* target = handler->getSelectedUnit();
+ if (!target)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
+ if (!spellInfo)
+ return false;
+
+ if (!SpellMgr::IsSpellValid(spellInfo, handler->GetSession()->GetPlayer()))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ target->CastSpell(target, spellId, false);
+
+ return true;
+ }
+
+ static bool HandleCastTargetCommad(ChatHandler* handler, char const* args)
+ {
+ Creature* caster = handler->getSelectedCreature();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!caster->getVictim())
+ {
+ handler->SendSysMessage(LANG_SELECTED_TARGET_NOT_HAVE_VICTIM);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ caster->CastSpell(caster->getVictim(), spellId, triggered);
+
+ return true;
+ }
+
+ static bool HandleCastDestCommand(ChatHandler* handler, char const* args)
+ {
+ Unit* caster = handler->getSelectedUnit();
+ if (!caster)
+ {
+ handler->SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
+ uint32 spellId = handler->extractSpellIdFromLink((char*)args);
+ if (!spellId || !sSpellMgr->GetSpellInfo(spellId))
+ {
+ handler->PSendSysMessage(LANG_COMMAND_NOSPELLFOUND);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ char* posX = strtok(NULL, " ");
+ char* posY = strtok(NULL, " ");
+ char* posZ = strtok(NULL, " ");
+
+ if (!posX || !posY || !posZ)
+ return false;
+
+ float x = float(atof(posX));
+ float y = float(atof(posY));
+ float z = float(atof(posZ));
+
+ char* triggeredStr = strtok(NULL, " ");
+ if (triggeredStr)
+ {
+ int l = strlen(triggeredStr);
+ if (strncmp(triggeredStr, "triggered", l) != 0)
+ return false;
+ }
+
+ bool triggered = (triggeredStr != NULL);
+
+ caster->CastSpell(x, y, z, spellId, triggered);
+
+ return true;
+ }
+};
+
+void AddSC_cast_commandscript()
+{
+ new cast_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
new file mode 100644
index 00000000000..1784d73cbab
--- /dev/null
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -0,0 +1,681 @@
+/*
+ * Copyright (C) 2008-2012 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/>.
+ */
+
+/* ScriptData
+Name: character_commandscript
+%Complete: 100
+Comment: All character related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "AccountMgr.h"
+#include "ObjectMgr.h"
+
+class character_commandscript : public CommandScript
+{
+public:
+ character_commandscript() : CommandScript("character_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand characterDeletedCommandTable[] =
+ {
+ { "delete", SEC_CONSOLE, true, &HandleCharacterDeletedDeleteCommand, "", NULL },
+ { "list", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedListCommand, "", NULL },
+ { "restore", SEC_ADMINISTRATOR, true, &HandleCharacterDeletedRestoreCommand, "", NULL },
+ { "old", SEC_CONSOLE, true, &HandleCharacterDeletedOldCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand characterCommandTable[] =
+ {
+ { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL },
+ { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL },
+ { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL },
+ { "deleted", SEC_GAMEMASTER, true, NULL, "", characterDeletedCommandTable},
+ { "erase", SEC_CONSOLE, true, &HandleCharacterEraseCommand, "", NULL },
+ { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL },
+ { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL },
+ { "reputation", SEC_GAMEMASTER, true, &HandleCharacterReputationCommand, "", NULL },
+ { "titles", SEC_GAMEMASTER, true, &HandleCharacterTitlesCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable},
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ return commandTable;
+ }
+
+ // Stores informations about a deleted character
+ struct DeletedInfo
+ {
+ uint32 lowguid; ///< the low GUID from the character
+ std::string name; ///< the character name
+ uint32 accountId; ///< the account id
+ std::string accountName; ///< the account name
+ time_t deleteDate; ///< the date at which the character has been deleted
+ };
+
+ typedef std::list<DeletedInfo> DeletedInfoList;
+
+ /**
+ * Collects all GUIDs (and related info) from deleted characters which are still in the database.
+ *
+ * @param foundList a reference to an std::list which will be filled with info data
+ * @param searchString the search string which either contains a player GUID or a part fo the character-name
+ * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable)
+ */
+ static bool GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
+ {
+ PreparedQueryResult result;
+ PreparedStatement* stmt;
+ if (!searchString.empty())
+ {
+ // search by GUID
+ if (isNumeric(searchString.c_str()))
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID);
+
+ stmt->setUInt32(0, uint32(atoi(searchString.c_str())));
+
+ result = CharacterDatabase.Query(stmt);
+ }
+ // search by name
+ else
+ {
+ if (!normalizePlayerName(searchString))
+ return false;
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME);
+
+ stmt->setString(0, searchString);
+
+ result = CharacterDatabase.Query(stmt);
+ }
+ }
+ else
+ {
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO);
+
+ result = CharacterDatabase.Query(stmt);
+ }
+
+ if (result)
+ {
+ do
+ {
+ Field* fields = result->Fetch();
+
+ DeletedInfo info;
+
+ info.lowguid = fields[0].GetUInt32();
+ info.name = fields[1].GetString();
+ info.accountId = fields[2].GetUInt32();
+
+ // account name will be empty for not existed account
+ AccountMgr::GetName(info.accountId, info.accountName);
+
+ info.deleteDate = time_t(fields[3].GetUInt32());
+
+ foundList.push_back(info);
+ } while (result->NextRow());
+ }
+
+ return true;
+ }
+
+ /**
+ * Shows all deleted characters which matches the given search string, expected non empty list
+ *
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedRestoreCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see DeletedInfoList
+ *
+ * @param foundList contains a list with all found deleted characters
+ */
+ static void HandleCharacterDeletedListHelper(DeletedInfoList const& foundList, ChatHandler* handler)
+ {
+ if (!handler->GetSession())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER);
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
+ }
+
+ for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
+ {
+ std::string dateStr = TimeToTimestampStr(itr->deleteDate);
+
+ if (!handler->GetSession())
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
+ itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
+ itr->accountId, dateStr.c_str());
+ else
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
+ itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
+ itr->accountId, dateStr.c_str());
+ }
+
+ if (!handler->GetSession())
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
+ }
+
+ /**
+ * Restore a previously deleted character
+ *
+ * @see HandleCharacterDeletedListHelper
+ * @see HandleCharacterDeletedRestoreCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see DeletedInfoList
+ *
+ * @param delInfo the informations about the character which will be restored
+ */
+ static void HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo, ChatHandler* handler)
+ {
+ if (delInfo.accountName.empty()) // account not exist
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
+ return;
+ }
+
+ // check character count
+ uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId);
+ if (charcount >= 10)
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
+ return;
+ }
+
+ if (sObjectMgr->GetPlayerGUIDByName(delInfo.name))
+ {
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
+ return;
+ }
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO);
+
+ stmt->setString(0, delInfo.name);
+ stmt->setUInt32(1, delInfo.accountId);
+ stmt->setUInt32(2, delInfo.lowguid);
+
+ CharacterDatabase.Execute(stmt);
+
+ stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
+ stmt->setUInt32(0, delInfo.lowguid);
+ if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
+ sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8());
+ }
+
+ static bool HandleCharacterTitlesCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ LocaleConstant loc = handler->GetSessionDbcLocale();
+ char const* targetName = target->GetName();
+ char const* knownStr = handler->GetTrinityString(LANG_KNOWN);
+
+ // Search in CharTitles.dbc
+ for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
+ {
+ CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(id);
+
+ if (titleInfo && target->HasTitle(titleInfo))
+ {
+ std::string name = titleInfo->name[loc];
+ if (name.empty())
+ continue;
+
+ char const* activeStr = target && target->GetUInt32Value(PLAYER_CHOSEN_TITLE) == titleInfo->bit_index
+ ? handler->GetTrinityString(LANG_ACTIVE)
+ : "";
+
+ char titleNameStr[80];
+ snprintf(titleNameStr, 80, name.c_str(), targetName);
+
+ // send title in "id (idx:idx) - [namedlink locale]" format
+ if (handler->GetSession())
+ handler->PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
+ else
+ handler->PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
+ }
+ }
+ return true;
+ }
+
+ //rename characters
+ static bool HandleCharacterRenameCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ if (target)
+ {
+ // check online security
+ if (handler->HasLowerSecurity(target, 0))
+ return false;
+
+ handler->PSendSysMessage(LANG_RENAME_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_RENAME);
+ }
+ else
+ {
+ // check offline security
+ if (handler->HasLowerSecurity(NULL, targetGuid))
+ return false;
+
+ std::string oldNameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_RENAME_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_RENAME));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ CharacterDatabase.Execute(stmt);
+ }
+ return true;
+ }
+
+ static bool HandleCharacterLevelCommand(ChatHandler* handler, char const* args)
+ {
+ char* nameStr;
+ char* levelStr;
+ handler->extractOptFirstArg((char*)args, &nameStr, &levelStr);
+ if (!levelStr)
+ return false;
+
+ // exception opt second arg: .character level $name
+ if (isalpha(levelStr[0]))
+ {
+ nameStr = levelStr;
+ levelStr = NULL; // current level will used
+ }
+
+ Player* target;
+ uint64 target_guid;
+ std::string target_name;
+ if (!handler->extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
+ return false;
+
+ int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid);
+ int32 newlevel = levelStr ? atoi(levelStr) : oldlevel;
+
+ if (newlevel < 1)
+ return false; // invalid level
+
+ if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level
+ newlevel = STRONG_MAX_LEVEL;
+
+ handler->HandleCharacterLevel(target, target_guid, oldlevel, newlevel);
+ if (!handler->GetSession() || handler->GetSession()->GetPlayer() != target) // including player == NULL
+ {
+ std::string nameLink = handler->playerLink(target_name);
+ handler->PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel);
+ }
+
+ return true;
+ }
+
+ // customize characters
+ static bool HandleCharacterCustomizeCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_CUSTOMIZE));
+ if (target)
+ {
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CUSTOMIZE);
+ stmt->setUInt32(1, target->GetGUIDLow());
+ }
+ else
+ {
+ std::string oldNameLink = handler->playerLink(targetName);
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ }
+ CharacterDatabase.Execute(stmt);
+
+ return true;
+ }
+
+ static bool HandleCharacterChangeFactionCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_FACTION));
+ if (target)
+ {
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CHANGE_FACTION);
+ stmt->setUInt32(1, target->GetGUIDLow());
+ }
+ else
+ {
+ std::string oldNameLink = handler->playerLink(targetName);
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ }
+ CharacterDatabase.Execute(stmt);
+
+ return true;
+ }
+
+ static bool HandleCharacterChangeRaceCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ uint64 targetGuid;
+ std::string targetName;
+ if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ return false;
+
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
+ stmt->setUInt16(0, uint16(AT_LOGIN_CHANGE_RACE));
+ if (target)
+ {
+ // TODO : add text into database
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER, handler->GetNameLink(target).c_str());
+ target->SetAtLoginFlag(AT_LOGIN_CHANGE_RACE);
+ stmt->setUInt32(1, target->GetGUIDLow());
+ }
+ else
+ {
+ std::string oldNameLink = handler->playerLink(targetName);
+ // TODO : add text into database
+ handler->PSendSysMessage(LANG_CUSTOMIZE_PLAYER_GUID, oldNameLink.c_str(), GUID_LOPART(targetGuid));
+ stmt->setUInt32(1, GUID_LOPART(targetGuid));
+ }
+ CharacterDatabase.Execute(stmt);
+
+ return true;
+ }
+
+ static bool HandleCharacterReputationCommand(ChatHandler* handler, char const* args)
+ {
+ Player* target;
+ if (!handler->extractPlayerTarget((char*)args, &target))
+ return false;
+
+ LocaleConstant loc = handler->GetSessionDbcLocale();
+
+ FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
+ for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
+ {
+ const FactionState& faction = itr->second;
+ FactionEntry const* factionEntry = sFactionStore.LookupEntry(faction.ID);
+ char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
+ ReputationRank rank = target->GetReputationMgr().GetRank(factionEntry);
+ std::string rankName = handler->GetTrinityString(ReputationRankStrIndex[rank]);
+ std::ostringstream ss;
+ if (handler->GetSession())
+ ss << faction.ID << " - |cffffffff|Hfaction:" << faction.ID << "|h[" << factionName << ' ' << localeNames[loc] << "]|h|r";
+ else
+ ss << faction.ID << " - " << factionName << ' ' << localeNames[loc];
+
+ ss << ' ' << rankName << " (" << target->GetReputationMgr().GetReputation(factionEntry) << ')';
+
+ if (faction.Flags & FACTION_FLAG_VISIBLE)
+ ss << handler->GetTrinityString(LANG_FACTION_VISIBLE);
+ if (faction.Flags & FACTION_FLAG_AT_WAR)
+ ss << handler->GetTrinityString(LANG_FACTION_ATWAR);
+ if (faction.Flags & FACTION_FLAG_PEACE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_PEACE_FORCED);
+ if (faction.Flags & FACTION_FLAG_HIDDEN)
+ ss << handler->GetTrinityString(LANG_FACTION_HIDDEN);
+ if (faction.Flags & FACTION_FLAG_INVISIBLE_FORCED)
+ ss << handler->GetTrinityString(LANG_FACTION_INVISIBLE_FORCED);
+ if (faction.Flags & FACTION_FLAG_INACTIVE)
+ ss << handler->GetTrinityString(LANG_FACTION_INACTIVE);
+
+ handler->SendSysMessage(ss.str().c_str());
+ }
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string
+ *
+ * @see HandleCharacterDeletedListHelper
+ * @see HandleCharacterDeletedRestoreCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see DeletedInfoList
+ *
+ * @param args the search string which either contains a player GUID or a part fo the character-name
+ */
+ static bool HandleCharacterDeletedListCommand(ChatHandler* handler, char const* args)
+ {
+ DeletedInfoList foundList;
+ if (!GetDeletedCharacterInfoList(foundList, args))
+ return false;
+
+ // if no characters have been found, output a warning
+ if (foundList.empty())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
+ return false;
+ }
+
+ HandleCharacterDeletedListHelper(foundList, handler);
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string
+ *
+ * The command automatically calls '.character deleted list' command with the search string to show all restored characters.
+ *
+ * @see HandleCharacterDeletedRestoreHelper
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedDeleteCommand
+ *
+ * @param args the search string which either contains a player GUID or a part of the character-name
+ */
+ static bool HandleCharacterDeletedRestoreCommand(ChatHandler* handler, char const* args)
+ {
+ // It is required to submit at least one argument
+ if (!*args)
+ return false;
+
+ std::string searchString;
+ std::string newCharName;
+ uint32 newAccount = 0;
+
+ // GCC by some strange reason fail build code without temporary variable
+ std::istringstream params(args);
+ params >> searchString >> newCharName >> newAccount;
+
+ DeletedInfoList foundList;
+ if (!GetDeletedCharacterInfoList(foundList, searchString))
+ return false;
+
+ if (foundList.empty())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
+ return false;
+ }
+
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_RESTORE);
+ HandleCharacterDeletedListHelper(foundList, handler);
+
+ if (newCharName.empty())
+ {
+ // Drop not existed account cases
+ for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
+ HandleCharacterDeletedRestoreHelper(*itr, handler);
+ }
+ else if (foundList.size() == 1 && normalizePlayerName(newCharName))
+ {
+ DeletedInfo delInfo = foundList.front();
+
+ // update name
+ delInfo.name = newCharName;
+
+ // if new account provided update deleted info
+ if (newAccount && newAccount != delInfo.accountId)
+ {
+ delInfo.accountId = newAccount;
+ AccountMgr::GetName(newAccount, delInfo.accountName);
+ }
+
+ HandleCharacterDeletedRestoreHelper(delInfo, handler);
+ }
+ else
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME);
+
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string
+ *
+ * @see Player::GetDeletedCharacterGUIDs
+ * @see Player::DeleteFromDB
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedRestoreCommand
+ *
+ * @param args the search string which either contains a player GUID or a part fo the character-name
+ */
+ static bool HandleCharacterDeletedDeleteCommand(ChatHandler* handler, char const* args)
+ {
+ // It is required to submit at least one argument
+ if (!*args)
+ return false;
+
+ DeletedInfoList foundList;
+ if (!GetDeletedCharacterInfoList(foundList, args))
+ return false;
+
+ if (foundList.empty())
+ {
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
+ return false;
+ }
+
+ handler->SendSysMessage(LANG_CHARACTER_DELETED_DELETE);
+ HandleCharacterDeletedListHelper(foundList, handler);
+
+ // Call the appropriate function to delete them (current account for deleted characters is 0)
+ for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
+ Player::DeleteFromDB(itr->lowguid, 0, false, true);
+
+ return true;
+ }
+
+ /**
+ * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago
+ *
+ * @see Player::DeleteOldCharacters
+ * @see Player::DeleteFromDB
+ * @see HandleCharacterDeletedDeleteCommand
+ * @see HandleCharacterDeletedListCommand
+ * @see HandleCharacterDeletedRestoreCommand
+ *
+ * @param args the search string which either contains a player GUID or a part fo the character-name
+ */
+ static bool HandleCharacterDeletedOldCommand(ChatHandler* handler, char const* args)
+ {
+ int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
+
+ char* px = strtok((char*)args, " ");
+ if (px)
+ {
+ if (!isNumeric(px))
+ return false;
+
+ keepDays = atoi(px);
+ if (keepDays < 0)
+ return false;
+ }
+ // config option value 0 -> disabled and can't be used
+ else if (keepDays <= 0)
+ return false;
+
+ Player::DeleteOldCharacters((uint32)keepDays);
+ return true;
+ }
+
+ static bool HandleCharacterEraseCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char *character_name_str = strtok((char*)args, " ");
+ if (!character_name_str)
+ return false;
+
+ std::string character_name = character_name_str;
+ if (!normalizePlayerName(character_name))
+ return false;
+
+ uint64 character_guid;
+ uint32 account_id;
+
+ Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str());
+ if (player)
+ {
+ character_guid = player->GetGUID();
+ account_id = player->GetSession()->GetAccountId();
+ player->GetSession()->KickPlayer();
+ }
+ else
+ {
+ character_guid = sObjectMgr->GetPlayerGUIDByName(character_name);
+ if (!character_guid)
+ {
+ handler->PSendSysMessage(LANG_NO_PLAYER, character_name.c_str());
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+ account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid);
+ }
+
+ std::string account_name;
+ AccountMgr::GetName (account_id, account_name);
+
+ Player::DeleteFromDB(character_guid, account_id, true, true);
+ handler->PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id);
+ return true;
+ }
+};
+
+void AddSC_character_commandscript()
+{
+ new character_commandscript();
+} \ No newline at end of file
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
new file mode 100644
index 00000000000..127a3848ebc
--- /dev/null
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2008-2012 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/>.
+ */
+
+/* ScriptData
+Name: instance_commandscript
+%Complete: 100
+Comment: All instance related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "Group.h"
+#include "InstanceSaveMgr.h"
+#include "InstanceScript.h"
+#include "MapManager.h"
+
+class instance_commandscript : public CommandScript
+{
+public:
+ instance_commandscript() : CommandScript("instance_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand instanceCommandTable[] =
+ {
+ { "listbinds", SEC_ADMINISTRATOR, false, &HandleInstanceListBindsCommand, "", NULL },
+ { "unbind", SEC_ADMINISTRATOR, false, &HandleInstanceUnbindCommand, "", NULL },
+ { "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "", NULL },
+ { "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ return commandTable;
+ }
+
+ static std::string GetTimeString(uint64 time)
+ {
+ uint64 days = time / DAY, hours = (time % DAY) / HOUR, minute = (time % HOUR) / MINUTE;
+ std::ostringstream ss;
+ if (days)
+ ss << days << "d ";
+ if (hours)
+ ss << hours << "h ";
+ ss << minute << 'm';
+ return ss.str();
+ }
+
+ static bool HandleInstanceListBindsCommand(ChatHandler* handler, char const* args)
+ {
+ Player* player = handler->getSelectedPlayer();
+ if (!player)
+ player = handler->GetSession()->GetPlayer();
+
+ uint32 counter = 0;
+ for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
+ {
+ Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
+ for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
+ {
+ InstanceSave* save = itr->second.save;
+ std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
+ handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
+ counter++;
+ }
+ }
+ handler->PSendSysMessage("player binds: %d", counter);
+
+ counter = 0;
+ if (Group* group = player->GetGroup())
+ {
+ for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
+ {
+ Group::BoundInstancesMap &binds = group->GetBoundInstances(Difficulty(i));
+ for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
+ {
+ InstanceSave* save = itr->second.save;
+ std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
+ handler->PSendSysMessage("map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
+ counter++;
+ }
+ }
+ }
+ handler->PSendSysMessage("group binds: %d", counter);
+
+ return true;
+ }
+
+ static bool HandleInstanceUnbindCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ Player* player = handler->getSelectedPlayer();
+ if (!player)
+ player = handler->GetSession()->GetPlayer();
+
+ char* map = strtok((char*)args, " ");
+ char* pDiff = strtok(NULL, " ");
+ int8 diff = -1;
+ if (pDiff)
+ diff = atoi(pDiff);
+ uint16 counter = 0;
+ uint16 MapId = 0;
+
+ if (strcmp(map, "all"))
+ {
+ MapId = uint16(atoi(map));
+ if (!MapId)
+ return false;
+ }
+
+ for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
+ {
+ Player::BoundInstancesMap &binds = player->GetBoundInstances(Difficulty(i));
+ for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
+ {
+ InstanceSave* save = itr->second.save;
+ if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
+ {
+ std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
+ handler->PSendSysMessage("unbinding map: %d inst: %d perm: %s diff: %d canReset: %s TTR: %s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str());
+ player->UnbindInstance(itr, Difficulty(i));
+ counter++;
+ }
+ else
+ ++itr;
+ }
+ }
+ handler->PSendSysMessage("instances unbound: %d", counter);
+
+ return true;
+ }
+
+ static bool HandleInstanceStatsCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ handler->PSendSysMessage("instances loaded: %d", sMapMgr->GetNumInstances());
+ handler->PSendSysMessage("players in instances: %d", sMapMgr->GetNumPlayersInInstances());
+ handler->PSendSysMessage("instance saves: %d", sInstanceSaveMgr->GetNumInstanceSaves());
+ handler->PSendSysMessage("players bound: %d", sInstanceSaveMgr->GetNumBoundPlayersTotal());
+ handler->PSendSysMessage("groups bound: %d", sInstanceSaveMgr->GetNumBoundGroupsTotal());
+
+ return true;
+ }
+
+ static bool HandleInstanceSaveDataCommand(ChatHandler* handler, char const* /*args*/)
+ {
+ Player* player = handler->GetSession()->GetPlayer();
+ Map* map = player->GetMap();
+ if (!map->IsDungeon())
+ {
+ handler->PSendSysMessage("Map is not a dungeon.");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ if (!((InstanceMap*)map)->GetInstanceScript())
+ {
+ handler->PSendSysMessage("Map has no instance data.");
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ ((InstanceMap*)map)->GetInstanceScript()->SaveToDB();
+
+ return true;
+ }
+};
+
+void AddSC_instance_commandscript()
+{
+ new instance_commandscript();
+}
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 3e04cb48af4..60c5e1cf162 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -1390,7 +1390,7 @@ public:
if (!target)
target = handler->GetSession()->GetPlayer();
- // check online security
+ // check online security
else if (target->GetTypeId() == TYPEID_PLAYER && handler->HasLowerSecurity(target->ToPlayer(), 0))
return false;
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
new file mode 100644
index 00000000000..2e5b929d460
--- /dev/null
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -0,0 +1,431 @@
+/*
+ * Copyright (C) 2008-2012 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/>.
+ */
+
+/* ScriptData
+Name: server_commandscript
+%Complete: 100
+Comment: All server related commands
+Category: commandscripts
+EndScriptData */
+
+#include "ScriptMgr.h"
+#include "Chat.h"
+#include "SystemConfig.h"
+#include "Config.h"
+#include "ObjectAccessor.h"
+
+class server_commandscript : public CommandScript
+{
+public:
+ server_commandscript() : CommandScript("server_commandscript") { }
+
+ ChatCommand* GetCommands() const
+ {
+ static ChatCommand serverIdleRestartCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverIdleShutdownCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverRestartCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverShutdownCommandTable[] =
+ {
+ { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL },
+ { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverSetCommandTable[] =
+ {
+ { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL },
+ { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL },
+ { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL },
+ { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL },
+ { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand serverCommandTable[] =
+ {
+ { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL },
+ { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL },
+ { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
+ { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
+ { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL },
+ { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL },
+ { "plimit", SEC_ADMINISTRATOR, true, &HandleServerPLimitCommand, "", NULL },
+ { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
+ { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
+ { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
+ { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+
+ static ChatCommand commandTable[] =
+ {
+ { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
+ { NULL, 0, false, NULL, "", NULL }
+ };
+ return commandTable;
+ }
+
+ // Triggering corpses expire check in world
+ static bool HandleServerCorpsesCommand(ChatHandler* handler, char const* args)
+ {
+ sObjectAccessor->RemoveOldCorpses();
+ return true;
+ }
+
+ static bool HandleServerInfoCommand(ChatHandler* handler, char const* args)
+ {
+ uint32 playersNum = sWorld->GetPlayerCount();
+ uint32 maxPlayersNum = sWorld->GetMaxPlayerCount();
+ uint32 activeClientsNum = sWorld->GetActiveSessionCount();
+ uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
+ uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
+ uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount();
+ std::string uptime = secsToTimeString(sWorld->GetUptime());
+ uint32 updateTime = sWorld->GetUpdateTime();
+
+ handler->SendSysMessage(_FULLVERSION);
+ handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
+ handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
+ handler->PSendSysMessage(LANG_UPTIME, uptime.c_str());
+ handler->PSendSysMessage(LANG_UPDATE_DIFF, updateTime);
+ // Can't use sWorld->ShutdownMsg here in case of console command
+ if (sWorld->IsShuttingDown())
+ handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str());
+
+ return true;
+ }
+ // Display the 'Message of the day' for the realm
+ static bool HandleServerMotdCommand(ChatHandler* handler, char const* args)
+ {
+ handler->PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd());
+ return true;
+ }
+
+ static bool HandleServerPLimitCommand(ChatHandler* handler, char const* args)
+ {
+ if (*args)
+ {
+ char* param = strtok((char*)args, " ");
+ if (!param)
+ return false;
+
+ int l = strlen(param);
+
+ if (strncmp(param, "player", l) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_PLAYER);
+ else if (strncmp(param, "moderator", l) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_MODERATOR);
+ else if (strncmp(param, "gamemaster", l) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER);
+ else if (strncmp(param, "administrator", l) == 0)
+ sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
+ else if (strncmp(param, "reset", l) == 0)
+ {
+ sWorld->SetPlayerAmountLimit(ConfigMgr::GetIntDefault("PlayerLimit", 100));
+ sWorld->LoadDBAllowedSecurityLevel();
+ }
+ else
+ {
+ int val = atoi(param);
+ if (val < 0)
+ sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
+ else
+ sWorld->SetPlayerAmountLimit(uint32(val));
+ }
+ }
+
+ uint32 pLimit = sWorld->GetPlayerAmountLimit();
+ AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
+ char const* secName = "";
+ switch (allowedAccountType)
+ {
+ case SEC_PLAYER: secName = "Player"; break;
+ case SEC_MODERATOR: secName = "Moderator"; break;
+ case SEC_GAMEMASTER: secName = "Gamemaster"; break;
+ case SEC_ADMINISTRATOR: secName = "Administrator"; break;
+ default: secName = "<unknown>"; break;
+ }
+ handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName);
+
+ return true;
+ }
+
+ static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* args)
+ {
+ sWorld->ShutdownCancel();
+ return true;
+ }
+
+ static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* time_str = strtok ((char*) args, " ");
+ char* exitcode_str = strtok (NULL, "");
+
+ int32 time = atoi (time_str);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitcode_str)
+ {
+ int32 exitcode = atoi(exitcode_str);
+
+ // Handle atoi() errors
+ if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitcode < 0 || exitcode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, 0, exitcode);
+ }
+ else
+ sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE);
+ return true;
+ }
+
+ static bool HandleServerRestartCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* time_str = strtok ((char*) args, " ");
+ char* exitcode_str = strtok (NULL, "");
+
+ int32 time = atoi (time_str);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitcode_str)
+ {
+ int32 exitcode = atoi (exitcode_str);
+
+ // Handle atoi() errors
+ if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitcode < 0 || exitcode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, exitcode);
+ }
+ else
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
+ return true;
+ }
+
+ static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* time_str = strtok ((char*) args, " ");
+ char* exitcode_str = strtok (NULL, "");
+
+ int32 time = atoi (time_str);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitcode_str)
+ {
+ int32 exitcode = atoi (exitcode_str);
+
+ // Handle atoi() errors
+ if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitcode < 0 || exitcode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
+ }
+ else
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE);
+ return true;
+ }
+
+ static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char* time_str = strtok ((char*) args, " ");
+ char* exitcode_str = strtok (NULL, "");
+
+ int32 time = atoi (time_str);
+
+ // Prevent interpret wrong arg value as 0 secs shutdown time
+ if ((time == 0 && (time_str[0] != '0' || time_str[1] != '\0')) || time < 0)
+ return false;
+
+ if (exitcode_str)
+ {
+ int32 exitcode = atoi (exitcode_str);
+
+ // Handle atoi() errors
+ if (exitcode == 0 && (exitcode_str[0] != '0' || exitcode_str[1] != '\0'))
+ return false;
+
+ // Exit code should be in range of 0-125, 126-255 is used
+ // in many shells for their own return codes and code > 255
+ // is not supported in many others
+ if (exitcode < 0 || exitcode > 125)
+ return false;
+
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, exitcode);
+ }
+ else
+ sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE);
+ return true;
+ }
+
+ // Exit the realm
+ static bool HandleServerExitCommand(ChatHandler* handler, char const* args)
+ {
+ handler->SendSysMessage(LANG_COMMAND_EXIT);
+ World::StopNow(SHUTDOWN_EXIT_CODE);
+ return true;
+ }
+
+ // Define the 'Message of the day' for the realm
+ static bool HandleServerSetMotdCommand(ChatHandler* handler, char const* args)
+ {
+ sWorld->SetMotd(args);
+ handler->PSendSysMessage(LANG_MOTD_NEW, args);
+ return true;
+ }
+
+ // Set whether we accept new clients
+ static bool HandleServerSetClosedCommand(ChatHandler* handler, char const* args)
+ {
+ if (strncmp(args, "on", 3) == 0)
+ {
+ handler->SendSysMessage(LANG_WORLD_CLOSED);
+ sWorld->SetClosed(true);
+ return true;
+ }
+ else if (strncmp(args, "off", 4) == 0)
+ {
+ handler->SendSysMessage(LANG_WORLD_OPENED);
+ sWorld->SetClosed(false);
+ return true;
+ }
+
+ handler->SendSysMessage(LANG_USE_BOL);
+ handler->SetSentErrorMessage(true);
+ return false;
+ }
+
+ // Set the level of logging
+ static bool HandleServerSetLogFileLevelCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char *NewLevel = strtok((char*)args, " ");
+ if (!NewLevel)
+ return false;
+
+ sLog->SetLogFileLevel(NewLevel);
+ return true;
+ }
+
+ // Set the level of logging
+ static bool HandleServerSetLogLevelCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char *NewLevel = strtok((char*)args, " ");
+ if (!NewLevel)
+ return false;
+
+ sLog->SetLogLevel(NewLevel);
+ return true;
+ }
+
+ // set diff time record interval
+ static bool HandleServerSetDiffTimeCommand(ChatHandler* handler, char const* args)
+ {
+ if (!*args)
+ return false;
+
+ char *NewTimeStr = strtok((char*)args, " ");
+ if (!NewTimeStr)
+ return false;
+
+ int32 NewTime =atoi(NewTimeStr);
+ if (NewTime < 0)
+ return false;
+
+ sWorld->SetRecordDiffInterval(NewTime);
+ printf( "Record diff every %u ms\n", NewTime);
+ return true;
+ }
+
+ // toggle sql driver query logging
+ static bool HandleServerToggleQueryLogging(ChatHandler* handler,const char* args )
+ {
+ sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging());
+ if (sLog->GetSQLDriverQueryLogging())
+ handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED);
+ else
+ handler->PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED);
+
+ return true;
+ }
+};
+
+void AddSC_server_commandscript()
+{
+ new server_commandscript();
+} \ No newline at end of file
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index ca7c3af7fde..8f390d17cd4 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -97,15 +97,16 @@ public:
if (!*args)
return false;
- std::string name = args;
-
- if (!sObjectMgr->DeleteGameTele(name))
+ // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
+ GameTele const* tele = handler->extractGameTeleFromLink((char*)args);
+ if (!tele)
{
handler->SendSysMessage(LANG_COMMAND_TELE_NOTFOUND);
handler->SetSentErrorMessage(true);
return false;
}
-
+ std::string name = tele->name;
+ sObjectMgr->DeleteGameTele(name);
handler->SendSysMessage(LANG_COMMAND_TP_DELETED);
return true;
}
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
index a86b2b8b17a..a70d05fa0ef 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/blackfathom_deeps.cpp
@@ -15,11 +15,13 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "ScriptedGossip.h"
#include "blackfathom_deeps.h"
#include "ScriptedEscortAI.h"
-enum eSpells
+enum Spells
{
SPELL_BLESSING_OF_BLACKFATHOM = 8733,
SPELL_RAVAGE = 8391,
@@ -94,11 +96,11 @@ public:
uint32 frostNovaTimer;
uint32 frostBoltVolleyTimer;
- bool bFlee;
+ bool Flee;
void Reset()
{
- bFlee = false;
+ Flee = false;
ravageTimer = urand(5000, 8000);
frostNovaTimer = urand(9000, 12000);
@@ -140,7 +142,7 @@ public:
{
if (ravageTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_RAVAGE);
+ DoCastVictim(SPELL_RAVAGE);
ravageTimer = urand(9000, 14000);
} else ravageTimer -= diff;
break;
@@ -148,9 +150,9 @@ public:
case NPC_MURKSHALLOW_SOFTSHELL:
case NPC_BARBED_CRUSTACEAN:
{
- if (!bFlee && HealthBelowPct(15))
+ if (!Flee && HealthBelowPct(15))
{
- bFlee = true;
+ Flee = true;
me->DoFleeToGetAssistance();
}
break;
@@ -160,10 +162,7 @@ public:
if (frostBoltVolleyTimer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- {
- if (target)
- DoCast(target, SPELL_FROST_BOLT_VOLLEY);
- }
+ DoCast(target, SPELL_FROST_BOLT_VOLLEY);
frostBoltVolleyTimer = urand(5000, 8000);
}
else frostBoltVolleyTimer -= diff;
@@ -190,7 +189,7 @@ public:
};
};
-enum eMorridune
+enum Morridune
{
SAY_MORRIDUNE_1 = -1048003,
SAY_MORRIDUNE_2 = -1048004
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
index 32a6bcbde77..7071395812e 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_aku_mai.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackfathom_deeps.h"
enum Spells
@@ -42,14 +43,14 @@ public:
}
uint32 poisonCloudTimer;
- bool bIsEnraged;
+ bool IsEnraged;
InstanceScript* instance;
void Reset()
{
poisonCloudTimer = urand(5000, 9000);
- bIsEnraged = false;
+ IsEnraged = false;
if (instance)
instance->SetData(TYPE_AKU_MAI, NOT_STARTED);
}
@@ -77,10 +78,10 @@ public:
poisonCloudTimer = urand(25000, 50000);
} else poisonCloudTimer -= diff;
- if (!bIsEnraged && HealthBelowPct(30))
+ if (!IsEnraged && HealthBelowPct(30))
{
DoCast(me, SPELL_FRENZIED_RAGE);
- bIsEnraged = true;
+ IsEnraged = true;
}
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
index 5a60a849b75..1488772dc8a 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_gelihast.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackfathom_deeps.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
index 7ee17172102..1c754b78672 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/boss_kelris.cpp
@@ -15,7 +15,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
#include "blackfathom_deeps.h"
enum Spells
diff --git a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
index ea33499a960..236c7b1ba69 100644
--- a/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
+++ b/src/server/scripts/Kalimdor/BlackfathomDeeps/instance_blackfathom_deeps.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Blackfathom Deeps
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
#include "blackfathom_deeps.h"
#define MAX_ENCOUNTER 4
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
index d7043965271..b23d15cd1b5 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_celebras_the_cursed.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
@@ -46,15 +47,15 @@ public:
{
celebras_the_cursedAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 Wrath_Timer;
- uint32 EntanglingRoots_Timer;
- uint32 CorruptForces_Timer;
+ uint32 WrathTimer;
+ uint32 EntanglingRootsTimer;
+ uint32 CorruptForcesTimer;
void Reset()
{
- Wrath_Timer = 8000;
- EntanglingRoots_Timer = 2000;
- CorruptForces_Timer = 30000;
+ WrathTimer = 8000;
+ EntanglingRootsTimer = 2000;
+ CorruptForcesTimer = 30000;
}
void EnterCombat(Unit* /*who*/) { }
@@ -70,32 +71,30 @@ public:
return;
//Wrath
- if (Wrath_Timer <= diff)
+ if (WrathTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_WRATH);
- Wrath_Timer = 8000;
+ WrathTimer = 8000;
}
- else Wrath_Timer -= diff;
+ else WrathTimer -= diff;
//EntanglingRoots
- if (EntanglingRoots_Timer <= diff)
+ if (EntanglingRootsTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_ENTANGLINGROOTS);
- EntanglingRoots_Timer = 20000;
+ DoCastVictim(SPELL_ENTANGLINGROOTS);
+ EntanglingRootsTimer = 20000;
}
- else EntanglingRoots_Timer -= diff;
+ else EntanglingRootsTimer -= diff;
//CorruptForces
- if (CorruptForces_Timer <= diff)
+ if (CorruptForcesTimer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_CORRUPT_FORCES);
- CorruptForces_Timer = 20000;
+ CorruptForcesTimer = 20000;
}
- else CorruptForces_Timer -= diff;
+ else CorruptForcesTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
index ea419793ae8..b4128ea80ee 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_landslide.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
@@ -46,15 +47,15 @@ public:
{
boss_landslideAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 KnockAway_Timer;
- uint32 Trample_Timer;
- uint32 Landslide_Timer;
+ uint32 KnockAwayTimer;
+ uint32 TrampleTimer;
+ uint32 LandslideTimer;
void Reset()
{
- KnockAway_Timer = 8000;
- Trample_Timer = 2000;
- Landslide_Timer = 0;
+ KnockAwayTimer = 8000;
+ TrampleTimer = 2000;
+ LandslideTimer = 0;
}
void EnterCombat(Unit* /*who*/)
@@ -66,32 +67,32 @@ public:
if (!UpdateVictim())
return;
- //KnockAway_Timer
- if (KnockAway_Timer <= diff)
+ //KnockAwayTimer
+ if (KnockAwayTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_KNOCKAWAY);
- KnockAway_Timer = 15000;
+ DoCastVictim(SPELL_KNOCKAWAY);
+ KnockAwayTimer = 15000;
}
- else KnockAway_Timer -= diff;
+ else KnockAwayTimer -= diff;
- //Trample_Timer
- if (Trample_Timer <= diff)
+ //TrampleTimer
+ if (TrampleTimer <= diff)
{
DoCast(me, SPELL_TRAMPLE);
- Trample_Timer = 8000;
+ TrampleTimer = 8000;
}
- else Trample_Timer -= diff;
+ else TrampleTimer -= diff;
//Landslide
if (HealthBelowPct(50))
{
- if (Landslide_Timer <= diff)
+ if (LandslideTimer <= diff)
{
me->InterruptNonMeleeSpells(false);
DoCast(me, SPELL_LANDSLIDE);
- Landslide_Timer = 60000;
+ LandslideTimer = 60000;
}
- else Landslide_Timer -= diff;
+ else LandslideTimer -= diff;
}
DoMeleeAttackIfReady();
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
index 18ce7be0f0a..ece3ff83776 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_noxxion.cpp
@@ -23,7 +23,9 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+
enum Spells
{
SPELL_TOXICVOLLEY = 21687,
@@ -44,24 +46,22 @@ public:
{
boss_noxxionAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 ToxicVolley_Timer;
- uint32 Uppercut_Timer;
- uint32 Adds_Timer;
- uint32 Invisible_Timer;
+ uint32 ToxicVolleyTimer;
+ uint32 UppercutTimer;
+ uint32 AddsTimer;
+ uint32 InvisibleTimer;
bool Invisible;
void Reset()
{
- ToxicVolley_Timer = 7000;
- Uppercut_Timer = 16000;
- Adds_Timer = 19000;
- Invisible_Timer = 15000; //Too much too low?
+ ToxicVolleyTimer = 7000;
+ UppercutTimer = 16000;
+ AddsTimer = 19000;
+ InvisibleTimer = 15000; //Too much too low?
Invisible = false;
}
- void EnterCombat(Unit* /*who*/)
- {
- }
+ void EnterCombat(Unit* /*who*/) {}
void SummonAdds(Unit* victim)
{
@@ -71,7 +71,7 @@ public:
void UpdateAI(const uint32 diff)
{
- if (Invisible && Invisible_Timer <= diff)
+ if (Invisible && InvisibleTimer <= diff)
{
//Become visible again
me->setFaction(14);
@@ -83,7 +83,7 @@ public:
}
else if (Invisible)
{
- Invisible_Timer -= diff;
+ InvisibleTimer -= diff;
//Do nothing while invisible
return;
}
@@ -92,24 +92,24 @@ public:
if (!UpdateVictim())
return;
- //ToxicVolley_Timer
- if (ToxicVolley_Timer <= diff)
+ //ToxicVolleyTimer
+ if (ToxicVolleyTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_TOXICVOLLEY);
- ToxicVolley_Timer = 9000;
+ DoCastVictim(SPELL_TOXICVOLLEY);
+ ToxicVolleyTimer = 9000;
}
- else ToxicVolley_Timer -= diff;
+ else ToxicVolleyTimer -= diff;
- //Uppercut_Timer
- if (Uppercut_Timer <= diff)
+ //UppercutTimer
+ if (UppercutTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_UPPERCUT);
- Uppercut_Timer = 12000;
+ DoCastVictim(SPELL_UPPERCUT);
+ UppercutTimer = 12000;
}
- else Uppercut_Timer -= diff;
+ else UppercutTimer -= diff;
- //Adds_Timer
- if (!Invisible && Adds_Timer <= diff)
+ //AddsTimer
+ if (!Invisible && AddsTimer <= diff)
{
//Interrupt any spell casting
//me->m_canMove = true;
@@ -124,11 +124,11 @@ public:
SummonAdds(me->getVictim());
SummonAdds(me->getVictim());
Invisible = true;
- Invisible_Timer = 15000;
+ InvisibleTimer = 15000;
- Adds_Timer = 40000;
+ AddsTimer = 40000;
}
- else Adds_Timer -= diff;
+ else AddsTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
index 039d30071d2..1f887d7ce64 100644
--- a/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
+++ b/src/server/scripts/Kalimdor/Maraudon/boss_princess_theradras.cpp
@@ -23,7 +23,8 @@ SDComment:
SDCategory: Maraudon
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
enum Spells
{
@@ -47,17 +48,17 @@ public:
{
boss_ptheradrasAI(Creature* creature) : ScriptedAI(creature) {}
- uint32 Dustfield_Timer;
- uint32 Boulder_Timer;
- uint32 Thrash_Timer;
- uint32 RepulsiveGaze_Timer;
+ uint32 DustfieldTimer;
+ uint32 BoulderTimer;
+ uint32 ThrashTimer;
+ uint32 RepulsiveGazeTimer;
void Reset()
{
- Dustfield_Timer = 8000;
- Boulder_Timer = 2000;
- Thrash_Timer = 5000;
- RepulsiveGaze_Timer = 23000;
+ DustfieldTimer = 8000;
+ BoulderTimer = 2000;
+ ThrashTimer = 5000;
+ RepulsiveGazeTimer = 23000;
}
void EnterCombat(Unit* /*who*/) {}
@@ -72,40 +73,38 @@ public:
if (!UpdateVictim())
return;
- //Dustfield_Timer
- if (Dustfield_Timer <= diff)
+ //DustfieldTimer
+ if (DustfieldTimer <= diff)
{
DoCast(me, SPELL_DUSTFIELD);
- Dustfield_Timer = 14000;
+ DustfieldTimer = 14000;
}
- else Dustfield_Timer -= diff;
+ else DustfieldTimer -= diff;
- //Boulder_Timer
- if (Boulder_Timer <= diff)
+ //BoulderTimer
+ if (BoulderTimer <= diff)
{
- Unit* target = NULL;
- target = SelectTarget(SELECT_TARGET_RANDOM, 0);
- if (target)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_BOULDER);
- Boulder_Timer = 10000;
+ BoulderTimer = 10000;
}
- else Boulder_Timer -= diff;
+ else BoulderTimer -= diff;
- //RepulsiveGaze_Timer
- if (RepulsiveGaze_Timer <= diff)
+ //RepulsiveGazeTimer
+ if (RepulsiveGazeTimer <= diff)
{
- DoCast(me->getVictim(), SPELL_REPULSIVEGAZE);
- RepulsiveGaze_Timer = 20000;
+ DoCastVictim(SPELL_REPULSIVEGAZE);
+ RepulsiveGazeTimer = 20000;
}
- else RepulsiveGaze_Timer -= diff;
+ else RepulsiveGazeTimer -= diff;
- //Thrash_Timer
- if (Thrash_Timer <= diff)
+ //ThrashTimer
+ if (ThrashTimer <= diff)
{
DoCast(me, SPELL_THRASH);
- Thrash_Timer = 18000;
+ ThrashTimer = 18000;
}
- else Thrash_Timer -= diff;
+ else ThrashTimer -= diff;
DoMeleeAttackIfReady();
}
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
index 6e6e089ba02..1fdf941d75c 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp
@@ -25,10 +25,15 @@ SDComment: <Known bugs>
SDCategory: Onyxia's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "ScriptedCreature.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
#include "onyxias_lair.h"
-enum eYells
+enum Yells
{
SAY_AGGRO = -1249000,
SAY_KILL = -1249001,
@@ -37,7 +42,7 @@ enum eYells
EMOTE_BREATH = -1249004,
};
-enum eSpells
+enum Spells
{
// Phase 1 spells
SPELL_WING_BUFFET = 18500,
@@ -67,15 +72,15 @@ enum eSpells
SPELL_BELLOWING_ROAR = 18431,
};
-struct sOnyxMove
+struct OnyxMove
{
- uint32 uiLocId;
- uint32 uiLocIdEnd;
- uint32 uiSpellId;
+ uint8 LocId;
+ uint8 LocIdEnd;
+ uint32 SpellId;
float fX, fY, fZ;
};
-static sOnyxMove aMoveData[]=
+static OnyxMove MoveData[8]=
{
{0, 1, SPELL_BREATH_WEST_TO_EAST, -33.5561f, -182.682f, -56.9457f}, //west
{1, 0, SPELL_BREATH_EAST_TO_WEST, -31.4963f, -250.123f, -55.1278f}, //east
@@ -87,11 +92,11 @@ static sOnyxMove aMoveData[]=
{7, 6, SPELL_BREATH_NORTH_TO_SOUTH, 22.8763f, -217.152f, -55.0548f}, //north
};
-const Position MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f};
+Position const MiddleRoomLocation = {-23.6155f, -215.357f, -55.7344f, 0.0f};
-const Position Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f};
+Position const Phase2Location = {-80.924f, -214.299f, -82.942f, 0.0f};
-static Position aSpawnLocations[3]=
+Position const SpawnLocations[3]=
{
//Whelps
{-30.127f, -254.463f, -89.440f, 0.0f},
@@ -121,58 +126,58 @@ public:
InstanceScript* instance;
SummonList Summons;
- uint32 m_uiPhase;
+ uint32 Phase;
- uint32 m_uiFlameBreathTimer;
- uint32 m_uiCleaveTimer;
- uint32 m_uiTailSweepTimer;
- uint32 m_uiWingBuffetTimer;
+ uint32 FlameBreathTimer;
+ uint32 CleaveTimer;
+ uint32 TailSweepTimer;
+ uint32 WingBuffetTimer;
- uint32 m_uiMovePoint;
- uint32 m_uiMovementTimer;
- sOnyxMove* m_pPointData;
+ uint8 MovePoint;
+ uint32 MovementTimer;
+ OnyxMove* PointData;
- uint32 m_uiFireballTimer;
- uint32 m_uiWhelpTimer;
- uint32 m_uiLairGuardTimer;
- uint32 m_uiDeepBreathTimer;
+ uint32 FireballTimer;
+ uint32 WhelpTimer;
+ uint32 LairGuardTimer;
+ uint32 DeepBreathTimer;
- uint32 m_uiBellowingRoarTimer;
+ uint32 BellowingRoarTimer;
- uint8 m_uiSummonWhelpCount;
- bool m_bIsMoving;
+ uint8 SummonWhelpCount;
+ bool IsMoving;
void Reset()
{
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
- m_uiPhase = PHASE_START;
+ Phase = PHASE_START;
- m_uiFlameBreathTimer = urand(10000, 20000);
- m_uiTailSweepTimer = urand(15000, 20000);
- m_uiCleaveTimer = urand(2000, 5000);
- m_uiWingBuffetTimer = urand(10000, 20000);
+ FlameBreathTimer = urand(10000, 20000);
+ TailSweepTimer = urand(15000, 20000);
+ CleaveTimer = urand(2000, 5000);
+ WingBuffetTimer = urand(10000, 20000);
- m_uiMovePoint = urand(0, 5);
- m_uiMovementTimer = 14000;
- m_pPointData = GetMoveData();
+ MovePoint = urand(0, 5);
+ MovementTimer = 14000;
+ PointData = GetMoveData();
- m_uiFireballTimer = 15000;
- m_uiWhelpTimer = 60000;
- m_uiLairGuardTimer = 60000;
- m_uiDeepBreathTimer = 85000;
+ FireballTimer = 15000;
+ WhelpTimer = 60000;
+ LairGuardTimer = 60000;
+ DeepBreathTimer = 85000;
- m_uiBellowingRoarTimer = 30000;
+ BellowingRoarTimer = 30000;
Summons.DespawnAll();
- m_uiSummonWhelpCount = 0;
- m_bIsMoving = false;
+ SummonWhelpCount = 0;
+ IsMoving = false;
if (instance)
{
instance->SetData(DATA_ONYXIA, NOT_STARTED);
- instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_TIMED_START_EVENT);
}
}
@@ -206,7 +211,7 @@ public:
switch (summoned->GetEntry())
{
case NPC_WHELP:
- ++m_uiSummonWhelpCount;
+ ++SummonWhelpCount;
break;
case NPC_LAIRGUARD:
summoned->setActive(true);
@@ -225,17 +230,17 @@ public:
DoScriptText(SAY_KILL, me);
}
- void SpellHit(Unit* /*pCaster*/, const SpellInfo* pSpell)
+ void SpellHit(Unit* /*pCaster*/, const SpellInfo* Spell)
{
- if (pSpell->Id == SPELL_BREATH_EAST_TO_WEST ||
- pSpell->Id == SPELL_BREATH_WEST_TO_EAST ||
- pSpell->Id == SPELL_BREATH_SE_TO_NW ||
- pSpell->Id == SPELL_BREATH_NW_TO_SE ||
- pSpell->Id == SPELL_BREATH_SW_TO_NE ||
- pSpell->Id == SPELL_BREATH_NE_TO_SW)
+ if (Spell->Id == SPELL_BREATH_EAST_TO_WEST ||
+ Spell->Id == SPELL_BREATH_WEST_TO_EAST ||
+ Spell->Id == SPELL_BREATH_SE_TO_NW ||
+ Spell->Id == SPELL_BREATH_NW_TO_SE ||
+ Spell->Id == SPELL_BREATH_SW_TO_NE ||
+ Spell->Id == SPELL_BREATH_NE_TO_SW)
{
- m_pPointData = GetMoveData();
- m_uiMovePoint = m_pPointData->uiLocIdEnd;
+ PointData = GetMoveData();
+ MovePoint = PointData->LocIdEnd;
me->SetSpeed(MOVE_FLIGHT, 1.5f);
me->GetMotionMaster()->MovePoint(8, MiddleRoomLocation);
@@ -249,16 +254,16 @@ public:
switch (id)
{
case 8:
- m_pPointData = GetMoveData();
- if (m_pPointData)
+ PointData = GetMoveData();
+ if (PointData)
{
me->SetSpeed(MOVE_FLIGHT, 1.0f);
- me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+ me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
}
break;
case 9:
me->GetMotionMaster()->MoveChase(me->getVictim());
- m_uiBellowingRoarTimer = 1000;
+ BellowingRoarTimer = 1000;
break;
case 10:
me->SetCanFly(true);
@@ -266,39 +271,39 @@ public:
me->SetSpeed(MOVE_FLIGHT, 1.0f);
DoScriptText(SAY_PHASE_2_TRANS, me);
if (instance)
- instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
- m_uiWhelpTimer = 5000;
- m_uiLairGuardTimer = 15000;
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
+ WhelpTimer = 5000;
+ LairGuardTimer = 15000;
break;
case 11:
- if (m_pPointData)
- me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
+ if (PointData)
+ me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
me->GetMotionMaster()->Clear(false);
me->GetMotionMaster()->MoveIdle();
break;
default:
- m_bIsMoving = false;
+ IsMoving = false;
break;
}
}
}
- void SpellHitTarget(Unit* target, const SpellInfo* pSpell)
+ void SpellHitTarget(Unit* target, const SpellInfo* Spell)
{
//Workaround - Couldn't find a way to group this spells (All Eruption)
- if (((pSpell->Id >= 17086 && pSpell->Id <= 17095) ||
- (pSpell->Id == 17097) ||
- (pSpell->Id >= 18351 && pSpell->Id <= 18361) ||
- (pSpell->Id >= 18564 && pSpell->Id <= 18576) ||
- (pSpell->Id >= 18578 && pSpell->Id <= 18607) ||
- (pSpell->Id == 18609) ||
- (pSpell->Id >= 18611 && pSpell->Id <= 18628) ||
- (pSpell->Id >= 21132 && pSpell->Id <= 21133) ||
- (pSpell->Id >= 21135 && pSpell->Id <= 21139) ||
- (pSpell->Id >= 22191 && pSpell->Id <= 22202) ||
- (pSpell->Id >= 22267 && pSpell->Id <= 22268)) &&
+ if (((Spell->Id >= 17086 && Spell->Id <= 17095) ||
+ (Spell->Id == 17097) ||
+ (Spell->Id >= 18351 && Spell->Id <= 18361) ||
+ (Spell->Id >= 18564 && Spell->Id <= 18576) ||
+ (Spell->Id >= 18578 && Spell->Id <= 18607) ||
+ (Spell->Id == 18609) ||
+ (Spell->Id >= 18611 && Spell->Id <= 18628) ||
+ (Spell->Id >= 21132 && Spell->Id <= 21133) ||
+ (Spell->Id >= 21135 && Spell->Id <= 21139) ||
+ (Spell->Id >= 22191 && Spell->Id <= 22202) ||
+ (Spell->Id >= 22267 && Spell->Id <= 22268)) &&
(target->GetTypeId() == TYPEID_PLAYER))
{
if (instance)
@@ -308,14 +313,14 @@ public:
}
}
- sOnyxMove* GetMoveData()
+ OnyxMove* GetMoveData()
{
- uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove);
+ uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove);
- for (uint32 i = 0; i < uiMaxCount; ++i)
+ for (uint8 i = 0; i < MaxCount; ++i)
{
- if (aMoveData[i].uiLocId == m_uiMovePoint)
- return &aMoveData[i];
+ if (MoveData[i].LocId == MovePoint)
+ return &MoveData[i];
}
return NULL;
@@ -323,84 +328,84 @@ public:
void SetNextRandomPoint()
{
- uint32 uiMaxCount = sizeof(aMoveData)/sizeof(sOnyxMove);
+ uint8 MaxCount = sizeof(MoveData)/sizeof(OnyxMove);
- uint32 iTemp = rand()%(uiMaxCount-1);
+ uint8 iTemp = urand(0, MaxCount-1);
- if (iTemp >= m_uiMovePoint)
+ if (iTemp >= MovePoint)
++iTemp;
- m_uiMovePoint = iTemp;
+ MovePoint = iTemp;
}
- void UpdateAI(const uint32 uiDiff)
+ void UpdateAI(const uint32 Diff)
{
if (!UpdateVictim())
return;
//Common to PHASE_START && PHASE_END
- if (m_uiPhase == PHASE_START || m_uiPhase == PHASE_END)
+ if (Phase == PHASE_START || Phase == PHASE_END)
{
//Specific to PHASE_START || PHASE_END
- if (m_uiPhase == PHASE_START)
+ if (Phase == PHASE_START)
{
if (HealthBelowPct(60))
{
SetCombatMovement(false);
- m_uiPhase = PHASE_BREATH;
+ Phase = PHASE_BREATH;
me->GetMotionMaster()->MovePoint(10, Phase2Location);
return;
}
}
else
{
- if (m_uiBellowingRoarTimer <= uiDiff)
+ if (BellowingRoarTimer <= Diff)
{
DoCastVictim(SPELL_BELLOWING_ROAR);
// Eruption
- GameObject* pFloor = NULL;
+ GameObject* Floor = NULL;
Trinity::GameObjectInRangeCheck check(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 15);
- Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, pFloor, check);
+ Trinity::GameObjectLastSearcher<Trinity::GameObjectInRangeCheck> searcher(me, Floor, check);
me->VisitNearbyGridObject(30, searcher);
- if (instance && pFloor)
- instance->SetData64(DATA_FLOOR_ERUPTION_GUID, pFloor->GetGUID());
- m_uiBellowingRoarTimer = 30000;
+ if (instance && Floor)
+ instance->SetData64(DATA_FLOOR_ERUPTION_GUID, Floor->GetGUID());
+ BellowingRoarTimer = 30000;
}
else
- m_uiBellowingRoarTimer -= uiDiff;
+ BellowingRoarTimer -= Diff;
}
- if (m_uiFlameBreathTimer <= uiDiff)
+ if (FlameBreathTimer <= Diff)
{
DoCastVictim(SPELL_FLAME_BREATH);
- m_uiFlameBreathTimer = urand(10000, 20000);
+ FlameBreathTimer = urand(10000, 20000);
}
else
- m_uiFlameBreathTimer -= uiDiff;
+ FlameBreathTimer -= Diff;
- if (m_uiTailSweepTimer <= uiDiff)
+ if (TailSweepTimer <= Diff)
{
DoCastAOE(SPELL_TAIL_SWEEP);
- m_uiTailSweepTimer = urand(15000, 20000);
+ TailSweepTimer = urand(15000, 20000);
}
else
- m_uiTailSweepTimer -= uiDiff;
+ TailSweepTimer -= Diff;
- if (m_uiCleaveTimer <= uiDiff)
+ if (CleaveTimer <= Diff)
{
DoCastVictim(SPELL_CLEAVE);
- m_uiCleaveTimer = urand(2000, 5000);
+ CleaveTimer = urand(2000, 5000);
}
else
- m_uiCleaveTimer -= uiDiff;
+ CleaveTimer -= Diff;
- if (m_uiWingBuffetTimer <= uiDiff)
+ if (WingBuffetTimer <= Diff)
{
DoCastVictim(SPELL_WING_BUFFET);
- m_uiWingBuffetTimer = urand(15000, 30000);
+ WingBuffetTimer = urand(15000, 30000);
}
else
- m_uiWingBuffetTimer -= uiDiff;
+ WingBuffetTimer -= Diff;
DoMeleeAttackIfReady();
}
@@ -408,86 +413,86 @@ public:
{
if (HealthBelowPct(40))
{
- m_uiPhase = PHASE_END;
+ Phase = PHASE_END;
if (instance)
- instance->SetData(DATA_ONYXIA_PHASE, m_uiPhase);
+ instance->SetData(DATA_ONYXIA_PHASE, Phase);
DoScriptText(SAY_PHASE_3_TRANS, me);
SetCombatMovement(true);
me->SetCanFly(false);
- m_bIsMoving = false;
+ IsMoving = false;
me->GetMotionMaster()->MovePoint(9, me->GetHomePosition());
return;
}
- if (m_uiDeepBreathTimer <= uiDiff)
+ if (DeepBreathTimer <= Diff)
{
- if (!m_bIsMoving)
+ if (!IsMoving)
{
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
DoScriptText(EMOTE_BREATH, me);
- DoCast(me, m_pPointData->uiSpellId);
- m_uiDeepBreathTimer = 70000;
+ DoCast(me, PointData->SpellId);
+ DeepBreathTimer = 70000;
}
}
else
- m_uiDeepBreathTimer -= uiDiff;
+ DeepBreathTimer -= Diff;
- if (m_uiMovementTimer <= uiDiff)
+ if (MovementTimer <= Diff)
{
- if (!m_bIsMoving)
+ if (!IsMoving)
{
SetNextRandomPoint();
- m_pPointData = GetMoveData();
+ PointData = GetMoveData();
- if (!m_pPointData)
+ if (!PointData)
return;
- me->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ);
- m_bIsMoving = true;
- m_uiMovementTimer = 25000;
+ me->GetMotionMaster()->MovePoint(PointData->LocId, PointData->fX, PointData->fY, PointData->fZ);
+ IsMoving = true;
+ MovementTimer = 25000;
}
}
else
- m_uiMovementTimer -= uiDiff;
+ MovementTimer -= Diff;
- if (m_uiFireballTimer <= uiDiff)
+ if (FireballTimer <= Diff)
{
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_FIREBALL);
- m_uiFireballTimer = 8000;
+ FireballTimer = 8000;
}
}
else
- m_uiFireballTimer -= uiDiff;
+ FireballTimer -= Diff;
- if (m_uiLairGuardTimer <= uiDiff)
+ if (LairGuardTimer <= Diff)
{
- me->SummonCreature(NPC_LAIRGUARD, aSpawnLocations[2].GetPositionX(), aSpawnLocations[2].GetPositionY(), aSpawnLocations[2].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
- m_uiLairGuardTimer = 30000;
+ me->SummonCreature(NPC_LAIRGUARD, SpawnLocations[2], TEMPSUMMON_CORPSE_DESPAWN);
+ LairGuardTimer = 30000;
}
else
- m_uiLairGuardTimer -= uiDiff;
+ LairGuardTimer -= Diff;
- if (m_uiWhelpTimer <= uiDiff)
+ if (WhelpTimer <= Diff)
{
- me->SummonCreature(NPC_WHELP, aSpawnLocations[0].GetPositionX(), aSpawnLocations[0].GetPositionY(), aSpawnLocations[0].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
- me->SummonCreature(NPC_WHELP, aSpawnLocations[1].GetPositionX(), aSpawnLocations[1].GetPositionY(), aSpawnLocations[1].GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_DESPAWN);
- if (m_uiSummonWhelpCount >= RAID_MODE(20, 40))
+ me->SummonCreature(NPC_WHELP, SpawnLocations[0], TEMPSUMMON_CORPSE_DESPAWN);
+ me->SummonCreature(NPC_WHELP, SpawnLocations[1], TEMPSUMMON_CORPSE_DESPAWN);
+ if (SummonWhelpCount >= RAID_MODE(20, 40))
{
- m_uiSummonWhelpCount = 0;
- m_uiWhelpTimer = 90000;
+ SummonWhelpCount = 0;
+ WhelpTimer = 90000;
}
else
- m_uiWhelpTimer = 500;
+ WhelpTimer = 500;
}
else
- m_uiWhelpTimer -= uiDiff;
+ WhelpTimer -= Diff;
}
}
};
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
index 1c599ce7c6f..0689a8872bb 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/instance_onyxias_lair.cpp
@@ -22,7 +22,12 @@ SDComment:
SDCategory: Onyxia's Lair
EndScriptData */
-#include "ScriptPCH.h"
+#include "ScriptMgr.h"
+#include "InstanceScript.h"
+#include "Cell.h"
+#include "CellImpl.h"
+#include "GridNotifiers.h"
+#include "GridNotifiersImpl.h"
#include "onyxias_lair.h"
class instance_onyxias_lair : public InstanceMapScript
@@ -44,27 +49,27 @@ public:
std::map<uint64, uint32> FloorEruptionGUID[2];
std::queue<uint64> FloorEruptionGUIDQueue;
- uint64 m_uiOnyxiasGUID;
- uint32 m_uiOnyxiaLiftoffTimer;
- uint32 m_uiManyWhelpsCounter;
- uint32 m_uiEruptTimer;
+ uint64 OnyxiasGUID;
+ uint32 OnyxiaLiftoffTimer;
+ uint32 ManyWhelpsCounter;
+ uint32 EruptTimer;
- uint8 m_auiEncounter[MAX_ENCOUNTER];
+ uint8 Encounter[MAX_ENCOUNTER];
- bool m_bAchievManyWhelpsHandleIt;
- bool m_bAchievSheDeepBreathMore;
+ bool AchievManyWhelpsHandleIt;
+ bool AchievSheDeepBreathMore;
void Initialize()
{
- memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ memset(&Encounter, 0, sizeof(Encounter));
- m_uiOnyxiasGUID = 0;
- m_uiOnyxiaLiftoffTimer = 0;
- m_uiManyWhelpsCounter = 0;
- m_bAchievManyWhelpsHandleIt = false;
- m_bAchievSheDeepBreathMore = true;
+ OnyxiasGUID = 0;
+ OnyxiaLiftoffTimer = 0;
+ ManyWhelpsCounter = 0;
+ AchievManyWhelpsHandleIt = false;
+ AchievSheDeepBreathMore = true;
- m_uiEruptTimer = 0;
+ EruptTimer = 0;
}
void OnCreatureCreate(Creature* creature)
@@ -72,7 +77,7 @@ public:
switch (creature->GetEntry())
{
case NPC_ONYXIA:
- m_uiOnyxiasGUID = creature->GetGUID();
+ OnyxiasGUID = creature->GetGUID();
break;
}
}
@@ -93,7 +98,7 @@ public:
if (Creature* temp = go->SummonCreature(NPC_WHELP, goPos, TEMPSUMMON_CORPSE_DESPAWN))
{
temp->SetInCombatWithZone();
- ++m_uiManyWhelpsCounter;
+ ++ManyWhelpsCounter;
}
break;
}
@@ -139,88 +144,88 @@ public:
FloorEruptionGUID[1].erase(floorEruptedGUID);
}
- void SetData(uint32 uiType, uint32 uiData)
+ void SetData(uint32 Type, uint32 Data)
{
- switch (uiType)
+ switch (Type)
{
case DATA_ONYXIA:
- m_auiEncounter[0] = uiData;
- if (uiData == IN_PROGRESS)
+ Encounter[0] = Data;
+ if (Data == IN_PROGRESS)
SetData(DATA_SHE_DEEP_BREATH_MORE, IN_PROGRESS);
break;
case DATA_ONYXIA_PHASE:
- if (uiData == PHASE_BREATH) //Used to mark the liftoff phase
+ if (Data == PHASE_BREATH) //Used to mark the liftoff phase
{
- m_bAchievManyWhelpsHandleIt = false;
- m_uiManyWhelpsCounter = 0;
- m_uiOnyxiaLiftoffTimer = 10*IN_MILLISECONDS;
+ AchievManyWhelpsHandleIt = false;
+ ManyWhelpsCounter = 0;
+ OnyxiaLiftoffTimer = 10*IN_MILLISECONDS;
}
break;
case DATA_SHE_DEEP_BREATH_MORE:
- if (uiData == IN_PROGRESS)
+ if (Data == IN_PROGRESS)
{
- m_bAchievSheDeepBreathMore = true;
+ AchievSheDeepBreathMore = true;
}
- else if (uiData == FAIL)
+ else if (Data == FAIL)
{
- m_bAchievSheDeepBreathMore = false;
+ AchievSheDeepBreathMore = false;
}
break;
}
- if (uiType < MAX_ENCOUNTER && uiData == DONE)
+ if (Type < MAX_ENCOUNTER && Data == DONE)
SaveToDB();
}
- void SetData64(uint32 uiType, uint64 uiData)
+ void SetData64(uint32 Type, uint64 Data)
{
- switch (uiType)
+ switch (Type)
{
case DATA_FLOOR_ERUPTION_GUID:
FloorEruptionGUID[1] = FloorEruptionGUID[0];
- FloorEruptionGUIDQueue.push(uiData);
- m_uiEruptTimer = 2500;
+ FloorEruptionGUIDQueue.push(Data);
+ EruptTimer = 2500;
break;
}
}
- uint32 GetData(uint32 uiType)
+ uint32 GetData(uint32 Type)
{
- switch (uiType)
+ switch (Type)
{
case DATA_ONYXIA:
- return m_auiEncounter[0];
+ return Encounter[0];
}
return 0;
}
- uint64 GetData64(uint32 uiData)
+ uint64 GetData64(uint32 Data)
{
- switch (uiData)
+ switch (Data)
{
case DATA_ONYXIA_GUID:
- return m_uiOnyxiasGUID;
+ return OnyxiasGUID;
}
return 0;
}
- void Update(uint32 uiDiff)
+ void Update(uint32 Diff)
{
if (GetData(DATA_ONYXIA) == IN_PROGRESS)
{
- if (m_uiOnyxiaLiftoffTimer && m_uiOnyxiaLiftoffTimer <= uiDiff)
+ if (OnyxiaLiftoffTimer && OnyxiaLiftoffTimer <= Diff)
{
- m_uiOnyxiaLiftoffTimer = 0;
- if (m_uiManyWhelpsCounter >= 50)
- m_bAchievManyWhelpsHandleIt = true;
- } else m_uiOnyxiaLiftoffTimer -= uiDiff;
+ OnyxiaLiftoffTimer = 0;
+ if (ManyWhelpsCounter >= 50)
+ AchievManyWhelpsHandleIt = true;
+ } else OnyxiaLiftoffTimer -= Diff;
}
if (!FloorEruptionGUIDQueue.empty())
{
- if (m_uiEruptTimer <= uiDiff)
+ if (EruptTimer <= Diff)
{
uint32 treeHeight = 0;
do
@@ -229,10 +234,10 @@ public:
FloorEruption(FloorEruptionGUIDQueue.front());
FloorEruptionGUIDQueue.pop();
} while (!FloorEruptionGUIDQueue.empty() && (*FloorEruptionGUID[1].find(FloorEruptionGUIDQueue.front())).second == treeHeight);
- m_uiEruptTimer = 1000;
+ EruptTimer = 1000;
}
else
- m_uiEruptTimer -= uiDiff;
+ EruptTimer -= Diff;
}
}
@@ -242,10 +247,10 @@ public:
{
case ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER: // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s
case ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER: // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s
- return m_bAchievManyWhelpsHandleIt;
+ return AchievManyWhelpsHandleIt;
case ACHIEV_CRITERIA_DEEP_BREATH_10_PLAYER: // Criteria for achievement 4404: She Deep Breaths More (10 player) Everybody evade Deep Breath
case ACHIEV_CRITERIA_DEEP_BREATH_25_PLAYER: // Criteria for achievement 4407: She Deep Breaths More (25 player) Everybody evade Deep Breath
- return m_bAchievSheDeepBreathMore;
+ return AchievSheDeepBreathMore;
}
return false;
}
diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
index eaf6cac43af..26fd9284ea2 100644
--- a/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
+++ b/src/server/scripts/Kalimdor/OnyxiasLair/onyxias_lair.h
@@ -18,13 +18,13 @@
#ifndef DEF_ONYXIAS_LAIR_H
#define DEF_ONYXIAS_LAIR_H
-enum eData64
+enum Data64
{
DATA_ONYXIA_GUID,
DATA_FLOOR_ERUPTION_GUID
};
-enum eInstanceData
+enum InstanceData
{
DATA_ONYXIA,
MAX_ENCOUNTER,
@@ -34,7 +34,7 @@ enum eInstanceData
DATA_MANY_WHELPS_COUNT
};
-enum eCreatures
+enum Creatures
{
NPC_WHELP = 11262,
NPC_LAIRGUARD = 36561,
@@ -42,20 +42,20 @@ enum eCreatures
NPC_ONYXIA = 10184
};
-enum eOnyxiaPhases
+enum OnyxiaPhases
{
PHASE_START = 1,
PHASE_BREATH = 2,
PHASE_END = 3
};
-enum eGameObjects
+enum GameObjects
{
GO_WHELP_SPAWNER = 176510,
GO_WHELP_EGG = 176511
};
-enum eAchievementData
+enum AchievementData
{
ACHIEV_CRITERIA_MANY_WHELPS_10_PLAYER = 12565, // Criteria for achievement 4403: Many Whelps! Handle It! (10 player) Hatch 50 eggs in 10s
ACHIEV_CRITERIA_MANY_WHELPS_25_PLAYER = 12568, // Criteria for achievement 4406: Many Whelps! Handle It! (25 player) Hatch 50 eggs in 10s
diff --git a/src/server/scripts/Kalimdor/ashenvale.cpp b/src/server/scripts/Kalimdor/ashenvale.cpp
index e28665c038e..9e8cdaa8b92 100644
--- a/src/server/scripts/Kalimdor/ashenvale.cpp
+++ b/src/server/scripts/Kalimdor/ashenvale.cpp
@@ -169,15 +169,15 @@ class npc_torek : public CreatureScript
# npc_ruul_snowhoof
####*/
-enum RuulSnowhoof
-{
+enum RuulSnowhoof
+{
NPC_THISTLEFUR_URSA = 3921,
NPC_THISTLEFUR_TOTEMIC = 3922,
NPC_THISTLEFUR_PATHFINDER = 3926,
QUEST_FREEDOM_TO_RUUL = 6482,
- GO_CAGE = 178147
+ GO_CAGE = 178147
};
Position const RuulSnowhoofSummonsCoord[6] =
diff --git a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
index 45e1c1808c1..397b0849d5e 100644
--- a/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
+++ b/src/server/scripts/Kalimdor/dustwallow_marsh.cpp
@@ -25,7 +25,6 @@ EndScriptData */
/* ContentData
mobs_risen_husk_spirit
-npc_deserter_agitator
npc_lady_jaina_proudmoore
npc_nat_pagle
npc_private_hendel
@@ -132,93 +131,7 @@ class mobs_risen_husk_spirit : public CreatureScript
};
/*######
-## npc_deserter_agitator
-######*/
-
-enum Deserter
-{
- QUEST_TRAITORS_AMONG_US = 11126,
- NPC_THERAMORE_DESERTER = 23602,
-};
-
-const Position DeserterDisappearPos = {-3609.03f, -4332.91f, 9.39354f, 3.73862f};
-
-#define GOSSIP_ITEM_DESERTER "Your propaganda wont`t work on me. Spout your treasonous filth elsewhere traitor!"
-
-class npc_deserter_agitator : public CreatureScript
-{
-public:
- npc_deserter_agitator() : CreatureScript("npc_deserter_agitator") { }
-
- bool OnGossipHello(Player* player, Creature* creature)
- {
- if (player->GetQuestStatus(QUEST_TRAITORS_AMONG_US) == QUEST_STATUS_INCOMPLETE)
- player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DESERTER, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO);
-
- player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
-
- return true;
- }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
- {
- player->PlayerTalkClass->ClearMenus();
-
- if (action == GOSSIP_SENDER_INFO)
- {
- player->CLOSE_GOSSIP_MENU();
- switch (urand(0, 1))
- {
- case 0:
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- creature->setFaction(14);
- creature->AI()->AttackStart(player);
- break;
- case 1:
- player->KilledMonsterCredit(NPC_THERAMORE_DESERTER, 0);
- creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- creature->SetSpeed(MOVE_RUN, creature->GetSpeedRate(MOVE_RUN), true);
- creature->setFaction(35);
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
- creature->SetReactState(REACT_PASSIVE);
- creature->GetMotionMaster()->MovePoint(1, DeserterDisappearPos);
- break;
- }
- }
-
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_deserter_agitatorAI(creature);
- }
-
- struct npc_deserter_agitatorAI : public ScriptedAI
- {
- npc_deserter_agitatorAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset()
- {
- me->RestoreFaction();
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NON_ATTACKABLE);
- me->SetReactState(REACT_AGGRESSIVE);
- me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
- }
-
- void MovementInform(uint32 Type, uint32 Id)
- {
- if (Type != POINT_MOTION_TYPE)
- return;
-
- if (Id == 1)
- me->DisappearAndDie();
- }
- };
-};
-
-/*######
-## npc_deserter_agitator
+## npc_theramor_guard
######*/
enum TheramoreGuard
@@ -865,7 +778,6 @@ void AddSC_dustwallow_marsh()
new npc_zelfrax();
new npc_stinky();
new npc_theramore_guard();
- new npc_deserter_agitator();
new spell_ooze_zap();
new spell_ooze_zap_channel_end();
new spell_energize_aoe();
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index a0fca522f61..b2662b644a7 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -296,6 +296,7 @@ class boss_professor_putricide : public CreatureScript
summon->ModifyAuraState(AURA_STATE_UNKNOWN22, true);
summon->CastSpell(summon, SPELL_GASEOUS_BLOAT_PROC, true);
summon->CastCustomSpell(SPELL_GASEOUS_BLOAT, SPELLVALUE_AURA_STACK, 10, summon, false);
+ summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
summon->SetReactState(REACT_PASSIVE);
return;
case NPC_VOLATILE_OOZE:
@@ -303,6 +304,7 @@ class boss_professor_putricide : public CreatureScript
summon->ModifyAuraState(AURA_STATE_UNKNOWN19, true);
summon->CastSpell(summon, SPELL_OOZE_ERUPTION_SEARCH_PERIODIC, true);
summon->CastSpell(summon, SPELL_VOLATILE_OOZE_ADHESIVE, false);
+ summon->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
summon->SetReactState(REACT_PASSIVE);
return;
case NPC_CHOKING_GAS_BOMB:
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
index 4dab215d1da..d2eaab361a1 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp
@@ -138,7 +138,7 @@ enum Spells
SPELL_IN_FROSTMOURNE_ROOM = 74276,
SPELL_KILL_FROSTMOURNE_PLAYERS = 75127,
SPELL_HARVESTED_SOUL = 72679,
- SPELL_TRIGGER_VILE_SPIRIT_HEROIC = 73582,
+ SPELL_TRIGGER_VILE_SPIRIT_HEROIC = 73582, // TODO: Cast every 3 seconds during Frostmourne phase, targets a Wicked Spirit amd activates it
// Frostmourne
SPELL_LIGHTS_FAVOR = 69382,
@@ -152,6 +152,7 @@ enum Spells
SPELL_SUMMON_SPIRIT_BOMB_1 = 73581, // (Heroic)
SPELL_SUMMON_SPIRIT_BOMB_2 = 74299, // (Heroic)
SPELL_EXPLOSION = 73576, // Spirit Bomb (Heroic)
+ SPELL_HARVEST_SOUL_DAMAGE_AURA = 73655,
// Outro
SPELL_FURY_OF_FROSTMOURNE = 72350,
@@ -221,7 +222,7 @@ enum Events
EVENT_QUAKE_2 = 27,
EVENT_VILE_SPIRITS = 28,
EVENT_HARVEST_SOULS = 29, // heroic only
- EVENT_WICKED_SPIRITS = 30,
+ EVENT_BERSERK = 30,
EVENT_SOUL_RIP = 31,
EVENT_DESTROY_SOUL = 32,
EVENT_FROSTMOURNE_TALK_1 = 33,
@@ -249,19 +250,18 @@ enum Events
EVENT_OUTRO_TERENAS_TALK_2 = 55,
EVENT_OUTRO_TALK_7 = 56,
EVENT_OUTRO_TALK_8 = 57,
- EVENT_BERSERK = 58,
// Shambling Horror
- EVENT_SHOCKWAVE = 59,
- EVENT_ENRAGE = 60,
+ EVENT_SHOCKWAVE = 58,
+ EVENT_ENRAGE = 59,
// Raging Spirit
- EVENT_SOUL_SHRIEK = 61,
+ EVENT_SOUL_SHRIEK = 60,
// Strangulate Vehicle (Harvest Soul)
- EVENT_TELEPORT = 62,
- EVENT_MOVE_TO_LICH_KING = 63,
- EVENT_DESPAWN_SELF = 64,
+ EVENT_TELEPORT = 61,
+ EVENT_MOVE_TO_LICH_KING = 62,
+ EVENT_DESPAWN_SELF = 63,
};
enum EventGroups
@@ -475,6 +475,32 @@ class VileSpiritActivateEvent : public BasicEvent
Creature* _owner;
};
+class TriggerWickedSpirit : public BasicEvent
+{
+ public:
+ explicit TriggerWickedSpirit(Creature* owner)
+ : _owner(owner), _counter(13)
+ {
+ }
+
+ bool Execute(uint64 /*time*/, uint32 /*diff*/)
+ {
+ _owner->CastCustomSpell(SPELL_TRIGGER_VILE_SPIRIT_HEROIC, SPELLVALUE_MAX_TARGETS, 1, NULL, true);
+
+ if (--_counter)
+ {
+ _owner->m_Events.AddEvent(this, _owner->m_Events.CalculateTime(3000));
+ return false;
+ }
+
+ return true;
+ }
+
+ private:
+ Creature* _owner;
+ uint32 _counter;
+};
+
class boss_the_lich_king : public CreatureScript
{
public:
@@ -503,6 +529,8 @@ class boss_the_lich_king : public CreatureScript
me->SetDisableGravity(false);
me->RemoveByteFlag(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_HOVER);
me->GetMotionMaster()->MoveFall();
+ if (Creature* frostmourne = me->FindNearestCreature(NPC_FROSTMOURNE_TRIGGER, 50.0f))
+ frostmourne->DespawnOrUnsummon();
}
void EnterCombat(Unit* target)
@@ -601,8 +629,6 @@ class boss_the_lich_king : public CreatureScript
summons.DoAction(ACTION_TELEPORT_BACK, pred);
if (!IsHeroic())
Talk(SAY_LK_FROSTMOURNE_ESCAPE);
- else
- DoCastAOE(SPELL_TRIGGER_VILE_SPIRIT_HEROIC);
break;
}
default:
@@ -645,6 +671,8 @@ class boss_the_lich_king : public CreatureScript
if (events.GetPhaseMask() & PHASE_MASK_ONE && !HealthAbovePct(70))
{
events.SetPhase(PHASE_TRANSITION);
+ me->SetReactState(REACT_PASSIVE);
+ me->AttackStop();
me->GetMotionMaster()->MovePoint(POINT_CENTER_1, CenterPosition);
return;
}
@@ -652,6 +680,8 @@ class boss_the_lich_king : public CreatureScript
if (events.GetPhaseMask() & PHASE_MASK_TWO && !HealthAbovePct(40))
{
events.SetPhase(PHASE_TRANSITION);
+ me->SetReactState(REACT_PASSIVE);
+ me->AttackStop();
me->GetMotionMaster()->MovePoint(POINT_CENTER_2, CenterPosition);
return;
}
@@ -664,7 +694,8 @@ class boss_the_lich_king : public CreatureScript
events.SetPhase(PHASE_OUTRO);
summons.DespawnAll();
SendMusicToPlayers(MUSIC_FURY_OF_FROSTMOURNE);
- DoCastAOE(SPELL_FURY_OF_FROSTMOURNE);
+ me->InterruptNonMeleeSpells(true);
+ me->CastSpell((Unit*)NULL, SPELL_FURY_OF_FROSTMOURNE, TRIGGERED_NONE);
me->SetWalk(true);
events.ScheduleEvent(EVENT_OUTRO_TALK_1, 2600, 0, PHASE_OUTRO);
events.ScheduleEvent(EVENT_OUTRO_EMOTE_TALK, 6600, 0, PHASE_OUTRO);
@@ -712,7 +743,6 @@ class boss_the_lich_king : public CreatureScript
break;
case NPC_FROSTMOURNE_TRIGGER:
{
- summons.Summon(summon);
summon->CastSpell((Unit*)NULL, SPELL_BROKEN_FROSTMOURNE, true);
SendLightOverride(LIGHT_SOULSTORM, 10000);
@@ -724,16 +754,11 @@ class boss_the_lich_king : public CreatureScript
case NPC_VILE_SPIRIT:
{
summons.Summon(summon);
- if (events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE)
- {
- TeleportSpirit(summon);
- return;
- }
-
summon->SetReactState(REACT_PASSIVE);
summon->SetSpeed(MOVE_FLIGHT, 0.5f);
summon->GetMotionMaster()->MoveRandom(10.0f);
- summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000));
+ if (!(events.GetPhaseMask() & PHASE_MASK_FROSTMOURNE))
+ summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15000));
return;
}
case NPC_STRANGULATE_VEHICLE:
@@ -756,7 +781,6 @@ class boss_the_lich_king : public CreatureScript
case NPC_VALKYR_SHADOWGUARD:
case NPC_RAGING_SPIRIT:
case NPC_VILE_SPIRIT:
- case NPC_WICKED_SPIRIT:
summon->ToTempSummon()->SetTempSummonType(TEMPSUMMON_CORPSE_DESPAWN);
break;
default:
@@ -802,8 +826,6 @@ class boss_the_lich_king : public CreatureScript
me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
- me->SetReactState(REACT_PASSIVE);
- me->AttackStop();
DoCast(me, SPELL_REMORSELESS_WINTER_1);
events.DelayEvents(62500, EVENT_GROUP_BERSERK); // delay berserk timer, its not ticking during phase transitions
events.ScheduleEvent(EVENT_QUAKE, 62500, 0, PHASE_TRANSITION);
@@ -819,8 +841,6 @@ class boss_the_lich_king : public CreatureScript
me->SetFacingTo(0.0f);
Talk(SAY_LK_REMORSELESS_WINTER);
SendMusicToPlayers(MUSIC_SPECIAL);
- me->SetReactState(REACT_PASSIVE);
- me->AttackStop();
DoCast(me, SPELL_REMORSELESS_WINTER_2);
summons.DespawnEntry(NPC_VALKYR_SHADOWGUARD);
events.DelayEvents(62500, EVENT_GROUP_BERSERK); // delay berserk timer, its not ticking during phase transitions
@@ -992,10 +1012,6 @@ class boss_the_lich_king : public CreatureScript
DoCastAOE(SPELL_VILE_SPIRITS);
events.ScheduleEvent(EVENT_VILE_SPIRITS, urand(35000, 40000), EVENT_GROUP_VILE_SPIRITS, PHASE_THREE);
break;
- case EVENT_WICKED_SPIRITS:
- DoCastAOE(SPELL_VILE_SPIRITS);
- events.ScheduleEvent(EVENT_WICKED_SPIRITS, urand(35000, 40000), 0, PHASE_FROSTMOURNE);
- break;
case EVENT_HARVEST_SOULS:
Talk(SAY_LK_HARVEST_SOUL);
DoCastAOE(SPELL_HARVEST_SOULS);
@@ -1003,7 +1019,6 @@ class boss_the_lich_king : public CreatureScript
events.SetPhase(PHASE_FROSTMOURNE); // will stop running UpdateVictim (no evading)
me->SetReactState(REACT_PASSIVE);
me->AttackStop();
- events.ScheduleEvent(EVENT_WICKED_SPIRITS, events.GetNextEventTime(EVENT_VILE_SPIRITS) - events.GetTimer(), 0, PHASE_FROSTMOURNE);
events.DelayEvents(50000, EVENT_GROUP_VILE_SPIRITS);
events.RescheduleEvent(EVENT_DEFILE, 50000, 0, PHASE_THREE);
events.RescheduleEvent(EVENT_SOUL_REAPER, urand(57000, 62000), 0, PHASE_THREE);
@@ -1019,16 +1034,22 @@ class boss_the_lich_king : public CreatureScript
if (!triggers.empty())
{
triggers.sort(Trinity::ObjectDistanceOrderPred(terenas, true));
- Unit* spawner = triggers.front();
+ Creature* spawner = triggers.front();
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_1, true); // summons bombs randomly
spawner->CastSpell(spawner, SPELL_SUMMON_SPIRIT_BOMB_2, true); // summons bombs on players
+ spawner->m_Events.AddEvent(new TriggerWickedSpirit(spawner), spawner->m_Events.CalculateTime(3000));
}
for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i)
{
Creature* summon = ObjectAccessor::GetCreature(*me, *i);
if (summon && summon->GetEntry() == NPC_VILE_SPIRIT)
- TeleportSpirit(summon);
+ {
+ summon->m_Events.KillAllEvents(true);
+ summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(50000));
+ summon->GetMotionMaster()->MoveRandom(10.0f);
+ summon->SetReactState(REACT_PASSIVE);
+ }
}
}
break;
@@ -1099,22 +1120,6 @@ class boss_the_lich_king : public CreatureScript
}
private:
-
- void TeleportSpirit(Creature* summon)
- {
- float dist = me->GetObjectSize() + (15.0f - me->GetObjectSize()) * float(rand_norm());
- float angle = float(rand_norm()) * float(2.0f * M_PI);
- Position dest = TerenasSpawnHeroic;
- me->MovePosition(dest, dist, angle);
- dest.m_positionZ += 15.0f;
- summon->UpdateEntry(NPC_WICKED_SPIRIT);
- summon->SetReactState(REACT_PASSIVE);
- summon->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation());
- summon->SetSpeed(MOVE_FLIGHT, 0.5f);
- summon->m_Events.KillAllEvents(true);
- summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(1000));
- }
-
void SendMusicToPlayers(uint32 musicId) const
{
WorldPacket data(SMSG_PLAY_MUSIC, 4);
@@ -1635,8 +1640,13 @@ class npc_strangulate_vehicle : public CreatureScript
return;
if (TempSummon* summ = me->ToTempSummon())
+ {
if (Unit* summoner = summ->GetSummoner())
+ {
DoCast(summoner, SPELL_HARVEST_SOUL_TELEPORT_BACK);
+ summoner->RemoveAurasDueToSpell(SPELL_HARVEST_SOUL_DAMAGE_AURA);
+ }
+ }
if (Creature* lichKing = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_THE_LICH_KING)))
lichKing->AI()->SummonedCreatureDespawn(me);
@@ -1993,6 +2003,10 @@ class npc_broken_frostmourne : public CreatureScript
_events.ScheduleEvent(EVENT_OUTRO_SUMMON_TERENAS, 6000, 0, PHASE_OUTRO);
}
+ void EnterEvadeMode()
+ {
+ }
+
void UpdateAI(uint32 const diff)
{
UpdateVictim();
@@ -2472,14 +2486,18 @@ class spell_the_lich_king_summon_into_air : public SpellScriptLoader
static Position const offset = {0.0f, 0.0f, 15.0f, 0.0f};
WorldLocation* dest = const_cast<WorldLocation*>(GetExplTargetDest());
dest->RelocateOffset(offset);
+ GetHitDest()->RelocateOffset(offset);
// spirit bombs get higher
if (GetSpellInfo()->Effects[effIndex].MiscValue == NPC_SPIRIT_BOMB)
+ {
dest->RelocateOffset(offset);
+ GetHitDest()->RelocateOffset(offset);
+ }
}
void Register()
{
- OnEffectLaunch += SpellEffectFn(spell_the_lich_king_summon_into_air_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
+ OnEffectHit += SpellEffectFn(spell_the_lich_king_summon_into_air_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
}
};
@@ -2954,6 +2972,15 @@ class spell_the_lich_king_restore_soul : public SpellScriptLoader
lichKing->AI()->DoAction(ACTION_TELEPORT_BACK);
if (Creature* spawner = GetCaster()->FindNearestCreature(NPC_WORLD_TRIGGER_INFINITE_AOI, 50.0f))
spawner->RemoveAllAuras();
+
+ std::list<Creature*> spirits;
+ GetCaster()->GetCreatureListWithEntryInGrid(spirits, NPC_WICKED_SPIRIT, 200.0f);
+ for (std::list<Creature*>::iterator itr = spirits.begin(); itr != spirits.end(); ++itr)
+ {
+ (*itr)->m_Events.KillAllEvents(true);
+ (*itr)->SetReactState(REACT_PASSIVE);
+ (*itr)->AI()->EnterEvadeMode();
+ }
}
void RemoveAura()
@@ -3046,23 +3073,18 @@ class spell_the_lich_king_trigger_vile_spirit : public SpellScriptLoader
{
PrepareSpellScript(spell_the_lich_king_trigger_vile_spirit_SpellScript);
- void TeleportOutside()
+ void ActivateSpirit()
{
Creature* target = GetHitCreature();
if (!target)
return;
- Position dest;
- Position offset;
- TerenasSpawnHeroic.GetPositionOffsetTo(*target, offset);
- GetCaster()->GetPosition(&dest);
- dest.RelocateOffset(offset);
- target->NearTeleportTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), dest.GetOrientation());
+ VileSpiritActivateEvent(target).Execute(0, 0);
}
void Register()
{
- OnHit += SpellHitFn(spell_the_lich_king_trigger_vile_spirit_SpellScript::TeleportOutside);
+ OnHit += SpellHitFn(spell_the_lich_king_trigger_vile_spirit_SpellScript::ActivateSpirit);
}
};
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
index c40a521c794..31ed1eedf10 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp
@@ -1013,11 +1013,8 @@ class npc_dream_portal : public CreatureScript
{
}
- void DoAction(int32 const action)
+ void OnSpellClick(Unit* /*clicker*/)
{
- if (action != EVENT_SPELLCLICK)
- return;
-
_used = true;
me->DespawnOrUnsummon();
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
index 704c3c2b0c2..270f56674eb 100755
--- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp
@@ -290,6 +290,11 @@ class instance_icecrown_citadel : public InstanceMapScript
case NPC_TERENAS_MENETHIL_FROSTMOURNE_H:
TerenasMenethilGUID = creature->GetGUID();
break;
+ case NPC_WICKED_SPIRIT:
+ // Remove corpse as soon as it dies (and respawn 10 seconds later)
+ creature->SetCorpseDelay(0);
+ creature->SetReactState(REACT_PASSIVE);
+ break;
default:
break;
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
index 0e453eceaa1..8ff6c2e1a3a 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp
@@ -720,20 +720,18 @@ class boss_flame_leviathan_overload_device : public CreatureScript
{
}
- void DoAction(const int32 param)
+ void OnSpellClick(Unit* /*clicker*/)
{
- if (param == EVENT_SPELLCLICK)
+ if (me->GetVehicle())
{
- if (me->GetVehicle())
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+
+ if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
{
- me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
- me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- if (Unit* player = me->GetVehicle()->GetPassenger(SEAT_PLAYER))
- {
- me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
- player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30);
- player->ExitVehicle();
- }
+ me->GetVehicleBase()->CastSpell(player, SPELL_SMOKE_TRAIL, true);
+ player->GetMotionMaster()->MoveKnockbackFrom(me->GetVehicleBase()->GetPositionX(), me->GetVehicleBase()->GetPositionY(), 30, 30);
+ player->ExitVehicle();
}
}
}
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index e7cc7360aab..9cbf81b39af 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -2996,11 +2996,14 @@ class spell_gen_mount : public SpellScriptLoader
// Triggered spell id dependent on riding skill and zone
bool canFly = false;
- uint32 map = target->GetMapId();
+ uint32 map = GetVirtualMapForMapAndZone(target->GetMapId(), target->GetZoneId());
if (map == 530 || (map == 571 && target->HasSpell(SPELL_COLD_WEATHER_FLYING)))
canFly = true;
- AreaTableEntry const* area = sAreaStore.LookupEntry(target->GetAreaId());
+ 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;
diff --git a/src/server/scripts/Spells/spell_pet.cpp b/src/server/scripts/Spells/spell_pet.cpp
index 78bdbb7f127..7830d46260c 100644
--- a/src/server/scripts/Spells/spell_pet.cpp
+++ b/src/server/scripts/Spells/spell_pet.cpp
@@ -1,4 +1,4 @@
- /*
+/*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify it
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 0ba5c866d63..463b9b2fb97 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -184,9 +184,9 @@ class spell_warr_deep_wounds : public SpellScriptLoader
damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
ApplyPctN(damage, 16 * sSpellMgr->GetSpellRank(GetSpellInfo()->Id));
-
+
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
-
+
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_DEEP_WOUNDS_RANK_PERIODIC);
uint32 ticks = spellInfo->GetDuration() / spellInfo->Effects[EFFECT_0].Amplitude;
@@ -397,7 +397,20 @@ class spell_warr_bloodthirst : public SpellScriptLoader
{
PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
- void HandleDummy(SpellEffIndex /* effIndex */)
+ void HandleDamage(SpellEffIndex /*effIndex*/)
+ {
+ int32 damage = GetEffectValue();
+ ApplyPctF(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
+
+ if (Unit* target = GetHitUnit())
+ {
+ damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
+ damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
+ }
+ SetHitDamage(damage);
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
@@ -405,7 +418,8 @@ class spell_warr_bloodthirst : public SpellScriptLoader
void Register()
{
- OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
+ OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
+ OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};
@@ -415,6 +429,38 @@ class spell_warr_bloodthirst : public SpellScriptLoader
}
};
+enum BloodthirstHeal
+{
+ SPELL_BLOODTHIRST_DAMAGE = 23881,
+};
+
+class spell_warr_bloodthirst_heal : public SpellScriptLoader
+{
+ public:
+ spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
+
+ class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
+
+ void HandleHeal(SpellEffIndex /*effIndex*/)
+ {
+ if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
+ SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())));
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_warr_bloodthirst_heal_SpellScript();
+ }
+};
+
enum Overpower
{
SPELL_UNRELENTING_ASSAULT_RANK_1 = 46859,
@@ -471,5 +517,6 @@ void AddSC_warrior_spell_scripts()
new spell_warr_execute();
new spell_warr_concussion_blow();
new spell_warr_bloodthirst();
+ new spell_warr_bloodthirst_heal();
new spell_warr_overpower();
}
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index e85a3e1870d..699e7cad97c 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -116,458 +116,6 @@ void commandFinished(void*, bool /*success*/)
fflush(stdout);
}
-/**
- * Collects all GUIDs (and related info) from deleted characters which are still in the database.
- *
- * @param foundList a reference to an std::list which will be filled with info data
- * @param searchString the search string which either contains a player GUID or a part fo the character-name
- * @return returns false if there was a problem while selecting the characters (e.g. player name not normalizeable)
- */
-bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::string searchString)
-{
- PreparedQueryResult result;
- PreparedStatement* stmt;
- if (!searchString.empty())
- {
- // search by GUID
- if (isNumeric(searchString.c_str()))
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_GUID);
-
- stmt->setUInt32(0, uint32(atoi(searchString.c_str())));
-
- result = CharacterDatabase.Query(stmt);
- }
- // search by name
- else
- {
- if (!normalizePlayerName(searchString))
- return false;
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO_BY_NAME);
-
- stmt->setString(0, searchString);
-
- result = CharacterDatabase.Query(stmt);
- }
- }
- else
- {
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_DEL_INFO);
-
- result = CharacterDatabase.Query(stmt);
- }
-
- if (result)
- {
- do
- {
- Field* fields = result->Fetch();
-
- DeletedInfo info;
-
- info.lowguid = fields[0].GetUInt32();
- info.name = fields[1].GetString();
- info.accountId = fields[2].GetUInt32();
-
- // account name will be empty for not existed account
- AccountMgr::GetName(info.accountId, info.accountName);
-
- info.deleteDate = time_t(fields[3].GetUInt32());
-
- foundList.push_back(info);
- } while (result->NextRow());
- }
-
- return true;
-}
-
-/**
- * Generate WHERE guids list by deleted info in way preventing return too long where list for existed query string length limit.
- *
- * @param itr a reference to an deleted info list iterator, it updated in function for possible next function call if list to long
- * @param itr_end a reference to an deleted info list iterator end()
- * @return returns generated where list string in form: 'guid IN (gui1, guid2, ...)'
- */
-std::string ChatHandler::GenerateDeletedCharacterGUIDsWhereStr(DeletedInfoList::const_iterator& itr, DeletedInfoList::const_iterator const& itr_end)
-{
- std::ostringstream wherestr;
- wherestr << "guid IN ('";
- for (; itr != itr_end; ++itr)
- {
- wherestr << itr->lowguid;
-
- if (wherestr.str().size() > MAX_QUERY_LEN - 50) // near to max query
- {
- ++itr;
- break;
- }
-
- DeletedInfoList::const_iterator itr2 = itr;
- if (++itr2 != itr_end)
- wherestr << "', '";
- }
- wherestr << "')";
- return wherestr.str();
-}
-
-/**
- * Shows all deleted characters which matches the given search string, expected non empty list
- *
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::DeletedInfoList
- *
- * @param foundList contains a list with all found deleted characters
- */
-void ChatHandler::HandleCharacterDeletedListHelper(DeletedInfoList const& foundList)
-{
- if (!m_session)
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_HEADER);
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
- }
-
- for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
- {
- std::string dateStr = TimeToTimestampStr(itr->deleteDate);
-
- if (!m_session)
- PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CONSOLE,
- itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
- itr->accountId, dateStr.c_str());
- else
- PSendSysMessage(LANG_CHARACTER_DELETED_LIST_LINE_CHAT,
- itr->lowguid, itr->name.c_str(), itr->accountName.empty() ? "<Not existed>" : itr->accountName.c_str(),
- itr->accountId, dateStr.c_str());
- }
-
- if (!m_session)
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_BAR);
-}
-
-/**
- * Handles the '.character deleted list' command, which shows all deleted characters which matches the given search string
- *
- * @see ChatHandler::HandleCharacterDeletedListHelper
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::DeletedInfoList
- *
- * @param args the search string which either contains a player GUID or a part fo the character-name
- */
-bool ChatHandler::HandleCharacterDeletedListCommand(const char* args)
-{
- DeletedInfoList foundList;
- if (!GetDeletedCharacterInfoList(foundList, args))
- return false;
-
- // if no characters have been found, output a warning
- if (foundList.empty())
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
- return false;
- }
-
- HandleCharacterDeletedListHelper(foundList);
- return true;
-}
-
-/**
- * Restore a previously deleted character
- *
- * @see ChatHandler::HandleCharacterDeletedListHelper
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::DeletedInfoList
- *
- * @param delInfo the informations about the character which will be restored
- */
-void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo)
-{
- if (delInfo.accountName.empty()) // account not exist
- {
- PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_ACCOUNT, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
- return;
- }
-
- // check character count
- uint32 charcount = AccountMgr::GetCharactersCount(delInfo.accountId);
- if (charcount >= 10)
- {
- PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_FULL, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
- return;
- }
-
- if (sObjectMgr->GetPlayerGUIDByName(delInfo.name))
- {
- PSendSysMessage(LANG_CHARACTER_DELETED_SKIP_NAME, delInfo.name.c_str(), delInfo.lowguid, delInfo.accountId);
- return;
- }
-
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_RESTORE_DELETE_INFO);
-
- stmt->setString(0, delInfo.name);
- stmt->setUInt32(1, delInfo.accountId);
- stmt->setUInt32(2, delInfo.lowguid);
-
- CharacterDatabase.Execute(stmt);
-
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_NAME_DATA);
- stmt->setUInt32(0, delInfo.lowguid);
- if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
- sWorld->AddCharacterNameData(delInfo.lowguid, delInfo.name, (*result)[2].GetUInt8(), (*result)[0].GetUInt8(), (*result)[1].GetUInt8());
-}
-
-/**
- * Handles the '.character deleted restore' command, which restores all deleted characters which matches the given search string
- *
- * The command automatically calls '.character deleted list' command with the search string to show all restored characters.
- *
- * @see ChatHandler::HandleCharacterDeletedRestoreHelper
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- *
- * @param args the search string which either contains a player GUID or a part of the character-name
- */
-bool ChatHandler::HandleCharacterDeletedRestoreCommand(const char* args)
-{
- // It is required to submit at least one argument
- if (!*args)
- return false;
-
- std::string searchString;
- std::string newCharName;
- uint32 newAccount = 0;
-
- // GCC by some strange reason fail build code without temporary variable
- std::istringstream params(args);
- params >> searchString >> newCharName >> newAccount;
-
- DeletedInfoList foundList;
- if (!GetDeletedCharacterInfoList(foundList, searchString))
- return false;
-
- if (foundList.empty())
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
- return false;
- }
-
- SendSysMessage(LANG_CHARACTER_DELETED_RESTORE);
- HandleCharacterDeletedListHelper(foundList);
-
- if (newCharName.empty())
- {
- // Drop not existed account cases
- for (DeletedInfoList::iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
- HandleCharacterDeletedRestoreHelper(*itr);
- }
- else if (foundList.size() == 1 && normalizePlayerName(newCharName))
- {
- DeletedInfo delInfo = foundList.front();
-
- // update name
- delInfo.name = newCharName;
-
- // if new account provided update deleted info
- if (newAccount && newAccount != delInfo.accountId)
- {
- delInfo.accountId = newAccount;
- AccountMgr::GetName(newAccount, delInfo.accountName);
- }
-
- HandleCharacterDeletedRestoreHelper(delInfo);
- }
- else
- SendSysMessage(LANG_CHARACTER_DELETED_ERR_RENAME);
-
- return true;
-}
-
-/**
- * Handles the '.character deleted delete' command, which completely deletes all deleted characters which matches the given search string
- *
- * @see Player::GetDeletedCharacterGUIDs
- * @see Player::DeleteFromDB
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- *
- * @param args the search string which either contains a player GUID or a part fo the character-name
- */
-bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args)
-{
- // It is required to submit at least one argument
- if (!*args)
- return false;
-
- DeletedInfoList foundList;
- if (!GetDeletedCharacterInfoList(foundList, args))
- return false;
-
- if (foundList.empty())
- {
- SendSysMessage(LANG_CHARACTER_DELETED_LIST_EMPTY);
- return false;
- }
-
- SendSysMessage(LANG_CHARACTER_DELETED_DELETE);
- HandleCharacterDeletedListHelper(foundList);
-
- // Call the appropriate function to delete them (current account for deleted characters is 0)
- for (DeletedInfoList::const_iterator itr = foundList.begin(); itr != foundList.end(); ++itr)
- Player::DeleteFromDB(itr->lowguid, 0, false, true);
-
- return true;
-}
-
-/**
- * Handles the '.character deleted old' command, which completely deletes all deleted characters deleted with some days ago
- *
- * @see Player::DeleteOldCharacters
- * @see Player::DeleteFromDB
- * @see ChatHandler::HandleCharacterDeletedDeleteCommand
- * @see ChatHandler::HandleCharacterDeletedListCommand
- * @see ChatHandler::HandleCharacterDeletedRestoreCommand
- *
- * @param args the search string which either contains a player GUID or a part fo the character-name
- */
-bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args)
-{
- int32 keepDays = sWorld->getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
-
- char* px = strtok((char*)args, " ");
- if (px)
- {
- if (!isNumeric(px))
- return false;
-
- keepDays = atoi(px);
- if (keepDays < 0)
- return false;
- }
- // config option value 0 -> disabled and can't be used
- else if (keepDays <= 0)
- return false;
-
- Player::DeleteOldCharacters((uint32)keepDays);
- return true;
-}
-
-bool ChatHandler::HandleCharacterEraseCommand(const char* args){
- if (!*args)
- return false;
-
- char *character_name_str = strtok((char*)args, " ");
- if (!character_name_str)
- return false;
-
- std::string character_name = character_name_str;
- if (!normalizePlayerName(character_name))
- return false;
-
- uint64 character_guid;
- uint32 account_id;
-
- Player* player = sObjectAccessor->FindPlayerByName(character_name.c_str());
- if (player)
- {
- character_guid = player->GetGUID();
- account_id = player->GetSession()->GetAccountId();
- player->GetSession()->KickPlayer();
- }
- else
- {
- character_guid = sObjectMgr->GetPlayerGUIDByName(character_name);
- if (!character_guid)
- {
- PSendSysMessage(LANG_NO_PLAYER, character_name.c_str());
- SetSentErrorMessage(true);
- return false;
- }
-
- account_id = sObjectMgr->GetPlayerAccountIdByGUID(character_guid);
- }
-
- std::string account_name;
- AccountMgr::GetName (account_id, account_name);
-
- Player::DeleteFromDB(character_guid, account_id, true, true);
- PSendSysMessage(LANG_CHARACTER_DELETED, character_name.c_str(), GUID_LOPART(character_guid), account_name.c_str(), account_id);
- return true;
-}
-
-/// Exit the realm
-bool ChatHandler::HandleServerExitCommand(const char* /*args*/)
-{
- SendSysMessage(LANG_COMMAND_EXIT);
- World::StopNow(SHUTDOWN_EXIT_CODE);
- return true;
-}
-
-/// Set the level of logging
-bool ChatHandler::HandleServerSetLogFileLevelCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char *NewLevel = strtok((char*)args, " ");
- if (!NewLevel)
- return false;
-
- sLog->SetLogFileLevel(NewLevel);
- return true;
-}
-
-/// Set the level of logging
-bool ChatHandler::HandleServerSetLogLevelCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char *NewLevel = strtok((char*)args, " ");
- if (!NewLevel)
- return false;
-
- sLog->SetLogLevel(NewLevel);
- return true;
-}
-
-/// set diff time record interval
-bool ChatHandler::HandleServerSetDiffTimeCommand(const char *args)
-{
- if (!*args)
- return false;
-
- char *NewTimeStr = strtok((char*)args, " ");
- if (!NewTimeStr)
- return false;
-
- int32 NewTime =atoi(NewTimeStr);
- if (NewTime < 0)
- return false;
-
- sWorld->SetRecordDiffInterval(NewTime);
- printf( "Record diff every %u ms\n", NewTime);
- return true;
-}
-
-/// toggle sql driver query logging
-bool ChatHandler::HandleServerToggleQueryLogging(const char* /* args */)
-{
- sLog->SetSQLDriverQueryLogging(!sLog->GetSQLDriverQueryLogging());
- if (sLog->GetSQLDriverQueryLogging())
- PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_ENABLED);
- else
- PSendSysMessage(LANG_SQLDRIVER_QUERY_LOGGING_DISABLED);
-
- return true;
-}
-
-/// @}
-
#ifdef linux
// Non-blocking keypress detector, when return pressed, return 1, else always return 0
int kb_hit_return()