From 4c8ff6e6a306407ecf1a2fd7bc5ce0b7b95786b9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 22 Mar 2013 19:55:01 +0100 Subject: [PATCH 01/13] Core/Auth: Updated AuthResult enum --- src/server/authserver/Authentication/AuthCodes.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/server/authserver/Authentication/AuthCodes.h b/src/server/authserver/Authentication/AuthCodes.h index 416d14ba5a..df7de3ed68 100644 --- a/src/server/authserver/Authentication/AuthCodes.h +++ b/src/server/authserver/Authentication/AuthCodes.h @@ -30,17 +30,22 @@ enum AuthResult WOW_FAIL_DB_BUSY = 0x08, WOW_FAIL_VERSION_INVALID = 0x09, WOW_FAIL_VERSION_UPDATE = 0x0A, + WOW_FAIL_INVALID_SERVER = 0x0B, WOW_FAIL_SUSPENDED = 0x0C, + WOW_FAIL_FAIL_NOACCESS = 0x0D, WOW_SUCCESS_SURVEY = 0x0E, WOW_FAIL_PARENTCONTROL = 0x0F, WOW_FAIL_LOCKED_ENFORCED = 0x10, WOW_FAIL_TRIAL_ENDED = 0x11, WOW_FAIL_USE_BATTLENET = 0x12, - WOW_FAIL_TOO_FAST = 0x16, - WOW_FAIL_CHARGEBACK = 0x17, + WOW_FAIL_ANTI_INDULGENCE = 0x13, + WOW_FAIL_EXPIRED = 0x14, + WOW_FAIL_NO_GAME_ACCOUNT = 0x15, + WOW_FAIL_CHARGEBACK = 0x16, + WOW_FAIL_INTERNET_GAME_ROOM_WITHOUT_BNET = 0x17, WOW_FAIL_GAME_ACCOUNT_LOCKED = 0x18, - WOW_FAIL_INTERNET_GAME_ROOM_WITHOUT_BNET = 0x19, - WOW_FAIL_UNLOCKABLE_LOCK = 0x20, + WOW_FAIL_UNLOCKABLE_LOCK = 0x19, + WOW_FAIL_CONVERSION_REQUIRED = 0x20, WOW_FAIL_DISCONNECTED = 0xFF }; From ccb95c74625ab67a3eaf0f4d54206b2d6104da07 Mon Sep 17 00:00:00 2001 From: Gacko Date: Fri, 22 Mar 2013 21:31:49 +0100 Subject: [PATCH 02/13] Script/Spell: Apply Shadow's Fate to Sindragosa Sindgragosa is summoned in instance script and would not pass the modified check otherwise Related to: #9487 --- src/server/scripts/Spells/spell_item.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index c9c75cdb13..0c9817ba16 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -813,6 +813,7 @@ class spell_item_scroll_of_recall : public SpellScriptLoader enum ShadowsFate { SPELL_SOUL_FEAST = 71203, + NPC_SINDRAGOSA = 36853 }; class spell_item_unsated_craving : public SpellScriptLoader @@ -831,7 +832,7 @@ class spell_item_unsated_craving : public SpellScriptLoader return false; Unit* target = procInfo.GetActionTarget(); - if (!target || target->GetTypeId() != TYPEID_UNIT || target->GetCreatureType() == CREATURE_TYPE_CRITTER || target->isSummon()) + if (!target || target->GetTypeId() != TYPEID_UNIT || target->GetCreatureType() == CREATURE_TYPE_CRITTER || (target->GetEntry() != NPC_SINDRAGOSA && target->isSummon())) return false; return true; From 3a5ed66dcd08bbca276b87ee4f2bc94c403bda21 Mon Sep 17 00:00:00 2001 From: gaut Date: Sat, 23 Mar 2013 10:23:20 +0100 Subject: [PATCH 03/13] DB/SAI: add SAI for The Light's Mercy Closes #9364 --- sql/updates/world/2013_03_23_00_world_sai.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2013_03_23_00_world_sai.sql diff --git a/sql/updates/world/2013_03_23_00_world_sai.sql b/sql/updates/world/2013_03_23_00_world_sai.sql new file mode 100644 index 0000000000..75a960af2f --- /dev/null +++ b/sql/updates/world/2013_03_23_00_world_sai.sql @@ -0,0 +1,9 @@ +-- Fix quest 14077: The Light's Mercy +SET @SPELL := 66390; +SET @NPC := 34852; +SET @NPC_REWARD := 34852; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` = @NPC; +DELETE FROM `smart_scripts` WHERE `entryorguid` = @NPC 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 +(@NPC,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@NPC_REWARD,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Slain Tualiq Villager - On spell hit - Give kill credit for quest 14077'), +(@NPC,0,1,0,61,0,100,1,0,0,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Slain Tualiq Villager - Despawn after 2 seconds'); From 6c6ee59ac99c8db247c515b0f9e66f240ebd210a Mon Sep 17 00:00:00 2001 From: alpharius Date: Sat, 23 Mar 2013 10:26:03 +0100 Subject: [PATCH 04/13] DB/Creature: add a text on death for Overmaster Pyron Closes #9267 --- sql/updates/world/2013_03_23_01_world_creature_text.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2013_03_23_01_world_creature_text.sql diff --git a/sql/updates/world/2013_03_23_01_world_creature_text.sql b/sql/updates/world/2013_03_23_01_world_creature_text.sql new file mode 100644 index 0000000000..d2b84cb0ef --- /dev/null +++ b/sql/updates/world/2013_03_23_01_world_creature_text.sql @@ -0,0 +1,7 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid`=9026 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 +(9026,0,2,0,6,0,100,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, "Overmaster Pyron - On Death - Say Line 0"); + +DELETE FROM `creature_text` WHERE `entry`=9026 AND `groupid`=0; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(9026,0,0, "I will be reborn, mortals! Incendius shall raise me from these ashes!",12,0,100,0,0,0,"Overmaster Pyron"); From 1dcfc74e2319ea1ee11c0efb8b0dd32d79c494df Mon Sep 17 00:00:00 2001 From: foldor Date: Sat, 23 Mar 2013 10:31:26 +0100 Subject: [PATCH 05/13] DB/Creature: add missing Silver Convenant in Frozen Halls Closes #9082 --- sql/updates/world/2013_03_23_02_world_creature.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2013_03_23_02_world_creature.sql diff --git a/sql/updates/world/2013_03_23_02_world_creature.sql b/sql/updates/world/2013_03_23_02_world_creature.sql new file mode 100644 index 0000000000..874068599f --- /dev/null +++ b/sql/updates/world/2013_03_23_02_world_creature.sql @@ -0,0 +1,11 @@ +SET @CGUID := 54428; -- set by TDB team (3) +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+2; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@CGUID+0, 36656, 571, 1, 1, 5647.669, 2106.526, 798.1375, 4.764749, 120, 0, 0), -- Silver Covenant Sentinel (Area: 4862) +(@CGUID+1, 36656, 571, 1, 1, 5657.819, 2105.712, 798.1375, 4.590216, 120, 0, 0), -- Silver Covenant Sentinel (Area: 4862) +(@CGUID+2, 36624, 571, 1, 1, 5652.733, 2106.208, 798.1375, 4.572762, 120, 0, 0); -- Caladis Brightspear (Area: 4862) +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+2; +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(@CGUID+0, 0, 0, 0x10000, 0x1, 0, '71311'), +(@CGUID+1, 0, 0, 0x10000, 0x1, 0, '71311'), +(@CGUID+2, 0, 0, 0x10000, 0x1, 0, '71311'); From da5829b7da0fc47ac3b0e86b211d4b947403cf52 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 23 Mar 2013 10:45:32 +0100 Subject: [PATCH 06/13] DB/SAI Update SAI param for Ruined lifeboat & add SAI for Negolas Closes #8846 --- sql/updates/world/2013_03_23_03_world_sai.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2013_03_23_03_world_sai.sql diff --git a/sql/updates/world/2013_03_23_03_world_sai.sql b/sql/updates/world/2013_03_23_03_world_sai.sql new file mode 100644 index 0000000000..e70dd7166a --- /dev/null +++ b/sql/updates/world/2013_03_23_03_world_sai.sql @@ -0,0 +1,9 @@ +UPDATE `smart_scripts` SET `event_phase_mask`=0 WHERE `entryorguid`=2289 AND `source_type`=1; +UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry`=1494; +DELETE FROM `smart_scripts` WHERE `entryorguid`=1494; +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 +(1494,0,0,0,1,0,100,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 'On Respawn - Say Line - Yell Text on Summon'); +-- Add missing creature_text +DELETE FROM `creature_text` WHERE `entry`=1494 AND `groupid`=0; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(1494,0,0, 'Mmmh...I SMELL FOOD!',14,0,100,0,0,0, 'Negolash Yell on Summon'); From 106f6f893f1637b0ce79ce7fab5c1d75df41ae0b Mon Sep 17 00:00:00 2001 From: baric Date: Sat, 23 Mar 2013 11:03:23 +0100 Subject: [PATCH 07/13] DB/Creature: Add missing spawns in the Demon Fall Ridge area Closes #8614 --- .../2013_03_23_04_world_waypoint_data.sql | 318 ++++++++++++++++++ 1 file changed, 318 insertions(+) create mode 100644 sql/updates/world/2013_03_23_04_world_waypoint_data.sql diff --git a/sql/updates/world/2013_03_23_04_world_waypoint_data.sql b/sql/updates/world/2013_03_23_04_world_waypoint_data.sql new file mode 100644 index 0000000000..7a977e45cb --- /dev/null +++ b/sql/updates/world/2013_03_23_04_world_waypoint_data.sql @@ -0,0 +1,318 @@ +-- missing objects/mobs on Demon Fall Ridge +SET @OGUID := 6040; +SET @CGUID := 108860; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+3; +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,1622 ,1,1,1,1559.646 ,-2812.193,181.5358 ,0 ,0 ,0 ,0 ,1 ,120,255,1), -- Bruiseweed (Area: Demon Fall Ridge), +(@OGUID+1,1623 ,1,1,1,1599.648 ,-3088.057,89.47401 ,0 ,0 ,0 ,0 ,1 ,120,255,1), -- Wild Steelbloom (Area: Demon Fall Ridge), +(@OGUID+2,1732 ,1,1,1,1619.236 ,-3106.807,90.91071 ,0 ,0 ,0 ,0 ,1 ,120,255,1), -- Tin Vein (Area: Demon Fall Ridge), +(@OGUID+3,176784,1,1,1,1550.686 ,-2862.281,181.7537 ,3.141593 ,0 ,0 ,0 ,1 ,120,255,1); -- Bonfire (Area: Demon Fall Ridge); +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+25; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`MovementType`) VALUES +(@CGUID+00,11697,1,1,1,1377.036,-2832.29,108.1152,5.778122,120,10,1), -- Mannoroc Lasher (Area: Demon Fall Ridge) (waypoints or random movement) +(@CGUID+01,11697,1,1,1,1442.845,-2781.555,143.3298,3.407407,120,10,1), -- Mannoroc Lasher (Area: Demon Fall Ridge) (possible waypoints or random movement) +(@CGUID+02,11697,1,1,1,1520.548,-2910.79,128.7899,0.3708913,120,10,1), -- Mannoroc Lasher (Area: Demon Fall Ridge) (possible waypoints or random movement) +(@CGUID+03,11697,1,1,1,1522.825,-2851.57,182.1475,5.156503,120,10,1), -- Mannoroc Lasher (Area: Demon Fall Ridge) (waypoints or random movement) +(@CGUID+04,11697,1,1,1,1538.938,-2878.932,183.4645,1.239184,120,0,0), -- Mannoroc Lasher (Area: Demon Fall Ridge) +(@CGUID+05,11697,1,1,1,1544.031,-2848.745,182.5147,5.044002,120,0,0), -- Mannoroc Lasher (Area: Demon Fall Ridge) +(@CGUID+06,11697,1,1,1,1544.416,-2863.002,112.0556,2.701836,120,10,1), -- Mannoroc Lasher (Area: Demon Fall Ridge) (possible waypoints or random movement) +(@CGUID+07,11697,1,1,1,1563.016,-2859.155,182.2932,4.066617,120,0,0), -- Mannoroc Lasher (Area: Demon Fall Ridge) +(@CGUID+08,11697,1,1,1,1581.573,-2897.424,182.3294,1.43117,120,0,0), -- Mannoroc Lasher (Area: Demon Fall Ridge) +(@CGUID+09,16030,1,1,1,1625.747,-3095.011,89.12293,2.2015,120,10,1), -- Maggot (Area: Demon Fall Ridge) +(@CGUID+10,16030,1,1,1,1636.01,-3052.925,90.07569,4.715363,120,10,1), -- Maggot (Area: Demon Fall Ridge) +(@CGUID+11,16030,1,1,1,1647.72,-3076.708,88.33277,1.016972,120,10,1), -- Maggot (Area: Demon Fall Ridge) +(@CGUID+12,6073,1,1,1,1420.36,-2797,153.2968,4.158457,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+13,6073,1,1,1,1451.373,-2815.769,154.2159,4.385233,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+14,6073,1,1,1,1500.756,-2835.735,111.587,5.95405,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+15,6073,1,1,1,1512.830,-2877.935,111.1157,2.860,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+16,6073,1,1,1,1550.406,-2885.673,132.9547,4.354227,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+17,6073,1,1,1,1555.71,-2901.445,182.4397,3.857178,120,10,1), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+18,6073,1,1,1,1566.779,-2894.126,132.5958,0.1956479,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+19,6073,1,1,1,1537.930,-2823.109,181.6067,5.282221,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+20,6073,1,1,1,1583.341,-2959.558,182.2528,5.410459,120,0,0), -- Searing Infernal (Area: Demon Fall Ridge) +(@CGUID+21,6115,1,1,1,1420.313,-2851.199,133.127,0.9438578,120,10,1), -- Roaming Felguard (Area: Demon Fall Ridge) (waypoints or random movement) +(@CGUID+22,6115,1,1,1,1461.483,-2783.054,154.6106,4.637331,120,10,1), -- Roaming Felguard (Area: Demon Fall Ridge) (waypoints or random movement) +(@CGUID+23,6115,1,1,1,1521.961,-2856.834,111.6264,4.90235,120,10,1), -- Roaming Felguard (Area: Demon Fall Ridge) (waypoints or random movement) +(@CGUID+24,6115,1,1,1,1610.802,-3083.251,89.95774,1.347837,120,10,1), -- Roaming Felguard (Area: Demon Fall Ridge) waypoints or random movement) +(@CGUID+25,6115,1,1,1,1611.121,-2985.179,182.0912,2.853907,120,10,1); -- Roaming Felguard (Area: Demon Fall Ridge) (waypoints or random movement) +-- reposition to avoid position clash with other mob +UPDATE creature SET position_x = 1553.05,position_y = -2844.765,position_z = 129.70,orientation = 0.6726,MovementType = 0,spawndist = 0 WHERE `guid` = 20082; +-- pathing for Felguard #20872 on +SET @WPID := 208720; +UPDATE `creature` SET `MovementType`=2,`position_x`=1445.667358,`position_y`=-2785.956299,`position_z`=144.079132,`currentwaypoint`=0 WHERE `guid`=20872; +DELETE FROM `creature_addon` WHERE `guid`=20872; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (20872,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1445.667358,-2785.956299,144.079132,0,0,0,0,100,0), +(@WPID,1,1450.664429,-2799.601807,144.581528,0,0,0,0,100,0), +(@WPID,2,1457.757935,-2801.675293,145.510452,0,0,0,0,100,0), +(@WPID,3,1467.130493,-2804.867188,147.879959,0,0,0,0,100,0), +(@WPID,4,1476.766113,-2806.016602,149.540283,0,0,0,0,100,0), +(@WPID,5,1478.050537,-2798.385254,149.963150,0,0,0,0,100,0), +(@WPID,6,1473.788696,-2787.377197,152.504379,0,0,0,0,100,0), +(@WPID,7,1468.064453,-2783.520264,154.801208,0,0,0,0,100,0), +(@WPID,8,1460.110718,-2782.338135,154.570343,0,0,0,0,100,0), +(@WPID,9,1466.063477,-2783.569580,155.144333,0,0,0,0,100,0), +(@WPID,10,1473.382202,-2788.681152,152.407547,0,0,0,0,100,0), +(@WPID,11,1477.975464,-2797.371094,150.017349,0,0,0,0,100,0), +(@WPID,12,1473.043457,-2804.988770,149.482895,0,0,0,0,100,0), +(@WPID,13,1465.716309,-2806.197021,147.414398,0,0,0,0,100,0), +(@WPID,14,1457.339355,-2802.397949,145.514069,0,0,0,0,100,0), +(@WPID,15,1450.980835,-2794.119385,144.331573,0,0,0,0,100,0); +-- pathing for Felguard #20874 on +SET @WPID := 208740; +UPDATE `creature` SET `MovementType`=2,`position_x`=1427.127686,`position_y`=-2794.929199,`position_z`=153.367630,`currentwaypoint`=0 WHERE `guid`=20874; +DELETE FROM `creature_addon` WHERE `guid`=20874; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (20874,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1427.127686,-2794.929199,153.367630,0,0,0,0,100,0), +(@WPID,1,1434.866943,-2792.607666,153.983551,0,0,0,0,100,0), +(@WPID,2,1439.881104,-2789.645996,156.961761,0,0,0,0,100,0), +(@WPID,3,1446.391846,-2787.082031,158.247574,0,0,0,0,100,0), +(@WPID,4,1452.749390,-2784.158691,156.516998,0,0,0,0,100,0), +(@WPID,5,1461.059204,-2782.987793,154.608047,0,0,0,0,100,0), +(@WPID,6,1459.080078,-2790.694580,157.111328,0,0,0,0,100,0), +(@WPID,7,1457.619629,-2795.229492,158.473236,0,0,0,0,100,0), +(@WPID,8,1455.797607,-2801.988037,158.055511,0,0,0,0,100,0), +(@WPID,9,1453.832642,-2808.706543,155.066422,0,0,0,0,100,0), +(@WPID,10,1451.864258,-2814.851807,153.940338,0,0,0,0,100,0), +(@WPID,11,1453.883789,-2807.040039,155.886780,0,0,0,0,100,0), +(@WPID,12,1457.238525,-2798.087891,158.691376,0,0,0,0,100,0), +(@WPID,13,1459.887451,-2791.610352,157.409363,0,0,0,0,100,0), +(@WPID,14,1461.216431,-2782.308350,154.564026,0,0,0,0,100,0), +(@WPID,15,1450.710571,-2784.914063,157.356842,0,0,0,0,100,0), +(@WPID,16,1444.170044,-2787.408203,158.144180,0,0,0,0,100,0), +(@WPID,17,1434.528687,-2791.566895,154.061630,0,0,0,0,100,0); +-- pathing for Felguard #20876 on +SET @WPID := 208760; +UPDATE creature SET `MovementType`=2,`position_x`=1519.061279,`position_y`=-2911.228271,`position_z`=128.724503,`currentwaypoint`=0 WHERE `guid` = 20876; +DELETE FROM `creature_addon` WHERE `guid` = 20876; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (20876,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1519.061279,-2911.228271,128.724503,0,0,0,0,100,0), +(@WPID,1,1520.779297,-2904.444336,130.019699,0,0,0,0,100,0), +(@WPID,2,1523.576782,-2894.323975,129.760376,0,0,0,0,100,0), +(@WPID,3,1525.399658,-2887.565674,129.650497,0,0,0,0,100,0), +(@WPID,4,1527.510254,-2880.891602,127.859444,0,0,0,0,100,0), +(@WPID,5,1530.465454,-2871.784424,124.707077,0,0,0,0,100,0), +(@WPID,6,1534.396240,-2865.125244,124.945396,0,0,0,0,100,0), +(@WPID,7,1541.486206,-2857.385254,129.325195,0,0,0,0,100,0), +(@WPID,8,1546.340820,-2852.342285,129.804764,0,0,0,0,100,0), +(@WPID,9,1551.960815,-2845.879395,129.609558,0,0,0,0,100,0), +(@WPID,10,1547.109009,-2851.705322,129.800903,0,0,0,0,100,0), +(@WPID,11,1542.209229,-2856.704590,129.541779,0,0,0,0,100,0), +(@WPID,12,1534.886353,-2864.229248,125.346100,0,0,0,0,100,0), +(@WPID,13,1530.252686,-2871.376953,124.679268,0,0,0,0,100,0), +(@WPID,14,1528.427368,-2877.171631,126.128044,0,0,0,0,100,0), +(@WPID,15,1525.856323,-2887.348633,129.625702,0,0,0,0,100,0), +(@WPID,16,1523.781738,-2894.034180,129.770584,0,0,0,0,100,0), +(@WPID,17,1521.690063,-2900.714355,129.564087,0,0,0,0,100,0); +-- pathing for Lasher CGUID+0 +SET @WPID := (@CGUID+0)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1377.440918,`position_y`=-2831.153320,`position_z`=108.026917,`currentwaypoint`=0 WHERE `guid` = @CGUID+0; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+0; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+0,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1377.440918,-2831.153320,108.026917,0,0,0,0,100,0), +(@WPID,1,1382.229004,-2827.563721,108.826355,0,0,0,0,100,0), +(@WPID,2,1391.730957,-2823.097656,109.964256,0,0,0,0,100,0), +(@WPID,3,1403.629517,-2820.422607,113.992607,0,0,0,0,100,0), +(@WPID,4,1414.020630,-2821.883545,116.552795,0,0,0,0,100,0), +(@WPID,5,1425.679565,-2823.227295,118.282143,0,0,0,0,100,0), +(@WPID,6,1437.257935,-2822.140869,120.388496,0,0,0,0,100,0), +(@WPID,7,1444.380127,-2817.184570,120.541428,0,0,0,0,100,0), +(@WPID,8,1439.560669,-2812.109863,120.442703,0,0,0,0,100,0), +(@WPID,9,1429.911133,-2806.321045,121.627449,0,0,0,0,100,0), +(@WPID,10,1420.165527,-2802.415283,122.528816,0,0,0,0,100,0), +(@WPID,11,1406.437866,-2799.521240,123.336349,0,0,0,0,100,0), +(@WPID,12,1408.145020,-2806.980225,124.640030,0,0,0,0,100,0), +(@WPID,13,1411.558472,-2817.519531,130.557297,0,0,0,0,100,0), +(@WPID,14,1414.248291,-2826.448975,134.029892,0,0,0,0,100,0), +(@WPID,15,1416.987061,-2833.898926,134.158966,0,0,0,0,100,0), +(@WPID,16,1418.680298,-2841.623291,134.089142,0,0,0,0,100,0), +(@WPID,17,1417.675415,-2851.522949,133.205948,0,0,0,0,100,0), +(@WPID,18,1419.567261,-2843.880615,134.064331,0,0,0,0,100,0), +(@WPID,19,1418.282349,-2835.081543,133.903214,0,0,0,0,100,0), +(@WPID,20,1413.755615,-2826.055420,133.871857,0,0,0,0,100,0), +(@WPID,21,1410.707886,-2816.007813,129.677521,0,0,0,0,100,0), +(@WPID,22,1407.735840,-2804.345947,123.423225,0,0,0,0,100,0), +(@WPID,23,1411.128418,-2800.364258,123.362190,0,0,0,0,100,0), +(@WPID,24,1423.222046,-2802.809082,122.215492,0,0,0,0,100,0), +(@WPID,25,1432.720093,-2807.233643,121.249458,0,0,0,0,100,0), +(@WPID,26,1442.866333,-2811.426514,120.474632,0,0,0,0,100,0), +(@WPID,27,1442.986938,-2817.752686,120.496185,0,0,0,0,100,0), +(@WPID,28,1432.807739,-2820.319336,120.214920,0,0,0,0,100,0), +(@WPID,29,1422.910767,-2822.051270,118.090607,0,0,0,0,100,0), +(@WPID,30,1411.085083,-2819.568359,115.681824,0,0,0,0,100,0), +(@WPID,31,1400.672852,-2819.333740,113.069351,0,0,0,0,100,0), +(@WPID,32,1392.437012,-2822.626953,110.105415,0,0,0,0,100,0), +(@WPID,33,1381.681763,-2827.953857,108.544312,0,0,0,0,100,0); +-- pathing for Lasher CGUID+3 +SET @WPID := (@CGUID+3)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1525.115723,`position_y`=-2850.323975,`position_z`=182.264648,`currentwaypoint`=0 WHERE `guid` = @CGUID+3; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+3; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+3,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1525.115723,-2850.323975,182.264648,0,0,0,0,100,0), +(@WPID,1,1531.196411,-2840.045166,182.315933,0,0,0,0,100,0), +(@WPID,2,1540.609741,-2830.145752,182.035614,0,0,0,0,100,0), +(@WPID,3,1550.371094,-2824.623535,181.914169,0,0,0,0,100,0), +(@WPID,4,1560.609863,-2825.602783,181.713562,0,0,0,0,100,0), +(@WPID,5,1573.442139,-2834.195557,181.620041,0,0,0,0,100,0), +(@WPID,6,1573.676636,-2843.122803,182.236511,0,0,0,0,100,0), +(@WPID,7,1575.495605,-2852.658936,183.287399,0,0,0,0,100,0), +(@WPID,8,1573.915161,-2863.642578,182.804459,0,0,0,0,100,0), +(@WPID,9,1568.231201,-2881.090820,183.118271,0,0,0,0,100,0), +(@WPID,10,1558.646729,-2884.779541,183.471115,0,0,0,0,100,0), +(@WPID,11,1549.383301,-2877.014160,182.969772,0,0,0,0,100,0), +(@WPID,12,1541.126465,-2864.694092,182.265366,0,0,0,0,100,0); +-- pathing for Felguard CGUID+21 on +SET @WPID := (@CGUID+21)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1418.673340,`position_y`=-2849.543701,`position_z`=133.128998,`currentwaypoint`=0 WHERE `guid` = @CGUID+21; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+21; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+21,@WPID); +DELETE FROM `waypoint_data` WHERE id=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1418.673340,-2849.543701,133.128998,0,0,0,0,100,0), +(@WPID,1,1419.053223,-2840.867188,133.872528,0,0,0,0,100,0), +(@WPID,2,1416.689941,-2834.154297,134.137970,0,0,0,0,100,0), +(@WPID,3,1414.608398,-2827.471436,134.225082,0,0,0,0,100,0), +(@WPID,4,1412.582764,-2820.770996,132.077194,0,0,0,0,100,0), +(@WPID,5,1409.088867,-2810.655762,126.843498,0,0,0,0,100,0), +(@WPID,6,1411.302002,-2817.291016,130.399963,0,0,0,0,100,0), +(@WPID,7,1413.902222,-2826.605957,134.035446,0,0,0,0,100,0), +(@WPID,8,1416.532471,-2833.090820,134.308105,0,0,0,0,100,0), +(@WPID,9,1418.736084,-2841.765137,134.127487,0,0,0,0,100,0); +-- pathing for Felguard CGUID+22 on +SET @WPID := (@CGUID+22)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1461.952393,`position_y`=-2777.578613,`position_z`=154.923584,`currentwaypoint`=0 WHERE `guid` = @CGUID+22; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+22; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+22,@WPID); +DELETE FROM `waypoint_data` WHERE id=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1461.952393,-2777.578613,154.923584,0,0,0,0,100,0), +(@WPID,1,1465.133545,-2767.573975,154.857132,0,0,0,0,100,0), +(@WPID,2,1472.367310,-2758.643555,156.072708,0,0,0,0,100,0), +(@WPID,3,1482.150879,-2754.233887,156.292877,0,0,0,0,100,0), +(@WPID,4,1493.999512,-2752.110352,158.143372,0,0,0,0,100,0), +(@WPID,5,1497.644165,-2753.630127,159.105545,0,0,0,0,100,0), +(@WPID,6,1500.601318,-2760.660889,160.422638,0,0,0,0,100,0), +(@WPID,7,1501.830933,-2768.006348,160.797318,0,0,0,0,100,0), +(@WPID,8,1503.898804,-2771.084473,161.295364,0,0,0,0,100,0), +(@WPID,9,1509.369507,-2777.201904,163.673080,0,0,0,0,100,0), +(@WPID,10,1512.175049,-2785.971191,165.083893,0,0,0,0,100,0), +(@WPID,11,1513.801514,-2792.097412,165.634216,0,0,0,0,100,0), +(@WPID,12,1518.169800,-2796.058838,165.138840,0,0,0,0,100,0), +(@WPID,13,1524.349854,-2800.773926,167.720108,0,0,0,0,100,0), +(@WPID,14,1525.073975,-2806.124023,169.219666,0,0,0,0,100,0), +(@WPID,15,1522.830933,-2812.213623,170.961700,0,0,0,0,100,0), +(@WPID,16,1511.613159,-2814.369385,174.126556,0,0,0,0,100,0), +(@WPID,17,1510.135620,-2812.832031,174.583145,0,0,0,0,100,0), +(@WPID,18,1507.537842,-2804.130127,177.219849,0,0,0,0,100,0), +(@WPID,19,1510.847778,-2799.395020,178.859070,0,0,0,0,100,0), +(@WPID,20,1516.893555,-2797.346436,180.676239,0,0,0,0,100,0), +(@WPID,21,1522.649170,-2800.572021,182.535858,0,0,0,0,100,0), +(@WPID,22,1524.135986,-2803.739746,183.545761,0,0,0,0,100,0), +(@WPID,23,1525.988403,-2809.307129,183.373550,0,0,0,0,100,0), +(@WPID,24,1531.261963,-2816.573486,183.528900,0,0,0,0,100,0), +(@WPID,25,1525.760620,-2811.326904,183.373657,0,0,0,0,100,0), +(@WPID,26,1524.779297,-2808.985840,183.373657,0,0,0,0,100,0), +(@WPID,27,1523.441772,-2802.632324,183.127411,0,0,0,0,100,0), +(@WPID,28,1517.132202,-2796.257080,180.712280,0,0,0,0,100,0), +(@WPID,29,1513.053223,-2798.000732,179.479279,0,0,0,0,100,0), +(@WPID,30,1507.427002,-2804.455811,177.126724,0,0,0,0,100,0), +(@WPID,31,1508.335205,-2810.697266,175.403000,0,0,0,0,100,0), +(@WPID,32,1511.198853,-2812.709717,174.371857,0,0,0,0,100,0), +(@WPID,33,1517.645874,-2814.697510,172.516037,0,0,0,0,100,0), +(@WPID,34,1522.476196,-2811.204834,170.816132,0,0,0,0,100,0), +(@WPID,35,1524.924316,-2804.578857,168.840012,0,0,0,0,100,0), +(@WPID,36,1522.207397,-2800.135010,167.209824,0,0,0,0,100,0), +(@WPID,37,1515.743164,-2793.846436,165.489563,0,0,0,0,100,0), +(@WPID,38,1513.621826,-2789.284180,165.761047,0,0,0,0,100,0), +(@WPID,39,1511.703735,-2782.553467,165.049728,0,0,0,0,100,0), +(@WPID,40,1509.514526,-2776.442139,163.672668,0,0,0,0,100,0), +(@WPID,41,1504.341187,-2768.239258,160.875214,0,0,0,0,100,0), +(@WPID,42,1499.623779,-2758.871826,160.065994,0,0,0,0,100,0), +(@WPID,43,1492.976929,-2750.636963,158.080460,0,0,0,0,100,0), +(@WPID,44,1487.860107,-2750.589600,157.576538,0,0,0,0,100,0), +(@WPID,45,1478.629761,-2755.590332,155.843948,0,0,0,0,100,0), +(@WPID,46,1469.609863,-2761.452148,155.947708,0,0,0,0,100,0), +(@WPID,47,1465.007324,-2767.513184,154.872833,0,0,0,0,100,0), +(@WPID,48,1462.420410,-2775.385254,155.379456,0,0,0,0,100,0); +-- pathing for Felguard CGUID+23 on +SET @WPID := (@CGUID+23)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1529.591064,`position_y`=-2869.343506,`position_z`=124.593094,`currentwaypoint`=0 WHERE `guid` = @CGUID+23; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+23; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+23,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1529.591064,-2869.343506,124.593094,0,0,0,0,100,0), +(@WPID,1,1521.646606,-2867.309082,125.010071,0,0,0,0,100,0), +(@WPID,2,1513.953125,-2865.164551,121.647118,0,0,0,0,100,0), +(@WPID,3,1505.404785,-2862.673584,118.801720,0,0,0,0,100,0), +(@WPID,4,1503.566650,-2868.243408,116.714241,0,0,0,0,100,0), +(@WPID,5,1502.711060,-2874.966064,113.316238,0,0,0,0,100,0), +(@WPID,6,1512.905396,-2877.691650,111.030319,0,0,0,0,100,0), +(@WPID,7,1521.637085,-2882.186279,111.867195,0,0,0,0,100,0), +(@WPID,8,1529.314087,-2885.161865,111.463722,0,0,0,0,100,0), +(@WPID,9,1539.290527,-2881.081299,112.201981,0,0,0,0,100,0), +(@WPID,10,1543.733276,-2870.510986,112.591675,0,0,0,0,100,0), +(@WPID,11,1538.328125,-2855.836182,111.515526,0,0,0,0,100,0), +(@WPID,12,1527.172241,-2852.837158,111.962715,0,0,0,0,100,0), +(@WPID,13,1519.438599,-2860.600342,111.478615,0,0,0,0,100,0), +(@WPID,14,1511.972412,-2870.450684,111.600555,0,0,0,0,100,0), +(@WPID,15,1507.419556,-2876.432617,112.032738,0,0,0,0,100,0), +(@WPID,16,1504.038330,-2877.903809,112.833618,0,0,0,0,100,0), +(@WPID,17,1502.584595,-2873.350342,113.795448,0,0,0,0,100,0), +(@WPID,18,1505.001221,-2866.783203,117.746407,0,0,0,0,100,0), +(@WPID,19,1506.119873,-2863.151855,118.807045,0,0,0,0,100,0), +(@WPID,20,1513.878296,-2865.620605,121.673973,0,0,0,0,100,0), +(@WPID,21,1527.201050,-2868.420166,124.730896,0,0,0,0,100,0); +-- pathing for Felguard CGUID+24 on +SET @WPID := (@CGUID+24)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1682.383301,`position_y`=-3116.470459,`position_z`=89.554993,`currentwaypoint`=0 WHERE `guid` = @CGUID+24; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+24; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+24,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1682.383301,-3116.470459,89.554993,0,0,0,0,100,0), +(@WPID,0,1674.620605,-3109.400146,88.976250,0,0,0,0,100,0), +(@WPID,0,1658.956787,-3095.415039,89.265846,0,0,0,0,100,0), +(@WPID,0,1653.566772,-3084.082275,88.686615,0,0,0,0,100,0), +(@WPID,0,1646.295532,-3068.169434,88.805115,0,0,0,0,100,0), +(@WPID,0,1636.780884,-3059.662109,88.973808,0,0,0,0,100,0), +(@WPID,0,1624.316528,-3060.500488,89.142319,0,0,0,0,100,0), +(@WPID,0,1617.466064,-3070.297119,89.184601,0,0,0,0,100,0), +(@WPID,0,1617.102051,-3082.547607,89.317902,0,0,0,0,100,0), +(@WPID,0,1627.488770,-3091.394531,88.658096,0,0,0,0,100,0), +(@WPID,0,1637.340332,-3094.989258,88.381920,0,0,0,0,100,0), +(@WPID,0,1650.978027,-3098.081299,88.389397,0,0,0,0,100,0), +(@WPID,0,1665.720093,-3104.706787,88.814766,0,0,0,0,100,0); +-- pathing for Felguard CGUID+25 on +SET @WPID := (@CGUID+25)*10; +UPDATE `creature` SET `MovementType`=2,`position_x`=1606.020386,`position_y`=-2979.190918,`position_z`=182.066589,`currentwaypoint`=0 WHERE `guid` = @CGUID+25; +DELETE FROM `creature_addon` WHERE `guid` = @CGUID+25; +INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+25,@WPID); +DELETE FROM `waypoint_data` WHERE `id`=@WPID; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@WPID,0,1606.020386,-2979.190918,182.066589,0,0,0,0,100,0), +(@WPID,1,1592.612793,-2967.980469,181.734604,0,0,0,0,100,0), +(@WPID,2,1584.635986,-2961.699951,182.099609,0,0,0,0,100,0), +(@WPID,3,1576.772339,-2950.720215,182.331390,0,0,0,0,100,0), +(@WPID,4,1570.186157,-2937.653564,181.647690,0,0,0,0,100,0), +(@WPID,5,1569.346313,-2915.366455,181.606720,0,0,0,0,100,0), +(@WPID,6,1567.291138,-2897.670410,181.974411,0,0,0,0,100,0), +(@WPID,7,1561.564575,-2883.124512,183.536499,0,0,0,0,100,0), +(@WPID,8,1554.509888,-2870.604492,182.784332,0,0,0,0,100,0), +(@WPID,9,1559.559570,-2883.650391,183.535065,0,0,0,0,100,0), +(@WPID,10,1565.662109,-2900.051514,181.913925,0,0,0,0,100,0), +(@WPID,11,1570.201538,-2913.283936,181.571747,0,0,0,0,100,0), +(@WPID,12,1573.806274,-2932.618896,181.725723,0,0,0,0,100,0), +(@WPID,13,1579.702026,-2949.056885,182.503983,0,0,0,0,100,0), +(@WPID,14,1586.535400,-2960.601807,182.164642,0,0,0,0,100,0), +(@WPID,15,1595.999878,-2972.899414,181.872986,0,0,0,0,100,0); From e3924a58f60af057a04b38fe889dd1f48eeb1cb0 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 23 Mar 2013 11:06:36 +0100 Subject: [PATCH 08/13] fix wrong pointid in previous commit --- .../2013_03_23_04_world_waypoint_data.sql | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sql/updates/world/2013_03_23_04_world_waypoint_data.sql b/sql/updates/world/2013_03_23_04_world_waypoint_data.sql index 7a977e45cb..b2467c93c2 100644 --- a/sql/updates/world/2013_03_23_04_world_waypoint_data.sql +++ b/sql/updates/world/2013_03_23_04_world_waypoint_data.sql @@ -281,18 +281,18 @@ INSERT INTO `creature_addon` (`guid`,`path_id`) VALUES (@CGUID+24,@WPID); DELETE FROM `waypoint_data` WHERE `id`=@WPID; INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES (@WPID,0,1682.383301,-3116.470459,89.554993,0,0,0,0,100,0), -(@WPID,0,1674.620605,-3109.400146,88.976250,0,0,0,0,100,0), -(@WPID,0,1658.956787,-3095.415039,89.265846,0,0,0,0,100,0), -(@WPID,0,1653.566772,-3084.082275,88.686615,0,0,0,0,100,0), -(@WPID,0,1646.295532,-3068.169434,88.805115,0,0,0,0,100,0), -(@WPID,0,1636.780884,-3059.662109,88.973808,0,0,0,0,100,0), -(@WPID,0,1624.316528,-3060.500488,89.142319,0,0,0,0,100,0), -(@WPID,0,1617.466064,-3070.297119,89.184601,0,0,0,0,100,0), -(@WPID,0,1617.102051,-3082.547607,89.317902,0,0,0,0,100,0), -(@WPID,0,1627.488770,-3091.394531,88.658096,0,0,0,0,100,0), -(@WPID,0,1637.340332,-3094.989258,88.381920,0,0,0,0,100,0), -(@WPID,0,1650.978027,-3098.081299,88.389397,0,0,0,0,100,0), -(@WPID,0,1665.720093,-3104.706787,88.814766,0,0,0,0,100,0); +(@WPID,1,1674.620605,-3109.400146,88.976250,0,0,0,0,100,0), +(@WPID,2,1658.956787,-3095.415039,89.265846,0,0,0,0,100,0), +(@WPID,3,1653.566772,-3084.082275,88.686615,0,0,0,0,100,0), +(@WPID,4,1646.295532,-3068.169434,88.805115,0,0,0,0,100,0), +(@WPID,5,1636.780884,-3059.662109,88.973808,0,0,0,0,100,0), +(@WPID,6,1624.316528,-3060.500488,89.142319,0,0,0,0,100,0), +(@WPID,7,1617.466064,-3070.297119,89.184601,0,0,0,0,100,0), +(@WPID,8,1617.102051,-3082.547607,89.317902,0,0,0,0,100,0), +(@WPID,9,1627.488770,-3091.394531,88.658096,0,0,0,0,100,0), +(@WPID,10,1637.340332,-3094.989258,88.381920,0,0,0,0,100,0), +(@WPID,11,1650.978027,-3098.081299,88.389397,0,0,0,0,100,0), +(@WPID,12,1665.720093,-3104.706787,88.814766,0,0,0,0,100,0); -- pathing for Felguard CGUID+25 on SET @WPID := (@CGUID+25)*10; UPDATE `creature` SET `MovementType`=2,`position_x`=1606.020386,`position_y`=-2979.190918,`position_z`=182.066589,`currentwaypoint`=0 WHERE `guid` = @CGUID+25; From e1cf3683a916a49934389effdf73df7b2332e0ef Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sun, 24 Mar 2013 02:38:56 -0400 Subject: [PATCH 09/13] DB/Spell: Fixed EFFECT BIND position for "Teach: Death Gate". Ref #8590 --- .../world/2013_03_24_00_world_spell_target_position.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_03_24_00_world_spell_target_position.sql diff --git a/sql/updates/world/2013_03_24_00_world_spell_target_position.sql b/sql/updates/world/2013_03_24_00_world_spell_target_position.sql new file mode 100644 index 0000000000..d71a96708e --- /dev/null +++ b/sql/updates/world/2013_03_24_00_world_spell_target_position.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_target_position` WHERE `id`=53821; +INSERT INTO `spell_target_position` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`) VALUES +(53821, 609, 2359.64, -5662.41, 382.261, 0.596899); -- Teach: Death Gate From aad8c12a86f21a373f9a6a037ffba7eb05d761d6 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 24 Mar 2013 12:32:17 +0100 Subject: [PATCH 10/13] DB/EAI: Fix db error in 3a5ed66dcd08bbca276b87ee4f2bc94c403bda21 --- sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql diff --git a/sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql b/sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql new file mode 100644 index 0000000000..9e49ff5f51 --- /dev/null +++ b/sql/updates/world/2013_03_24_01_world_creature_ai_scripts.sql @@ -0,0 +1 @@ +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=34852; From 70e4891e96f0b561968c702f875ef90157fcc14a Mon Sep 17 00:00:00 2001 From: nelegalno Date: Sun, 24 Mar 2013 19:26:26 +0100 Subject: [PATCH 11/13] DB/Quest: set correct class requirement for The Forging of Quel Serrar Closes 4194 --- sql/updates/world/2013_03_24_02_world_quest_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2013_03_24_02_world_quest_template.sql diff --git a/sql/updates/world/2013_03_24_02_world_quest_template.sql b/sql/updates/world/2013_03_24_02_world_quest_template.sql new file mode 100644 index 0000000000..7d0950d0cb --- /dev/null +++ b/sql/updates/world/2013_03_24_02_world_quest_template.sql @@ -0,0 +1,2 @@ +-- The Forging of Quel'Serrar (7509) +UPDATE `quest_template` SET `RequiredClasses` = 3 WHERE `Id` = 7509; -- Warrior & Paladin From 7c36e3a298ce243631848b94364c185a863d1526 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 25 Mar 2013 10:36:30 +0100 Subject: [PATCH 12/13] Core/Misc: Minor optimizations (+ code changes to reduce differences with 4.3.4 branch) --- src/server/game/Entities/Creature/Creature.h | 6 +- .../game/Entities/GameObject/GameObject.h | 1 + src/server/game/Entities/Object/Object.cpp | 250 ++++++++++-------- src/server/game/Entities/Object/Object.h | 165 +++++++----- src/server/game/Entities/Unit/Unit.cpp | 2 +- src/server/game/Entities/Unit/Unit.h | 1 + .../boss_fathomlord_karathress.cpp | 2 +- .../boss_warchief_kargath_bladefist.cpp | 20 +- .../scripts/Outland/zone_shattrath_city.cpp | 54 ++-- 9 files changed, 271 insertions(+), 230 deletions(-) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 6e771d2761..1b59c273d5 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -29,13 +29,13 @@ #include -class SpellInfo; - class CreatureAI; +class CreatureGroup; +class Group; class Quest; class Player; +class SpellInfo; class WorldSession; -class CreatureGroup; enum CreatureFlagsExtra { diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 3f16ea5f27..164735a56b 100644 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -27,6 +27,7 @@ #include "DatabaseEnv.h" class GameObjectAI; +class Group; #define MAX_GAMEOBJECT_QUEST_ITEMS 6 diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 5b6bf87057..4ec0a93f71 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -16,13 +16,13 @@ * with this program. If not, see . */ +#include "Object.h" #include "Common.h" #include "SharedDefines.h" #include "WorldPacket.h" #include "Opcodes.h" #include "Log.h" #include "World.h" -#include "Object.h" #include "Creature.h" #include "Player.h" #include "Vehicle.h" @@ -204,7 +204,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c if (!target) return; - uint8 updatetype = UPDATETYPE_CREATE_OBJECT; + uint8 updateType = UPDATETYPE_CREATE_OBJECT; uint16 flags = m_updateFlag; /** lower flag1 **/ @@ -215,22 +215,22 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c { // UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses... if (isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER)) - updatetype = UPDATETYPE_CREATE_OBJECT2; + updateType = UPDATETYPE_CREATE_OBJECT2; // UPDATETYPE_CREATE_OBJECT2 for pets... if (target->GetPetGUID() == GetGUID()) - updatetype = UPDATETYPE_CREATE_OBJECT2; + updateType = UPDATETYPE_CREATE_OBJECT2; // UPDATETYPE_CREATE_OBJECT2 for some gameobject types... if (isType(TYPEMASK_GAMEOBJECT)) { - switch (((GameObject*)this)->GetGoType()) + switch (ToGameObject()->GetGoType()) { case GAMEOBJECT_TYPE_TRAP: case GAMEOBJECT_TYPE_DUEL_ARBITER: case GAMEOBJECT_TYPE_FLAGSTAND: case GAMEOBJECT_TYPE_FLAGDROP: - updatetype = UPDATETYPE_CREATE_OBJECT2; + updateType = UPDATETYPE_CREATE_OBJECT2; break; case GAMEOBJECT_TYPE_TRANSPORT: flags |= UPDATEFLAG_TRANSPORT; @@ -242,24 +242,24 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c if (isType(TYPEMASK_UNIT)) { - if (((Unit*)this)->getVictim()) + if (ToUnit()->getVictim()) flags |= UPDATEFLAG_HAS_TARGET; } } - //sLog->outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updatetype, m_objectTypeId, flags, flags2); + //sLog->outDebug("BuildCreateUpdate: update-type: %u, object-type: %u got flags: %X, flags2: %X", updateType, m_objectTypeId, flags, flags2); ByteBuffer buf(500); - buf << (uint8)updatetype; + buf << uint8(updateType); buf.append(GetPackGUID()); - buf << (uint8)m_objectTypeId; + buf << uint8(m_objectTypeId); _BuildMovementUpdate(&buf, flags); UpdateMask updateMask; updateMask.SetCount(m_valuesCount); _SetCreateBits(&updateMask, target); - _BuildValuesUpdate(updatetype, &buf, &updateMask, target); + _BuildValuesUpdate(updateType, &buf, &updateMask, target); data->AddUpdateBlock(buf); } @@ -278,7 +278,7 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) c { ByteBuffer buf(500); - buf << (uint8) UPDATETYPE_VALUES; + buf << uint8(UPDATETYPE_VALUES); buf.append(GetPackGUID()); UpdateMask updateMask; @@ -360,64 +360,73 @@ uint16 Object::GetUInt16Value(uint16 index, uint8 offset) const void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { + Unit const* unit = NULL; + WorldObject const* object = NULL; + + if (isType(TYPEMASK_UNIT)) + unit = ToUnit(); + else + object = ((WorldObject*)this); + *data << uint16(flags); // update flags // 0x20 if (flags & UPDATEFLAG_LIVING) { - ((Unit*)this)->BuildMovementPacket(data); + unit->BuildMovementPacket(data); - *data << ((Unit*)this)->GetSpeed(MOVE_WALK); - *data << ((Unit*)this)->GetSpeed(MOVE_RUN); - *data << ((Unit*)this)->GetSpeed(MOVE_RUN_BACK); - *data << ((Unit*)this)->GetSpeed(MOVE_SWIM); - *data << ((Unit*)this)->GetSpeed(MOVE_SWIM_BACK); - *data << ((Unit*)this)->GetSpeed(MOVE_FLIGHT); - *data << ((Unit*)this)->GetSpeed(MOVE_FLIGHT_BACK); - *data << ((Unit*)this)->GetSpeed(MOVE_TURN_RATE); - *data << ((Unit*)this)->GetSpeed(MOVE_PITCH_RATE); + *data << unit->GetSpeed(MOVE_WALK) + << unit->GetSpeed(MOVE_RUN) + << unit->GetSpeed(MOVE_RUN_BACK) + << unit->GetSpeed(MOVE_SWIM) + << unit->GetSpeed(MOVE_SWIM_BACK) + << unit->GetSpeed(MOVE_FLIGHT) + << unit->GetSpeed(MOVE_FLIGHT_BACK) + << unit->GetSpeed(MOVE_TURN_RATE) + << unit->GetSpeed(MOVE_PITCH_RATE); // 0x08000000 - if (((Unit*)this)->m_movementInfo.GetMovementFlags() & MOVEMENTFLAG_SPLINE_ENABLED) - Movement::PacketBuilder::WriteCreate(*((Unit*)this)->movespline, *data); + if (unit->m_movementInfo.GetMovementFlags() & MOVEMENTFLAG_SPLINE_ENABLED) + Movement::PacketBuilder::WriteCreate(*unit->movespline, *data); } else { if (flags & UPDATEFLAG_POSITION) { - Transport* transport = ((WorldObject*)this)->GetTransport(); + Transport* transport = object->GetTransport(); + if (transport) data->append(transport->GetPackGUID()); else *data << uint8(0); - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); + *data << object->GetPositionX(); + *data << object->GetPositionY(); if (isType(TYPEMASK_UNIT)) - *data << ((Unit*)this)->GetPositionZMinusOffset(); + *data << unit->GetPositionZMinusOffset(); else - *data << ((WorldObject*)this)->GetPositionZ(); + *data << object->GetPositionZ(); if (transport) { - *data << ((WorldObject*)this)->GetTransOffsetX(); - *data << ((WorldObject*)this)->GetTransOffsetY(); - *data << ((WorldObject*)this)->GetTransOffsetZ(); + *data << object->GetTransOffsetX(); + *data << object->GetTransOffsetY(); + *data << object->GetTransOffsetZ(); } else { - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); + *data << object->GetPositionX(); + *data << object->GetPositionY(); if (isType(TYPEMASK_UNIT)) - *data << ((Unit*)this)->GetPositionZMinusOffset(); + *data << unit->GetPositionZMinusOffset(); else - *data << ((WorldObject*)this)->GetPositionZ(); + *data << object->GetPositionZ(); } - *data << ((WorldObject*)this)->GetOrientation(); + *data << object->GetOrientation(); if (GetTypeId() == TYPEID_CORPSE) - *data << float(((WorldObject*)this)->GetOrientation()); + *data << float(object->GetOrientation()); else *data << float(0); } @@ -426,13 +435,13 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const // 0x40 if (flags & UPDATEFLAG_STATIONARY_POSITION) { - *data << ((WorldObject*)this)->GetPositionX(); - *data << ((WorldObject*)this)->GetPositionY(); + *data << object->GetPositionX(); + *data << object->GetPositionY(); if (isType(TYPEMASK_UNIT)) - *data << ((Unit*)this)->GetPositionZMinusOffset(); + *data << unit->GetPositionZMinusOffset(); else - *data << ((WorldObject*)this)->GetPositionZ(); - *data << ((WorldObject*)this)->GetOrientation(); + *data << object->GetPositionZ(); + *data << object->GetOrientation(); } } } @@ -476,7 +485,7 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const // 0x4 if (flags & UPDATEFLAG_HAS_TARGET) { - if (Unit* victim = ((Unit*)this)->getVictim()) + if (Unit* victim = unit->getVictim()) data->append(victim->GetPackGUID()); else *data << uint8(0); @@ -492,67 +501,71 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const if (flags & UPDATEFLAG_VEHICLE) { /// @todo Allow players to aquire this updateflag. - *data << uint32(((Unit*)this)->GetVehicleKit()->GetVehicleInfo()->m_ID); - *data << float(((Creature*)this)->GetOrientation()); + *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID); + *data << float(unit->GetOrientation()); } // 0x200 if (flags & UPDATEFLAG_ROTATION) - { - *data << int64(((GameObject*)this)->GetRotation()); - } + *data << int64(ToGameObject()->GetRotation()); } -void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* updateMask, Player* target) const +void Object::_BuildValuesUpdate(uint8 updateType, ByteBuffer* data, UpdateMask* updateMask, Player* target) const { if (!target) return; bool IsActivateToQuest = false; - if (updatetype == UPDATETYPE_CREATE_OBJECT || updatetype == UPDATETYPE_CREATE_OBJECT2) - { - if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsDynTransport()) - { - if (((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster()) - IsActivateToQuest = true; - if (((GameObject*)this)->GetGoArtKit()) + // Before trying to convert to each type there is a check, so safe + Unit const* unit = ToUnit(); + GameObject const* go = ToGameObject(); + + if (unit) + { + if (unit->HasFlag(UNIT_FIELD_AURASTATE, PER_CASTER_AURA_STATE_MASK)) + updateMask->SetBit(UNIT_FIELD_AURASTATE); + } + else if (go) + { + if (updateType == UPDATETYPE_CREATE_OBJECT || updateType == UPDATETYPE_CREATE_OBJECT2) + { + if (!go->IsDynTransport()) + { + if (go->ActivateToQuest(target) || target->isGameMaster()) + IsActivateToQuest = true; + + if (go->GetGoArtKit()) + updateMask->SetBit(GAMEOBJECT_BYTES_1); + } + } + else + { + if (!go->IsTransport()) + { + if (go->ActivateToQuest(target) || target->isGameMaster()) + IsActivateToQuest = true; + updateMask->SetBit(GAMEOBJECT_BYTES_1); - } - else if (isType(TYPEMASK_UNIT)) - { - if (((Unit*)this)->HasFlag(UNIT_FIELD_AURASTATE, PER_CASTER_AURA_STATE_MASK)) - updateMask->SetBit(UNIT_FIELD_AURASTATE); - } - } - else // case UPDATETYPE_VALUES - { - if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport()) - { - if (((GameObject*)this)->ActivateToQuest(target) || target->isGameMaster()) - IsActivateToQuest = true; - updateMask->SetBit(GAMEOBJECT_BYTES_1); - - if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST && ToGameObject()->GetGOInfo()->chest.groupLootRules && - ToGameObject()->HasLootRecipient()) - updateMask->SetBit(GAMEOBJECT_FLAGS); - } - else if (isType(TYPEMASK_UNIT)) - { - if (((Unit*)this)->HasFlag(UNIT_FIELD_AURASTATE, PER_CASTER_AURA_STATE_MASK)) - updateMask->SetBit(UNIT_FIELD_AURASTATE); + if (go->GetGoType() == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.groupLootRules && + go->HasLootRecipient()) + { + updateMask->SetBit(GAMEOBJECT_FLAGS); + } + } } } - WPAssert(updateMask && updateMask->GetCount() == m_valuesCount); + ASSERT(updateMask && updateMask->GetCount() == m_valuesCount); - *data << (uint8)updateMask->GetBlockCount(); + *data << uint8(updateMask->GetBlockCount()); updateMask->AppendToPacket(data); // 2 specialized loops for speed optimization in non-unit case - if (isType(TYPEMASK_UNIT)) // unit (creature/player) case + if (unit) // unit (creature/player) case { + Creature const* creature = ToCreature(); for (uint16 index = 0; index < m_valuesCount; ++index) { if (updateMask->GetBit(index)) @@ -569,7 +582,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* if (appendValue & UNIT_NPC_FLAG_TRAINER) { - if (!this->ToCreature()->isCanTrainingOf(target, false)) + if (!creature->isCanTrainingOf(target, false)) appendValue &= ~(UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS | UNIT_NPC_FLAG_TRAINER_PROFESSION); } } @@ -578,8 +591,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } else if (index == UNIT_FIELD_AURASTATE) { - // Check per caster aura states to not enable using a pell in client if specified aura is not by target - *data << ((Unit*)this)->BuildAuraStateUpdateForTarget(target); + // Check per caster aura states to not enable using a spell in client if specified aura is not by target + *data << unit->BuildAuraStateUpdateForTarget(target); } // FIXME: Some values at server stored in float format but must be sent to client in uint32 format else if (index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME) @@ -608,7 +621,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { if (GetTypeId() == TYPEID_UNIT) { - CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate(); + CreatureTemplate const* cinfo = creature->GetCreatureTemplate(); // this also applies for transform auras if (SpellInfo const* transform = sSpellMgr->GetSpellInfo(ToUnit()->getTransForm())) @@ -648,7 +661,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { uint32 dynamicFlags = m_uint32Values[index]; - if (Creature const* creature = ToCreature()) + if (creature) { if (creature->hasLootRecipient()) { @@ -673,16 +686,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } // unit UNIT_DYNFLAG_TRACK_UNIT should only be sent to caster of SPELL_AURA_MOD_STALKED auras - if (Unit const* unit = ToUnit()) - if (dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT) - if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) - dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; + if (dynamicFlags & UNIT_DYNFLAG_TRACK_UNIT) + if (!unit->HasAuraTypeWithCaster(SPELL_AURA_MOD_STALKED, target->GetGUID())) + dynamicFlags &= ~UNIT_DYNFLAG_TRACK_UNIT; *data << dynamicFlags; } // FG: pretend that OTHER players in own group are friendly ("blue") else if (index == UNIT_FIELD_BYTES_2 || index == UNIT_FIELD_FACTIONTEMPLATE) { - Unit const* unit = ToUnit(); if (unit->IsControlledByPlayer() && target != this && sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && unit->IsInRaidWith(target)) { FactionTemplateEntry const* ft1 = unit->getFactionTemplateEntry(); @@ -715,7 +726,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* } } } - else if (isType(TYPEMASK_GAMEOBJECT)) // gameobject case + else if (go) // gameobject case { for (uint16 index = 0; index < m_valuesCount; ++index) { @@ -726,7 +737,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* { if (IsActivateToQuest) { - switch (ToGameObject()->GetGoType()) + switch (go->GetGoType()) { case GAMEOBJECT_TYPE_CHEST: if (target->isGameMaster()) @@ -766,8 +777,8 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* else if (index == GAMEOBJECT_FLAGS) { uint32 flags = m_uint32Values[index]; - if (ToGameObject()->GetGoType() == GAMEOBJECT_TYPE_CHEST) - if (ToGameObject()->GetGOInfo()->chest.groupLootRules && !ToGameObject()->IsLootAllowedFor(target)) + if (go->GetGoType() == GAMEOBJECT_TYPE_CHEST) + if (go->GetGOInfo()->chest.groupLootRules && !go->IsLootAllowedFor(target)) flags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE; *data << flags; @@ -1294,6 +1305,14 @@ bool Object::PrintIndexError(uint32 index, bool set) const return false; } +bool Position::operator==(Position const &a) +{ + return (G3D::fuzzyEq(a.m_positionX, m_positionX) && + G3D::fuzzyEq(a.m_positionY, m_positionY) && + G3D::fuzzyEq(a.m_positionZ, m_positionZ) && + G3D::fuzzyEq(a.m_orientation, m_orientation)); +} + bool Position::HasInLine(WorldObject const* target, float width) const { if (!HasInArc(M_PI, target)) @@ -1703,7 +1722,7 @@ void Position::RelocateOffset(const Position & offset) m_positionX = GetPositionX() + (offset.GetPositionX() * std::cos(GetOrientation()) + offset.GetPositionY() * std::sin(GetOrientation() + M_PI)); m_positionY = GetPositionY() + (offset.GetPositionY() * std::cos(GetOrientation()) + offset.GetPositionX() * std::sin(GetOrientation())); m_positionZ = GetPositionZ() + offset.GetPositionZ(); - m_orientation = GetOrientation() + offset.GetOrientation(); + SetOrientation(GetOrientation() + offset.GetOrientation()); } void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset) const @@ -1714,7 +1733,7 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset retOffset.m_positionX = dx * std::cos(GetOrientation()) + dy * std::sin(GetOrientation()); retOffset.m_positionY = dy * std::cos(GetOrientation()) - dx * std::sin(GetOrientation()); retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ(); - retOffset.m_orientation = endPos.GetOrientation() - GetOrientation(); + retOffset.SetOrientation(endPos.GetOrientation() - GetOrientation()); } float Position::GetAngle(const Position* obj) const @@ -1755,25 +1774,25 @@ void Position::GetSinCos(const float x, const float y, float &vsin, float &vcos) } } -bool Position::HasInArc(float arc, const Position* obj) const +bool Position::HasInArc(float arc, const Position* obj, float border) const { // always have self in arc if (obj == this) return true; // move arc to range 0.. 2*pi - arc = MapManager::NormalizeOrientation(arc); + arc = NormalizeOrientation(arc); float angle = GetAngle(obj); angle -= m_orientation; // move angle to range -pi ... +pi - angle = MapManager::NormalizeOrientation(angle); + angle = NormalizeOrientation(angle); if (angle > M_PI) angle -= 2.0f*M_PI; - float lborder = -1 * (arc/2.0f); // in range -pi..0 - float rborder = (arc/2.0f); // in range 0..pi + float lborder = -1 * (arc/border); // in range -pi..0 + float rborder = (arc/border); // in range 0..pi return ((angle >= lborder) && (angle <= rborder)); } @@ -2037,7 +2056,7 @@ bool WorldObject::CanDetect(WorldObject const* obj, bool ignoreStealth) const const WorldObject* seer = this; // Pets don't have detection, they use the detection of their masters - if (const Unit* thisUnit = ToUnit()) + if (Unit const* thisUnit = ToUnit()) if (Unit* controller = thisUnit->GetCharmerOrOwner()) seer = controller; @@ -2096,8 +2115,9 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj) const float distance = GetExactDist(obj); float combatReach = 0.0f; - if (isType(TYPEMASK_UNIT)) - combatReach = ((Unit*)this)->GetCombatReach(); + Unit const* unit = ToUnit(); + if (unit) + combatReach = unit->GetCombatReach(); if (distance < combatReach) return true; @@ -2105,14 +2125,14 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj) const if (!HasInArc(M_PI, obj)) return false; + GameObject const* go = ToGameObject(); for (uint32 i = 0; i < TOTAL_STEALTH_TYPES; ++i) { if (!(obj->m_stealth.GetFlags() & (1 << i))) continue; - if (isType(TYPEMASK_UNIT)) - if (((Unit*)this)->HasAuraTypeWithMiscvalue(SPELL_AURA_DETECT_STEALTH, i)) - return true; + if (unit && unit->HasAuraTypeWithMiscvalue(SPELL_AURA_DETECT_STEALTH, i)) + return true; // Starting points int32 detectionValue = 30; @@ -2124,8 +2144,8 @@ bool WorldObject::CanDetectStealthOf(WorldObject const* obj) const // Apply modifiers detectionValue += m_stealthDetect.GetValue(StealthType(i)); - if (obj->isType(TYPEMASK_GAMEOBJECT)) - if (Unit* owner = ((GameObject*)obj)->GetOwner()) + if (go) + if (Unit* owner = go->GetOwner()) detectionValue -= int32(owner->getLevelForTarget(this) - 1) * 5; detectionValue -= obj->m_stealth.GetValue(StealthType(i)); @@ -2955,7 +2975,7 @@ float WorldObject::GetObjectSize() const void WorldObject::MovePosition(Position &pos, float dist, float angle) { - angle += m_orientation; + angle += GetOrientation(); float destx, desty, destz, ground, floor; destx = pos.m_positionX + dist * std::cos(angle); desty = pos.m_positionY + dist * std::sin(angle); @@ -3000,7 +3020,7 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle) void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float angle) { - angle += m_orientation; + angle += GetOrientation(); float destx, desty, destz, ground, floor; pos.m_positionZ += 2.0f; destx = pos.m_positionX + dist * std::cos(angle); @@ -3063,7 +3083,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float Trinity::NormalizeMapCoord(pos.m_positionX); Trinity::NormalizeMapCoord(pos.m_positionY); UpdateAllowedPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ); - pos.m_orientation = m_orientation; + pos.SetOrientation(GetOrientation()); } void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 6c54ccfbdf..70a7bcd7f3 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -21,10 +21,8 @@ #include "Common.h" #include "UpdateMask.h" -#include "UpdateData.h" #include "GridReference.h" #include "ObjectDefines.h" -#include "GridDefines.h" #include "Map.h" #include @@ -101,20 +99,21 @@ enum NotifyFlags NOTIFY_ALL = 0xFF }; -class WorldPacket; -class UpdateData; -class ByteBuffer; -class WorldSession; +class Corpse; class Creature; -class Player; -class InstanceScript; -class GameObject; -class TempSummon; -class Vehicle; class CreatureAI; -class ZoneScript; -class Unit; +class DynamicObject; +class GameObject; +class Map; +class InstanceScript; +class Player; +class TempSummon; class Transport; +class Unit; +class UpdateData; +class WorldObject; +class WorldPacket; +class ZoneScript; typedef UNORDERED_MAP UpdateDataMapType; @@ -225,6 +224,9 @@ class Object Corpse* ToCorpse() { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } Corpse const* ToCorpse() const { if (GetTypeId() == TYPEID_CORPSE) return reinterpret_cast(this); else return NULL; } + DynamicObject* ToDynObject() { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast(this); else return NULL; } + DynamicObject const* ToDynObject() const { if (GetTypeId() == TYPEID_DYNAMICOBJECT) return reinterpret_cast(this); else return NULL; } + protected: Object(); @@ -288,21 +290,31 @@ struct Position float m_positionX; float m_positionY; float m_positionZ; +// Better to limit access to m_orientation field, but this will be hard to achieve with many scripts using array initialization for this structure +//private: float m_orientation; +//public: + + bool operator==(Position const &a); + + inline bool operator!=(Position const &a) + { + return !(operator==(a)); + } void Relocate(float x, float y) { m_positionX = x; m_positionY = y;} void Relocate(float x, float y, float z) { m_positionX = x; m_positionY = y; m_positionZ = z; } void Relocate(float x, float y, float z, float orientation) - { m_positionX = x; m_positionY = y; m_positionZ = z; m_orientation = orientation; } - void Relocate(const Position &pos) - { m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; m_orientation = pos.m_orientation; } - void Relocate(const Position* pos) - { m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; m_orientation = pos->m_orientation; } - void RelocateOffset(const Position &offset); + { m_positionX = x; m_positionY = y; m_positionZ = z; SetOrientation(orientation); } + void Relocate(Position const &pos) + { m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; SetOrientation(pos.m_orientation); } + void Relocate(Position const* pos) + { m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; SetOrientation(pos->m_orientation); } + void RelocateOffset(Position const &offset); void SetOrientation(float orientation) - { m_orientation = orientation; } + { m_orientation = NormalizeOrientation(orientation); } float GetPositionX() const { return m_positionX; } float GetPositionY() const { return m_positionY; } @@ -336,39 +348,54 @@ struct Position { float dx = m_positionX - x; float dy = m_positionY - y; return dx*dx + dy*dy; } float GetExactDist2d(const float x, const float y) const { return sqrt(GetExactDist2dSq(x, y)); } - float GetExactDist2dSq(const Position* pos) const + float GetExactDist2dSq(Position const* pos) const { float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; return dx*dx + dy*dy; } - float GetExactDist2d(const Position* pos) const + float GetExactDist2d(Position const* pos) const { return sqrt(GetExactDist2dSq(pos)); } float GetExactDistSq(float x, float y, float z) const { float dz = m_positionZ - z; return GetExactDist2dSq(x, y) + dz*dz; } float GetExactDist(float x, float y, float z) const { return sqrt(GetExactDistSq(x, y, z)); } - float GetExactDistSq(const Position* pos) const + float GetExactDistSq(Position const* pos) const { float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; float dz = m_positionZ - pos->m_positionZ; return dx*dx + dy*dy + dz*dz; } - float GetExactDist(const Position* pos) const + float GetExactDist(Position const* pos) const { return sqrt(GetExactDistSq(pos)); } - void GetPositionOffsetTo(const Position & endPos, Position & retOffset) const; + void GetPositionOffsetTo(Position const & endPos, Position & retOffset) const; - float GetAngle(const Position* pos) const; + float GetAngle(Position const* pos) const; float GetAngle(float x, float y) const; - float GetRelativeAngle(const Position* pos) const + float GetRelativeAngle(Position const* pos) const { return GetAngle(pos) - m_orientation; } float GetRelativeAngle(float x, float y) const { return GetAngle(x, y) - m_orientation; } void GetSinCos(float x, float y, float &vsin, float &vcos) const; bool IsInDist2d(float x, float y, float dist) const { return GetExactDist2dSq(x, y) < dist * dist; } - bool IsInDist2d(const Position* pos, float dist) const + bool IsInDist2d(Position const* pos, float dist) const { return GetExactDist2dSq(pos) < dist * dist; } bool IsInDist(float x, float y, float z, float dist) const { return GetExactDistSq(x, y, z) < dist * dist; } - bool IsInDist(const Position* pos, float dist) const + bool IsInDist(Position const* pos, float dist) const { return GetExactDistSq(pos) < dist * dist; } - bool HasInArc(float arcangle, const Position* pos) const; + bool HasInArc(float arcangle, Position const* pos, float border = 2.0f) const; bool HasInLine(WorldObject const* target, float width) const; std::string ToString() const; + + // modulos a radian orientation to the range of 0..2PI + static float NormalizeOrientation(float o) + { + // fmod only supports positive numbers. Thus we have + // to emulate negative numbers + if (o < 0) + { + float mod = o *-1; + mod = fmod(mod, 2.0f * static_cast(M_PI)); + mod = -mod + 2.0f * static_cast(M_PI); + return mod; + } + return fmod(o, 2.0f * static_cast(M_PI)); + } }; ByteBuffer& operator>>(ByteBuffer& buf, Position::PositionXYZOStreamer const& streamer); ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZStreamer const& streamer); @@ -378,39 +405,31 @@ ByteBuffer& operator<<(ByteBuffer& buf, Position::PositionXYZOStreamer const& st struct MovementInfo { // common - uint64 guid; - uint32 flags; - uint16 flags2; + uint64 guid; + uint32 flags; + uint16 flags2; Position pos; - uint32 time; + uint32 time; // transport - uint64 t_guid; + uint64 t_guid; Position t_pos; - uint32 t_time; - uint32 t_time2; - int8 t_seat; + int8 t_seat; + uint32 t_time; + uint32 t_time2; // swimming/flying - float pitch; + float pitch; // falling - uint32 fallTime; + uint32 fallTime; // jumping - float j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed; + float j_zspeed, j_sinAngle, j_cosAngle, j_xyspeed; // spline - float splineElevation; + float splineElevation; - MovementInfo() - { - pos.Relocate(0, 0, 0, 0); - guid = 0; - flags = 0; - flags2 = 0; - time = t_time = t_time2 = fallTime = 0; - splineElevation = 0; - pitch = j_zspeed = j_sinAngle = j_cosAngle = j_xyspeed = 0.0f; - t_guid = 0; - t_pos.Relocate(0, 0, 0, 0); - t_seat = -1; - } + MovementInfo() : + guid(), flags(), flags2(), pos(), time(), t_guid(), t_pos(), + t_seat(-1), t_time(), t_time2(), pitch(), fallTime(), + j_zspeed(), j_sinAngle(), j_cosAngle(), j_xyspeed() + { } uint32 GetMovementFlags() const { return flags; } void SetMovementFlags(uint32 flag) { flags = flag; } @@ -498,14 +517,14 @@ class WorldObject : public Object, public WorldLocation void MovePositionToFirstCollision(Position &pos, float dist, float angle); void GetFirstCollisionPosition(Position &pos, float dist, float angle); void GetRandomNearPosition(Position &pos, float radius); - void GetContactPoint(const WorldObject* obj, float &x, float &y, float &z, float distance2d = CONTACT_DISTANCE) const; + void GetContactPoint(WorldObject const* obj, float &x, float &y, float &z, float distance2d = CONTACT_DISTANCE) const; float GetObjectSize() const; void UpdateGroundPositionZ(float x, float y, float &z) const; void UpdateAllowedPositionZ(float x, float y, float &z) const; - void GetRandomPoint(const Position &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const; - void GetRandomPoint(const Position &srcPos, float distance, Position &pos) const; + void GetRandomPoint(Position const &srcPos, float distance, float &rand_x, float &rand_y, float &rand_z) const; + void GetRandomPoint(Position const &srcPos, float distance, Position &pos) const; uint32 GetInstanceId() const { return m_InstanceId; } @@ -525,24 +544,24 @@ class WorldObject : public Object, public WorldLocation virtual std::string const& GetNameForLocaleIdx(LocaleConstant /*locale_idx*/) const { return m_name; } - float GetDistance(const WorldObject* obj) const; - float GetDistance(const Position &pos) const; + float GetDistance(WorldObject const* obj) const; + float GetDistance(Position const &pos) const; float GetDistance(float x, float y, float z) const; - float GetDistance2d(const WorldObject* obj) const; + float GetDistance2d(WorldObject const* obj) const; float GetDistance2d(float x, float y) const; - float GetDistanceZ(const WorldObject* obj) const; + float GetDistanceZ(WorldObject const* obj) const; - bool IsSelfOrInSameMap(const WorldObject* obj) const; - bool IsInMap(const WorldObject* obj) const; + bool IsSelfOrInSameMap(WorldObject const* obj) const; + bool IsInMap(WorldObject const* obj) const; bool IsWithinDist3d(float x, float y, float z, float dist) const; - bool IsWithinDist3d(const Position* pos, float dist) const; + bool IsWithinDist3d(Position const* pos, float dist) const; bool IsWithinDist2d(float x, float y, float dist) const; - bool IsWithinDist2d(const Position* pos, float dist) const; + bool IsWithinDist2d(Position const* pos, float dist) const; // use only if you will sure about placing both object at same map bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const; bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const; bool IsWithinLOS(float x, float y, float z) const; - bool IsWithinLOSInMap(const WorldObject* obj) const; + bool IsWithinLOSInMap(WorldObject const* obj) const; bool GetDistanceOrder(WorldObject const* obj1, WorldObject const* obj2, bool is3D = true) const; bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const; bool IsInRange2d(float x, float y, float minRange, float maxRange) const; @@ -550,7 +569,7 @@ class WorldObject : public Object, public WorldLocation bool isInFront(WorldObject const* target, float arc = M_PI) const; bool isInBack(WorldObject const* target, float arc = M_PI) const; - bool IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size = 0) const; + bool IsInBetween(WorldObject const* obj1, WorldObject const* obj2, float size = 0) const; virtual void CleanupsBeforeDelete(bool finalCleanup = true); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units @@ -581,7 +600,7 @@ class WorldObject : public Object, public WorldLocation float GetGridActivationRange() const; float GetVisibilityRange() const; - float GetSightRange(const WorldObject* target = NULL) const; + float GetSightRange(WorldObject const* target = NULL) const; bool canSeeOrDetect(WorldObject const* obj, bool ignoreStealth = false, bool distanceCheck = false) const; FlaggedValuesArray32 m_stealth; @@ -608,7 +627,7 @@ class WorldObject : public Object, public WorldLocation void SetZoneScript(); ZoneScript* GetZoneScript() const { return m_zoneScript; } - TempSummon* SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const; + TempSummon* SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const; TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0) const; GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime); Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL); @@ -710,13 +729,13 @@ namespace Trinity class ObjectDistanceOrderPred { public: - ObjectDistanceOrderPred(const WorldObject* pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {} - bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const + ObjectDistanceOrderPred(WorldObject const* pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {} + bool operator()(WorldObject const* pLeft, WorldObject const* pRight) const { return m_ascending ? m_refObj->GetDistanceOrder(pLeft, pRight) : !m_refObj->GetDistanceOrder(pLeft, pRight); } private: - const WorldObject* m_refObj; + WorldObject const* m_refObj; const bool m_ascending; }; } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 87ca7a6c62..bf73feeae1 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9934,7 +9934,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin AddPct(DoneTotalMod, (*i)->GetAmount()); // done scripted mod (take it from owner) - Unit const * const owner = GetOwner() ? GetOwner() : this; + Unit const* owner = GetOwner() ? GetOwner() : this; AuraEffectList const& mOverrideClassScript= owner->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); for (AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) { diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 49df265943..4896f29d20 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -19,6 +19,7 @@ #ifndef __UNIT_H #define __UNIT_H +#include "DBCStructure.h" #include "EventProcessor.h" #include "FollowerReference.h" #include "FollowerRefManager.h" diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 38f02622e5..0a6c09093f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -672,7 +672,7 @@ public: if (Creature* Cyclone = me->SummonCreature(CREATURE_CYCLONE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), float(rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000)) { - Cyclone->ToCreature()->SetObjectScale(3.0f); + Cyclone->SetObjectScale(3.0f); Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Cyclone->setFaction(me->getFaction()); Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); diff --git a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp index 2cfe73ea71..a13d91e8bf 100644 --- a/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp @@ -164,24 +164,24 @@ class boss_warchief_kargath_bladefist : public CreatureScript { for (std::vector::const_iterator itr = adds.begin(); itr!= adds.end(); ++itr) { - Unit* temp = Unit::GetUnit(*me, *itr); - if (temp && temp->isAlive()) + Creature* creature = Unit::GetCreature(*me, *itr); + if (creature && creature->isAlive()) { - temp->GetMotionMaster()->Clear(true); - me->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - temp->ToCreature()->RemoveCorpse(); + creature->GetMotionMaster()->Clear(true); + me->DealDamage(creature, creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + creature->RemoveCorpse(); } } adds.clear(); for (std::vector::const_iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) { - Unit* temp = Unit::GetUnit(*me, *itr); - if (temp && temp->isAlive()) + Creature* creature = Unit::GetCreature(*me, *itr); + if (creature && creature->isAlive()) { - temp->GetMotionMaster()->Clear(true); - me->DealDamage(temp, temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - temp->ToCreature()->RemoveCorpse(); + creature->GetMotionMaster()->Clear(true); + me->DealDamage(creature, creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + creature->RemoveCorpse(); } } assassins.clear(); diff --git a/src/server/scripts/Outland/zone_shattrath_city.cpp b/src/server/scripts/Outland/zone_shattrath_city.cpp index 95ba947690..4af1119170 100644 --- a/src/server/scripts/Outland/zone_shattrath_city.cpp +++ b/src/server/scripts/Outland/zone_shattrath_city.cpp @@ -474,16 +474,16 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->setFaction(1194); - if (Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20)) + if (Creature* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20)) { - Creepjack->ToCreature()->AI()->EnterEvadeMode(); + Creepjack->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - if (Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20)) + if (Creature* Malone = me->FindNearestCreature(NPC_MALONE, 20)) { - Malone->ToCreature()->AI()->EnterEvadeMode(); + Malone->AI()->EnterEvadeMode(); Malone->setFaction(1194); Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } @@ -521,31 +521,31 @@ public: { if (Event) SayTimer = NextStep(++Step); - } else SayTimer -= diff; + } + else + SayTimer -= diff; if (Attack) { - Player* player = Unit::GetPlayer(*me, PlayerGUID); me->setFaction(14); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (player) + if (Player* player = Unit::GetPlayer(*me, PlayerGUID)) { - Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20); - if (Creepjack) - { - Creepjack->Attack(player, true); - Creepjack->setFaction(14); - Creepjack->GetMotionMaster()->MoveChase(player); - Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20); - if (Malone) - { - Malone->Attack(player, true); - Malone->setFaction(14); - Malone->GetMotionMaster()->MoveChase(player); - Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } + if (Creature* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20)) + { + Creepjack->Attack(player, true); + Creepjack->setFaction(14); + Creepjack->GetMotionMaster()->MoveChase(player); + Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (Creature* Malone = me->FindNearestCreature(NPC_MALONE, 20)) + { + Malone->Attack(player, true); + Malone->setFaction(14); + Malone->GetMotionMaster()->MoveChase(player); + Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } DoStartMovement(player); AttackStart(player); } @@ -557,17 +557,17 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); me->RemoveAllAuras(); - if (Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20)) + if (Creature* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20)) { - Creepjack->ToCreature()->AI()->EnterEvadeMode(); + Creepjack->AI()->EnterEvadeMode(); Creepjack->setFaction(1194); Creepjack->GetMotionMaster()->MoveTargetedHome(); Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } - if (Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20)) + if (Creature* Malone = me->FindNearestCreature(NPC_MALONE, 20)) { - Malone->ToCreature()->AI()->EnterEvadeMode(); + Malone->AI()->EnterEvadeMode(); Malone->setFaction(1194); Malone->GetMotionMaster()->MoveTargetedHome(); Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); From 1a6a23ec96c7646d2753198f93eaba62d2732a83 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 25 Mar 2013 13:26:48 +0100 Subject: [PATCH 13/13] Core/Misc: Minor optimizations (+code changes to reduce differences with 4.3.4 branch) Core/Logging: Create new logger type "Cheat". Will be used to log all cheat attempts --- src/server/game/Entities/Object/Object.cpp | 2 +- src/server/game/Entities/Object/Object.h | 1 - .../game/Entities/Object/Updates/UpdateData.h | 2 + src/server/game/Entities/Pet/Pet.cpp | 63 ++++--- src/server/game/Entities/Player/Player.cpp | 14 +- src/server/game/Entities/Player/Player.h | 10 +- src/server/game/Entities/Player/SocialMgr.cpp | 11 +- src/server/game/Entities/Player/SocialMgr.h | 1 - src/server/game/Entities/Unit/Unit.h | 41 +++-- src/server/game/Events/GameEventMgr.cpp | 4 +- src/server/game/Globals/ObjectAccessor.cpp | 29 +++ src/server/game/Globals/ObjectAccessor.h | 29 +-- src/server/game/Grids/GridDefines.h | 6 +- src/server/game/Grids/NGrid.h | 13 +- src/server/game/Groups/Group.cpp | 10 +- src/server/game/Instances/InstanceSaveMgr.cpp | 3 +- src/server/game/Instances/InstanceScript.cpp | 2 + src/server/game/Loot/LootMgr.cpp | 17 +- src/server/game/Loot/LootMgr.h | 1 - src/server/game/Maps/MapInstanced.cpp | 2 - src/server/game/Maps/MapManager.h | 15 -- src/server/game/Spells/Auras/SpellAuras.h | 15 +- src/server/game/Spells/Spell.h | 4 +- .../RubySanctum/boss_halion.cpp | 2 +- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 5 +- .../Northrend/Nexus/Oculus/boss_varos.cpp | 3 +- src/server/shared/CMakeLists.txt | 3 +- src/server/shared/Containers.h | 1 + .../Cryptography/Authentication/AuthCrypt.cpp | 13 +- .../Cryptography/Authentication/AuthCrypt.h | 1 - src/server/shared/Cryptography/BigNumber.cpp | 9 +- src/server/shared/Cryptography/HMACSHA1.cpp | 2 +- .../shared/Database/DatabaseWorkerPool.h | 4 +- src/server/shared/Debugging/Errors.cpp | 38 ++++ src/server/shared/Debugging/Errors.h | 24 ++- .../Debugging/WheatyExceptionReport.cpp | 2 + src/server/shared/Logging/Appender.cpp | 2 + src/server/shared/Logging/Appender.h | 13 +- src/server/shared/Logging/LogOperation.h | 3 +- src/server/shared/Packets/ByteBuffer.cpp | 95 ++++++++++ src/server/shared/Packets/ByteBuffer.h | 169 ++++++------------ src/server/worldserver/worldserver.conf.dist | 3 +- 42 files changed, 375 insertions(+), 312 deletions(-) create mode 100644 src/server/shared/Debugging/Errors.cpp create mode 100644 src/server/shared/Packets/ByteBuffer.cpp diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 4ec0a93f71..83d192e8a8 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -3015,7 +3015,7 @@ void WorldObject::MovePosition(Position &pos, float dist, float angle) Trinity::NormalizeMapCoord(pos.m_positionX); Trinity::NormalizeMapCoord(pos.m_positionY); UpdateGroundPositionZ(pos.m_positionX, pos.m_positionY, pos.m_positionZ); - pos.m_orientation = m_orientation; + pos.SetOrientation(GetOrientation()); } void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float angle) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 70a7bcd7f3..9acd3cc302 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -104,7 +104,6 @@ class Creature; class CreatureAI; class DynamicObject; class GameObject; -class Map; class InstanceScript; class Player; class TempSummon; diff --git a/src/server/game/Entities/Object/Updates/UpdateData.h b/src/server/game/Entities/Object/Updates/UpdateData.h index fb4ec930c4..654db149ca 100644 --- a/src/server/game/Entities/Object/Updates/UpdateData.h +++ b/src/server/game/Entities/Object/Updates/UpdateData.h @@ -20,6 +20,8 @@ #define __UPDATEDATA_H #include "ByteBuffer.h" +#include + class WorldPacket; enum OBJECT_UPDATE_TYPE diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index d32c37975d..990c315e05 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -34,12 +34,12 @@ #define PET_XP_FACTOR 0.05f -Pet::Pet(Player* owner, PetType type) : Guardian(NULL, owner, true), - m_usedTalentCount(0), m_removed(false), - m_happinessTimer(7500), m_petType(type), m_duration(0), - m_auraRaidUpdateMask(0), m_loading(false), m_declinedname(NULL) +Pet::Pet(Player* owner, PetType type) : + Guardian(NULL, owner, true), m_usedTalentCount(0), m_removed(false), + m_happinessTimer(7500), m_petType(type), m_duration(0), m_auraRaidUpdateMask(0), m_loading(false), + m_declinedname(NULL) { - ASSERT(m_owner->GetTypeId() == TYPEID_PLAYER); + ASSERT(GetOwner()->GetTypeId() == TYPEID_PLAYER); m_unitTypeMask |= UNIT_MASK_PET; if (type == HUNTER_PET) @@ -563,7 +563,7 @@ void Pet::Update(uint32 diff) { if (owner->GetPetGUID() != GetGUID()) { - sLog->outError(LOG_FILTER_PETS, "Pet %u is not pet of owner %s, removed", GetEntry(), m_owner->GetName().c_str()); + sLog->outError(LOG_FILTER_PETS, "Pet %u is not pet of owner %s, removed", GetEntry(), GetOwner()->GetName().c_str()); Remove(getPetType() == HUNTER_PET?PET_SAVE_AS_DELETED:PET_SAVE_NOT_IN_SLOT); return; } @@ -832,19 +832,24 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) //Determine pet type PetType petType = MAX_PET_TYPE; - if (isPet() && m_owner->GetTypeId() == TYPEID_PLAYER) + if (isPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER) { - if ((m_owner->getClass() == CLASS_WARLOCK) - || (m_owner->getClass() == CLASS_SHAMAN) // Fire Elemental - || (m_owner->getClass() == CLASS_DEATH_KNIGHT)) // Risen Ghoul + if (GetOwner()->getClass() == CLASS_WARLOCK + || GetOwner()->getClass() == CLASS_SHAMAN // Fire Elemental + || GetOwner()->getClass() == CLASS_DEATH_KNIGHT) // Risen Ghoul + { petType = SUMMON_PET; - else if (m_owner->getClass() == CLASS_HUNTER) + } + else if (GetOwner()->getClass() == CLASS_HUNTER) { petType = HUNTER_PET; m_unitTypeMask |= UNIT_MASK_HUNTER_PET; } else - sLog->outError(LOG_FILTER_PETS, "Unknown type pet %u is summoned by player class %u", GetEntry(), m_owner->getClass()); + { + sLog->outError(LOG_FILTER_PETS, "Unknown type pet %u is summoned by player class %u", + GetEntry(), GetOwner()->getClass()); + } } uint32 creature_ID = (petType == HUNTER_PET) ? 1 : cinfo->Entry; @@ -911,12 +916,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { case SUMMON_PET: { - //the damage bonus used for pets is either fire or shadow damage, whatever is higher - uint32 fire = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE); - uint32 shadow = m_owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW); - uint32 val = (fire > shadow) ? fire : shadow; - SetBonusDamage(int32 (val * 0.15f)); - //bonusAP += val * 0.57; + // the damage bonus used for pets is either fire or shadow damage, whatever is higher + int32 fire = GetOwner()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE); + int32 shadow = GetOwner()->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW); + int32 val = (fire > shadow) ? fire : shadow; + if (val < 0) + val = 0; + + SetBonusDamage(val * 0.15f); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); @@ -941,14 +948,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) { case 510: // mage Water Elemental { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); + SetBonusDamage(int32(GetOwner()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); break; } case 1964: //force of nature { if (!pInfo) SetCreateHealth(30 + 30*petlevel); - float bonusDmg = m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_NATURE) * 0.15f; + float bonusDmg = GetOwner()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_NATURE) * 0.15f; SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 2.5f - (petlevel / 2) + bonusDmg)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 2.5f + (petlevel / 2) + bonusDmg)); break; @@ -968,7 +975,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateHealth(40*petlevel); SetCreateMana(28 + 10*petlevel); } - SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) * 0.5f)); + SetBonusDamage(int32(GetOwner()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) * 0.5f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel * 4 - petlevel)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel * 4 + petlevel)); break; @@ -980,7 +987,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateMana(28 + 10*petlevel); SetCreateHealth(28 + 30*petlevel); } - int32 bonus_dmg = (int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SHADOW)* 0.3f)); + int32 bonus_dmg = int32(GetOwner()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SHADOW)* 0.3f); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel) + bonus_dmg)); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel) + bonus_dmg)); @@ -1009,16 +1016,16 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel))); - SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(m_owner->GetArmor()) * 0.35f); // Bonus Armor (35% of player armor) - SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(m_owner->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina) + SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(GetOwner()->GetArmor()) * 0.35f); // Bonus Armor (35% of player armor) + SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(GetOwner()->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina) if (!HasAura(58877))//prevent apply twice for the 2 wolves AddAura(58877, this);//Spirit Hunt, passive, Spirit Wolves' attacks heal them and their master for 150% of damage done. break; } case 31216: // Mirror Image { - SetBonusDamage(int32(m_owner->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); - SetDisplayId(m_owner->GetDisplayId()); + SetBonusDamage(int32(GetOwner()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FROST) * 0.33f)); + SetDisplayId(GetOwner()->GetDisplayId()); if (!pInfo) { SetCreateMana(28 + 30*petlevel); @@ -1033,7 +1040,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetCreateMana(28 + 10*petlevel); SetCreateHealth(28 + 30*petlevel); } - SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f)); + SetBonusDamage(int32(GetOwner()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.5f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4))); break; @@ -1041,7 +1048,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) case 28017: // Bloodworms { SetCreateHealth(4 * petlevel); - SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f)); + SetBonusDamage(int32(GetOwner()->GetTotalAttackPowerValue(BASE_ATTACK) * 0.006f)); SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - 30 - (petlevel / 4))); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel - 30 + (petlevel / 4))); } diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 49d210fca2..bed7d9642a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -12113,14 +12113,8 @@ void Player::RemoveAmmo() UpdateDamagePhysical(RANGED_ATTACK); } -Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId) -{ - AllowedLooterSet allowedLooters; - return StoreNewItem(dest, item, update, randomPropertyId, allowedLooters); -} - // Return stored item (if stored to stack, it can diff. from pItem). And pItem ca be deleted in this case. -Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet& allowedLooters) +Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet const& allowedLooters) { uint32 count = 0; for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr) @@ -12241,7 +12235,6 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool AddEnchantmentDurations(pItem); AddItemDurations(pItem); - const ItemTemplate* proto = pItem->GetTemplate(); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) if (proto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE && proto->Spells[i].SpellId > 0) // On obtain trigger @@ -16172,6 +16165,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) { uint16 addkillcount = 1; uint32 real_entry = entry; + Creature* killed = NULL; if (guid) { Creature* killed = GetMap()->GetCreature(guid); @@ -16180,7 +16174,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) } StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_CREATURE, real_entry); // MUST BE CALLED FIRST - UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, guid ? GetMap()->GetCreature(guid) : NULL); + UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, real_entry, addkillcount, killed); for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i) { @@ -26013,7 +26007,7 @@ void Player::RefundItem(Item* item) { ItemPosCountVec dest; InventoryResult msg = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemid, count); - ASSERT(msg == EQUIP_ERR_OK) /// Already checked before + ASSERT(msg == EQUIP_ERR_OK); /// Already checked before Item* it = StoreNewItem(dest, itemid, true); SendNewItem(it, count, true, false, true); } diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 6458de4737..1c0fa4ea93 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -907,13 +907,13 @@ class PlayerTaxi bool IsTaximaskNodeKnown(uint32 nodeidx) const { uint8 field = uint8((nodeidx - 1) / 32); - uint32 submask = 1<<((nodeidx-1)%32); + uint32 submask = 1 << ((nodeidx-1) % 32); return (m_taximask[field] & submask) == submask; } bool SetTaximaskNode(uint32 nodeidx) { uint8 field = uint8((nodeidx - 1) / 32); - uint32 submask = 1<<((nodeidx-1)%32); + uint32 submask = 1 << ((nodeidx-1) % 32); if ((m_taximask[field] & submask) != submask) { m_taximask[field] |= submask; @@ -1022,7 +1022,7 @@ class TradeData uint32 m_spell; // m_player apply spell to non-traded slot item uint64 m_spellCastItem; // applied spell casted by item use - uint64 m_items[TRADE_SLOT_COUNT]; // traded itmes from m_player side including non-traded slot + uint64 m_items[TRADE_SLOT_COUNT]; // traded items from m_player side including non-traded slot }; class KillRewarder @@ -1235,8 +1235,7 @@ class Player : public Unit, public GridObject InventoryResult CanUseItem(ItemTemplate const* pItem) const; InventoryResult CanUseAmmo(uint32 item) const; InventoryResult CanRollForItemInLFG(ItemTemplate const* item, WorldObject const* lootedObject) const; - Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0); - Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId, AllowedLooterSet &allowedLooters); + Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0, AllowedLooterSet const& allowedLooters = AllowedLooterSet()); Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update); Item* EquipNewItem(uint16 pos, uint32 item, bool update); Item* EquipItem(uint16 pos, Item* pItem, bool update); @@ -2665,4 +2664,5 @@ template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas basevalue = T((float)basevalue + diff); return T(diff); } + #endif diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index 6f5927492b..2b053995e1 100644 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -27,15 +27,8 @@ #include "Util.h" #include "AccountMgr.h" -PlayerSocial::PlayerSocial() -{ - m_playerGUID = 0; -} - -PlayerSocial::~PlayerSocial() -{ - m_playerSocialMap.clear(); -} +PlayerSocial::PlayerSocial(): m_playerGUID() +{ } uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag) { diff --git a/src/server/game/Entities/Player/SocialMgr.h b/src/server/game/Entities/Player/SocialMgr.h index 0e73af8f80..4f2a4fdde7 100644 --- a/src/server/game/Entities/Player/SocialMgr.h +++ b/src/server/game/Entities/Player/SocialMgr.h @@ -104,7 +104,6 @@ class PlayerSocial friend class SocialMgr; public: PlayerSocial(); - ~PlayerSocial(); // adding/removing bool AddToSocialList(uint32 friend_guid, bool ignore); void RemoveFromSocialList(uint32 friend_guid, bool ignore); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4896f29d20..c972f97788 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -127,14 +127,32 @@ enum SpellValueMod SPELLVALUE_AURA_STACK }; -typedef std::pair CustomSpellValueMod; -class CustomSpellValues : public std::vector +class CustomSpellValues { - public: - void AddSpellMod(SpellValueMod mod, int32 value) - { - push_back(std::make_pair(mod, value)); - } + typedef std::pair CustomSpellValueMod; + typedef std::vector StorageType; + +public: + typedef StorageType::const_iterator const_iterator; + +public: + void AddSpellMod(SpellValueMod mod, int32 value) + { + storage_.push_back(CustomSpellValueMod(mod, value)); + } + + const_iterator begin() const + { + return storage_.begin(); + } + + const_iterator end() const + { + return storage_.end(); + } + +private: + StorageType storage_; }; enum SpellFacingFlags @@ -1411,10 +1429,13 @@ class Unit : public WorldObject void ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL); void ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage, SpellInfo const* procAura = NULL); - void GetProcAurasTriggeredOnEvent(std::list& aurasTriggeringProc, std::list* procAuras, ProcEventInfo eventInfo); + void GetProcAurasTriggeredOnEvent(AuraApplicationList& aurasTriggeringProc, AuraApplicationList* procAuras, ProcEventInfo eventInfo); void TriggerAurasProcOnEvent(CalcDamageInfo& damageInfo); - void TriggerAurasProcOnEvent(std::list* myProcAuras, std::list* targetProcAuras, Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo); - void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list& procAuras); + void TriggerAurasProcOnEvent(AuraApplicationList* myProcAuras, AuraApplicationList* targetProcAuras, + Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, + uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, + DamageInfo* damageInfo, HealInfo* healInfo); + void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationList& procAuras); void HandleEmoteCommand(uint32 anim_id); void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index 685ac9029e..9141f77b85 100644 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -205,7 +205,7 @@ void GameEventMgr::LoadFromDB() { { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 6 7 + // 0 1 2 3 4 5 6 7 QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event"); if (!result) { @@ -792,7 +792,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - // 0 1 2 3 4 5 + // 0 1 2 3 4 5 QueryResult result = WorldDatabase.Query("SELECT eventEntry, guid, item, maxcount, incrtime, ExtendedCost FROM game_event_npc_vendor ORDER BY guid, slot ASC"); if (!result) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 0ea66a056f..08075235ba 100644 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -47,6 +47,35 @@ ObjectAccessor::~ObjectAccessor() { } +template T* ObjectAccessor::GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, T* /*fake*/) +{ + T* obj = HashMapHolder::Find(guid); + if (!obj || obj->GetMapId() != mapid) + return NULL; + + CellCoord p = Trinity::ComputeCellCoord(x, y); + if (!p.IsCoordValid()) + { + sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord); + return NULL; + } + + CellCoord q = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); + if (!q.IsCoordValid()) + { + sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord); + return NULL; + } + + int32 dx = int32(p.x_coord) - int32(q.x_coord); + int32 dy = int32(p.y_coord) - int32(q.y_coord); + + if (dx > -2 && dx < 2 && dy > -2 && dy < 2) + return obj; + else + return NULL; +} + Player* ObjectAccessor::GetObjectInWorld(uint64 guid, Player* /*typeSpecifier*/) { Player* player = HashMapHolder::Find(guid); diff --git a/src/server/game/Globals/ObjectAccessor.h b/src/server/game/Globals/ObjectAccessor.h index 6a53d58c57..1abe355072 100644 --- a/src/server/game/Globals/ObjectAccessor.h +++ b/src/server/game/Globals/ObjectAccessor.h @@ -138,34 +138,7 @@ class ObjectAccessor return NULL; } - template static T* GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, T* /*fake*/) - { - T* obj = HashMapHolder::Find(guid); - if (!obj || obj->GetMapId() != mapid) - return NULL; - - CellCoord p = Trinity::ComputeCellCoord(x, y); - if (!p.IsCoordValid()) - { - sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord); - return NULL; - } - - CellCoord q = Trinity::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY()); - if (!q.IsCoordValid()) - { - sLog->outError(LOG_FILTER_GENERAL, "ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord); - return NULL; - } - - int32 dx = int32(p.x_coord) - int32(q.x_coord); - int32 dy = int32(p.y_coord) - int32(q.y_coord); - - if (dx > -2 && dx < 2 && dy > -2 && dy < 2) - return obj; - else - return NULL; - } + template static T* GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, T* /*fake*/); // these functions return objects only if in map of specified object static WorldObject* GetWorldObject(WorldObject const&, uint64); diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 14c0588c3b..ad48e4fd12 100644 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -85,13 +85,11 @@ template struct CoordPair { CoordPair(uint32 x=0, uint32 y=0) - : x_coord(x) - , y_coord(y) + : x_coord(x), y_coord(y) {} CoordPair(const CoordPair &obj) - : x_coord(obj.x_coord) - , y_coord(obj.y_coord) + : x_coord(obj.x_coord), y_coord(obj.y_coord) {} CoordPair & operator=(const CoordPair &obj) diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h index f64c54c8c4..65cdd3a603 100644 --- a/src/server/game/Grids/NGrid.h +++ b/src/server/game/Grids/NGrid.h @@ -78,15 +78,10 @@ class NGrid { public: typedef Grid GridType; - NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) - : i_gridId(id) - , i_GridInfo(GridInfo(expiry, unload)) - , i_x(x) - , i_y(y) - , i_cellstate(GRID_STATE_INVALID) - , i_GridObjectDataLoaded(false) - { - } + NGrid(uint32 id, int32 x, int32 y, time_t expiry, bool unload = true) : + i_gridId(id), i_GridInfo(GridInfo(expiry, unload)), i_x(x), i_y(y), + i_cellstate(GRID_STATE_INVALID), i_GridObjectDataLoaded(false) + { } GridType& GetGridType(const uint32 x, const uint32 y) { diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index fe06c172e3..8df65364b8 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1336,8 +1336,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) item->is_looted = true; roll->getLoot()->NotifyItemRemoved(roll->itemSlot); roll->getLoot()->unlootedCount--; - AllowedLooterSet looters = item->GetAllowedLooters(); - player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters); + player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, item->GetAllowedLooters()); } else { @@ -1389,8 +1388,7 @@ void Group::CountTheRoll(Rolls::iterator rollI) item->is_looted = true; roll->getLoot()->NotifyItemRemoved(roll->itemSlot); roll->getLoot()->unlootedCount--; - AllowedLooterSet looters = item->GetAllowedLooters(); - player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters); + player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, item->GetAllowedLooters()); } else { @@ -2126,7 +2124,7 @@ void Group::SetLfgRoles(uint64 guid, const uint8 roles) return; slot->roles = roles; - SendUpdate(); + SendUpdate(); } bool Group::IsFull() const @@ -2174,7 +2172,7 @@ uint32 Group::GetLowGUID() const return GUID_LOPART(m_guid); } -const char * Group::GetLeaderName() const +char const* Group::GetLeaderName() const { return m_leaderName.c_str(); } diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index c4967e4662..498abbdc59 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -51,14 +51,13 @@ InstanceSaveManager::~InstanceSaveManager() ++next; (*itr2)->UnbindInstance(save->GetMapId(), save->GetDifficulty(), true); } - save->m_playerList.clear(); for (InstanceSave::GroupListType::iterator itr2 = save->m_groupList.begin(), next = itr2; itr2 != save->m_groupList.end(); itr2 = next) { ++next; (*itr2)->UnbindInstance(save->GetMapId(), save->GetDifficulty(), true); } - save->m_groupList.clear(); + delete save; } } diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index bfd9bd6264..0b4c32500e 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -403,6 +403,8 @@ void InstanceScript::SendEncounterUnit(uint32 type, Unit* unit /*= NULL*/, uint8 case ENCOUNTER_FRAME_ENGAGE: case ENCOUNTER_FRAME_DISENGAGE: case ENCOUNTER_FRAME_UPDATE_PRIORITY: + if (!unit) + return; data.append(unit->GetPackGUID()); data << uint8(param1); break; diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index da219c66b9..fcef203738 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -861,17 +861,16 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) { if (lv.permission == NONE_PERMISSION) { - b << uint32(0); //gold + b << uint32(0); // gold b << uint8(0); // item count - return b; // nothing output more + return b; } Loot &l = lv.loot; uint8 itemsShown = 0; - //gold - b << uint32(l.gold); + b << uint32(l.gold); //gold size_t count_pos = b.wpos(); // pos of item count byte b << uint8(0); // item count placeholder @@ -954,7 +953,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) break; } default: - return b; // nothing output more + return b; } LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT; @@ -1226,15 +1225,11 @@ void LootTemplate::LootGroup::CheckLootRefs(LootTemplateMap const& /*store*/, Lo LootTemplate::~LootTemplate() { - while (!Entries.empty()) - { - delete Entries.back(); - Entries.pop_back(); - } + for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i) + delete *i; for (size_t i = 0; i < Groups.size(); ++i) delete Groups[i]; - Groups.clear(); } // Adds an entry to the group (at loading stage) diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index 5c858a3524..d338f6f503 100644 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -100,7 +100,6 @@ enum LootSlotType class Player; class LootStore; -class ConditionMgr; struct LootStoreItem { diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index c2079c22e7..62fec9e4b2 100644 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -29,8 +29,6 @@ MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL) { - // initialize instanced maps list - m_InstancedMaps.clear(); // fill with zero memset(&GridMapReference, 0, MAX_NUMBER_OF_GRIDS*MAX_NUMBER_OF_GRIDS*sizeof(uint16)); } diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index 76876044bb..09e09a8014 100644 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -104,21 +104,6 @@ class MapManager return IsValidMapCoord(loc.GetMapId(), loc.GetPositionX(), loc.GetPositionY(), loc.GetPositionZ(), loc.GetOrientation()); } - // modulos a radian orientation to the range of 0..2PI - static float NormalizeOrientation(float o) - { - // fmod only supports positive numbers. Thus we have - // to emulate negative numbers - if (o < 0) - { - float mod = o *-1; - mod = fmod(mod, 2.0f * static_cast(M_PI)); - mod = -mod + 2.0f * static_cast(M_PI); - return mod; - } - return fmod(o, 2.0f * static_cast(M_PI)); - } - void DoDelayedMovesAndRemoves(); void LoadTransports(); diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index bd35154825..73832a632c 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -23,7 +23,6 @@ #include "SpellInfo.h" #include "Unit.h" -class Unit; class SpellInfo; struct SpellModifier; struct ProcTriggerSpell; @@ -153,7 +152,15 @@ class Aura bool IsArea() const; bool IsPassive() const; bool IsDeathPersistent() const; - bool IsRemovedOnShapeLost(Unit* target) const { return (GetCasterGUID() == target->GetGUID() && m_spellInfo->Stances && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT) && !(m_spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT)); } + + bool IsRemovedOnShapeLost(Unit* target) const + { + return GetCasterGUID() == target->GetGUID() + && m_spellInfo->Stances + && !(m_spellInfo->AttributesEx2 & SPELL_ATTR2_NOT_NEED_SHAPESHIFT) + && !(m_spellInfo->Attributes & SPELL_ATTR0_NOT_SHAPESHIFT); + } + bool CanBeSaved() const; bool IsRemoved() const { return m_isRemoved; } bool CanBeSentToClient() const; @@ -166,7 +173,7 @@ class Aura void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, int32 * amount); // helpers for aura effects - bool HasEffect(uint8 effIndex) const { return bool(GetEffect(effIndex)); } + bool HasEffect(uint8 effIndex) const { return GetEffect(effIndex) != NULL; } bool HasEffectType(AuraType type) const; AuraEffect* GetEffect(uint8 effIndex) const { ASSERT (effIndex < MAX_SPELL_EFFECTS); return m_effects[effIndex]; } uint8 GetEffectMask() const { uint8 effMask = 0; for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (m_effects[i]) effMask |= 1< & applicationList) const; + void GetApplicationList(Unit::AuraApplicationList& applicationList) const; const AuraApplication * GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; } AuraApplication * GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; } bool IsAppliedOnTarget(uint64 guid) const { return m_applications.find(guid) != m_applications.end(); } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 47ce299c05..191a7461fe 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -456,7 +456,7 @@ class Spell void SetAutoRepeat(bool rep) { m_autoRepeat = rep; } void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; } bool IsNextMeleeSwingSpell() const; - bool IsTriggered() const { return _triggeredCastFlags & TRIGGERED_FULL_MASK; }; + bool IsTriggered() const { return _triggeredCastFlags & TRIGGERED_FULL_MASK; } bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; } bool IsAutoActionResetSpell() const; @@ -491,7 +491,7 @@ class Spell Unit* const m_caster; - SpellValue * const m_spellValue; + SpellValue* const m_spellValue; uint64 m_originalCasterGUID; // real source of cast (aura caster/etc), used for spell targets selection // e.g. damage around area spell trigered by victim aura and damage enemies of aura caster diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 48bc162c82..c36815b49f 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -1020,7 +1020,7 @@ class npc_meteor_strike_initial : public CreatureScript _meteorList.clear(); for (uint8 i = 0; i < 4; i++) { - angle[i] = MapManager::NormalizeOrientation(angle[i]); + angle[i] = Position::NormalizeOrientation(angle[i]); me->SetOrientation(angle[i]); me->GetNearPosition(newPos, 10.0f, 0.0f); // Exact distance if (Creature* meteor = me->SummonCreature(NPC_METEOR_STRIKE_NORTH + i, newPos, TEMPSUMMON_TIMED_DESPAWN, 30000)) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 7e72ad00a3..7d508b154e 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -19,7 +19,6 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellAuras.h" -#include "MapManager.h" #include "MoveSplineInit.h" #include "Player.h" #include "icecrown_citadel.h" @@ -372,7 +371,7 @@ class npc_coldflame : public CreatureScript if (owner->HasAura(SPELL_BONE_STORM)) { - float ang = MapManager::NormalizeOrientation(pos.GetAngle(me)); + float ang = Position::NormalizeOrientation(pos.GetAngle(me)); me->SetOrientation(ang); owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 5.0f - owner->GetObjectSize(), ang); } @@ -385,7 +384,7 @@ class npc_coldflame : public CreatureScript return; } - float ang = MapManager::NormalizeOrientation(pos.GetAngle(target)); + float ang = Position::NormalizeOrientation(pos.GetAngle(target)); me->SetOrientation(ang); owner->GetNearPoint2D(pos.m_positionX, pos.m_positionY, 15.0f - owner->GetObjectSize(), ang); } diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp index a2b5d34041..111e6b2c7a 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_varos.cpp @@ -20,7 +20,6 @@ #include "SpellScript.h" #include "SpellAuraEffects.h" #include "oculus.h" -#include "MapManager.h" enum Says { @@ -121,7 +120,7 @@ public: coreEnergizeOrientation = me->GetOrientation(); firstCoreEnergize = true; } else - coreEnergizeOrientation = MapManager::NormalizeOrientation(coreEnergizeOrientation - 2.0f); + coreEnergizeOrientation = Position::NormalizeOrientation(coreEnergizeOrientation - 2.0f); DoCast(me, SPELL_ENERGIZE_CORES_VISUAL); events.ScheduleEvent(EVENT_ENERGIZE_CORES_VISUAL, 5000); diff --git a/src/server/shared/CMakeLists.txt b/src/server/shared/CMakeLists.txt index 01ccf648b3..447819b043 100644 --- a/src/server/shared/CMakeLists.txt +++ b/src/server/shared/CMakeLists.txt @@ -16,6 +16,7 @@ file(GLOB_RECURSE sources_Configuration Configuration/*.cpp Configuration/*.h) file(GLOB_RECURSE sources_Cryptography Cryptography/*.cpp Cryptography/*.h) file(GLOB_RECURSE sources_Database Database/*.cpp Database/*.h) file(GLOB_RECURSE sources_DataStores DataStores/*.cpp DataStores/*.h) +file(GLOB_RECURSE sources_Debugging Debugging/*.cpp Debugging/*.h) file(GLOB_RECURSE sources_Dynamic Dynamic/*.cpp Dynamic/*.h) file(GLOB_RECURSE sources_Logging Logging/*.cpp Logging/*.h) file(GLOB_RECURSE sources_Packets Packets/*.cpp Packets/*.h) @@ -39,13 +40,13 @@ set(shared_STAT_SRCS ${sources_Cryptography} ${sources_Database} ${sources_DataStores} + ${sources_Debugging} ${sources_Dynamic} ${sources_Logging} ${sources_Packets} ${sources_Threading} ${sources_Utilities} ${sources_localdir} - Debugging/Errors.h ) include_directories( diff --git a/src/server/shared/Containers.h b/src/server/shared/Containers.h index 83c691a99e..b33954d7ea 100644 --- a/src/server/shared/Containers.h +++ b/src/server/shared/Containers.h @@ -18,6 +18,7 @@ #ifndef TRINITY_CONTAINERS_H #define TRINITY_CONTAINERS_H +#include "Define.h" #include //! Because circular includes are bad diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp index 0f68fcb6c3..003c09e458 100644 --- a/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp +++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.cpp @@ -20,15 +20,10 @@ #include "Cryptography/HMACSHA1.h" #include "Cryptography/BigNumber.h" -AuthCrypt::AuthCrypt() : _clientDecrypt(SHA_DIGEST_LENGTH), _serverEncrypt(SHA_DIGEST_LENGTH) - , _initialized(false) -{ -} - -AuthCrypt::~AuthCrypt() -{ - -} +AuthCrypt::AuthCrypt() : + _clientDecrypt(SHA_DIGEST_LENGTH), _serverEncrypt(SHA_DIGEST_LENGTH), + _initialized(false) +{ } void AuthCrypt::Init(BigNumber* K) { diff --git a/src/server/shared/Cryptography/Authentication/AuthCrypt.h b/src/server/shared/Cryptography/Authentication/AuthCrypt.h index 200681afd0..95e773b586 100644 --- a/src/server/shared/Cryptography/Authentication/AuthCrypt.h +++ b/src/server/shared/Cryptography/Authentication/AuthCrypt.h @@ -27,7 +27,6 @@ class AuthCrypt { public: AuthCrypt(); - ~AuthCrypt(); void Init(BigNumber* K); void DecryptRecv(uint8 *, size_t); diff --git a/src/server/shared/Cryptography/BigNumber.cpp b/src/server/shared/Cryptography/BigNumber.cpp index 37778cceab..06ea57b662 100644 --- a/src/server/shared/Cryptography/BigNumber.cpp +++ b/src/server/shared/Cryptography/BigNumber.cpp @@ -24,18 +24,15 @@ #include BigNumber::BigNumber() - : _bn(BN_new()) - , _array(NULL) + : _bn(BN_new()), _array(NULL) { } BigNumber::BigNumber(BigNumber const& bn) - : _bn(BN_dup(bn._bn)) - , _array(NULL) + : _bn(BN_dup(bn._bn)), _array(NULL) { } BigNumber::BigNumber(uint32 val) - : _bn(BN_new()) - , _array(NULL) + : _bn(BN_new()), _array(NULL) { BN_set_word(_bn, val); } diff --git a/src/server/shared/Cryptography/HMACSHA1.cpp b/src/server/shared/Cryptography/HMACSHA1.cpp index ab50eb9981..297b4e9031 100644 --- a/src/server/shared/Cryptography/HMACSHA1.cpp +++ b/src/server/shared/Cryptography/HMACSHA1.cpp @@ -40,7 +40,7 @@ void HmacHash::Finalize() { uint32 length = 0; HMAC_Final(&m_ctx, (uint8*)m_digest, &length); - ASSERT(length == SHA_DIGEST_LENGTH) + ASSERT(length == SHA_DIGEST_LENGTH); } uint8 *HmacHash::ComputeHash(BigNumber* bn) diff --git a/src/server/shared/Database/DatabaseWorkerPool.h b/src/server/shared/Database/DatabaseWorkerPool.h index 524a3de262..a197610c6b 100644 --- a/src/server/shared/Database/DatabaseWorkerPool.h +++ b/src/server/shared/Database/DatabaseWorkerPool.h @@ -55,8 +55,8 @@ class DatabaseWorkerPool memset(_connectionCount, 0, sizeof(_connectionCount)); _connections.resize(IDX_SIZE); - WPFatal (mysql_thread_safe(), "Used MySQL library isn't thread-safe."); - WPFatal (mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION, "TrinityCore does not support MySQL versions below 5.1"); + WPFatal(mysql_thread_safe(), "Used MySQL library isn't thread-safe."); + WPFatal(mysql_get_client_version() >= MIN_MYSQL_CLIENT_VERSION, "TrinityCore does not support MySQL versions below 5.1"); } ~DatabaseWorkerPool() diff --git a/src/server/shared/Debugging/Errors.cpp b/src/server/shared/Debugging/Errors.cpp new file mode 100644 index 0000000000..bd299906de --- /dev/null +++ b/src/server/shared/Debugging/Errors.cpp @@ -0,0 +1,38 @@ +#include "Errors.h" +#include "Log.h" + +#include +#include + +namespace Trinity { + +void Assert(char const *file, int line, char const *function, char const *message) +{ + ACE_Stack_Trace st; + fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", + file, line, function, message, st.c_str()); + *((volatile int*)NULL) = 0; +} + +void Fatal(char const *file, int line, char const *function, char const *message) +{ + sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s FATAL ERROR:\n %s\n", + file, line, function, message); + ACE_OS::sleep(10); + *((volatile int*)NULL) = 0; +} + +void Error(char const *file, int line, char const *function, char const *message) +{ + sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s ERROR:\n %s\n", + file, line, function, message); + *((volatile int*)NULL) = 0; +} + +void Warning(char const *file, int line, char const *function, char const *message) +{ + sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s WARNING:\n %s\n", + file, line, function, message); +} + +} // namespace Trinity diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h index 10e94634e9..554b20c364 100644 --- a/src/server/shared/Debugging/Errors.h +++ b/src/server/shared/Debugging/Errors.h @@ -19,15 +19,23 @@ #ifndef TRINITYCORE_ERRORS_H #define TRINITYCORE_ERRORS_H -#include "Common.h" -#include "Log.h" -#include -#include +namespace Trinity { -#define WPAssert(assertion) { if (!(assertion)) { ACE_Stack_Trace st; fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n", __FILE__, __LINE__, __FUNCTION__, #assertion, st.c_str()); *((volatile int*)NULL) = 0; } } -#define WPError(assertion, errmsg) { if (!(assertion)) { sLog->outError(LOG_FILTER_GENERAL, "%\n%s:%i in %s ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); *((volatile int*)NULL) = 0; } } -#define WPWarning(assertion, errmsg) { if (!(assertion)) { sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s WARNING:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); } } -#define WPFatal(assertion, errmsg) { if (!(assertion)) { sLog->outError(LOG_FILTER_GENERAL, "\n%s:%i in %s FATAL ERROR:\n %s\n", __FILE__, __LINE__, __FUNCTION__, (char *)errmsg); ACE_OS::sleep(10); *((volatile int*)NULL) = 0; } } +void Assert(char const *file, int line, char const *function, char const *message); + +void Fatal(char const *file, int line, char const *function, char const *message); + +void Error(char const *file, int line, char const *function, char const *message); + +void Warning(char const *file, int line, char const *function, char const *message); + +} // namespace Trinity + +#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while(0) +#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) +#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) +#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) #define ASSERT WPAssert + #endif diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp index d07e579ab5..d4bd630ca2 100644 --- a/src/server/shared/Debugging/WheatyExceptionReport.cpp +++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp @@ -3,6 +3,8 @@ // MSDN Magazine, 2002 // FILE: WheatyExceptionReport.CPP //========================================== +#include "CompilerDefs.h" + #if PLATFORM == PLATFORM_WINDOWS && !defined(__MINGW32__) #define WIN32_LEAN_AND_MEAN #pragma warning(disable:4996) diff --git a/src/server/shared/Logging/Appender.cpp b/src/server/shared/Logging/Appender.cpp index efb141d106..cde94fe3a7 100644 --- a/src/server/shared/Logging/Appender.cpp +++ b/src/server/shared/Logging/Appender.cpp @@ -218,6 +218,8 @@ char const* Appender::getLogFilterTypeString(LogFilterType type) return "SOAP"; case LOG_FILTER_RBAC: return "RBAC"; + case LOG_FILTER_CHEAT: + return "CHEAT"; default: break; } diff --git a/src/server/shared/Logging/Appender.h b/src/server/shared/Logging/Appender.h index e11bc40c42..983f6a5ddb 100644 --- a/src/server/shared/Logging/Appender.h +++ b/src/server/shared/Logging/Appender.h @@ -68,10 +68,11 @@ enum LogFilterType LOG_FILTER_SERVER_LOADING = 40, LOG_FILTER_OPCODES = 41, LOG_FILTER_SOAP = 42, - LOG_FILTER_RBAC = 43 + LOG_FILTER_RBAC = 43, + LOG_FILTER_CHEAT = 44 }; -const uint8 MaxLogFilter = 43; +const uint8 MaxLogFilter = 45; // Values assigned have their equivalent in enum ACE_Log_Priority enum LogLevel @@ -108,12 +109,8 @@ enum AppenderFlags struct LogMessage { LogMessage(LogLevel _level, LogFilterType _type, std::string _text) - : level(_level) - , type(_type) - , text(_text) - { - mtime = time(NULL); - } + : level(_level), type(_type), text(_text), mtime(time(NULL)) + { } static std::string getTimeStr(time_t time); std::string getTimeStr(); diff --git a/src/server/shared/Logging/LogOperation.h b/src/server/shared/Logging/LogOperation.h index 0a0dde3bb6..40017cb87f 100644 --- a/src/server/shared/Logging/LogOperation.h +++ b/src/server/shared/Logging/LogOperation.h @@ -25,8 +25,7 @@ class LogOperation { public: LogOperation(Logger* _logger, LogMessage* _msg) - : logger(_logger) - , msg(_msg) + : logger(_logger), msg(_msg) { } ~LogOperation(); diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp new file mode 100644 index 0000000000..a14cf3477a --- /dev/null +++ b/src/server/shared/Packets/ByteBuffer.cpp @@ -0,0 +1,95 @@ +#include "ByteBuffer.h" +#include "Log.h" + +#include +#include + +ByteBufferPositionException::ByteBufferPositionException(bool add, size_t pos, + size_t size, size_t valueSize) +{ + std::ostringstream ss; + ACE_Stack_Trace trace; + + ss << "Attempted to " << (add ? "put" : "get") << " value with size: " + << valueSize << " in ByteBuffer (pos: " << pos << " size: " << size + << ")\n\n" << trace.c_str(); + + message().assign(ss.str()); +} + +ByteBufferSourceException::ByteBufferSourceException(size_t pos, size_t size, + size_t valueSize) +{ + std::ostringstream ss; + ACE_Stack_Trace trace; + + ss << "Attempted to put a " + << (valueSize > 0 ? "NULL-pointer" : "zero-sized value") + << " in ByteBuffer (pos: " << pos << " size: " << size << ")\n\n" + << trace.c_str(); + + message().assign(ss.str()); +} + +void ByteBuffer::print_storage() const +{ + if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled trace output + return; + + std::ostringstream o; + o << "STORAGE_SIZE: " << size(); + for (uint32 i = 0; i < size(); ++i) + o << read(i) << " - "; + o << " "; + + sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str()); +} + +void ByteBuffer::textlike() const +{ + if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled trace output + return; + + std::ostringstream o; + o << "STORAGE_SIZE: " << size(); + for (uint32 i = 0; i < size(); ++i) + { + char buf[1]; + snprintf(buf, 1, "%c", read(i)); + o << buf; + } + o << " "; + sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str()); +} + +void ByteBuffer::hexlike() const +{ + if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled trace output + return; + + uint32 j = 1, k = 1; + + std::ostringstream o; + o << "STORAGE_SIZE: " << size(); + + for (uint32 i = 0; i < size(); ++i) + { + char buf[3]; + snprintf(buf, 1, "%2X ", read(i)); + if ((i == (j * 8)) && ((i != (k * 16)))) + { + o << "| "; + ++j; + } + else if (i == (k * 16)) + { + o << "\n"; + ++k; + ++j; + } + + o << buf; + } + o << " "; + sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str()); +} diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index ceab4ca442..9b16c2e9c0 100644 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -19,64 +19,47 @@ #ifndef _BYTEBUFFER_H #define _BYTEBUFFER_H -#include "Common.h" +#include "Define.h" #include "Debugging/Errors.h" -#include "Logging/Log.h" #include "Utilities/ByteConverter.h" -class ByteBufferException -{ - public: - ByteBufferException(size_t pos, size_t size, size_t valueSize) - : Pos(pos), Size(size), ValueSize(valueSize) - { - } +#include +#include +#include +#include +#include - protected: - size_t Pos; - size_t Size; - size_t ValueSize; +#include + +// Root of ByteBuffer exception hierarchy +class ByteBufferException : public std::exception +{ +public: + ~ByteBufferException() throw() { } + + char const * what() const throw() { return msg_.c_str(); } + +protected: + std::string & message() throw() { return msg_; } + +private: + std::string msg_; }; class ByteBufferPositionException : public ByteBufferException { - public: - ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize) - : ByteBufferException(pos, size, valueSize), _add(add) - { - PrintError(); - } +public: + ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize); - protected: - void PrintError() const - { - ACE_Stack_Trace trace; - - sLog->outError(LOG_FILTER_NETWORKIO, "Attempted to %s value with size: "SIZEFMTD" in ByteBuffer (pos: " SIZEFMTD " size: "SIZEFMTD")\n[Stacktrace: %s]", - (_add ? "put" : "get"), ValueSize, Pos, Size, trace.c_str()); - } - - private: - bool _add; + ~ByteBufferPositionException() throw() { } }; class ByteBufferSourceException : public ByteBufferException { - public: - ByteBufferSourceException(size_t pos, size_t size, size_t valueSize) - : ByteBufferException(pos, size, valueSize) - { - PrintError(); - } +public: + ByteBufferSourceException(size_t pos, size_t size, size_t valueSize); - protected: - void PrintError() const - { - ACE_Stack_Trace trace; - - sLog->outError(LOG_FILTER_NETWORKIO, "Attempted to put a %s in ByteBuffer (pos: "SIZEFMTD" size: "SIZEFMTD")\n[Stacktrace: %s]", - (ValueSize > 0 ? "NULL-pointer" : "zero-sized value"), Pos, Size, trace.c_str()); - } + ~ByteBufferSourceException() throw() { } }; class ByteBuffer @@ -85,19 +68,21 @@ class ByteBuffer const static size_t DEFAULT_SIZE = 0x1000; // constructor - ByteBuffer(): _rpos(0), _wpos(0) + ByteBuffer() : _rpos(0), _wpos(0) { _storage.reserve(DEFAULT_SIZE); } - // constructor - ByteBuffer(size_t res): _rpos(0), _wpos(0) + ByteBuffer(size_t reserve) : _rpos(0), _wpos(0) { - _storage.reserve(res); + _storage.reserve(reserve); } // copy constructor - ByteBuffer(const ByteBuffer &buf): _rpos(buf._rpos), _wpos(buf._wpos), _storage(buf._storage) { } + ByteBuffer(const ByteBuffer &buf) : _rpos(buf._rpos), _wpos(buf._wpos), + _storage(buf._storage) + { + } void clear() { @@ -275,9 +260,18 @@ class ByteBuffer return *this; } - uint8 operator[](size_t pos) const + uint8& operator[](size_t const pos) { - return read(pos); + if (pos >= size()) + throw ByteBufferPositionException(false, pos, 1, size()); + return _storage[pos]; + } + + uint8 const& operator[](size_t const pos) const + { + if (pos >= size()) + throw ByteBufferPositionException(false, pos, 1, size()); + return _storage[pos]; } size_t rpos() const { return _rpos; } @@ -331,7 +325,7 @@ class ByteBuffer { if (_rpos + len > size()) throw ByteBufferPositionException(false, _rpos, len, size()); - memcpy(dest, &_storage[_rpos], len); + std::memcpy(dest, &_storage[_rpos], len); _rpos += len; } @@ -362,8 +356,7 @@ class ByteBuffer uint32 ReadPackedTime() { uint32 packedDate = read(); - tm lt; - memset(<, 0, sizeof(lt)); + tm lt = tm(); lt.tm_min = packedDate & 0x3F; lt.tm_hour = (packedDate >> 6) & 0x1F; @@ -423,7 +416,7 @@ class ByteBuffer if (_storage.size() < _wpos + cnt) _storage.resize(_wpos + cnt); - memcpy(&_storage[_wpos], src, cnt); + std::memcpy(&_storage[_wpos], src, cnt); _wpos += cnt; } @@ -476,71 +469,14 @@ class ByteBuffer if (!src) throw ByteBufferSourceException(_wpos, size(), cnt); - memcpy(&_storage[pos], src, cnt); + std::memcpy(&_storage[pos], src, cnt); } - void print_storage() const - { - if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled debug output - return; + void print_storage() const; - std::ostringstream o; - o << "STORAGE_SIZE: " << size(); - for (uint32 i = 0; i < size(); ++i) - o << read(i) << " - "; - o << " "; + void textlike() const; - sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str()); - } - - void textlike() const - { - if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled debug output - return; - - std::ostringstream o; - o << "STORAGE_SIZE: " << size(); - for (uint32 i = 0; i < size(); ++i) - { - char buf[1]; - snprintf(buf, 1, "%c", read(i)); - o << buf; - } - o << " "; - sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str()); - } - - void hexlike() const - { - if (!sLog->ShouldLog(LOG_FILTER_NETWORKIO, LOG_LEVEL_TRACE)) // optimize disabled debug output - return; - - uint32 j = 1, k = 1; - - std::ostringstream o; - o << "STORAGE_SIZE: " << size(); - - for (uint32 i = 0; i < size(); ++i) - { - char buf[3]; - snprintf(buf, 1, "%2X ", read(i)); - if ((i == (j * 8)) && ((i != (k * 16)))) - { - o << "| "; - ++j; - } - else if (i == (k * 16)) - { - o << "\n"; - ++k; - ++j; - } - - o << buf; - } - o << " "; - sLog->outTrace(LOG_FILTER_NETWORKIO, "%s", o.str().c_str()); - } + void hexlike() const; protected: size_t _rpos, _wpos; @@ -652,5 +588,6 @@ inline void ByteBuffer::read_skip() { read_skip(); } + #endif diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 0802aca43c..bf19240407 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -1123,7 +1123,7 @@ AccountInstancesPerHour = 5 # RBAC.DefaultGroups # Description: Comma separated list of groups to be added to any account # Check auth.rbac_groups for correct ids -# Default: "" (No group) +# Default: "" (No group) RBAC.DefaultGroups = "" @@ -2712,6 +2712,7 @@ Appenders=Console Server GM DBErrors Char RA Warden Chat # 41 - Opcodes (just id and name sent / received) # 42 - SOAP # 43 - RBAC (Role Based Access Control) +# 44 - Cheat (used to log cheat attempts) # # LogLevel # 0 - (Disabled)