diff options
47 files changed, 884 insertions, 306 deletions
diff --git a/dep/g3dlite/G3D-v8.0_hotfix7.diff b/dep/g3dlite/G3D-v8.0_hotfix7.diff new file mode 100644 index 00000000000..00ab78f5c7c --- /dev/null +++ b/dep/g3dlite/G3D-v8.0_hotfix7.diff @@ -0,0 +1,13 @@ +diff --git a/dep/g3dlite/source/Matrix4.cpp b/dep/g3dlite/source/Matrix4.cpp +index 2ce14f6..fbc918f 100644 +--- a/dep/g3dlite/source/Matrix4.cpp ++++ b/dep/g3dlite/source/Matrix4.cpp +@@ -382,7 +382,7 @@ bool Matrix4::operator==(const Matrix4& other) const { + // If the bit patterns are identical, they must be + // the same matrix. If not, they *might* still have + // equal elements due to floating point weirdness. +- if (memcmp(this, &other, sizeof(Matrix4) == 0)) { ++ if (memcmp(this, &other, sizeof(Matrix4)) == 0) { + return true; + } + diff --git a/dep/g3dlite/G3D-v8.0_hotfix8.diff b/dep/g3dlite/G3D-v8.0_hotfix8.diff new file mode 100644 index 00000000000..438fd95f77c --- /dev/null +++ b/dep/g3dlite/G3D-v8.0_hotfix8.diff @@ -0,0 +1,13 @@ +diff --git a/dep/g3dlite/include/G3D/Vector3int32.h b/dep/g3dlite/include/G3D/Vector3int32.h +index 2f256ea..c1a6b21 100644 +--- a/dep/g3dlite/include/G3D/Vector3int32.h ++++ b/dep/g3dlite/include/G3D/Vector3int32.h +@@ -74,7 +74,7 @@ public: + inline Vector3int32& operator+=(const Vector3int32& other) { + x += other.x; + y += other.y; +- z += other.y; ++ z += other.z; + return *this; + } + diff --git a/dep/g3dlite/Readme.txt b/dep/g3dlite/Readme.txt index 055574ee654..7988d1f314e 100644 --- a/dep/g3dlite/Readme.txt +++ b/dep/g3dlite/Readme.txt @@ -6,3 +6,6 @@ G3D-v8.0_hotfix2.diff - 2012-01-14 - fix typo in isNaN(float x) G3D-v8.0_hotfix3.diff - 2012-08-26 - fix compilation on Fedora Linux G3D-v8.0_hotfix4.diff - 2012-11-09 - fix compilation on OSX G3D-v8.0_hotfix5.diff - 2013-02-27 - fix compilation in cygwin environments +G3D-v8.0_hotfix6.diff - 2013-03-08 - fix compilation in mingw +G3D-v8.0_hotfix7.diff - 2013-08-31 - fix typo in Matrix4 == operator +G3D-v8.0_hotfix8.diff - 2013-09-01 - fix typo in Vector3int32 += operator diff --git a/dep/g3dlite/include/G3D/Vector3int32.h b/dep/g3dlite/include/G3D/Vector3int32.h index 2f256ea0300..c1a6b21e100 100644 --- a/dep/g3dlite/include/G3D/Vector3int32.h +++ b/dep/g3dlite/include/G3D/Vector3int32.h @@ -74,7 +74,7 @@ public: inline Vector3int32& operator+=(const Vector3int32& other) { x += other.x; y += other.y; - z += other.y; + z += other.z; return *this; } diff --git a/dep/g3dlite/source/Matrix4.cpp b/dep/g3dlite/source/Matrix4.cpp index 2ce14f6c5d4..fbc918f8f3e 100644 --- a/dep/g3dlite/source/Matrix4.cpp +++ b/dep/g3dlite/source/Matrix4.cpp @@ -382,7 +382,7 @@ bool Matrix4::operator==(const Matrix4& other) const { // If the bit patterns are identical, they must be // the same matrix. If not, they *might* still have // equal elements due to floating point weirdness. - if (memcmp(this, &other, sizeof(Matrix4) == 0)) { + if (memcmp(this, &other, sizeof(Matrix4)) == 0) { return true; } diff --git a/sql/updates/auth/2013_08_30_04_auth_misc.sql b/sql/updates/auth/2013_08_30_04_auth_misc.sql new file mode 100644 index 00000000000..422f0f38c50 --- /dev/null +++ b/sql/updates/auth/2013_08_30_04_auth_misc.sql @@ -0,0 +1,24 @@ +/* cs_bf.cpp */ + +SET @id = 257; + +-- Add new permissions +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+5; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(@id+0, 'bf'), +(@id+1, 'bf start'), +(@id+2, 'bf stop'), +(@id+3, 'bf switch'), +(@id+4, 'bf timer'), +(@id+5, 'bf enabled'); + +-- Add permissions to "corresponding Commands Role" +DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+5; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(4, @id+0), +(4, @id+1), +(4, @id+2), +(4, @id+3), +(4, @id+4), +(4, @id+5); + diff --git a/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql b/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql index 3e6ed052f34..69223384be1 100644 --- a/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql +++ b/sql/updates/world/2013_08_30_00_world_gameobject_loot_template.sql @@ -1 +1 @@ -UPDATE `gameobject_loot_template` SET `item`=33700 WHERE `entry`=24157 AND `item`=37703; +UPDATE `gameobject_loot_template` SET `item`=37700 /* 33700 */ WHERE `entry`=24157 AND `item`=37703; diff --git a/sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql b/sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..85f033443bf --- /dev/null +++ b/sql/updates/world/2013_08_31_01_world_gameobject_loot_template.sql @@ -0,0 +1 @@ +UPDATE `gameobject_loot_template` SET `item`=37700 WHERE `entry`=24157 AND `item`=33700; diff --git a/sql/updates/world/2013_08_31_02_world_sai.sql b/sql/updates/world/2013_08_31_02_world_sai.sql new file mode 100644 index 00000000000..9a34b6fcf99 --- /dev/null +++ b/sql/updates/world/2013_08_31_02_world_sai.sql @@ -0,0 +1,83 @@ +-- The Lost Mistwhisper Treasure (12575) +SET @TARTEK := 28105; +SET @ZEPTEK := 28399; +SET @HC_RIDE := 46598; +SET @TRIGGER := 5030; +SET @SPEARBORNBUNNY := 28457; +-- REF 6710.741, 5154.322, -19.3981 +-- REF 6712.461, 5136.462, -19.3981 + +-- Propper phasing +DELETE FROM `spell_area` WHERE `spell` = 52217; +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(52217, 4306, 12574, 0, 0, 0, 2, 1, 74, 64), +(52217, 4308, 12574, 0, 0, 0, 2, 1, 74, 64); + +-- Needs one waypoint for passenger removal +DELETE FROM `waypoints` WHERE `entry`=@ZEPTEK; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@ZEPTEK, 1, 6712.461, 5136.462, -19.3981, 'Zeptek the Destroyer'); + +-- Criteria linked with involved relation +DELETE FROM `areatrigger_involvedrelation` WHERE `id` = @TRIGGER; +INSERT INTO `areatrigger_involvedrelation` (`id`,`quest`) VALUES +(@TRIGGER,12575); + +DELETE FROM `areatrigger_scripts` WHERE `entry` = @TRIGGER; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(@TRIGGER,'SmartTrigger'); + +DELETE FROM `smart_scripts` WHERE `entryorguid` =@TRIGGER AND `source_type`=2; +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 +(@TRIGGER,2,0,0,46,0,100,0,@TRIGGER,0,0,0,45,1,1,0,0,0,0,10,99764,@SPEARBORNBUNNY,0,0,0,0,0,"On Trigger - Set Data"); + +DELETE FROM `smart_scripts` WHERE `entryorguid` =@SPEARBORNBUNNY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@SPEARBORNBUNNY,0,0,0,10,0,100,0,1,200,10000,10000,11,51642,2,0,0,0,0,7,0,0,0,0,0,0,0,'Spearborn Encampment Bunny - On update OOC - Spellcast Spearborn Encampment Aura'), +(@SPEARBORNBUNNY,0,1,2,38,0,100,0,1,1,300000,300000,45,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Spearborn Encampment Bunny - On Data Set - Set Data'), +(@SPEARBORNBUNNY,0,2,0,61,0,100,0,0,0,0,0,12,@TARTEK,1,300000,0,0,0,8,0,0,0,6709.02, 5169.21, -20.8878, 4.91029, 'Spearborn Encampment Bunny - Linked with Previous Event - Spawn Warlord Tartek'); + +DELETE FROM `creature` WHERE `id`=@TARTEK; +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@TARTEK; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` =@TARTEK; +DELETE FROM `smart_scripts` WHERE `entryorguid` =@TARTEK; +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 +(@TARTEK,0,0,1,11,0,100,0,0,0,0,0,2,2061,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Spawn - Set Faction'), +(@TARTEK,0,1,2,61,0,100,0,0,0,0,0,18,756,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Set Unattackable Flags'), +(@TARTEK,0,2,3,61,0,100,0,0,0,0,0,12,@ZEPTEK,1,100000,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Summon Zeptek'), +(@TARTEK,0,3,4,61,0,100,0,0,0,0,0,11,@HC_RIDE,2,0,0,0,0,11,@ZEPTEK,10,0,0,0,0,0,'Warlord Tartek - On Link - Ride Zeptek'), +(@TARTEK,0,4,5,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Say 0'), +(@TARTEK,0,5,0,4,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Aggro - Say 1'), +(@TARTEK,0,6,0,8,0,100,0,@HC_RIDE,0,0,0,19,756,0,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - On Data set - Remove Unattackable Flags'), +-- Combat +(@TARTEK,0,7,0,9,0,100,0,5000,8000,5000,8000,11,29426,2,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - IC - Cast Heroic Strike'), +(@TARTEK,0,8,0,0,0,100,0,5000,15000,5000,15000,11,35429,2,0,0,0,0,1,0,0,0,0,0,0,0,'Warlord Tartek - IC - Cast Sweeping Strikes'), +(@TARTEK,0,9,0,0,0,100,0,6000,15000,6000,15000,11,15572,2,0,0,0,0,2,0,0,0,0,0,0,0,'Warlord Tartek - IC - Cast Sunder Armor'), +-- Credit +(@TARTEK,0,10,11,6,0,100,0,0,0,0,0,45,1,1,0,0,0,0,9,28121,0,50,0,0,0,0, 'Warlord Tartek - On Death - Set Data Jaloot'), -- If spawned by player, will say text. +(@TARTEK,0,11,0,61,0,100,0,0,0,0,0,15,12575,0,0,0,0,0,7,0,0,0,0,0,0,0,'Warlord Tartek - On Link - Call area explored or event happens'); + +UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry`=@ZEPTEK; +DELETE FROM `creature_ai_scripts` WHERE `creature_id` =@ZEPTEK; +DELETE FROM `smart_scripts` WHERE `entryorguid` =@ZEPTEK; +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 +(@ZEPTEK,0,0,1,11,0,100,0,0,0,0,0,2,2061,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - On Spawn - Set Faction'), +(@ZEPTEK,0,1,0,61,0,100,0,0,0,0,0,53,1,@ZEPTEK,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - On Link - Start WP'), +(@ZEPTEK,0,2,3,40,0,100,0,1,0,0,0,11,@HC_RIDE,0,0,0,0,0,11,@TARTEK,20,0,0,0,0,0,'Zeptik The Destroyer - ON WP reached - Dismount Tartek'), +(@ZEPTEK,0,3,4,61,0,100,0,0,0,0,0,8,2,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - OnLink - Summon New Zeptek'), +(@ZEPTEK,0,4,0,61,0,100,0,0,0,0,0,28,@HC_RIDE,0,0,0,0,0,1,0,0,0,0,0,0,0,'Zeptik The Destroyer - On LInk - Attack Closest Player'); + +DELETE FROM `creature_equip_template` WHERE `entry` =@TARTEK; +INSERT INTO `creature_equip_template` (`entry`, `id`, `itemEntry1`, `itemEntry2`, `itemEntry3`) VALUES +(@TARTEK, 1, 5305, 0, 0); + +DELETE FROM `creature_text` WHERE `entry` =@TARTEK; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(@TARTEK, 0, 0, 'My treasure! You no steal from Tartek, dumb big-tongue traitor thing.', 14, 0, 100, 0, 0, 0, 'Warlord Tartek'), +(@TARTEK, 1, 0, 'Tartek and nasty dragon going to kill you! You so dumb.', 14, 0, 100, 0, 0, 0, 'Warlord Tartek'); +-- Needs special flags 2 for external event +UPDATE `quest_template` SET `SpecialFlags`=2 WHERE `Id`=12575; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=@TRIGGER AND `SourceId`=2; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,1,@TRIGGER,2,0,9,0,12575,0,0,0,0,'','Trigger only activates if player is on the Lost Mistwhisper Treasure'); diff --git a/sql/updates/world/2013_08_31_03_world_creature_text.sql b/sql/updates/world/2013_08_31_03_world_creature_text.sql new file mode 100644 index 00000000000..ca8133784d1 --- /dev/null +++ b/sql/updates/world/2013_08_31_03_world_creature_text.sql @@ -0,0 +1,10 @@ +DELETE FROM `creature_text` WHERE `entry`=24480; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(24480, 0, 0, 'I thought you''d never ask!', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 1, 'I promise not to give you warts...', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 2, 'This won''t take long, did it?', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 3, 'Now that''s what I call froggy-style!', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 4, 'Listen, $n, I know of a little swamp not too far from here....', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 5, 'Your lily pad or mine?', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 6, 'Feelin'' a little froggy, are ya?', 15, 0, 100, 0, 0, 0, 'Mojo'), +(24480, 0, 7, 'There''s just never enough Mojo to go around...', 15, 0, 100, 0, 0, 0, 'Mojo'); diff --git a/sql/updates/world/2013_08_31_04_world_spell_script_names.sql b/sql/updates/world/2013_08_31_04_world_spell_script_names.sql new file mode 100644 index 00000000000..a1f71f3c870 --- /dev/null +++ b/sql/updates/world/2013_08_31_04_world_spell_script_names.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=51858; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(51858, 'spell_q12641_death_comes_from_on_high'); diff --git a/sql/updates/world/2013_08_31_05_world_creature_template.sql b/sql/updates/world/2013_08_31_05_world_creature_template.sql new file mode 100644 index 00000000000..8bd02b1de1a --- /dev/null +++ b/sql/updates/world/2013_08_31_05_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_pet_gen_mojo' WHERE `ScriptName`='npc_mojo'; diff --git a/sql/updates/world/2013_08_31_06_world_smart_scripts.sql b/sql/updates/world/2013_08_31_06_world_smart_scripts.sql new file mode 100644 index 00000000000..9376bb62951 --- /dev/null +++ b/sql/updates/world/2013_08_31_06_world_smart_scripts.sql @@ -0,0 +1,10 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18110,18142,18143,18144) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18110, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1811000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18110, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18110, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18142, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814200, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18142, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18142, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18143, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18143, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18143, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'), +(18144, 0, 0, 1, 8, 0, 100, 1, 31927, 0, 0, 0, 80, 1814400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit - Run Script'), +(18144, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 18144, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Windyreed Quest Credit - On Spellhit (Link) - Quest Credit'); diff --git a/sql/updates/world/2013_08_31_07_world_creature.sql b/sql/updates/world/2013_08_31_07_world_creature.sql new file mode 100644 index 00000000000..04f844d68c0 --- /dev/null +++ b/sql/updates/world/2013_08_31_07_world_creature.sql @@ -0,0 +1,26 @@ +UPDATE `creature` SET + `position_x`=1814.592, + `position_y`=-5988.646, + `position_z`=125.4968, + `orientation`=3.228859 +WHERE `id`=28525; + +UPDATE `creature` SET + `position_x`=1590.806, + `position_y`=-5731.661, + `position_z`=143.8694, + `orientation`=0.9075712 +WHERE `id`=28543; + +UPDATE `creature` SET + `position_x`= 1651.211, + `position_y`=-5994.667, + `position_z`=133.5836 +WHERE `id`=28542; + +UPDATE `creature` SET `position_x`= 1385.928, + `position_x`=1385.928, + `position_y`= -5702.061, + `position_z`= 146.3048, + `orientation`=4.153883 +WHERE `id`=28544; diff --git a/sql/updates/world/2013_08_31_08_world_command.sql b/sql/updates/world/2013_08_31_08_world_command.sql new file mode 100644 index 00000000000..c48180f36b5 --- /dev/null +++ b/sql/updates/world/2013_08_31_08_world_command.sql @@ -0,0 +1,12 @@ +/* cs_bf.cpp */ + +SET @id = 257; + +-- Update command table with new RBAC permissions +UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'bf'; +UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'bf start'; +UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'bf stop'; +UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'bf switch'; +UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'bf timer'; +UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'bf enabled'; + diff --git a/sql/updates/world/2013_09_01_00_world_spell_script_names.sql b/sql/updates/world/2013_09_01_00_world_spell_script_names.sql new file mode 100644 index 00000000000..7d8dda4dba9 --- /dev/null +++ b/sql/updates/world/2013_09_01_00_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN (63276,63278); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(63276,'spell_general_vezax_mark_of_the_faceless'), +(63278,'spell_general_vezax_mark_of_the_faceless_leech'); diff --git a/sql/updates/world/2013_09_01_01_world_trinity_string.sql b/sql/updates/world/2013_09_01_01_world_trinity_string.sql new file mode 100644 index 00000000000..541a2674f96 --- /dev/null +++ b/sql/updates/world/2013_09_01_01_world_trinity_string.sql @@ -0,0 +1,23 @@ +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, 871); +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(453,'│Player %s %s (guid: %u)'), +(548,'│ GM Mode active, Phase: -1'), +(549,'├─ Banned: (Type: %s, Reason: %s, Time: %s, By: %s)'), +(550,'├─ Muted: (Reason: %s, Time: %s, By: %s)'), +(714,'│ Account: %s (ID: %u), GMLevel: %u'), +(716,'│ Last Login: %s (Failed Logins: %u)'), +(749,'│ OS: %s - Latency: %u ms - Mail: %s'), +(752,'│ Last IP: %s (Locked: %s)'), +(843,'│ Level: %u (%u/%u XP (%u XP left))'), +(844,'│ Race: %s %s, %s'), +(845,'│ Alive ?: %s'), +(846,'│ Phase: %u'), +(847,'│ Money: %ug%us%uc'), +(848,'│ Map: %s, Area: %s, Zone: %s'), +(849,'│ Guild: %s (ID: %u)'), +(850,'├─ Rank: %s'), +(851,'├─ Note: %s'), +(852,'├─ O. Note: %s'), +(853,'│ Played time: %s'), +(854,'└ Mails: %d Read/%u Total'), +(871,'│ Level: %u'); diff --git a/sql/updates/world/2013_09_01_02_world_smart_scripts.sql b/sql/updates/world/2013_09_01_02_world_smart_scripts.sql new file mode 100644 index 00000000000..ef165c6f96e --- /dev/null +++ b/sql/updates/world/2013_09_01_02_world_smart_scripts.sql @@ -0,0 +1,8 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (25510,25511,25512,25513); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (25510,25511,25512,25513) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(25510, 0, 0, 0, 8, 0, 100, 1, 45692, 0, 0, 0, 33, 25510, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '1st Kvaldir Vessel (The Serpent''s Maw) - On Spellhit "Use Tuskarr Torch" - Give Quest Credit'), +(25511, 0, 0, 0, 8, 0, 100, 1, 45692, 0, 0, 0, 33, 25511, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '2nd Kvaldir Vessel (The Kur Drakkar) - On Spellhit "Use Tuskarr Torch" - Give Quest Credit'), +(25512, 0, 0, 0, 8, 0, 100, 1, 45692, 0, 0, 0, 33, 25512, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '3rd Kvaldir Vessel (Bor''s Hammer) - On Spellhit "Use Tuskarr Torch" - Give Quest Credit'), +(25513, 0, 0, 0, 8, 0, 100, 1, 45692, 0, 0, 0, 33, 25513, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, '4th Kvaldir Vessel (Bor''s Anvil) - On Spellhit "Use Tuskarr Torch" - Give Quest Credit'); diff --git a/sql/updates/world/2013_09_01_03_world_smart_scripts.sql b/sql/updates/world/2013_09_01_03_world_smart_scripts.sql new file mode 100644 index 00000000000..3e99f43aa33 --- /dev/null +++ b/sql/updates/world/2013_09_01_03_world_smart_scripts.sql @@ -0,0 +1,7 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (19866,19867,19868); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (19866,19867,19868) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19866, 0, 0, 0, 8, 0, 100, 1, 34646, 0, 0, 0, 33, 19866, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Invis East KV Rune - On Spellhit "Activate Kirin''Var Rune" - Give Quest Credit'), +(19867, 0, 0, 0, 8, 0, 100, 1, 34646, 0, 0, 0, 33, 19867, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Invis NE KV Rune - On Spellhit "Activate Kirin''Var Rune" - Give Quest Credit'), +(19868, 0, 0, 0, 8, 0, 100, 1, 34646, 0, 0, 0, 33, 19868, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Invis West KV Rune - On Spellhit "Activate Kirin''Var Rune" - Give Quest Credit'); diff --git a/sql/updates/world/2013_09_01_04_world_smart_scripts.sql b/sql/updates/world/2013_09_01_04_world_smart_scripts.sql new file mode 100644 index 00000000000..9966f9d7812 --- /dev/null +++ b/sql/updates/world/2013_09_01_04_world_smart_scripts.sql @@ -0,0 +1,6 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (19723,19724) AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19723, 0, 0, 1, 8, 0, 100, 1, 34526, 0, 0, 0, 80, 1972300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invis BE Ballista - On Spellhit - Run Script'), +(19723, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 19723, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Invis BE Ballista - On Spellhit (Link) - Quest Credit'), +(19724, 0, 0, 1, 8, 0, 100, 1, 34526, 0, 0, 0, 80, 1972400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invis BE Tent - On Spellhit - Run Script'), +(19724, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 33, 19724, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Invis BE Tent - On Spellhit (Link) - Quest Credit'); diff --git a/sql/updates/world/2013_09_01_05_world_skinning_loot_template.sql b/sql/updates/world/2013_09_01_05_world_skinning_loot_template.sql new file mode 100644 index 00000000000..b9d4810bedb --- /dev/null +++ b/sql/updates/world/2013_09_01_05_world_skinning_loot_template.sql @@ -0,0 +1,201 @@ +-- -------------------------------------------------------------------------------------- +-- -- Skinning Loot Revamp by ZxBiohazardZx +-- -------------------------------------------------------------------------------------- +SET @var := 100000; -- Set this to the reference value, gap is 10 minimum, more ofc later (10<00X>)? +-- Delete old junk that isnt needed & assign new template to those creatures: +UPDATE `creature_template` SET `skinloot`=0 WHERE `entry`=534; +DELETE FROM `skinning_loot_template` WHERE `entry`=534; +UPDATE `creature_template` SET `skinloot`=@var WHERE `skinloot` IN (721,883,890,2098,2442,2620,4166,5951,17467,10780,12296,12297,12298); +DELETE FROM `skinning_loot_template` WHERE `entry` IN(721,883,890,2098,2442,2620,4166,5951,17467,10780,12296,12297,12298); +-- Var+1 +UPDATE `creature_template` SET `skinloot`=@var+1 WHERE `skinloot`=100007; +DELETE FROM `skinning_loot_template` WHERE `entry`=100007; +-- Var+2 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+2 WHERE `skinloot` IN ( + 113, 118, 119, 330, 390, 524, 525, 822, 834,1125,1126,1127,1128,1131,1132,1133,1134,1135, +1137,1138,1190,1196,1199,1201,1547,1548,1549,1553,1554,1689,1765,1922,2033,2034,2042,2043, +2070,2175,2956,2957,2958,2959,2960,2972,2973,3035,3068,3099,3100,3110,3121,3122,3123,3125, +3126,3127,3130,3131,3225,3226,3227,3566,5807,6789,10105,10356,14430,15650,15651,15652, +16347,16353,17199,17200,17202,17203,17345,17372,17373); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( + 113, 118, 119, 330, 390, 524, 525, 822, 834,1125,1126,1127,1128,1131,1132,1133,1134,1135, +1137,1138,1190,1196,1199,1201,1547,1548,1549,1553,1554,1689,1765,1922,2033,2034,2042,2043, +2070,2175,2956,2957,2958,2959,2960,2972,2973,3035,3068,3099,3100,3110,3121,3122,3123,3125, +3126,3127,3130,3131,3225,3226,3227,3566,5807,6789,10105,10356,14430,15650,15651,15652, +16347,16353,17199,17200,17202,17203,17345,17372,17373); +-- Var+3 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+3 WHERE `skinloot` IN ( + 157, 454, 833,1130,1186,1188,1191,1271,1388,1693,1766,1769,1770,1778,1779,1782,1797,1892, +1893,1896,1924,1961,1972,2069,2163,2164,2185,2321,2322,2974,3056,3058,3231,3234,3241,3242, +3243,3244,3246,3248,3254,3255,3415,3425,3461,3531,4127,4316,5829,5865,12431,12432,16348, +16354,17347,17525,17556); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( + 157, 454, 833,1130,1186,1188,1191,1271,1388,1693,1766,1769,1770,1778,1779,1782,1797,1892, +1893,1896,1924,1961,1972,2069,2163,2164,2185,2321,2322,2974,3056,3058,3231,3234,3241,3242, +3243,3244,3246,3248,3254,3255,3415,3425,3461,3531,4127,4316,5829,5865,12431,12432,16348, +16354,17347,17525,17556); +-- Var+4 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+4 WHERE `skinloot` IN ( + 213, 547, 565,1189,1192,1224,2071,2165,2172,2187,2237,2323,3236,3240,3245,3247,3256,3257, +3398,3416,3424,3426,3463,3466,3475,3721,3816,3823,4008,4009,4011,4129,5053,6788,10644,16349, +16355,17348,17527,17588,17589); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( + 213, 547, 565,1189,1192,1224,2071,2165,2172,2187,2237,2323,3236,3240,3245,3247,3256,3257, +3398,3416,3424,3426,3463,3466,3475,3721,3816,3823,4008,4009,4011,4129,5053,6788,10644,16349, +16355,17348,17527,17588,17589); +-- Var+5 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+5 WHERE `skinloot` IN ( + 335, 345, 521, 628, 819, 923,1015,1016,1017,1020,1021,1022,1258,1400,1417,1923,2089,2275, +2351,2354,2356,2384,2476,2529,3235,3237,3238,3239,3249,3250,3252,3472,3473,3474,3774,3809, +3810,3817,3824,4012,4013,4014,4015,4016,4018,4019,4031,4032,4042,4044,4067,4117,4126,4126, +4128,4250,5835,12678,12723,12940); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( + 335, 345, 521, 628, 819, 923,1015,1016,1017,1020,1021,1022,1258,1400,1417,1923,2089,2275, +2351,2354,2356,2384,2476,2529,3235,3237,3238,3239,3249,3250,3252,3472,3473,3474,3774,3809, +3810,3817,3824,4012,4013,4014,4015,4016,4018,4019,4031,4032,4042,4044,4067,4117,4126,4126, +4128,4250,5835,12678,12723,12940); +-- Var+6 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+6 WHERE `skinloot` IN (1225,3653,3851,3853,3854,3855,3861,3862,3864,3865,3914,5058); +DELETE FROM `skinning_loot_template` WHERE `entry` IN (1225,3653,3851,3853,3854,3855,3861,3862,3864,3865,3914,5058); +-- Var+7 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+7 WHERE `skinloot` IN (3857,3859,3866,3868,3886,4279,4511,4514,4824,4827,4887,14357); +DELETE FROM `skinning_loot_template` WHERE `entry` IN (3857,3859,3866,3868,3886,4279,4511,4514,4824,4827,4887,14357); +-- Var+8 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+8 WHERE `skinloot` IN (1042,1043,1069); +DELETE FROM `skinning_loot_template` WHERE `entry` IN (1042,1043,1069); +-- Var+9 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+9 WHERE `skinloot` IN (3630,3631,3632,3633,3634,3636,3637,3641,5048,5056,5755,5756,5762,8886,20797); +DELETE FROM `skinning_loot_template` WHERE `entry` IN (3630,3631,3632,3633,3634,3636,3637,3641,5048,5056,5755,5756,5762,8886,20797); +-- Var+10 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+10 WHERE `skinloot` IN ( + 205, 206, 533, 681, 683, 855, 898, 920,1018,1019,1023,1150,1353,2248,2385,2408,2559,3476, +3789,3791,3811,3815,3818,3825,4017,4041,4107,4109,4110,4118,4119,4124,4142,4147,4248,4249,4548, +4688,5827,6071,6167,10116,10882,12677); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( + 205, 206, 533, 681, 683, 855, 898, 920,1018,1019,1023,1150,1353,2248,2385,2408,2559,3476, +3789,3791,3811,3815,3818,3825,4017,4041,4107,4109,4110,4118,4119,4124,4142,4147,4248,4249,4548, +4688,5827,6071,6167,10116,10882,12677); +-- Var+11 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+11 WHERE `skinloot` IN ( + 507, 682, 685, 686, 688, 689, 736, 856,1084,1085,1108,1151,1152,2249,2250,2251,2406, +2407,2560,2727,4139,4140,4143,4144,4150,4151,4304,4341,4351,4689,4696,4697,4700,4726, +4728,10131,10992,12676); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( + 507, 682, 685, 686, 688, 689, 736, 856,1084,1085,1108,1151,1152,2249,2250,2251,2406, +2407,2560,2727,4139,4140,4143,4144,4150,4151,4304,4341,4351,4689,4696,4697,4700,4726, +4728,10131,10992,12676); +-- Var+12 +-- -------------------------------------------------------------------------------------- +UPDATE `creature_template` SET `skinloot`=@var+12 WHERE `skinloot` IN ( +3927,4274,4515,4538,4825,4829); +DELETE FROM `skinning_loot_template` WHERE `entry` IN ( +3927,4274,4515,4538,4825,4829); +-- Var+13 +UPDATE `creature_template` SET `skinloot`=@var+13 WHERE `skinloot` IN +(687, 690, 728, 767, 772, 854, 874,1082,1114,1557,2473,2561,2728,2729,2731,2732,4342,4343, +4344,4345,4347,4348,4352,4355,4356,4357,4388,4662,4678,4681,4685,4690,4699,4701,4702,4727, +4729,10136,11785,13602,14227,14232,14233); +DELETE FROM `skinning_loot_template` WHERE `entry` IN +(687, 690, 728, 767, 772, 854, 874,1082,1114,1557,2473,2561,2728,2729,2731,2732,4342,4343, +4344,4345,4347,4348,4352,4355,4356,4357,4388,4662,4678,4681,4685,4690,4699,4701,4702,4727, +4729,10136,11785,13602,14227,14232,14233); + +-- Var+14 +UPDATE `creature_template` SET `skinloot`=@var+14 WHERE `skinloot` IN +( 730,1087,1511,1514,1516,1550,1551,1558,2657,2658,2734,4389,4841,5224,5260,5268,5272,5300, +5304,5305,5307,5308,5419,5420,5425,5426,7268,11786,12741); +DELETE FROM `skinning_loot_template` WHERE `entry` IN +( 730,1087,1511,1514,1516,1550,1551,1558,2657,2658,2734,4389,4841,5224,5260,5268,5272,5300, +5304,5305,5307,5308,5419,5420,5425,5426,7268,11786,12741); + +-- -------------------------------------------------------------------------------------- +-- -- Add the new profiles +-- -------------------------------------------------------------------------------------- +DELETE FROM `skinning_loot_template` WHERE `entry` BETWEEN @var AND @var+15; +INSERT INTO `skinning_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Var (Light Leather) +(@var,2318,90,1,1,1,1), -- Ruined Leather Scraps +(@var,2934,10,1,1,1,1), -- Light Leather +-- Var+1 (Light Leather) -- +(@var+1,2934,80,1,1,1,1), -- Light Leather +(@var+1, 783,20,1,1,1,1), -- Light Hide +-- Var+2 (Light Leather +(@var+2,2934,60,1,1,1,1), -- Ruined Leather Scraps +(@var+2,2318,40,1,1,1,1), -- Light Leather +-- Var+3 (Light Leather) +(@var+3,2318,60,1,1,1,1), -- Light Leather +(@var+3,2934,35,1,1,1,1), -- Ruined Leather Scraps +(@var+3, 783, 5,1,1,1,1), -- Light Hide +-- Var+4 (Light/Medium Leather +(@var+4,2318,72,1,1,1,2), -- Light Leather +(@var+4,2319,20,1,1,1,1), -- Medium Leather +(@var+4, 783, 5,1,1,1,1), -- Light Hide +(@var+4,4232, 3,1,1,1,1), -- Medium Hide +-- Var+5 (Light/Medium Leather +(@var+5,2319,50,1,1,1,1), -- Medium Leather +(@var+5,2318,42,1,1,1,2), -- Light Leather +(@var+5, 783, 5,1,1,1,1), -- Light Hide +(@var+5,4232, 3,1,1,1,1), -- Medium Hide +-- Var+6 (Light/Medium Leather2) +(@var+6,2318,65,1,1,1,2), -- Light Leather +(@var+6,2319,25,1,1,1,2), -- Medium Leather +(@var+6, 783, 7,1,1,1,1), -- Light Hide +(@var+6,4232, 3,1,1,1,1), -- Medium Hide +-- Var+7 (Light/Medium Leather2) +(@var+7,2318,55,1,1,1,2), -- Light Leather +(@var+7,2319,35,1,1,1,2), -- Medium Leather +(@var+7, 783, 7,1,1,1,1), -- Light Hide +(@var+7,4232, 3,1,1,1,1), -- Medium Hide +-- Var+8 (Red Whelp Scale Dragons) +(@var+8,2318,37,1,1,1,2), -- Light Leather +(@var+8,2319,45,1,1,1,1), -- Medium Leather +(@var+8, 783, 3,1,1,1,1), -- Light Hide +(@var+8,4232, 5,1,1,1,1), -- Medium Hide +(@var+8,7287,10,1,1,1,1), -- Red Whelp Scale +-- Var+9 (Deviate Scales) +(@var+9,2318,50,1,1,1,2), -- Light Leather +(@var+9,2319,25,1,1,1,2), -- Medium Leather +(@var+9,6470,10,1,1,1,1), -- Deviate Scale +(@var+9, 783, 7,1,1,1,1), -- Light Hide +(@var+9,6471, 5,1,1,1,1), -- Perfect Deviate Scale +(@var+9,4232, 3,1,1,1,1), -- Medium Hide +-- Var+10 (Medium Leather) +(@var+10,2319,73,1,1,1,1), -- Medium Leather +(@var+10,4234,20,1,1,1,1), -- Heavy Leather +(@var+10,4232, 5,1,1,1,1), -- Medium Hide +(@var+10,4235, 2,1,1,1,1), -- Heavy Hide +-- Var+11 (Medium Leather) +(@var+11,4234,51,1,1,1,1), -- Heavy Leather +(@var+11,2319,42,1,1,1,1), -- Medium Leather +(@var+11,4232, 4,1,1,1,1), -- Medium Hide +(@var+11,4235, 3,1,1,1,1), -- Heavy Hide +-- Var+12 (Medium Leather) +(@var+12,2319,64,1,1,1,2), -- Medium Leather +(@var+12,4234,27,1,1,1,2), -- Heavy Leather +(@var+12,4232, 6,1,1,1,1), -- Medium Hide +(@var+12,4235, 3,1,1,1,1), -- Heavy Hide +-- Var+13 (Heavy Leather) +(@var+13,4234,77,1,1,1,1), -- Heavy Leather +(@var+13,4304,20,1,1,1,1), -- Thick Leather +(@var+13,4235, 3,1,1,1,1), -- Heavy Hide +-- Var+14 (Heavy Leather) +(@var+14,4304,50,1,1,1,1), -- Thick Leather +(@var+14,4234,45,1,1,1,1), -- Heavy Leather +(@var+14,8169, 3,1,1,1,1), -- Thick Hide +(@var+14,4235, 2,1,1,1,1), -- Heavy Hide +-- Var+15 (Green Whelp Scale) +(@var+15,4234,40,1,1,1,1), -- Heavy Leather +(@var+15,2319,33,1,1,1,1), -- Medium Leather +(@var+15,7392,20,1,1,1,1), -- Green Whelp Scale +(@var+15,4232, 4,1,1,1,1), -- Medium Hide +(@var+15,4235, 3,1,1,1,1); -- Heavy Hide diff --git a/sql/updates/world/2013_09_01_06_world_misc.sql b/sql/updates/world/2013_09_01_06_world_misc.sql new file mode 100644 index 00000000000..3d7516ca573 --- /dev/null +++ b/sql/updates/world/2013_09_01_06_world_misc.sql @@ -0,0 +1,6 @@ +DELETE FROM `creature_addon` WHERE `auras` LIKE '%46598%'; -- no need to specify GUID, these are unique +DELETE FROM `creature_addon` WHERE `auras` LIKE '%43671%'; -- no need to specify GUID, these are unique +DELETE FROM `creature_addon` WHERE `guid`=85236; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(85236,0,22471,0,1,0,'63500 64718'); +DELETE FROM `creature_addon` WHERE `guid` IN (132681,128620); diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 2d6046cbddf..f94a3e79066 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -731,7 +731,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->AI()->EnterEvadeMode(); TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_EVADE: Creature %u EnterEvadeMode", me->GetGUIDLow()); - return; + break; } case SMART_ACTION_FLEE_FOR_ASSIST: { @@ -854,7 +854,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } case SMART_ACTION_CALL_KILLEDMONSTER: { - if (e.target.type == SMART_TARGET_NONE) // Loot recipient and his group members + if (e.target.type == SMART_TARGET_NONE || e.target.type == SMART_TARGET_SELF) // Loot recipient and his group members { if (!me) break; @@ -1340,15 +1340,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!me) break; - ObjectList* targets = GetTargets(e, unit); if (e.GetTargetType() == SMART_TARGET_SELF) me->SetFacingTo(me->GetHomePosition().GetOrientation()); else if (e.GetTargetType() == SMART_TARGET_POSITION) me->SetFacingTo(e.target.o); - else if (targets && !targets->empty()) - me->SetFacingToObject(*targets->begin()); + else if (ObjectList* targets = GetTargets(e, unit)) + { + if (!targets->empty()) + me->SetFacingToObject(*targets->begin()); + + delete targets; + } - delete targets; break; } case SMART_ACTION_PLAYMOVIE: @@ -1445,7 +1448,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u", equipId, npc->GetEntry()); delete targets; - return; + break; } npc->SetCurrentEquipmentId(equipId); @@ -1879,11 +1882,13 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (Creature* creature = (*itr)->ToCreature()) { creature->GetMotionMaster()->Clear(); creature->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); } + } /// @todo Resume path when reached jump location delete targets; @@ -1913,7 +1918,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!storedTargets) { delete targets; - return; + break; } for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) @@ -1950,6 +1955,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (Player* player = (*itr)->ToPlayer()) { if (e.action.sendGossipMenu.gossipMenuId) @@ -1959,6 +1965,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipNpcTextId, GetBaseObject()->GetGUID()); } + } delete targets; break; @@ -1970,15 +1977,32 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { if (IsCreature(*itr)) { if (e.GetTargetType() == SMART_TARGET_SELF) (*itr)->ToCreature()->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation()); else if (e.GetTargetType() == SMART_TARGET_POSITION) (*itr)->ToCreature()->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o); + else if (e.GetTargetType() == SMART_TARGET_CREATURE_RANGE || e.GetTargetType() == SMART_TARGET_CREATURE_GUID || + e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE || + e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || + e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || + e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER || + e.GetTargetType() == SMART_TARGET_CLOSEST_ENEMY || e.GetTargetType() == SMART_TARGET_CLOSEST_FRIENDLY) + { + if (ObjectList* targets = GetTargets(e, unit)) + { + if (WorldObject* target = targets->front()) + (*itr)->ToCreature()->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation()); + + delete targets; + } + } else - TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SET_HOME_POS is not using SMART_TARGET_SELF or SMART_TARGET_POSITION, skipping"); + TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript: Action target for SMART_ACTION_SET_HOME_POS is invalid, skipping"); } + } delete targets; break; @@ -2101,7 +2125,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!sGameEventMgr->IsActiveEvent(eventId)) { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: %u)", eventId); - return; + break; } sGameEventMgr->StopEvent(eventId, true); break; @@ -2112,7 +2136,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (sGameEventMgr->IsActiveEvent(eventId)) { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: %u)", eventId); - return; + break; } sGameEventMgr->StartEvent(eventId, true); break; @@ -2621,10 +2645,20 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_TARGET_CASTING: { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->IsNonMeleeSpellCasted(false, false, true)) + if (!me || !me->IsInCombat()) return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); + Unit* victim = me->GetVictim(); + + if (!victim || !victim->IsNonMeleeSpellCasted(false, false, true)) + return; + + if (e.event.targetCasting.spellId > 0) + if (Spell* currSpell = victim->GetCurrentSpell(CURRENT_GENERIC_SPELL)) + if (currSpell->m_spellInfo->Id != e.event.targetCasting.spellId) + return; + + ProcessTimedAction(e, e.event.targetCasting.repeatMin, e.event.targetCasting.repeatMax, me->GetVictim()); break; } case SMART_EVENT_FRIENDLY_HEALTH: @@ -2632,10 +2666,10 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!me || !me->IsInCombat()) return; - Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealt.radius, e.event.friendlyHealt.hpDeficit); + Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealth.radius, e.event.friendlyHealth.hpDeficit); if (!target || !target->IsInCombat()) return; - ProcessTimedAction(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax, target); + ProcessTimedAction(e, e.event.friendlyHealth.repeatMin, e.event.friendlyHealth.repeatMax, target); break; } case SMART_EVENT_FRIENDLY_IS_CC: @@ -2983,7 +3017,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui { uint32 healthPct = uint32((*itr)->ToUnit()->GetHealthPct()); - if (healthPct > e.event.friendlyHealtPct.maxHpPct || healthPct < e.event.friendlyHealtPct.minHpPct) + if (healthPct > e.event.friendlyHealthPct.maxHpPct || healthPct < e.event.friendlyHealthPct.minHpPct) continue; target = (*itr)->ToUnit(); @@ -2996,7 +3030,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!target) return; - ProcessTimedAction(e, e.event.friendlyHealtPct.repeatMin, e.event.friendlyHealtPct.repeatMax, target); + ProcessTimedAction(e, e.event.friendlyHealthPct.repeatMin, e.event.friendlyHealthPct.repeatMax, target); break; } default: diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 081599c322e..ae87d7122d4 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -407,10 +407,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) } break; case SMART_EVENT_FRIENDLY_HEALTH: - if (!NotNULL(e, e.event.friendlyHealt.radius)) + if (!NotNULL(e, e.event.friendlyHealth.radius)) return false; - if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) + if (!IsMinMaxValid(e, e.event.friendlyHealth.repeatMin, e.event.friendlyHealth.repeatMax)) return false; break; case SMART_EVENT_FRIENDLY_IS_CC: @@ -437,6 +437,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; break; case SMART_EVENT_TARGET_CASTING: + if (e.event.targetCasting.spellId > 0 && !sSpellMgr->GetSpellInfo(e.event.targetCasting.spellId)) + { + sLog->outError(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses non-existent Spell entry %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.event.spellHit.spell); + return false; + } + + if (!IsMinMaxValid(e, e.event.targetCasting.repeatMin, e.event.targetCasting.repeatMax)) + return false; + break; case SMART_EVENT_PASSENGER_BOARDED: case SMART_EVENT_PASSENGER_REMOVED: if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) @@ -546,10 +555,10 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) break; } case SMART_EVENT_FRIENDLY_HEALTH_PCT: - if (!IsMinMaxValid(e, e.event.friendlyHealtPct.repeatMin, e.event.friendlyHealtPct.repeatMax)) + if (!IsMinMaxValid(e, e.event.friendlyHealthPct.repeatMin, e.event.friendlyHealthPct.repeatMax)) return false; - if (e.event.friendlyHealtPct.maxHpPct > 100 || e.event.friendlyHealtPct.minHpPct > 100) + if (e.event.friendlyHealthPct.maxHpPct > 100 || e.event.friendlyHealthPct.minHpPct > 100) { TC_LOG_ERROR(LOG_FILTER_SQL, "SmartAIMgr: Entry %d SourceType %u Event %u Action %u has pct value above 100, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); return false; diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 8337f9e15ee..0bb559dfe3c 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -94,7 +94,7 @@ enum SMART_EVENT SMART_EVENT_OOC_LOS = 10, // NoHostile, MaxRnage, CooldownMin, CooldownMax SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId SMART_EVENT_TARGET_HEALTH_PCT = 12, // HPMin%, HPMax%, RepeatMin, RepeatMax - SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax + SMART_EVENT_TARGET_CASTING = 13, // RepeatMin, RepeatMax, spellid SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax @@ -215,11 +215,18 @@ struct SmartEvent struct { + uint32 repeatMin; + uint32 repeatMax; + uint32 spellId; + } targetCasting; + + struct + { uint32 hpDeficit; uint32 radius; uint32 repeatMin; uint32 repeatMax; - } friendlyHealt; + } friendlyHealth; struct { @@ -368,7 +375,7 @@ struct SmartEvent uint32 maxHpPct; uint32 repeatMin; uint32 repeatMax; - } friendlyHealtPct; + } friendlyHealthPct; struct { diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 55f8527a125..be4356f6b54 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -154,6 +154,12 @@ enum RBACPermissions RBAC_PERM_COMMAND_UNBAN_CHARACTER = 254,
RBAC_PERM_COMMAND_UNBAN_IP = 255,
RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT = 256,
+ RBAC_PERM_COMMAND_BF = 257,
+ RBAC_PERM_COMMAND_BF_START = 258,
+ RBAC_PERM_COMMAND_BF_STOP = 259,
+ RBAC_PERM_COMMAND_BF_SWITCH = 260,
+ RBAC_PERM_COMMAND_BF_TIMER = 261,
+ RBAC_PERM_COMMAND_BF_ENABLE = 262,
// custom permissions 1000+
RBAC_PERM_MAX
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 6cd61dc043c..5a787f910b8 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -137,20 +137,7 @@ void Object::_Create(uint32 guidlow, uint32 entry, HighGuid guidhigh) uint64 guid = MAKE_NEW_GUID(guidlow, entry, guidhigh); SetUInt64Value(OBJECT_FIELD_GUID, guid); - uint32 type = 0; - switch (m_objectType) - { - //case TYPEID_ITEM: type = 3; break; - //case TYPEID_CONTAINER: type = 7; break; //+4 - //case TYPEID_UNIT: type = 9; break; //+2 - //case TYPEID_PLAYER: type = 25; break; //+16 - //case TYPEID_GAMEOBJECT: type = 33; break; //+8 - case TYPEID_DYNAMICOBJECT: type = 65; break; //+32 - //case TYPEID_CORPSE: type = 129; break; //+64 - default: type = m_objectType; break; - } - SetUInt32Value(OBJECT_FIELD_TYPE, type); - //SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType); + SetUInt32Value(OBJECT_FIELD_TYPE, m_objectType); m_PackGUID.wpos(0); m_PackGUID.appendPackGUID(GetGUID()); } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 39dea3ca5fe..f5d8cca70e3 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -560,6 +560,10 @@ void ObjectMgr::LoadCreatureTemplateAddons() TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has wrong spell %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); continue; } + + if (AdditionalSpellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)) + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has SPELL_AURA_CONTROL_VEHICLE aura %u defined in `auras` field in `creature_template_addon`.", entry, uint32(atol(*itr))); + creatureAddon.auras[i++] = uint32(atol(*itr)); } @@ -574,7 +578,7 @@ void ObjectMgr::LoadCreatureTemplateAddons() if (!sEmotesStore.LookupEntry(creatureAddon.emote)) { - TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_addon`.", entry, creatureAddon.emote); + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (Entry: %u) has invalid emote (%u) defined in `creature_template_addon`.", entry, creatureAddon.emote); creatureAddon.emote = 0; } @@ -933,6 +937,10 @@ void ObjectMgr::LoadCreatureAddons() TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (GUID: %u) has wrong spell %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr))); continue; } + + if (AdditionalSpellInfo->HasAura(SPELL_AURA_CONTROL_VEHICLE)) + TC_LOG_ERROR(LOG_FILTER_SQL, "Creature (GUID: %u) has SPELL_AURA_CONTROL_VEHICLE aura %u defined in `auras` field in `creature_addon`.", guid, uint32(atol(*itr))); + creatureAddon.auras[i++] = uint32(atol(*itr)); } diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 426d83ef837..3456041ddb2 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -654,6 +654,7 @@ void AddSC_event_childrens_week(); // Pets void AddSC_deathknight_pet_scripts(); +void AddSC_generic_pet_scripts(); void AddSC_hunter_pet_scripts(); void AddSC_mage_pet_scripts(); void AddSC_priest_pet_scripts(); @@ -1359,6 +1360,7 @@ void AddPetScripts() { #ifdef SCRIPTS AddSC_deathknight_pet_scripts(); + AddSC_generic_pet_scripts(); AddSC_hunter_pet_scripts(); AddSC_mage_pet_scripts(); AddSC_priest_pet_scripts(); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index ffd8805901a..0e85815a054 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -277,18 +277,15 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) { if (!AntiDOS.EvaluateOpcode(*packet)) { - delete packet; - packet = NULL; KickPlayer(); } - - if (packet && packet->GetOpcode() >= NUM_MSG_TYPES) + else if (packet->GetOpcode() >= NUM_MSG_TYPES) { TC_LOG_ERROR(LOG_FILTER_OPCODES, "Received non-existed opcode %s from %s", GetOpcodeNameForLogging(packet->GetOpcode()).c_str() , GetPlayerInfo().c_str()); sScriptMgr->OnUnknownPacketReceive(m_Socket, WorldPacket(*packet)); } - else if (packet) + else { OpcodeHandler &opHandle = opcodeTable[packet->GetOpcode()]; try @@ -373,7 +370,7 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) break; } } - catch(ByteBufferException &) + catch (ByteBufferException const&) { TC_LOG_ERROR(LOG_FILTER_GENERAL, "WorldSession::Update ByteBufferException occured while parsing a packet (opcode: %u) from client %s, accountid=%i. Skipped packet.", packet->GetOpcode(), GetRemoteAddress().c_str(), GetAccountId()); @@ -383,6 +380,8 @@ bool WorldSession::Update(uint32 diff, PacketFilter& updater) if (deletePacket) delete packet; + + deletePacket = true; } if (m_Socket && !m_Socket->IsClosed() && _warden) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 2bc4f3a0258..12ec033dfa7 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -83,7 +83,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, bool> World::m_stopEvent = false; uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; -volatile uint32 World::m_worldLoopCounter = 0; +ACE_Atomic_Op<ACE_Thread_Mutex, uint32> World::m_worldLoopCounter = 0; float World::m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE; float World::m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE; diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index bf90b5ac01a..d4d9c4e2431 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -514,7 +514,7 @@ struct CharacterNameData class World { public: - static volatile uint32 m_worldLoopCounter; + static ACE_Atomic_Op<ACE_Thread_Mutex, uint32> m_worldLoopCounter; World(); ~World(); diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp index 5ab94062a85..0b239219ddd 100644 --- a/src/server/scripts/Commands/cs_bf.cpp +++ b/src/server/scripts/Commands/cs_bf.cpp @@ -35,17 +35,17 @@ public: { static ChatCommand battlefieldcommandTable[] = { - { "start", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldStart, "", NULL }, - { "stop", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnd, "", NULL }, - { "switch", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldSwitch, "", NULL }, - { "timer", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldTimer, "", NULL }, - { "enable", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnable, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "start", RBAC_PERM_COMMAND_BF_START, false, &HandleBattlefieldStart, "", NULL }, + { "stop", RBAC_PERM_COMMAND_BF_STOP, false, &HandleBattlefieldEnd, "", NULL }, + { "switch", RBAC_PERM_COMMAND_BF_SWITCH, false, &HandleBattlefieldSwitch, "", NULL }, + { "timer", RBAC_PERM_COMMAND_BF_TIMER, false, &HandleBattlefieldTimer, "", NULL }, + { "enable", RBAC_PERM_COMMAND_BF_ENABLE, false, &HandleBattlefieldEnable, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "bf", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", battlefieldcommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "bf", RBAC_PERM_COMMAND_BF, false, NULL, "", battlefieldcommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 473fe000939..780f781f58d 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -73,14 +73,12 @@ enum Spells SPELL_SHIELDWALL = 29390 }; -#define POS_Z 81.73f - -float Locations[4][3]= +Position const Locations[4] = { - {-10991.0f, -1884.33f, 0.614315f}, - {-10989.4f, -1885.88f, 0.904913f}, - {-10978.1f, -1887.07f, 2.035550f}, - {-10975.9f, -1885.81f, 2.253890f}, + {-10991.0f, -1884.33f, 81.73f, 0.614315f}, + {-10989.4f, -1885.88f, 81.73f, 0.904913f}, + {-10978.1f, -1887.07f, 81.73f, 2.035550f}, + {-10975.9f, -1885.81f, 81.73f, 2.253890f}, }; const uint32 Adds[6]= @@ -137,7 +135,7 @@ public: Enrage = false; InVanish = false; - if (me->GetHealth()) + if (me->IsAlive()) SpawnAdds(); if (instance) @@ -183,39 +181,34 @@ public: void SpawnAdds() { DeSpawnAdds(); + if (isAddlistEmpty()) { - Creature* creature = NULL; - std::vector<uint32> AddList; + std::list<uint32> AddList; for (uint8 i = 0; i < 6; ++i) AddList.push_back(Adds[i]); - while (AddList.size() > 4) - AddList.erase((AddList.begin())+(rand()%AddList.size())); + Trinity::Containers::RandomResizeList(AddList, 4); uint8 i = 0; - for (std::vector<uint32>::const_iterator itr = AddList.begin(); itr != AddList.end(); ++itr) + for (std::list<uint32>::const_iterator itr = AddList.begin(); itr != AddList.end() && i < 4; ++itr, ++i) { uint32 entry = *itr; - creature = me->SummonCreature(entry, Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (creature) + if (Creature* creature = me->SummonCreature(entry, Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) { AddGUID[i] = creature->GetGUID(); AddId[i] = entry; } - ++i; } - }else + } + else { for (uint8 i = 0; i < 4; ++i) { - Creature* creature = me->SummonCreature(AddId[i], Locations[i][0], Locations[i][1], POS_Z, Locations[i][2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - if (creature) - { + if (Creature* creature = me->SummonCreature(AddId[i], Locations[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) AddGUID[i] = creature->GetGUID(); - } } } } @@ -235,9 +228,8 @@ public: { if (AddGUID[i]) { - Creature* temp = Creature::GetCreature((*me), AddGUID[i]); - if (temp && temp->IsAlive()) - temp->DisappearAndDie(); + if (Creature* temp = ObjectAccessor::GetCreature(*me, AddGUID[i])) + temp->DespawnOrUnsummon(); } } } diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index b1ecdc5904e..7d923e7686f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -403,21 +403,19 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader bool Load() OVERRIDE { - _procTarget = NULL; return true; } bool CheckProc(ProcEventInfo& /*eventInfo*/) { - _procTarget = GetCaster(); - return _procTarget && _procTarget->IsAlive(); + return GetCaster() && GetCaster()->IsAlive(); } void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45)); - GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, _procTarget, true); + GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true); } void Register() OVERRIDE @@ -425,9 +423,6 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader DoCheckProc += AuraCheckProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_devourer_of_souls_mirrored_soul_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } - - private: - Unit* _procTarget; }; AuraScript* GetAuraScript() const OVERRIDE diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index afd0e8a4342..0097fe8c4d7 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -256,8 +256,6 @@ public: } } else uiGripOfSladRanTimer -= diff; } - - InstanceScript* instance; }; }; @@ -278,8 +276,6 @@ public: uint32 uiVenomousBiteTimer; - InstanceScript* instance; - void Reset() OVERRIDE { uiVenomousBiteTimer = 2*IN_MILLISECONDS; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp index 38864effe9f..46776ae9b96 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_general_vezax.cpp @@ -39,7 +39,7 @@ enum VezaxEmotes EMOTE_SURGE_OF_DARKNESS = 8, // Saronite Vapor - EMOTE_VAPORS = 9 + EMOTE_VAPORS = 0 }; enum VezaxSpells @@ -443,14 +443,21 @@ class npc_saronite_vapors : public CreatureScript } }; -class spell_mark_of_the_faceless : public SpellScriptLoader +class spell_general_vezax_mark_of_the_faceless : public SpellScriptLoader { public: - spell_mark_of_the_faceless() : SpellScriptLoader("spell_mark_of_the_faceless") { } + spell_general_vezax_mark_of_the_faceless() : SpellScriptLoader("spell_general_vezax_mark_of_the_faceless") { } - class spell_mark_of_the_faceless_AuraScript : public AuraScript + class spell_general_vezax_mark_of_the_faceless_AuraScript : public AuraScript { - PrepareAuraScript(spell_mark_of_the_faceless_AuraScript); + PrepareAuraScript(spell_general_vezax_mark_of_the_faceless_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_THE_FACELESS_DAMAGE)) + return false; + return true; + } void HandleEffectPeriodic(AuraEffect const* aurEff) { @@ -460,13 +467,42 @@ class spell_mark_of_the_faceless : public SpellScriptLoader void Register() OVERRIDE { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_the_faceless_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + OnEffectPeriodic += AuraEffectPeriodicFn(spell_general_vezax_mark_of_the_faceless_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); } }; AuraScript* GetAuraScript() const OVERRIDE { - return new spell_mark_of_the_faceless_AuraScript(); + return new spell_general_vezax_mark_of_the_faceless_AuraScript(); + } +}; + +class spell_general_vezax_mark_of_the_faceless_leech : public SpellScriptLoader +{ + public: + spell_general_vezax_mark_of_the_faceless_leech() : SpellScriptLoader("spell_general_vezax_mark_of_the_faceless_leech") { } + + class spell_general_vezax_mark_of_the_faceless_leech_SpellScript : public SpellScript + { + PrepareSpellScript(spell_general_vezax_mark_of_the_faceless_leech_SpellScript); + + void FilterTargets(std::list<WorldObject*>& targets) + { + targets.remove(GetExplTargetWorldObject()); + + if (targets.empty()) + FinishCast(SPELL_FAILED_NO_VALID_TARGETS); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_general_vezax_mark_of_the_faceless_leech_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_general_vezax_mark_of_the_faceless_leech_SpellScript(); } }; @@ -554,7 +590,8 @@ void AddSC_boss_general_vezax() new boss_general_vezax(); new boss_saronite_animus(); new npc_saronite_vapors(); - new spell_mark_of_the_faceless(); + new spell_general_vezax_mark_of_the_faceless(); + new spell_general_vezax_mark_of_the_faceless_leech(); new spell_general_vezax_saronite_vapors(); new achievement_shadowdodger(); new achievement_smell_saronite(); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 56fd4b310ee..6783d8cd428 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -16,6 +16,7 @@ */ #include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "SpellScript.h" #include "ulduar.h" diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 8691f9769fa..d0cb7108c09 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -24,15 +24,21 @@ static DoorData const doorData[] = { - {GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S }, - {GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S }, - {GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM, BOUNDARY_S }, - {GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W }, - {GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_NONE }, - {GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, - {GO_DOODAD_UL_UNIVERSEGLOBE01, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, - {GO_DOODAD_UL_ULDUAR_TRAPDOOR_03, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, - {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_LEVIATHAN_DOOR, BOSS_LEVIATHAN, DOOR_TYPE_ROOM, BOUNDARY_S }, + { GO_XT_002_DOOR, BOSS_XT002, DOOR_TYPE_ROOM, BOUNDARY_S }, + { GO_IRON_COUNCIL_DOOR, BOSS_ASSEMBLY_OF_IRON, DOOR_TYPE_ROOM, BOUNDARY_N }, + { GO_ARCHIVUM_DOOR, BOSS_ASSEMBLY_OF_IRON, DOOR_TYPE_PASSAGE, BOUNDARY_S }, + { GO_HODIR_ENTRANCE, BOSS_HODIR, DOOR_TYPE_ROOM, BOUNDARY_E }, + { GO_HODIR_DOOR, BOSS_HODIR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { GO_HODIR_ICE_DOOR, BOSS_HODIR, DOOR_TYPE_PASSAGE, BOUNDARY_W }, + { GO_VEZAX_DOOR, BOSS_VEZAX, DOOR_TYPE_PASSAGE, BOUNDARY_E }, + { GO_YOGG_SARON_DOOR, BOSS_YOGG_SARON, DOOR_TYPE_ROOM, BOUNDARY_S }, + { GO_DOODAD_UL_SIGILDOOR_03, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_W }, + { GO_DOODAD_UL_UNIVERSEFLOOR_01, BOSS_ALGALON, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_DOODAD_UL_UNIVERSEFLOOR_02, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + { GO_DOODAD_UL_UNIVERSEGLOBE01, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + { GO_DOODAD_UL_ULDUAR_TRAPDOOR_03, BOSS_ALGALON, DOOR_TYPE_SPAWN_HOLE, BOUNDARY_NONE }, + { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }, }; MinionData const minionData[] = @@ -46,7 +52,7 @@ MinionData const minionData[] = class instance_ulduar : public InstanceMapScript { public: - instance_ulduar() : InstanceMapScript("instance_ulduar", 603) { } + instance_ulduar() : InstanceMapScript(UlduarScriptName, 603) { } struct instance_ulduar_InstanceMapScript : public InstanceScript { @@ -73,6 +79,7 @@ class instance_ulduar : public InstanceMapScript uint64 VoiceOfYoggSaronGUID; uint64 SaraGUID; uint64 BrainOfYoggSaronGUID; + uint64 KeeperGUIDs[4]; uint64 AlgalonGUID; uint64 BrannBronzebeardAlgGUID; @@ -81,16 +88,10 @@ class instance_ulduar : public InstanceMapScript uint64 RazorHarpoonGUIDs[4]; uint64 KologarnChestGUID; uint64 KologarnBridgeGUID; - uint64 KologarnDoorGUID; uint64 ThorimChestGUID; uint64 HodirRareCacheGUID; uint64 HodirChestGUID; - uint64 HodirDoorGUID; - uint64 HodirIceDoorGUID; - uint64 ArchivumDoorGUID; - uint64 VezaxDoorGUID; uint64 BrainRoomDoorGUIDs[3]; - uint64 KeeperGUIDs[4]; uint64 AlgalonSigilDoorGUID[3]; uint64 AlgalonFloorGUID[2]; uint64 AlgalonUniverseGUID; @@ -138,10 +139,6 @@ class instance_ulduar : public InstanceMapScript HodirRareCacheGUID = 0; HodirChestGUID = 0; LeviathanGateGUID = 0; - VezaxDoorGUID = 0; - HodirDoorGUID = 0; - HodirIceDoorGUID = 0; - ArchivumDoorGUID = 0; AlgalonUniverseGUID = 0; AlgalonTrapdoorGUID = 0; BrannBronzebeardAlgGUID = 0; @@ -458,9 +455,6 @@ class instance_ulduar : public InstanceMapScript if (GetBossState(BOSS_KOLOGARN) == DONE) HandleGameObject(0, false, gameObject); break; - case GO_KOLOGARN_DOOR: - KologarnDoorGUID = gameObject->GetGUID(); - break; case GO_THORIM_CHEST_HERO: case GO_THORIM_CHEST: ThorimChestGUID = gameObject->GetGUID(); @@ -473,20 +467,21 @@ class instance_ulduar : public InstanceMapScript case GO_HODIR_CHEST: HodirChestGUID = gameObject->GetGUID(); break; - case GO_LEVIATHAN_DOOR: - AddDoor(gameObject, true); - break; case GO_LEVIATHAN_GATE: LeviathanGateGUID = gameObject->GetGUID(); if (GetBossState(BOSS_LEVIATHAN) == DONE) gameObject->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); break; + case GO_LEVIATHAN_DOOR: case GO_XT_002_DOOR: - AddDoor(gameObject, true); - break; + case GO_IRON_COUNCIL_DOOR: + case GO_ARCHIVUM_DOOR: + case GO_HODIR_ENTRANCE: + case GO_HODIR_DOOR: + case GO_HODIR_ICE_DOOR: case GO_VEZAX_DOOR: - VezaxDoorGUID = gameObject->GetGUID(); - HandleGameObject(0, false, gameObject); + case GO_YOGG_SARON_DOOR: + AddDoor(gameObject, true); break; case GO_RAZOR_HARPOON_1: RazorHarpoonGUIDs[0] = gameObject->GetGUID(); @@ -504,20 +499,6 @@ class instance_ulduar : public InstanceMapScript if (GetBossState(BOSS_RAZORSCALE) == IN_PROGRESS) gameObject->SetGoState(GO_STATE_ACTIVE); break; - case GO_HODIR_DOOR: - HodirDoorGUID = gameObject->GetGUID(); - break; - case GO_HODIR_ICE_DOOR: - HodirIceDoorGUID = gameObject->GetGUID(); - break; - case GO_ARCHIVUM_DOOR: - ArchivumDoorGUID = gameObject->GetGUID(); - if (GetBossState(BOSS_ASSEMBLY_OF_IRON) != DONE) - HandleGameObject(ArchivumDoorGUID, false); - break; - case GO_YOGG_SARON_DOOR: - AddDoor(gameObject, true); - break; case GO_BRAIN_ROOM_DOOR_1: BrainRoomDoorGUIDs[0] = gameObject->GetGUID(); break; @@ -566,6 +547,8 @@ class instance_ulduar : public InstanceMapScript case GO_GIFT_OF_THE_OBSERVER_25: GiftOfTheObserverGUID = gameObject->GetGUID(); break; + default: + break; } } @@ -575,6 +558,13 @@ class instance_ulduar : public InstanceMapScript { case GO_LEVIATHAN_DOOR: case GO_XT_002_DOOR: + case GO_IRON_COUNCIL_DOOR: + case GO_ARCHIVUM_DOOR: + case GO_HODIR_ENTRANCE: + case GO_HODIR_DOOR: + case GO_HODIR_ICE_DOOR: + case GO_VEZAX_DOOR: + case GO_YOGG_SARON_DOOR: case GO_DOODAD_UL_SIGILDOOR_03: case GO_DOODAD_UL_UNIVERSEFLOOR_01: case GO_DOODAD_UL_UNIVERSEFLOOR_02: @@ -659,7 +649,10 @@ class instance_ulduar : public InstanceMapScript case BOSS_IGNIS: case BOSS_RAZORSCALE: case BOSS_XT002: + case BOSS_ASSEMBLY_OF_IRON: case BOSS_AURIAYA: + case BOSS_VEZAX: + case BOSS_YOGG_SARON: break; case BOSS_MIMIRON: if (state == DONE) @@ -669,16 +662,6 @@ class instance_ulduar : public InstanceMapScript if (state == DONE) instance->SummonCreature(NPC_FREYA_OBSERVATION_RING, ObservationRingKeepersPos[0]); break; - case BOSS_ASSEMBLY_OF_IRON: - if (state == DONE) - HandleGameObject(ArchivumDoorGUID, true); - break; - case BOSS_VEZAX: - if (state == DONE) - HandleGameObject(VezaxDoorGUID, true); - break; - case BOSS_YOGG_SARON: - break; case BOSS_KOLOGARN: if (state == DONE) { @@ -698,8 +681,6 @@ class instance_ulduar : public InstanceMapScript HodirRareCache->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); if (GameObject* HodirChest = instance->GetGameObject(HodirChestGUID)) HodirChest->SetRespawnTime(HodirChest->GetRespawnDelay()); - HandleGameObject(HodirDoorGUID, true); - HandleGameObject(HodirIceDoorGUID, true); instance->SummonCreature(NPC_HODIR_OBSERVATION_RING, ObservationRingKeepersPos[1]); } diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h index 35d11522580..45134cd9ff6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar.h @@ -166,29 +166,46 @@ enum UlduarNPCs enum UlduarGameObjects { - GO_KOLOGARN_CHEST_HERO = 195047, - GO_KOLOGARN_CHEST = 195046, - GO_KOLOGARN_BRIDGE = 194232, - GO_KOLOGARN_DOOR = 194553, - GO_THORIM_CHEST_HERO = 194315, - GO_THORIM_CHEST = 194314, - GO_HODIR_RARE_CACHE_OF_WINTER = 194200, - GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, - GO_HODIR_CHEST_HERO = 194308, - GO_HODIR_CHEST = 194307, + // Leviathan GO_LEVIATHAN_DOOR = 194905, GO_LEVIATHAN_GATE = 194630, - GO_XT_002_DOOR = 194631, - GO_VEZAX_DOOR = 194750, + + // Razorscale GO_MOLE_MACHINE = 194316, GO_RAZOR_HARPOON_1 = 194542, GO_RAZOR_HARPOON_2 = 194541, GO_RAZOR_HARPOON_3 = 194543, GO_RAZOR_HARPOON_4 = 194519, GO_RAZOR_BROKEN_HARPOON = 194565, + + // XT-002 + GO_XT_002_DOOR = 194631, + + // Assembly of Iron + GO_IRON_COUNCIL_DOOR = 194554, + GO_ARCHIVUM_DOOR = 194556, + + // Kologarn + GO_KOLOGARN_CHEST_HERO = 195047, + GO_KOLOGARN_CHEST = 195046, + GO_KOLOGARN_BRIDGE = 194232, + GO_KOLOGARN_DOOR = 194553, + + // Hodir + GO_HODIR_ENTRANCE = 194442, GO_HODIR_DOOR = 194634, GO_HODIR_ICE_DOOR = 194441, - GO_ARCHIVUM_DOOR = 194556, + GO_HODIR_RARE_CACHE_OF_WINTER = 194200, + GO_HODIR_RARE_CACHE_OF_WINTER_HERO = 194201, + GO_HODIR_CHEST_HERO = 194308, + GO_HODIR_CHEST = 194307, + + // Thorim + GO_THORIM_CHEST_HERO = 194315, + GO_THORIM_CHEST = 194314, + + // Vezax + GO_VEZAX_DOOR = 194750, // Yogg-Saron GO_YOGG_SARON_DOOR = 194773, @@ -327,26 +344,10 @@ enum YoggSaronIllusions STORMWIND_ILLUSION = 2, }; -template<class AI> -CreatureAI* GetUlduarAI(Creature* creature) +template<class AI, class T> +AI* GetUlduarAI(T* obj) { - if (InstanceMap* instance = creature->GetMap()->ToInstanceMap()) - if (instance->GetInstanceScript()) - if (instance->GetScriptId() == sObjectMgr->GetScriptId(UlduarScriptName)) - return new AI(creature); - - return NULL; -} - -template<class AI> -GameObjectAI* GetUlduarAI(GameObject* go) -{ - if (InstanceMap* instance = go->GetMap()->ToInstanceMap()) - if (instance->GetInstanceScript()) - if (instance->GetScriptId() == sObjectMgr->GetScriptId(UlduarScriptName)) - return new AI(go); - - return NULL; + return GetInstanceAI<AI, T>(obj, UlduarScriptName); } class PlayerOrPetCheck diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp index 054a32a75d2..0daa9ea16c6 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/ulduar_teleporter.cpp @@ -18,9 +18,9 @@ #include "ScriptMgr.h" #include "ScriptedGossip.h" -#include "ulduar.h" #include "InstanceScript.h" #include "Player.h" +#include "ulduar.h" /* The teleporter appears to be active and stable. diff --git a/src/server/scripts/Outland/zone_netherstorm.cpp b/src/server/scripts/Outland/zone_netherstorm.cpp index 74257c95cf3..7c328f57e78 100644 --- a/src/server/scripts/Outland/zone_netherstorm.cpp +++ b/src/server/scripts/Outland/zone_netherstorm.cpp @@ -753,7 +753,6 @@ public: bool Drained; uint8 WeakPercent; - Player* player; uint64 PlayerGUID; uint32 ManaBurnTimer; diff --git a/src/server/scripts/Pet/CMakeLists.txt b/src/server/scripts/Pet/CMakeLists.txt index b4a8eea77d8..87bbfd63c69 100644 --- a/src/server/scripts/Pet/CMakeLists.txt +++ b/src/server/scripts/Pet/CMakeLists.txt @@ -11,6 +11,7 @@ set(scripts_STAT_SRCS ${scripts_STAT_SRCS} Pet/pet_dk.cpp + Pet/pet_generic.cpp Pet/pet_hunter.cpp Pet/pet_mage.cpp Pet/pet_priest.cpp diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp new file mode 100644 index 00000000000..f10a14716c6 --- /dev/null +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* + * Ordered alphabetically using scriptname. + * Scriptnames of files in this file should be prefixed with "npc_pet_gen_". + */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "Player.h" + +enum Mojo +{ + SAY_MOJO = 0, + + SPELL_FEELING_FROGGY = 43906, + SPELL_SEDUCTION_VISUAL = 43919 +}; + +class npc_pet_gen_mojo : public CreatureScript +{ + public: + npc_pet_gen_mojo() : CreatureScript("npc_pet_gen_mojo") { } + + struct npc_pet_gen_mojoAI : public ScriptedAI + { + npc_pet_gen_mojoAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() OVERRIDE + { + _victimGUID = 0; + + if (Unit* owner = me->GetOwner()) + me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f); + } + + void EnterCombat(Unit* /*who*/) OVERRIDE { } + void UpdateAI(uint32 /*diff*/) OVERRIDE { } + + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE + { + me->HandleEmoteCommand(emote); + Unit* owner = me->GetOwner(); + if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || + owner->ToPlayer()->GetTeam() != player->GetTeam()) + { + return; + } + + Talk(SAY_MOJO, player->GetGUID()); + + if (_victimGUID) + if (Player* victim = ObjectAccessor::GetPlayer(*me, _victimGUID)) + victim->RemoveAura(SPELL_FEELING_FROGGY); + + _victimGUID = player->GetGUID(); + + DoCast(player, SPELL_FEELING_FROGGY, true); + DoCast(me, SPELL_SEDUCTION_VISUAL, true); + me->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f); + } + + private: + uint64 _victimGUID; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_pet_gen_mojoAI(creature); + } +}; + +void AddSC_generic_pet_scripts() +{ + new npc_pet_gen_mojo(); +} diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 7b9821c60a9..7021f6251a2 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2034,6 +2034,79 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa } }; + +enum DeathComesFromOnHigh +{ + SPELL_FORGE_CREDIT = 51974, + SPELL_TOWN_HALL_CREDIT = 51977, + SPELL_SCARLET_HOLD_CREDIT = 51980, + SPELL_CHAPEL_CREDIT = 51982, + + NPC_NEW_AVALON_FORGE = 28525, + NPC_NEW_AVALON_TOWN_HALL = 28543, + NPC_SCARLET_HOLD = 28542, + NPC_CHAPEL_OF_THE_CRIMSON_FLAME = 28544 +}; + +// 51858 - Siphon of Acherus +class spell_q12641_death_comes_from_on_high : public SpellScriptLoader +{ + public: + spell_q12641_death_comes_from_on_high() : SpellScriptLoader("spell_q12641_death_comes_from_on_high") { } + + class spell_q12641_death_comes_from_on_high_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12641_death_comes_from_on_high_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_FORGE_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_TOWN_HALL_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_SCARLET_HOLD_CREDIT) || + !sSpellMgr->GetSpellInfo(SPELL_CHAPEL_CREDIT)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + uint32 spellId = 0; + + TC_LOG_ERROR(LOG_FILTER_SPELLS_AURAS, "spell_q12641_death_comes_from_on_high:: Caster: %s (GUID: %u) On Hit Target: Creature: %s (Entry: %u GUID: %u)", + GetOriginalCaster()->GetName().c_str(), GetOriginalCaster()->GetGUIDLow(), GetHitCreature()->GetName().c_str(), GetHitCreature()->GetEntry(), GetHitCreature()->GetGUIDLow()); + switch (GetHitCreature()->GetEntry()) + { + case NPC_NEW_AVALON_FORGE: + spellId = SPELL_FORGE_CREDIT; + break; + case NPC_NEW_AVALON_TOWN_HALL: + spellId = SPELL_TOWN_HALL_CREDIT; + break; + case NPC_SCARLET_HOLD: + spellId = SPELL_SCARLET_HOLD_CREDIT; + break; + case NPC_CHAPEL_OF_THE_CRIMSON_FLAME: + spellId = SPELL_CHAPEL_CREDIT; + break; + default: + return; + } + + GetOriginalCaster()->CastSpell((Unit*)NULL, spellId, true); + } + + void Register() OVERRIDE + { + OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12641_death_comes_from_on_high_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2083,4 +2156,5 @@ void AddSC_quest_spell_scripts() new spell_q12690_burst_at_the_seams(); new spell_q12308_escape_from_silverbrook_summon_worgen(); new spell_q12308_escape_from_silverbrook(); + new spell_q12641_death_comes_from_on_high(); } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 4efdf78154d..5304cbf56ca 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1575,130 +1575,34 @@ public: ## npc_brewfest_reveler ####*/ -class npc_brewfest_reveler : public CreatureScript +enum BrewfestReveler { -public: - npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { } - - struct npc_brewfest_revelerAI : public ScriptedAI - { - npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) {} - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE - { - if (!IsHolidayActive(HOLIDAY_BREWFEST)) - return; - - if (emote == TEXT_EMOTE_DANCE) - me->CastSpell(player, 41586, false); - } - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_brewfest_revelerAI(creature); - } + SPELL_BREWFEST_TOAST = 41586 }; - -#define SAY_RANDOM_MOJO0 "Now that's what I call froggy-style!" -#define SAY_RANDOM_MOJO1 "Your lily pad or mine?" -#define SAY_RANDOM_MOJO2 "This won't take long, did it?" -#define SAY_RANDOM_MOJO3 "I thought you'd never ask!" -#define SAY_RANDOM_MOJO4 "I promise not to give you warts..." -#define SAY_RANDOM_MOJO5 "Feelin' a little froggy, are ya?" -#define SAY_RANDOM_MOJO6a "Listen, " -#define SAY_RANDOM_MOJO6b ", I know of a little swamp not too far from here...." -#define SAY_RANDOM_MOJO7 "There's just never enough Mojo to go around..." - -class npc_mojo : public CreatureScript +class npc_brewfest_reveler : public CreatureScript { -public: - npc_mojo() : CreatureScript("npc_mojo") { } + public: + npc_brewfest_reveler() : CreatureScript("npc_brewfest_reveler") { } - struct npc_mojoAI : public ScriptedAI - { - npc_mojoAI(Creature* creature) : ScriptedAI(creature) {Reset();} - uint32 hearts; - uint64 victimGUID; - void Reset() OVERRIDE + struct npc_brewfest_revelerAI : public ScriptedAI { - victimGUID = 0; - hearts = 15000; - if (Unit* own = me->GetOwner()) - me->GetMotionMaster()->MoveFollow(own, 0, 0); - } - - void EnterCombat(Unit* /*who*/)OVERRIDE {} + npc_brewfest_revelerAI(Creature* creature) : ScriptedAI(creature) { } - void UpdateAI(uint32 diff) OVERRIDE - { - if (me->HasAura(20372)) + void ReceiveEmote(Player* player, uint32 emote) OVERRIDE { - if (hearts <= diff) - { - me->RemoveAurasDueToSpell(20372); - hearts = 15000; - } hearts -= diff; - } - } - - void ReceiveEmote(Player* player, uint32 emote) OVERRIDE - { - me->HandleEmoteCommand(emote); - Unit* owner = me->GetOwner(); - if (emote != TEXT_EMOTE_KISS || !owner || owner->GetTypeId() != TYPEID_PLAYER || - owner->ToPlayer()->GetTeam() != player->GetTeam()) - { - return; - } + if (!IsHolidayActive(HOLIDAY_BREWFEST)) + return; - std::string whisp = ""; - switch (rand() % 8) - { - case 0: - whisp.append(SAY_RANDOM_MOJO0); - break; - case 1: - whisp.append(SAY_RANDOM_MOJO1); - break; - case 2: - whisp.append(SAY_RANDOM_MOJO2); - break; - case 3: - whisp.append(SAY_RANDOM_MOJO3); - break; - case 4: - whisp.append(SAY_RANDOM_MOJO4); - break; - case 5: - whisp.append(SAY_RANDOM_MOJO5); - break; - case 6: - whisp.append(SAY_RANDOM_MOJO6a); - whisp.append(player->GetName()); - whisp.append(SAY_RANDOM_MOJO6b); - break; - case 7: - whisp.append(SAY_RANDOM_MOJO7); - break; + if (emote == TEXT_EMOTE_DANCE) + me->CastSpell(player, SPELL_BREWFEST_TOAST, false); } + }; - me->MonsterWhisper(whisp.c_str(), player->GetGUID()); - if (victimGUID) - if (Player* victim = ObjectAccessor::GetPlayer(*me, victimGUID)) - victim->RemoveAura(43906); // remove polymorph frog thing - me->AddAura(43906, player); // add polymorph frog thing - victimGUID = player->GetGUID(); - DoCast(me, 20372, true); // tag.hearts - me->GetMotionMaster()->MoveFollow(player, 0, 0); - hearts = 15000; + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_brewfest_revelerAI(creature); } - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_mojoAI(creature); - } }; enum TrainingDummy @@ -2554,7 +2458,6 @@ void AddSC_npcs_special() new npc_steam_tonk(); new npc_tonk_mine(); new npc_brewfest_reveler(); - new npc_mojo(); new npc_training_dummy(); new npc_wormhole(); new npc_pet_trainer(); diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index b2a6b60ac4f..d9b97cfd3f5 100644 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -103,10 +103,11 @@ public: ACE_Based::Thread::Sleep(1000); uint32 curtime = getMSTime(); // normal work - if (_loops != World::m_worldLoopCounter) + uint32 worldLoopCounter = World::m_worldLoopCounter.value(); + if (_loops != worldLoopCounter) { _lastChange = curtime; - _loops = World::m_worldLoopCounter; + _loops = worldLoopCounter; } // possible freeze else if (getMSTimeDiff(_lastChange, curtime) > _delaytime) |