diff options
76 files changed, 1694 insertions, 423 deletions
| diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 4dc5cb2e7b6..1f247a6b8ef 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -110,6 +110,20 @@ LOCK TABLES `account_banned` WRITE;  UNLOCK TABLES;  -- +-- Dumping data for table `autobroadcast` +-- + +DROP TABLE IF EXISTS `autobroadcast`; + +CREATE TABLE `autobroadcast` ( +  `realmid` int(11) NOT NULL DEFAULT '-1', +  `id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, +  `weight` tinyint(3) unsigned DEFAULT '1', +  `text` longtext NOT NULL, +  PRIMARY KEY (`id`,`realmid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +--  -- Table structure for table `ip_banned`  -- diff --git a/sql/updates/auth/2013_06_02_00_auth_autobroadcast.sql b/sql/updates/auth/2013_06_02_00_auth_autobroadcast.sql new file mode 100644 index 00000000000..2e689ffd64d --- /dev/null +++ b/sql/updates/auth/2013_06_02_00_auth_autobroadcast.sql @@ -0,0 +1,5 @@ +ALTER TABLE `autobroadcast` +  CHANGE `realmid` `realmid` INT(11) NOT NULL DEFAULT '-1', +  CHANGE `id` `id` TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT, +  CHANGE `weight` `weight` TINYINT(3) UNSIGNED DEFAULT '1', +  ENGINE=INNODB; diff --git a/sql/updates/world/2013_05_21_00_world_trinity_strings.sql b/sql/updates/world/2013_05_21_00_world_trinity_strings.sql index efdffb68b59..a8cae5aa19c 100644 --- a/sql/updates/world/2013_05_21_00_world_trinity_strings.sql +++ b/sql/updates/world/2013_05_21_00_world_trinity_strings.sql @@ -1,4 +1,4 @@ -DELETE FROM `trinity_string` WHERE entry IN (453, 548, 549, 550, 714, 716, 749, 752, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856);  +DELETE FROM `trinity_string` WHERE entry IN (453, 548, 549, 550, 714, 716, 749, 752, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856);   INSERT INTO `trinity_string` (entry, content_default) VALUES  (453,'│Player %s %s (guid: %u)'),  (548,'│ GM Mode active, Phase: -1'), diff --git a/sql/updates/world/2013_05_26_00_world_sai.sql b/sql/updates/world/2013_05_26_00_world_sai.sql new file mode 100644 index 00000000000..14879241a25 --- /dev/null +++ b/sql/updates/world/2013_05_26_00_world_sai.sql @@ -0,0 +1,115 @@ +SET @NPC_LANDGREN := 29542; +SET @NPC_ARETE    := 29560; +SET @NPC_SOUL     := 29572; +SET @NPC_SOUL_TARGET := 29577; +SET @GO_FOCUS      := 191578; +SET @GO_GATE      := 191579; + +UPDATE `gameobject_template` SET `faction`=114, `AIName`='SmartGameObjectAI' WHERE `entry`=@GO_GATE; +DELETE FROM `gameobject_template` WHERE `entry`=@GO_FOCUS; +INSERT INTO `gameobject_template` (`entry`,`type`,`displayId`,`name`,`data0`,`data1`,`data6`,`AIName`) VALUES +(@GO_FOCUS,8,0,'Archbishop Landgren''s Corpse',1566,20,0,'SmartGameObjectAI'); + +UPDATE `creature_template` SET `npcflag`=2, `unit_flags`=33280 WHERE `entry`=@NPC_ARETE; +UPDATE `creature_template` SET `faction_A`=14, `faction_H`=14, `speed_walk`=0.4, `unit_flags`=256, `dynamicflags`=0, `InhabitType`=4 WHERE `entry`=@NPC_SOUL; +UPDATE `creature_template` SET `unit_flags`=33555200, `InhabitType`=4 WHERE `entry`=@NPC_SOUL_TARGET; + +UPDATE `creature_model_info` SET `bounding_radius`=0.5745, `combat_reach`=2.25 WHERE `modelid`=26197; +UPDATE `creature_model_info` SET `bounding_radius`=0.3825, `combat_reach`=1.875 WHERE `modelid`=26346; + +DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_SOUL; +INSERT INTO `creature_template_addon` (`entry`,`bytes2`,`emote`,`auras`) VALUES +(@NPC_SOUL,1,0,'36545'); + +DELETE FROM `creature_equip_template` WHERE `entry`=@NPC_ARETE; +INSERT INTO `creature_equip_template` (`entry`,`id`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(@NPC_ARETE,1,40276,0,0); + +DELETE FROM `creature_text` WHERE `entry` IN (@NPC_LANDGREN,@NPC_ARETE,@NPC_SOUL); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_LANDGREN,0,0,'I will not die so quickly this time!',14,0,100,0,0,0,''), + +(@NPC_ARETE,0,0,'Well done. Let''s get this over with.',12,0,100,1,0,0,''), +(@NPC_ARETE,1,0,'Come, Landgren, cough up your soul so that I can ask you a very important question.',12,0,100,0,0,0,''), +(@NPC_ARETE,2,0,'YOU WILL TELL ME WHERE WESTWIND IS OR I WILL DESTROY YOUR SOUL!',14,0,100,25,0,0,''), +(@NPC_ARETE,3,0,'Then you leave me no choice. I won''t say that I won''t enjoy this.',12,0,100,1,0,0,''), +(@NPC_ARETE,4,0,'Very well. Tell me!',12,0,100,0,0,0,''), +(@NPC_ARETE,5,0,'A hidden hollow? How very interesting. You''ve served your purpose, Landgren, but I''m afraid there''ll be no resurrection for you this time!',12,0,100,6,0,0,''), +(@NPC_ARETE,6,0,'Now that the unpleasantness is finished with, let''s talk about you dealing with Grand Admiral Westwind.',12,0,100,11,0,0,''), + +(@NPC_SOUL,0,0,'You''ll get nothing out of me, monster. I am beyond your ability to influence.',12,0,100,0,0,0,''), +(@NPC_SOUL,1,0,'No.',12,0,100,0,0,0,''), +(@NPC_SOUL,2,0,'STOP! It isn''t worth it. I''ll tell you where he is.',12,0,100,0,0,0,''), +(@NPC_SOUL,3,0,'On the south end of the island is a cave -- a hidden hollow. The grand admiral has holed himself up in there, preparing for the final battle against the Lich King.',12,0,100,0,0,0,''), +(@NPC_SOUL,4,0,'AAAEEEEIIIiiiiiiiiiiiiiiiiiiiiiiiiiiii........................................',14,0,100,0,0,0,''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (22966,26560); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,22966,0,0,31,0,3,@NPC_LANDGREN,0,0,0,'','Spell Soul Coax targets Archbishop Landgren'), +(13,2,26560,0,0,31,0,3,@NPC_LANDGREN,0,0,0,'','Spell Summon Arete''s Gate effect1 targets Archbishop Landgren'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=12601; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(12601,'spell_q12847_summon_soul_moveto_bunny'); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@NPC_LANDGREN,@NPC_ARETE,@NPC_SOUL); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_LANDGREN,@NPC_ARETE,@NPC_SOUL) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@GO_FOCUS,@GO_GATE) AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_LANDGREN*100,@NPC_ARETE*100,@NPC_SOUL*100,@GO_GATE*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 +(@NPC_LANDGREN,0,0,0,25,0,100,0,0,0,0,0,28,60449,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On reset - Remove aura Shadowform'), +(@NPC_LANDGREN,0,1,0,0,0,100,0,10000,12000,9000,10000,11,60453,0,0,0,0,0,2,0,0,0,0,0,0,0,'Archbishop Landgren - On update IC - Spellcast Mind Blast'), +(@NPC_LANDGREN,0,2,0,0,0,100,0,15000,16000,18000,20000,11,60446,0,0,0,0,0,2,0,0,0,0,0,0,0,'Archbishop Landgren - On update IC - Spellcast Shadow Word: Pain'), +(@NPC_LANDGREN,0,3,0,0,0,100,0,30000,35000,35000,40000,11,60440,0,0,0,0,0,2,0,0,0,0,0,0,0,'Archbishop Landgren - On update IC - Spellcast Mind Sear'), +(@NPC_LANDGREN,0,4,5,2,0,100,1,0,50,0,0,11,60449,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On health below 50% - Spellcast Shadowform'), +(@NPC_LANDGREN,0,5,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On health below 50% - Say line'), +(@NPC_LANDGREN,0,6,0,6,0,100,0,0,0,0,0,11,22965,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On death - Spellcast Summon Archbishop Landgren''s Corpse Spell Focus'), +(@NPC_LANDGREN,0,7,8,8,0,100,0,26560,0,0,0,45,0,1,0,0,0,0,20,@GO_GATE,50,0,0,0,0,0,'Archbishop Landgren - On spellhit Summon Arete''s Gate - Set data 0 1 Arete''s Gate'), +(@NPC_LANDGREN,0,8,0,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,20,@GO_FOCUS,5,0,0,0,0,0,'Archbishop Landgren - On spellhit Summon Arete''s Gate - Set data 0 1 Arete''s Gate'), +(@NPC_LANDGREN,0,9,10,38,0,100,0,0,1,0,0,11,12601,2,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On data 0 1 set - Spellcast Summon Landgren''s Soul Moveto Target Bunny'), +(@NPC_LANDGREN,0,10,0,61,0,100,0,0,0,0,0,11,12600,2,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren - On data 0 1 set - Spellcast Summon Landgren''s Soul'), + +(@NPC_ARETE,0,0,1,1,0,100,1,0,0,0,0,11,34427,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Spellcast Ethereal Teleport'), +(@NPC_ARETE,0,1,2,61,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Remove npcflag questgiver'), +(@NPC_ARETE,0,2,3,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_LANDGREN,20,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Turn to Archbishop Landgren'), +(@NPC_ARETE,0,3,0,61,0,100,0,0,0,0,0,80,@NPC_ARETE*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete - Just summoned - Run script'), + +(@NPC_SOUL,0,0,0,54,0,100,0,0,0,0,0,80,@NPC_SOUL*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul - Just summoned - Run script'), + +(@GO_FOCUS,1,0,0,38,0,100,0,0,1,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Archbishop Landgren''s Corpse Spell Focus - On data 0 1 set - Set phase 2'), + +(@GO_GATE,1,0,0,38,0,100,0,0,1,0,0,80,@GO_GATE*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway - On data 0 1 set - Run script'), + +(@GO_GATE*100,9,0,0,0,0,100,0,4000,4000,0,0,11,18280,0,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway script - Spellcast Summon Arete'), +(@GO_GATE*100,9,1,0,0,0,100,0,180000,180000,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway script - Set phase 2'), + +(@NPC_ARETE*100,9,0,0,0,0,100,0,500,500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,1,0,0,0,100,0,0,0,0,0,46,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Move forward'), +(@NPC_ARETE*100,9,2,0,0,0,100,0,4000,4000,0,0,66,0,0,0,0,0,0,19,@NPC_LANDGREN,20,0,0,0,0,0,'Lord-Commander Arete script - Turn to Archbishop Landgren'), +(@NPC_ARETE*100,9,3,0,0,0,100,0,1000,1000,0,0,11,22966,0,0,0,0,0,19,@NPC_LANDGREN,20,1,0,0,0,0,'Lord-Commander Arete script - Spellcast Soul Coax'), +(@NPC_ARETE*100,9,4,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,5,0,0,0,100,0,8000,8000,0,0,45,0,1,0,0,0,0,19,@NPC_LANDGREN,20,1,0,0,0,0,'Lord-Commander Arete script - Set data 0 1 Archbishop Landgren'), +(@NPC_ARETE*100,9,6,0,0,0,100,0,12000,12000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,7,0,0,0,100,0,7000,7000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,8,0,0,0,100,0,4000,4000,0,0,11,27765,0,0,0,0,0,19,@NPC_SOUL,20,0,0,0,0,0,'Lord-Commander Arete script - Spellcast Soul Wrack'), +(@NPC_ARETE*100,9,9,0,0,0,100,0,15000,15000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,10,0,0,0,100,0,0,0,0,0,92,0,27765,1,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Interrupt spellcast'), +(@NPC_ARETE*100,9,11,0,0,0,100,0,10000,10000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,12,0,0,0,100,0,4000,4000,0,0,5,25,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Play emote'), +(@NPC_ARETE*100,9,13,0,0,0,100,0,4000,4000,0,0,11,54723,0,0,0,0,0,19,@NPC_SOUL,20,0,0,0,0,0,'Lord-Commander Arete script - Spellcast Soul Wrack'), +(@NPC_ARETE*100,9,14,0,0,0,100,0,8000,8000,0,0,92,0,54723,1,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Interrupt spellcast'), +(@NPC_ARETE*100,9,15,0,0,0,100,0,0,0,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Say line'), +(@NPC_ARETE*100,9,16,0,0,0,100,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Set npcflag questgiver'), +(@NPC_ARETE*100,9,17,0,0,0,100,0,98000,98000,0,0,69,0,0,0,0,0,0,20,@GO_GATE,10,0,0,0,0,0,'Lord-Commander Arete script - Move to position'), +(@NPC_ARETE*100,9,18,0,0,0,100,0,2000,2000,0,0,11,34427,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Spellcast Ethereal Teleport'), +(@NPC_ARETE*100,9,19,0,0,0,100,0,500,500,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Lord-Commander Arete script - Despawn'), + +(@NPC_SOUL*100,9,0,0,0,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_ARETE,20,0,0,0,0,0,'Landgren''s Soul script - Turn to Lord-Commander Arete'), +(@NPC_SOUL*100,9,1,0,0,0,100,0,500,500,0,0,11,36545,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Spellcast Floating Drowned'), +(@NPC_SOUL*100,9,2,0,0,0,100,0,6500,6500,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'), +(@NPC_SOUL*100,9,3,0,0,0,100,0,10000,10000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'), +(@NPC_SOUL*100,9,4,0,0,0,100,0,15000,15000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'), +(@NPC_SOUL*100,9,5,0,0,0,100,0,10000,10000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'), +(@NPC_SOUL*100,9,6,0,0,0,100,0,16000,16000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Say line'), +(@NPC_SOUL*100,9,7,0,0,0,100,0,5000,5000,0,0,11,35426,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Spellcast Arcane Explosion Visual'), +(@NPC_SOUL*100,9,8,0,0,0,100,0,1000,1000,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Landgren''s Soul script - Despawn'); diff --git a/sql/updates/world/2013_05_26_01_world_sai.sql b/sql/updates/world/2013_05_26_01_world_sai.sql new file mode 100644 index 00000000000..0c70f665c27 --- /dev/null +++ b/sql/updates/world/2013_05_26_01_world_sai.sql @@ -0,0 +1,39 @@ +SET @THANE          := 29919; +SET @SPELL          := 31696; +SET @B_STRIKE       := 58460; +SET @REND           := 16509; +SET @P_SMASH        := 60868; +SET @EVENT          := 19490; + +DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN (@SPELL); +INSERT INTO `disables`(`sourceType`,`entry`,`flags`,`comment`) VALUES +(0,@SPELL,64,'Ignore LOS on Thane'); + +DELETE FROM `event_scripts` WHERE `id`=@EVENT; +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(@EVENT,0,15,53799,4,29919,30,0,0,0); + +DELETE FROM `creature_text` WHERE `entry` IN (@THANE); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@THANE,1,0, 'By order of Duke Lankral, Commander of the Knights of the Ebon Blade, Vanquisher of the Scourge and Conquerer of The Shadow Vault, you are hearby served notice to cease and desist from all activities providing materiel assistance, vrykul, and any other type of support to the Lich King. Failure to comply will result in your immediate destruction. My messenger will serve as the instrument of my will. What is your decision?',12,0,100,0,0,0,'Thane'), +(@THANE,2,0, 'What is this?',14,0,100,0,0,0,'Thane'), +(@THANE,3,0, 'My answer? Here''s my answer, little messenger!',14,0,100,0,0,0,'Thane'), +(@THANE,4,0, 'I will feed you to the dogs!',14,0,100,0,0,0,'Thane'); + +UPDATE `creature_template` SET AIName='SmartAI' WHERE entry = @THANE; +DELETE FROM `smart_scripts` WHERE source_type=0 AND entryorguid = @THANE; +DELETE FROM `smart_scripts` WHERE source_type=9 AND entryorguid = @THANE*100; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES  +(@THANE,0,0,1,4,0,100,0,0,0,0,0,1,2,12000,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On spellhit - Say text2'), +(@THANE,0,1,2,61,0,100,0,0,0,0,0,18,33685504,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On Link - Set Unit Flags'), +(@THANE,0,2,0,61,0,100,0,0,0,0,0,84,1,0,0,0,0,0,7,0,0,0,0,0,0,0,'Thane - On Link - Make player say Text1'), +(@THANE,0,3,0,52,0,100,0,2,@THANE,0,0,1,3,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On Text2 over - Say Text3'), +(@THANE,0,4,5,52,0,100,0,3,@THANE,0,0,1,4,4000,0,0,0,0,1,0,0,0,0,0,0,0,'Thane - On Text3 over - Say Text4'), +(@THANE,0,5,0,61,0,100,0,0,0,0,0,19,33685504,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Thane - On Link - Remove unit flags'), +(@THANE,0,6,0,0,0,100,0,4000,7000,4000,7000,11,@B_STRIKE,0,0,0,0,0,5,0,0,0,0,0,0,0,'Thane - In Combat - Cast Brutal Strike'), +(@THANE,0,7,0,0,0,100,0,4000,15000,4000,15000,11,@REND,0,0,0,0,0,5,0,0,0,0,0,0,0,'Thane - In Combat - Cast Rend'), +(@THANE,0,8,0,0,0,100,0,12000,25000,12000,25000,11,@P_SMASH,0,0,0,0,0,5,0,0,0,0,0,0,0,'Thane - In Combat - Cast Powerful Smash'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry`=@SPELL; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES  +(13,1,@SPELL,0,0,31,0,3,@THANE,0,0,0,'','Shadow Decree hits only Thane'); diff --git a/sql/updates/world/2013_05_26_02_world_sai.sql b/sql/updates/world/2013_05_26_02_world_sai.sql new file mode 100644 index 00000000000..a30b6c8be43 --- /dev/null +++ b/sql/updates/world/2013_05_26_02_world_sai.sql @@ -0,0 +1,79 @@ +-- Not-So-Honorable Combat (13137) +SET @GO_SIGNAL_FIRE             := 193024;  -- Battlescar Signal Fire +SET @EVENT_SCRIPT               := 20069;   -- Event Script +SET @NPC_POSSESSED_ISKALDER     := 30924;   -- Possessed Iskalder <The Ancient Hero> +SET @NPC_VARDMADRA              := 30945;   -- Vadmadra +SET @NPC_LADY_NIGHTSWOOD        := 30955;   -- Lady Nightswood +SET @MOVE_TARGET_BUNNY          := 25715;   -- Not-So-Honorable Combat: Summon Lady Nightswood's Moveto Target Bunny +SET @TARGET_BUNNY               := 30959;   -- Lady Nightswood's Moveto Target Bunny +SET @SUMMON_NIGHTSWOOD          := 25727;   -- Not-So-Honorable Combat: Summon Lady Nightswood +SET @POSSESS_VARDMADRA          := 25745;   -- Possession + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry`IN (@SUMMON_NIGHTSWOOD,@MOVE_TARGET_BUNNY,@POSSESS_VARDMADRA); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES  +(13,1,@SUMMON_NIGHTSWOOD,0,0,31,0,3,@TARGET_BUNNY,0,0,0,'','Summon Nightswood only hits Target Bunny'), +(13,1,@MOVE_TARGET_BUNNY,0,0,31,0,3,@NPC_POSSESSED_ISKALDER,0,0,0,'','Move Target Bunny only hits Target Bunny'), +(13,1,@POSSESS_VARDMADRA,0,0,31,0,3,@NPC_VARDMADRA,0,0,0,'','Possess Vardmadra only hits Vardmadra'); + +UPDATE `creature_template` SET `AIName`='SmartAI',`faction_A`=2116,`faction_H`=2116,`unit_flags`=33088,`mindmg`=422,`maxdmg`=586,`attackpower`=642,`minrangedmg`=345,`maxrangedmg`=509,`rangedattackpower`=103 WHERE `entry`=@NPC_POSSESSED_ISKALDER; +UPDATE `creature_template` SET `faction_A`=2116,`faction_H`=2116,`unit_flags`=33536,`AIName`='SmartAI',`minlevel`=80, `maxlevel`=80 WHERE `entry`=@NPC_VARDMADRA; +UPDATE `creature_template` SET `AIName`='SmartAI', `InhabitType`=7 WHERE  `entry` IN (@TARGET_BUNNY,@NPC_LADY_NIGHTSWOOD); +UPDATE `creature_template` SET `modelid1`=11686, `modelid2`=0 WHERE  `entry`=@TARGET_BUNNY; +DELETE FROM `creature_template_addon` WHERE `entry` IN (@NPC_POSSESSED_ISKALDER,@NPC_VARDMADRA); +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(@NPC_POSSESSED_ISKALDER,0,0x0,0x1,'58102'), +(@NPC_VARDMADRA,0,0x3000000,0x1,''); + +DELETE FROM `creature_equip_template` WHERE `entry`=@NPC_POSSESSED_ISKALDER; +INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(@NPC_POSSESSED_ISKALDER,43296,43295,0); + +DELETE FROM `creature_text` WHERE `entry` IN (@NPC_POSSESSED_ISKALDER,@NPC_VARDMADRA,@NPC_LADY_NIGHTSWOOD); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_POSSESSED_ISKALDER,0,0,'Now fight me, $N! Kill Iskalder!',14,0,100,0,0,1167,'Possessed Iskalder'), +(@NPC_VARDMADRA,0,0, 'Iskalder, there you are. What is this? Engaged in battle already?',14,0,100,457,0,13824,'Vardmadra'), +(@NPC_VARDMADRA,1,0, 'NO! How is this possible?',14,0,100,457,0,13825,'Vardmadra'), +(@NPC_VARDMADRA,2,0, 'I know not how this was possible, but you must still be judged Iskalder. Wait... what is this?',14,0,100,457,0,13824,'Vardmadra'), +(@NPC_VARDMADRA,3,0, 'Stay away from me creature! Do not touch me!',14,0,100,0,0,1168,'Vardmadra to Nightswood'), +(@NPC_VARDMADRA,4,0, 'Ahahahahahaha! It is done. Return to my cave. We have much to discuss!',14,0,100,457,0,1167,'Vardmadra to '), +(@NPC_LADY_NIGHTSWOOD,0,0, 'This? This is me taking control of you. This is me setting up my final revenge!',14,0,100,457,0,13824,'Lady Nightswood'); + +-- Possessed Iskalder <The Ancient Hero> +DELETE FROM `event_scripts` WHERE `id`=@EVENT_SCRIPT; +INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@EVENT_SCRIPT,5,10,@NPC_POSSESSED_ISKALDER,180000,0,7229.436,3642.27,809.0175,0); + +DELETE FROM `smart_scripts` WHERE `source_type` IN (0,9) AND `entryorguid` IN (@NPC_POSSESSED_ISKALDER,@NPC_VARDMADRA,@NPC_LADY_NIGHTSWOOD,@TARGET_BUNNY,@TARGET_BUNNY*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_POSSESSED_ISKALDER,0,0,1,54,0,100,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - On Summon - Remove unit flag'), +(@NPC_POSSESSED_ISKALDER,0,1,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - On Link - Talk'), +(@NPC_POSSESSED_ISKALDER,0,2,0,2,0,100,1,0,65,0,0,12,@NPC_VARDMADRA,3,180000,0,0,0,8,0,0,0,7182.766602,3661.931885, 826.149292, 5.838641, 'Possessed Iskalder - on 65% HP - Spawn Vardmara'), +(@NPC_POSSESSED_ISKALDER,0,3,0,4,0,100,1,0,0,0,0,11,60108,0,0,0,0,0,2,0,0,0,0,0,0,0,'Iskalder - On Aggro - Cast Heroic Leap'), +(@NPC_POSSESSED_ISKALDER,0,4,0,0,0,100,0,3500,3500,14500,16700,11,15496,0,0,0,0,0,2,0,0,0,0,0,0,0,'Iskalder - In Combat - Cast Cleave'), +(@NPC_POSSESSED_ISKALDER,0,5,0,0,0,100,0,5000,6000,11200,15800,11,57846,0,0,0,0,0,2,0,0,0,0,0,0,0,'Iskalder - In Combat - Cast Heroic Strike'), +(@NPC_POSSESSED_ISKALDER,0,6,0,0,0,100,0,9000,11000,25000,25000,11,60121,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - In Combat - Cast Ancient Curse'), +(@NPC_POSSESSED_ISKALDER,0,7,0,2,0,100,1,0,50,0,0,1,0,0,0,0,0,0,11,@NPC_VARDMADRA,200,0,0,0,0,0,'Iskalder - On HPC - Make Vardmadra Say'), +(@NPC_POSSESSED_ISKALDER,0,8,0,6,0,100,1,0,0,0,0,45,1,1,0,0,0,0,11,@NPC_VARDMADRA,200,0,0,0,0,0,' Iskalder - On event death - Send Data to Vardmadra'), +(@NPC_POSSESSED_ISKALDER,0,9,10,1,0,100,1,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0,'Iskalder - OOC - Remove unit flag'), +(@NPC_POSSESSED_ISKALDER,0,10,0,61,0,100,1,0,0,0,0,45,2,2,0,0,0,0,11,@NPC_VARDMADRA,300,0,0,0,0,0, 'Possessed Iskalder - On link - Set Data on Vardmara'), + +(@NPC_VARDMADRA,0,0,1,38,0,100,0,1,1,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Receive Data - Set Run'), +(@NPC_VARDMADRA,0,1,2,61,0,100,0,1,1,0,0,69,0,0,0,0,0,0,8,0,0,0,7234.742,3643.584,811.8065,5.507,'Vardmadra - Linked with Previous Event - Move to position'), +(@NPC_VARDMADRA,0,2,3,61,0,100,0,0,0,0,0,1,1,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - Linked with Previous Event - Say'), +(@NPC_VARDMADRA,0,3,4,61,0,100,1,0,0,0,0,11,@MOVE_TARGET_BUNNY,2,0,0,0,0,19,@NPC_POSSESSED_ISKALDER,200,1,0,0,0,0,'Vardmadra - Linked with Previous Event - Cast Not-So-Honorable Combat: Summon Lady Nightswood''s Moveto Target Bunny'), +(@NPC_VARDMADRA,0,4,5,52,0,100,0,1,@NPC_VARDMADRA,0,0,1,2,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Text Over - Say'), +(@NPC_VARDMADRA,0,5,0,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_POSSESSED_ISKALDER,200,1,0,0,0,0,'Vardmadra - On Link - Turn to Iskalder'), +(@NPC_VARDMADRA,0,6,7,52,0,100,0,2,@NPC_VARDMADRA,0,0,1,0,10000,0,0,0,0,11,@NPC_LADY_NIGHTSWOOD,200,0,0,0,0,0,'Vardmadra - On Text Over - Say'), +(@NPC_VARDMADRA,0,7,8,61,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_LADY_NIGHTSWOOD,200,0,0,0,0,0,'Vardmadra - On Link - Turn to Lady Nightswood'), +(@NPC_VARDMADRA,0,8,0,61,0,100,0,0,0,0,0,45,1,1,0,0,0,0,11,@NPC_LADY_NIGHTSWOOD,200,0,0,0,0,0,'Vardmadra - On link - Send Data to Lady Nightswood'), +(@NPC_VARDMADRA,0,9,0,52,0,100,0,0,@NPC_LADY_NIGHTSWOOD,0,0,1,3,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Text Over - Say'), +(@NPC_VARDMADRA,0,10,0,52,0,100,0,3,@NPC_VARDMADRA,0,0,1,4,10000,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra- On Text Over - Say'), +(@NPC_VARDMADRA,0,11,0,52,0,100,0,4,@NPC_VARDMADRA,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Text Over - Despawn'), +(@NPC_VARDMADRA,0,12,0,38,0,100,0,2,2,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Vardmadra - On Receive Data - Despawn'), + +(@TARGET_BUNNY,0,0,0,54,0,100,0,0,0,0,0,80,@TARGET_BUNNY*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Lady Nightswood Move-to-Bunny - On Summon - Start Timed Script'), +(@TARGET_BUNNY*100,9,0,0,0,0,100,0,7000,7000,7000,7000,69,0,0,0,0,0,0,8,0,0,0,7242.77,3631.67,814.0644,2.227,'Lady Nightswood Move-to-Bunny - On Script - Go to position'), +(@TARGET_BUNNY*100,9,1,0,0,0,100,0,8000,8000,8000,8000,11,@SUMMON_NIGHTSWOOD,2,0,0,0,0,1,0,0,0,0,0,0,0,'Lady Nightswood Move-to-Bunny - Linked with Previous Event - Cast Not-So-Honorable Combat: Summon Lady Nightswood''s Moveto Target Bunny'), + +(@NPC_LADY_NIGHTSWOOD,0,0,0,54,0,100,0,0,0,0,0,66,0,0,0,0,0,0,19,@NPC_VARDMADRA,200,0,0,0,0,0,'Lady Nightswood - On Summon - Turn to Vardmadra'), +(@NPC_LADY_NIGHTSWOOD,0,1,0,38,0,100,0,1,1,0,0,11,@POSSESS_VARDMADRA,0,0,0,0,0,19,@NPC_VARDMADRA,200,0,0,0,0,0,'Lady Nigtswood - On Receive Data - Possess Vardmadra'); diff --git a/sql/updates/world/2013_05_26_03_world_sai.sql b/sql/updates/world/2013_05_26_03_world_sai.sql new file mode 100644 index 00000000000..6a3225266e7 --- /dev/null +++ b/sql/updates/world/2013_05_26_03_world_sai.sql @@ -0,0 +1,5 @@ +SET @SUMMON_ARETE       := 18280; -- LC Arete Summon Spell +SET @ARETE_GATE         := 191579; -- Arete Gateway Object +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ARETE_GATE*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 +(@ARETE_GATE*100,9,0,0,0,0,100,0,4000,4000,0,0,11,@SUMMON_ARETE,0,0,0,0,0,1,0,0,0,0,0,0,0,'Arete''s Gateway - On Script - Spellcast Summon Arete'); diff --git a/sql/updates/world/2013_05_26_04_world_waypoints.sql b/sql/updates/world/2013_05_26_04_world_waypoints.sql new file mode 100644 index 00000000000..58f1e50bf23 --- /dev/null +++ b/sql/updates/world/2013_05_26_04_world_waypoints.sql @@ -0,0 +1,27 @@ +-- Pathing for Entry 5934 Heartrazor +SET @NPC := 51821; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5183.809,`position_y`=-1170.219,`position_z`=45.11078 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +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,-5183.809,-1170.219,45.11078,0,0,0,100,0), +(@PATH,2,-5181.056,-1184.849,45.97993,0,0,0,100,0), +(@PATH,3,-5169.914,-1200.506,47.15270,0,0,0,100,0), +(@PATH,4,-5159.998,-1216.499,48.38121,0,0,0,100,0), +(@PATH,5,-5173.076,-1229.047,49.04836,0,0,0,100,0), +(@PATH,6,-5194.938,-1230.641,48.47133,0,0,0,100,0), +(@PATH,7,-5207.135,-1229.340,47.92607,0,0,0,100,0), +(@PATH,8,-5215.482,-1216.020,46.70019,0,0,0,100,0), +(@PATH,9,-5207.343,-1200.787,46.16835,0,0,0,100,0), +(@PATH,10,-5184.156,-1170.526,45.12170,0,0,0,100,0), +(@PATH,11,-5183.285,-1153.094,44.87883,0,0,0,100,0), +(@PATH,12,-5183.285,-1153.094,44.87883,0,0,0,100,0), +(@PATH,13,-5177.142,-1130.755,43.77563,0,0,0,100,0), +(@PATH,14,-5164.937,-1121.575,43.77023,0,0,0,100,0), +(@PATH,15,-5145.432,-1115.095,43.74949,0,0,0,100,0), +(@PATH,16,-5138.181,-1109.642,44.04351,0,0,0,100,0), +(@PATH,17,-5154.783,-1119.312,43.67305,0,0,0,100,0), +(@PATH,18,-5176.401,-1127.441,43.71729,0,0,0,100,0), +(@PATH,19,-5183.811,-1149.325,44.34430,0,0,0,100,0); diff --git a/sql/updates/world/2013_05_26_05_world_misc.sql b/sql/updates/world/2013_05_26_05_world_misc.sql new file mode 100644 index 00000000000..e819f7a93bc --- /dev/null +++ b/sql/updates/world/2013_05_26_05_world_misc.sql @@ -0,0 +1,120 @@ +SET @OGUID := 7080; + +SET @ARTHAS := 27455; +SET @MURADIN := 27480; +SET @THELZAN := 27851; +SET @ALTAR := 190332; + +UPDATE `creature` SET `spawndist`=0,`MovementType`=0 WHERE `id`=@THELZAN; + +DELETE FROM `gameobject` WHERE `map`=571 AND `id` IN (192066,192065,192064,190191,@ALTAR); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES  +(@OGUID,192066,571,1,1,4816.637,-582.2271,163.1873,-1.240983,-0.5743933,0.2897787,-0.5093117,0.5715788,120,0,1), +(@OGUID+1,192065,571,1,1,4816.552,-581.2853,163.0618,1.043091,0.5583439,0.3292217,0.3740091,0.6633116,120,0,1), +(@OGUID+2,192064,571,1,1,4823.089,-581.7293,164.1632,2.408346,-0.3306689,-0.6249218,0.6858006,0.1726511,120,0,1), +(@OGUID+3,190191,571,1,1,4819.284,-583.5658,163.5637,1.343901,0,0,0.6225138,0.7826088,120,0,1), +(@OGUID+4,@ALTAR,571,1,1,4819.374,-583.699,163.5065,1.500983,0,0,0.6819983,0.7313538,120,0,1); + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@THELZAN; +UPDATE `creature_template` SET `InhabitType`=1, `AIName`='SmartAI' WHERE `entry` IN (@MURADIN,@ARTHAS); + +DELETE FROM `event_scripts` WHERE `id`=18281; +INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`x`,`y`,`z`,`o`) VALUES +(18281,0,10,@THELZAN,20000,4819.284,-583.5658,163.5637,1.343901); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=49825; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@THELZAN; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`Comment`) VALUES +(13,1,49825,0,0,31,3,@MURADIN,0,0,0, 'Arthas Calls to Spirits targets Muradin'), +(22,2,@THELZAN,0,0,29,@MURADIN,100,0,1,0, 'SAI activates only if Muradin is not around'); + +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@ARTHAS,@MURADIN,@THELZAN); +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ARTHAS*100,@MURADIN*100,@MURADIN*100+1,@THELZAN*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ARTHAS,0,0,0,38,0,100,0,0,10,0,0,80,@ARTHAS*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - On dataset - Run script'), + +(@MURADIN,0,0,0,38,0,100,0,0,10,0,0,80,@MURADIN*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - On dataset - Run script'), +(@MURADIN,0,1,0,8,0,100,0,49825,0,0,0,80,@MURADIN*100+1,2,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - On spellhit - Run script'), + +(@THELZAN,0,0,0,54,0,100,0,0,0,0,0,3,0,17200,0,0,0,0,1,0,0,0,0,0,0,0,'Thel''zan Spell Dummy - Just summoned - Run script'), +(@THELZAN,0,1,0,54,0,100,0,0,0,0,0,80,@THELZAN*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Thel''zan Spell Dummy - Just summoned - Run script'), + +(@ARTHAS*100,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - reset data 0'), +(@ARTHAS*100,9,1,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,4820.175,-581.226,163.6158,0,'Prince Arthas - Script - moveto'), +(@ARTHAS*100,9,2,0,0,0,100,0,8000,8000,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - say 6'), +(@ARTHAS*100,9,3,0,0,0,100,0,6000,6000,0,0,1,7,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - say 7'), +(@ARTHAS*100,9,4,0,0,0,100,0,6000,6000,0,0,11,49824,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - Spellcast Arthas Calls to Spirits'), +(@ARTHAS*100,9,5,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,4819.658,-582.5223,163.752,0,'Prince Arthas - Script - moveto'), +(@ARTHAS*100,9,6,0,0,0,100,0,0,0,0,0,71,0,7,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - Change weapon'), +(@ARTHAS*100,9,7,0,0,0,100,0,1000,1000,0,0,5,397,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - Emote OneShotPointNoSheathe'), +(@ARTHAS*100,9,8,0,0,0,100,0,0,0,0,0,71,0,7,33350,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - Change weapon'), +(@ARTHAS*100,9,9,0,0,0,100,0,0,0,0,0,9,0,0,0,0,0,0,20,@ALTAR,5,0,0,0,0,0,'Prince Arthas - Script - Activate Altar'), +(@ARTHAS*100,9,10,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,8,0,0,0,4814.56,-577.2604,162.2522,0,'Prince Arthas - Script - moveto'), +(@ARTHAS*100,9,11,0,0,0,100,0,3500,3500,0,0,5,15,0,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - Emote OneShotRoar'), +(@ARTHAS*100,9,12,0,0,0,100,0,4000,4000,0,0,53,1,@ARTHAS,0,0,0,0,1,0,0,0,0,0,0,0,'Prince Arthas - Script - Start WP movement'), + +(@MURADIN*100,9,0,0,0,0,100,0,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - reset data 0'), +(@MURADIN*100,9,1,0,0,0,100,0,500,500,0,0,69,0,0,0,0,0,0,8,0,0,0,4818.622,-582.4843,163.5883,0,'Muradin - Script - moveto'), +(@MURADIN*100,9,2,0,0,0,100,0,2000,2000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.305801,'Muradin - Script - turnto'), +(@MURADIN*100,9,3,0,0,0,100,0,1000,1000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - say 2'), +(@MURADIN*100,9,4,0,0,0,100,0,500,500,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - kneel'), +(@MURADIN*100,9,5,0,0,0,100,0,15000,15000,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - stand'), +(@MURADIN*100,9,6,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,@ARTHAS,10,0,0,0,0,0,'Muradin - Script - turnto Prince Arthas'), +(@MURADIN*100,9,7,0,0,0,100,0,2000,2000,0,0,5,274,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Emote no'), +(@MURADIN*100,9,8,0,0,0,100,0,2500,2500,0,0,5,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Emote Exclamation'), +(@MURADIN*100,9,9,0,0,0,100,0,7000,7000,0,0,69,0,0,0,0,0,0,8,0,0,0,4817.42,-581.4944,163.2614,0,'Muradin - Script - moveto'), +(@MURADIN*100,9,10,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,19,@ARTHAS,10,0,0,0,0,0,'Muradin - Script - turnto Prince Arthas'), +(@MURADIN*100,9,11,0,0,0,100,0,1500,1500,0,0,1,5,0,0,0,0,0,19,@ARTHAS,10,0,0,0,0,0,'Muradin - Script - Prince Arthas say 5'), +(@MURADIN*100,9,12,0,0,0,100,0,5000,5000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - say 3'), +(@MURADIN*100,9,13,0,0,0,100,0,0,0,0,0,45,0,10,0,0,0,0,19,@ARTHAS,10,0,0,0,0,0,'Muradin - Script - set data 0 10 on Prince Arthas'), +(@MURADIN*100,9,14,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,5.323254,'Muradin - Script - turnto'), + +(@MURADIN*100+1,9,0,0,0,0,100,0,0,0,0,0,40,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Set sheath'), +(@MURADIN*100+1,9,1,0,0,0,100,0,0,0,0,0,18,1,1,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Set unit_flag2'), +(@MURADIN*100+1,9,2,0,0,0,100,0,13000,13000,0,0,19,1,1,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Remove unit_flag2'), +(@MURADIN*100+1,9,3,0,0,0,100,0,500,500,0,0,17,64,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - emotestate stun'), +(@MURADIN*100+1,9,4,0,0,0,100,0,5000,5000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - say 4'), +(@MURADIN*100+1,9,5,0,0,0,100,0,3000,3000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - say 5'), +(@MURADIN*100+1,9,6,0,0,0,100,0,4000,4000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - emotestate none'), +(@MURADIN*100+1,9,7,0,0,0,100,0,1000,1000,0,0,11,49829,3,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Spellcast Frostmourne Cavern Quest Credit'), +(@MURADIN*100+1,9,8,0,0,0,100,0,0,0,0,0,53,1,@MURADIN,0,0,0,0,1,0,0,0,0,0,0,0,'Muradin - Script - Start WP movement'), + +(@THELZAN*100,9,0,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thel''zan Spell Dummy - Script - Say 0'), +(@THELZAN*100,9,1,0,0,0,100,0,0,0,0,0,11,33271,0,0,0,0,0,1,0,0,0,0,0,0,0,'Thel''zan Spell Dummy - Script - Spellcast Internal Shake Camera w/ rumble sound'), +(@THELZAN*100,9,2,0,0,0,100,0,7000,7000,0,0,12,@MURADIN,3,116000,0,0,0,8,0,0,0,4817.494,-579.6047,163.0956,5.102134,'Thel''zan Spell Dummy - Script - Summon Muradin'), +(@THELZAN*100,9,3,0,0,0,100,0,0,0,0,0,12,@ARTHAS,3,102000,0,0,0,8,0,0,0,4821.529,-579.8818,163.5944,4.167512,'Thel''zan Spell Dummy - Script - Summon Prince Arthas'), +(@THELZAN*100,9,4,0,0,0,100,0,0,0,0,0,9,0,0,0,0,0,0,20,@ALTAR,5,0,0,0,0,0,'Thel''zan Spell Dummy - Script - set data 0 10 on Frostmourne Altar'), +(@THELZAN*100,9,5,0,0,0,100,0,3000,3000,0,0,1,4,0,0,0,0,0,19,@ARTHAS,10,0,0,0,0,0,'Thel''zan Spell Dummy - Script - Prince Arthas Say 4'), +(@THELZAN*100,9,6,0,0,0,100,0,3000,3000,0,0,5,25,0,0,0,0,0,19,@ARTHAS,10,0,0,0,0,0,'Thel''zan Spell Dummy - Script - Prince Arthas Emote Point'), +(@THELZAN*100,9,7,0,0,0,100,0,3500,3500,0,0,45,0,10,0,0,0,0,19,@MURADIN,10,0,0,0,0,0,'Thel''zan Spell Dummy - Script - Set data 0 10 on Muradin'); + +DELETE FROM `waypoints` WHERE `entry` IN (@ARTHAS,@MURADIN); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ARTHAS,1,4793.066,-571.0735,160.8400, 'Prince Arthas'), +(@ARTHAS,2,4772.816,-566.8235,162.2605, 'Prince Arthas'), +(@ARTHAS,3,4759.816,-568.5735,164.2808, 'Prince Arthas'), +(@ARTHAS,4,4743.573,-564.3865,166.2362, 'Prince Arthas'), +(@MURADIN,1,4797.722,-576.3405,160.1779, 'Muradin'), +(@MURADIN,2,4770.222,-575.5905,162.9453, 'Muradin'), +(@MURADIN,3,4757.972,-575.0905,164.5265, 'Muradin'), +(@MURADIN,4,4753.972,-572.8405,165.1388, 'Muradin'), +(@MURADIN,5,4749.972,-569.5905,165.7607, 'Muradin'), +(@MURADIN,6,4748.024,-566.1866,165.7932, 'Muradin'); + +DELETE FROM `creature_text` WHERE `entry` IN (@ARTHAS,@MURADIN,@THELZAN); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ARTHAS,0,0, 'Captain, why are the guards not at their posts?',12,0,100,6,0,12725, 'Prince Arthas'), +(@ARTHAS,1,0, 'Uther had my troops recalled? Damn it! If my warriors abandon me, I''ll never defeat Mal''Ganis. The ships must be burned before the men reach the shore!',12,0,100,5,0,12726, 'Prince Arthas'), +(@ARTHAS,2,0, 'Burned down to their frames! No one goes home until our job here is done!',12,0,100,15,0,12727, 'Prince Arthas'), +(@ARTHAS,3,0, 'Spare me, Muradin. You weren''t there to see what Mal''Ganis did to my homeland.',12,0,100,1,0,12728, 'Prince Arthas'), +(@ARTHAS,4,0, 'Behold, Muradin, our salvation, Frostmourne.',12,0,100,1,0,12729, 'Prince Arthas'), +(@ARTHAS,5,0, 'I would gladly bear any curse to save my homeland.',12,0,100,1,0,12730, 'Prince Arthas'), +(@ARTHAS,6,0, 'Damn the men! Nothing shall prevent me from having my revenge, old friend. Not even you.',12,0,100,5,0,12731, 'Prince Arthas'), +(@ARTHAS,7,0, 'Now, I call out to the spirits of this place. I will give anything or pay any price, if only you will help me save my people.',12,0,100,396,0,12732, 'Prince Arthas'), +(@MURADIN,0,0, 'Isn''t that a bit much, lad?',12,0,100,6,0,12733, 'Muradin'), +(@MURADIN,1,0, 'You lied to your men and betrayed the mercenaries who fought for you. What''s happening to you, Arthas? Is vengeance all that''s important to you?',12,0,100,1,0,12734, 'Muradin'), +(@MURADIN,2,0, 'Hold, lad. There''s an inscription on the dais. It''s a warning. It says, "Whomsoever takes up this blade shall wield power eternal. Just as the blade rends flesh, so must power scar the spirit." Oh, I should''ve known. The blade is cursed! Let''s get the hell out of here!',12,0,100,0,0,12735, 'Muradin'), +(@MURADIN,3,0, 'Leave it be, Arthas. Forget this business and lead your men home.',12,0,100,396,0,12736, 'Muradin'), +(@MURADIN,4,0, 'O'' my head... Wh... Where am I?',12,0,100,0,0,0, 'Muradin'), +(@MURADIN,5,0, 'Who... Who am I?',12,0,100,0,0,0, 'Muradin'), +(@THELZAN,0,0, 'The walls of Frostmourne Cavern shudder and shake.',41,0,100,0,0,0, 'Thel''zan Spell Dummy'); diff --git a/sql/updates/world/2013_05_26_05_world_waypoints.sql b/sql/updates/world/2013_05_26_05_world_waypoints.sql new file mode 100644 index 00000000000..6596851cd33 --- /dev/null +++ b/sql/updates/world/2013_05_26_05_world_waypoints.sql @@ -0,0 +1,55 @@ +-- remove extra Highperch Soarer spawn +DELETE FROM `creature` WHERE `guid`=21707; +DELETE FROM `creature_addon` WHERE `guid`=21707; + +-- Proper Pathing for Entry 6139 Highperch Soarer +SET @NPC := 21708; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=-5155.495,`position_y`=-1195.804,`position_z`=73.70869 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,4097,0, ''); +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,-5155.495,-1195.804,73.70869,0,0,0,100,0), +(@PATH,2,-5155.09,-1194.89,73.70869,0,0,0,100,0), +(@PATH,3,-5155.986,-1199.748,81.49023,0,0,0,100,0), +(@PATH,4,-5166.314,-1220.043,81.76808,0,0,0,100,0), +(@PATH,5,-5170.551,-1226.347,76.71234,0,0,0,100,0), +(@PATH,6,-5178.024,-1237.037,72.43468,0,0,0,100,0), +(@PATH,7,-5190.296,-1239.181,71.90687,0,0,0,100,0), +(@PATH,8,-5215.796,-1225.133,69.76797,0,0,0,100,0), +(@PATH,9,-5221.52,-1209.387,67.79574,0,0,0,100,0), +(@PATH,10,-5219.366,-1194.92,67.15694,0,0,0,100,0), +(@PATH,11,-5209.852,-1187.224,65.96239,0,0,0,100,0), +(@PATH,12,-5194.886,-1188.915,70.71236,0,0,0,100,0), +(@PATH,13,-5181.055,-1199.332,60.29574,0,0,0,100,0), +(@PATH,14,-5158.846,-1213.597,57.6291,0,0,0,100,0), +(@PATH,15,-5122.129,-1222.279,42.46242,0,0,0,100,0), +(@PATH,16,-5110.988,-1230.767,15.32349,0,0,0,100,0), +(@PATH,17,-5084.673,-1227.625,-11.81538,0,0,0,100,0), +(@PATH,18,-5065.282,-1209.691,-34.89864,0,0,0,100,0), +(@PATH,19,-5052.477,-1181.261,-39.42649,0,0,0,100,0), +(@PATH,20,-5025.058,-1165.288,-32.56528,0,0,0,100,0), +(@PATH,21,-5004.282,-1140.431,-38.3154,0,0,0,100,0), +(@PATH,22,-4984.813,-1123.683,-38.17639,0,0,0,100,0), +(@PATH,23,-4971.478,-1109.776,-38.17639,0,0,0,100,0), +(@PATH,24,-4949.74,-1096.296,-32.42633,0,0,0,100,0), +(@PATH,25,-4927.954,-1090.275,-24.84298,0,0,0,100,0), +(@PATH,26,-4909.837,-1080.728,-14.0652,0,0,0,100,0), +(@PATH,27,-4914.713,-1066.641,-7.898551,0,0,0,100,0), +(@PATH,28,-4927.922,-1056.954,-3.352009,0,0,0,100,0), +(@PATH,29,-4942.696,-1055.217,8.220422,0,0,0,100,0), +(@PATH,30,-4951.954,-1049.145,14.62554,0,0,0,100,0), +(@PATH,31,-4960.176,-1028.92,20.03323,0,0,0,100,0), +(@PATH,32,-4970.474,-1008.432,22.08879,0,0,0,100,0), +(@PATH,33,-4980.969,-992.9671,23.42848,0,0,0,100,0), +(@PATH,34,-4993.734,-980.054,23.75917,0,0,0,100,0), +(@PATH,35,-5012.753,-967.9377,24.0925,0,0,0,100,0), +(@PATH,36,-5032.862,-971.138,30.92584,0,0,0,100,0), +(@PATH,37,-5052.127,-982.1085,39.0092,0,0,0,100,0), +(@PATH,38,-5060.675,-991.1913,52.28708,0,0,0,100,0), +(@PATH,39,-5072.277,-1008.99,67.84268,0,0,0,100,0), +(@PATH,40,-5090.256,-1005.558,79.18673,0,0,0,100,0), +(@PATH,41,-5106.005,-1004.311,73.88409,0,0,0,100,0), +(@PATH,42,-5132.349,-1102.871,74.67264,0,0,0,100,0), +(@PATH,43,-5200.281,-1166.383,88.48215,0,0,0,100,0); diff --git a/sql/updates/world/2013_05_27_00_world_sai.sql b/sql/updates/world/2013_05_27_00_world_sai.sql new file mode 100644 index 00000000000..9c0002572c3 --- /dev/null +++ b/sql/updates/world/2013_05_27_00_world_sai.sql @@ -0,0 +1,2 @@ +SET @SPELL := 31696; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 13 AND `SourceEntry`=@SPELL; diff --git a/sql/updates/world/2013_05_30_00_world_misc.sql b/sql/updates/world/2013_05_30_00_world_misc.sql new file mode 100644 index 00000000000..0e81b2debaa --- /dev/null +++ b/sql/updates/world/2013_05_30_00_world_misc.sql @@ -0,0 +1,103 @@ +SET @GOSSIP             := 8301; +SET @EVENT              := 13888; +SET @BLOOD_MOUNT        := 19085; +SET @BORAK              := 21293; +SET @ICARIUS            := 21409; +SET @ZARATH             := 21410; +SET @GOBJECT            := 184798; + +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP AND `text_id`=10356; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@GOSSIP,10356); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP; +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 +(@GOSSIP,0,0,'Borak, I need another bundle of bloodthistle.',1,1,0,0,0,0,''); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES  +(15,@GOSSIP,0,0,0,9,0,10570,0,0,0,0,0,'','Show gossip menu option if player has quest To Catch a Thistlehead'), +(15,@GOSSIP,0,0,0,2,0,30616,1,0,1,0,0,'','Show gossip menu option if player doesn''t have item Bundle of Bloodthistle'); + +DELETE FROM `creature_text` WHERE entry IN (@ZARATH,@ICARIUS,@BORAK); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@BORAK,0,0,'Hide! Hide before they see you! Back up!',15,0,100,0,0,0,'Borak'), +(@BORAK,1,0,'The time to strike is at hand. Terminate Icarius.',15,0,100,0,0,0,'Borak'), +(@BORAK,2,0,'You have it. Do not lose it again!',12,0,100,5,0,0,'Borak'), +(@ZARATH,0,0,'What is it, my lord?',12,0,100,6,0,0,'Zarath'), +(@ZARATH,1,0,'My lord, surely you do not expect me to leave you unattended. Lord Illidan would have my head if anything were to happen to you.',12,0,100,1,0,0,'Zarath'), +(@ZARATH,2,0,'As you wish, my lord.',12,0,100,66,0,0,'Zarath'), +(@ICARIUS,0,0,'Halt!',12,0,100,1,0,0,'Icarius'), +(@ICARIUS,1,0,'Zarath you must return to the Black Temple at once! I... I seem to have misplaced Lord Illidan''s orders. Quickly!',12,0,100,5,0,0,'Icarius'), +(@ICARIUS,2,0,'Zarath, I am perfectly capable of making it up this road to Eclipse Point. If we do not deliver the missive, Lord Illidan will have both of our heads! You are dismissed!',12,0,100,1,0,0,'Icarius'), +(@ICARIUS,3,0,'Ah, sweet, sweet bloodthistle... Probably left behind by one of those filthy addicts at Eclipse Point.',12,0,100,1,0,0,'Icarius'), +(@ICARIUS,4,0,'Their loss is most definitely my gain...',12,0,100,275,0,0,'Icarius'), +(@ICARIUS,5,0,'Envoy Icarius puts the bundle of bloodthistle in his robe.',16,0,100,0,0,0,'Icarius'), +(@ICARIUS,6,0,'Ah, damn it all! Clever trap. Too bad you''ll never live to tell the tale...',12,0,100,1,0,0,'Icarius'); + +DELETE FROM `creature_template_addon` WHERE entry = @ZARATH; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes2`) VALUES  +(@ZARATH,@BLOOD_MOUNT,0); + +UPDATE `gameobject` SET `position_x`=-4057.190, `position_y`=1527.482, `position_z`=93.0938 WHERE `guid`=99970; + +UPDATE `creature_template` SET `gossip_menu_id`=8301 WHERE `entry`=@BORAK; +UPDATE `creature_template` SET `faction_A`=1701, `faction_H`=1701, `speed_walk`=1.14286 WHERE `entry` IN (@ZARATH,@ICARIUS); + +UPDATE `creature_template` SET AIName='SmartAI' WHERE entry IN (@ZARATH,@ICARIUS,@BORAK); +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@GOBJECT; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@ZARATH,@ICARIUS,@BORAK); +DELETE FROM `smart_scripts` WHERE `source_type`=1 AND `entryorguid`=@GOBJECT; +DELETE FROM `smart_scripts` WHERE `source_type`=9 AND `entryorguid` IN (@ICARIUS*100,@ZARATH*100); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@BORAK,0,0,0,38,0,100,0,1,1,0,0,1,0,0,0,0,0,0,17,50,100,0,0,0,0,0,'Borak - On Data Set - Say 0'), +(@BORAK,0,1,0,38,0,100,0,2,2,0,0,1,1,0,0,0,0,0,17,50,100,0,0,0,0,0,'Borak - On Data Set - Say 1'), +(@BORAK,0,2,3,62,0,100,0,@GOSSIP,0,0,0,56,30616,35,0,0,0,0,7,0,0,0,0,0,0,0,'Borak - On gossip select - Add Item to Player'), +(@BORAK,0,3,4,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Borak - On gossip select - Close Gossip'), +(@BORAK,0,4,0,61,0,100,0,0,0,0,0,1,2,0,0,0,0,0,17,50,100,0,0,0,0,0,'Borak - On gossip select - Say 2'), + +(@ZARATH,0,0,1,54,0,100,0,0,0,0,0,53,0,@ZARATH,0,10570,0,0,1,0,0,0,0,0,0,0,'Zarath - Just Summoned - Start Wp'), +(@ZARATH,0,1,2,61,0,100,1,0,0,0,0,45,1,1,0,0,0,0,11,@BORAK,500,0,0,0,0,0,'Zarath - On Link - Set Data to Borak'), +(@ZARATH,0,2,0,61,0,100,1,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zarath - On Link - Set react state aggressive'), +(@ZARATH,0,3,0,38,0,100,0,0,1,0,0,66,0,0,0,0,0,0,19,@ICARIUS,10,0,0,0,0,0,'Zarath - On Data Set - Turn to'), +(@ZARATH,0,4,5,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.716,'Zarath - On Data Set - Set Orientation'), +(@ZARATH,0,5,0,61,0,100,0,0,0,0,0,80,@ZARATH*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Zarath - On Link - Timed Script'), +(@ZARATH,0,6,0,40,0,100,0,1,@ZARATH,0,0,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zarath - WP Reached - Set Home Pos'), + +(@ICARIUS,0,0,1,54,0,100,0,0,0,0,0,53,0,@ICARIUS,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Just Summoned - Start Wp'), +(@ICARIUS,0,1,0,61,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Just Summoned - Set react state aggressive'), +(@ICARIUS,0,2,0,40,0,100,0,1,@ICARIUS,0,0,80,@ICARIUS*100,2,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - WP reached - Call Action Script'), +(@ICARIUS,0,3,0,4,1,100,1,0,0,0,0,1,6,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - On aggro (phase 1) - Say text 6'), + +(@GOBJECT,1,0,0,38,0,100,0,3,3,0,0,44,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Bundle of Bloodthistle - On data 3 3 set - Set phase 2'), + +(@ZARATH*100,9,0,0,0,0,100,0,1500,1500,0,0,46,100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zarath - Move forward'), + +(@ICARIUS*100,9,0,0,0,0,100,0,1000,1000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Say Text 0'), +(@ICARIUS*100,9,1,0,0,0,100,0,2000,2000,0,0,1,0,0,0,0,0,0,19,@ZARATH,10,0,0,0,0,0,'Zarath - Say Text 0 Zarath'), +(@ICARIUS*100,9,2,0,0,0,100,0,6500,6500,0,0,66,0,0,0,0,0,0,19,@ZARATH,10,0,0,0,0,0,'Icarius - Turn to'), +(@ICARIUS*100,9,3,0,0,0,100,0,500,500,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Say Text 1'), +(@ICARIUS*100,9,4,0,0,0,100,0,1000,1000,0,0,45,0,1,0,0,0,0,19,@ZARATH,10,0,0,0,0,0,'Zarath - Set data 0 1'), +(@ICARIUS*100,9,5,0,0,0,100,0,5000,5000,0,0,1,1,0,0,0,0,0,19,@ZARATH,10,0,0,0,0,0,'Zarath - Say Text 1 Zarath'), +(@ICARIUS*100,9,6,0,0,0,100,0,7000,7000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Say Text 2'), +(@ICARIUS*100,9,7,0,0,0,100,0,6000,6000,0,0,1,2,0,0,0,0,0,19,@ZARATH,10,0,0,0,0,0,'Zarath - Say Text 2 Zarath'), +(@ICARIUS*100,9,8,0,0,0,100,0,3000,3000,0,0,45,1,1,0,0,0,0,19,@ZARATH,10,0,0,0,0,0,'Zarath - Set Data 1 1'), +(@ICARIUS*100,9,9,0,0,0,100,0,1000,1000,0,0,66,0,0,0,0,0,0,20,@GOBJECT,50,0,0,0,0,0,'Icarius - Turn to'), +(@ICARIUS*100,9,10,0,0,0,100,0,4000,4000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Say Text 3'), +(@ICARIUS*100,9,11,0,0,0,100,0,6000,6000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Say Text 4'), +(@ICARIUS*100,9,12,0,0,0,100,0,4000,4000,0,0,69,0,0,0,0,0,0,20,@GOBJECT,50,0,0,0,0,0,'Icarius - Go to GO PoS'), +(@ICARIUS*100,9,13,0,0,0,100,0,5000,5000,0,0,5,16,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Emote Kneel'), +(@ICARIUS*100,9,14,0,0,0,100,0,3000,3000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Say Text 5'), +(@ICARIUS*100,9,15,0,0,0,100,0,0,0,0,0,45,3,3,0,0,0,0,20,@GOBJECT,5,0,0,0,0,0,'Icarius - Set Data Gameobject'), +(@ICARIUS*100,9,16,0,0,0,100,1,3000,3000,0,0,45,2,2,0,0,0,0,11,@BORAK,100,0,0,0,0,0,'Icarius - Set Data 2 2'), +(@ICARIUS*100,9,17,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Icarius - Set event phase 1'); + +DELETE FROM `event_scripts` WHERE `id`=@EVENT; +INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(@EVENT,0,10,@ZARATH,80000,0,-4055.979,1478.097,87.927,1.501698), +(@EVENT,0,10,@ICARIUS,120000,0,-4052.285,1478.886,87.8424,1.604585); + +DELETE FROM `waypoints` WHERE `entry` IN (@ZARATH,@ICARIUS); +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ZARATH,1,-4058.758,1515.231,91.292,'Zarath'), +(@ICARIUS,1,-4054.427,1515.515,91.511,'Icarius'); diff --git a/sql/updates/world/2013_05_31_00_world_misc.sql b/sql/updates/world/2013_05_31_00_world_misc.sql new file mode 100644 index 00000000000..1bc46748f96 --- /dev/null +++ b/sql/updates/world/2013_05_31_00_world_misc.sql @@ -0,0 +1,35 @@ +-- DB/Misc: Fix: Prevent chat/spell flood, Prevent summon spells from overwriting. + +-- Prevent chat/spell flood +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid`=2358 AND `source_type`=0 AND `id`=9 AND `link`=10; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid`=2358 AND `source_type`=0 AND `id`=10 AND `link`=0; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid`=2358 AND `source_type`=0 AND `id`=11 AND `link`=12; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid`=2358 AND `source_type`=0 AND `id`=12 AND `link`=0; + +-- Prevent chat flood / ..run away in fear! / Manually checked one by one! (64 NPC's) +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (429,453,548,1166,1867,1920,2369,4063,5839,7075,11319,11324,15281,15401,15417,15938,15945,15970,15971,16204) AND `source_type` = 0 AND `id` = 12 AND `link` = 13; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (429,453,548,1166,1867,1920,2369,4063,5839,7075,11319,11324,15281,15401,15417,15938,15945,15970,15971,16204) AND `source_type` = 0 AND `id` = 13 AND `link` = 0; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1065,1173,1397,1914,1915,2120,2371,2376,6008,8550,9449,16249,16318,16337) AND `source_type` = 0 AND `id` = 13 AND `link` = 14; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1065,1124,1173,1397,1914,1915,2120,2245,2371,2376,6008,8550,9449,16249,16318,16337) AND `source_type` = 0 AND `id` = 14 AND `link` = 0; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1889,2375,2387,8566,9450,16317,16344,25073) AND `source_type` = 0 AND `id` = 14 AND `link` = 15; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1124,1889,2375,2387,8566,9450,16317,16344,25073) AND `source_type` = 0 AND `id` = 15 AND `link` = 0; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1123,1162,2245,2554,9451,16403) AND `source_type` = 0 AND `id` = 15 AND `link` = 16; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (1009,1013,1123,1162,2554,7246,9451,16403) AND `source_type` = 0 AND `id` = 16 AND `link` = 0; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (2276,2428,4064,4463,10824,12322) AND `source_type` = 0 AND `id` = 16 AND `link` = 17; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (2276,2428,4064,4463,10824,12322) AND `source_type` = 0 AND `id` = 17 AND `link` = 0; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (436,4462,17694) AND `source_type` = 0 AND `id` = 17 AND `link` = 18; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` IN (436,4462,17694) AND `source_type` = 0 AND `id` = 18 AND `link` = 0; +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 8564 AND `source_type` = 0 AND `id` = 18 AND `link` = 19; -- Ranger - Allow Combat Movement +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 8564 AND `source_type` = 0 AND `id` = 19 AND `link` = 0; -- Ranger - Flee For Assist +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 24683 AND `source_type` = 0 AND `id` = 19 AND `link` = 20; -- Sunblade Mage Guard - Allow Combat Movement +UPDATE `smart_scripts` SET `event_flags` = 1 WHERE `entryorguid` = 24683 AND `source_type` = 0 AND `id` = 20 AND `link` = 0; -- Sunblade Mage Guard - Flee For Assist + +-- Prevent summon spells from overwriting each other's cast time, earlier script had wrong timers.. +UPDATE `smart_scripts` SET `link`=15 WHERE  `entryorguid`=1124 AND `source_type`=0 AND `id`=14 AND `link`=01; +UPDATE `smart_scripts` SET `event_type`=61, `event_flags`=1 WHERE  `entryorguid`=1124 AND `source_type`=0 AND `id`=15 AND `link`=0; +UPDATE `smart_scripts` SET `event_param1`=9100, `event_param2`=14900 WHERE  `entryorguid`=2358 AND `source_type`=0 AND `id`=9 AND `link`=10; +UPDATE `smart_scripts` SET `event_param1`=4700, `event_param2`=11100 WHERE  `entryorguid`=2358 AND `source_type`=0 AND `id`=11 AND `link`=12; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid` IN (429,453) AND `source_type`=0 AND `id`=12 AND `link`=13; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid` IN (1009,1065,1397) AND `source_type`=0 AND `id`=13 AND `link`=14; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid` IN (1009,1013,1123,2245,2554) AND `source_type`=0 AND `id`=15 AND `link`=16; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE  `entryorguid` = 1009 AND `source_type`=0 AND `id`=14 AND `link`=15; diff --git a/sql/updates/world/2013_06_01_00_world_creature_template.sql b/sql/updates/world/2013_06_01_00_world_creature_template.sql new file mode 100644 index 00000000000..1c56f1979f8 --- /dev/null +++ b/sql/updates/world/2013_06_01_00_world_creature_template.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (24021,3094,23905,27376,27378,27379,27381); +DELETE FROM `smart_scripts` WHERE `entryorguid`=26917; diff --git a/sql/updates/world/2013_06_01_01_world_fishing_loot_template.sql b/sql/updates/world/2013_06_01_01_world_fishing_loot_template.sql new file mode 100644 index 00000000000..0a0d8f842fa --- /dev/null +++ b/sql/updates/world/2013_06_01_01_world_fishing_loot_template.sql @@ -0,0 +1,14 @@ +DELETE FROM `skill_fishing_base_level` WHERE `entry`=4813; +INSERT INTO `skill_fishing_base_level`(`entry`,`skill`) VALUE +(4813,450); + +DELETE FROM `fishing_loot_template` WHERE `entry`=4813; +INSERT INTO `fishing_loot_template`(`entry`,`item`,`ChanceOrQuestChance`,`groupid`) VALUES +(4813,41808,58,1), +(4813,43572,20.5,1), +(4813,36794,5.4,1), +(4813,4875,5,1), +(4813,3671,4.5,1), +(4813,25447,4.5,1), +(4813,44475,1.1,1), +(4813,37705,1,1); diff --git a/sql/updates/world/2013_06_02_00_world_achievement_criteria_data.sql b/sql/updates/world/2013_06_02_00_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..053ade0486d --- /dev/null +++ b/sql/updates/world/2013_06_02_00_world_achievement_criteria_data.sql @@ -0,0 +1,16 @@ +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry` IN (10082,10083,10084,10085,10086,10087); + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10082,10083,10084,10085,10086,10087); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(10082, 11, 0, 0, 'achievement_assembly_i_choose_you'), +(10082, 12, 0, 0, ''), +(10083, 11, 0, 0, 'achievement_assembly_i_choose_you'), +(10083, 12, 0, 0, ''), +(10084, 11, 0, 0, 'achievement_assembly_i_choose_you'), +(10084, 12, 0, 0, ''), +(10085, 11, 0, 0, 'achievement_assembly_i_choose_you'), +(10085, 12, 1, 0, ''), +(10086, 11, 0, 0, 'achievement_assembly_i_choose_you'), +(10086, 12, 1, 0, ''), +(10087, 11, 0, 0, 'achievement_assembly_i_choose_you'), +(10087, 12, 1, 0, ''); diff --git a/sql/updates/world/2013_06_02_01_world_conditions.sql b/sql/updates/world/2013_06_02_01_world_conditions.sql new file mode 100644 index 00000000000..4f3993bd1e0 --- /dev/null +++ b/sql/updates/world/2013_06_02_01_world_conditions.sql @@ -0,0 +1,78 @@ +-- Add option conditions for mage trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (63,64,4484,4485,4486,4517,4518,4519,4520,4537,4538,4539,4552,4651,4654,4660,4661,4685,4686,6648,7264,9990,9580,7366,4535); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,63,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,63,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,63,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,64,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,64,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,64,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4484,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4484,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4484,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4485,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4485,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4485,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4486,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4486,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4486,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4517,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4517,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4517,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4518,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4518,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4518,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4519,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4519,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4519,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4520,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4520,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4520,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4537,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4537,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4537,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4538,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4538,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4538,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4539,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4539,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4539,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4552,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4552,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4552,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4651,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4651,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4651,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4654,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4654,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4654,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4660,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4660,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4660,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4661,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4661,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4661,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4685,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4685,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4685,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4686,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4686,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4686,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,6648,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,6648,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,6648,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,7264,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,7264,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,7264,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,9990,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,9990,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,9990,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,9580,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,9580,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,9580,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,7366,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,7366,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,7366,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4535,0,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4535,1,0,15,128,0,0,0,'','Show gossip option if player is a mage'), +(15,4535,2,0,15,128,0,0,0,'','Show gossip option if player is a mage'); diff --git a/sql/updates/world/2013_06_02_02_world_conditions.sql b/sql/updates/world/2013_06_02_02_world_conditions.sql new file mode 100644 index 00000000000..9d1b80e7a3f --- /dev/null +++ b/sql/updates/world/2013_06_02_02_world_conditions.sql @@ -0,0 +1,78 @@ +-- Add option conditions for Warlock trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (1503,1522,2381,2383,2384,4503,4504,4505,4566,4567,4603,4604,4609,4610,4641,4643,4655,4656,4667,4681,4682,6628,7437,7566,4642); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1503,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,1503,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,1503,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,1522,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,1522,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,1522,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2381,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2381,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2381,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2383,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2383,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2383,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2384,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2384,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,2384,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4503,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4503,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4503,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4504,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4504,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4504,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4505,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4505,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4505,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4566,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4566,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4566,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4567,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4567,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4567,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4603,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4603,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4603,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4604,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4604,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4604,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4609,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4609,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4609,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4610,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4610,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4610,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4641,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4641,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4641,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4643,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4643,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4643,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4655,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4655,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4655,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4656,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4656,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4656,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4667,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4667,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4667,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4681,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4681,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4681,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4682,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4682,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4682,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,6628,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,6628,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,6628,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,7437,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,7437,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,7437,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,7566,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,7566,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,7566,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4642,0,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4642,1,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'), +(15,4642,2,0,15,256,0,0,0,'','Show gossip option if player is a Warlock'); diff --git a/sql/updates/world/2013_06_02_03_world_conditions.sql b/sql/updates/world/2013_06_02_03_world_conditions.sql new file mode 100644 index 00000000000..c2d730ffc6d --- /dev/null +++ b/sql/updates/world/2013_06_02_03_world_conditions.sql @@ -0,0 +1,42 @@ +-- Add option conditions for Paladin trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (2304,4556,4557,4469,4470,4471,4662,4663,4664,4677,4678,7260,8111); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,2304,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,2304,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,2304,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4556,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4556,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4556,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4557,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4557,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4557,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4469,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4469,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4469,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4470,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4470,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4470,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4471,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4471,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4471,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4662,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4662,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4662,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4663,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4663,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4663,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4664,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4664,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4664,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4677,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4677,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4677,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4678,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4678,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,4678,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,7260,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,7260,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,7260,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,8111,0,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,8111,1,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'), +(15,8111,2,0,15,2,0,0,0,'','Show gossip option if player is a Paladin'); diff --git a/sql/updates/world/2013_06_02_04_world_conditions.sql b/sql/updates/world/2013_06_02_04_world_conditions.sql new file mode 100644 index 00000000000..82ee44df19d --- /dev/null +++ b/sql/updates/world/2013_06_02_04_world_conditions.sql @@ -0,0 +1,93 @@ +-- Add option conditions for Warrior trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (523,655,656,4091,4475,4481,4482,4509,4511,4525,4526,4527,4546,4547,4548,4568,4569,4570,4578,4579,4581,4645,4649,4650,4653,4683,4684,4696,4697,7263); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,523,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,523,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,523,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,655,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,655,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,655,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,656,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,656,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,656,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4091,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4091,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4091,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4475,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4475,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4475,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4481,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4481,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4481,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4482,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4482,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4482,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4509,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4509,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4509,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4511,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4511,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4511,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4525,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4525,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4525,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4526,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4526,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4526,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4527,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4527,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4527,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4546,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4546,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4546,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4547,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4547,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4547,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4548,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4548,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4548,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4568,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4568,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4568,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4569,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4569,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4569,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4570,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4570,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4570,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4578,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4578,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4578,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4579,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4579,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4579,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4581,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4581,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4581,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4645,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4645,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4645,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4649,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4649,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4649,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4650,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4650,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4650,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4653,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4653,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4653,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4683,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4683,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4683,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4684,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4684,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4684,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4696,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4696,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4696,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4697,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4697,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,4697,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,7263,0,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,7263,1,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'), +(15,7263,2,0,15,1,0,0,0,'','Show gossip option if player is a Warrior'); diff --git a/sql/updates/world/2013_06_02_05_world_conditions.sql b/sql/updates/world/2013_06_02_05_world_conditions.sql new file mode 100644 index 00000000000..fdee846a275 --- /dev/null +++ b/sql/updates/world/2013_06_02_05_world_conditions.sql @@ -0,0 +1,49 @@ +-- Add option conditions for Druid trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (1403,3921,3924,3925,3926,4507,4508,4571,4605,4606,4607,4687,4688,7567,4646); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1403,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,1403,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,1403,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,1403,3,0,8,0,3781,0,0,'','Mathrengyl Bearwalker - Show gossip option if player has rewarded quest 3781'), +(15,3921,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3921,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3921,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3924,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3924,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3924,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3925,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3925,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3925,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3926,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3926,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,3926,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4507,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4507,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4507,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4508,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4508,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4508,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4571,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4571,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4571,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4605,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4605,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4605,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4606,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4606,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4606,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4607,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4607,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4607,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4687,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4687,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4687,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4688,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4688,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4688,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,7567,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,7567,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,7567,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4646,0,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4646,1,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'), +(15,4646,2,0,15,1024,0,0,0,'','Show gossip option if player is a Druid'); diff --git a/sql/updates/world/2013_06_02_06_world_conditions.sql b/sql/updates/world/2013_06_02_06_world_conditions.sql new file mode 100644 index 00000000000..b2605b97d26 --- /dev/null +++ b/sql/updates/world/2013_06_02_06_world_conditions.sql @@ -0,0 +1,4 @@ +-- Add option conditions for Druid trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (1403) AND `SourceEntry` IN (3); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,1403,3,0,8,0,3781,0,0,'','Mathrengyl Bearwalker - Show gossip option if player has rewarded quest 3781'); diff --git a/sql/updates/world/2013_06_02_07_world_conditions.sql b/sql/updates/world/2013_06_02_07_world_conditions.sql new file mode 100644 index 00000000000..696c69ca62e --- /dev/null +++ b/sql/updates/world/2013_06_02_07_world_conditions.sql @@ -0,0 +1,80 @@ +-- Add option conditions for Hunter trainers +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (4008,4009,4010,4011,4012,4017,4023,4101,4472,4473,4474,4506,4524,4549,4550,4551,4647,4648,4657,4675,4693,4695,6652,7262,7368); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,4008,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4008,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4008,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4009,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4009,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4009,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4010,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4010,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4010,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4011,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4011,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4011,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4012,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4012,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4012,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4017,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4017,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4017,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4023,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4023,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4023,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4101,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4101,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4101,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4472,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4472,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4472,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4473,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4473,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4473,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4474,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4474,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4474,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4506,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4506,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4506,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4524,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4524,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4524,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4549,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4549,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4549,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4550,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4550,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4550,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4551,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4551,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4551,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4647,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4647,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4647,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4648,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4648,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4648,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4657,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4657,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4657,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4675,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4675,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4675,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4693,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4693,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4693,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4695,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4695,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,4695,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,6652,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,6652,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,6652,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7262,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7262,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7262,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7368,0,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7368,1,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7368,2,0,15,4,0,0,0,'','Show gossip option if player is a Hunter'), +(15,7368,3,0,9,0,9454,0,0,'','Acteon - Show gossip option if player has quest 9454'), +(15,7368,4,0,9,0,10324,0,0,'','Acteon - Show gossip option if player has quest 10324'); diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 2e73498eb52..792e1bf2a86 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -196,12 +196,12 @@ const AuthHandler table[] =  Patcher PatchesCache;  // Constructor - set the N and g values for SRP6 -AuthSocket::AuthSocket(RealmSocket& socket) : pPatch(NULL), socket_(socket) +AuthSocket::AuthSocket(RealmSocket& socket) : +    pPatch(NULL), socket_(socket), _authed(false), _build(0), +    _expversion(0), _accountSecurityLevel(SEC_PLAYER)  {      N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");      g.SetDword(7); -    _authed = false; -    _accountSecurityLevel = SEC_PLAYER;  }  // Close patch file descriptor before leaving diff --git a/src/server/authserver/Server/RealmSocket.cpp b/src/server/authserver/Server/RealmSocket.cpp index e249894a4d3..6710a6a88ae 100644 --- a/src/server/authserver/Server/RealmSocket.cpp +++ b/src/server/authserver/Server/RealmSocket.cpp @@ -27,7 +27,9 @@ RealmSocket::Session::Session(void) {}  RealmSocket::Session::~Session(void) { } -RealmSocket::RealmSocket(void) : input_buffer_(4096), session_(NULL), _remoteAddress() +RealmSocket::RealmSocket(void) : +    input_buffer_(4096), session_(NULL), +    _remoteAddress(), _remotePort(0)  {      reference_counting_policy().value(ACE_Event_Handler::Reference_Counting_Policy::ENABLED); diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 8a1bd346957..6355dbcf4ce 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -96,7 +96,10 @@ namespace VMAP              std::string mapFileName = getMapFileName(mapId);              StaticMapTree* newTree = new StaticMapTree(mapId, basePath);              if (!newTree->InitMap(mapFileName, this)) +            { +                delete newTree;                  return false; +            }              instanceTree = iInstanceMapTrees.insert(InstanceTreeMap::value_type(mapId, newTree)).first;          } diff --git a/src/server/collision/Maps/MapTree.cpp b/src/server/collision/Maps/MapTree.cpp index 7dbfcd78bc9..dc12bb68e0d 100644 --- a/src/server/collision/Maps/MapTree.cpp +++ b/src/server/collision/Maps/MapTree.cpp @@ -119,8 +119,9 @@ namespace VMAP          return intersectionCallBack.result;      } -    StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath) -        : iMapID(mapID), iIsTiled(false), iTreeValues(0), iBasePath(basePath) +    StaticMapTree::StaticMapTree(uint32 mapID, const std::string &basePath) : +        iMapID(mapID), iIsTiled(false), iTreeValues(NULL), +        iNTreeValues(0), iBasePath(basePath)      {          if (iBasePath.length() > 0 && iBasePath[iBasePath.length()-1] != '/' && iBasePath[iBasePath.length()-1] != '\\')          { @@ -273,54 +274,49 @@ namespace VMAP      bool StaticMapTree::InitMap(const std::string &fname, VMapManager2* vm)      {          VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : initializing StaticMapTree '%s'", fname.c_str()); -        bool success = true; +        bool success = false;          std::string fullname = iBasePath + fname;          FILE* rf = fopen(fullname.c_str(), "rb");          if (!rf)              return false; -        else + +        char chunk[8]; +        char tiled = '\0'; + +        if (readChunk(rf, chunk, VMAP_MAGIC, 8) && fread(&tiled, sizeof(char), 1, rf) == 1 && +            readChunk(rf, chunk, "NODE", 4) && iTree.readFromFile(rf))          { -            char chunk[8]; -            //general info -            if (!readChunk(rf, chunk, VMAP_MAGIC, 8)) success = false; -            char tiled = '\0'; -            if (success && fread(&tiled, sizeof(char), 1, rf) != 1) success = false; -            iIsTiled = bool(tiled); -            // Nodes -            if (success && !readChunk(rf, chunk, "NODE", 4)) success = false; -            if (success) success = iTree.readFromFile(rf); -            if (success) -            { -                iNTreeValues = iTree.primCount(); -                iTreeValues = new ModelInstance[iNTreeValues]; -            } +            iNTreeValues = iTree.primCount(); +            iTreeValues = new ModelInstance[iNTreeValues]; +            success = readChunk(rf, chunk, "GOBJ", 4); +        } + +        iIsTiled = bool(tiled); -            if (success && !readChunk(rf, chunk, "GOBJ", 4)) success = false; -            // global model spawns -            // only non-tiled maps have them, and if so exactly one (so far at least...) -            ModelSpawn spawn; +        // global model spawns +        // only non-tiled maps have them, and if so exactly one (so far at least...) +        ModelSpawn spawn;  #ifdef VMAP_DEBUG -            TC_LOG_DEBUG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : map isTiled: %u", static_cast<uint32>(iIsTiled)); +        TC_LOG_DEBUG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : map isTiled: %u", static_cast<uint32>(iIsTiled));  #endif -            if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) +        if (!iIsTiled && ModelSpawn::readFromFile(rf, spawn)) +        { +            WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); +            VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); +            if (model)              { -                WorldModel* model = vm->acquireModelInstance(iBasePath, spawn.name); -                VMAP_DEBUG_LOG(LOG_FILTER_MAPS, "StaticMapTree::InitMap() : loading %s", spawn.name.c_str()); -                if (model) -                { -                    // assume that global model always is the first and only tree value (could be improved...) -                    iTreeValues[0] = ModelInstance(spawn, model); -                    iLoadedSpawns[0] = 1; -                } -                else -                { -                    success = false; -                    VMAP_ERROR_LOG(LOG_FILTER_GENERAL, "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str()); -                } +                // assume that global model always is the first and only tree value (could be improved...) +                iTreeValues[0] = ModelInstance(spawn, model); +                iLoadedSpawns[0] = 1; +            } +            else +            { +                success = false; +                VMAP_ERROR_LOG(LOG_FILTER_GENERAL, "StaticMapTree::InitMap() : could not acquire WorldModel pointer for '%s'", spawn.name.c_str());              } - -            fclose(rf);          } + +        fclose(rf);          return success;      } diff --git a/src/server/collision/Maps/MapTree.h b/src/server/collision/Maps/MapTree.h index e97c44d089e..c66893da82f 100644 --- a/src/server/collision/Maps/MapTree.h +++ b/src/server/collision/Maps/MapTree.h @@ -85,7 +85,8 @@ namespace VMAP      struct AreaInfo      { -        AreaInfo(): result(false), ground_Z(-G3D::inf()) {} +        AreaInfo(): result(false), ground_Z(-G3D::inf()), flags(0), adtId(0), +            rootId(0), groupId(0) {}          bool result;          float ground_Z;          uint32 flags; diff --git a/src/server/collision/Maps/TileAssembler.cpp b/src/server/collision/Maps/TileAssembler.cpp index aca7c02e79f..4b61e5da40b 100644 --- a/src/server/collision/Maps/TileAssembler.cpp +++ b/src/server/collision/Maps/TileAssembler.cpp @@ -152,23 +152,25 @@ namespace VMAP                  uint32 x, y;                  StaticMapTree::unpackTileID(tile->first, x, y);                  tilefilename << std::setw(2) << x << '_' << std::setw(2) << y << ".vmtile"; -                FILE* tilefile = fopen(tilefilename.str().c_str(), "wb"); -                // file header -                if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false; -                // write number of tile spawns -                if (success && fwrite(&nSpawns, sizeof(uint32), 1, tilefile) != 1) success = false; -                // write tile spawns -                for (uint32 s=0; s<nSpawns; ++s) +                if (FILE* tilefile = fopen(tilefilename.str().c_str(), "wb"))                  { -                    if (s) -                        ++tile; -                    const ModelSpawn &spawn2 = map_iter->second->UniqueEntries[tile->second]; -                    success = success && ModelSpawn::writeToFile(tilefile, spawn2); -                    // MapTree nodes to update when loading tile: -                    std::map<uint32, uint32>::iterator nIdx = modelNodeIdx.find(spawn2.ID); -                    if (success && fwrite(&nIdx->second, sizeof(uint32), 1, tilefile) != 1) success = false; +                    // file header +                    if (success && fwrite(VMAP_MAGIC, 1, 8, tilefile) != 8) success = false; +                    // write number of tile spawns +                    if (success && fwrite(&nSpawns, sizeof(uint32), 1, tilefile) != 1) success = false; +                    // write tile spawns +                    for (uint32 s=0; s<nSpawns; ++s) +                    { +                        if (s) +                            ++tile; +                        const ModelSpawn &spawn2 = map_iter->second->UniqueEntries[tile->second]; +                        success = success && ModelSpawn::writeToFile(tilefile, spawn2); +                        // MapTree nodes to update when loading tile: +                        std::map<uint32, uint32>::iterator nIdx = modelNodeIdx.find(spawn2.ID); +                        if (success && fwrite(&nIdx->second, sizeof(uint32), 1, tilefile) != 1) success = false; +                    } +                    fclose(tilefile);                  } -                fclose(tilefile);              }              // break; //test, extract only first map; TODO: remvoe this line          } diff --git a/src/server/collision/Maps/TileAssembler.h b/src/server/collision/Maps/TileAssembler.h index a11ce272d62..56cb7600e4f 100644 --- a/src/server/collision/Maps/TileAssembler.h +++ b/src/server/collision/Maps/TileAssembler.h @@ -40,6 +40,7 @@ namespace VMAP          private:              G3D::Matrix3 iRotation;          public: +            ModelPosition(): iScale(0.0f) { }              G3D::Vector3 iPos;              G3D::Vector3 iDir;              float iScale; @@ -74,7 +75,8 @@ namespace VMAP          std::vector<G3D::Vector3> vertexArray;          class WmoLiquid* liquid; -        GroupModel_Raw() : liquid(0) {} +        GroupModel_Raw() : mogpflags(0), GroupWMOID(0), liquidflags(0), +            liquid(NULL) {}          ~GroupModel_Raw();          bool Read(FILE* f); diff --git a/src/server/collision/Models/WorldModel.cpp b/src/server/collision/Models/WorldModel.cpp index ca0f95c74e3..3c72cb80308 100644 --- a/src/server/collision/Models/WorldModel.cpp +++ b/src/server/collision/Models/WorldModel.cpp @@ -205,35 +205,48 @@ namespace VMAP      bool WmoLiquid::writeToFile(FILE* wf)      { -        bool result = true; -        if (result && fwrite(&iTilesX, sizeof(uint32), 1, wf) != 1) result = false; -        if (result && fwrite(&iTilesY, sizeof(uint32), 1, wf) != 1) result = false; -        if (result && fwrite(&iCorner, sizeof(Vector3), 1, wf) != 1) result = false; -        if (result && fwrite(&iType, sizeof(uint32), 1, wf) != 1) result = false; -        uint32 size = (iTilesX + 1)*(iTilesY + 1); -        if (result && fwrite(iHeight, sizeof(float), size, wf) != size) result = false; -        size = iTilesX*iTilesY; -        if (result && fwrite(iFlags, sizeof(uint8), size, wf) != size) result = false; +        bool result = false; +        if (fwrite(&iTilesX, sizeof(uint32), 1, wf) == 1 && +            fwrite(&iTilesY, sizeof(uint32), 1, wf) == 1 && +            fwrite(&iCorner, sizeof(Vector3), 1, wf) == 1 && +            fwrite(&iType, sizeof(uint32), 1, wf) == 1) +        { +            uint32 size = (iTilesX + 1) * (iTilesY + 1); +            if (fwrite(iHeight, sizeof(float), size, wf) == size) +            { +                size = iTilesX*iTilesY; +                result = fwrite(iFlags, sizeof(uint8), size, wf) == size; +            } +        } +          return result;      }      bool WmoLiquid::readFromFile(FILE* rf, WmoLiquid* &out)      { -        bool result = true; +        bool result = false;          WmoLiquid* liquid = new WmoLiquid(); -        if (result && fread(&liquid->iTilesX, sizeof(uint32), 1, rf) != 1) result = false; -        if (result && fread(&liquid->iTilesY, sizeof(uint32), 1, rf) != 1) result = false; -        if (result && fread(&liquid->iCorner, sizeof(Vector3), 1, rf) != 1) result = false; -        if (result && fread(&liquid->iType, sizeof(uint32), 1, rf) != 1) result = false; -        uint32 size = (liquid->iTilesX + 1)*(liquid->iTilesY + 1); -        liquid->iHeight = new float[size]; -        if (result && fread(liquid->iHeight, sizeof(float), size, rf) != size) result = false; -        size = liquid->iTilesX * liquid->iTilesY; -        liquid->iFlags = new uint8[size]; -        if (result && fread(liquid->iFlags, sizeof(uint8), size, rf) != size) result = false; + +        if (fread(&liquid->iTilesX, sizeof(uint32), 1, rf) == 1 && +            fread(&liquid->iTilesY, sizeof(uint32), 1, rf) == 1 && +            fread(&liquid->iCorner, sizeof(Vector3), 1, rf) == 1 && +            fread(&liquid->iType, sizeof(uint32), 1, rf) == 1) +        { +            uint32 size = (liquid->iTilesX + 1) * (liquid->iTilesY + 1); +            liquid->iHeight = new float[size]; +            if (fread(liquid->iHeight, sizeof(float), size, rf) == size) +            { +                size = liquid->iTilesX * liquid->iTilesY; +                liquid->iFlags = new uint8[size]; +                result = fread(liquid->iFlags, sizeof(uint8), size, rf) == size; +            } +        } +          if (!result)              delete liquid; -        out = liquid; +        else +            out = liquid; +          return result;      } diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 0ab807466d5..70c4761e025 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -123,34 +123,45 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered)  void UnitAI::DoCast(uint32 spellId)  {      Unit* target = NULL; -    //TC_LOG_ERROR(LOG_FILTER_GENERAL, "aggre %u %u", spellId, (uint32)AISpellInfo[spellId].target); +      switch (AISpellInfo[spellId].target)      {          default: -        case AITARGET_SELF:     target = me; break; -        case AITARGET_VICTIM:   target = me->getVictim(); break; +        case AITARGET_SELF: +            target = me; +            break; +        case AITARGET_VICTIM: +            target = me->getVictim(); +            break;          case AITARGET_ENEMY:          { -            const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId); -            bool playerOnly = spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS; -            //float range = GetSpellMaxRange(spellInfo, false); -            target = SelectTarget(SELECT_TARGET_RANDOM, 0, spellInfo->GetMaxRange(false), playerOnly); +            if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) +            { +                bool playerOnly = spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS; +                target = SelectTarget(SELECT_TARGET_RANDOM, 0, spellInfo->GetMaxRange(false), playerOnly); +            }              break;          } -        case AITARGET_ALLY:     target = me; break; -        case AITARGET_BUFF:     target = me; break; +        case AITARGET_ALLY: +            target = me; +            break; +        case AITARGET_BUFF: +            target = me; +            break;          case AITARGET_DEBUFF:          { -            const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId); -            bool playerOnly = spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS; -            float range = spellInfo->GetMaxRange(false); - -            DefaultTargetSelector targetSelector(me, range, playerOnly, -(int32)spellId); -            if (!(spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_VICTIM) -                && targetSelector(me->getVictim())) -                target = me->getVictim(); -            else -                target = SelectTarget(SELECT_TARGET_RANDOM, 0, targetSelector); +            if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId)) +            { +                bool playerOnly = spellInfo->AttributesEx3 & SPELL_ATTR3_ONLY_TARGET_PLAYERS; +                float range = spellInfo->GetMaxRange(false); + +                DefaultTargetSelector targetSelector(me, range, playerOnly, -(int32)spellId); +                if (!(spellInfo->AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_VICTIM) +                    && targetSelector(me->getVictim())) +                    target = me->getVictim(); +                else +                    target = SelectTarget(SELECT_TARGET_RANDOM, 0, targetSelector); +            }              break;          }      } diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index 9d61ec0a214..3d71abb47a9 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -169,7 +169,7 @@ class CreatureAI : public UnitAI          virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) {} -        virtual void OnSpellClick(Unit* /*clicker*/) { } +        virtual void OnSpellClick(Unit* /*clicker*/, bool& /*result*/) { }          virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; }      protected: diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index 96979cf2c49..a2612df2f89 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -828,8 +828,11 @@ void SmartAI::sOnGameEvent(bool start, uint16 eventId)      GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId);  } -void SmartAI::OnSpellClick(Unit* clicker) +void SmartAI::OnSpellClick(Unit* clicker, bool& result)  { +    if (!result) +        return; +      GetScript()->ProcessEventsFor(SMART_EVENT_ON_SPELLCLICK, clicker);  } diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index dee6bec905c..4b4909e9c6c 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -197,7 +197,7 @@ class SmartAI : public CreatureAI          void RemoveAuras(); -        void OnSpellClick(Unit* clicker); +        void OnSpellClick(Unit* clicker, bool& result);      private:          uint32 mFollowCreditType; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 576d77a2e24..9d182ee6885 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -657,9 +657,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u              {                  if (IsUnit(*itr))                  { -                    (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); -                    TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS", +                    if (!e.action.unitFlag.type) +                    { +                        (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); +                        TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS", +                        (*itr)->GetGUIDLow(), e.action.unitFlag.flag); +                    } +                    else +                    { +                        (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag); +                        TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS_2",                          (*itr)->GetGUIDLow(), e.action.unitFlag.flag); +                    }                  }              } @@ -676,9 +685,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u              {                  if (IsUnit(*itr))                  { -                    (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); -                    TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS", +                    if (!e.action.unitFlag.type) +                    { +                        (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); +                        TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS", +                        (*itr)->GetGUIDLow(), e.action.unitFlag.flag); +                    } +                    else +                    { +                        (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag); +                        TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS_2",                          (*itr)->GetGUIDLow(), e.action.unitFlag.flag); +                    }                  }              } diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 409d0e7d324..6801c132331 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -117,7 +117,7 @@ class SmartScript                  smart = false;              if (!smart) -                TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target Creature(entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetEntry() : (me ? me->GetEntry() : 0)); +                TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target Creature (GUID: %u Entry: %u) is not using SmartAI, action skipped to prevent crash.", c ? c->GetDBTableGUIDLow() : (me ? me->GetDBTableGUIDLow() : 0), c ? c->GetEntry() : (me ? me->GetEntry() : 0));              return smart;          } @@ -131,7 +131,7 @@ class SmartScript              if (!go || go->GetAIName() != "SmartGameObjectAI")                  smart = false;              if (!smart) -                TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target GameObject(entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetEntry() : (go ? go->GetEntry() : 0)); +                TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target GameObject (GUID: %u Entry: %u) is not using SmartGameObjectAI, action skipped to prevent crash.", g ? g->GetDBTableGUIDLow() : (go ? go->GetDBTableGUIDLow() : 0), g ? g->GetEntry() : (go ? go->GetEntry() : 0));              return smart;          } diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 33e458976f1..2fcee55ed14 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -827,6 +827,7 @@ struct SmartAction          struct          {              uint32 flag; +            uint32 type;          } unitFlag;          struct diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index b7b065a8b31..00bffb8f21c 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1639,6 +1639,9 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui  bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achievementCriteria, AchievementEntry const* achievement)  { +    if (!achievement) +        return false; +      // counter can never complete      if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER)          return false; @@ -1951,8 +1954,11 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry,      SendCriteriaUpdate(entry, progress, timeElapsed, timedCompleted);  } -void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry* entry) +void AchievementMgr::RemoveCriteriaProgress(AchievementCriteriaEntry const* entry)  { +    if (!entry) +        return; +      CriteriaProgressMap::iterator criteriaProgress = m_criteriaProgress.find(entry->ID);      if (criteriaProgress == m_criteriaProgress.end())          return; @@ -2127,12 +2133,11 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player) const   */  void AchievementMgr::BuildAllDataPacket(WorldPacket* data) const  { -    AchievementEntry const* achievement = NULL;      for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter)      {          // Skip hidden achievements -        achievement = sAchievementMgr->GetAchievement(iter->first); -        if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) +        AchievementEntry const* achievement = sAchievementMgr->GetAchievement(iter->first); +        if (!achievement || achievement->flags & ACHIEVEMENT_FLAG_HIDDEN)              continue;          *data << uint32(iter->first); diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index d7f9aa66582..0b7999fcf57 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -1481,6 +1481,7 @@ struct WGWorkshop          bf = _bf;          workshopId = _workshopId; +        teamControl = BATTLEFIELD_WG_TEAM_NEUTRAL;      }      void GiveControlTo(uint8 team, bool init /* for first call in setup*/) diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 3f2908cbdad..5218c9c9e55 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -205,7 +205,7 @@ bool ChatHandler::hasStringAbbr(const char* name, const char* part)          if (!*part)              return false; -        for (;;) +        while (true)          {              if (!*part)                  return true; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 50f745669a7..f274f201e04 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -2456,19 +2456,18 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)      time_t ptime = time(NULL);      if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime) -    { -        ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(vItem->item); - -        uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime); -        if ((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount) +        if (ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(vItem->item))          { -            m_vendorItemCounts.erase(itr); -            return vItem->maxcount; -        } +            uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime); +            if ((vCount->count + diff * pProto->BuyCount) >= vItem->maxcount) +            { +                m_vendorItemCounts.erase(itr); +                return vItem->maxcount; +            } -        vCount->count += diff * pProto->BuyCount; -        vCount->lastIncrementTime = ptime; -    } +            vCount->count += diff * pProto->BuyCount; +            vCount->lastIncrementTime = ptime; +        }      return vCount->count;  } @@ -2495,15 +2494,14 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us      time_t ptime = time(NULL);      if (time_t(vCount->lastIncrementTime + vItem->incrtime) <= ptime) -    { -        ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(vItem->item); - -        uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime); -        if ((vCount->count + diff * pProto->BuyCount) < vItem->maxcount) -            vCount->count += diff * pProto->BuyCount; -        else -            vCount->count = vItem->maxcount; -    } +        if (ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(vItem->item)) +        { +            uint32 diff = uint32((ptime - vCount->lastIncrementTime)/vItem->incrtime); +            if ((vCount->count + diff * pProto->BuyCount) < vItem->maxcount) +                vCount->count += diff * pProto->BuyCount; +            else +                vCount->count = vItem->maxcount; +        }      vCount->count = vCount->count > used_count ? vCount->count-used_count : 0;      vCount->lastIncrementTime = ptime; diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index 8a8c9ad895f..d59015fd359 100644 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -184,7 +184,9 @@ void PlayerMenu::SendGossipMenu(uint32 titleTextId, uint64 objectGUID) const          data << item.BoxMessage;                        // accept text (related to money) pop up box, 2.0.3      } -    data << uint32(_questMenu.GetMenuItemCount());      // max count 0x20 +    size_t count_pos = data.wpos(); +    data << uint32(0);                                  // max count 0x20 +    uint32 count = 0;      // Store this instead of checking the Singleton every loop iteration      bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); @@ -193,26 +195,29 @@ void PlayerMenu::SendGossipMenu(uint32 titleTextId, uint64 objectGUID) const      {          QuestMenuItem const& item = _questMenu.GetItem(i);          uint32 questID = item.QuestId; -        Quest const* quest = sObjectMgr->GetQuestTemplate(questID); - -        data << uint32(questID); -        data << uint32(item.QuestIcon); -        data << int32(quest->GetQuestLevel()); -        data << uint32(quest->GetFlags());              // 3.3.3 quest flags -        data << uint8(0);                               // 3.3.3 changes icon: blue question or yellow exclamation -        std::string title = quest->GetTitle(); +        if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID)) +        { +            ++count; +            data << uint32(questID); +            data << uint32(item.QuestIcon); +            data << int32(quest->GetQuestLevel()); +            data << uint32(quest->GetFlags());              // 3.3.3 quest flags +            data << uint8(0);                               // 3.3.3 changes icon: blue question or yellow exclamation +            std::string title = quest->GetTitle(); -        int32 locale = _session->GetSessionDbLocaleIndex(); -        if (locale >= 0) -            if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(questID)) -                ObjectMgr::GetLocaleString(localeData->Title, locale, title); +            int32 locale = _session->GetSessionDbLocaleIndex(); +            if (locale >= 0) +                if (QuestLocale const* localeData = sObjectMgr->GetQuestLocale(questID)) +                    ObjectMgr::GetLocaleString(localeData->Title, locale, title); -        if (questLevelInTitle) -            AddQuestLevelToTitle(title, quest->GetQuestLevel()); +            if (questLevelInTitle) +                AddQuestLevelToTitle(title, quest->GetQuestLevel()); -        data << title;                                  // max 0x200 +            data << title;                                  // max 0x200 +        }      } +    data.put<uint8>(count_pos, count);      _session->SendPacket(&data);  } @@ -300,20 +305,21 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title      data << uint32(eEmote._Emote);                         // NPC emote      size_t count_pos = data.wpos(); -    data << uint8 (_questMenu.GetMenuItemCount()); +    data << uint8 (0);      uint32 count = 0;      // Store this instead of checking the Singleton every loop iteration      bool questLevelInTitle = sWorld->getBoolConfig(CONFIG_UI_QUESTLEVELS_IN_DIALOGS); -    for (; count < _questMenu.GetMenuItemCount(); ++count) +    for (uint32 i = 0; i < _questMenu.GetMenuItemCount(); ++i)      { -        QuestMenuItem const& qmi = _questMenu.GetItem(count); +        QuestMenuItem const& qmi = _questMenu.GetItem(i);          uint32 questID = qmi.QuestId;          if (Quest const* quest = sObjectMgr->GetQuestTemplate(questID))          { +            ++count;              std::string title = quest->GetTitle();              int32 locale = _session->GetSessionDbLocaleIndex(); diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index cc9e87052f7..1556703e45b 100644 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -87,7 +87,10 @@ bool GameObject::AIM_Initialize()  std::string GameObject::GetAIName() const  { -    return sObjectMgr->GetGameObjectTemplate(GetEntry())->AIName; +    if (GameObjectTemplate const* got = sObjectMgr->GetGameObjectTemplate(GetEntry())) +        return got->AIName; + +    return "";  }  void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/) diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index e1ca398c7f3..d87e1e8fbbc 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -877,16 +877,26 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const      return true;  } -void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges) +void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster /*= 0*/)  {      // Better lost small time at check in comparison lost time at item save to DB.      if ((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges))          return; +    Player* owner = GetOwner(); +    if (slot < MAX_INSPECTED_ENCHANTMENT_SLOT) +    { +        if (uint32 oldEnchant = GetEnchantmentId(slot)) +            owner->GetSession()->SendEnchantmentLog(GetOwnerGUID(), 0, GetEntry(), oldEnchant); + +        if (id) +            owner->GetSession()->SendEnchantmentLog(GetOwnerGUID(), caster, GetEntry(), id); +    } +      SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET, id);      SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET, duration);      SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET, charges); -    SetState(ITEM_CHANGED, GetOwner()); +    SetState(ITEM_CHANGED, owner);  }  void Item::SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* owner) @@ -1003,6 +1013,16 @@ bool Item::IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) cons      return proto && ((proto->Map && proto->Map != cur_mapId) || (proto->Area && proto->Area != cur_zoneId));  } +void Item::SendUpdateSockets() +{ +    WorldPacket data(SMSG_SOCKET_GEMS_RESULT, 8+4+4+4+4); +    data << uint64(GetGUID()); +    for (uint32 i = SOCK_ENCHANTMENT_SLOT; i <= BONUS_ENCHANTMENT_SLOT; ++i) +        data << uint32(GetEnchantmentId(EnchantmentSlot(i))); + +    GetOwner()->GetSession()->SendPacket(&data); +} +  // Though the client has the information in the item's data field,  // we have to send SMSG_ITEM_TIME_UPDATE to display the remaining  // time. diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 0d34305d15c..b18dfe694d6 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -289,7 +289,7 @@ class Item : public Object          void SetItemRandomProperties(int32 randomPropId);          void UpdateItemSuffixFactor();          static int32 GenerateItemRandomPropertyId(uint32 item_id); -        void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges); +        void SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges, uint64 caster = 0);          void SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* owner);          void SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges);          void ClearEnchantment(EnchantmentSlot slot); @@ -300,6 +300,8 @@ class Item : public Object          std::string const& GetText() const { return m_text; }          void SetText(std::string const& text) { m_text = text; } +        void SendUpdateSockets(); +          void SendTimeUpdate(Player* owner);          void UpdateDuration(Player* owner, uint32 diff); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 4b2c5e29d35..1d3eebf4c58 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -22238,7 +22238,7 @@ void Player::UpdateTriggerVisibility()              if (!obj || !(obj->isTrigger() || obj->HasAuraType(SPELL_AURA_TRANSFORM)))  // can transform into triggers                  continue; -            obj->BuildCreateUpdateBlockForPlayer(&udata, this); +            obj->BuildValuesUpdateBlockForPlayer(&udata, this);          }      } @@ -23225,7 +23225,7 @@ void Player::UpdateForQuestWorldObjects()                  if (buildUpdateBlock)                  { -                    obj->BuildCreateUpdateBlockForPlayer(&udata, this); +                    obj->BuildValuesUpdateBlockForPlayer(&udata, this);                      break;                  }              } diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 74842d8d80d..f41b5c2f001 100644 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -692,30 +692,34 @@ void Transport::UpdatePassengerPositions()          float x, y, z, o;          npc->m_movementInfo.t_pos.GetPosition(x, y, z, o); -        CalculatePassengerPosition(x, y, z, o); +        CalculatePassengerPosition(x, y, z, &o);          GetMap()->CreatureRelocation(npc, x, y, z, o, false);          npc->GetTransportHomePosition(x, y, z, o); -        CalculatePassengerPosition(x, y, z, o); +        CalculatePassengerPosition(x, y, z, &o);          npc->SetHomePosition(x, y, z, o);      }  } -void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float& o) const +void Transport::CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const  { -    float inx = x, iny = y, inz = z, ino = o; -    o = GetOrientation() + ino; +    float inx = x, iny = y, inz = z; +    if (o) +        *o = Position::NormalizeOrientation(GetOrientation() + *o); +      x = GetPositionX() + inx * std::cos(GetOrientation()) - iny * std::sin(GetOrientation());      y = GetPositionY() + iny * std::cos(GetOrientation()) + inx * std::sin(GetOrientation());      z = GetPositionZ() + inz;  } -void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float& o) const +void Transport::CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const  { -    o -= GetOrientation(); +    if (o) +        *o = Position::NormalizeOrientation(*o - GetOrientation()); +      z -= GetPositionZ();      y -= GetPositionY();    // y = searchedY * std::cos(o) + searchedX * std::sin(o)      x -= GetPositionX();    // x = searchedX * std::cos(o) + searchedY * std::sin(o + pi)      float inx = x, iny = y; -    y = (iny - inx * tan(GetOrientation())) / (cos(GetOrientation()) + std::sin(GetOrientation()) * tan(GetOrientation())); -    x = (inx + iny * tan(GetOrientation())) / (cos(GetOrientation()) + std::sin(GetOrientation()) * tan(GetOrientation())); +    y = (iny - inx * std::tan(GetOrientation())) / (std::cos(GetOrientation()) + std::sin(GetOrientation()) * std::tan(GetOrientation())); +    x = (inx + iny * std::tan(GetOrientation())) / (std::cos(GetOrientation()) + std::sin(GetOrientation()) * std::tan(GetOrientation()));  } diff --git a/src/server/game/Entities/Transport/Transport.h b/src/server/game/Entities/Transport/Transport.h index bae09335f62..445bec456fd 100644 --- a/src/server/game/Entities/Transport/Transport.h +++ b/src/server/game/Entities/Transport/Transport.h @@ -50,10 +50,10 @@ class Transport : public GameObject, public TransportBase          void UpdatePassengerPositions();          /// This method transforms supplied transport offsets into global coordinates -        void CalculatePassengerPosition(float& x, float& y, float& z, float& o) const; +        void CalculatePassengerPosition(float& x, float& y, float& z, float* o = NULL) const;          /// This method transforms supplied global coordinates into local offsets -        void CalculatePassengerOffset(float& x, float& y, float& z, float& o) const; +        void CalculatePassengerOffset(float& x, float& y, float& z, float* o = NULL) const;          void BuildStartMovePacket(Map const* targetMap);          void BuildStopMovePacket(Map const* targetMap); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9adcbdd9365..4ad2a06a61e 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -414,7 +414,7 @@ void Unit::UpdateSplineMovement(uint32 t_diff)              pos.m_orientation = loc.orientation;              if (TransportBase* transport = GetDirectTransport()) -                transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation); +                transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, &loc.orientation);          }          if (HasUnitState(UNIT_STATE_CANNOT_TURN)) @@ -16801,12 +16801,9 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)          result = true;      } -    if (result) -    { -        Creature* creature = ToCreature(); -        if (creature && creature->IsAIEnabled) -            creature->AI()->OnSpellClick(clicker); -    } +    Creature* creature = ToCreature(); +    if (creature && creature->IsAIEnabled) +        creature->AI()->OnSpellClick(clicker, result);      return result;  } diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index d3c2a16c592..6d7d3f2b2ff 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -557,7 +557,7 @@ void Vehicle::RelocatePassengers()              float px, py, pz, po;              passenger->m_movementInfo.t_pos.GetPosition(px, py, pz, po); -            CalculatePassengerPosition(px, py, pz, po); +            CalculatePassengerPosition(px, py, pz, &po);              passenger->UpdatePosition(px, py, pz, po);          }      } @@ -675,24 +675,28 @@ uint8 Vehicle::GetAvailableSeatCount() const      return ret;  } -void Vehicle::CalculatePassengerPosition(float& x, float& y, float& z, float& o) const +void Vehicle::CalculatePassengerPosition(float& x, float& y, float& z, float* o /*= NULL*/) const  { -    float inx = x, iny = y, inz = z, ino = o; -    o = GetBase()->GetOrientation() + ino; +    float inx = x, iny = y, inz = z; +    if (o) +        *o = Position::NormalizeOrientation(GetBase()->GetOrientation() + *o); +      x = GetBase()->GetPositionX() + inx * std::cos(GetBase()->GetOrientation()) - iny * std::sin(GetBase()->GetOrientation());      y = GetBase()->GetPositionY() + iny * std::cos(GetBase()->GetOrientation()) + inx * std::sin(GetBase()->GetOrientation());      z = GetBase()->GetPositionZ() + inz;  } -void Vehicle::CalculatePassengerOffset(float& x, float& y, float& z, float& o) const +void Vehicle::CalculatePassengerOffset(float& x, float& y, float& z, float* o /*= NULL*/) const  { -    o -= GetBase()->GetOrientation(); +    if (o) +        *o = Position::NormalizeOrientation(*o - GetBase()->GetOrientation()); +      z -= GetBase()->GetPositionZ();      y -= GetBase()->GetPositionY();    // y = searchedY * std::cos(o) + searchedX * std::sin(o)      x -= GetBase()->GetPositionX();    // x = searchedX * std::cos(o) + searchedY * std::sin(o + pi)      float inx = x, iny = y; -    y = (iny - inx * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + std::sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation())); -    x = (inx + iny * tan(GetBase()->GetOrientation())) / (cos(GetBase()->GetOrientation()) + std::sin(GetBase()->GetOrientation()) * tan(GetBase()->GetOrientation())); +    y = (iny - inx * std::tan(GetBase()->GetOrientation())) / (std::cos(GetBase()->GetOrientation()) + std::sin(GetBase()->GetOrientation()) * std::tan(GetBase()->GetOrientation())); +    x = (inx + iny * std::tan(GetBase()->GetOrientation())) / (std::cos(GetBase()->GetOrientation()) + std::sin(GetBase()->GetOrientation()) * std::tan(GetBase()->GetOrientation()));  }  /** diff --git a/src/server/game/Entities/Vehicle/Vehicle.h b/src/server/game/Entities/Vehicle/Vehicle.h index 3e4a2fd3a78..c83a9fa5f33 100644 --- a/src/server/game/Entities/Vehicle/Vehicle.h +++ b/src/server/game/Entities/Vehicle/Vehicle.h @@ -89,10 +89,10 @@ class Vehicle : public TransportBase          void InitMovementInfoForBase();          /// This method transforms supplied transport offsets into global coordinates -        void CalculatePassengerPosition(float& x, float& y, float& z, float& o) const; +        void CalculatePassengerPosition(float& x, float& y, float& z, float* o = NULL) const;          /// This method transforms supplied global coordinates into local offsets -        void CalculatePassengerOffset(float& x, float& y, float& z, float& o) const; +        void CalculatePassengerOffset(float& x, float& y, float& z, float* o = NULL) const;          void RemovePendingEvent(VehicleJoinEvent* e);          void RemovePendingEventsForSeat(int8 seatId); diff --git a/src/server/game/Entities/Vehicle/VehicleDefines.h b/src/server/game/Entities/Vehicle/VehicleDefines.h index b02448b2d96..dd73ab3a01b 100644 --- a/src/server/game/Entities/Vehicle/VehicleDefines.h +++ b/src/server/game/Entities/Vehicle/VehicleDefines.h @@ -83,10 +83,10 @@ protected:  public:      /// This method transforms supplied transport offsets into global coordinates -    virtual void CalculatePassengerPosition(float& x, float& y, float& z, float& o) const = 0; +    virtual void CalculatePassengerPosition(float& x, float& y, float& z, float* o = NULL) const = 0;      /// This method transforms supplied global coordinates into local offsets -    virtual void CalculatePassengerOffset(float& x, float& y, float& z, float& o) const = 0; +    virtual void CalculatePassengerOffset(float& x, float& y, float& z, float* o = NULL) const = 0;  };  #endif diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index e684de730da..2290a7c088e 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5724,7 +5724,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float      MapEntry const* map = sMapStore.LookupEntry(MapId);      // not need to check validity of map object; MapId _MUST_ be valid here -    if (range.first == range.second && !map->IsBattleArena()) +    if (range.first == range.second && !map->IsBattlegroundOrArena())      {          TC_LOG_ERROR(LOG_FILTER_SQL, "Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team);          return GetDefaultGraveYard(team); diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index e1a9dd27450..13f1988f050 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -1007,15 +1007,14 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket& recvData)          GetPlayer()->SetAmmo(item);  } -void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID) +void WorldSession::SendEnchantmentLog(uint64 target, uint64 caster, uint32 itemId, uint32 enchantId)  { -    WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1));     // last check 2.0.10 -    data << uint64(Target); -    data << uint64(Caster); -    data << uint32(ItemID); -    data << uint32(SpellID); -    data << uint8(0); -    SendPacket(&data); +    WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4));     // last check 2.0.10 +    data.appendPackGUID(target); +    data.appendPackGUID(caster); +    data << uint32(itemId); +    data << uint32(enchantId); +    GetPlayer()->SendMessageToSet(&data, true);  }  void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, uint32 slot, uint32 Duration) @@ -1334,7 +1333,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)      {          if (GemEnchants[i])          { -            itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i], 0, 0); +            itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i], 0, 0, _player->GetGUID());              if (Item* guidItem = _player->GetItemByGuid(gem_guids[i]))                  _player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true);          } @@ -1347,7 +1346,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)      if (SocketBonusActivated ^ SocketBonusToBeActivated)     //if there was a change...      {          _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false); -        itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetTemplate()->socketBonus : 0), 0, 0); +        itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetTemplate()->socketBonus : 0), 0, 0, _player->GetGUID());          _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true);          //it is not displayed, client has an inbuilt system to determine if the bonus is activated      } @@ -1356,6 +1355,8 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData)      _player->RemoveTradeableItem(itemTarget);      itemTarget->ClearSoulboundTradeable(_player);           // clear tradeable flag + +    itemTarget->SendUpdateSockets();  }  void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData) diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 4e4ec1350cb..43a0b083b91 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -580,7 +580,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)                      continue;                  } -                player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, player->GetGUID(), true); +                player->PlayerTalkClass->SendQuestGiverQuestDetails(quest, _player->GetGUID(), true);                  player->SetDivider(_player->GetGUID());              }          } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index f2f3959dba5..156813f56fb 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -153,8 +153,8 @@ class MotionMaster //: private std::stack<MovementGenerator *>          void MoveChase(Unit* target, float dist = 0.0f, float angle = 0.0f);          void MoveConfused();          void MoveFleeing(Unit* enemy, uint32 time = 0); -        void MovePoint(uint32 id, const Position &pos) -            { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ); } +        void MovePoint(uint32 id, Position const& pos, bool generatePath = true) +            { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath); }          void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true);          // These two movement types should only be used with creatures having landing/takeoff animations diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index ea7a8c4c710..227780daa1f 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -24,6 +24,7 @@  #include "MoveSplineInit.h"  #include "MoveSpline.h"  #include "Player.h" +#include "CreatureGroups.h"  //----- Point Movement Generator  template<class T> @@ -42,6 +43,11 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)      if (speed > 0.0f)          init.SetVelocity(speed);      init.Launch(); +     +    //Call for creature group update +    if (Creature* creature = unit->ToCreature()) +        if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature) +            creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z);  }  template<class T> @@ -66,6 +72,11 @@ bool PointMovementGenerator<T>::DoUpdate(T* unit, uint32 /*diff*/)          if (speed > 0.0f) // Default value for point motion type is 0.0, if 0.0 spline will use GetSpeed on unit              init.SetVelocity(speed);          init.Launch(); +         +        //Call for creature group update +        if (Creature* creature = unit->ToCreature()) +            if (creature->GetFormation() && creature->GetFormation()->getLeader() == creature) +                creature->GetFormation()->LeaderMoveTo(i_x, i_y, i_z);      }      return !unit->movespline->Finalized(); diff --git a/src/server/game/Movement/Spline/MoveSplineInit.cpp b/src/server/game/Movement/Spline/MoveSplineInit.cpp index 49a33a4f79e..2f4224c8b91 100644 --- a/src/server/game/Movement/Spline/MoveSplineInit.cpp +++ b/src/server/game/Movement/Spline/MoveSplineInit.cpp @@ -29,11 +29,7 @@ namespace Movement  {      UnitMoveType SelectSpeedType(uint32 moveFlags)      { -        /*! Not sure about MOVEMENTFLAG_CAN_FLY here - do creatures that can fly -            but are on ground right now also have it? If yes, this needs a more -            dynamic check, such as is flying now -        */ -        if (moveFlags & (MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_DISABLE_GRAVITY)) +        if (moveFlags & MOVEMENTFLAG_FLYING)          {              if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.flight >= speed_obj.flight_back*/)                  return MOVE_FLIGHT_BACK; @@ -55,6 +51,8 @@ namespace Movement          else if (moveFlags & MOVEMENTFLAG_BACKWARD /*&& speed_obj.run >= speed_obj.run_back*/)              return MOVE_RUN_BACK; +        // Flying creatures use MOVEMENTFLAG_CAN_FLY or MOVEMENTFLAG_DISABLE_GRAVITY +        // Run speed is their default flight speed.          return MOVE_RUN;      } @@ -90,22 +88,25 @@ namespace Movement          move_spline.onTransport = transport;          uint32 moveFlags = unit->m_movementInfo.GetMovementFlags(); -        if (args.flags.walkmode) -            moveFlags |= MOVEMENTFLAG_WALKING; -        else -            moveFlags &= ~MOVEMENTFLAG_WALKING; -          moveFlags |= (MOVEMENTFLAG_SPLINE_ENABLED|MOVEMENTFLAG_FORWARD); +        if (moveFlags & MOVEMENTFLAG_ROOT) +            moveFlags &= ~MOVEMENTFLAG_MASK_MOVING; +          if (!args.HasVelocity) -            args.velocity = unit->GetSpeed(SelectSpeedType(moveFlags)); +        { +            // If spline is initialized with SetWalk method it only means we need to select +            // walk move speed for it but not add walk flag to unit +            uint32 moveFlagsForSpeed = moveFlags; +            if (args.flags.walkmode) +                moveFlagsForSpeed |= MOVEMENTFLAG_WALKING; + +            args.velocity = unit->GetSpeed(SelectSpeedType(moveFlagsForSpeed)); +        }          if (!args.Validate(unit))              return 0; -        if (moveFlags & MOVEMENTFLAG_ROOT) -            moveFlags &= ~MOVEMENTFLAG_MASK_MOVING; -          unit->m_movementInfo.SetMovementFlags((MovementFlags)moveFlags);          move_spline.Initialize(args); @@ -175,13 +176,8 @@ namespace Movement      Vector3 TransportPathTransform::operator()(Vector3 input)      {          if (_transformForTransport) -        {              if (TransportBase* transport = _owner->GetDirectTransport()) -            { -                float unused = 0.0f; // need reference -                transport->CalculatePassengerOffset(input.x, input.y, input.z, unused); -            } -        } +                transport->CalculatePassengerOffset(input.x, input.y, input.z);          return input;      } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 7237d5f74f7..065b80cb08f 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1317,7 +1317,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =      /*0x508*/ { "CMSG_SET_ALLOW_LOW_LEVEL_RAID1",               STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_NULL                     },      /*0x509*/ { "CMSG_SET_ALLOW_LOW_LEVEL_RAID2",               STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_NULL                     },      /*0x50A*/ { "SMSG_CAMERA_SHAKE",                            STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_ServerSide               }, -    /*0x50B*/ { "SMSG_UPDATE_ITEM_ENCHANTMENTS",                STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_ServerSide               }, +    /*0x50B*/ { "SMSG_SOCKET_GEMS_RESULT",                      STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_ServerSide               },      /*0x50C*/ { "CMSG_SET_CHARACTER_MODEL",                     STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_NULL                     },      /*0x50D*/ { "SMSG_REDIRECT_CLIENT",                         STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_ServerSide               },      /*0x50E*/ { "CMSG_REDIRECTION_FAILED",                      STATUS_NEVER,    PROCESS_INPLACE,      &WorldSession::Handle_NULL                     }, diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 30c5b1dcdf4..254f9fe5350 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1325,7 +1325,7 @@ enum Opcodes      CMSG_SET_ALLOW_LOW_LEVEL_RAID1                  = 0x508,      CMSG_SET_ALLOW_LOW_LEVEL_RAID2                  = 0x509,      SMSG_CAMERA_SHAKE                               = 0x50A, // uint32 SpellEffectCameraShakes.dbc index, uint32 -    SMSG_UPDATE_ITEM_ENCHANTMENTS                   = 0x50B, // some item update packet? +    SMSG_SOCKET_GEMS_RESULT                         = 0x50B,      CMSG_SET_CHARACTER_MODEL                        = 0x50C,      SMSG_REDIRECT_CLIENT                            = 0x50D, // uint32 ip, uint16 port, uint32 unk, uint8[20] hash (ip + port, seed=sessionkey)      CMSG_REDIRECTION_FAILED                         = 0x50E, // something with networking diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index b714cd71e6d..bf79b34822d 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -322,7 +322,7 @@ class WorldSession          void SendAuctionOwnerNotification(AuctionEntry* auction);          //Item Enchantment -        void SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID); +        void SendEnchantmentLog(uint64 target, uint64 caster, uint32 itemId, uint32 enchantId);          void SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, uint32 slot, uint32 Duration);          //Taxi diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index db6263a8062..64a538dce86 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2771,7 +2771,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)          // remove old enchanting before applying new if equipped          item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, false); -        itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0); +        itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID());          // add new enchanting if equipped          item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, true); @@ -2836,7 +2836,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)      // remove old enchanting before applying new if equipped      item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, false); -    itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0); +    itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID());      // add new enchanting if equipped      item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true); @@ -2970,7 +2970,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)      // remove old enchanting before applying new if equipped      item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, false); -    itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0); +    itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0, m_caster->GetGUID());      // add new enchanting if equipped      item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, true); @@ -4521,7 +4521,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex)      if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)          return; -    Player* item_owner = (Player*)unitTarget; +    Player* item_owner = unitTarget->ToPlayer();      Item* item = item_owner->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);      if (!item) @@ -4552,7 +4552,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex)              return;          // Apply the temporary enchantment -        item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0); +        item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0, m_caster->GetGUID());          item_owner->ApplyEnchantment(item, slot, true);      }  } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 026c61d4965..9cedfdf922f 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -499,6 +499,9 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con  SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const  { +    if (!spell) +        return NULL; +      uint32 newSpellId = GetSpellIdForDifficulty(spell->Id, caster);      SpellInfo const* newSpell = GetSpellInfo(newSpellId);      if (!newSpell) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 80577c3462e..9d2ee2eb2ba 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2675,14 +2675,12 @@ void World::SendAutoBroadcast()      if (abcenter == 0)          sWorld->SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); -      else if (abcenter == 1)      {          WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1));          data << msg;          sWorld->SendGlobalMessage(&data);      } -      else if (abcenter == 2)      {          sWorld->SendWorldText(LANG_AUTO_BROADCAST, msg.c_str()); diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index 309380a9cbb..11b4ebf33ae 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -338,7 +338,8 @@ public:          }          else              sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); -            return true; + +        return true;      }      // Exit the realm diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index 9e312ef8f94..b6b701c513d 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -716,27 +716,27 @@ public:              if (CheckTimer <= diff)              {                  Creature* Kalec = Unit::GetCreature(*me, KalecGUID); -                if (!Kalec || (Kalec && !Kalec->isAlive())) +                if (!Kalec || !Kalec->isAlive())                  {                      if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID))                          Kalecgos->AI()->EnterEvadeMode(); -                        return; +                    return;                  } +                  if (HealthBelowPct(10) && !isEnraged)                  {                      if (Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID))                          Kalecgos->AI()->DoAction(DO_ENRAGE);                      DoAction(DO_ENRAGE);                  } +                  Creature* Kalecgos = Unit::GetCreature(*me, KalecgosGUID); -                if (Kalecgos) +                if (Kalecgos && !Kalecgos->isInCombat())                  { -                    if (!Kalecgos->isInCombat()) -                    { -                        me->AI()->EnterEvadeMode(); -                        return; -                    } +                    me->AI()->EnterEvadeMode(); +                    return;                  } +                  if (!isBanished && HealthBelowPct(1))                  {                      if (Kalecgos) @@ -746,8 +746,7 @@ public:                              me->DealDamage(me, me->GetHealth());                              return;                          } -                        else -                            DoAction(DO_BANISH); +                        DoAction(DO_BANISH);                      }                      else                      { diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp index 0e2308a8e1a..bff18b508d5 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/instance_halls_of_reflection.cpp @@ -267,8 +267,8 @@ public:                  case NPC_WAVE_MAGE:                  {                      uint32 deadNpcs = 0; -                    uint32 internalWaveId = _waveCount - ((_waveCount < 5) ? 1 : 2); -                    for (std::set<uint64>::const_iterator itr = waveGuidList[internalWaveId].begin(); itr != waveGuidList[internalWaveId].end(); ++itr) +                    uint32 waveId = creature->AI()->GetData(0); +                    for (std::set<uint64>::const_iterator itr = waveGuidList[waveId].begin(); itr != waveGuidList[waveId].end(); ++itr)                      {                          Creature* npc = instance->GetCreature(*itr);                          if (!npc || !npc->isAlive()) @@ -277,7 +277,7 @@ public:                      // because the current npc returns isAlive when OnUnitDeath happens                      // we check if the number of dead npcs is equal to the list-1 -                    if (deadNpcs == waveGuidList[internalWaveId].size() - 1) +                    if (deadNpcs == waveGuidList[waveId].size() - 1)                      {                          ++_waveCount;                          events.ScheduleEvent(EVENT_NEXT_WAVE, 10000); @@ -322,7 +322,7 @@ public:                          possibilityList.push_back(NPC_WAVE_MAGE);                          // iterate each wave -                        for (uint8 i = 0; i < 8; i++) +                        for (uint8 i = 0; i < 8; ++i)                          {                              tempList = possibilityList; diff --git a/src/server/scripts/Northrend/Gundrak/gundrak.h b/src/server/scripts/Northrend/Gundrak/gundrak.h index 0c65b4d16de..a43edb4fcd7 100644 --- a/src/server/scripts/Northrend/Gundrak/gundrak.h +++ b/src/server/scripts/Northrend/Gundrak/gundrak.h @@ -43,12 +43,31 @@ enum Data64  enum mainCreatures  { -    CREATURE_RUIN_DWELLER                         = 29920, -    CREATURE_SLAD_RAN                             = 29304, -    CREATURE_MOORABI                              = 29305, -    CREATURE_GALDARAH                             = 29306, -    CREATURE_DRAKKARICOLOSSUS                     = 29307, -    CREATURE_ECK                                  = 29932 +    CREATURE_RUIN_DWELLER               = 29920, +    CREATURE_SLAD_RAN                   = 29304, +    CREATURE_MOORABI                    = 29305, +    CREATURE_GALDARAH                   = 29306, +    CREATURE_DRAKKARICOLOSSUS           = 29307, +    CREATURE_ECK                        = 29932 +}; + +enum Gameobjects { + +    GO_SLADRAN_ALTAR                    = 192518, +    GO_MOORABI_ALTAR                    = 192519, +    GO_DRAKKARI_COLOSSUS_ALTAR          = 192520, +    GO_SLADRAN_STATUE                   = 192564, +    GO_MOORABI_STATUE                   = 192565, +    GO_GALDARAH_STATUE                  = 192566, +    GO_DRAKKARI_COLOSSUS_STATUE         = 192567, +    GO_ECK_THE_FEROCIOUS_DOOR           = 192632, +    GO_ECK_THE_FEROCIOUS_DOOR_BEHIND    = 192569, +    GO_GALDARAH_DOOR1                   = 193208, +    GO_GALDARAH_DOOR2                   = 193209, +    GO_GALDARAH_DOOR3                   = 192568, +    GO_BRIDGE                           = 193188, +    GO_COLLISION                        = 192633 +      };  #endif diff --git a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp index a9bbffa5fb0..d17198b0c92 100644 --- a/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp +++ b/src/server/scripts/Northrend/Gundrak/instance_gundrak.cpp @@ -45,44 +45,45 @@ public:      {          instance_gundrak_InstanceMapScript(Map* map) : InstanceScript(map)          { -            bHeroicMode = map->IsHeroic(); +            isHeroic = map->IsHeroic();          } -        bool bHeroicMode; +        bool isHeroic;          bool spawnSupport;          uint32 timer;          uint32 phase;          uint64 toActivate; -        uint64 uiSladRan; -        uint64 uiMoorabi; -        uint64 uiDrakkariColossus; -        uint64 uiGalDarah; -        uint64 uiEckTheFerocious; - -        uint64 uiSladRanAltar; -        uint64 uiMoorabiAltar; -        uint64 uiDrakkariColossusAltar; -        uint64 uiSladRanStatue; -        uint64 uiMoorabiStatue; -        uint64 uiDrakkariColossusStatue; -        uint64 uiGalDarahStatue; -        uint64 uiEckTheFerociousDoor; -        uint64 uiEckTheFerociousDoorBehind; -        uint64 uiGalDarahDoor1; -        uint64 uiGalDarahDoor2; -        uint64 uiBridge; -        uint64 uiCollision; +        uint64 sladRanGUID; +        uint64 moorabiGUID; +        uint64 drakkariColossusGUID; +        uint64 galDarahGUID; +        uint64 eckTheFerociousGUID; + +        uint64 sladRanAltarGUID; +        uint64 moorabiAltarGUID; +        uint64 drakkariColossusAltarGUID; +        uint64 sladRanStatueGUID; +        uint64 moorabiStatueGUID; +        uint64 drakkariColossusStatueGUID; +        uint64 galDarahStatueGUID; +        uint64 eckTheFerociousDoorGUID; +        uint64 eckTheFerociousDoorBehindGUID; +        uint64 galDarahDoor1GUID; +        uint64 galDarahDoor2GUID; +        uint64 galDarahDoor3GUID; +        uint64 bridgeGUID; +        uint64 collisionGUID;          uint32 m_auiEncounter[MAX_ENCOUNTER]; -        GOState uiSladRanStatueState; -        GOState uiMoorabiStatueState; -        GOState uiDrakkariColossusStatueState; -        GOState uiGalDarahStatueState; -        GOState uiBridgeState; -        GOState uiCollisionState; +        GOState sladRanStatueState; +        GOState moorabiStatueState; +        GOState drakkariColossusStatueState; +        GOState galDarahStatueState; +        GOState bridgeState; +        GOState collisionState;          std::set<uint64> DwellerGUIDs; @@ -96,35 +97,36 @@ public:              phase = 0;              toActivate = 0; -            uiSladRan = 0; -            uiMoorabi = 0; -            uiDrakkariColossus = 0; -            uiGalDarah = 0; -            uiEckTheFerocious = 0; - -            uiSladRanAltar = 0; -            uiMoorabiAltar = 0; -            uiDrakkariColossusAltar = 0; - -            uiSladRanStatue = 0; -            uiMoorabiStatue = 0; -            uiDrakkariColossusStatue = 0; -            uiGalDarahStatue = 0; - -            uiEckTheFerociousDoor = 0; -            uiEckTheFerociousDoorBehind = 0; -            uiGalDarahDoor1 = 0; -            uiGalDarahDoor2 = 0; - -            uiBridge = 0; -            uiCollision = 0; - -            uiSladRanStatueState = GO_STATE_ACTIVE; -            uiMoorabiStatueState = GO_STATE_ACTIVE; -            uiDrakkariColossusStatueState = GO_STATE_ACTIVE; -            uiGalDarahStatueState = GO_STATE_READY; -            uiBridgeState = GO_STATE_ACTIVE; -            uiCollisionState = GO_STATE_READY; +            sladRanGUID = 0; +            moorabiGUID = 0; +            drakkariColossusGUID = 0; +            galDarahGUID = 0; +            eckTheFerociousGUID = 0; + +            sladRanAltarGUID = 0; +            moorabiAltarGUID = 0; +            drakkariColossusAltarGUID = 0; + +            sladRanStatueGUID = 0; +            moorabiStatueGUID = 0; +            drakkariColossusStatueGUID = 0; +            galDarahStatueGUID = 0; + +            eckTheFerociousDoorGUID = 0; +            eckTheFerociousDoorBehindGUID = 0; +            galDarahDoor1GUID = 0; +            galDarahDoor2GUID = 0; +            galDarahDoor3GUID = 0; + +            bridgeGUID = 0; +            collisionGUID = 0; + +            sladRanStatueState = GO_STATE_ACTIVE; +            moorabiStatueState = GO_STATE_ACTIVE; +            drakkariColossusStatueState = GO_STATE_ACTIVE; +            galDarahStatueState = GO_STATE_READY; +            bridgeState = GO_STATE_ACTIVE; +            collisionState = GO_STATE_READY;              DwellerGUIDs.clear(); @@ -144,11 +146,21 @@ public:          {              switch (creature->GetEntry())              { -                case CREATURE_SLAD_RAN: uiSladRan = creature->GetGUID(); break; -                case CREATURE_MOORABI: uiMoorabi = creature->GetGUID(); break; -                case CREATURE_GALDARAH: uiGalDarah = creature->GetGUID(); break; -                case CREATURE_DRAKKARICOLOSSUS: uiDrakkariColossus = creature->GetGUID(); break; -                case CREATURE_ECK: uiEckTheFerocious = creature->GetGUID(); break; +                case CREATURE_SLAD_RAN: +                    sladRanGUID = creature->GetGUID(); +                    break; +                case CREATURE_MOORABI: +                    moorabiGUID = creature->GetGUID(); +                    break; +                case CREATURE_GALDARAH: +                    galDarahGUID = creature->GetGUID(); +                    break; +                case CREATURE_DRAKKARICOLOSSUS: +                    drakkariColossusGUID = creature->GetGUID(); +                    break; +                case CREATURE_ECK: +                    eckTheFerociousGUID = creature->GetGUID(); +                    break;                  case CREATURE_RUIN_DWELLER:                      if (creature->isAlive())                          DwellerGUIDs.insert(creature->GetGUID()); @@ -160,13 +172,13 @@ public:          {              switch (go->GetEntry())              { -                case 192518: -                    uiSladRanAltar = go->GetGUID(); +                case GO_SLADRAN_ALTAR: +                    sladRanAltarGUID = go->GetGUID();                      // Make sure that they start out as unusuable                      go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                      if (m_auiEncounter[0] == DONE)                      { -                        if (uiSladRanStatueState == GO_STATE_ACTIVE) +                        if (sladRanStatueState == GO_STATE_ACTIVE)                              go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                          else                          { @@ -175,13 +187,13 @@ public:                          }                      }                      break; -                case 192519: -                    uiMoorabiAltar = go->GetGUID(); +                case GO_MOORABI_ALTAR: +                    moorabiAltarGUID = go->GetGUID();                      // Make sure that they start out as unusuable                      go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                      if (m_auiEncounter[0] == DONE)                      { -                        if (uiMoorabiStatueState == GO_STATE_ACTIVE) +                        if (moorabiStatueState == GO_STATE_ACTIVE)                              go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                          else                          { @@ -190,13 +202,13 @@ public:                          }                      }                      break; -                case 192520: -                    uiDrakkariColossusAltar = go->GetGUID(); +                case GO_DRAKKARI_COLOSSUS_ALTAR: +                    drakkariColossusAltarGUID = go->GetGUID();                      // Make sure that they start out as unusuable                      go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                      if (m_auiEncounter[0] == DONE)                      { -                        if (uiDrakkariColossusStatueState == GO_STATE_ACTIVE) +                        if (drakkariColossusStatueState == GO_STATE_ACTIVE)                              go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                          else                          { @@ -205,53 +217,58 @@ public:                          }                      }                      break; -                case 192564: -                    uiSladRanStatue = go->GetGUID(); -                    go->SetGoState(uiSladRanStatueState); +                case GO_SLADRAN_STATUE: +                    sladRanStatueGUID = go->GetGUID(); +                    go->SetGoState(sladRanStatueState);                      break; -                case 192565: -                    uiMoorabiStatue = go->GetGUID(); -                    go->SetGoState(uiMoorabiStatueState); +                case GO_MOORABI_STATUE: +                    moorabiStatueGUID = go->GetGUID(); +                    go->SetGoState(moorabiStatueState);                      break; -                case 192566: -                    uiGalDarahStatue = go->GetGUID(); -                    go->SetGoState(uiGalDarahStatueState); +                case GO_GALDARAH_STATUE: +                    galDarahStatueGUID = go->GetGUID(); +                    go->SetGoState(galDarahStatueState);                      break; -                case 192567: -                    uiDrakkariColossusStatue = go->GetGUID(); -                    go->SetGoState(uiDrakkariColossusStatueState); +                case GO_DRAKKARI_COLOSSUS_STATUE: +                    drakkariColossusStatueGUID = go->GetGUID(); +                    go->SetGoState(drakkariColossusStatueState);                      break; -                case 192632: -                    uiEckTheFerociousDoor = go->GetGUID(); -                    if (bHeroicMode && m_auiEncounter[1] == DONE) +                case GO_ECK_THE_FEROCIOUS_DOOR: +                    eckTheFerociousDoorGUID = go->GetGUID(); +                    if (isHeroic && m_auiEncounter[1] == DONE)                          HandleGameObject(0, true, go);                      break; -                case 192569: -                    uiEckTheFerociousDoorBehind = go->GetGUID(); -                    if (bHeroicMode && m_auiEncounter[4] == DONE) +                case GO_ECK_THE_FEROCIOUS_DOOR_BEHIND: +                    eckTheFerociousDoorBehindGUID = go->GetGUID(); +                    if (isHeroic && m_auiEncounter[4] == DONE)                          HandleGameObject(0, true, go); -                case 193208: -                    uiGalDarahDoor1 = go->GetGUID(); +                case GO_GALDARAH_DOOR1: +                    galDarahDoor1GUID = go->GetGUID();                      if (m_auiEncounter[3] == DONE)                          HandleGameObject(0, true, go);                      break; -                case 193209: -                    uiGalDarahDoor2 = go->GetGUID(); +                case GO_GALDARAH_DOOR2: +                    galDarahDoor2GUID = go->GetGUID();                      if (m_auiEncounter[3] == DONE)                          HandleGameObject(0, true, go);                      break; -                case 193188: -                    uiBridge = go->GetGUID(); -                    go->SetGoState(uiBridgeState); +                case GO_BRIDGE: +                    bridgeGUID = go->GetGUID(); +                    go->SetGoState(bridgeState);                      break; -                case 192633: -                    uiCollision = go->GetGUID(); -                    go->SetGoState(uiCollisionState); +                case GO_COLLISION: +                    collisionGUID = go->GetGUID(); +                    go->SetGoState(collisionState);                      // Can't spawn here with SpawnGameObject because go isn't added to world yet... -                    if (uiCollisionState == GO_STATE_ACTIVE_ALTERNATIVE) +                    if (collisionState == GO_STATE_ACTIVE_ALTERNATIVE)                          spawnSupport = true;                      break; +                case GO_GALDARAH_DOOR3: +                    galDarahDoor3GUID = go->GetGUID(); +                    if (m_auiEncounter[3] != IN_PROGRESS) +                        HandleGameObject(galDarahDoor3GUID, true, go); +                    break;              }          } @@ -263,7 +280,7 @@ public:                  m_auiEncounter[0] = data;                  if (data == DONE)                  { -                  GameObject* go = instance->GetGameObject(uiSladRanAltar); +                  GameObject* go = instance->GetGameObject(sladRanAltarGUID);                    if (go)                        go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                  } @@ -272,18 +289,18 @@ public:                  m_auiEncounter[1] = data;                  if (data == DONE)                  { -                  GameObject* go = instance->GetGameObject(uiMoorabiAltar); +                  GameObject* go = instance->GetGameObject(moorabiAltarGUID);                    if (go)                        go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); -                  if (bHeroicMode) -                      HandleGameObject(uiEckTheFerociousDoor, true); +                  if (isHeroic) +                      HandleGameObject(eckTheFerociousDoorGUID, true);                  }                  break;              case DATA_DRAKKARI_COLOSSUS_EVENT:                  m_auiEncounter[2] = data;                  if (data == DONE)                  { -                  GameObject* go = instance->GetGameObject(uiDrakkariColossusAltar); +                  GameObject* go = instance->GetGameObject(drakkariColossusAltarGUID);                    if (go)                        go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                  } @@ -292,14 +309,15 @@ public:                  m_auiEncounter[3] = data;                  if (data == DONE)                  { -                    HandleGameObject(uiGalDarahDoor1, true); -                    HandleGameObject(uiGalDarahDoor2, true); +                    HandleGameObject(galDarahDoor1GUID, true); +                    HandleGameObject(galDarahDoor2GUID, true);                  } +                HandleGameObject(galDarahDoor3GUID, data == IN_PROGRESS ? false : true);                  break;              case DATA_ECK_THE_FEROCIOUS_EVENT:                  m_auiEncounter[4] = data; -                if (bHeroicMode && data == DONE) -                    HandleGameObject(uiEckTheFerociousDoorBehind, true); +                if (isHeroic && data == DONE) +                    HandleGameObject(eckTheFerociousDoorBehindGUID, true);                  break;              } @@ -345,19 +363,19 @@ public:              switch (type)              {                  case DATA_SLAD_RAN_ALTAR: -                    return uiSladRanAltar; +                    return sladRanAltarGUID;                  case DATA_MOORABI_ALTAR: -                    return uiMoorabiAltar; +                    return moorabiAltarGUID;                  case DATA_DRAKKARI_COLOSSUS_ALTAR: -                    return uiDrakkariColossusAltar; +                    return drakkariColossusAltarGUID;                  case DATA_SLAD_RAN_STATUE: -                    return uiSladRanStatue; +                    return sladRanStatueGUID;                  case DATA_MOORABI_STATUE: -                    return uiMoorabiStatue; +                    return moorabiStatueGUID;                  case DATA_DRAKKARI_COLOSSUS_STATUE: -                    return uiDrakkariColossusStatue; +                    return drakkariColossusStatueGUID;                  case DATA_DRAKKARI_COLOSSUS: -                    return uiDrakkariColossus; +                    return drakkariColossusGUID;                  case DATA_STATUE_ACTIVATE:                      return toActivate;              } @@ -372,9 +390,9 @@ public:              std::ostringstream saveStream;              saveStream << "G D " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '                   << m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4] << ' ' -                 << (uiSladRanStatue ? GetObjState(uiSladRanStatue) : GO_STATE_ACTIVE) << ' ' << (uiMoorabiStatue ? GetObjState(uiMoorabiStatue) : GO_STATE_ACTIVE) << ' ' -                 << (uiDrakkariColossusStatue ? GetObjState(uiDrakkariColossusStatue) : GO_STATE_ACTIVE) << ' ' << (uiGalDarahStatue ? GetObjState(uiGalDarahStatue) : GO_STATE_READY) << ' ' -                 << (uiBridge ? GetObjState(uiBridge) : GO_STATE_ACTIVE) << ' ' << (uiCollision ? GetObjState(uiCollision) : GO_STATE_READY); +                 << (sladRanStatueGUID ? GetObjState(sladRanStatueGUID) : GO_STATE_ACTIVE) << ' ' << (moorabiStatueGUID ? GetObjState(moorabiStatueGUID) : GO_STATE_ACTIVE) << ' ' +                 << (drakkariColossusStatueGUID ? GetObjState(drakkariColossusStatueGUID) : GO_STATE_ACTIVE) << ' ' << (galDarahStatueGUID ? GetObjState(galDarahStatueGUID) : GO_STATE_READY) << ' ' +                 << (bridgeGUID ? GetObjState(bridgeGUID) : GO_STATE_ACTIVE) << ' ' << (collisionGUID ? GetObjState(collisionGUID) : GO_STATE_READY);              str_data = saveStream.str(); @@ -406,12 +424,12 @@ public:                  m_auiEncounter[2] = data2;                  m_auiEncounter[3] = data3;                  m_auiEncounter[4] = data4; -                uiSladRanStatueState            = GOState(data5); -                uiMoorabiStatueState            = GOState(data6); -                uiDrakkariColossusStatueState   = GOState(data7); -                uiGalDarahStatueState           = GOState(data8); -                uiBridgeState                   = GOState(data9); -                uiCollisionState                = GOState(data10); +                sladRanStatueState            = GOState(data5); +                moorabiStatueState            = GOState(data6); +                drakkariColossusStatueState   = GOState(data7); +                galDarahStatueState           = GOState(data8); +                bridgeState                   = GOState(data9); +                collisionState                = GOState(data10);                  for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)                      if (m_auiEncounter[i] == IN_PROGRESS) @@ -426,8 +444,8 @@ public:               // Spawn the support for the bridge if necessary               if (spawnSupport)               { -                 if (GameObject* pCollision = instance->GetGameObject(uiCollision)) -                     pCollision->SummonGameObject(192743, pCollision->GetPositionX(), pCollision->GetPositionY(), pCollision->GetPositionZ(), pCollision->GetOrientation(), 0, 0, 0, 0, 0); +                 if (GameObject* collision = instance->GetGameObject(collisionGUID)) +                     collision->SummonGameObject(192743, collision->GetPositionX(), collision->GetPositionY(), collision->GetPositionZ(), collision->GetOrientation(), 0, 0, 0, 0, 0);                   spawnSupport = false;               } @@ -438,25 +456,25 @@ public:               if (timer < diff)               {                   timer = 0; -                 if (toActivate == uiBridge) +                 if (toActivate == bridgeGUID)                   { -                     GameObject* pBridge = instance->GetGameObject(uiBridge); -                     GameObject* pCollision = instance->GetGameObject(uiCollision); -                     GameObject* pSladRanStatue = instance->GetGameObject(uiSladRanStatue); -                     GameObject* pMoorabiStatue = instance->GetGameObject(uiMoorabiStatue); -                     GameObject* pDrakkariColossusStatue = instance->GetGameObject(uiDrakkariColossusStatue); -                     GameObject* pGalDarahStatue = instance->GetGameObject(uiGalDarahStatue); +                     GameObject* bridge = instance->GetGameObject(bridgeGUID); +                     GameObject* collision = instance->GetGameObject(collisionGUID); +                     GameObject* sladRanStatue = instance->GetGameObject(sladRanStatueGUID); +                     GameObject* moorabiStatue = instance->GetGameObject(moorabiStatueGUID); +                     GameObject* drakkariColossusStatue = instance->GetGameObject(drakkariColossusStatueGUID); +                     GameObject* galDarahStatue = instance->GetGameObject(galDarahStatueGUID);                       toActivate = 0; -                     if (pBridge && pCollision && pSladRanStatue && pMoorabiStatue && pDrakkariColossusStatue && pGalDarahStatue) +                     if (bridge && collision && sladRanStatue && moorabiStatue && drakkariColossusStatue && galDarahStatue)                       { -                         pBridge->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); -                         pCollision->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); -                         pSladRanStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); -                         pMoorabiStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); -                         pDrakkariColossusStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); -                         pGalDarahStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); +                         bridge->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); +                         collision->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); +                         sladRanStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); +                         moorabiStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); +                         drakkariColossusStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); +                         galDarahStatue->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);                           // Add the GO that solidifies the bridge so you can walk on it                           spawnSupport = true; @@ -466,27 +484,27 @@ public:                   else                   {                       uint32 spell = 0; -                     GameObject* pAltar = NULL; -                     if (toActivate == uiSladRanStatue) +                     GameObject* altar = NULL; +                     if (toActivate == sladRanStatueGUID)                       {                           spell = 57071; -                         pAltar = instance->GetGameObject(uiSladRanAltar); +                         altar = instance->GetGameObject(sladRanAltarGUID);                       } -                     else if (toActivate == uiMoorabiStatue) +                     else if (toActivate == moorabiStatueGUID)                       {                           spell = 57068; -                         pAltar = instance->GetGameObject(uiMoorabiAltar); +                         altar = instance->GetGameObject(moorabiAltarGUID);                       } -                     else if (toActivate == uiDrakkariColossusStatue) +                     else if (toActivate == drakkariColossusStatueGUID)                       {                           spell = 57072; -                         pAltar = instance->GetGameObject(uiDrakkariColossusAltar); +                         altar = instance->GetGameObject(drakkariColossusAltarGUID);                       }                       // This is a workaround to make the beam cast properly. The caster should be ID 30298 but since the spells                       // all are with scripted target for that same ID, it will hit itself. -                     if (pAltar) -                         if (Creature* trigger = pAltar->SummonCreature(18721, pAltar->GetPositionX(), pAltar->GetPositionY(), pAltar->GetPositionZ() + 3, pAltar->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 5000)) +                     if (altar) +                         if (Creature* trigger = altar->SummonCreature(18721, altar->GetPositionX(), altar->GetPositionY(), altar->GetPositionZ() + 3, altar->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 5000))                           {                               // Set the trigger model to invisible                               trigger->SetDisplayId(11686); @@ -499,7 +517,7 @@ public:                       toActivate = 0;                       if (phase == 3) -                         SetData64(DATA_STATUE_ACTIVATE, uiBridge); +                         SetData64(DATA_STATUE_ACTIVATE, bridgeGUID);                       else                           SaveToDB(); // Don't save in between last statue and bridge turning in case of crash leading to stuck instance                  } @@ -526,7 +544,7 @@ public:      bool OnGossipHello(Player* /*player*/, GameObject* go)      {          InstanceScript* instance = go->GetInstanceScript(); -        uint64 uiStatue = 0; +        uint64 statueGUID = 0;          go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);          go->SetGoState(GO_STATE_ACTIVE); @@ -535,20 +553,20 @@ public:          {              switch (go->GetEntry())              { -                case 192518: -                    uiStatue = instance->GetData64(DATA_SLAD_RAN_STATUE); +                case GO_SLADRAN_ALTAR: +                    statueGUID = instance->GetData64(DATA_SLAD_RAN_STATUE);                      break; -                case 192519: -                    uiStatue = instance->GetData64(DATA_MOORABI_STATUE); +                case GO_MOORABI_ALTAR: +                    statueGUID = instance->GetData64(DATA_MOORABI_STATUE);                      break; -                case 192520: -                    uiStatue = instance->GetData64(DATA_DRAKKARI_COLOSSUS_STATUE); +                case GO_DRAKKARI_COLOSSUS_ALTAR: +                    statueGUID = instance->GetData64(DATA_DRAKKARI_COLOSSUS_STATUE);                      break;              }              if (!instance->GetData64(DATA_STATUE_ACTIVATE))              { -                instance->SetData64(DATA_STATUE_ACTIVATE, uiStatue); +                instance->SetData64(DATA_STATUE_ACTIVATE, statueGUID);                  go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);                  go->SetGoState(GO_STATE_ACTIVE);              } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 97a70f43c27..259f2c28300 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -1013,8 +1013,11 @@ class npc_dream_portal : public CreatureScript              {              } -            void OnSpellClick(Unit* /*clicker*/) +            void OnSpellClick(Unit* /*clicker*/, bool& result)              { +                if (!result) +                    return; +                  _used = true;                  me->DespawnOrUnsummon();              } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp index 6ad70d38635..b3f5cc38c9f 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_assembly_of_iron.cpp @@ -122,9 +122,11 @@ enum AssemblyYells      EMOTE_BRUNDIR_OVERLOAD                      = 7  }; -enum AssemblyNPCs +enum Misc  { -    NPC_WORLD_TRIGGER                            = 22515 +    NPC_WORLD_TRIGGER                            = 22515, + +    DATA_PHASE_3                                 = 1  };  #define FLOOR_Z                                  427.28f @@ -158,6 +160,14 @@ class boss_steelbreaker : public CreatureScript                  events.ScheduleEvent(EVENT_FUSION_PUNCH, 15000);              } +            uint32 GetData(uint32 type) const +            { +                if (type == DATA_PHASE_3) +                    return (phase >= 3) ? 1 : 0; + +                return 0; +            } +              void DoAction(int32 action)              {                  switch (action) @@ -184,7 +194,7 @@ class boss_steelbreaker : public CreatureScript                  if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == DONE)                  { -                    DoCastAOE(SPELL_KILL_CREDIT); +                    DoCastAOE(SPELL_KILL_CREDIT, true);                      Talk(SAY_STEELBREAKER_ENCOUNTER_DEFEATED);                  }                  else @@ -287,6 +297,14 @@ class boss_runemaster_molgeim : public CreatureScript                  events.ScheduleEvent(EVENT_RUNE_OF_POWER, 20000);              } +            uint32 GetData(uint32 type) const +            { +                if (type == DATA_PHASE_3) +                    return (phase >= 3) ? 1 : 0; + +                return 0; +            } +              void DoAction(int32 action)              {                  switch (action) @@ -313,7 +331,7 @@ class boss_runemaster_molgeim : public CreatureScript                  if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == DONE)                  { -                    DoCastAOE(SPELL_KILL_CREDIT); +                    DoCastAOE(SPELL_KILL_CREDIT, true);                      Talk(SAY_MOLGEIM_ENCOUNTER_DEFEATED);                  }                  else @@ -429,6 +447,14 @@ class boss_stormcaller_brundir : public CreatureScript                  me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, false);       // Reset immumity, Brundir should be stunnable by default              } +            uint32 GetData(uint32 type) const +            { +                if (type == DATA_PHASE_3) +                    return (phase >= 3) ? 1 : 0; + +                return 0; +            } +              void EnterCombat(Unit* /*who*/)              {                  _EnterCombat(); @@ -470,7 +496,7 @@ class boss_stormcaller_brundir : public CreatureScript                  if (instance->GetBossState(BOSS_ASSEMBLY_OF_IRON) == DONE)                  { -                    DoCastAOE(SPELL_KILL_CREDIT); +                    DoCastAOE(SPELL_KILL_CREDIT, true);                      Talk(SAY_BRUNDIR_ENCOUNTER_DEFEATED);                  }                  else @@ -697,6 +723,17 @@ class spell_assembly_rune_of_summoning : public SpellScriptLoader          }  }; +class achievement_assembly_i_choose_you : public AchievementCriteriaScript +{ +    public: +        achievement_assembly_i_choose_you() : AchievementCriteriaScript("achievement_assembly_i_choose_you") { } + +        bool OnCheck(Player* /*player*/, Unit* target) +        { +            return target && target->GetAI()->GetData(DATA_PHASE_3); +        } +}; +  void AddSC_boss_assembly_of_iron()  {      new boss_steelbreaker(); @@ -705,4 +742,5 @@ void AddSC_boss_assembly_of_iron()      new spell_shield_of_runes();      new spell_assembly_meltdown();      new spell_assembly_rune_of_summoning(); +    new achievement_assembly_i_choose_you();  } 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 f89112e3d67..37ecf7874b8 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -709,8 +709,11 @@ class boss_flame_leviathan_overload_device : public CreatureScript              {              } -            void OnSpellClick(Unit* /*clicker*/) +            void OnSpellClick(Unit* /*clicker*/, bool& result)              { +                if (!result) +                    return; +                  if (me->GetVehicle())                  {                      me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 105b4757066..97554a63217 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -1421,8 +1421,10 @@ class npc_descend_into_madness : public CreatureScript          {              npc_descend_into_madnessAI(Creature* creature) : PassiveAI(creature), _instance(creature->GetInstanceScript()) { } -            void OnSpellClick(Unit* clicker) +            void OnSpellClick(Unit* clicker, bool& result)              { +                if (!result) +                    return;                  clicker->RemoveAurasDueToSpell(SPELL_BRAIN_LINK);                  me->DespawnOrUnsummon();              } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 3036c52876d..4cc464af9ab 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1640,6 +1640,37 @@ class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public S          }  }; +class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader +{ +    public: +        spell_q12847_summon_soul_moveto_bunny() : SpellScriptLoader("spell_q12847_summon_soul_moveto_bunny") { } + +        class spell_q12847_summon_soul_moveto_bunny_SpellScript : public SpellScript +        { +            PrepareSpellScript(spell_q12847_summon_soul_moveto_bunny_SpellScript); + +            void ChangeSummonPos(SpellEffIndex /*effIndex*/) +            { +                // Adjust effect summon position +                WorldLocation summonPos = *GetExplTargetDest(); +                Position offset = { 0.0f, 0.0f, 2.5f, 0.0f }; +                summonPos.RelocateOffset(offset); +                SetExplTargetDest(summonPos); +                GetHitDest()->RelocateOffset(offset); +            } + +            void Register() +            { +                OnEffectHit += SpellEffectFn(spell_q12847_summon_soul_moveto_bunny_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); +            } +        }; + +        SpellScript *GetSpellScript() const +        { +            return new spell_q12847_summon_soul_moveto_bunny_SpellScript(); +        } +}; +  void AddSC_quest_spell_scripts()  {      new spell_q55_sacred_cleansing(); @@ -1680,4 +1711,5 @@ void AddSC_quest_spell_scripts()      new spell_q12527_zuldrak_rat();      new spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy();      new spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon(); +    new spell_q12847_summon_soul_moveto_bunny();  } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index fce78638414..446f89aef4f 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -45,12 +45,12 @@ void CharacterDatabaseConnection::DoPrepareStatements()      PrepareStatement(CHAR_SEL_ENUM, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, c.position_x, c.position_y, c.position_z, "                       "gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, cb.guid "                       "FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? LEFT JOIN guild_member AS gm ON c.guid = gm.guid " -                     "LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); +                     "LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? AND c.deleteInfos_Name IS NULL ORDER BY c.guid", CONNECTION_ASYNC);      PrepareStatement(CHAR_SEL_ENUM_DECLINED_NAME, "SELECT c.guid, c.name, c.race, c.class, c.gender, c.playerBytes, c.playerBytes2, c.level, c.zone, c.map, "                       "c.position_x, c.position_y, c.position_z, gm.guildid, c.playerFlags, c.at_login, cp.entry, cp.modelid, cp.level, c.equipmentCache, "                       "cb.guid, cd.genitive FROM characters AS c LEFT JOIN character_pet AS cp ON c.guid = cp.owner AND cp.slot = ? "                       "LEFT JOIN character_declinedname AS cd ON c.guid = cd.guid LEFT JOIN guild_member AS gm ON c.guid = gm.guid " -                     "LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ? ORDER BY c.guid", CONNECTION_ASYNC); +                     "LEFT JOIN character_banned AS cb ON c.guid = cb.guid AND cb.active = 1 WHERE c.account = ?  AND c.deleteInfos_Name IS NULL ORDER BY c.guid", CONNECTION_ASYNC);      PrepareStatement(CHAR_SEL_FREE_NAME, "SELECT guid, name FROM characters WHERE guid = ? AND account = ? AND (at_login & ?) = ? AND NOT EXISTS (SELECT NULL FROM characters WHERE name = ?)", CONNECTION_ASYNC);      PrepareStatement(CHAR_SEL_GUID_RACE_ACC_BY_NAME, "SELECT guid, race, account FROM characters WHERE name = ?", CONNECTION_BOTH);      PrepareStatement(CHAR_SEL_CHAR_RACE, "SELECT race FROM characters WHERE guid = ?", CONNECTION_SYNCH); | 
