diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt index 764953ab587af..fc20347c2c8a9 100644 --- a/dep/boost/CMakeLists.txt +++ b/dep/boost/CMakeLists.txt @@ -26,7 +26,7 @@ if(WIN32) set(Boost_USE_STATIC_RUNTIME OFF) endif() -find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams regex) +find_package(Boost 1.55 REQUIRED system filesystem thread program_options iostreams) # Find if Boost was compiled in C++03 mode because it requires -DBOOST_NO_CXX11_SCOPED_ENUMS diff --git a/sql/updates/world/3.3.5/2016_08_02_00_world.sql b/sql/updates/world/3.3.5/2016_08_02_00_world.sql new file mode 100644 index 0000000000000..a5fe8c29c3e41 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_02_00_world.sql @@ -0,0 +1,82 @@ +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`IN(25769,24730,25456,25457,25458); +UPDATE `creature_template` SET `unit_flags`=33555200 WHERE `entry`=25769; +UPDATE `creature_template` SET `unit_flags`=33587968 WHERE `entry`IN(25456,25457); +UPDATE `creature_template` SET `unit_flags`=33555200 WHERE `entry`IN(25458); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25769,24730,25456,25457,25458) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`IN(2574201,2473000,2545600,2545800) AND `source_type`=9; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(25769,24730) AND `source_type`=0; + +DELETE FROM `smart_scripts` WHERE `entryorguid` =25742 AND `source_type`=0 AND `id`=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 +(24730, 0, 0, 0, 20, 0, 100, 0, 11695, 0, 0, 0, 80, 2473000, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - On Quest Reward (The Horn of Elemental Fury) - Run Script'), +(25769, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 11, 45979, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Small Elemental - On Just Summoned - Cast Elemental Beam'), +(25769, 0, 1, 2, 1, 0, 100, 1, 8000, 8000, 0, 0, 28, 45979, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Small Elemental - OOC (8 Sec) - Remove Aura'), +(25769, 0, 2, 0, 61, 0, 100, 1, 0, 0, 0, 0, 90, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Small Elemental - OOC (8 Sec) - Set Bytes 1'), +(25742, 0, 2, 0, 54, 0, 100, 1, 0, 0, 0, 0, 80, 2574201, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alluvius - On Just Summoned - Run Script 2'), +(2574201, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 5, 35, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Alluvius - Script 2 - Play emote OneShotAttackUnarmed'), +(2574201, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 24730, 0, 0, 0, 0, 0, 0, 'Alluvius - Script 2 - Say Line 0'), +(2473000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Set NPC Flags'), +(2473000, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 43320, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Cast Windwarden Channeling'), +(2473000, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25771, 1, 12000, 0, 0, 0, 8, 0, 0, 0, 3526.857, 4215.892, 16.89778, 0.9599311, 'Wind Tamer Barah - Script - Summon Ice Elemental Target'), +(2473000, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3526.76, 4208.782, 12.51583, 0.9599311, 'Wind Tamer Barah - Script - Summon Small Elemental'), +(2473000, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3530.082, 4210.271, 12.5575, 1.029744, 'Wind Tamer Barah - Script - Summon Small Elemental'), +(2473000, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3533.227, 4213.772, 12.55055, 2.80998, 'Wind Tamer Barah - Script - Summon Small Elemental'), +(2473000, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3531.661, 4218.423, 12.57833, 0.9250245, 'Wind Tamer Barah - Script - Summon Small Elemental'), +(2473000, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3528.847, 4221.306, 12.52278, 2.75762, 'Wind Tamer Barah - Script - Summon Small Elemental'), +(2473000, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 25769, 1, 10000, 0, 0, 0, 8, 0, 0, 0, 3524.509, 4220.787, 12.59916, 3.630285, 'Wind Tamer Barah - Script - Summon Small Elemental'), +(2473000, 9, 9, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 12, 25742, 1, 7000, 0, 0, 0, 8, 0, 0, 0, 3526.815, 4215.751, 13.3075, 3.752458, 'Wind Tamer Barah - Script - Summon Alluvius'), +(2473000, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 92,0, 43320, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Remove Aura'), +(2473000, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 81, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wind Tamer Barah - Script - Set NPC Flags'), +(25458, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 25458, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - On Just Summoned - Start WP'), +(25458, 0, 1, 0, 40, 0, 100, 0, 2, 25458, 0, 0, 80, 2545800, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - On Reached WP2 - Run Script'), +(25457, 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 11, 45581, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Magmoth Shaman - On Data Set - Cast Spirit Shackle'), +(25456, 0, 0, 2, 54, 0, 100, 0, 0, 0, 0, 0, 53, 0, 25456, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - On Just Summoned - Start WP'), +(25456, 0, 1, 0, 40, 0, 100, 0, 2, 25456, 0, 0, 80, 2545600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - On Reached WP2 - Run Script'), +(25456, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 50, 187679, 14, 0, 0, 0, 0, 8, 0, 0, 0, 4528.167, 5678.6, 82.23339, 0.6283169, 'Vision of Kaganishu - On Just Summoned - Spawn Blue aura, short column, scale 6'), +(2545600, 9, 0, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 11, 45595, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - Script - Cast Fireball'), +(2545600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Kaganishu - Script - Say'), +(2545800, 9, 0, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 25457, 0, 40, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Set Data on Vision of Magmoth Shaman'), -- 21:09:47.563 +(2545800, 9, 1, 0, 0, 0, 100, 0, 500, 500, 0, 0, 17, 383, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Set Emote State'), -- 21:09:47.563 +(2545800, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 25339, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Say Line 0'), -- 21:09:44.297 +(2545800, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 45605, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Vision of Farseer Grimwalkers Spirit - Script - Cast Vision of Air: Kill Credit'); -- 21:09:57.953 + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`IN(45979,45581); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=30886 AND `source_type`=0 AND `id`=1; + +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 +(30886, 0, 1, 0, 54, 0, 100, 0, 0, 0, 0, 0, 29, 0, 0, 30232, 0, 1, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Subjugated Iskalder - Out of Combat - Start Follow Invoker'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=25742; + +DELETE FROM `creature_text` WHERE `entry`IN(24730,25339,25456); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES +(24730, 0, 0, 'With the power of the horn, I bind you to its wielder''s will!', 12, 0, 100, 0, 0, 0, 24963, 'Wind Tamer Barah to Player'), +(25339, 0, 0, 'Oh no... they''ve shackled his spirit!', 12, 1, 100, 5, 0, 0, 24683, 'Spirit Talker Snarlfang'), +(25456, 0, 0, 'KAGANISHU!', 12, 0, 100, 0, 0, 0, 24658, 'Vision of Kaganishu'); + +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 45979, 0, 0, 31, 0, 3, 25771, 0, 0, 0, 0, '', 'Elemental Beam only targets Ice Elemental Target'), +(13, 1, 45581, 0, 0, 31, 0, 3, 25458, 0, 0, 0, 0, '', 'Spirit Shackle only targets Vision of Farseer Grimwalkers Spirit'), +(22, 1, 25742, 0, 0, 23, 1, 4037, 0, 0, 1, 0, 0, '', 'Alluvius - Only Run SAI if not summoned in Taunka le village'), +(22, 4, 25742, 0, 0, 23, 1, 4037, 0, 0, 0, 0, 0, '', 'Alluvius - Only Run SAI if summoned in Taunka le village'); + + +DELETE FROM `waypoints` WHERE `entry`IN(25456,25458); +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(25456, 1, 4525.928, 5677.233, 81.70667, 'Vision of Kaganishu'), +(25456, 2, 4527.502, 5678.359, 81.88042, 'Vision of Kaganishu'), +(25458, 1, 4528.928, 5679.599, 81.99405, 'Vision of Farseer Grimwalkers Spirit'), +(25458, 2, 4528.823, 5679.591, 83.10519, 'Vision of Farseer Grimwalkers Spirit'); + +DELETE FROM `event_scripts` WHERE `id`=16716; +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(16716, 5, 10, 25424, 16000, 0, 4529.002, 5679.642, 82.36562, 3.769911), +(16716, 6, 10, 25457, 15000, 0, 4528.024, 5680.72, 82.29639, 5.497787), +(16716, 6, 10, 25457, 15000, 0, 4530.323, 5680.649, 82.45662, 3.769911), +(16716, 6, 10, 25457, 15000, 0, 4529.922, 5678.596, 82.38788, 2.286381), +(16716, 7, 10, 25456, 14000, 0, 4525.962, 5677.239, 82.14642, 0.6290413), +(16716, 12, 10,25458, 9000, 0, 4528.883, 5679.529, 82.23911, 0.6290413); diff --git a/sql/updates/world/3.3.5/2016_08_03_00_world.sql b/sql/updates/world/3.3.5/2016_08_03_00_world.sql new file mode 100644 index 0000000000000..ee9a582d083c7 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_03_00_world.sql @@ -0,0 +1,2 @@ +-- +DELETE FROM `creature_addon` WHERE `guid`=84716; diff --git a/sql/updates/world/3.3.5/2016_08_03_01_world.sql b/sql/updates/world/3.3.5/2016_08_03_01_world.sql new file mode 100644 index 0000000000000..e535f2e786f24 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_03_01_world.sql @@ -0,0 +1,9 @@ +DELETE FROM `areatrigger_involvedrelation` WHERE `id`=4950; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=4950 AND `source_type`=2 AND `id`=1; +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 +(4950, 2, 1, 0, 46, 0, 100, 0, 4950, 0, 0, 0, 15, 12036, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'On Trigger - Complete quest'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=4950 AND `SourceId`=2; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 2, 4950, 2, 0, 9, 0, 12036, 0, 0, 0, 0, 0, '', 'Trigger - requires From the Depths of Azjol-Nerub'); diff --git a/sql/updates/world/3.3.5/2016_08_03_02_world.sql b/sql/updates/world/3.3.5/2016_08_03_02_world.sql new file mode 100644 index 0000000000000..0179449e6cc3c --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_03_02_world.sql @@ -0,0 +1,303 @@ +SET @OGUID:=74772; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+26; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@OGUID+0 , 188691, 571, 1, 1, 4049.076, -3725.035, 222.8353, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) -- Vordrassil's Seed +(@OGUID+1 , 188691, 571, 1, 1, 4001.214, -3765.898, 114.5079, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+2 , 188691, 571, 1, 1, 4039.253, -3717, 144.1972, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+3 , 188691, 571, 1, 1, 4060.134, -3802.432, 122.2398, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+4 , 188691, 571, 1, 1, 4034.984, -3799.606, 114.0969, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+5 , 188691, 571, 1, 1, 4089.661, -3676.995, 178.8947, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+6 , 188691, 571, 1, 1, 4111.052, -3677.905, 179.8427, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+7 , 188691, 571, 1, 1, 4127.012, -3665.212, 179.5133, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+8 , 188691, 571, 1, 1, 4184.179, -3762.825, 126.697, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+9 , 188691, 571, 1, 1, 4224.181, -3778.01, 183.52, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+10, 188691, 571, 1, 1, 4208.241, -3747.861, 124.9824, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+11, 188691, 571, 1, 1, 4209.658, -3755.583, 181.8647, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+12, 188691, 571, 1, 1, 4204.343, -3851.42, 181.1544, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+13, 188691, 571, 1, 1, 3890.3, -3731.524, 177.5446, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+14, 188691, 571, 1, 1, 3888.587, -3787.781, 181.266, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+15, 188691, 571, 1, 1, 3850.862, -3841.207, 178.9151, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+16, 188691, 571, 1, 1, 3865.623, -3868.439, 178.9035, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+17, 188691, 571, 1, 1, 3910.82, -3863.681, 179.8728, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+18, 188691, 571, 1, 1, 3882.307, -3897.07, 177.2399, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+19, 188691, 571, 1, 1, 3902.865, -3893.974, 177.7818, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+20, 188691, 571, 1, 1, 4198.049, -3876.462, 178.5676, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+21, 188691, 571, 1, 1, 4109.072, -3910.161, 174.2324, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+22, 188691, 571, 1, 1, 4198.53, -3916.613, 177.4275, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+23, 188691, 571, 1, 1, 4087.799, -3926.196, 175.3997, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+24, 188691, 571, 1, 1, 4018.979, -3980.839, 168.2293, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+25, 188691, 571, 1, 1, 4061.722, -3963.128, 168.4298, 5.811947, 0, 0, 0, 1, 120, 255, 1), -- 188691 (Area: 395) +(@OGUID+26, 188691, 571, 1, 1, 4006.32, -3979.95, 168.1229, 5.811947, 0, 0, 0, 1, 120, 255, 1); -- 188691 (Area: 395) + +SET @CGUID:=145573; +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+82; +INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `curhealth`) VALUES +(@CGUID+0 , 26357, 571, 3879.237, -3760.305, 176.7235, 2.193023, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) -- Frostpaw Warrior +(@CGUID+1 , 26357, 571, 3869.679, -3756.928, 176.3351, 0.1116352, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+2 , 26357, 571, 3821.76, -3761.004, 173.5642, 0.3028143, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+3 , 26357, 571, 3877.058, -3859.821, 178.8136, 4.25889, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+4 , 26357, 571, 3878.248, -3861.027, 178.8644, 3.807764, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+5 , 26357, 571, 3864.086, -3845.099, 179.0016, 4.779684, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement) +(@CGUID+6 , 26357, 571, 3897.301, -3881.822, 179.0855, 0.1410686, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+7 , 26357, 571, 3971.117, -3830.09, 224.0997, 6.256703, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement) +(@CGUID+8 , 26357, 571, 3971, -3901.663, 190.3317, 2.752203, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+9 , 26357, 571, 3977.379, -4022.655, 176.8455, 3.264833, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+10, 26357, 571, 3982.721, -4016.198, 174.7489, 5.433867, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+11, 26357, 571, 4045.729, -3912.388, 203.9128, 3.565682, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+12, 26357, 571, 4001.404, -4028.513, 175.833, 3.631839, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+13, 26357, 571, 4096.433, -3906.757, 176.4102, 2.377615, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement) +(@CGUID+14, 26357, 571, 4080.8, -4039.988, 172.2695, 2.539905, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+15, 26357, 571, 4198.01, -3910.091, 178.1277, 2.479687, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+16, 26357, 571, 4145.057, -3789.465, 195.275, 1.812423, 120, 10, 0), -- 26357 (Area: 395) (possible waypoints or random movement) +(@CGUID+17, 26357, 571, 4213.179, -3781.989, 182.7321, 6.008373, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+18, 26357, 571, 4170.634, -3704.126, 179.8536, 5.658669, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+19, 26357, 571, 4073.11, -3775.6, 223.8053, 3.455384, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+20, 26357, 571, 4025.165, -3837.161, 222.9081, 4.105071, 120, 0, 0), -- 26357 (Area: 395) +(@CGUID+21, 26357, 571, 3900.035, -3757.717, 172.328, 3.56418, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+22, 26357, 571, 3861.08, -3730.731, 174.6297, 0.8339269, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+23, 26357, 571, 3799.124, -3783.812, 178.2991, 3.918704, 120, 0, 0), -- 26357 (Area: 395) (Auras: ) +(@CGUID+24, 26357, 571, 3691.749, -3849.967, 183.1454, 5.951573, 120, 0, 0), -- 26357 (Area: 0) +(@CGUID+25, 26357, 571, 3661.865, -3861.654, 191.6324, 0.541052, 120, 0, 0), -- 26357 (Area: 0) +(@CGUID+26, 26357, 571, 3593.146, -3971.567, 199.1834, 1.53589, 120, 0, 0), -- 26357 (Area: 4215) +(@CGUID+27, 26357, 571, 3497.097, -3657.63, 242.7636, 5.183628, 120, 0, 0), -- 26357 (Area: 4215) +(@CGUID+28, 26357, 571, 3477.05, -3671.698, 242.31, 5.410521, 120, 0, 0), -- 26357 (Area: 4215) +(@CGUID+29, 26357, 571, 3799.059, -3783.835, 178.3111, 3.915259, 120, 0, 0), -- 26357 (Area: 4215) (Auras: ) +(@CGUID+30, 26357, 571, 3796.123, -3822.649, 174.0334, 0.3137422, 120, 0, 0), -- 26357 (Area: 4215) +(@CGUID+31, 26357, 571, 3820.662, -3751.43, 173.4701, 0.0339255, 120, 0, 0), -- 26357 (Area: 0) (Auras: ) +(@CGUID+32, 26357, 571, 3855.45, -3818.902, 179.0332, 1.499981, 120, 0, 0), -- 26357 (Area: 0) +(@CGUID+33, 26356, 571, 4103.722, -3719.238, 213.3612, 2.808078, 120, 10, 0), -- 26356 (Area: 0) (Auras: ) (possible waypoints or random movement) -- Redfang Hunter +(@CGUID+34, 26356, 571, 4026.025, -3729.962, 222.1561, 4.505303, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement) +(@CGUID+35, 26356, 571, 4072.582, -3770.402, 223.6467, 4.213392, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement) +(@CGUID+36, 26356, 571, 3892.886, -3768.199, 174.3011, 3.430619, 120, 10, 0), -- 26356 (Area: 395) (possible waypoints or random movement) +(@CGUID+37, 26356, 571, 3905.209, -3759.375, 169.9874, 2.698826, 120, 10, 0), -- 26356 (Area: 395) (possible waypoints or random movement) +(@CGUID+38, 26356, 571, 3873.323, -3756.52, 176.2863, 3.253347, 120, 0, 0), -- 26356 (Area: 395) (Auras: ) +(@CGUID+39, 26356, 571, 3876.145, -3755.855, 176.2065, 0.07042629, 120, 0, 0), -- 26356 (Area: 395) (Auras: ) +(@CGUID+40, 26356, 571, 3820.561, -3771.664, 173.4297, 5.888169, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement) +(@CGUID+41, 26356, 571, 3818.421, -3750.936, 173.5778, 4.735462, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement) +(@CGUID+42, 26356, 571, 3895.245, -3886.765, 178.4925, 5.070431, 120, 10, 0), -- 26356 (Area: 395) (Auras: ) (possible waypoints or random movement) +(@CGUID+43, 26356, 571, 3930.054, -3910.088, 183.4956, 4.152149, 120, 10, 0), -- 26356 (Area: 395) (possible waypoints or random movement) +(@CGUID+44, 26356, 571, 3875.366, -3863.293, 178.6655, 0.6662612, 120, 0, 0), -- 26356 (Area: 395) +(@CGUID+45, 26356, 571, 3995.784, -3952.801, 171.0737, 4.834562, 120, 0, 0), -- 26356 (Area: 395) +(@CGUID+46, 26356, 571, 3978.649, -3942.981, 170.1882, 4.223697, 120, 0, 0), -- 26356 (Area: 395) +(@CGUID+47, 26356, 571, 4007.814, -3959.805, 172.7155, 5.529015, 120, 0, 0), -- 26356 (Area: 395) (Auras: ) +(@CGUID+48, 26356, 571, 4042.443, -3913.872, 203.2461, 0.0267967, 120, 0, 0), -- 26356 (Area: 395) (Auras: ) +(@CGUID+49, 26356, 571, 4176.536, -4007.584, 167.01, 1.487265, 120, 0, 0), -- 26356 (Area: 395) +(@CGUID+50, 26356, 571, 4149.791, -4016.912, 166.9085, 0.7246146, 120, 0, 0), -- 26356 (Area: 395) +(@CGUID+51, 26356, 571, 4216.706, -3782.983, 182.8609, 0.8818134, 120, 0, 0), -- 26356 (Area: 395) (Auras: ) +(@CGUID+52, 26356, 571, 4028.722, -3833.599, 222.7841, 3.872888, 120, 0, 0), -- 26356 (Area: 395) +(@CGUID+53, 26356, 571, 3886.695, -3837.735, 179.1514, 4.593853, 120, 0, 0), -- 26356 (Area: 395) (Auras: ) +(@CGUID+54, 24042, 571, 3850.287, -3810.284, 178.9985, 3.682645, 120, 0, 0), -- 24042 (Area: 395) -- Generic Trigger LAB +(@CGUID+55, 24042, 571, 3851.408, -3798.338, 185.194, 6.248279, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+56, 24042, 571, 3847.807, -3791.891, 185.1802, 4.817109, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+57, 24042, 571, 3840.402, -3799.909, 181.5622, 4.921828, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+58, 24042, 571, 3837.816, -3800.208, 178.2815, 2.234021, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+59, 24042, 571, 3827.984, -3809.152, 175.7139, 4.153883, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+60, 24042, 571, 3835.792, -3816.849, 177.7749, 2.426008, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+61, 24042, 571, 3909.943, -3885.461, 181.1191, 4.607669, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+62, 24042, 571, 3865.56, -3888.845, 177.7284, 1.884956, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+63, 24042, 571, 3871.915, -3875.688, 180.7031, 5.427974, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+64, 24042, 571, 3886.949, -3891.863, 178.0842, 0.6806784, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+65, 24042, 571, 3880.724, -3882.395, 178.8988, 0.418879, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+66, 24042, 571, 3901.444, -3902.951, 177.6381, 1.53589, 120, 0, 0), -- 24042 (Area: 395) +(@CGUID+67, 26436, 571, 3874.801, -3792.651, 178.9906, 2.949606, 120, 10, 0), -- 26436 (Area: 395) (Auras: ) (possible waypoints or random movement) -- Redfang Elder +(@CGUID+68, 26436, 571, 3822.412, -3779.1, 173.4248, 2.600541, 120, 10, 0), -- 26436 (Area: 395) (Auras: ) (possible waypoints or random movement) +(@CGUID+69, 26436, 571, 4084.101, -4017.483, 170.1538, 2.368356, 120, 0, 0), -- 26436 (Area: 395) (Auras: ) +(@CGUID+70, 26428, 571, 3807.165, -3809.847, 173.2943, 0.7853982, 120, 0, 0), -- 26428 (Area: 395) -- Frostpaw Shaman +(@CGUID+71, 26428, 571, 3762.819, -3785.132, 187.2933, 6.230825, 120, 0, 0), -- 26428 (Area: 395) +(@CGUID+72, 26428, 571, 3785.312, -3870.198, 179.0041, 0.6283185, 120, 0, 0), -- 26428 (Area: 395) +(@CGUID+73, 26428, 571, 4068.647, -3811.453, 223.3654, 2.653818, 120, 0, 0), -- 26428 (Area: 395) +(@CGUID+74, 26428, 571, 3670.685, -3835.09, 190.7745, 5.272768, 120, 10, 0), -- 26428 (Area: 0) (possible waypoints or random movement) +(@CGUID+75, 26357, 571, 3638.573, -3958.29, 184.6026, 0.6283185, 120, 0, 0), -- 26357 (Area: 0) -- Frostpaw Warrior +(@CGUID+76, 26434, 571, 3794.211, -3796.299, 177.9795, 6.195919, 120, 0, 0), -- 26434 (Area: 395) -- Frostpaw Trapper +(@CGUID+77, 26434, 571, 3792.02, -3823.878, 174.353, 0.3316126, 120, 0, 0), -- 26434 (Area: 395) +(@CGUID+78, 26434, 571, 3787.88, -3778.618, 180.399, 5.916666, 120, 0, 0), -- 26434 (Area: 395) +(@CGUID+79, 26434, 571, 3822.915, -3883.725, 177.7764, 0.1570796, 120, 0, 0), -- 26434 (Area: 395) +(@CGUID+80, 26434, 571, 3831.866, -3931.298, 180.3725, 0.8028514, 120, 0, 0), -- 26434 (Area: 395) +(@CGUID+81, 26434, 571, 3854.642, -3941.627, 182.1573, 1.186824, 120, 0, 0), -- 26434 (Area: 395) +(@CGUID+82, 26434, 571, 3868.795, -3952.046, 180.4138, 1.37881, 120, 0, 0); -- 26434 (Area: 395) + +-- Update spawn distance & movementype so they move around randomly +UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+26; +UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+29 AND @CGUID+53; +UPDATE `creature` SET `spawndist`=5, `MovementType`=1 WHERE `guid` BETWEEN @CGUID+67 AND @CGUID+82; + +-- Pathing for Frostpaw Shaman Entry: 26428 'TDB FORMAT' +SET @NPC := 101659; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3588.338,`position_y`=-3912.43,`position_z`=196.6769 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3588.338,-3912.43,196.6769,0,0,0,0,100,0), -- 09:55:20 +(@PATH,2,3588.173,-3912.414,196.4898,0,0,0,0,100,0), -- 09:55:26 +(@PATH,3,3580.502,-3912.278,197.8292,0,0,0,0,100,0), -- 09:55:29 +(@PATH,4,3569.688,-3912.361,199.2898,0,0,0,0,100,0), -- 09:55:34 +(@PATH,5,3568.212,-3912.104,199.2802,0,0,0,0,100,0), -- 09:55:41 +(@PATH,6,3562.38,-3906.169,199.7104,0,0,0,0,100,0), -- 09:55:46 +(@PATH,7,3560.485,-3895.428,200.3166,0,0,0,0,100,0), -- 09:55:51 +(@PATH,8,3539.613,-3890.547,205.4668,0,0,0,0,100,0), -- 09:55:54 +(@PATH,9,3528.841,-3882.14,208.4974,0,0,0,0,100,0), -- 09:56:08 +(@PATH,10,3524.06,-3863.459,214.6403,0,0,0,0,100,0), -- 09:56:16 +(@PATH,11,3525.18,-3848.973,217.9511,0,0,0,0,100,0), -- 09:56:28 +(@PATH,12,3528.96,-3837.769,220.407,0,0,0,0,100,0), -- 09:56:37 +(@PATH,13,3530.571,-3804.345,224.4586,0,0,0,0,100,0), -- 09:56:47 +(@PATH,14,3527.41,-3780.331,225.1916,0,0,0,0,100,0), -- 09:57:06 +(@PATH,15,3525.282,-3756.282,228.4059,0,0,0,0,100,0), -- 09:57:20 +(@PATH,16,3510.197,-3744.293,230.4912,0,0,0,0,100,0), -- 09:57:34 +(@PATH,17,3500.498,-3732.984,231.0331,0,0,0,0,100,0), -- 09:57:47 +(@PATH,18,3494.976,-3718.273,232.0333,0,0,0,0,100,0), -- 09:57:57 +(@PATH,19,3494.382,-3715.592,232.0598,0,0,0,0,100,0), -- 09:58:05 +(@PATH,20,3495.405,-3699.1,231.7552,0,0,0,0,100,0), -- 09:58:15 +(@PATH,21,3501.611,-3689.164,231.9368,0,0,0,0,100,0), -- 09:58:22 +(@PATH,22,3511.642,-3684.653,231.8804,0,0,0,0,100,0), -- 09:58:28 +(@PATH,23,3525.416,-3684.77,231.6663,0,0,0,0,100,0), -- 09:58:37 +(@PATH,24,3525.127,-3684.767,231.6062,0,0,0,0,100,0), -- 09:58:46 +(@PATH,25,3525.148,-3684.727,231.8664,0,0,0,0,100,0), -- 09:58:53 +(@PATH,26,3511.393,-3684.857,231.6934,0,0,0,0,100,0), -- 09:59:01 +(@PATH,27,3501.216,-3689.363,231.9671,0,0,0,0,100,0), -- 09:59:07 +(@PATH,28,3495.221,-3699.442,231.8276,0,0,0,0,100,0), -- 09:59:15 +(@PATH,29,3497.122,-3726.3,231.5606,0,0,0,0,100,0), -- 09:59:24 +(@PATH,30,3504.481,-3738.602,230.8245,0,0,0,0,100,0), -- 09:59:34 +(@PATH,31,3510.197,-3744.293,230.4912,0,0,0,0,100,0), -- 09:57:34 +(@PATH,32,3524.331,-3754.838,228.9258,0,0,0,0,100,0), -- 09:59:43 +(@PATH,33,3526.505,-3775.408,225.6859,0,0,0,0,100,0), -- 09:59:56 +(@PATH,34,3530.599,-3800.592,224.8364,0,0,0,0,100,0), -- 10:00:09 +(@PATH,35,3530.5,-3830.635,221.5797,0,0,0,0,100,0), -- 10:00:24 +(@PATH,36,3526.106,-3846.375,219.0367,0,0,0,0,100,0), -- 10:00:43 +(@PATH,37,3524.411,-3859.844,215.7675,0,0,0,0,100,0), -- 10:00:52 +(@PATH,38,3527.364,-3880.439,209.3438,0,0,0,0,100,0), -- 10:01:01 +(@PATH,39,3538.28,-3889.869,205.931,0,0,0,0,100,0), -- 10:01:12 +(@PATH,40,3558.303,-3894.219,200.8895,0,0,0,0,100,0), -- 10:01:22 +(@PATH,41,3560.166,-3894.849,200.1797,0,0,0,0,100,0), -- 10:01:35 +(@PATH,42,3562.815,-3898.638,199.7,0,0,0,0,100,0), -- 10:01:38 +(@PATH,43,3562.38,-3906.169,199.7104,0,0,0,0,100,0), -- 09:55:46 +(@PATH,44,3567.723,-3911.692,199.3717,0,0,0,0,100,0), -- 10:01:43 +(@PATH,45,3578.139,-3912.183,198.1925,0,0,0,0,100,0), -- 10:01:48 +(@PATH,46,3583.498,-3912.365,197.4213,0,0,0,0,100,0), -- 10:01:55 +(@PATH,47,3588.46,-3912.435,196.6265,0,0,0,0,100,0); -- 10:02:00 +-- 0x203930476019CF0000030D00000C69EF .go 3588.338 -3912.43 196.6769 + +-- Pathing for Frostpaw Shaman Entry: 26428 'TDB FORMAT' +SET @NPC := 101658; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3633.149,`position_y`=-3857.641,`position_z`=191.463 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3633.149,-3857.641,191.463,0,0,0,0,100,0), -- 09:51:31 +(@PATH,2,3633.018,-3857.819,191.1933,0,0,0,0,100,0), -- 09:51:41 +(@PATH,3,3631.676,-3872.631,190.7729,0,0,0,0,100,0), -- 09:51:49 +(@PATH,4,3631.376,-3874.811,190.6524,0,0,0,0,100,0), -- 09:51:59 +(@PATH,5,3625.465,-3884.832,190.824,0,0,0,0,100,0), -- 09:53:09 +(@PATH,6,3624.28,-3885.842,191.2049,0,0,0,0,100,0), -- 09:52:57 +(@PATH,7,3613.153,-3893.728,193.0957,0,0,0,0,100,0), -- 09:52:06 +(@PATH,8,3606.48,-3897.225,194.7092,0,0,0,0,100,0), -- 09:52:50 +(@PATH,9,3601.187,-3898.144,195.6989,0,0,0,0,100,0), -- 09:52:18 +(@PATH,10,3596.7,-3899.317,196.3635,0,0,0,0,100,0), -- 09:52:27 +(@PATH,11,3591.105,-3897.377,196.9956,0,0,0,0,100,0), -- 09:52:46 +(@PATH,12,3587.069,-3893.888,197.4965,0,0,0,0,100,0), -- 09:52:30 +(@PATH,13,3588.063,-3894.848,197.3372,0,0,0,0,100,0), -- 09:52:39 +(@PATH,14,3591.105,-3897.377,196.9956,0,0,0,0,100,0), -- 09:52:46 +(@PATH,15,3596.7,-3899.317,196.3635,0,0,0,0,100,0), -- 09:52:27 +(@PATH,16,3601.187,-3898.144,195.6989,0,0,0,0,100,0), -- 09:52:18 +(@PATH,17,3606.48,-3897.225,194.7092,0,0,0,0,100,0), -- 09:52:50 +(@PATH,18,3613.153,-3893.728,193.0957,0,0,0,0,100,0), -- 09:52:06 +(@PATH,19,3624.28,-3885.842,191.2049,0,0,0,0,100,0), -- 09:52:57 +(@PATH,20,3625.465,-3884.832,190.824,0,0,0,0,100,0), -- 09:53:09 +(@PATH,21,3631.376,-3874.811,190.6524,0,0,0,0,100,0), -- 09:51:59 +(@PATH,22,3631.676,-3872.631,190.7729,0,0,0,0,100,0), -- 09:51:49 +(@PATH,23,3632.195,-3866.898,191.0448,0,0,0,0,100,0), -- 09:53:17 +(@PATH,24,3633.313,-3857.507,191.4412,0,0,0,0,100,0); -- 09:53:26 +-- 0x203930476019CF0000030D00000C6A80 .go 3633.149 -3857.641 191.463 + +-- Pathing for Frostpaw Shaman Entry: 26428 'TDB FORMAT' +SET @NPC := 145647; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3648.541,`position_y`=-3814.498,`position_z`=190.925 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3648.541,-3814.498,190.925,0,0,0,0,100,0), -- 09:52:02 +(@PATH,2,3652.493,-3822.352,191.1677,0,0,0,0,100,0), -- 09:52:12 +(@PATH,3,3671.021,-3835.209,191.0056,0,0,0,0,100,0), -- 09:52:32 +(@PATH,4,3675.492,-3846.821,191.0968,0,0,0,0,100,0), -- 09:52:39 +(@PATH,5,3676.12,-3845.173,191.1244,0,0,0,0,100,0), -- 09:52:51 +(@PATH,6,3672.284,-3837.276,190.8509,0,0,0,0,100,0), -- 09:53:02 +(@PATH,7,3670.633,-3834.835,190.8977,0,0,0,0,100,0), -- 09:53:08 +(@PATH,8,3652.493,-3822.352,191.1677,0,0,0,0,100,0), -- 09:52:12 +(@PATH,9,3648.31,-3814.437,190.9192,0,0,0,0,100,0); -- 09:53:21 +-- 0x203930476019CF000002D600008C3941 .go 3648.541 -3814.498 190.925 + +-- Pathing for Frostpaw Warrior Entry: 26357 'TDB FORMAT' +SET @NPC := 145580; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=3985.092,`position_y`=-3842.579,`position_z`=223.7648 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,3985.092,-3842.579,223.7648,0,0,0,0,100,0), -- 09:46:46 +(@PATH,2,3983.845,-3838.281,223.705,0,0,0,0,100,0), -- 09:46:48 +(@PATH,3,3982.509,-3835.532,224.0413,0,0,0,0,100,0), -- 09:46:49 +(@PATH,4,3970.937,-3830.248,224.1597,0,0,0,0,100,0), -- 09:46:50 +(@PATH,5,3963.993,-3831.297,224.1532,0,0,0,0,100,0), -- 09:46:55 +(@PATH,6,3963.007,-3831.464,224.1532,0,0,0,0,100,0), -- 09:46:55 +(@PATH,7,3968.315,-3830.015,224.1386,0,0,0,0,100,0), -- 09:46:55 +(@PATH,8,3970.55,-3830.074,224.0992,0,0,0,0,100,0), -- 09:46:55 +(@PATH,9,3976.947,-3830.244,224.1054,0,0,0,0,100,0), -- 09:46:55 +(@PATH,10,3986.181,-3833.333,224.1631,0,0,0,0,100,0), -- 09:46:56 +(@PATH,11,3985.167,-3842.387,223.7295,0,0,0,0,100,0); -- 09:46:57 +-- 0x203930476019BD400002D600018C3943 .go 3985.092 -3842.579 223.7648 + +-- Frostpaw Shaman SAI +SET @ENTRY := 26428; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,1,0,100,1,0,0,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Out of Combat - Enable Combat Movement (No Repeat)"), +(@ENTRY,0,2,3,4,0,100,1,0,0,0,0,11,12058,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frostpaw Shaman - On Aggro - Cast 'Chain Lightning' (No Repeat)"), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - On Aggro - Increment Phase By 1 (No Repeat)"), +(@ENTRY,0,4,0,9,2,100,0,0,30,6000,7000,11,12058,0,0,0,0,0,2,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 0-30 Range - Cast 'Chain Lightning' (No Repeat)"), +(@ENTRY,0,5,6,3,2,100,1,0,7,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Between 0-7% Mana - Enable Combat Movement (Phase 2) (No Repeat)"), +(@ENTRY,0,6,0,61,2,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Between 0-7% Mana - Increment Phase By 1 (Phase 2) (No Repeat)"), +(@ENTRY,0,7,0,9,2,100,1,25,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 25-80 Range - Enable Combat Movement (Phase 2) (No Repeat)"), +(@ENTRY,0,8,0,9,2,100,1,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 5-15 Range - Disable Combat Movement (Phase 2) (No Repeat)"), +(@ENTRY,0,9,0,9,2,100,1,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Within 0-5 Range - Enable Combat Movement (Phase 2) (No Repeat)"), +(@ENTRY,0,10,0,3,2,100,0,15,100,100,100,23,0,1,0,0,0,0,1,0,0,0,0,0,0,0,"Frostpaw Shaman - Between 15-100% Mana - Decrement Phase By 1 (Phase 2) (No Repeat)"), +(@ENTRY,0,11,0,14,0,100,0,2000,40,15000,20000,11,25420,1,0,0,0,0,7,0,0,0,0,0,0,0,"Frostpaw Shaman - Friendly At 2000 Health - Cast 'Lesser Healing Wave' (Phase 2) (No Repeat)"), +(@ENTRY,0,12,0,6,0,100,1,0,0,0,0,11,47033,39,0,0,0,0,2,0,0,0,0,0,0,0,"Frostpaw Shaman - On Just Died - Cast 'Redfang Ally' (Phase 2) (No Repeat)"); + +-- Redfang Hunter SAI +SET @ENTRY := 26356; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,1,0,100,1,0,0,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Out of Combat - Enable Combat Movement (No Repeat)"), +(@ENTRY,0,1,0,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Out of Combat - Stop Attacking (No Repeat)"), +(@ENTRY,0,2,3,4,0,100,1,0,0,0,0,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - On Aggro - Cast 'Shoot' (No Repeat)"), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - On Aggro - Increment Phase (No Repeat)"), +(@ENTRY,0,4,5,9,1,100,0,5,30,2300,3900,11,6660,0,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-30 Range - Cast 'Shoot' (Phase 1)"), +(@ENTRY,0,5,0,61,1,100,0,5,30,2300,3900,40,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-30 Range - Set Sheath Ranged (Phase 1)"), +(@ENTRY,0,6,7,9,1,100,0,25,80,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 25-80 Range - Enable Combat Movement (Phase 1)"), +(@ENTRY,0,7,0,61,1,100,0,25,80,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 25-80 Range - Start Attacking (Phase 1)"), +(@ENTRY,0,8,9,9,1,100,0,0,5,0,0,21,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Enable Combat Movement (Phase 1)"), +(@ENTRY,0,9,10,61,1,100,0,0,5,0,0,40,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Set Sheath Melee (Phase 1)"), +(@ENTRY,0,10,0,61,1,100,0,0,5,0,0,20,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Start Attacking (Phase 1)"), +(@ENTRY,0,11,12,9,1,100,0,5,15,0,0,21,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-15 Range - Disable Combat Movement (Phase 1)"), +(@ENTRY,0,12,0,61,1,100,0,5,15,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - Within 5-15 Range - Stop Attacking (Phase 1)"), +(@ENTRY,0,13,0,9,0,100,0,0,20,11000,16000,11,12024,1,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-20 Range - Cast 'Net'"), +(@ENTRY,0,14,0,9,0,100,0,0,5,4000,7000,11,30639,0,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - Within 0-5 Range - Cast 'Carnivorous Bite'"), +(@ENTRY,0,15,0,7,0,100,1,0,0,0,0,40,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Redfang Hunter - On Evade - Set Sheath Melee (No Repeat)"), +(@ENTRY,0,16,0,6,0,100,1,0,0,0,0,11,47034,39,0,0,0,0,2,0,0,0,0,0,0,0,"Redfang Hunter - On Just Died - Cast 'Frostpaw Ally' (No Repeat)"); + +-- Generic Trigger LAB SAI +SET @ENTRY := 24042; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,1,38,0,100,0,1,1,0,0,11,60484,0,0,0,0,0,1,0,0,0,0,0,0,0,"Generic Trigger LAB - On Data Set 1 1 - Cast 'Heart Explosion'"), +(@ENTRY,0,1,0,61,0,100,0,1,1,0,0,11,60532,0,0,0,0,0,1,0,0,0,0,0,0,0,"Generic Trigger LAB - On Data Set 1 1 - Cast 'Heart Explosion Effects'"), +(@ENTRY,0,2,1,38,0,100,0,2,1,0,0,11,42532,0,0,0,0,0,1,0,0,0,0,0,0,0,"Generic Trigger LAB - On Data Set 2 1 - Cast 'Explosion'"); diff --git a/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql b/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql new file mode 100644 index 0000000000000..09f5768c7a130 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql @@ -0,0 +1,63 @@ +-- NPC ID 9021 Kharan Mighthammer, Quest ID 4001 'What Is Going On?' and 4342 'Kharan's Tale' +SET @Kharan := 9021; + +UPDATE `creature_template` SET `AIName`= 'SmartAI', `ScriptName`= '' WHERE `entry` = @Kharan; + +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = @Kharan); +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 +(@Kharan,0,0,0, 10,0,100,0, 0,20,0,0, 1, 0,3000,0,0,0,0,7,0,0,0,0,0,0,0,'Kharan Mighthammer - Within 0-20 Range Out of Combat LoS - Say Line 0'), +(@Kharan,0,1,2, 62,0,100,0,1823, 0,0,0, 72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,'Kharan Mighthammer - on Gossip option 0 selected - Close Gossip'), +(@Kharan,0,2,0, 61,0,100,0, 0, 0,0,0, 15,4342, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Kharan Mighthammer - on Gossip option 0 selected - Quest Credit 'Kharan's Tale'"), +(@Kharan,0,3,4, 62,0,100,0,1839, 0,0,0, 72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,'Kharan Mighthammer - on Gossip option 0 selected - Close Gossip'), +(@Kharan,0,4,0, 61,0,100,0, 0, 0,0,0, 15,4001, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Kharan Mighthammer - on Gossip option 0 selected - Credit Quest 'What Is Going On?'"); + +DELETE FROM `creature_text` WHERE `entry` = @Kharan; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@Kharan,0,0,'Key... get the key... Gerstahn has... key.', 12,0,100,0,0,0,4723,0,'Kharan Mighthammer'), +(@Kharan,0,1,'Try and make yourself useful, $r. GET ME OUT OF HERE! The High Interrogator has the key.',12,0,100,0,0,0,4724,0,'Kharan Mighthammer'), +(@Kharan,0,2,'HEY! HEY YOU! $R! Get me out of here!', 12,0,100,0,0,0,4725,0,'Kharan Mighthammer'), +(@Kharan,0,3,'%s groans.', 16,0,100,0,0,0,4726,0,'Kharan Mighthammer'); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 1821 AND 1839; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`) VALUES +(1822,0,0,"All is not lost, Kharan!", 4734,1,1,1828,0,0,0,'',0), +(1828,1,0,"Continue...", 5256,1,1,1827,0,0,0,'',0), +(1827,0,0,"So what happened?", 4742,1,1,1826,0,0,0,'',0), +(1826,0,0,"So you suspect that someone on the inside was involved? That they were tipped off?", 4744,1,1,1825,0,0,0,'',0), +(1825,0,0,"Continue with your story please.", 4746,1,1,1824,0,0,0,'',0), +(1824,0,0,"Indeed.", 4748,1,1,1823,0,0,0,'',0), +(1823,0,0,"The door is open, Kharan. You are a free man.", 5257,1,1, 0,0,0,0,'',0), +(1822,1,0,"I am not here to harm you, Kharan. Gor'shak sent me. He told me that you would speak to me about the Princess.", 4732,1,1,1831,0,0,0,'',0), +(1831,0,0,"All is not lost, Kharan!", 4734,1,1,1832,0,0,0,'',0), +(1832,0,0,"Because you are still alive and my hands aren't gripped firmly around your stubby little neck.", 4736,1,1,1833,0,0,0,'',0), +(1833,0,0,"Nothing. My orders were to speak with you and then speak with Thrall. All I know is that Thrall is interested in saving your princess.",4738,1,1,1834,0,0,0,'',0), +(1834,0,0,"Which would explain why you're sitting in a jail cell at the bottom of a mountain, right, dwarf?", 4740,1,1,1835,0,0,0,'',0), +(1835,0,0,"So what happened?", 4742,1,1,1836,0,0,0,'',0), +(1836,0,0,"So you suspect that someone on the inside was involved? That they were tipped off?", 4744,1,1,1837,0,0,0,'',0), +(1837,0,0,"Continue with your story please.", 4746,1,1,1838,0,0,0,'',0), +(1838,0,0,"Indeed.", 4748,1,1,1839,0,0,0,'',0), +(1839,0,0,"If it's any consolation, I'll be leaving the cell door open. How you get out is your problem. Good bye, Kharan.", 4750,1,1, 0,0,0,0,'',0); + +DELETE FROM `gossip_menu` WHERE `entry`= 1822 AND `text_id`= 2473 OR `entry` BETWEEN 1831 AND 1839; +INSERT INTO `gossip_menu` (`entry`,`text_id`,`VerifiedBuild`) VALUES +(1822, 2473, 0), +(1831, 2474, 0), +(1832, 2475, 0), +(1833, 2476, 0), +(1834, 2477, 0), +(1835, 2478, 0), +(1836, 2479, 0), +(1837, 2480, 0), +(1838, 2481, 0), +(1839, 2482, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`= 1822 AND `SourceEntry` IN (0,1,2473,2474) AND `SourceId`= 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,1822,2473,0,1, 9,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 text id 2473 if quest 'What Is Going On?' has been taken. -OR-"), +(14,1822,2474,0,2,14,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'What Is Going On?' has not been taken. -OR-"), +(14,1822,2474,0,3,28,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'What Is Going On?' has been completed. -OR-"), +(15,1822, 1,0,0, 9,0,4001,0,0,0,0,0,'', "Show gossip menu 1822 option id 1 if quest 'What Is Going On?' has been taken."), +(14,1822,2474,0,4, 9,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'Kharan's Tale' has been taken. -OR-"), +(14,1822,2474,0,5,14,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'Kharan's Tale' has not been taken. -OR-"), +(14,1822,2474,0,6,28,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 text id 2474 if quest 'Kharan's Tale' has been completed. -OR-"), +(15,1822, 0,0,0, 9,0,4342,0,0,0,0,0,'', "Show gossip menu 1822 option id 0 if quest 'Kharan's Tale' has been taken."); diff --git a/sql/updates/world/3.3.5/2016_08_04_01_world.sql b/sql/updates/world/3.3.5/2016_08_04_01_world.sql new file mode 100644 index 0000000000000..4871f6de86a1b --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_04_01_world.sql @@ -0,0 +1,5 @@ +-- animal handler, spell ranks +DELETE FROM `spell_ranks` WHERE `first_spell_id` = 34453; +INSERT INTO `spell_ranks` (`first_spell_id`,`spell_id`,`rank`) VALUES +(34453, 34453, 1), -- Animal Handler, Rank 1 +(34453, 34454, 2); -- Animal Handler, Rank 2 diff --git a/sql/updates/world/3.3.5/2016_08_04_02_world.sql b/sql/updates/world/3.3.5/2016_08_04_02_world.sql new file mode 100644 index 0000000000000..f7611942a2889 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_04_02_world.sql @@ -0,0 +1,63 @@ +-- +SET @CGUID := 85647; + +-- missing creatures +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+5; +DELETE FROM `creature` WHERE `guid` IN (56866,57621,57682); +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `PhaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES +(@CGUID+0, 15271, 530, 0, 0, 1, 1, 0, 0, 10270.9, -6519.52, 63.4511, 0.647896, 120, 5, 0, 0, 0, 1, 0, 0, 0, 20886), +(@CGUID+1, 15649, 530, 0, 0, 1, 1, 0, 0, 9320.62, -7323.15, 15.5084, 5.89452, 120, 5, 0, 0, 0, 1, 0, 0, 0, 20886), +(@CGUID+2, 15649, 530, 0, 0, 1, 1, 0, 0, 9324.59, -6823.18, 18.9366, 2.39027, 120, 5, 0, 0, 0, 1, 0, 0, 0, 20886), +(@CGUID+3, 15649, 530, 0, 0, 1, 1, 0, 0, 9356, -7347.08, 12.2037, 1.3481, 120, 5, 0, 0, 0, 1, 0, 0, 0, 20886), +(@CGUID+4, 15654, 530, 0, 0, 1, 1, 0, 0, 9280.22, -7007.69, 6.44821, 5.97162, 120, 5, 0, 0, 0, 1, 0, 0, 0, 20886), +(@CGUID+5, 16221, 530, 0, 0, 1, 1, 0, 0, 9363.16, -7314.13, 7.11649, 5.64581, 120, 0, 0, 0, 0, 0, 0, 0, 0, 20886), +(56866, 16192, 530, 0, 0, 1, 1, 0, 0, 9376.08, -7165.45, 9.04866, 3.1765, 120, 0, 0, 0, 0, 0, 0, 0, 0, 20886), +(57621, 16626, 530, 0, 0, 1, 1, 0, 0, 9453.1, -7138.56, 16.1339, 0.0120617, 120, 0, 0, 0, 0, 0, 0, 0, 0, 20886), +(57682, 16693, 530, 0, 0, 1, 1, 0, 0, 9451.74, -7122.86, 16.1392, 6.12848, 120, 0, 0, 0, 0, 0, 0, 0, 0, 20886); + +UPDATE `creature` SET `spawntimesecs`=120 WHERE `spawntimesecs`=300 AND `id` IN (1420,6368,15367,15366,15372,15273,15298,13321,721,2914,6271,15271,15294,15649,15654); +UPDATE `creature` SET `spawntimesecs`=120 WHERE `id` IN (27946); +UPDATE `creature` SET `spawntimesecs`=30 WHERE `id` IN (44937); +UPDATE `creature` SET `spawndist`=10 AND `MovementType` =1 WHERE `id` IN (61080,61081,61141,61142,2914,6271) AND `MovementType`=0; +UPDATE `creature` SET `spawndist`=5 AND `MovementType` =1 WHERE `id` IN (6271,15271,15294,15649,15654,15298) AND `MovementType`=0; + +-- missing creature texts +DELETE FROM `creature_text` WHERE `entry` IN (15416) AND `id`=0; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(15416, 0, 0, "Slay them! Don't let the Scourge scum defile our city!", 14, 0, 100, 0, 0, 0, 12861, 0, 'Ranger Jaela to Rotlimb Cannibal'); +UPDATE `creature_text` SET `comment`='Novice Ranger' WHERE `entry`=16923 AND `id`=0; + +-- missing npc_text +UPDATE `npc_text` SET `VerifiedBuild` = 20886 WHERE `ID` = 7882; +UPDATE `npc_text` SET `BroadcastTextID0` = 14774, `VerifiedBuild` = 20886 WHERE `ID` = 7904; +UPDATE `npc_text` SET `BroadcastTextID0` = 14192, `VerifiedBuild` = 20886 WHERE `ID` = 9007; +UPDATE `npc_text` SET `BroadcastTextID0` = 14767, `VerifiedBuild` = 20886 WHERE `ID` = 9188; +UPDATE `npc_text` SET `VerifiedBuild` = 20886 WHERE `ID` = 9190; +UPDATE `npc_text` SET `VerifiedBuild` = 20886 WHERE `ID` = 9191; +UPDATE `npc_text` SET `BroadcastTextID0` = 44401, `VerifiedBuild` = 20886 WHERE `ID` = 16541; + +DELETE FROM `npc_text` WHERE `ID`=19889; +INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `BroadcastTextID0`, `lang0`, `Probability0`, `em0_0`, `em0_1`) VALUES +(19889, 'How may I help you?', 'How may I help you?', 61023, 0, 1, 0, 0); + +-- missing quest stuff +DELETE FROM `quest_details` WHERE `ID` IN (8563,10073); +INSERT INTO `quest_details` (`ID`, `Emote1`, `Emote2`, `Emote3`, `Emote4`, `EmoteDelay1`, `EmoteDelay2`, `EmoteDelay3`, `EmoteDelay4`, `VerifiedBuild`) VALUES +(8563, 1, 1, 0, 0, 0, 0, 0, 0, 20886), +(10073, 1, 1, 0, 0, 0, 1000, 0, 0, 20886); + +UPDATE `quest_request_items` SET `EmoteOnComplete` = 2, `VerifiedBuild` = 20886 WHERE `ID` = 8350; +UPDATE `quest_request_items` SET `EmoteOnComplete` = 0, `CompletionText` = 'Have you mastered Corruption?', `VerifiedBuild` = 20886 WHERE `ID` = 10073; + +UPDATE `quest_offer_reward` SET `Emote1` = 4, `Emote2` = 1, `VerifiedBuild` = 20886 WHERE `ID` = 8325; +UPDATE `quest_offer_reward` SET `Emote1` = 4, `Emote2` = 1, `RewardText` = 'The tower and surrounding areas should now be relatively secure, though only for the time being. You have done well in providing us with a buffer of security, but we will need to reassert control over the entire isle if we are to survive here in the long run. This will involve tackling much greater threats than errant mana wyrms and lynxes.$B$BTake this, $n - you will no doubt make good use of it for the tasks to come.', `VerifiedBuild` = 20886 WHERE `ID` = 8326; +UPDATE `quest_offer_reward` SET `Emote1` = 2, `Emote2` = 1, `VerifiedBuild` = 20886 WHERE `ID` = 8350; +UPDATE `quest_offer_reward` SET `Emote1` = 1, `Emote2` = 1, `RewardText` = '$n - your name has passed my ears as one seeking out a master in the ways of the warlock. You look capable enough, but I seek more than just looks from my students. You must be ready to delve where others fear to look to gain your power. I will teach you, but I will not tolerate failure.$B$BThere will be monetary costs associated with your training, but you should be more concerned with the cost your mind is willing to make. If you are ready, we shall begin.', `VerifiedBuild` = 20886 WHERE `ID` = 8563; +UPDATE `quest_offer_reward` SET `Emote1` = 1, `RewardText` = 'Well done, $n. You are quickly becoming one of my best students and I look forward to continuing your training in the future.', `VerifiedBuild` = 20886 WHERE `ID` = 10073; + +UPDATE `quest_template` SET `RewardBonusMoney` = 60, `VerifiedBuild` = 20886 WHERE `ID` = 8325; +UPDATE `quest_template` SET `RewardBonusMoney` = 300, `VerifiedBuild` = 20886 WHERE `ID` = 8326; +UPDATE `quest_template` SET `VerifiedBuild` = 20886 WHERE `ID` = 8327; +UPDATE `quest_template` SET `RewardBonusMoney` = 60, `VerifiedBuild` = 20886 WHERE `ID` = 8350; +UPDATE `quest_template` SET `RewardBonusMoney` = 60, `VerifiedBuild` = 20886 WHERE `ID` = 8563; +UPDATE `quest_template` SET `RewardBonusMoney` = 150, `VerifiedBuild` = 20886 WHERE `ID` = 10073; diff --git a/sql/updates/world/3.3.5/2016_08_04_03_world.sql b/sql/updates/world/3.3.5/2016_08_04_03_world.sql new file mode 100644 index 0000000000000..f7bce378a47f9 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_04_03_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `smart_scripts` SET `action_type`=49, `target_type`=19, `target_param1`=26653, `target_param2`=40, `comment`="Anub'ar Underlord - On Script - Start attack" WHERE `entryorguid`=2660500 AND `source_type`=9 AND `id`=8; diff --git a/sql/updates/world/3.3.5/2016_08_04_04_world_335.sql b/sql/updates/world/3.3.5/2016_08_04_04_world_335.sql new file mode 100644 index 0000000000000..c675a4e2ee588 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_04_04_world_335.sql @@ -0,0 +1,7 @@ +-- NPC ID 2058 Deathstalker Faerleia, Quest ID 452 'Pyrewood Ambush' +SET @Faerleia := 2058; + +DELETE FROM `creature_text` WHERE `entry` = @Faerleia; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@Faerleia,0,0,'Be ready, $n. I hear the council returning. Prepare to ambush!',12,0,100,0,0,0,542,0,'Deathstalker Faerleia - SAY_PREPARE_TO_AMBUSH'), +(@Faerleia,1,0,'Well done. A blow to Arugal no doubt!', 12,0,100,0,0,0,545,0,'Deathstalker Faerleia - SAY_A_BLOW_TO_ARUGAL'); diff --git a/sql/updates/world/3.3.5/2016_08_05_00_world.sql b/sql/updates/world/3.3.5/2016_08_05_00_world.sql new file mode 100644 index 0000000000000..5dff6593e6d1e --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_05_00_world.sql @@ -0,0 +1,50 @@ +SET @CGUID := 12460; + +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=32800; + +UPDATE `quest_template_addon` SET `PrevQuestID`=13117 WHERE `ID`IN(13221,13229); +UPDATE `quest_template_addon` SET `PrevQuestID`=13144 WHERE `ID`IN(13481,13482); + +UPDATE `quest_template_addon` SET `ExclusiveGroup`=13221 WHERE `ID`IN(13221,13482); +UPDATE `quest_template_addon` SET `ExclusiveGroup`=13229 WHERE `ID`IN(13229,13481); + +DELETE FROM `creature` WHERE `id` =32800; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 32800, 571, 1, 64, 6717.831, 3452.021, 683.7534, 4.625123, 120, 0, 0); -- 32800 (Area: 4531) (Auras: 32595 - 32595) + +DELETE FROM `creature_template_addon` WHERE `entry`=32800; +INSERT INTO `creature_template_addon` (`entry`, `mount`, `bytes1`, `bytes2`, `auras`) VALUES +(32800, 0, 0x8, 0x1, '32595'); -- 32800 - 32595 + +DELETE FROM `smart_scripts` WHERE `entryorguid`=32800 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 +(32800, 0, 0, 0, 4, 0, 100, 1, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Aggro - Set Event Phase 1 (No Repeat)'), +(32800, 0, 1, 0, 4, 1, 100, 1, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Aggro - Disable Combat Movement (No Repeat)'), +(32800, 0, 2, 0, 4, 1, 100, 1, 0, 0, 0, 0, 11, 25054, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Aggro - Cast \'Holy Smite\' (No Repeat)'), +(32800, 0, 3, 0, 9, 1, 100, 0, 0, 40, 3400, 4700, 11, 25054, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Within 0-40 Range - Cast \'Holy Smite\' (No Repeat)'), +(32800, 0, 4, 0, 9, 1, 100, 0, 40, 100, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Within 40-100 Range - Enable Combat Movement (No Repeat)'), +(32800, 0, 5, 0, 9, 1, 100, 0, 10, 15, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Within 10-15 Range - Disable Combat Movement (No Repeat)'), +(32800, 0, 6, 0, 9, 1, 100, 0, 0, 40, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Within 0-40 Range - Disable Combat Movement (No Repeat)'), +(32800, 0, 7, 0, 3, 1, 100, 0, 0, 15, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Between 0-15% Mana - Set Event Phase 2 (No Repeat)'), +(32800, 0, 8, 0, 3, 2, 100, 0, 0, 15, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Between 0-15% Mana - Enable Combat Movement (No Repeat)'), +(32800, 0, 9, 0, 3, 2, 100, 0, 30, 100, 100, 100, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Between 30-100% Mana - Set Event Phase 1 (No Repeat)'), +(32800, 0, 11, 0, 0, 1, 100, 0, 5000, 6200, 11700, 15600, 11, 17146, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - In Combat - Cast \'Shadow Word: Pain\' (No Repeat)'), +(32800, 0, 12, 0, 2, 0, 100, 1, 0, 50, 0, 0, 11, 32595, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - Between 0-50% Health - Cast \'Power Word: Shield\' (No Repeat)'), +(32800, 0, 13, 14, 19, 0, 100, 0, 0, 0, 0, 0, 75, 58921, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Quest Taken - Add Aura \'Power Word: Fortitude\''), +(32800, 0, 14, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 1, 4000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Quest Taken - Say Line 1'), +(32800, 0, 15, 16, 52, 0, 100, 0, 1, 32800, 0, 0, 1, 2, 1000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Text 1 Over - Say Line 2'), +(32800, 0, 16, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 2, 1000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Quest Taken - Say Line 2'), +(32800, 0, 17, 0, 52, 0, 100, 0, 2, 32800, 0, 0, 53, 0, 31279, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Text 2 Over - Start Waypoint'), +(32800, 0, 18, 0, 40, 0, 100, 0, 12, 0, 0, 0, 1, 3, 2900, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Waypoint 13 Reached - Say Line 3'), +(32800, 0, 19, 0, 52, 0, 100, 0, 3, 32800, 0, 0, 1, 4, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Text 3 Over - Say Line 4'), +(32800, 0, 20, 0, 52, 0, 100, 0, 4, 32800, 0, 0, 15, 13481, 0, 0, 0, 0, 0, 18, 30, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Text 4 Over - Quest Credit Lets Get Out of Here!'), +(32800, 0, 21, 0, 52, 0, 100, 0, 4, 32800, 0, 0, 15, 13482, 0, 0, 0, 0, 0, 18, 30, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Text 4 Over - Quest Credit Lets Get Out of Here!'), +(32800, 0, 22, 0, 52, 0, 100, 0, 4, 32800, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Father Kamaros - On Text 4 Over - Despawn In 1000 ms'); + +DELETE FROM `creature_text` WHERE `entry`=32800; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextID`, `comment`) VALUES +(32800, 1, 0, 'The Light''s blessing be upon you for aiding me in my time of need, $N.', 12, 0, 100, 0, 0, 0, 31941, 'Father Kamaros to Player'), +(32800, 2, 0, 'I''ve had my fill of this place. Let us depart.', 12, 0, 100, 1, 0, 0, 31942, 'Father Kamaros to Player'), +(32800, 3, 0, 'You must tell my brothers that I live.', 12, 0, 100, 1, 0, 0, 31944, 'Father Kamaros to Player'), +(32800, 4, 0, 'I have you to thank for my life. I will return to my comrades and spread word of your bravery. Fight the Scourge with all the strength you can muster, and we will be by your side.', 12, 0, 100, 2, 0, 0, 31943, 'Father Kamaros to Player'); diff --git a/sql/updates/world/3.3.5/2016_08_06_00_world.sql b/sql/updates/world/3.3.5/2016_08_06_00_world.sql new file mode 100644 index 0000000000000..250ba104ae526 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_06_00_world.sql @@ -0,0 +1,5 @@ +-- insert new delay notice messages for server shutdown commands +DELETE FROM `trinity_string` WHERE `entry` IN (11017,11018); +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(11017,"Server shutdown delayed to %d seconds as other users are still connected. Specify 'force' to override."), +(11018,"Server shutdown scheduled for T+%d seconds was successfully cancelled."); diff --git a/sql/updates/world/3.3.5/2016_08_08_00_world.sql b/sql/updates/world/3.3.5/2016_08_08_00_world.sql new file mode 100644 index 0000000000000..60e8bf27d17a2 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_08_00_world.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `lootid` = 0 WHERE `entry` = 15550; +UPDATE `conditions` SET `SourceGroup` = 16152 WHERE `SourceGroup` = 15550 AND `SourceEntry` = 23809 AND `SourceTypeOrReferenceId` = 1; +UPDATE `creature_template` SET `flags_extra` = `flags_extra`|2097152 WHERE `entry` = 16152; diff --git a/src/common/Collision/BoundingIntervalHierarchy.h b/src/common/Collision/BoundingIntervalHierarchy.h index eb0a102806f80..d84ee3f6bf322 100644 --- a/src/common/Collision/BoundingIntervalHierarchy.h +++ b/src/common/Collision/BoundingIntervalHierarchy.h @@ -91,7 +91,7 @@ class TC_COMMON_API BIH buildData dat; dat.maxPrims = leafSize; - dat.numPrims = primitives.size(); + dat.numPrims = uint32(primitives.size()); dat.indices = new uint32[dat.numPrims]; dat.primBound = new G3D::AABox[dat.numPrims]; getBounds(primitives[0], bounds); @@ -115,7 +115,7 @@ class TC_COMMON_API BIH delete[] dat.primBound; delete[] dat.indices; } - uint32 primCount() const { return objects.size(); } + uint32 primCount() const { return uint32(objects.size()); } template void intersectRay(const G3D::Ray &r, RayCallback& intersectCallback, float &maxDist, bool stopAtFirst=false) const diff --git a/src/common/Collision/Management/MMapManager.cpp b/src/common/Collision/Management/MMapManager.cpp index 04b1e62399b66..66808e08e34c1 100644 --- a/src/common/Collision/Management/MMapManager.cpp +++ b/src/common/Collision/Management/MMapManager.cpp @@ -23,6 +23,9 @@ namespace MMAP { + static char const* const MAP_FILE_NAME_FORMAT = "%s/mmaps/%03i.mmap"; + static char const* const TILE_FILE_NAME_FORMAT = "%s/mmaps/%03i%02i%02i.mmtile"; + // ######################## MMapManager ######################## MMapManager::~MMapManager() { @@ -70,26 +73,20 @@ namespace MMAP } // load and init dtNavMesh - read parameters from file - std::string dataDir = sConfigMgr->GetStringDefault("DataDir", "./"); - uint32 pathLen = dataDir.length() + strlen("/mmaps/%03i.mmap") + 1; - char *fileName = new char[pathLen]; - snprintf(fileName, pathLen, (dataDir + "/mmaps/%03i.mmap").c_str(), mapId); - - FILE* file = fopen(fileName, "rb"); + std::string fileName = Trinity::StringFormat(MAP_FILE_NAME_FORMAT, sConfigMgr->GetStringDefault("DataDir", ".").c_str(), mapId); + FILE* file = fopen(fileName.c_str(), "rb"); if (!file) { - TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName); - delete [] fileName; + TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName.c_str()); return false; } dtNavMeshParams params; - int count = fread(¶ms, sizeof(dtNavMeshParams), 1, file); + uint32 count = uint32(fread(¶ms, sizeof(dtNavMeshParams), 1, file)); fclose(file); if (count != 1) { - TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not read params from file '%s'", fileName); - delete [] fileName; + TC_LOG_DEBUG("maps", "MMAP:loadMapData: Error: Could not read params from file '%s'", fileName.c_str()); return false; } @@ -98,18 +95,14 @@ namespace MMAP if (dtStatusFailed(mesh->init(¶ms))) { dtFreeNavMesh(mesh); - TC_LOG_ERROR("maps", "MMAP:loadMapData: Failed to initialize dtNavMesh for mmap %03u from file %s", mapId, fileName); - delete [] fileName; + TC_LOG_ERROR("maps", "MMAP:loadMapData: Failed to initialize dtNavMesh for mmap %03u from file %s", mapId, fileName.c_str()); return false; } - delete [] fileName; - TC_LOG_DEBUG("maps", "MMAP:loadMapData: Loaded %03i.mmap", mapId); // store inside our map list MMapData* mmap_data = new MMapData(mesh); - mmap_data->mmapLoadedTiles.clear(); itr->second = mmap_data; return true; @@ -120,7 +113,7 @@ namespace MMAP return uint32(x << 16 | y); } - bool MMapManager::loadMap(const std::string& basePath, uint32 mapId, int32 x, int32 y) + bool MMapManager::loadMap(const std::string& /*basePath*/, uint32 mapId, int32 x, int32 y) { // make sure the mmap is loaded and ready to load tiles if (!loadMapData(mapId)) @@ -132,23 +125,17 @@ namespace MMAP // check if we already have this tile loaded uint32 packedGridPos = packTileID(x, y); - if (mmap->mmapLoadedTiles.find(packedGridPos) != mmap->mmapLoadedTiles.end()) + if (mmap->loadedTileRefs.find(packedGridPos) != mmap->loadedTileRefs.end()) return false; // load this tile :: mmaps/MMMXXYY.mmtile - uint32 pathLen = basePath.length() + strlen("/%03i%02i%02i.mmtile") + 1; - char *fileName = new char[pathLen]; - - snprintf(fileName, pathLen, (basePath + "/%03i%02i%02i.mmtile").c_str(), mapId, x, y); - - FILE* file = fopen(fileName, "rb"); + std::string fileName = Trinity::StringFormat(TILE_FILE_NAME_FORMAT, sConfigMgr->GetStringDefault("DataDir", ".").c_str(), mapId, x, y); + FILE* file = fopen(fileName.c_str(), "rb"); if (!file) { - TC_LOG_DEBUG("maps", "MMAP:loadMap: Could not open mmtile file '%s'", fileName); - delete [] fileName; + TC_LOG_DEBUG("maps", "MMAP:loadMap: Could not open mmtile file '%s'", fileName.c_str()); return false; } - delete [] fileName; // read header MmapTileHeader fileHeader; @@ -186,7 +173,7 @@ namespace MMAP // memory allocated for data is now managed by detour, and will be deallocated when the tile is removed if (dtStatusSucceed(mmap->navMesh->addTile(data, fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef))) { - mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); + mmap->loadedTileRefs.insert(std::pair(packedGridPos, tileRef)); ++loadedTiles; TC_LOG_DEBUG("maps", "MMAP:loadMap: Loaded mmtile %03i[%02i, %02i] into %03i[%02i, %02i]", mapId, x, y, mapId, header->x, header->y); return true; @@ -214,14 +201,14 @@ namespace MMAP // check if we have this tile loaded uint32 packedGridPos = packTileID(x, y); - if (mmap->mmapLoadedTiles.find(packedGridPos) == mmap->mmapLoadedTiles.end()) + if (mmap->loadedTileRefs.find(packedGridPos) == mmap->loadedTileRefs.end()) { // file may not exist, therefore not loaded TC_LOG_DEBUG("maps", "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); return false; } - dtTileRef tileRef = mmap->mmapLoadedTiles[packedGridPos]; + dtTileRef tileRef = mmap->loadedTileRefs[packedGridPos]; // unload, and mark as non loaded if (dtStatusFailed(mmap->navMesh->removeTile(tileRef, NULL, NULL))) @@ -234,7 +221,7 @@ namespace MMAP } else { - mmap->mmapLoadedTiles.erase(packedGridPos); + mmap->loadedTileRefs.erase(packedGridPos); --loadedTiles; TC_LOG_DEBUG("maps", "MMAP:unloadMap: Unloaded mmtile %03i[%02i, %02i] from %03i", mapId, x, y, mapId); return true; @@ -255,7 +242,7 @@ namespace MMAP // unload all tiles from given map MMapData* mmap = itr->second; - for (MMapTileSet::iterator i = mmap->mmapLoadedTiles.begin(); i != mmap->mmapLoadedTiles.end(); ++i) + for (MMapTileSet::iterator i = mmap->loadedTileRefs.begin(); i != mmap->loadedTileRefs.end(); ++i) { uint32 x = (i->first >> 16); uint32 y = (i->first & 0x0000FFFF); diff --git a/src/common/Collision/Management/MMapManager.h b/src/common/Collision/Management/MMapManager.h index a8d792296bb92..6e2594a1d7f9b 100644 --- a/src/common/Collision/Management/MMapManager.h +++ b/src/common/Collision/Management/MMapManager.h @@ -22,7 +22,6 @@ #include "Define.h" #include "DetourNavMesh.h" #include "DetourNavMeshQuery.h" - #include #include #include @@ -34,7 +33,7 @@ namespace MMAP typedef std::unordered_map NavMeshQuerySet; // dummy struct to hold map's mmap data - struct MMapData + struct TC_COMMON_API MMapData { MMapData(dtNavMesh* mesh) : navMesh(mesh) { } ~MMapData() @@ -46,11 +45,11 @@ namespace MMAP dtFreeNavMesh(navMesh); } - dtNavMesh* navMesh; - // we have to use single dtNavMeshQuery for every instance, since those are not thread safe NavMeshQuerySet navMeshQueries; // instanceId to query - MMapTileSet mmapLoadedTiles; // maps [map grid coords] to [dtTile] + + dtNavMesh* navMesh; + MMapTileSet loadedTileRefs; // maps [map grid coords] to [dtTile] }; diff --git a/src/common/Collision/Maps/MapDefines.h b/src/common/Collision/Maps/MapDefines.h index 538a78a38d422..a523b0c01860a 100644 --- a/src/common/Collision/Maps/MapDefines.h +++ b/src/common/Collision/Maps/MapDefines.h @@ -33,4 +33,4 @@ enum NavTerrain // we only have 8 bits }; -#endif +#endif /* _MAPDEFINES_H */ diff --git a/src/common/Collision/Maps/MapTree.h b/src/common/Collision/Maps/MapTree.h index c6a283cac4d91..0227a982b4ca7 100644 --- a/src/common/Collision/Maps/MapTree.h +++ b/src/common/Collision/Maps/MapTree.h @@ -79,7 +79,7 @@ namespace VMAP bool LoadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm); void UnloadMapTile(uint32 tileX, uint32 tileY, VMapManager2* vm); bool isTiled() const { return iIsTiled; } - uint32 numLoadedTiles() const { return iLoadedTiles.size(); } + uint32 numLoadedTiles() const { return uint32(iLoadedTiles.size()); } void getModelInstances(ModelInstance* &models, uint32 &count); private: diff --git a/src/common/Collision/Maps/TileAssembler.cpp b/src/common/Collision/Maps/TileAssembler.cpp index 3f58b8f351650..7ee9125a5c505 100644 --- a/src/common/Collision/Maps/TileAssembler.cpp +++ b/src/common/Collision/Maps/TileAssembler.cpp @@ -355,10 +355,13 @@ namespace VMAP uint32 name_length, displayId; char buff[500]; - while (!feof(model_list)) + while (true) { - if (fread(&displayId, sizeof(uint32), 1, model_list) != 1 - || fread(&name_length, sizeof(uint32), 1, model_list) != 1 + if (fread(&displayId, sizeof(uint32), 1, model_list) != 1) + if (feof(model_list)) // EOF flag is only set after failed reading attempt + break; + + if (fread(&name_length, sizeof(uint32), 1, model_list) != 1 || name_length >= sizeof(buff) || fread(&buff, sizeof(char), name_length, model_list) != name_length) { @@ -369,7 +372,7 @@ namespace VMAP std::string model_name(buff, name_length); WorldModel_Raw raw_model; - if ( !raw_model.Read((iSrcDir + "/" + model_name).c_str()) ) + if (!raw_model.Read((iSrcDir + "/" + model_name).c_str()) ) continue; spawnedModelFiles.insert(model_name); @@ -412,13 +415,14 @@ namespace VMAP fclose(model_list); fclose(model_list_copy); } - // temporary use defines to simplify read/check code (close file and return at fail) - #define READ_OR_RETURN(V, S) if (fread((V), (S), 1, rf) != 1) { \ - fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); } - #define READ_OR_RETURN_WITH_DELETE(V, S) if (fread((V), (S), 1, rf) != 1) { \ - fclose(rf); printf("readfail, op = %i\n", readOperation); delete[] V; return(false); }; - #define CMP_OR_RETURN(V, S) if (strcmp((V), (S)) != 0) { \ - fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); } + +// temporary use defines to simplify read/check code (close file and return at fail) +#define READ_OR_RETURN(V, S) if (fread((V), (S), 1, rf) != 1) { \ + fclose(rf); printf("readfail, op = %i\n", readOperation); return(false); } +#define READ_OR_RETURN_WITH_DELETE(V, S) if (fread((V), (S), 1, rf) != 1) { \ + fclose(rf); printf("readfail, op = %i\n", readOperation); delete[] V; return(false); }; +#define CMP_OR_RETURN(V, S) if (strcmp((V), (S)) != 0) { \ + fclose(rf); printf("cmpfail, %s!=%s\n", V, S);return(false); } bool GroupModel_Raw::Read(FILE* rf) { diff --git a/src/common/Collision/RegularGrid.h b/src/common/Collision/RegularGrid.h index 563cf516406a5..2f3819c872c85 100644 --- a/src/common/Collision/RegularGrid.h +++ b/src/common/Collision/RegularGrid.h @@ -71,7 +71,7 @@ class TC_COMMON_API RegularGrid2D } bool contains(const T& value) const { return memberTable.containsKey(&value); } - int size() const { return memberTable.size(); } + int size() const { return uint32(memberTable.size()); } struct Cell { diff --git a/src/common/Collision/VMapTools.h b/src/common/Collision/VMapTools.h index a7e4149b5165f..85f0cc134155a 100644 --- a/src/common/Collision/VMapTools.h +++ b/src/common/Collision/VMapTools.h @@ -46,7 +46,7 @@ namespace VMAP //============================================================== //============================================================== - class MyCollisionDetection + class TC_COMMON_API MyCollisionDetection { private: public: diff --git a/src/common/Common.cpp b/src/common/Common.cpp index 308da60257956..7337853b29225 100644 --- a/src/common/Common.cpp +++ b/src/common/Common.cpp @@ -18,7 +18,8 @@ #include "Common.h" -char const* localeNames[TOTAL_LOCALES] = { +TC_COMMON_API char const* localeNames[TOTAL_LOCALES] = +{ "enUS", "koKR", "frFR", @@ -33,7 +34,7 @@ char const* localeNames[TOTAL_LOCALES] = { LocaleConstant GetLocaleByName(const std::string& name) { for (uint32 i = 0; i < TOTAL_LOCALES; ++i) - if (name==localeNames[i]) + if (name == localeNames[i]) return LocaleConstant(i); return LOCALE_enUS; // including enGB case diff --git a/src/common/Common.h b/src/common/Common.h index aa04abacd3061..423c3e8cae0f5 100644 --- a/src/common/Common.h +++ b/src/common/Common.h @@ -133,7 +133,7 @@ enum LocaleConstant #define MAX_LOCALES 8 #define MAX_ACCOUNT_TUTORIAL_VALUES 8 -TC_COMMON_API extern char const* localeNames[TOTAL_LOCALES]; +extern "C" TC_COMMON_API char const* localeNames[TOTAL_LOCALES]; TC_COMMON_API LocaleConstant GetLocaleByName(const std::string& name); diff --git a/src/common/Cryptography/ARC4.cpp b/src/common/Cryptography/ARC4.cpp index eea523a20906d..ead85a18e676d 100644 --- a/src/common/Cryptography/ARC4.cpp +++ b/src/common/Cryptography/ARC4.cpp @@ -18,14 +18,14 @@ #include "ARC4.h" -ARC4::ARC4(uint8 len) : m_ctx() +ARC4::ARC4(uint32 len) : m_ctx() { EVP_CIPHER_CTX_init(&m_ctx); EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL); EVP_CIPHER_CTX_set_key_length(&m_ctx, len); } -ARC4::ARC4(uint8 *seed, uint8 len) : m_ctx() +ARC4::ARC4(uint8 *seed, uint32 len) : m_ctx() { EVP_CIPHER_CTX_init(&m_ctx); EVP_EncryptInit_ex(&m_ctx, EVP_rc4(), NULL, NULL, NULL); diff --git a/src/common/Cryptography/ARC4.h b/src/common/Cryptography/ARC4.h index 7e68017683636..df412944ef680 100644 --- a/src/common/Cryptography/ARC4.h +++ b/src/common/Cryptography/ARC4.h @@ -25,8 +25,8 @@ class TC_COMMON_API ARC4 { public: - ARC4(uint8 len); - ARC4(uint8 *seed, uint8 len); + ARC4(uint32 len); + ARC4(uint8 *seed, uint32 len); ~ARC4(); void Init(uint8 *seed); void UpdateData(int len, uint8 *data); diff --git a/src/common/Cryptography/BigNumber.cpp b/src/common/Cryptography/BigNumber.cpp index 3b85122ebabda..0d5dafc336b09 100644 --- a/src/common/Cryptography/BigNumber.cpp +++ b/src/common/Cryptography/BigNumber.cpp @@ -163,11 +163,16 @@ uint32 BigNumber::AsDword() return (uint32)BN_get_word(_bn); } -bool BigNumber::isZero() const +bool BigNumber::IsZero() const { return BN_is_zero(_bn); } +bool BigNumber::IsNegative() const +{ + return BN_is_negative(_bn); +} + std::unique_ptr BigNumber::AsByteArray(int32 minSize, bool littleEndian) { int numBytes = GetNumBytes(); @@ -189,13 +194,19 @@ std::unique_ptr BigNumber::AsByteArray(int32 minSize, bool littleEndian return ret; } -char * BigNumber::AsHexStr() const +std::string BigNumber::AsHexStr() const { - return BN_bn2hex(_bn); + char* ch = BN_bn2hex(_bn); + std::string ret = ch; + OPENSSL_free(ch); + return ret; } -char * BigNumber::AsDecStr() const +std::string BigNumber::AsDecStr() const { - return BN_bn2dec(_bn); + char* ch = BN_bn2dec(_bn); + std::string ret = ch; + OPENSSL_free(ch); + return ret; } diff --git a/src/common/Cryptography/BigNumber.h b/src/common/Cryptography/BigNumber.h index 1d21be1b431f8..baf338552d09c 100644 --- a/src/common/Cryptography/BigNumber.h +++ b/src/common/Cryptography/BigNumber.h @@ -21,6 +21,7 @@ #include #include "Define.h" +#include struct bignum_st; @@ -76,7 +77,8 @@ class TC_COMMON_API BigNumber return t %= bn; } - bool isZero() const; + bool IsZero() const; + bool IsNegative() const; BigNumber ModExp(BigNumber const& bn1, BigNumber const& bn2); BigNumber Exp(BigNumber const&); @@ -89,8 +91,8 @@ class TC_COMMON_API BigNumber std::unique_ptr AsByteArray(int32 minSize = 0, bool littleEndian = true); - char * AsHexStr() const; - char * AsDecStr() const; + std::string AsHexStr() const; + std::string AsDecStr() const; private: struct bignum_st *_bn; diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp index 2ce00229e53a6..6157cd786cdcf 100644 --- a/src/common/Debugging/Errors.cpp +++ b/src/common/Debugging/Errors.cpp @@ -90,7 +90,7 @@ void Warning(char const* file, int line, char const* function, char const* messa void Abort(char const* file, int line, char const* function) { - fprintf(stderr, "\n%s:%i in %s ABORTED\n", + fprintf(stderr, "\n%s:%i in %s ABORTED.\n", file, line, function); *((volatile int*)NULL) = 0; exit(1); diff --git a/src/common/Logging/AppenderFile.cpp b/src/common/Logging/AppenderFile.cpp index 20fa3dc720b71..ecb65ae7d167d 100644 --- a/src/common/Logging/AppenderFile.cpp +++ b/src/common/Logging/AppenderFile.cpp @@ -28,6 +28,7 @@ AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, Ap Appender(id, name, level, flags), logfile(NULL), _logDir(sLog->GetLogsDir()), + _maxFileSize(0), _fileSize(0) { if (extraArgs.empty()) @@ -50,8 +51,6 @@ AppenderFile::AppenderFile(uint8 id, std::string const& name, LogLevel level, Ap if (extraArgs.size() > 2) _maxFileSize = atoi(extraArgs[2]); - else - _maxFileSize = 0; _dynamicName = std::string::npos != _fileName.find("%s"); _backup = (flags & APPENDER_FLAGS_MAKE_FILE_BACKUP) != 0; diff --git a/src/common/Threading/ProcessPriority.h b/src/common/Threading/ProcessPriority.h index 7119daa5030dc..2d7e9cca2f13b 100644 --- a/src/common/Threading/ProcessPriority.h +++ b/src/common/Threading/ProcessPriority.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2016 TrinityCore -* -* 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 . -*/ + * Copyright (C) 2008-2016 TrinityCore + * + * 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 . + */ #ifndef _PROCESSPRIO_H #define _PROCESSPRIO_H diff --git a/src/common/Threading/ProducerConsumerQueue.h b/src/common/Threading/ProducerConsumerQueue.h index bd4c8efd32c18..e8e71ac35c71a 100644 --- a/src/common/Threading/ProducerConsumerQueue.h +++ b/src/common/Threading/ProducerConsumerQueue.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2016 TrinityCore -* -* 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 . -*/ + * Copyright (C) 2008-2016 TrinityCore + * + * 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 . + */ #ifndef _PCQ_H #define _PCQ_H diff --git a/src/common/Utilities/MessageBuffer.h b/src/common/Utilities/MessageBuffer.h index d08c4b25bab7f..c3faf234f1dda 100644 --- a/src/common/Utilities/MessageBuffer.h +++ b/src/common/Utilities/MessageBuffer.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2016 TrinityCore -* -* 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 . -*/ + * Copyright (C) 2008-2016 TrinityCore + * + * 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 . + */ #ifndef __MESSAGEBUFFER_H_ #define __MESSAGEBUFFER_H_ diff --git a/src/common/Utilities/Random.cpp b/src/common/Utilities/Random.cpp index 31318e8f52d95..1c325c383086c 100644 --- a/src/common/Utilities/Random.cpp +++ b/src/common/Utilities/Random.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2015 TrinityCore + * Copyright (C) 2008-2016 TrinityCore * * 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 diff --git a/src/common/Utilities/Random.h b/src/common/Utilities/Random.h index b3ca00219ef15..d7269928dfe81 100644 --- a/src/common/Utilities/Random.h +++ b/src/common/Utilities/Random.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2015 TrinityCore + * Copyright (C) 2008-2016 TrinityCore * * 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 diff --git a/src/common/Utilities/Util.cpp b/src/common/Utilities/Util.cpp index 3d8cda66d48d4..b8877fe491e54 100644 --- a/src/common/Utilities/Util.cpp +++ b/src/common/Utilities/Util.cpp @@ -30,7 +30,7 @@ #include #endif -Tokenizer::Tokenizer(const std::string &src, const char sep, uint32 vectorReserve) +Tokenizer::Tokenizer(const std::string &src, const char sep, uint32 vectorReserve /*= 0*/, bool keepEmptyStrings /*= true*/) { m_str = new char[src.length() + 1]; memcpy(m_str, src.c_str(), src.length() + 1); @@ -45,9 +45,10 @@ Tokenizer::Tokenizer(const std::string &src, const char sep, uint32 vectorReserv { if (*posnew == sep) { - m_storage.push_back(posold); - posold = posnew + 1; + if (keepEmptyStrings || posold != posnew) + m_storage.push_back(posold); + posold = posnew + 1; *posnew = '\0'; } else if (*posnew == '\0') diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h index cc68f3b223782..fc322a8958383 100644 --- a/src/common/Utilities/Util.h +++ b/src/common/Utilities/Util.h @@ -52,7 +52,7 @@ class TC_COMMON_API Tokenizer typedef StorageType::const_reference const_reference; public: - Tokenizer(const std::string &src, char const sep, uint32 vectorReserve = 0); + Tokenizer(const std::string &src, char const sep, uint32 vectorReserve = 0, bool keepEmptyStrings = true); ~Tokenizer() { delete[] m_str; } const_iterator begin() const { return m_storage.begin(); } @@ -112,8 +112,10 @@ inline T RoundToInterval(T& num, T floor, T ceil) // UTF8 handling TC_COMMON_API bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr); + // in wsize==max size of buffer, out wsize==real string size TC_COMMON_API bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize); + inline bool Utf8toWStr(const std::string& utf8str, wchar_t* wstr, size_t& wsize) { return Utf8toWStr(utf8str.c_str(), utf8str.size(), wstr, wsize); @@ -123,7 +125,8 @@ TC_COMMON_API bool WStrToUtf8(std::wstring const& wstr, std::string& utf8str); // size==real string size TC_COMMON_API bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str); -TC_COMMON_API size_t utf8length(std::string& utf8str); // set string to "" if invalid utf8 sequence +// set string to "" if invalid utf8 sequence +TC_COMMON_API size_t utf8length(std::string& utf8str); TC_COMMON_API void utf8truncate(std::string& utf8str, size_t len); inline bool isBasicLatinCharacter(wchar_t wchar) @@ -354,7 +357,7 @@ class HookList } }; -class flag96 +class TC_COMMON_API flag96 { private: uint32 part[3]; diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index 43c327ffda160..ec72651ecb71a 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -499,7 +499,7 @@ bool AuthSession::HandleLogonProof() A.SetBinary(logonProof->A, 32); // SRP safeguard: abort if A == 0 - if (A.isZero()) + if (A.IsZero()) { return false; } @@ -575,18 +575,15 @@ bool AuthSession::HandleLogonProof() // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket - const char *K_hex = K.AsHexStr(); PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF); - stmt->setString(0, K_hex); + stmt->setString(0, K.AsHexStr()); stmt->setString(1, GetRemoteIpAddress().to_string().c_str()); stmt->setUInt32(2, GetLocaleByName(_localizationName)); stmt->setString(3, _os); stmt->setString(4, _accountInfo.Login); LoginDatabase.DirectExecute(stmt); - OPENSSL_free((void*)K_hex); - // Finish SRP6 and send the final result to the client sha.Initialize(); sha.UpdateBigNumbers(&A, &M, &K, NULL); @@ -959,16 +956,9 @@ void AuthSession::SetVSFields(const std::string& rI) v = g.ModExp(x, N); // No SQL injection (username escaped) - char *v_hex, *s_hex; - v_hex = v.AsHexStr(); - s_hex = s.AsHexStr(); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS); - stmt->setString(0, v_hex); - stmt->setString(1, s_hex); + stmt->setString(0, v.AsHexStr()); + stmt->setString(1, s.AsHexStr()); stmt->setString(2, _accountInfo.Login); LoginDatabase.Execute(stmt); - - OPENSSL_free(v_hex); - OPENSSL_free(s_hex); } diff --git a/src/server/database/Database/Implementation/LoginDatabase.cpp b/src/server/database/Database/Implementation/LoginDatabase.cpp index 4f056e2686d3a..c868d2a4b5c92 100644 --- a/src/server/database/Database/Implementation/LoginDatabase.cpp +++ b/src/server/database/Database/Implementation/LoginDatabase.cpp @@ -117,4 +117,5 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_DEL_RBAC_ACCOUNT_PERMISSION, "DELETE FROM rbac_account_permissions WHERE accountId = ? AND permissionId = ? AND (realmId = ? OR realmId = -1)", CONNECTION_ASYNC); PrepareStatement(LOGIN_INS_ACCOUNT_MUTE, "INSERT INTO account_muted VALUES (?, UNIX_TIMESTAMP(), ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_ACCOUNT_MUTE_INFO, "SELECT mutedate, mutetime, mutereason, mutedby FROM account_muted WHERE guid = ? ORDER BY mutedate ASC", CONNECTION_SYNCH); + PrepareStatement(LOGIN_DEL_ACCOUNT_MUTED, "DELETE FROM account_muted WHERE guid = ?", CONNECTION_ASYNC); } diff --git a/src/server/database/Database/Implementation/LoginDatabase.h b/src/server/database/Database/Implementation/LoginDatabase.h index e206be16d7344..2bed9664d3412 100644 --- a/src/server/database/Database/Implementation/LoginDatabase.h +++ b/src/server/database/Database/Implementation/LoginDatabase.h @@ -113,6 +113,7 @@ enum LoginDatabaseStatements LOGIN_INS_ACCOUNT_MUTE, LOGIN_SEL_ACCOUNT_MUTE_INFO, + LOGIN_DEL_ACCOUNT_MUTED, MAX_LOGINDATABASE_STATEMENTS }; diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 15bbff2793fc0..14bc9ec4ec27f 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -82,7 +82,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature /*= nullptr*/, float maxRange // If it can't find a suitable attack target then we should error out. if (!creature->HasReactState(REACT_PASSIVE) && !creature->GetVictim()) { - TC_LOG_ERROR("misc", "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry()); + TC_LOG_ERROR("misc.dozoneincombat", "DoZoneInCombat called for creature that has empty threat list (creature entry = %u)", creature->GetEntry()); return; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index bbc7e8beadb48..6a130d8f20f35 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -369,7 +369,7 @@ class TC_GAME_API BossAI : public ScriptedAI void _JustDied(); void _JustReachedHome() { me->setActive(false); } void _DespawnAtEvade(uint32 delayToRespawn = 30, Creature* who = nullptr); - void _DespawnAtEvade(Milliseconds const& time, Creature* who = nullptr) { _DespawnAtEvade(uint32(time.count()), who); } + void _DespawnAtEvade(Seconds const& time, Creature* who = nullptr) { _DespawnAtEvade(uint32(time.count()), who); } void TeleportCheaters(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 1b8b472b8051c..e87651224b96d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -66,7 +66,7 @@ void npc_escortAI::AttackStart(Unit* who) } //see followerAI -bool npc_escortAI::AssistPlayerInCombat(Unit* who) +bool npc_escortAI::AssistPlayerInCombatAgainst(Unit* who) { if (!who || !who->GetVictim()) return false; @@ -107,7 +107,7 @@ void npc_escortAI::MoveInLineOfSight(Unit* who) { if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { - if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(who)) + if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombatAgainst(who)) return; if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) @@ -439,13 +439,13 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false { if (me->GetVictim()) { - TC_LOG_ERROR("misc", "TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry()); + TC_LOG_ERROR("scripts.escortai", "TSCR ERROR: EscortAI (script: %s, creature entry: %u) attempts to Start while in combat", me->GetScriptName().c_str(), me->GetEntry()); return; } if (HasEscortState(STATE_ESCORT_ESCORTING)) { - TC_LOG_ERROR("scripts", "EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry()); + TC_LOG_ERROR("scripts.escortai", "EscortAI (script: %s, creature entry: %u) attempts to Start while already escorting", me->GetScriptName().c_str(), me->GetEntry()); return; } diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index 37a1464d812ec..32dfd87432b67 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -109,7 +109,7 @@ struct TC_GAME_API npc_escortAI : public ScriptedAI Player* GetPlayerForEscort() { return ObjectAccessor::GetPlayer(*me, m_uiPlayerGUID); } private: - bool AssistPlayerInCombat(Unit* who); + bool AssistPlayerInCombatAgainst(Unit* who); bool IsPlayerOrGroupInRange(); void FillPointMovementListForCreature(); diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index bd07e688fb0e6..24de7344f998d 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -63,7 +63,7 @@ void FollowerAI::AttackStart(Unit* who) //This part provides assistance to a player that are attacked by who, even if out of normal aggro range //It will cause me to attack who that are attacking _any_ player (which has been confirmed may happen also on offi) //The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate. -bool FollowerAI::AssistPlayerInCombat(Unit* who) +bool FollowerAI::AssistPlayerInCombatAgainst(Unit* who) { if (!who || !who->GetVictim()) return false; @@ -104,7 +104,7 @@ void FollowerAI::MoveInLineOfSight(Unit* who) { if (me->HasReactState(REACT_AGGRESSIVE) && !me->HasUnitState(UNIT_STATE_STUNNED) && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me)) { - if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(who)) + if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombatAgainst(who)) return; if (!me->CanFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h index e17fb7c8507d5..8c1a427acd8bb 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.h @@ -69,7 +69,7 @@ class TC_GAME_API FollowerAI : public ScriptedAI void AddFollowState(uint32 uiFollowState) { m_uiFollowState |= uiFollowState; } void RemoveFollowState(uint32 uiFollowState) { m_uiFollowState &= ~uiFollowState; } - bool AssistPlayerInCombat(Unit* who); + bool AssistPlayerInCombatAgainst(Unit* who); ObjectGuid m_uiLeaderGUID; uint32 m_uiUpdateFollowTimer; diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index e21f59fe58284..4a577f5a530e0 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -30,12 +30,12 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) { // copy script to local (protection for table reload) - mWayPoints = NULL; + mWayPoints = nullptr; mEscortState = SMART_ESCORT_NONE; mCurrentWPID = 0;//first wp id is 1 !! mWPReached = false; mWPPauseTimer = 0; - mLastWP = NULL; + mLastWP = nullptr; mCanRepeatPath = false; @@ -90,7 +90,7 @@ void SmartAI::UpdateDespawn(const uint32 diff) WayPoint* SmartAI::GetNextWayPoint() { if (!mWayPoints || mWayPoints->empty()) - return NULL; + return nullptr; mCurrentWPID++; WPPath::const_iterator itr = mWayPoints->find(mCurrentWPID); @@ -103,7 +103,7 @@ WayPoint* SmartAI::GetNextWayPoint() } return (*itr).second; } - return NULL; + return nullptr; } void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/) @@ -130,7 +130,7 @@ void SmartAI::StartPath(bool run, uint32 path, bool repeat, Unit* /*invoker*/) { mLastOOCPos = me->GetPosition(); me->GetMotionMaster()->MovePoint(wp->id, wp->x, wp->y, wp->z); - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, NULL, wp->id, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_START, nullptr, wp->id, GetScript()->GetPathId()); } } @@ -167,7 +167,7 @@ void SmartAI::PausePath(uint32 delay, bool forced) me->StopMoving();//force stop me->GetMotionMaster()->MoveIdle();//force stop } - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, NULL, mLastWP->id, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_PAUSED, nullptr, mLastWP->id, GetScript()->GetPathId()); } void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail) @@ -183,19 +183,19 @@ void SmartAI::StopPath(uint32 DespawnTime, uint32 quest, bool fail) mLastOOCPos = me->GetPosition(); me->StopMoving();//force stop me->GetMotionMaster()->MoveIdle(); - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_STOPPED, NULL, mLastWP->id, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_STOPPED, nullptr, mLastWP->id, GetScript()->GetPathId()); EndPath(fail); } void SmartAI::EndPath(bool fail) { - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, NULL, mLastWP->id, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_ENDED, nullptr, mLastWP->id, GetScript()->GetPathId()); RemoveEscortState(SMART_ESCORT_ESCORTING | SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING); - mWayPoints = NULL; + mWayPoints = nullptr; mCurrentWPID = 0; mWPPauseTimer = 0; - mLastWP = NULL; + mLastWP = nullptr; if (mCanRepeatPath) StartPath(mRun, GetScript()->GetPathId(), true); @@ -216,7 +216,7 @@ void SmartAI::EndPath(bool fail) if (Group* group = player->GetGroup()) { - for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) + for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next()) { Player* groupGuy = groupRef->GetSource(); @@ -226,7 +226,8 @@ void SmartAI::EndPath(bool fail) groupGuy->FailQuest(mEscortQuestID); } } - }else + } + else { for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter) { @@ -278,7 +279,7 @@ void SmartAI::UpdatePath(const uint32 diff) { if (!me->IsInCombat() && !HasEscortState(SMART_ESCORT_RETURNING) && (mWPReached || mLastWPIDReached == SMART_ESCORT_LAST_OOC_POINT || mForcedPaused)) { - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, NULL, mLastWP->id, GetScript()->GetPathId()); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_RESUMED, nullptr, mLastWP->id, GetScript()->GetPathId()); RemoveEscortState(SMART_ESCORT_PAUSED); if (mForcedPaused)// if paused between 2 wps resend movement { @@ -365,7 +366,7 @@ bool SmartAI::IsEscortInvokerInRange() if (Group* group = player->GetGroup()) { - for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) + for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next()) { Player* groupGuy = groupRef->GetSource(); @@ -373,7 +374,8 @@ bool SmartAI::IsEscortInvokerInRange() return true; } } - }else + } + else { for (ObjectList::iterator iter = targets->begin(); iter != targets->end(); ++iter) { @@ -391,7 +393,7 @@ bool SmartAI::IsEscortInvokerInRange() void SmartAI::MovepointReached(uint32 id) { if (id != SMART_ESCORT_LAST_OOC_POINT && mLastWPIDReached != id) - GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_REACHED, NULL, id); + GetScript()->ProcessEventsFor(SMART_EVENT_WAYPOINT_REACHED, nullptr, id); mLastWPIDReached = id; mWPReached = true; @@ -402,7 +404,7 @@ void SmartAI::MovementInform(uint32 MovementType, uint32 Data) if ((MovementType == POINT_MOTION_TYPE && Data == SMART_ESCORT_LAST_OOC_POINT) || MovementType == FOLLOW_MOTION_TYPE) me->ClearUnitState(UNIT_STATE_EVADE); - GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, NULL, MovementType, Data); + GetScript()->ProcessEventsFor(SMART_EVENT_MOVEMENTINFORM, nullptr, MovementType, Data); if (MovementType != POINT_MOTION_TYPE || !HasEscortState(SMART_ESCORT_ESCORTING)) return; MovepointReached(Data); @@ -448,7 +450,7 @@ void SmartAI::MoveInLineOfSight(Unit* who) GetScript()->OnMoveInLineOfSight(who); - if (AssistPlayerInCombat(who)) + if (AssistPlayerInCombatAgainst(who)) return; CreatureAI::MoveInLineOfSight(who); @@ -459,7 +461,7 @@ bool SmartAI::CanAIAttack(const Unit* /*who*/) const return !(me->HasReactState(REACT_PASSIVE)); } -bool SmartAI::AssistPlayerInCombat(Unit* who) +bool SmartAI::AssistPlayerInCombatAgainst(Unit* who) { if (me->HasReactState(REACT_PASSIVE)) return false; @@ -627,7 +629,7 @@ void SmartAI::UpdateAIWhileCharmed(const uint32 /*diff*/) { } void SmartAI::CorpseRemoved(uint32& respawnDelay) { - GetScript()->ProcessEventsFor(SMART_EVENT_CORPSE_REMOVED, NULL, respawnDelay); + GetScript()->ProcessEventsFor(SMART_EVENT_CORPSE_REMOVED, nullptr, respawnDelay); } void SmartAI::PassengerBoarded(Unit* who, int8 seatId, bool apply) @@ -646,7 +648,7 @@ void SmartAI::InitializeAI() void SmartAI::OnCharmed(bool apply) { - GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, NULL, 0, 0, apply); + GetScript()->ProcessEventsFor(SMART_EVENT_CHARMED, nullptr, 0, 0, apply); if (!apply && !me->IsInEvadeMode()) if (Unit* charmer = me->GetCharmer()) @@ -655,7 +657,7 @@ void SmartAI::OnCharmed(bool apply) void SmartAI::DoAction(int32 param) { - GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, NULL, param); + GetScript()->ProcessEventsFor(SMART_EVENT_ACTION_DONE, nullptr, param); } uint32 SmartAI::GetData(uint32 /*id*/) const @@ -665,7 +667,7 @@ uint32 SmartAI::GetData(uint32 /*id*/) const void SmartAI::SetData(uint32 id, uint32 value) { - GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value); + GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value); } void SmartAI::SetGUID(ObjectGuid /*guid*/, int32 /*id*/) { } @@ -799,7 +801,7 @@ void SmartAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker) void SmartAI::sOnGameEvent(bool start, uint16 eventId) { - GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId); + GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, nullptr, eventId); } void SmartAI::OnSpellClick(Unit* clicker, bool& result) @@ -838,14 +840,14 @@ void SmartGameObjectAI::Reset() bool SmartGameObjectAI::GossipHello(Player* player) { TC_LOG_DEBUG("scripts.ai", "SmartGameObjectAI::GossipHello"); - GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0, 0, false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0, 0, false, nullptr, go); return false; } // Called when a player selects a gossip item in the gameobject's gossip menu. bool SmartGameObjectAI::GossipSelect(Player* player, uint32 sender, uint32 action) { - GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action, false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_SELECT, player, sender, action, false, nullptr, go); return false; } @@ -858,26 +860,26 @@ bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/, // Called when a player accepts a quest from the gameobject. bool SmartGameObjectAI::QuestAccept(Player* player, Quest const* quest) { - GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId(), 0, false, nullptr, go); return false; } // Called when a player selects a quest reward. bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 opt) { - GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt, false, nullptr, go); return false; } // Called when the gameobject is destroyed (destructible buildings only). void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId) { - GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, nullptr, go); } void SmartGameObjectAI::SetData(uint32 id, uint32 value) { - GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value); + GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value); } void SmartGameObjectAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker) @@ -889,7 +891,7 @@ void SmartGameObjectAI::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* inv void SmartGameObjectAI::OnGameEvent(bool start, uint16 eventId) { - GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, NULL, eventId); + GetScript()->ProcessEventsFor(start ? SMART_EVENT_GAME_EVENT_START : SMART_EVENT_GAME_EVENT_END, nullptr, eventId); } void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit) @@ -899,7 +901,7 @@ void SmartGameObjectAI::OnStateChanged(uint32 state, Unit* unit) void SmartGameObjectAI::EventInform(uint32 eventId) { - GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, NULL, eventId); + GetScript()->ProcessEventsFor(SMART_EVENT_GO_EVENT_INFORM, nullptr, eventId); } class SmartTrigger : public AreaTriggerScript @@ -915,7 +917,7 @@ class SmartTrigger : public AreaTriggerScript TC_LOG_DEBUG("scripts.ai", "AreaTrigger %u is using SmartTrigger script", trigger->id); SmartScript script; - script.OnInitialize(NULL, trigger); + script.OnInitialize(nullptr, trigger); script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); return true; } diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h index aa7c9ace0b387..fe703bc208378 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.h +++ b/src/server/game/AI/SmartScripts/SmartAI.h @@ -49,7 +49,7 @@ class TC_GAME_API SmartAI : public CreatureAI explicit SmartAI(Creature* c); // Start moving to the desired MovePoint - void StartPath(bool run = false, uint32 path = 0, bool repeat = false, Unit* invoker = NULL); + void StartPath(bool run = false, uint32 path = 0, bool repeat = false, Unit* invoker = nullptr); bool LoadPath(uint32 entry); void PausePath(uint32 delay, bool forced = false); void StopPath(uint32 DespawnTime = 0, uint32 quest = 0, bool fail = false); @@ -75,7 +75,7 @@ class TC_GAME_API SmartAI : public CreatureAI // Called at reaching home after evade, InitializeAI(), EnterEvadeMode() for resetting variables void JustReachedHome() override; - // Called for reaction at enter to combat if not in combat yet (enemy can be NULL) + // Called for reaction at enter to combat if not in combat yet (enemy can be nullptr) void EnterCombat(Unit* enemy) override; // Called for reaction at stopping attack at no attackers or targets @@ -221,7 +221,7 @@ class TC_GAME_API SmartAI : public CreatureAI bool mCanCombatMove; bool mForcedPaused; uint32 mInvincibilityHpLevel; - bool AssistPlayerInCombat(Unit* who); + bool AssistPlayerInCombatAgainst(Unit* who); uint32 mDespawnTime; uint32 mDespawnState; diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 75b9752a19393..c8b640d3683fc 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -39,9 +39,9 @@ SmartScript::SmartScript() { - go = NULL; - me = NULL; - trigger = NULL; + go = nullptr; + me = nullptr; + trigger = nullptr; mEventPhase = 0; mPathId = 0; mTargetStorage = new ObjectListMap(); @@ -117,8 +117,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { ObjectList* targets = GetTargets(e, unit); Creature* talker = me; - Player* targetPlayer = NULL; - Unit* talkTarget = NULL; + Player* targetPlayer = nullptr; + Unit* talkTarget = nullptr; if (targets) { @@ -328,7 +328,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) { - (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL); + (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, nullptr); TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", (*itr)->GetGUID().GetCounter(), e.action.quest.quest); } @@ -1470,7 +1470,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!IsSmart()) break; - WorldObject* target = NULL; + WorldObject* target = nullptr; 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 || @@ -1604,7 +1604,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; } case SMART_ACTION_TRIGGER_TIMED_EVENT: - ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, e.action.timeEvent.id); + ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, nullptr, e.action.timeEvent.id); break; case SMART_ACTION_REMOVE_TIMED_EVENT: mRemIDs.push_back(e.action.timeEvent.id); @@ -1623,7 +1623,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u meOrigGUID = me->GetGUID(); if (!goOrigGUID && go) goOrigGUID = go->GetGUID(); - go = NULL; + go = nullptr; me = (*itr)->ToCreature(); break; } @@ -1634,7 +1634,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!goOrigGUID && go) goOrigGUID = go->GetGUID(); go = (*itr)->ToGameObject(); - me = NULL; + me = nullptr; break; } } @@ -2268,7 +2268,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u waypoints[4] = e.action.closestWaypointFromList.wp5; waypoints[5] = e.action.closestWaypointFromList.wp6; float distanceToClosest = std::numeric_limits::max(); - WayPoint* closestWp = NULL; + WayPoint* closestWp = nullptr; ObjectList* targets = GetTargets(e, unit); if (targets) @@ -2488,9 +2488,9 @@ SmartScriptHolder SmartScript::CreateEvent(SMART_EVENT e, uint32 event_flags, ui return script; } -ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*= NULL*/) +ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /*= nullptr*/) { - Unit* scriptTrigger = NULL; + Unit* scriptTrigger = nullptr; if (invoker) scriptTrigger = invoker; else if (Unit* tempLastInvoker = GetLastInvoker()) @@ -2545,7 +2545,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* { if (Group* group = player->GetGroup()) { - for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) + for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next()) if (Player* member = groupRef->GetSource()) l->push_back(member); } @@ -2760,7 +2760,7 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* if (l->empty()) { delete l; - l = NULL; + l = nullptr; } return l; @@ -3172,7 +3172,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui { if (e.event.gameEvent.gameEventId != var0) return; - ProcessAction(e, NULL, var0); + ProcessAction(e, nullptr, var0); break; } case SMART_EVENT_GO_STATE_CHANGED: @@ -3186,7 +3186,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui { if (e.event.eventInform.eventId != var0) return; - ProcessAction(e, NULL, var0); + ProcessAction(e, nullptr, var0); break; } case SMART_EVENT_ACTION_DONE: @@ -3201,7 +3201,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!me || !me->IsInCombat()) return; - ObjectList* _targets = NULL; + ObjectList* _targets = nullptr; switch (e.GetTargetType()) { @@ -3221,7 +3221,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if (!_targets) return; - Unit* target = NULL; + Unit* target = nullptr; for (ObjectList::const_iterator itr = _targets->begin(); itr != _targets->end(); ++itr) { @@ -3352,7 +3352,7 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) if (e.GetEventType() == SMART_EVENT_UPDATE_IC && (!me || !me->IsInCombat())) return; - if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat())) //can be used with me=NULL (go script) + if (e.GetEventType() == SMART_EVENT_UPDATE_OOC && (me && me->IsInCombat())) //can be used with me=nullptr (go script) return; if (e.timer < diff) @@ -3489,7 +3489,7 @@ void SmartScript::OnUpdate(uint32 const diff) mTalkerEntry = 0; mTextTimer = 0; mUseTextTimer = false; - ProcessEventsFor(SMART_EVENT_TEXT_OVER, NULL, textID, entry); + ProcessEventsFor(SMART_EVENT_TEXT_OVER, nullptr, textID, entry); } else mTextTimer -= diff; } } @@ -3538,19 +3538,19 @@ void SmartScript::GetScript() e = sSmartScriptMgr->GetScript(-((int32)me->GetSpawnId()), mScriptType); if (e.empty()) e = sSmartScriptMgr->GetScript((int32)me->GetEntry(), mScriptType); - FillScript(e, me, NULL); + FillScript(e, me, nullptr); } else if (go) { e = sSmartScriptMgr->GetScript(-((int32)go->GetSpawnId()), mScriptType); if (e.empty()) e = sSmartScriptMgr->GetScript((int32)go->GetEntry(), mScriptType); - FillScript(e, go, NULL); + FillScript(e, go, nullptr); } else if (trigger) { e = sSmartScriptMgr->GetScript((int32)trigger->id, mScriptType); - FillScript(e, NULL, trigger); + FillScript(e, nullptr, trigger); } } @@ -3603,48 +3603,18 @@ void SmartScript::OnMoveInLineOfSight(Unit* who) ProcessEventsFor(me->IsInCombat() ? SMART_EVENT_IC_LOS : SMART_EVENT_OOC_LOS, who); } - -/* -void SmartScript::UpdateAIWhileCharmed(const uint32 diff) { } - -void SmartScript::DoAction(const int32 param) { } - -uint32 SmartScript::GetData(uint32 id) -{ - return 0; -} - -void SmartScript::SetData(uint32 id, uint32 value) { } - -void SmartScript::SetGUID(uint64 guid, int32 id) { } - -uint64 SmartScript::GetGUID(int32 id) -{ - return 0; -} - -void SmartScript::MovepointStart(uint32 id) { } - -void SmartScript::SetRun(bool run) { } - -void SmartScript::SetMovePathEndAction(SMART_ACTION action) { } - -uint32 SmartScript::DoChat(int8 id, uint64 whisperGuid) -{ - return 0; -}*/ // SmartScript end Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) { if (!me) - return NULL; + return nullptr; CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY())); Cell cell(p); cell.SetNoCreate(); - Unit* unit = NULL; + Unit* unit = nullptr; Trinity::MostHPMissingInRange u_check(me, range, MinHPDiff); Trinity::UnitLastSearcher searcher(me, unit, u_check); @@ -3692,9 +3662,9 @@ void SmartScript::DoFindFriendlyMissingBuff(std::list& list, float ra Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly) { if (!me) - return NULL; + return nullptr; - Unit* unit = NULL; + Unit* unit = nullptr; Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(me, me, range, playerOnly); Trinity::UnitLastSearcher searcher(me, unit, u_check); me->VisitNearbyObject(range, searcher); diff --git a/src/server/game/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index a28f223486085..3e3af58a81391 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -34,19 +34,19 @@ class TC_GAME_API SmartScript SmartScript(); ~SmartScript(); - void OnInitialize(WorldObject* obj, AreaTriggerEntry const* at = NULL); + void OnInitialize(WorldObject* obj, AreaTriggerEntry const* at = nullptr); void GetScript(); void FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEntry const* at); - void ProcessEventsFor(SMART_EVENT e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL); - void ProcessEvent(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL); + void ProcessEventsFor(SMART_EVENT e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr); + void ProcessEvent(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr); bool CheckTimer(SmartScriptHolder const& e) const; void RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max); void UpdateTimer(SmartScriptHolder& e, uint32 const diff); void InitTimer(SmartScriptHolder& e); - void ProcessAction(SmartScriptHolder& e, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL); - void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = NULL, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = NULL, GameObject* gob = NULL); - ObjectList* GetTargets(SmartScriptHolder const& e, Unit* invoker = NULL); + void ProcessAction(SmartScriptHolder& e, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr); + void ProcessTimedAction(SmartScriptHolder& e, uint32 const& min, uint32 const& max, Unit* unit = nullptr, uint32 var0 = 0, uint32 var1 = 0, bool bvar = false, const SpellInfo* spell = nullptr, GameObject* gob = nullptr); + ObjectList* GetTargets(SmartScriptHolder const& e, Unit* invoker = nullptr); ObjectList* GetWorldObjectsInDist(float dist); void InstallTemplate(SmartScriptHolder const& e); SmartScriptHolder CreateEvent(SMART_EVENT e, uint32 event_flags, uint32 event_param1, uint32 event_param2, uint32 event_param3, uint32 event_param4, SMART_ACTION action, uint32 action_param1, uint32 action_param2, uint32 action_param3, uint32 action_param4, uint32 action_param5, uint32 action_param6, SMARTAI_TARGETS t, uint32 target_param1, uint32 target_param2, uint32 target_param3, uint32 phaseMask = 0); @@ -55,7 +55,7 @@ class TC_GAME_API SmartScript uint32 GetPathId() const { return mPathId; } WorldObject* GetBaseObject() { - WorldObject* obj = NULL; + WorldObject* obj = nullptr; if (me) obj = me; else if (go) @@ -108,7 +108,7 @@ class TC_GAME_API SmartScript (*mTargetStorage)[id] = new ObjectGuidList(targets, GetBaseObject()); } - bool IsSmart(Creature* c = NULL) + bool IsSmart(Creature* c = nullptr) { bool smart = true; if (c && c->GetAIName() != "SmartAI") @@ -123,7 +123,7 @@ class TC_GAME_API SmartScript return smart; } - bool IsSmartGO(GameObject* g = NULL) + bool IsSmartGO(GameObject* g = nullptr) { bool smart = true; if (g && g->GetAIName() != "SmartGameObjectAI") @@ -142,7 +142,7 @@ class TC_GAME_API SmartScript ObjectListMap::iterator itr = mTargetStorage->find(id); if (itr != mTargetStorage->end()) return (*itr).second->GetObjectList(); - return NULL; + return nullptr; } void StoreCounter(uint32 id, uint32 value, uint32 reset) @@ -214,7 +214,7 @@ class TC_GAME_API SmartScript if (Creature* m = ObjectAccessor::GetCreature(*lookupRoot, meOrigGUID)) { me = m; - go = NULL; + go = nullptr; } } @@ -222,7 +222,7 @@ class TC_GAME_API SmartScript { if (GameObject* o = ObjectAccessor::GetGameObject(*lookupRoot, goOrigGUID)) { - me = NULL; + me = nullptr; go = o; } } diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index fa3e8818fe00b..6269b968852e0 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -132,6 +132,10 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accountId) stmt->setUInt32(0, accountId); trans->Append(stmt); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_MUTED); + stmt->setUInt32(0, accountId); + trans->Append(stmt); + LoginDatabase.CommitTransaction(trans); return AccountOpResult::AOR_OK; diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 741983431dd80..70b60d11a65d4 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -59,9 +59,9 @@ enum RBACPermissions // 7 - reuse // 8 - reuse // 9 - reuse - // 10 - 7.x only + RBAC_PERM_USE_CHARACTER_TEMPLATES = 10, // not on 3.3.5a RBAC_PERM_LOG_GM_TRADE = 11, - // 12 - 7.x only + RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEMON_HUNTER = 12, // not on 3.3.5a RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES = 13, RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK = 14, RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK = 15, @@ -111,7 +111,16 @@ enum RBACPermissions RBAC_PERM_COMMAND_RBAC_ACC_PERM_DENY = 204, RBAC_PERM_COMMAND_RBAC_ACC_PERM_REVOKE = 205, RBAC_PERM_COMMAND_RBAC_LIST = 206, - // 207 - 216 do NOT use + RBAC_PERM_COMMAND_BNET_ACCOUNT = 207, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_CREATE = 208, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_LOCK_COUNTRY = 209, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_LOCK_IP = 210, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_PASSWORD = 211, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_SET = 212, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_SET_PASSWORD = 213, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_LINK = 214, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_UNLINK = 215, // not on 3.3.5a + RBAC_PERM_COMMAND_BNET_ACCOUNT_CREATE_GAME = 216, // not on 3.3.5a RBAC_PERM_COMMAND_ACCOUNT = 217, RBAC_PERM_COMMAND_ACCOUNT_ADDON = 218, RBAC_PERM_COMMAND_ACCOUNT_CREATE = 219, @@ -670,8 +679,8 @@ enum RBACPermissions RBAC_PERM_COMMAND_WP_UNLOAD = 772, RBAC_PERM_COMMAND_WP_RELOAD = 773, RBAC_PERM_COMMAND_WP_SHOW = 774, - RBAC_PERM_COMMAND_MODIFY_CURRENCY = 775, // only 6.x - RBAC_PERM_COMMAND_DEBUG_PHASE = 776, // only 6.x + RBAC_PERM_COMMAND_MODIFY_CURRENCY = 775, // not on 3.3.5a + RBAC_PERM_COMMAND_DEBUG_PHASE = 776, // not on 3.3.5a RBAC_PERM_COMMAND_MAILBOX = 777, RBAC_PERM_COMMAND_AHBOT = 778, RBAC_PERM_COMMAND_AHBOT_ITEMS = 779, @@ -694,7 +703,42 @@ enum RBACPermissions RBAC_PERM_COMMAND_INSTANCE_GET_BOSS_STATE = 796, RBAC_PERM_COMMAND_PVPSTATS = 797, RBAC_PERM_COMMAND_MODIFY_XP = 798, - // 799 - 834 6.x only + RBAC_PERM_COMMAND_GO_BUG_TICKET = 799, // not on 3.3.5a + RBAC_PERM_COMMAND_GO_COMPLAINT_TICKET = 800, // not on 3.3.5a + RBAC_PERM_COMMAND_GO_SUGGESTION_TICKET = 801, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG = 802, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT = 803, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION = 804, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_ASSIGN = 805, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_CLOSE = 806, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_CLOSEDLIST = 807, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_COMMENT = 808, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_DELETE = 809, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_LIST = 810, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_UNASSIGN = 811, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_BUG_VIEW = 812, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_ASSIGN = 813, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_CLOSE = 814, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_CLOSEDLIST = 815, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_COMMENT = 816, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_DELETE = 817, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_LIST = 818, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_UNASSIGN = 819, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_COMPLAINT_VIEW = 820, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_ASSIGN = 821, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_CLOSE = 822, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_CLOSEDLIST = 823, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_COMMENT = 824, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_DELETE = 825, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_LIST = 826, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_UNASSIGN = 827, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_SUGGESTION_VIEW = 828, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_RESET_ALL = 829, // not on 3.3.5a + // 830 reuse + RBAC_PERM_COMMAND_TICKET_RESET_BUG = 831, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_RESET_COMPLAINT = 832, // not on 3.3.5a + RBAC_PERM_COMMAND_TICKET_RESET_SUGGESTION = 833, // not on 3.3.5a + RBAC_PERM_COMMAND_GO_QUEST = 834, // not on 3.3.5a RBAC_PERM_COMMAND_DEBUG_LOADCELLS = 835, RBAC_PERM_COMMAND_DEBUG_BOUNDARY = 836, RBAC_PERM_COMMAND_NPC_EVADE = 837, diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 11c2635da33c4..f600244f69272 100644 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -1515,7 +1515,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement->ID)) return; - TC_LOG_DEBUG("achievement", "AchievementMgr::CompletedAchievement(%u). Player: %s (%u)", + TC_LOG_INFO("achievement", "AchievementMgr::CompletedAchievement(%u). Player: %s (%u)", achievement->ID, m_player->GetName().c_str(), m_player->GetGUID().GetCounter()); SendAchievementEarned(achievement); diff --git a/src/server/game/Battlefield/Battlefield.cpp b/src/server/game/Battlefield/Battlefield.cpp index 924b3b4377789..f44099f6037ce 100644 --- a/src/server/game/Battlefield/Battlefield.cpp +++ b/src/server/game/Battlefield/Battlefield.cpp @@ -797,18 +797,21 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl GameObject* Battlefield::SpawnGameObject(uint32 entry, float x, float y, float z, float o) { // Get map object - Map* map = sMapMgr->CreateBaseMap(571); // *vomits* + Map* map = sMapMgr->CreateBaseMap(m_MapId); if (!map) return 0; + // Calculate rotation + G3D::Quat rot = G3D::Matrix3::fromEulerAnglesZYX(o, 0.f, 0.f); + // Create gameobject GameObject* go = new GameObject; - if (!go->Create(map->GenerateLowGuid(), entry, map, PHASEMASK_NORMAL, Position(x, y, z, o), G3D::Quat(), 255, GO_STATE_READY)) + if (!go->Create(map->GenerateLowGuid(), entry, map, PHASEMASK_NORMAL, Position(x, y, z, o), rot, 255, GO_STATE_READY)) { TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Gameobject template %u could not be found in the database! Battlefield has not been created!", entry); TC_LOG_ERROR("bg.battlefield", "Battlefield::SpawnGameObject: Could not create gameobject template %u! Battlefield has not been created!", entry); delete go; - return NULL; + return nullptr; } // Add to world diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 79b07aa5b65bb..2e66c587e1598 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1350,12 +1350,22 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float Map* map = FindBgMap(); if (!map) return false; + + G3D::Quat rot(rotation0, rotation1, rotation2, rotation3); + // Temporally add safety check for bad spawns and send log (object rotations need to be rechecked in sniff) + if (!rotation0 && !rotation1 && !rotation2 && !rotation3) + { + TC_LOG_DEBUG("bg.battleground", "Battleground::AddObject: gameoobject [entry: %u, object type: %u] for BG (map: %u) has zeroed rotation fields, " + "orientation used temporally, but please fix the spawn", entry, type, m_MapId); + + rot = G3D::Matrix3::fromEulerAnglesZYX(o, 0.f, 0.f); + } + // Must be created this way, adding to godatamap would add it to the base map of the instance // and when loading it (in go::LoadFromDB()), a new guid would be assigned to the object, and a new object would be created // So we must create it specific for this instance GameObject* go = new GameObject; - if (!go->Create(GetBgMap()->GenerateLowGuid(), entry, GetBgMap(), - PHASEMASK_NORMAL, Position(x, y, z, o), G3D::Quat(rotation0, rotation1, rotation2, rotation3), 255, goState)) + if (!go->Create(GetBgMap()->GenerateLowGuid(), entry, GetBgMap(), PHASEMASK_NORMAL, Position(x, y, z, o), rot, 255, goState)) { TC_LOG_ERROR("bg.battleground", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!", entry, m_MapId, m_InstanceID); diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 6317fae2767e5..2629013585a43 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -22,6 +22,7 @@ #include "InstanceScript.h" #include "ObjectMgr.h" #include "Player.h" +#include "Pet.h" #include "ReputationMgr.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" @@ -104,7 +105,9 @@ ConditionMgr::ConditionTypeInfo const ConditionMgr::StaticConditionTypeData[COND { "In Water", false, false, false }, { "Terrain Swap", false, false, false }, { "Sit/stand state", true, true, false }, - { "Daily Quest Completed",true, false, false } + { "Daily Quest Completed",true, false, false }, + { "Charmed", false, false, false }, + { "Pet type", true, false, false } }; // Checks if object meets the condition @@ -455,6 +458,19 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const condMeets = player->IsDailyQuestDone(ConditionValue1); break; } + case CONDITION_CHARMED: + { + if (Unit* unit = object->ToUnit()) + condMeets = unit->IsCharmed(); + break; + } + case CONDITION_PET_TYPE: + { + if (Player* player = object->ToPlayer()) + if (Pet* pet = player->GetPet()) + condMeets = (((1 << pet->getPetType()) & ConditionValue1) != 0); + break; + } default: condMeets = false; break; @@ -631,6 +647,12 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const case CONDITION_DAILY_QUEST_DONE: mask |= GRID_MAP_TYPE_MASK_PLAYER; break; + case CONDITION_CHARMED: + mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER; + break; + case CONDITION_PET_TYPE: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -2129,8 +2151,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const } break; } - case CONDITION_IN_WATER: - break; case CONDITION_TERRAIN_SWAP: TC_LOG_ERROR("sql.sql", "%s is not valid for this branch, skipped.", cond->ToString(true).c_str()); return false; @@ -2156,6 +2176,15 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const } break; } + case CONDITION_PET_TYPE: + if (cond->ConditionValue1 >= (1 << MAX_PET_TYPE)) + { + TC_LOG_ERROR("sql.sql", "%s has non-existing pet type %u, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1); + return false; + } + break; + case CONDITION_IN_WATER: + case CONDITION_CHARMED: default: break; } diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 4ec2be0753ab4..659cec02d37a5 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -74,7 +74,9 @@ enum ConditionTypes CONDITION_TERRAIN_SWAP = 41, // only for 6.x CONDITION_STAND_STATE = 42, // stateType state 0 true if unit matches specified sitstate (0,x: has exactly state x; 1,0: any standing state; 1,1: any sitting state;) CONDITION_DAILY_QUEST_DONE = 43, // quest id 0 0 true if daily quest has been completed for the day - CONDITION_MAX = 44 // MAX + CONDITION_CHARMED = 44, // 0 0 0 true if unit is currently charmed + CONDITION_PET_TYPE = 45, // mask 0 0 true if player has a pet of given type(s) + CONDITION_MAX = 46 // MAX }; /*! Documentation on implementing a new ConditionSourceType: diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 255225c973980..051b5e824bf12 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -25,7 +25,7 @@ #include "Timer.h" #include "ObjectDefines.h" -#include +#include #include typedef std::map AreaFlagByAreaID; @@ -145,7 +145,7 @@ DBCStorage sMovieStore(MovieEntryfmt); DBCStorage sNamesProfanityStore(NamesProfanityEntryfmt); DBCStorage sNamesReservedStore(NamesReservedEntryfmt); -typedef std::array, TOTAL_LOCALES> NameValidationRegexContainer; +typedef std::array, TOTAL_LOCALES> NameValidationRegexContainer; NameValidationRegexContainer NamesProfaneValidators; NameValidationRegexContainer NamesReservedValidators; @@ -410,11 +410,14 @@ void LoadDBCStores(const std::string& dataPath) continue; ASSERT(namesProfanity->Language < TOTAL_LOCALES || namesProfanity->Language == -1); + std::wstring wname; + ASSERT(Utf8toWStr(namesProfanity->Name, wname)); + if (namesProfanity->Language != -1) - NamesProfaneValidators[namesProfanity->Language].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize); + NamesProfaneValidators[namesProfanity->Language].emplace_back(wname, std::regex::icase | std::regex::optimize); else for (uint32 i = 0; i < TOTAL_LOCALES; ++i) - NamesProfaneValidators[i].emplace_back(namesProfanity->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize); + NamesProfaneValidators[i].emplace_back(wname, std::regex::icase | std::regex::optimize); } for (uint32 i = 0; i < sNamesReservedStore.GetNumRows(); ++i) @@ -424,11 +427,14 @@ void LoadDBCStores(const std::string& dataPath) continue; ASSERT(namesReserved->Language < TOTAL_LOCALES || namesReserved->Language == -1); + std::wstring wname; + ASSERT(Utf8toWStr(namesReserved->Name, wname)); + if (namesReserved->Language != -1) - NamesReservedValidators[namesReserved->Language].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize); + NamesReservedValidators[namesReserved->Language].emplace_back(wname, std::regex::icase | std::regex::optimize); else for (uint32 i = 0; i < TOTAL_LOCALES; ++i) - NamesReservedValidators[i].emplace_back(namesReserved->Name, boost::regex::perl | boost::regex::icase | boost::regex::optimize); + NamesReservedValidators[i].emplace_back(wname, std::regex::icase | std::regex::optimize); } @@ -1000,18 +1006,18 @@ SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, u return NULL; } -ResponseCodes ValidateName(std::string const& name, LocaleConstant locale) +ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale) { if (locale >= TOTAL_LOCALES) return RESPONSE_FAILURE; - for (boost::regex const& regex : NamesProfaneValidators[locale]) - if (boost::regex_search(name, regex)) + for (std::wregex const& regex : NamesProfaneValidators[locale]) + if (std::regex_search(name, regex)) return CHAR_NAME_PROFANE; // regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific - for (boost::regex const& regex : NamesReservedValidators[locale]) - if (boost::regex_search(name, regex)) + for (std::wregex const& regex : NamesReservedValidators[locale]) + if (std::regex_search(name, regex)) return CHAR_NAME_RESERVED; return CHAR_NAME_SUCCESS; diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 00b4141555f9f..128ff7ad1b84e 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -75,7 +75,7 @@ typedef std::unordered_multimap SkillRac typedef std::pair SkillRaceClassInfoBounds; TC_GAME_API SkillRaceClassInfoEntry const* GetSkillRaceClassInfo(uint32 skill, uint8 race, uint8 class_); -TC_GAME_API ResponseCodes ValidateName(std::string const& name, LocaleConstant locale); +TC_GAME_API ResponseCodes ValidateName(std::wstring const& name, LocaleConstant locale); TC_GAME_API EmotesTextSoundEntry const* FindTextSoundEmoteFor(uint32 emote, uint32 race, uint32 gender); diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 4a5f70165fc40..a5e28e8c5e465 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1383,26 +1383,7 @@ bool Creature::LoadCreatureFromDB(ObjectGuid::LowType spawnId, Map* map, bool ad } } - uint32 curhealth; - - if (!m_regenHealth) - { - curhealth = data->curhealth; - if (curhealth) - { - curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank)); - if (curhealth < 1) - curhealth = 1; - } - SetPower(POWER_MANA, data->curmana); - } - else - { - curhealth = GetMaxHealth(); - SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); - } - - SetHealth(m_deathState == ALIVE ? curhealth : 0); + SetSpawnHealth(); // checked at creature_template loading m_defaultMovementType = MovementGeneratorType(data->movementType); @@ -1443,6 +1424,35 @@ void Creature::LoadEquipment(int8 id, bool force /*= true*/) SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i, einfo->ItemEntry[i]); } +void Creature::SetSpawnHealth() +{ + uint32 curhealth; + + if (!m_regenHealth) + { + if (m_creatureData) + { + curhealth = m_creatureData->curhealth; + if (curhealth) + { + curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank)); + if (curhealth < 1) + curhealth = 1; + } + SetPower(POWER_MANA, m_creatureData->curmana); + } + else + curhealth = GetHealth(); + } + else + { + curhealth = GetMaxHealth(); + SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); + } + + SetHealth(m_deathState == ALIVE ? curhealth : 0); +} + bool Creature::hasQuest(uint32 quest_id) const { QuestRelationBounds qr = sObjectMgr->GetCreatureQuestRelationBounds(GetEntry()); @@ -1654,9 +1664,11 @@ void Creature::setDeathState(DeathState s) } else if (s == JUST_RESPAWNED) { - //if (IsPet()) - // setActive(true); - SetFullHealth(); + if (IsPet()) + SetFullHealth(); + else + SetSpawnHealth(); + SetLootRecipient(nullptr); ResetPlayerDamageReq(); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index cfe637c4b21cb..57a025fdd88c9 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -442,6 +442,7 @@ class TC_GAME_API Creature : public Unit, public GridObject, public Ma bool LoadCreaturesAddon(); void SelectLevel(); void LoadEquipment(int8 id = 1, bool force = false); + void SetSpawnHealth(); ObjectGuid::LowType GetSpawnId() const { return m_spawnId; } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 82792a49c96ae..def6c3828938e 100644 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -1327,6 +1327,11 @@ void Guardian::UpdateAttackPowerAndDamage(bool ranged) } bonusAP = owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.22f * mod; + if (AuraEffect* aurEff = owner->GetAuraEffectOfRankedSpell(34453, EFFECT_1, owner->GetGUID())) // Animal Handler + { + AddPct(bonusAP, aurEff->GetAmount()); + AddPct(val, aurEff->GetAmount()); + } SetBonusDamage(int32(owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.1287f * mod)); } else if (IsPetGhoul() || IsRisenAlly()) //ghouls benefit from deathknight's attack power (may be summon pet or not) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ac924f39a03ef..68625c175b629 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7773,7 +7773,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg if (triggerEntry == NULL) { // Don't cast unknown spell - TC_LOG_ERROR("entities.unit", "Unit::HandleProcTriggerSpell: Spell %u (effIndex: %u) has unknown TriggerSpell %u. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id); + TC_LOG_ERROR("entities.unit.handleproctriggerspell", "Unit::HandleProcTriggerSpell: Spell %u (effIndex: %u) has unknown TriggerSpell %u. Unhandled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex(), trigger_spell_id); return false; } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 772e9b970a296..30602cbf7d278 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1093,7 +1093,7 @@ void ObjectMgr::LoadGameObjectAddons() if (!gameObjectAddon.ParentRotation.isUnit()) { - TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has invalid path rotation, set to default", guid); + TC_LOG_ERROR("sql.sql", "GameObject (GUID: %u) has invalid parent rotation in `gameobject_addon`, set to default", guid); gameObjectAddon.ParentRotation = G3D::Quat(); } @@ -7701,7 +7701,7 @@ ResponseCodes ObjectMgr::CheckPlayerName(std::string const& name, LocaleConstant if (wname[i] == wname[i-1] && wname[i] == wname[i-2]) return CHAR_NAME_THREE_CONSECUTIVE; - return ValidateName(name, locale); + return ValidateName(wname, locale); } bool ObjectMgr::IsValidCharterName(const std::string& name) @@ -7739,7 +7739,7 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name, LocaleCons if (!isValidString(wname, strictMask, false)) return PET_NAME_MIXED_LANGUAGES; - switch (ValidateName(name, locale)) + switch (ValidateName(wname, locale)) { case CHAR_NAME_PROFANE: return PET_NAME_PROFANE; diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 8be44924c1220..2d94d4231429a 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -251,6 +251,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } sender->Say(msg, Language(lang)); + break; } case CHAT_MSG_EMOTE: { @@ -265,6 +266,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } sender->TextEmote(msg); + break; } case CHAT_MSG_YELL: { @@ -279,7 +281,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } sender->Yell(msg, Language(lang)); - } break; + break; + } case CHAT_MSG_WHISPER: { if (!normalizePlayerName(to)) @@ -319,7 +322,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) sender->AddWhisperWhiteList(receiver->GetGUID()); GetPlayer()->Whisper(msg, Language(lang), receiver); - } break; + break; + } case CHAT_MSG_PARTY: case CHAT_MSG_PARTY_LEADER: { @@ -340,7 +344,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::BuildChatPacket(data, ChatMsg(type), Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false, group->GetMemberGroup(GetPlayer()->GetGUID())); - } break; + break; + } case CHAT_MSG_GUILD: { if (GetPlayer()->GetGuildId()) @@ -352,7 +357,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) guild->BroadcastToGuild(this, false, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); } } - } break; + break; + } case CHAT_MSG_OFFICER: { if (GetPlayer()->GetGuildId()) @@ -364,7 +370,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) guild->BroadcastToGuild(this, true, msg, lang == LANG_ADDON ? LANG_ADDON : LANG_UNIVERSAL); } } - } break; + break; + } case CHAT_MSG_RAID: { // if player is in battleground, he cannot say to battleground members by /ra @@ -381,7 +388,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID, Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_RAID_LEADER: { // if player is in battleground, he cannot say to battleground members by /ra @@ -398,7 +406,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_LEADER, Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_RAID_WARNING: { Group* group = GetPlayer()->GetGroup(); @@ -411,7 +420,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) //in battleground, raid warning is sent only to players in battleground - code is ok ChatHandler::BuildChatPacket(data, CHAT_MSG_RAID_WARNING, Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_BATTLEGROUND: { //battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() @@ -424,7 +434,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND, Language(lang), sender, NULL, msg); group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_BATTLEGROUND_LEADER: { // battleground raid is always in Player->GetGroup(), never in GetOriginalGroup() @@ -437,7 +448,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) WorldPacket data; ChatHandler::BuildChatPacket(data, CHAT_MSG_BATTLEGROUND_LEADER, Language(lang), sender, NULL, msg);; group->BroadcastPacket(&data, false); - } break; + break; + } case CHAT_MSG_CHANNEL: { if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ)) @@ -457,7 +469,8 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) chn->Say(sender->GetGUID(), msg.c_str(), lang); } } - } break; + break; + } case CHAT_MSG_AFK: { if (!sender->IsInCombat()) diff --git a/src/server/game/Handlers/GroupHandler.cpp b/src/server/game/Handlers/GroupHandler.cpp index 00d64cee59b45..5ea81718a5dff 100644 --- a/src/server/game/Handlers/GroupHandler.cpp +++ b/src/server/game/Handlers/GroupHandler.cpp @@ -82,6 +82,13 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) return; } + // player trying to invite himself (most likely cheating) + if (player == GetPlayer()) + { + SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S); + return; + } + // restrict invite to GMs if (!sWorld->getBoolConfig(CONFIG_ALLOW_GM_GROUP) && !GetPlayer()->IsGameMaster() && player->IsGameMaster()) { @@ -176,6 +183,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) } if (!group->AddInvite(player)) { + group->RemoveAllInvites(); delete group; return; } diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp index 17c9c4a58d740..6ef6ab93fe4a3 100644 --- a/src/server/game/Handlers/PetHandler.cpp +++ b/src/server/game/Handlers/PetHandler.cpp @@ -39,13 +39,13 @@ void WorldSession::HandleDismissCritter(WorldPacket& recvData) ObjectGuid guid; recvData >> guid; - TC_LOG_DEBUG("network", "WORLD: Received CMSG_DISMISS_CRITTER for %s", guid.ToString().c_str()); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_DISMISS_CRITTER for %s", guid.ToString().c_str()); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - TC_LOG_DEBUG("network", "Vanitypet (%s) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", + TC_LOG_DEBUG("entities.pet", "Vanitypet (%s) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().GetCounter(), GetAccountId()); return; } @@ -71,17 +71,17 @@ void WorldSession::HandlePetAction(WorldPacket& recvData) // used also for charmed creature Unit* pet = ObjectAccessor::GetUnit(*_player, guid1); - TC_LOG_DEBUG("network", "HandlePetAction: %s - flag: %u, spellid: %u, target: %s.", guid1.ToString().c_str(), uint32(flag), spellid, guid2.ToString().c_str()); + TC_LOG_DEBUG("entities.pet", "HandlePetAction: %s - flag: %u, spellid: %u, target: %s.", guid1.ToString().c_str(), uint32(flag), spellid, guid2.ToString().c_str()); if (!pet) { - TC_LOG_DEBUG("network", "HandlePetAction: %s doesn't exist for %s %s", guid1.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); + TC_LOG_DEBUG("entities.pet", "HandlePetAction: %s doesn't exist for %s %s", guid1.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); return; } if (pet != GetPlayer()->GetFirstControlled()) { - TC_LOG_DEBUG("network", "HandlePetAction: %s does not belong to %s %s", guid1.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); + TC_LOG_DEBUG("entities.pet", "HandlePetAction: %s does not belong to %s %s", guid1.ToString().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetPlayer()->GetName().c_str()); return; } @@ -117,19 +117,19 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData) ObjectGuid guid; recvData >> guid; - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_STOP_ATTACK for %s", guid.ToString().c_str()); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_STOP_ATTACK for %s", guid.ToString().c_str()); Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - TC_LOG_ERROR("network", "HandlePetStopAttack: %s does not exist", guid.ToString().c_str()); + TC_LOG_ERROR("entities.pet", "HandlePetStopAttack: %s does not exist", guid.ToString().c_str()); return; } if (pet != GetPlayer()->GetPet() && pet != GetPlayer()->GetCharm()) { - TC_LOG_ERROR("network", "HandlePetStopAttack: %s isn't a pet or charmed creature of player %s", + TC_LOG_ERROR("entities.pet", "HandlePetStopAttack: %s isn't a pet or charmed creature of player %s", guid.ToString().c_str(), GetPlayer()->GetName().c_str()); return; } @@ -145,7 +145,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - TC_LOG_DEBUG("network", "WorldSession::HandlePetAction(petGuid: %s, tagGuid: %s, spellId: %u, flag: %u): object (GUID: %u Entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", + TC_LOG_DEBUG("entities.pet", "WorldSession::HandlePetAction(petGuid: %s, tagGuid: %s, spellId: %u, flag: %u): object (GUID: %u Entry: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", guid1.ToString().c_str(), guid2.ToString().c_str(), spellid, flag, pet->GetGUID().GetCounter(), pet->GetEntry(), pet->GetTypeId()); return; } @@ -263,7 +263,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe } break; default: - TC_LOG_ERROR("network", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); + TC_LOG_ERROR("entities.pet", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); } break; case ACT_REACTION: // 0x6 @@ -292,7 +292,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid); if (!spellInfo) { - TC_LOG_ERROR("network", "WORLD: unknown PET spell id %i", spellid); + TC_LOG_ERROR("spells.pet", "WORLD: unknown PET spell id %i", spellid); return; } @@ -391,13 +391,13 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe break; } default: - TC_LOG_ERROR("network", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); + TC_LOG_ERROR("entities.pet", "WORLD: unknown PET flag Action %i and spellid %i.", uint32(flag), spellid); } } void WorldSession::HandlePetNameQuery(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_NAME_QUERY"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_NAME_QUERY"); uint32 petnumber; ObjectGuid petguid; @@ -446,7 +446,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid) { if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE)) { - TC_LOG_DEBUG("network", "%s attempt open stable in cheating way.", guid.ToString().c_str()); + TC_LOG_DEBUG("entities.player.cheat", "%s attempt open stable in cheating way.", guid.ToString().c_str()); return false; } } @@ -455,7 +455,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid) { if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER)) { - TC_LOG_DEBUG("network", "Stablemaster %s not found or you can't interact with him.", guid.ToString().c_str()); + TC_LOG_DEBUG("entities.player", "Stablemaster %s not found or you can't interact with him.", guid.ToString().c_str()); return false; } } @@ -464,7 +464,7 @@ bool WorldSession::CheckStableMaster(ObjectGuid guid) void WorldSession::HandlePetSetAction(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_SET_ACTION"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_SET_ACTION"); ObjectGuid petguid; uint8 count; @@ -475,14 +475,14 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData) if (!pet || pet != _player->GetFirstControlled()) { - TC_LOG_ERROR("network", "HandlePetSetAction: Unknown %s or owner (%s)", petguid.ToString().c_str(), _player->GetGUID().ToString().c_str()); + TC_LOG_ERROR("entities.pet", "HandlePetSetAction: Unknown %s or owner (%s)", petguid.ToString().c_str(), _player->GetGUID().ToString().c_str()); return; } CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - TC_LOG_ERROR("network", "WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId()); + TC_LOG_ERROR("entities.pet", "WorldSession::HandlePetSetAction: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId()); return; } @@ -544,7 +544,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData) uint32 spell_id = UNIT_ACTION_BUTTON_ACTION(data[i]); uint8 act_state = UNIT_ACTION_BUTTON_TYPE(data[i]); - TC_LOG_DEBUG("network", "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", + TC_LOG_DEBUG("entities.pet", "Player %s has changed pet spell action. Position: %u, Spell: %u, State: 0x%X", _player->GetName().c_str(), position[i], spell_id, uint32(act_state)); //if it's act for spell (en/disable/cast) and there is a spell given (0 = remove spell) which pet doesn't know, don't add @@ -581,7 +581,7 @@ void WorldSession::HandlePetSetAction(WorldPacket& recvData) void WorldSession::HandlePetRename(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_RENAME"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_RENAME"); ObjectGuid petguid; uint8 isdeclined; @@ -669,7 +669,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData) { ObjectGuid guid; recvData >> guid; //pet guid - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_ABANDON %s", guid.ToString().c_str()); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_ABANDON %s", guid.ToString().c_str()); if (!_player->IsInWorld()) return; @@ -695,7 +695,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData) void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_SPELL_AUTOCAST"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_SPELL_AUTOCAST"); ObjectGuid guid; uint32 spellid; uint8 state; //1 for on, 0 for off @@ -711,14 +711,14 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) if (!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm())) { - TC_LOG_ERROR("network", "HandlePetSpellAutocastOpcode. %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); + TC_LOG_ERROR("entities.pet", "HandlePetSpellAutocastOpcode. %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid); if (!spellInfo) { - TC_LOG_ERROR("network", "WORLD: unknown PET spell id %u", spellid); + TC_LOG_ERROR("spells.pet", "WORLD: unknown PET spell id %u", spellid); return; } @@ -729,7 +729,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) CharmInfo* charmInfo = pet->GetCharmInfo(); if (!charmInfo) { - TC_LOG_ERROR("network", "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId()); + TC_LOG_ERROR("entities.pet", "WorldSession::HandlePetSpellAutocastOpcod: object (GUID: %u TypeId: %u) is considered pet-like but doesn't have a charminfo!", pet->GetGUID().GetCounter(), pet->GetTypeId()); return; } @@ -743,7 +743,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_CAST_SPELL"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_CAST_SPELL"); ObjectGuid guid; uint8 castCount; @@ -752,7 +752,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> guid >> castCount >> spellId >> castFlags; - TC_LOG_DEBUG("network", "WORLD: CMSG_PET_CAST_SPELL, %s, castCount: %u, spellId %u, castFlags %u", guid.ToString().c_str(), castCount, spellId, castFlags); + TC_LOG_DEBUG("entities.pet", "WORLD: CMSG_PET_CAST_SPELL, %s, castCount: %u, spellId %u, castFlags %u", guid.ToString().c_str(), castCount, spellId, castFlags); // This opcode is also sent from charmed and possessed units (players and creatures) if (!_player->GetGuardianPet() && !_player->GetCharm()) @@ -762,14 +762,14 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm())) { - TC_LOG_ERROR("network", "HandlePetCastSpellOpcode: %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); + TC_LOG_ERROR("entities.pet", "HandlePetCastSpellOpcode: %s isn't pet of player %s (%s).", guid.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str()); return; } SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - TC_LOG_ERROR("network", "WORLD: unknown PET spell id %i", spellId); + TC_LOG_ERROR("spells.pet", "WORLD: unknown PET spell id %i", spellId); return; } @@ -836,7 +836,7 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec void WorldSession::HandlePetLearnTalent(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_PET_LEARN_TALENT"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_PET_LEARN_TALENT"); ObjectGuid guid; uint32 talentId, requestedRank; @@ -848,7 +848,7 @@ void WorldSession::HandlePetLearnTalent(WorldPacket& recvData) void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_LEARN_PREVIEW_TALENTS_PET"); + TC_LOG_DEBUG("network.opcode", "WORLD: Received CMSG_LEARN_PREVIEW_TALENTS_PET"); ObjectGuid guid; recvData >> guid; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 143f535ddf538..ef5779bb64c56 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1217,5 +1217,7 @@ enum TrinityStrings LANG_INSTANCE_BIND_MISMATCH = 11014, LANG_CREATURE_NOT_AI_ENABLED = 11015, LANG_SELECT_PLAYER_OR_PET = 11016, + LANG_SHUTDOWN_DELAYED = 11017, + LANG_SHUTDOWN_CANCELLED = 11018 }; #endif diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 77185f4f25e4e..513cb823477fe 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -34,6 +34,7 @@ void HomeMovementGenerator::DoFinalize(Creature* owner) owner->ClearUnitState(UNIT_STATE_EVADE); owner->SetWalk(true); owner->LoadCreaturesAddon(); + owner->SetSpawnHealth(); owner->AI()->JustReachedHome(); } } diff --git a/src/server/game/Movement/Spline/MoveSpline.cpp b/src/server/game/Movement/Spline/MoveSpline.cpp index 991a4eacd2997..4089de67f9f4a 100644 --- a/src/server/game/Movement/Spline/MoveSpline.cpp +++ b/src/server/game/Movement/Spline/MoveSpline.cpp @@ -202,7 +202,7 @@ bool MoveSplineInitArgs::Validate(Unit* unit) const #define CHECK(exp) \ if (!(exp))\ {\ - TC_LOG_ERROR("misc", "MoveSplineInitArgs::Validate: expression '%s' failed for GUID: %u Entry: %u", #exp, unit->GetTypeId() == TYPEID_PLAYER ? unit->GetGUID().GetCounter() : unit->ToCreature()->GetSpawnId(), unit->GetEntry());\ + TC_LOG_ERROR("misc.movesplineinitargs", "MoveSplineInitArgs::Validate: expression '%s' failed for GUID: %u Entry: %u", #exp, unit->GetTypeId() == TYPEID_PLAYER ? unit->GetGUID().GetCounter() : unit->ToCreature()->GetSpawnId(), unit->GetEntry());\ return false;\ } CHECK(path.size() > 1); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index d7615ee920701..5e58a602a43a5 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3823,6 +3823,9 @@ void Spell::SendCastResult(SpellCastResult result) if (m_caster->ToPlayer()->GetSession()->PlayerLoading()) // don't send cast results at loading time return; + if (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) + result = SPELL_FAILED_DONT_REPORT; + SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError); } @@ -3839,6 +3842,9 @@ void Spell::SendPetCastResult(SpellCastResult result) if (!player) return; + if (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) + result = SPELL_FAILED_DONT_REPORT; + WorldPacket data(SMSG_PET_CAST_FAILED, 1 + 4 + 1); WriteCastResultInfo(data, player, m_spellInfo, m_cast_count, result, m_customError); @@ -4882,9 +4888,6 @@ SpellCastResult Spell::CheckCast(bool strict) return SpellCastResult(condInfo.mLastFailedCondition->ErrorType); } - if (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) - return SPELL_FAILED_DONT_REPORT; - if (!condInfo.mLastFailedCondition || !condInfo.mLastFailedCondition->ConditionTarget) return SPELL_FAILED_CASTER_AURASTATE; return SPELL_FAILED_BAD_TARGETS; @@ -5539,7 +5542,7 @@ SpellCastResult Spell::CheckCast(bool strict) Battlefield* Bf = sBattlefieldMgr->GetBattlefieldToZoneId(m_originalCaster->GetZoneId()); if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(m_originalCaster->GetAreaId())) if (area->flags & AREA_FLAG_NO_FLY_ZONE || (Bf && !Bf->CanFlyIn())) - return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_NOT_HERE; + return SPELL_FAILED_NOT_HERE; } break; } @@ -5894,14 +5897,14 @@ SpellCastResult Spell::CheckRange(bool strict) if (target && target != m_caster) { if (m_caster->GetExactDistSq(target) > maxRange) - return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT; + return SPELL_FAILED_OUT_OF_RANGE; if (minRange > 0.0f && m_caster->GetExactDistSq(target) < minRange) - return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT; + return SPELL_FAILED_OUT_OF_RANGE; if (m_caster->GetTypeId() == TYPEID_PLAYER && (m_spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT) && !m_caster->HasInArc(static_cast(M_PI), target)) - return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_UNIT_NOT_INFRONT : SPELL_FAILED_DONT_REPORT; + return SPELL_FAILED_UNIT_NOT_INFRONT; } if (m_targets.HasDst() && !m_targets.HasTraj()) @@ -6434,11 +6437,11 @@ SpellCastResult Spell::CheckItems() // skip spell if no weapon in slot or broken if (!item || item->IsBroken()) - return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS; + return SPELL_FAILED_EQUIPPED_ITEM_CLASS; // skip spell if weapon not fit to triggered spell if (!item->IsFitToSpellRequirements(m_spellInfo)) - return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS; + return SPELL_FAILED_EQUIPPED_ITEM_CLASS; } // offhand hand weapon required @@ -6448,11 +6451,11 @@ SpellCastResult Spell::CheckItems() // skip spell if no weapon in slot or broken if (!item || item->IsBroken()) - return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS; + return SPELL_FAILED_EQUIPPED_ITEM_CLASS; // skip spell if weapon not fit to triggered spell if (!item->IsFitToSpellRequirements(m_spellInfo)) - return (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_DONT_REPORT : SPELL_FAILED_EQUIPPED_ITEM_CLASS; + return SPELL_FAILED_EQUIPPED_ITEM_CLASS; } } diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index b0e3b6deeee98..758cc20929241 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -839,7 +839,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { - TC_LOG_ERROR("spells", "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); + TC_LOG_ERROR("spells.effecttriggerspell", "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); return; } @@ -889,7 +889,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { - TC_LOG_ERROR("spells", "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u.", m_spellInfo->Id, triggered_spell_id); + TC_LOG_ERROR("spells.effecttrigermissilespell", "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u.", m_spellInfo->Id, triggered_spell_id); return; } diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index d8df3310765f4..d47035ddd7d05 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -207,7 +207,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry()); if (sList == mTextMap.end()) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Could not find Text for Creature %s (Entry %u, GUID %u) in 'creature_text' table. Ignoring.", source->GetName().c_str(), source->GetEntry(), source->GetGUID().GetCounter()); + TC_LOG_ERROR("sql.sql.creaturetextmgr", "CreatureTextMgr: Could not find Text for Creature %s (Entry %u, GUID %u) in 'creature_text' table. Ignoring.", source->GetName().c_str(), source->GetEntry(), source->GetGUID().GetCounter()); return 0; } @@ -215,7 +215,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); if (itr == textHolder.end()) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Could not find TextGroup %u for Creature %s (Entry %u, GUID %u) in 'creature_text' table. Ignoring.", uint32(textGroup), source->GetName().c_str(), source->GetEntry(), source->GetGUID().GetCounter()); + TC_LOG_ERROR("sql.sql.creaturetextmgr", "CreatureTextMgr: Could not find TextGroup %u for Creature %s (Entry %u, GUID %u) in 'creature_text' table. Ignoring.", uint32(textGroup), source->GetName().c_str(), source->GetEntry(), source->GetGUID().GetCounter()); return 0; } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 19abfbe315216..8bda53f7a8f89 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -2749,22 +2749,24 @@ void World::ShutdownMsg(bool show, Player* player, const std::string& reason) } /// Cancel a planned server shutdown -void World::ShutdownCancel() +uint32 World::ShutdownCancel() { // nothing cancel or too later if (!m_ShutdownTimer || m_stopEvent) - return; + return 0; ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; + uint32 oldTimer = m_ShutdownTimer; m_ShutdownMask = 0; m_ShutdownTimer = 0; m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value SendServerMessage(msgid); - TC_LOG_DEBUG("misc", "Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); + TC_LOG_DEBUG("misc", "Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shutdown")); sScriptMgr->OnShutdownCancel(); + return oldTimer; } /// Send a server message to the user(s) diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 5850063bdc8b4..07094bc570bd0 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -664,7 +664,7 @@ class TC_GAME_API World bool IsShuttingDown() const { return m_ShutdownTimer > 0; } uint32 GetShutDownTimeLeft() const { return m_ShutdownTimer; } void ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason = std::string()); - void ShutdownCancel(); + uint32 ShutdownCancel(); void ShutdownMsg(bool show = false, Player* player = NULL, const std::string& reason = std::string()); static uint8 GetExitCode() { return m_ExitCode; } static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; } diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp index e0e52d4e1f5d4..b4697e3f64c3f 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -188,14 +188,15 @@ class server_commandscript : public CommandScript return true; } - static bool HandleServerShutDownCancelCommand(ChatHandler* /*handler*/, char const* /*args*/) + static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* /*args*/) { - sWorld->ShutdownCancel(); + if (uint32 timer = sWorld->ShutdownCancel()) + handler->PSendSysMessage(LANG_SHUTDOWN_CANCELLED, timer); return true; } - static inline bool IsOnlyUser(WorldSession* mySession) + static bool IsOnlyUser(WorldSession* mySession) { // check if there is any session connected from a different address std::string myAddr = mySession ? mySession->GetRemoteAddress() : ""; @@ -207,32 +208,32 @@ class server_commandscript : public CommandScript } static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args) { - return ShutdownServer(args, IsOnlyUser(handler->GetSession()) ? SHUTDOWN_MASK_FORCE : 0, SHUTDOWN_EXIT_CODE); + return ShutdownServer(handler, args, 0, SHUTDOWN_EXIT_CODE); } static bool HandleServerRestartCommand(ChatHandler* handler, char const* args) { - return ShutdownServer(args, IsOnlyUser(handler->GetSession()) ? (SHUTDOWN_MASK_FORCE | SHUTDOWN_MASK_RESTART) : SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + return ShutdownServer(handler, args, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); } - static bool HandleServerForceShutDownCommand(ChatHandler* /*handler*/, char const* args) + static bool HandleServerForceShutDownCommand(ChatHandler* handler, char const* args) { - return ShutdownServer(args, SHUTDOWN_MASK_FORCE, SHUTDOWN_EXIT_CODE); + return ShutdownServer(handler, args, SHUTDOWN_MASK_FORCE, SHUTDOWN_EXIT_CODE); } - static bool HandleServerForceRestartCommand(ChatHandler* /*handler*/, char const* args) + static bool HandleServerForceRestartCommand(ChatHandler* handler, char const* args) { - return ShutdownServer(args, SHUTDOWN_MASK_FORCE | SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); + return ShutdownServer(handler, args, SHUTDOWN_MASK_FORCE | SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE); } - static bool HandleServerIdleShutDownCommand(ChatHandler* /*handler*/, char const* args) + static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args) { - return ShutdownServer(args, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); + return ShutdownServer(handler, args, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); } - static bool HandleServerIdleRestartCommand(ChatHandler* /*handler*/, char const* args) + static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args) { - return ShutdownServer(args, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); + return ShutdownServer(handler, args, SHUTDOWN_MASK_RESTART | SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); } // Exit the realm @@ -327,7 +328,7 @@ class server_commandscript : public CommandScript return true; } - static bool ShutdownServer(char const* args, uint32 shutdownMask, int32 defaultExitCode) + static bool ShutdownServer(ChatHandler* handler, char const* args, uint32 shutdownMask, int32 defaultExitCode) { if (!*args) return false; @@ -381,8 +382,12 @@ class server_commandscript : public CommandScript if (!ParseExitCode(exitCodeStr, exitCode)) return false; - if (delay < (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD) && !(shutdownMask & SHUTDOWN_MASK_FORCE)) - return false; + // Override parameter "delay" with the configuration value if there are still players connected and "force" parameter was not specified + if (delay < (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD) && !(shutdownMask & SHUTDOWN_MASK_FORCE) && !IsOnlyUser(handler->GetSession())) + { + delay = (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD); + handler->PSendSysMessage(LANG_SHUTDOWN_DELAYED, delay); + } sWorld->ShutdownServ(delay, shutdownMask, static_cast(exitCode), std::string(reason)); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index 79709734e18aa..7b07c9272da8b 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -415,98 +415,6 @@ class npc_phalanx : public CreatureScript }; }; -// npc_kharan_mighthammer -enum KharamQuests -{ - QUEST_4001 = 4001, - QUEST_4342 = 4342 -}; - -#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" -#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" -#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." -#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." -#define GOSSIP_ITEM_KHARAN_5 "So what happened?" -#define GOSSIP_ITEM_KHARAN_6 "Continue..." -#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" -#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." -#define GOSSIP_ITEM_KHARAN_9 "Indeed." -#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." - -class npc_kharan_mighthammer : public CreatureScript -{ -public: - npc_kharan_mighthammer() : CreatureScript("npc_kharan_mighthammer") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - player->SEND_GOSSIP_MENU(2475, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - player->SEND_GOSSIP_MENU(2476, creature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); - player->SEND_GOSSIP_MENU(2477, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); - player->SEND_GOSSIP_MENU(2478, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); - player->SEND_GOSSIP_MENU(2479, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); - player->SEND_GOSSIP_MENU(2480, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); - player->SEND_GOSSIP_MENU(2481, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+8: - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); - player->SEND_GOSSIP_MENU(2482, creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+9: - player->CLOSE_GOSSIP_MENU(); - if (player->GetTeam() == HORDE) - player->AreaExploredOrEventHappens(QUEST_4001); - else - player->AreaExploredOrEventHappens(QUEST_4342); - break; - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - - if (player->GetTeam() == HORDE) - player->SEND_GOSSIP_MENU(2473, creature->GetGUID()); - else - player->SEND_GOSSIP_MENU(2474, creature->GetGUID()); - - return true; - } -}; - // npc_lokhtos_darkbargainer enum Lokhtos { @@ -708,7 +616,6 @@ void AddSC_blackrock_depths() new at_ring_of_law(); new npc_grimstone(); new npc_phalanx(); - new npc_kharan_mighthammer(); new npc_lokhtos_darkbargainer(); new npc_rocknot(); } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 7e7edfb7832db..ce3e68d9c488b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -93,7 +93,7 @@ class boss_attumen : public CreatureScript void EnterEvadeMode(EvadeReason /*why*/) override { if (Creature* midnight = ObjectAccessor::GetCreature(*me, _midnightGUID)) - BossAI::_DespawnAtEvade(10, midnight); + BossAI::_DespawnAtEvade(Seconds(10), midnight); me->DespawnOrUnsummon(); } @@ -349,7 +349,7 @@ class boss_midnight : public CreatureScript void EnterEvadeMode(EvadeReason /*why*/) override { - BossAI::_DespawnAtEvade(10); + BossAI::_DespawnAtEvade(Seconds(10)); } void KilledUnit(Unit* /*victim*/) override diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index 49dfda48a694e..38e938fca98a2 100644 --- a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -139,10 +139,22 @@ class npc_deathstalker_erland : public CreatureScript ## pyrewood_ambush #######*/ -#define QUEST_PYREWOOD_AMBUSH 452 - -#define NPCSAY_INIT "Get ready, they'll be arriving any minute..." //not blizzlike -#define NPCSAY_END "Thanks for your help!" //not blizzlike +enum PyrewoodAmbush +{ + SAY_PREPARE_TO_AMBUSH = 0, + SAY_A_BLOW_TO_ARUGAL = 1, + FACTION_ENEMY = 168, + QUEST_PYREWOOD_AMBUSH = 452, + COUNCILMAN_SMITHERS = 2060, + COUNCILMAN_THATCHER = 2061, + COUNCILMAN_HENDRICKS = 2062, + COUNCILMAN_WILHELM = 2063, + COUNCILMAN_HARTIN = 2064, + COUNCILMAN_COOPER = 2065, + COUNCILMAN_HIGARTH = 2066, + COUNCILMAN_BRUNSWICK = 2067, + LORD_MAYOR_MORRISON = 2068 +}; static float PyrewoodSpawnPoints[3][4] = { @@ -159,8 +171,6 @@ static float PyrewoodSpawnPoints[3][4] = {-397.94f, 1504.74f, 19.77f, 0}, }; -#define WAIT_SECS 6000 - class pyrewood_ambush : public CreatureScript { public: @@ -189,7 +199,7 @@ class pyrewood_ambush : public CreatureScript pyrewood_ambushAI(Creature* creature) : ScriptedAI(creature), Summons(me) { Initialize(); - WaitTimer = WAIT_SECS; + WaitTimer = 6 * IN_MILLISECONDS; QuestInProgress = false; } @@ -210,7 +220,7 @@ class pyrewood_ambush : public CreatureScript void Reset() override { - WaitTimer = WAIT_SECS; + WaitTimer = 6 * IN_MILLISECONDS; if (!QuestInProgress) //fix reset values (see UpdateVictim) { @@ -246,7 +256,7 @@ class pyrewood_ambush : public CreatureScript if (!target) target = me; - summoned->setFaction(168); + summoned->setFaction(FACTION_ENEMY); summoned->AddThreat(target, 32.0f); summoned->AI()->AttackStart(target); } @@ -279,8 +289,9 @@ class pyrewood_ambush : public CreatureScript switch (Phase) { case 0: - if (WaitTimer == WAIT_SECS) - me->Say(NPCSAY_INIT, LANG_UNIVERSAL); //no blizzlike + if (WaitTimer == 6 * IN_MILLISECONDS) + if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) + Talk(SAY_PREPARE_TO_AMBUSH, player); if (WaitTimer <= diff) { @@ -289,28 +300,28 @@ class pyrewood_ambush : public CreatureScript } break; case 1: - SummonCreatureWithRandomTarget(2060, 1); + SummonCreatureWithRandomTarget(COUNCILMAN_SMITHERS, 1); break; case 2: - SummonCreatureWithRandomTarget(2061, 2); - SummonCreatureWithRandomTarget(2062, 0); + SummonCreatureWithRandomTarget(COUNCILMAN_THATCHER, 2); + SummonCreatureWithRandomTarget(COUNCILMAN_HENDRICKS, 0); break; case 3: - SummonCreatureWithRandomTarget(2063, 1); - SummonCreatureWithRandomTarget(2064, 2); - SummonCreatureWithRandomTarget(2065, 0); + SummonCreatureWithRandomTarget(COUNCILMAN_WILHELM, 1); + SummonCreatureWithRandomTarget(COUNCILMAN_HARTIN, 2); + SummonCreatureWithRandomTarget(COUNCILMAN_COOPER, 0); break; case 4: - SummonCreatureWithRandomTarget(2066, 1); - SummonCreatureWithRandomTarget(2067, 0); - SummonCreatureWithRandomTarget(2068, 2); + SummonCreatureWithRandomTarget(COUNCILMAN_HIGARTH, 1); + SummonCreatureWithRandomTarget(COUNCILMAN_BRUNSWICK, 0); + SummonCreatureWithRandomTarget(LORD_MAYOR_MORRISON, 2); break; case 5: //end if (PlayerGUID) { if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) { - me->Say(NPCSAY_END, LANG_UNIVERSAL); //not blizzlike + Talk(SAY_A_BLOW_TO_ARUGAL); player->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, me); } } diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp index 3c11fd5d9a683..2f97b5a80551b 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_jedoga_shadowseeker.cpp @@ -16,7 +16,8 @@ */ /* - * Comment: Complete - BUT THE TRIGGER NEEDS DATA WHETHER THE PRISON OF TALDARAM IS OFFLINE ! + * Comment: Visuals missing, de-germanize code, wow 3.3.5a-ize + * Patch 3.3.2 (2010-01-02): Jedoga Shadowseeker now only ascends once during the encounter. */ #include "ScriptMgr.h"