From daaa54b6153a7e8d473eb1065798275c91c45776 Mon Sep 17 00:00:00 2001 From: Xyventh Date: Thu, 27 Apr 2017 21:11:49 +0200 Subject: [PATCH 01/51] DB/Creature: R-3D0 Missing event for NPC R-3D0 in Blade's Edge Mountains --- .../pending_db_world/rev_1493320243875599900.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493320243875599900.sql diff --git a/data/sql/updates/pending_db_world/rev_1493320243875599900.sql b/data/sql/updates/pending_db_world/rev_1493320243875599900.sql new file mode 100644 index 000000000..f1f54115b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493320243875599900.sql @@ -0,0 +1,15 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493320243875599900'); + +SET @R3D0 := 21690; + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@R3D0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@R3D0, @R3D0*100); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@R3D0, 0, 0, 0, 64, 0, 100, 0, 0, 0, 0, 0, 80, 2169000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Gossip Hello - Call Actionlist"), +(@R3D0*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 91, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Script - Remove Standstate Sleep"), +(@R3D0*100, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Script - Talk"), +(@R3D0*100, 9, 2, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 90, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "R-3D0 - On Gossip Hello - Set Standstate Sleep"); + +DELETE FROM `creature_text` WHERE `entry`=@R3D0; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(@R3D0, 0, 0, "WARNING! WARNING! AWAY HOSTILE BEINGS! DO NOT HEAD UP THE RIDGE TO TOSHLEY'S STATION!", 12, 0, 100, 35, 0, 0, 19311, 0, "R-3D0"); From eeb575adfc98d300a08b9e142e84707b3cee9bbb Mon Sep 17 00:00:00 2001 From: Xyventh Date: Thu, 27 Apr 2017 21:20:46 +0200 Subject: [PATCH 02/51] DB/Creature: Hargin Mundar Added the missing out of combat text --- .../pending_db_world/rev_1493320702119541800.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493320702119541800.sql diff --git a/data/sql/updates/pending_db_world/rev_1493320702119541800.sql b/data/sql/updates/pending_db_world/rev_1493320702119541800.sql new file mode 100644 index 000000000..22f1ad3a3 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493320702119541800.sql @@ -0,0 +1,15 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493320702119541800'); +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=1476; +DELETE FROM `smart_scripts` WHERE `entryorguid`=1476; +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 +(1476, 0, 0, 0, 1, 0, 100, 0, 5000, 30000, 300000, 600000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Hargin Mundar - Out Of Combat - Talk"), +(1476, 0, 1, 2, 1, 0, 100, 0, 35000, 45000, 300000, 600000, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Hargin Mundar - Out Of Combat - Talk"), +(1476, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 41995, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Hargin Mundar - Out Of Combat - Cast Vomit"); + +DELETE FROM `creature_text` WHERE `entry`=1476; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(1476, 0, 0, "Stormy seas out there. The sea spirits must be restless....hic!", 12, 6, 100, 0, 0, 0, 318, 0, "Hargin Mundar"), +(1476, 0, 1, "I saw a Sea Giant once. It's not something I would care to see again. Burp!", 12, 6, 100, 0, 0, 0, 319, 0, "Hargin Mundar"), +(1476, 0, 2, "I'd go out and clear out some of those gnolls, but this leg has seen better days and I am afraid I'd just wind up dead.", 12, 6, 100, 0, 0, 0, 320, 0, "Hargin Mundar"), +(1476, 0, 3, "Watch your step out there. Many an adventure seeker has not returned from the marsh. hic!", 12, 6, 100, 0, 0, 0, 321, 0, "Hargin Mundar"), +(1476, 1, 0, "Huuup...Huuup...Bleeeeehh!", 12, 0, 100, 0, 0, 0, 397, 0, "Hargin Mundar"); From 1fcc9d9d6387d81d37ed651095039017a8807c1a Mon Sep 17 00:00:00 2001 From: Xyventh Date: Thu, 27 Apr 2017 21:28:19 +0200 Subject: [PATCH 03/51] DB/Quest: The Prodigal Lich Returns Added event upon handing in quest --- .../rev_1493321166929502700.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493321166929502700.sql diff --git a/data/sql/updates/pending_db_world/rev_1493321166929502700.sql b/data/sql/updates/pending_db_world/rev_1493321166929502700.sql new file mode 100644 index 000000000..8d5cf95a6 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493321166929502700.sql @@ -0,0 +1,24 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493321166929502700'); +SET @BETHOR := 1498; +SET @GUNTHER := 5666; + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (@BETHOR, @GUNTHER); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@BETHOR, @BETHOR*100, @GUNTHER, @GUNTHER*100); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@BETHOR, 0, 0, 0, 20, 0, 100, 0, 411, 0, 0, 0, 80, @BETHOR*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Bethor Iceshard - On Quest 'The Prodigal Lich Returns' Rewarded - Run Script"), +(@BETHOR*100, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 7762, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Bethor Iceshard - On Script - Cast Summon Gunther's Visage"), +(@BETHOR*100, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 12, @GUNTHER, 1, 22000, 0, 0, 0, 8, 0, 0, 0, 1766.0415, 62.8454, -46.3213, 1.5910, "Bethor Iceshard - On Script - Summon Gunther's Visage"), +(@BETHOR*100, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Bethor Iceshard - On Script - Store Targetlist"), +(@BETHOR*100, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 100, 1, 0, 0, 0, 0, 0, 19, @GUNTHER, 0, 0, 0, 0, 0, 0, "Bethor Iceshard - On Script - Send Targetlist to Guther's Visage"), +(@GUNTHER, 0, 0, 0, 54, 0, 100, 0, 0, 0, 0, 0, 80, @GUNTHER*100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Gunther's Visage - On Just Summoned - Run Script"), +(@GUNTHER*100, 9, 0, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Gunther's Visage - On Script - Talk 0"), +(@GUNTHER*100, 9, 1, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Gunther's Visage - On Script - Talk 1"), +(@GUNTHER*100, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, "Gunther's Visage - On Script - Talk 2"), +(@GUNTHER*100, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 1498, 0, 0, 0, 0, 0, 0, "Gunther's Visage - On Script - Talk 0 (Bethor Iceshard)"); + +DELETE FROM `creature_text` WHERE `entry` IN (1498, 5666); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(@GUNTHER, 0, 0, "It has been a long time, Bethor, my friend.", 12, 0, 100, 1, 0, 0, 1973, 0, "Gunther's Visage"), +(@GUNTHER, 1, 0, "When time permits, we must speak at length. For we have much to discuss.", 12, 0, 100, 1, 0, 0, 1974, 0, "Gunther's Visage"), +(@GUNTHER, 2, 0, "And thank you, $n. Without your aid I may never have found my way to the Forsaken.", 12, 0, 100, 1, 0, 0, 1975, 0, "Gunther's Visage"), +(@BETHOR, 0, 0, "Farewell, my friend.", 12, 0, 100, 1, 0, 0, 1976, 0, "Bethor Iceshard"); From 7abf3f080fcb3517d7d3f8932d350ee326dd6077 Mon Sep 17 00:00:00 2001 From: Xyventh Date: Thu, 27 Apr 2017 21:31:39 +0200 Subject: [PATCH 04/51] =?UTF-8?q?DB:=20RP=20event=20for=20Dame=20Auriferou?= =?UTF-8?q?s,=20High=20Executor=20Mavren,=20Advisor=20Valwy=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ...n and Deathstalker Maltendis --- .../rev_1493321428049355400.sql | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493321428049355400.sql diff --git a/data/sql/updates/pending_db_world/rev_1493321428049355400.sql b/data/sql/updates/pending_db_world/rev_1493321428049355400.sql new file mode 100644 index 000000000..82721555c --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493321428049355400.sql @@ -0,0 +1,98 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493321428049355400'); +-- Tranquillien RP event +SET @AURIFEROUS :=16231; +SET @SCRIPT := 1623100; +SET @MALTENDIS :=16251; +SET @MAVREN := 16252; +SET @VALWYN := 16289; + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (@AURIFEROUS, @MAVREN, @VALWYN, @MALTENDIS); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@AURIFEROUS, @SCRIPT, @MAVREN, @VALWYN, @MALTENDIS); +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 +(@AURIFEROUS,0, 0, 0, 1, 0, 100, 0, 10000, 60000, 580000, 620000, 80, @SCRIPT, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Aureous - Out Of Combat - Run Script"), +(@SCRIPT, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Advisor Valwyn)"), +(@SCRIPT, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0"), +(@SCRIPT, 9, 2, 0, 0, 0, 100, 0, 60000, 70000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Face High Executor Mavren"), +(@SCRIPT, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1"), +(@SCRIPT, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (High Executor Mavren)"), +(@SCRIPT, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Deathstalker Maltendis)"), +(@SCRIPT, 9, 6, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Reset Orientation"), +(@SCRIPT, 9, 7, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (High Executor Mavren)"), +(@SCRIPT, 9, 8, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Advisor Valwyn)"), +(@SCRIPT, 9, 9, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (High Executor Mavren)"), +(@SCRIPT, 9, 10, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 2"), +(@SCRIPT, 9, 11, 0, 0, 0, 100, 0, 50000, 70000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Face High Executor Mavren"), +(@SCRIPT, 9, 12, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 3"), +(@SCRIPT, 9, 13, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (High Executor Mavren)"), +(@SCRIPT, 9, 14, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Deathstalker Maltendis)"), +(@SCRIPT, 9, 15, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Reset Orientation"), +(@SCRIPT, 9, 16, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (High Executor Mavren)"), +(@SCRIPT, 9, 17, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Advisor Valwyn)"), +(@SCRIPT, 9, 18, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (High Executor Mavren"), +(@SCRIPT, 9, 19, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 4"), +(@SCRIPT, 9, 20, 0, 0, 0, 100, 0, 50000, 70000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Face High Executor Mavren"), +(@SCRIPT, 9, 21, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 5"), +(@SCRIPT, 9, 22, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (High Executor Mavren)"), +(@SCRIPT, 9, 23, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 0 (Deathstalker Maltendis)"), +(@SCRIPT, 9, 24, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Reset Orientation"), +(@SCRIPT, 9, 25, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 2 (High Executor Mavren)"), +(@SCRIPT, 9, 26, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Advisor Valwyn)"), +(@SCRIPT, 9, 27, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MAVREN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (High Executor Mavren"), +(@SCRIPT, 9, 28, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 6"), +(@SCRIPT, 9, 29, 0, 0, 0, 100, 0, 150000, 190000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (Deathstalker Maltendis)"), +(@SCRIPT, 9, 30, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 1 (Deathstalker Maltendis)"), +(@SCRIPT, 9, 31, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 45, 1, 1, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 1 1 (Advisor Valwyn)"), +(@SCRIPT, 9, 32, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Talk 2 (Advisor Valwyn)"), +(@SCRIPT, 9, 33, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (Deathstalker Maltendis)"), +(@SCRIPT, 9, 34, 0, 0, 0, 100, 0, 8000, 8000, 0, 0, 45, 2, 2, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 2 2 (Advisor Valwyn)"), +(@SCRIPT, 9, 35, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 45, 3, 3, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Dame Auriferous - On Script - Set Data 3 3 (Deathstalker Maltendis)"), +(@VALWYN, 0, 0, 0, 38, 0, 100, 0, 1, 1, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 19, @MALTENDIS, 0, 0, 0, 0, 0, 0, "Advisor Valwyn - On Data 1 1 Set - Face Deathstalker Maltendis"), +(@VALWYN, 0, 1, 0, 38, 0, 100, 0, 2, 2, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Advisor Valwyn - On Data 2 2 Set - Reset Orientation"), +(@MAVREN, 0, 0, 0, 38, 0, 100, 0, 1, 1, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 19, 16231, 0, 0, 0, 0, 0, 0, "High Executor Mavren - On Data 1 1 Set - Face Dame Auriferious"), +(@MAVREN, 0, 1, 0, 38, 0, 100, 0, 2, 2, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "High Executor Mavren - On Data 2 2 Set - Reset Orientation"), +(@MALTENDIS, 0, 0, 0, 38, 0, 100, 0, 1, 1, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 19, @VALWYN, 0, 0, 0, 0, 0, 0, "Deathstalker Maltendis - On Data 1 1 Set - Face Advisor Valwyn"), +(@MALTENDIS, 0, 1, 0, 38, 0, 100, 0, 2, 2, 1000, 1000, 5, 153, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Deathstalker Maltendis - On Data 2 2 Set - Emote Laugh"), +(@MALTENDIS, 0, 2, 0, 38, 0, 100, 0, 3, 3, 1000, 1000, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Deathstalker Maltendis - On Data 3 3 Set - Reset Orientation"); + +DELETE FROM `creature_text` WHERE `entry` IN (@AURIFEROUS, @MAVREN, @VALWYN, @MALTENDIS); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@AURIFEROUS, 0, 0, "%s nods her head yes at what her advisor has to say.", 16, 0, 100, 273, 0, 0, 13362, 0, "Dame Auriferous"), +(@AURIFEROUS, 0, 1, "%s disagrees with whatever it is that Valwyn has whispered to her.", 16, 0, 100, 274, 0, 0, 13363, 0, "Dame Auriferous"), +(@AURIFEROUS, 0, 2, "%s seems nonplussed by whatever it is that her advisor has whispered in her ear.", 16, 0, 100, 6, 0, 0, 13365, 0, "Dame Auriferous"), +(@AURIFEROUS, 1, 0, "Executor, your direct assault approach will cost us more lives than I am comfortable with. A more nuanced strategy is called for; one that involves us reclaiming the surrounding territory, starting with the villages so as to cut off all points of reinforcement to Deatholme.", 12, 1, 100, 0, 0, 0, 12552, 0, "Dame Auriferous"), +(@AURIFEROUS, 2, 0, "I hear what you are saying, Mavren. Nevertheless, the final decision is mine. I appreciate your assistance, but the majority of the lives on the line are blood elf. I will not have those lives carelessly thrown away!", 12, 1, 100, 0, 0, 0, 12571, 0, "Dame Auriferous"), +(@AURIFEROUS, 3, 0, "How long until Forsaken reinforcements arrive? Our position here is tenuous. Your Lady promised us more soldiers. We must be able to concentrate solely on Deatholme and the Scourge!", 12, 1, 100, 0, 0, 0, 12557, 0, "Dame Auriferous"), +(@AURIFEROUS, 4, 0, "Mavren, I don't want excuses, I want results! The Farstriders aren't available and we've received all that we're going to get from Silvermoon for now. I cannot ignore the Shadowpine trolls and Zul'Aman... they're arrayed across our eastern border!", 12, 1, 100, 0, 0, 0, 12572, 0, "Dame Auriferous"), +(@AURIFEROUS, 5, 0, "No, I was right to begin with. Deatholme must come last. We must secure all of the Ghostlands first. I will not commit the forces here to a battle against Dar'khan with enemies to our flank and rear!", 12, 1, 100, 0, 0, 0, 12562, 0, "Dame Auriferous"), +(@AURIFEROUS, 6, 0, "Disagree with me all you like, High Executor. I will weigh your counsel, and then we will take the steps to free all of Quel'Thalas as I deem necessary. We shall continue this discussion anon.", 12, 1, 100, 0, 0, 0, 12573, 0, "Dame Auriferous"), +(@MAVREN, 0, 0, "With all due respect, milady, you have not fought the Scourge as I have. The Lady appointed me to assist you in defeating Dar'khan because of that, and you would do well to consider what I have to say.", 12, 1, 100, 0, 0, 0, 12553, 0, "High Executor Mavren"), +(@MAVREN, 0, 1, "I strongly disagree. Dar'khan is not going to get reinforcements because he'll be bottlenecked. Deatholme has only one way in and out. Your traitor was a fool to corner himself there, and I intend to exploit that weakness!", 12, 1, 100, 0, 0, 0, 12554, 0, "High Executor Mavren"), +(@MAVREN, 0, 2, "This is war, Dame Auriferous, and in any war lives will be lost! The only areas that we need to secure are the two ziggurats. We will turtle in and take the Tower of the Damned and its master by brute force. Then you will have your Quel'Thalas.", 12, 1, 100, 0, 0, 0, 12555, 0, "High Executor Mavren"), +(@MAVREN, 0, 3, "And if your Farstriders were here to reinforce us, I might agree. But, they are busying themselves instead with the Shadowpine trolls on your eastern border. The longer we wait for them, the stronger the Scourge will become.", 12, 1, 100, 0, 0, 0, 12556, 0, "High Executor Mavren"), +(@MAVREN, 1, 0, "I believe that you're making my argument for me, but yes it would be nice if we had more reinforcements. I would counter that it would be faster to pull the Farstriders from their senseless skirmishing with the trolls.", 12, 1, 100, 0, 0, 0, 12558, 0, "High Executor Mavren"), +(@MAVREN, 1, 1, "Dame Auriferous, we are the reinforcements. It may come to pass that The Lady will send more men in time. Better that you convince Silvermoon City to muster all of its forces and put them at our disposal here.", 12, 1, 100, 0, 0, 0, 12559, 0, "High Executor Mavren"), +(@MAVREN, 1, 2, "You are correct; we must concentrate on the Scourge. Ignore the trolls and the villages, and focus our attentions on Deatholme! With Dar'khan defeated you will find that the rest of the Scourge 'body' will fall quickly, lacking their 'head'.", 12, 1, 100, 0, 0, 0, 12560, 0, "High Executor Mavren"), +(@MAVREN, 1, 3, "Forsaken reinforcements? Undercity is stretched thin with the Scourge on all sides. No, this will be a matter largely dealt with by the blood elves. We Forsaken are here as backup and advisors.", 12, 1, 100, 0, 0, 0, 12561, 0, "High Executor Mavren"), +(@MAVREN, 2, 0, "Again I strongly disagree with your view of the strategic situation. Your plan will spread our forces too thin. It will leave us with only a small force to assault Deatholme. I cannot in good conscience execute such a strategy.", 12, 1, 100, 0, 0, 0, 12567, 0, "High Executor Mavren"), +(@MAVREN, 2, 1, "Spread throughout the Ghostlands, our forces will be of little use in an assault on Deatholme. No, milady, I am here to kill Dar'khan and that is what I intend to do!", 12, 1, 100, 0, 0, 0, 12568, 0, "High Executor Mavren"), +(@MAVREN, 2, 2, "We've been over this before. Only a focused assault upon Deatholme will meet with success. These other targets are distractions that we can ill afford. I suggest that you inform your Captain Helios that he is to leave off his campaign against the Shadowpine trolls and focus solely on the Scourge.", 12, 1, 100, 0, 0, 0, 12569, 0, "High Executor Mavren"), +(@MAVREN, 2, 3, "Perhaps we should let the matter rest for the time being until your chef has prepared your meal? You look a bit piqued if you don't mind my saying. We can resume our discussion when you are feeling more yourself.", 12, 1, 100, 0, 0, 0, 12570, 0, "High Executor Mavren"), +(@VALWYN, 0, 0, "%s whispers something in the Dame's ear.", 16, 0, 100, 0, 0, 0, 13361, 0, "Advisor Valwyn"), +(@VALWYN, 1, 0, "%s looks appalled at the Executor's tone!", 16, 0, 100, 0, 0, 0, 12574, 0, "Advisor Valwyn"), +(@VALWYN, 1, 1, "%s tries to busy herself with other matters.", 16, 0, 100, 0, 0, 0, 12575, 0, "Advisor Valwyn"), +(@VALWYN, 1, 2, "%s glares daggers in the direction of High Executor Mavren and Deathstalker Maltendis.", 16, 0, 100, 0, 0, 0, 12576, 0, "Advisor Valwyn"), +(@VALWYN, 1, 3, "%s lifts her nose and sniffs in response to the High Executor's reply.", 16, 0, 100, 0, 0, 0, 12577, 0, "Advisor Valwyn"), +(@VALWYN, 1, 4, "%s shakes her head in disbelief at what she is hearing out of the Forsaken's mouth.", 16, 0, 100, 0, 0, 0, 12578, 0, "Advisor Valwyn"), +(@VALWYN, 1, 5, "%s blanches as much of the blood drains from her face.", 16, 0, 100, 0, 0, 0, 12579, 0, "Advisor Valwyn"), +(@VALWYN, 1, 6, "%s reddens furiously at what she is hearing in response to her lady's question.", 16, 0, 100, 0, 0, 0, 12580, 0, "Advisor Valwyn"), +(@VALWYN, 1, 7, "%s concentrates on the wall opposite her, clearly ignoring the looks of the Executor and his assistant.", 16, 0, 100, 0, 0, 0, 12581, 0, "Advisor Valwyn"), +(@VALWYN, 2, 0, "%s looks disgusted at the deathstalker's flirtations.", 16, 0, 100, 274, 0, 0, 13367, 0, "Advisor Valwyn"), +(@MALTENDIS, 0, 0, "%s nods in agreement.", 16, 0, 100, 0, 0, 0, 12582, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 1, "%s opens his mouth as if to add something, and then apparently thinks the better of it.", 16, 0, 100, 0, 0, 0, 12583, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 2, "%s looks over at Advisor Valwyn with a smirk on his face.", 16, 0, 100, 0, 0, 0, 12584, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 3, "%s grins at the High Executor's words.", 16, 0, 100, 0, 0, 0, 12585, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 4, "%s appears bored with the whole discussion.", 16, 0, 100, 0, 0, 0, 12586, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 5, "%s winks slyly at Advisor Valwyn.", 16, 0, 100, 0, 0, 0, 12587, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 6, "%s fidgets with his armor, clearly uncomfortable at the tone of the discussion.", 16, 0, 100, 0, 0, 0, 12588, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 0, 7, "%s looks like he'd rather be anywhere else but here.", 16, 0, 100, 0, 0, 0, 12589, 0, "Deathstalker Maltendis"), +(@MALTENDIS, 1, 0, "%s turns to Advisor Valwyn and winks lasciviously in her direction.", 16, 0, 100, 2, 0, 0, 13366, 0, "Deathstalker Maltendis"); From a62b193229024d68331cb53677d1af60eca2be63 Mon Sep 17 00:00:00 2001 From: Killyana Date: Thu, 27 Apr 2017 21:41:11 +0200 Subject: [PATCH 05/51] DB/Creature: Caer Darrow AREA Added missing NPC(S) in Caer Darrow --- .../rev_1493321989278173500.sql | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493321989278173500.sql diff --git a/data/sql/updates/pending_db_world/rev_1493321989278173500.sql b/data/sql/updates/pending_db_world/rev_1493321989278173500.sql new file mode 100644 index 000000000..db48f3eec --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493321989278173500.sql @@ -0,0 +1,229 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493321989278173500'); +SET @GUID := 131324; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID + 1 AND @GUID + 23; +INSERT INTO `creature` (`guid`, `id`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `npcflag`, `MovementType`) VALUES +(@GUID + 1, 11277, 0, 1093.95, -2528.63, 61.2475, 5.74213, 0, 0, 0, 484, 0, 0, 0), +(@GUID + 2, 11277, 0, 1095.56, -2529.47, 61.1291, 2.37365, 0, 0, 0, 484, 0, 0, 0), +(@GUID + 3, 11277, 0, 1148.08, -2559.31, 60.1493, 4.15388, 0, 0, 0, 484, 0, 0, 0), +(@GUID + 4, 11277, 0, 1146.79, -2561.22, 60.1145, 0.959931, 0, 0, 0, 484, 0, 0, 0), +(@GUID + 5, 11279, 0, 1064.06, -2519.78, 60.2259, 3.19395, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 6, 11279, 0, 1056.5, -2536.54, 59.9694, 2.35619, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 7, 11279, 0, 1245.02, -2597.47, 90.3675, 3.52556, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 8, 11280, 0, 1180.07, -2536.72, 85.3681, 1.0821, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 9, 11280, 0, 1187.12, -2532.58, 85.3681, 2.16421, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 10, 11280, 0, 1208.19, -2583.32, 98.2479, 2.72271, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 11, 11282, 0, 1113.59, -2555.59, 59.2532, 3.50681, 0, 0, 0, 42, 0, 0, 0), +(@GUID + 12, 11283, 0, 1111.49, -2556.4, 59.2532, 0.365222, 0, 0, 0, 42, 0, 0, 0), +(@GUID + 13, 11316, 0, 1223.27, -2506.41, 72.9261, 4.10152, 0, 0, 0, 3500, 0, 0, 0), +(@GUID + 14, 11277, 0, 1155.4, -2383.73, 60.304, 5.43574, 300, 0, 0, 2784, 0, 0, 0), +(@GUID + 15, 11281, 0, 1098.49, -2523.82, 61.3707, 4.6691, 1272, 0, 0, 2371, 0, 0, 0), +(@GUID + 16, 11281, 0, 1031.16, -2498.27, 59.177, 4.73616, 1272, 0, 0, 2371, 0, 0, 2), +(@GUID + 17, 11281, 0, 1090.52, -2541.25, 59.2419, 2.70896, 1272, 0, 0, 2371, 0, 0, 2), +(@GUID + 18, 11279, 0, 1238.9929, -2586.8103, 90.3722, 3.695799, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 19, 11277, 0, 1100.1054, -2589.2932, 60.624, 0.555778, 0, 0, 0, 3632, 0, 0, 0), +(@GUID + 20, 11277, 0, 1127.81, -2387.71, 59.264, 1.72159, 300, 0, 0, 2784, 0, 0, 0), +(@GUID + 21, 11287, 0, 1081.91, -2574, 59.957, 0.301, 360, 0, 0, 1536, 0, 0, 0), +(@GUID + 22, 11277, 0, 1090.52, -2541.25, 59.2419, 2.70896, 1272, 0, 0, 2784, 0, 0, 2), +(@GUID + 23, 11277, 0, 1231.62939, -2558.7126, 91.04164, 4.410, 1272, 0, 0, 2784, 0, 0, 2); + +SET @NPC := 131340; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,5228,0,1,0, '17622'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`, `delay`) VALUES +(@PATH, 1, 1031.16, -2498.27, 59.177, 10000), +(@PATH, 2, 1034.48, -2468.77, 59.9844, 0), +(@PATH, 3, 1043.48, -2458.4, 60.4699, 0), +(@PATH, 4, 1071.23, -2443.23, 61.1634, 5000), +(@PATH, 5, 1101.41, -2409.45, 59.8655, 0), +(@PATH, 6, 1125.81, -2397.36, 59.4695, 0), +(@PATH, 7, 1183.61, -2397.16, 60.1768, 10000), +(@PATH, 8, 1126.2, -2397.42, 59.4867, 0), +(@PATH, 9, 1101.19, -2409.67, 59.8831, 0), +(@PATH, 10, 1070.91, -2443.54, 61.1405, 5000), +(@PATH, 11, 1043.16, -2458.72, 60.4674, 0), +(@PATH, 12, 1034.42, -2468.71, 59.9897, 0); + +SET @NPC := 131341; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,5228,0,1,0, '17622'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`, `delay`) VALUES +(@PATH, 1, 1090.52, -2541.25, 59.1419, 10000), +(@PATH, 2, 1095.36, -2543.49, 59.1418, 0), +(@PATH, 3, 1118.02, -2601.04, 59.4689, 0), +(@PATH, 4, 1132.05, -2612.48, 63.1381, 0), +(@PATH, 5, 1161.32, -2620.66, 70.9007, 0), +(@PATH, 6, 1193.38, -2629.62, 74.0911, 0), +(@PATH, 7, 1214.63, -2616.73, 83.1397, 0), +(@PATH, 8, 1221.01, -2604.11, 86.3537, 0), +(@PATH, 9, 1237.11, -2595.52, 90.1566, 10000), +(@PATH, 10, 1221.38, -2603.91, 86.4882, 0), +(@PATH, 11, 1214.67, -2616.99, 83.1357, 0), +(@PATH, 12, 1193.52, -2629.6, 74.1169, 0), +(@PATH, 13, 1161.14, -2620.61, 70.8684, 0), +(@PATH, 14, 1131.64, -2612.35, 63.038, 0), +(@PATH, 15, 1117.74, -2600.92, 59.4468, 0), +(@PATH, 16, 1095.2, -2543.02, 59.1423, 0); + +DELETE FROM `creature_formations` WHERE `leaderGUID` IN (131341); +INSERT INTO `creature_formations` (`leaderGUID`,`memberGUID`,`dist`,`angle`,`groupAI`,`point_1`,`point_2`) VALUES +(131341,131341,0,0,2,0,0), +(131341,131339,9,360,2,9,19); + +SET @NPC := @GUID + 23; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '17622 10848'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, 1235.24, -2562.57, 91.3431, 0, 0, 0, 0, 100, 0), +(@PATH, 2, 1236.63, -2570.77, 91.5426, 0, 0, 0, 0, 100, 0), +(@PATH, 3, 1237.19, -2580.81, 90.9381, 0, 0, 0, 0, 100, 0), +(@PATH, 4, 1238.05, -2593.67, 90.1927, 0, 0, 0, 0, 100, 0), +(@PATH, 5, 1228.63, -2599.66, 88.6386, 0, 0, 0, 0, 100, 0), +(@PATH, 6, 1220.7, -2604.7, 86.2027, 0, 0, 0, 0, 100, 0), +(@PATH, 7, 1212.85, -2601.35, 83.4549, 0, 0, 0, 0, 100, 0), +(@PATH, 8, 1201.85, -2595.01, 78.5496, 0, 0, 0, 0, 100, 0), +(@PATH, 9, 1191.01, -2590.97, 74.6417, 0, 0, 0, 0, 100, 0), +(@PATH, 10, 1180.71, -2595.16, 72.9315, 0, 0, 0, 0, 100, 0), +(@PATH, 11, 1176.2, -2606.29, 72.8323, 0, 0, 0, 0, 100, 0), +(@PATH, 12, 1168.01, -2620.18, 71.895, 0, 0, 0, 0, 100, 0), +(@PATH, 13, 1173.01, -2612.22, 72.7501, 0, 0, 0, 0, 100, 0), +(@PATH, 14, 1182.33, -2592.46, 72.9574, 0, 0, 0, 0, 100, 0), +(@PATH, 15, 1197.4, -2592.45, 76.7622, 0, 0, 0, 0, 100, 0), +(@PATH, 16, 1219.52, -2604.41, 85.8084, 0, 0, 0, 0, 100, 0), +(@PATH, 17, 1237.83, -2592.45, 90.193, 0, 0, 0, 0, 100, 0), +(@PATH, 18, 1237.96, -2574.51, 91.5436, 0, 0, 0, 0, 100, 0), +(@PATH, 19, 1233.04, -2561.64, 90.6976, 0, 0, 0, 0, 100, 0), +(@PATH, 20, 1232.37, -2553.62, 91.4351, 0, 0, 0, 0, 100, 0); + +SET @NPC := 131346; +UPDATE `creature` SET `position_x`=1127.81, `position_y`=-2387.71, `position_z`=59.264, `orientation`=1.72159 WHERE `guid`=@NPC; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, '17622 10848'); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(@PATH, 1, 1130.21, -2395.8, 59.6262, 0, 0, 0, 0, 100, 0), +(@PATH, 2, 1137.21, -2395.91, 59.8531, 0, 0, 0, 0, 100, 0), +(@PATH, 3, 1158.21, -2396.22, 59.8991, 0, 0, 0, 0, 100, 0), +(@PATH, 4, 1179.21, -2396.51, 60.0552, 0, 0, 0, 0, 100, 0), +(@PATH, 5, 1203.92, -2392.72, 60.0587, 0, 0, 0, 0, 100, 0), +(@PATH, 6, 1190.1, -2394.95, 60.1484, 0, 0, 0, 0, 100, 0), +(@PATH, 7, 1169.22, -2396.95, 59.9472, 0, 0, 0, 0, 100, 0), +(@PATH, 8, 1155.23, -2396.77, 59.9844, 0, 0, 0, 0, 100, 0), +(@PATH, 9, 1124.17, -2397.18, 59.405, 0, 0, 0, 0, 100, 0), +(@PATH, 10, 1099.73, -2410.8, 59.9901, 0, 0, 0, 0, 100, 0), +(@PATH, 11, 1090.4, -2420.13, 60.9123, 0, 0, 0, 0, 100, 0), +(@PATH, 12, 1072.48, -2441.64, 61.2209, 0, 0, 0, 0, 100, 0), +(@PATH, 13, 1043.13, -2458.38, 60.4831, 0, 0, 0, 0, 100, 0), +(@PATH, 14, 1035.92, -2468.81, 59.9447, 0, 0, 0, 0, 100, 0), +(@PATH, 15, 1032.07, -2486.29, 59.3631, 0, 0, 0, 0, 100, 0), +(@PATH, 16, 1024.47, -2514.34, 59.1417, 0, 0, 0, 0, 100, 0), +(@PATH, 17, 1037.54, -2519.32, 59.1867, 0, 0, 0, 0, 100, 0), +(@PATH, 18, 1063.46, -2529.89, 59.1418, 0, 0, 0, 0, 100, 0), +(@PATH, 19, 1097.75, -2544.71, 59.1428, 0, 0, 0, 0, 100, 0), +(@PATH, 20, 1102.49, -2557.88, 59.1428, 0, 0, 0, 0, 100, 0), +(@PATH, 21, 1111.76, -2584.3, 59.1743, 0, 0, 0, 0, 100, 0), +(@PATH, 22, 1123.54, -2607.25, 61.0399, 0, 0, 0, 0, 100, 0), +(@PATH, 23, 1136.36, -2612.87, 64.1442, 0, 0, 0, 0, 100, 0), +(@PATH, 24, 1163.16, -2620.89, 71.2108, 0, 0, 0, 0, 100, 0), +(@PATH, 25, 1182.45, -2627.27, 72.8355, 0, 0, 0, 0, 100, 0), +(@PATH, 26, 1196.35, -2625.69, 74.9546, 0, 0, 0, 0, 100, 0), +(@PATH, 27, 1205.57, -2623.11, 78.4216, 0, 0, 0, 0, 100, 0), +(@PATH, 28, 1218.12, -2611.44, 84.922, 0, 0, 0, 0, 100, 0), +(@PATH, 29, 1232.4, -2596.93, 89.4579, 0, 0, 0, 0, 100, 0), +(@PATH, 30, 1218.97, -2605.37, 85.534, 0, 0, 0, 0, 100, 0), +(@PATH, 31, 1207.03, -2598.07, 80.8431, 0, 0, 0, 0, 100, 0), +(@PATH, 32, 1184.18, -2591.84, 73.0826, 0, 0, 0, 0, 100, 0), +(@PATH, 33, 1180.16, -2598.08, 72.8645, 0, 0, 0, 0, 100, 0), +(@PATH, 34, 1167.55, -2620.42, 71.8289, 0, 0, 0, 0, 100, 0), +(@PATH, 35, 1148.76, -2617.4, 67.9948, 0, 0, 0, 0, 100, 0), +(@PATH, 36, 1128.96, -2610.55, 62.3378, 0, 0, 0, 0, 100, 0), +(@PATH, 37, 1114.88, -2592.68, 59.2346, 0, 0, 0, 0, 100, 0), +(@PATH, 38, 1112, -2586.3, 59.1568, 0, 0, 0, 0, 100, 0), +(@PATH, 39, 1102.92, -2559.83, 59.142, 0, 0, 0, 0, 100, 0), +(@PATH, 40, 1093.84, -2542.81, 59.1414, 0, 0, 0, 0, 100, 0), +(@PATH, 41, 1067.78, -2532.62, 59.1415, 0, 0, 0, 0, 100, 0), +(@PATH, 42, 1035.69, -2518.67, 59.1449, 0, 0, 0, 0, 100, 0), +(@PATH, 43, 1022.34, -2513.6, 59.1417, 0, 0, 0, 0, 100, 0), +(@PATH, 44, 1029.52, -2499.31, 59.1618, 0, 0, 0, 0, 100, 0), +(@PATH, 45, 1032.82, -2480.03, 59.4609, 0, 0, 0, 0, 100, 0), +(@PATH, 46, 1040.28, -2461.78, 60.4131, 0, 0, 0, 0, 100, 0), +(@PATH, 47, 1068.44, -2444.34, 60.9293, 0, 0, 0, 0, 100, 0), +(@PATH, 48, 1089.28, -2422.64, 61.0531, 0, 0, 0, 0, 100, 0), +(@PATH, 49, 1110.43, -2404.84, 59.3954, 0, 0, 0, 0, 100, 0), +(@PATH, 50, 1125.89, -2397.4, 59.473, 0, 0, 0, 0, 100, 0); + +UPDATE `creature_template_addon` SET `mount` = 5228 WHERE `entry` = 11281; + +DELETE FROM `creature_template_addon` WHERE `entry` IN (11282, 11283, 11287, 11279, 11286, 11316, 11280); +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(11282, 0, 0, 0, 0, 0, '17622 10848'), +(11283, 0, 0, 0, 0, 0, '17622 10848'), +(11287, 0, 0, 0, 0, 0, '17622 10848'), +(11279, 0, 0, 0, 0, 0, '17622 10848'), +(11286, 0, 0, 0, 0, 0, '17622 10848'), +(11316, 0, 0, 0, 69, 0, '17622 10848'), +(11280, 0, 0, 0, 69, 0, '17622 10848'); + +UPDATE `creature_template_addon` SET `auras` = '17622 10848' WHERE `entry` = 11277; +UPDATE `creature_addon` SET `bytes1`=0, `auras` = '17622 10848' WHERE `guid` = 200140; + +-- Melia SAI +SET @ENTRY := 11282; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,1,11282,1,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Reset - Start Waypoint"), +(@ENTRY,0,1,0,40,0,100,0,5,11282,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Waypoint 5 Reached - Run Script"); + +-- Actionlist SAI +SET @ENTRY := 1128200; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Pause Waypoint"), +(@ENTRY,9,1,0,0,0,100,0,6000,6000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.495,"Melia - On Script - Set Orientation 3.495"), +(@ENTRY,9,2,0,0,0,100,0,3000,3000,0,0,1,0,2000,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Say Line 0"), +(@ENTRY,9,3,0,0,0,100,0,5000,5000,0,0,1,0,2000,0,0,0,0,19,11283,100,0,0,0,0,0,"Melia - On Script - Say Line 0"), +(@ENTRY,9,4,0,0,0,100,0,2000,2000,0,0,1,1,2000,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Say Line 1"), +(@ENTRY,9,5,0,0,0,100,0,14000,14000,0,0,1,2,2000,0,0,0,0,1,0,0,0,0,0,0,0,"Melia - On Script - Say Line 2"), +(@ENTRY,9,6,0,0,0,100,0,1000,1000,0,0,1,1,2000,0,0,0,0,19,11283,100,0,0,0,0,0,"Melia - On Script - Say Line 1"); + +-- Sammy SAI +SET @ENTRY := 11283; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,25,0,100,0,0,0,0,0,53,1,11283,1,0,0,0,1,0,0,0,0,0,0,0,"Sammy - On Reset - Start Waypoint"), +(@ENTRY,0,1,0,40,0,100,0,5,11283,0,0,54,30000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Sammy - On Waypoint 5 Reached - Pause Waypoint"); + +DELETE FROM `creature_text` WHERE `entry` IN (11282, 11283); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +(11282, 0, 0, 'I win!', 12, 0, 100, 0, 2000, 0, 6808, 'Melia'), +(11282, 1, 0, 'Wanna race again? Best two out of three!', 12, 0, 100, 0, 2000, 0, 6809, 'Melia'), +(11282, 2, 0, 'Ready. Set. GO!', 12, 0, 100, 0, 2000, 0, 6806, 'Melia'), +(11283, 0, 0, 'You cheated!', 12, 0, 100, 0, 2000, 0, 6810, 'Sammy'), +(11283, 1, 0, 'HEY! No fair!', 12, 0, 100, 0, 2000, 0, 6807, 'Sammy'); + +DELETE FROM `waypoints` WHERE `entry` IN (11282, 11283); +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(11282, 1, 1120.09, -2547.57, 59.2532, 'Melia'), +(11282, 2, 1111.05, -2537.9, 59.2532, 'Melia'), +(11282, 3, 1100.43, -2547.73, 59.2532, 'Melia'), +(11282, 4, 1109.6, -2558.2, 59.2532, 'Melia'), +(11282, 5, 1113.59, -2555.59, 59.2532, 'Melia'), +(11282, 6, 1113.59, -2555.59, 59.2532, 'Melia'), +(11283, 1, 1120.72, -2548.21, 59.2532, 'Sammy'), +(11283, 2, 1110.95, -2538.51, 59.2532, 'Sammy'), +(11283, 3, 1100.73, -2547.23, 59.2532, 'Sammy'), +(11283, 4, 1109.56, -2557.59, 59.2532, 'Sammy'), +(11283, 5, 1111.49, -2556.4, 59.2532, 'Sammy'), +(11283, 6, 1111.49, -2556.4, 59.2532, 'Sammy'); From ad3e23223371a2837c0609c60f660fa5c4c290a8 Mon Sep 17 00:00:00 2001 From: tkrokli Date: Fri, 28 Apr 2017 03:40:45 +0200 Subject: [PATCH 06/51] DB/Quests: Grimtotem Spying Show actual player name in reward text (5064) --- .../updates/pending_db_world/rev_1493343523138941000.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493343523138941000.sql diff --git a/data/sql/updates/pending_db_world/rev_1493343523138941000.sql b/data/sql/updates/pending_db_world/rev_1493343523138941000.sql new file mode 100644 index 000000000..57954ec85 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493343523138941000.sql @@ -0,0 +1,6 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493343523138941000'); +-- replace "Mac" with actual player name ($N) in the reward text +UPDATE `quest_template` +SET `OfferRewardText`= "Great Spirit Totem! This is dire news indeed. I must begin to plan for whatever may come.$b$b$N, as promised, here is your reward for your brave service.$b$b" +WHERE `ID`= 5064; +-- From b4fd041855e6be19738605a15811ca893bf8e83f Mon Sep 17 00:00:00 2001 From: Keader Date: Fri, 28 Apr 2017 03:54:43 +0200 Subject: [PATCH 07/51] DB/Spells: Fixed spell range of Flush Pipe (Dalaran Sewers Knockback) --- data/sql/updates/pending_db_world/rev_1493344470069156600.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493344470069156600.sql diff --git a/data/sql/updates/pending_db_world/rev_1493344470069156600.sql b/data/sql/updates/pending_db_world/rev_1493344470069156600.sql new file mode 100644 index 000000000..b677181f5 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493344470069156600.sql @@ -0,0 +1,2 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493344470069156600'); +UPDATE `spell_dbc` SET `RangeIndex`=4 WHERE `Id`=61698; From 34d4354f41857b2a4ecb48692bf6585b7342883b Mon Sep 17 00:00:00 2001 From: Killyana Date: Fri, 28 Apr 2017 04:03:10 +0200 Subject: [PATCH 08/51] DB/Creature: Fix Stonescythe Whelps faction --- data/sql/updates/pending_db_world/rev_1493344929793898700.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493344929793898700.sql diff --git a/data/sql/updates/pending_db_world/rev_1493344929793898700.sql b/data/sql/updates/pending_db_world/rev_1493344929793898700.sql new file mode 100644 index 000000000..41c45c7e4 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493344929793898700.sql @@ -0,0 +1,2 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493344929793898700'); +UPDATE `creature_template` SET `faction` = 1873 WHERE `entry` = 16927; From 91d75ec7ffd0f565cd46dd47fa632458e2ba0431 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 28 Apr 2017 04:35:11 +0200 Subject: [PATCH 09/51] DB/Quest: Challenge Overlord Mok'Morokk --- .../rev_1493346808800720600.sql | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493346808800720600.sql diff --git a/data/sql/updates/pending_db_world/rev_1493346808800720600.sql b/data/sql/updates/pending_db_world/rev_1493346808800720600.sql new file mode 100644 index 000000000..ab35fec3e --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493346808800720600.sql @@ -0,0 +1,45 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493346808800720600'); +-- Quest 27418, Challenge Overlord Mok'Morokk + +SET @OMM := 4500; -- Overlord Mok'Morokk + +UPDATE `quest_template_addon` SET `SpecialFlags`=2 WHERE `ID`=1173; + +DELETE FROM `creature_text` WHERE `entry`= @OMM; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@OMM, 0,0,'Puny $r wanna fight Overlord Mok''Morokk? Me beat you! Me boss here!',12,0,100,0,0,0,1515,0,'Overlord Mok''Morokk - on Quest Accept'), +(@OMM, 1,0,'Me scared! Me run now!', 14,0,100,0,0,0,1523,0,'Overlord Mok''Morokk - on Health 0%-25%'); + +DELETE FROM `waypoints` WHERE `entry` = @OMM; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(@OMM, 1, -3138.49, -2864.64, 34.76, 'Overlord Mok''Morokk'), +(@OMM, 2, -3128.08, -2847.37, 34.72, 'Overlord Mok''Morokk'), +(@OMM, 3, -3108.94, -2839.60, 34.28, 'Overlord Mok''Morokk'); + +UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = '' WHERE `entry` = @OMM; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@OMM, @OMM*100, @OMM*100+1); +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@OMM, 0, 0,0, 0,0,100,0, 1000,3000,7000,10000, 11, 6749, 2, 0,0,0,0, 2, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - In Combat Update - cast ''Wide Swipe'''), +(@OMM, 0, 1,2, 19,0,100,1, 1173, 0, 0, 0, 64, 1, 0, 0,0,0,0, 16, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Quest Accept - Store players (No repeat)'), +(@OMM, 0, 2,0, 61,0,100,0, 0, 0, 0, 0, 80, @OMM*100, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Quest Accept - Run Actionlist 450000'), +(@OMM*100, 9, 0,0, 0,0,100,0, 3000,3000, 0, 0, 1, 0, 0, 0,0,0,0, 12, 1,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Say text 0'), +(@OMM*100, 9, 1,0, 0,0,100,0, 0, 0, 0, 0, 2, 16, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Set faction (Monster)'), +(@OMM*100, 9, 2,0, 0,0,100,0, 0, 0, 0, 0, 83, 2, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Remove npcflag Quest Giver'), +(@OMM*100, 9, 3,0, 0,0,100,0, 0, 0, 0, 0, 19, 768, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Remove Unit Flags immune to NPC & immune to PC'), +(@OMM*100, 9, 4,0, 0,0,100,0, 0, 0, 0, 0, 49, 0, 0, 0,0,0,0, 12, 1,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Attack stored player'), +(@OMM, 0, 3,0, 2,0,100,1, 0, 25, 0, 0, 80,@OMM*100+1, 2, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Health 0%-25% - Run Actionlist 450001 (No repeat)'), +(@OMM, 0, 4,0, 0,0,100,1, 0, 0, 0, 0, 42, 0, 1, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - In Combat - Set invincibility hp level (No repeat)'), +(@OMM*100+1,9, 0,0, 0,0,100,0, 0, 0, 0, 0, 18, 768, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Set Unit Flags immune to NPC & immune to PC'), +(@OMM*100+1,9, 1,0, 0,0,100,0, 0, 0, 0, 0, 28, 0, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Remove all auras'), +(@OMM*100+1,9, 2,0, 0,0,100,0, 0, 0, 0, 0, 2, 29, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Set faction (Orgrimmar)'), +(@OMM*100+1,9, 3,0, 0,0,100,0, 0, 0, 0, 0, 24, 0, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Evade'), +(@OMM*100+1,9, 4,0, 0,0,100,0, 0, 0, 0, 0, 15, 1173, 0, 0,0,0,0, 12, 1,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Credit Quest ''Challenge Overlord Mok''Morokk'''), +(@OMM*100+1,9, 5,0, 0,0,100,0, 500, 500, 0, 0, 1, 1, 0, 0,0,0,0, 12, 1,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Say text 1'), +(@OMM*100+1,9, 6,0, 0,0,100,0, 0, 0, 0, 0, 53, 1,@OMM, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - Actionlist - Start Waypoint'), +(@OMM, 0, 5,0, 58,0,100,0, 0,@OMM, 0, 0, 41, 0, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on WP End - Despawn'), +(@OMM, 0, 6,7, 25,0,100,0, 0, 0, 0, 0, 18, 768, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Reset - Set Unit Flags immune to NPC & immune to PC'), +(@OMM, 0, 7,8, 61,0,100,0, 0, 0, 0, 0, 82, 2, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Reset - Remove all auras'), +(@OMM, 0, 8,0, 61,0,100,0, 0, 0, 0, 0, 2, 29, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Reset - Set faction (Orgrimmar)'), +(@OMM, 0, 9,0, 11,0,100,0, 0, 0, 0, 0, 42, 1, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Spawn - Set Invincibility at 1 HP'); +-- + From b3b0c0586ac46c72a284cbc37109f65567a7d9f8 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 28 Apr 2017 04:47:37 +0200 Subject: [PATCH 10/51] DB/Creature: Fix Verifonix faction and reputation --- .../updates/pending_db_world/rev_1493347575872142000.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493347575872142000.sql diff --git a/data/sql/updates/pending_db_world/rev_1493347575872142000.sql b/data/sql/updates/pending_db_world/rev_1493347575872142000.sql new file mode 100644 index 000000000..2415faa21 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493347575872142000.sql @@ -0,0 +1,7 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493347575872142000'); +-- Verifonix +UPDATE `creature_template` SET `faction`=47 WHERE `entry`=14492; + +DELETE FROM `creature_onkill_reputation` WHERE `creature_id`=14492; +INSERT INTO `creature_onkill_reputation` (`creature_id`,`RewOnKillRepFaction1`,`RewOnKillRepFaction2`,`MaxStanding1`,`IsTeamAward1`,`RewOnKillRepValue1`,`MaxStanding2`,`IsTeamAward2`,`RewOnKillRepValue2`,`TeamDependent`) VALUES +(14492, 21, 0, 5, 0, 5, 0, 0, 0, 0); From e6c9795fe3087a71a4dd7dc6b527b2eefb2116ab Mon Sep 17 00:00:00 2001 From: Killyana Date: Fri, 28 Apr 2017 05:15:03 +0200 Subject: [PATCH 11/51] DB/Creature: Doctor Razorgrin --- .../rev_1493349239278044600.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1493349239278044600.sql diff --git a/data/sql/updates/pending_db_world/rev_1493349239278044600.sql b/data/sql/updates/pending_db_world/rev_1493349239278044600.sql new file mode 100644 index 000000000..f1df78966 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1493349239278044600.sql @@ -0,0 +1,24 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493349239278044600'); +-- +DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry=45872; +INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionTarget, ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName, COMMENT) VALUES +(13, 1, 45872, 0, 0, 31, 0, 3, 23837, 0, 0, 0, 0, '', 'Defibrillate'); + +SET @ENTRY := 25678; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Doctor Razorgin - On Aggro - Say Line 0 (random)'), +(@ENTRY,0,1,2,1,0,100,0,3000,3000,30000,30000,11,45872,0,0,0,0,0,1,0,0,0,0,0,0,0,'Doctor Razorgin - OOC - Cast Defibrillate'), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Doctor Razorgin - Ooc - Say Line 1 (random)'); + +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`,`BroadcastTextId`) VALUES +(@ENTRY,0,0,'Ah, good... more parts!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines',24872), +(@ENTRY,0,1,'Fresh meat!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines',24871), +(@ENTRY,0,2,'The doctor is in!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines',24870), +(@ENTRY,0,3,'I recommened evisceration!',14,0,100,0,0,0,'Part of the Doctor Razorgin on aggro lines',24873), +(@ENTRY,1,0,'Clear!',14,0,100,0,0,0,'Part of the Doctor Razorgin ooc lines',24867), +(@ENTRY,1,1,'It''s no good... you need more work first.',14,0,100,0,0,0,'Part of the Doctor Razorgin ooc lines',24869), +(@ENTRY,1,2,'Live, damn you!',14,0,100,0,0,0,'Part of the Doctor Razorgin ooc lines',24868); + +UPDATE `creature` SET `position_x`=4402.431152, `position_y`=4554.557129, `position_z`=88.743332, `orientation`=0.395920, `MovementType`=0, `spawndist`=0 WHERE `id`=@ENTRY; From 3427036942e0c7263daf82f6195d51d89074395f Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Mon, 8 May 2017 10:06:43 +0200 Subject: [PATCH 12/51] minor quest fixes --- .../rev_1494230753178074480.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1494230753178074480.sql diff --git a/data/sql/updates/pending_db_world/rev_1494230753178074480.sql b/data/sql/updates/pending_db_world/rev_1494230753178074480.sql new file mode 100644 index 000000000..72497c860 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1494230753178074480.sql @@ -0,0 +1,25 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1494230753178074480'); + +-- The boar hunter requires 12 kills, not 8 +UPDATE `quest_template` SET `RequiredNpcOrGoCount1` = 12 where `ID` = 183; + +-- Quest Westbrook Garrison Needs Help! has The Jasperlode Mine as prequest +UPDATE `quest_template_addon` SET `PrevQuestID` = 76 WHERE `ID` = 239; + +-- The Everstill Bridge has The Lost Tools as prequest +UPDATE `quest_template_addon` SET `PrevQuestID` = 125 WHERE `ID` = 89; + +-- Kurzen's Mystery follows Bad Medicine, not Colonel Kurzen +UPDATE `quest_template_addon` SET `PrevQuestId` = 204 WHERE `ID` = 207; + +-- Spirits of the Stonemaul Hold follows The Essence of Enmity +UPDATE `quest_template_addon` SET `PrevQuestId` = 11161 WHERE `ID` = 11159; + +-- Bungle in the jungle follows March of the Silithid (alliance: 4493, horde:4494), which follow Rise of the Silithid (alliance: 162, horde: 32) +UPDATE `quest_template_addon` SET `PrevQuestID` = 162, `NextQuestID` = 4496, `ExclusiveGroup` = 4493 WHERE `ID` = 4493; +UPDATE `quest_template_addon` SET `PrevQuestID` = 32, `NextQuestID` = 4496, `ExclusiveGroup` = 4493 WHERE `ID` = 4494; + +-- Salve via hunting first time quest for alliance was not rewarding money or xp +UPDATE `quest_template` SET RewardXPDifficulty = 4, RewardBonusMoney = 3600 WHERE ID = 4103; +-- Salve via hunting repeatable quest for horde WAS! +UPDATE `quest_template` SET RewardXPDifficulty = 0, RewardBonusMoney = 0 WHERE ID = 5887; From e003c068cbdf227de8fbbc8a5fdf66e84526a2fb Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Thu, 25 May 2017 18:29:06 +0200 Subject: [PATCH 13/51] Bael'Gar's Fiery Essence condition --- .../updates/pending_db_world/rev_1495729610203623150.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1495729610203623150.sql diff --git a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql new file mode 100644 index 000000000..ecc62499f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql @@ -0,0 +1,9 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1495729610203623150'); + + +-- Bael'Gar's Fiery Essence requires Bael'Gar's Corpse, borrowed from TrinityCore/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_00_world.sql +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN(17) AND `SourceEntry`=13982; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17,0,13982,0,0,29,0,9016,10,1,0,0,0,'',"Spell 'Bael'Gar's Fiery Essence' requires Bael'Gar's corpse"); + + From 4d38ea8b2bc290811a110e1215897066bd46f9ae Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Sun, 28 May 2017 20:29:53 +0200 Subject: [PATCH 14/51] minor fixes in outland --- .../rev_1495729610203623150.sql | 78 ++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql index ecc62499f..735fc4088 100644 --- a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql +++ b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql @@ -1,9 +1,85 @@ INSERT INTO version_db_world (`sql_rev`) VALUES ('1495729610203623150'); - -- Bael'Gar's Fiery Essence requires Bael'Gar's Corpse, borrowed from TrinityCore/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_00_world.sql DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN(17) AND `SourceEntry`=13982; INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES (17,0,13982,0,0,29,0,9016,10,1,0,0,0,'',"Spell 'Bael'Gar's Fiery Essence' requires Bael'Gar's corpse"); +-- Crimson Crysal Shard is a guaranteed drop +UPDATE creature_loot_template SET ChanceOrQuestChance = 100 WHERE entry = 19188 AND item = 29476; + +-- Kurenai +UPDATE quest_template SET RewardFactionValue1 = 7 WHERE ID IN (9924,9954, 9917, 10476, 9923, 11502, 10477, 9871, 9873, 9878, 9874, 9921, 9936, 9940, 10116, 10115, 9835, 9833, 9905, 9834,9839,9830, 9902); +UPDATE quest_template SET RewardFactionOverride1 = 70000 WHERE ID IN (9955,9933,9956,9879,9922,9938); +UPDATE quest_template SET RewardFactionValue1 = 8 WHERE ID IN (9918); + +-- Mag'har +UPDATE quest_template SET RewardFactionValue1 = 7 WHERE ID IN (9867, 9442,10102,10085, 9447, 9891, 9916, 11503, 9441, 9906, 10478, 9872, 9865, 10479, 9910, 10082, 9888, 10175, 9863, 9935, 9939, 9945, 10101); +UPDATE quest_template SET RewardFactionOverride1 = 70000 WHERE ID IN (9410, 9907, 10167, 9946, 9948, 10045, 9934, 9868, 9937, 10168); +UPDATE quest_template SET RewardFactionValue1 = 8 WHERE ID IN (9889); +UPDATE quest_template SET RewardFactionOverride1 = 200000 WHERE ID IN (10212); + +-- Sporeggar +UPDATE quest_template SET RewardFactionOverride1 = 75000 WHERE ID in (9739, 9743, 9742, 9744, 9919, 9806, 9808, 9807, 9809,9726, 9727, 9714, 9715); +UPDATE quest_template SET RewardFactionOverride1 = 105000 WHERE ID in (9719, 9717, 9729); + +-- Diaphanous wing droprate +UPDATE creature_loot_template SET ChanceOrQuestChance = -40 WHERE item = 24372 AND entry IN (18132, 18133, 20197, 20198, 18283); + +-- Greater and Young Sporebat also drop eyes. +DELETE FROM creature_loot_template WHERE entry IN (20387, 18129) AND item = 24426; +INSERT INTO creature_loot_template VALUES +(18129, 24426,-20,1,0,1,1), +(20387, 24426,-20,1,0,1,1); + + +-- Added vengeful draenei, from Trinity +DELETE FROM creature WHERE id = 21636; +INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags) VALUES +(21636,530,1,1,0,0,-2981.75,4378.62,-49.227, 6.20934,600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,0,-2962.8, 4378.18,-49.227, 3.08974,600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,0,-2961.98,4363.85,-49.227, 1.88651,600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,0,-2980.05,4363.27,-49.227, 1.61633,600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,0,-3049.06,4495.87,-42.944, 6.09074,600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,1,-2974.29,4441.98,-47.2117,1.43117,600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,1,-3013.52,4510.81,-42.8637,5.0091, 600,0,0,5914,0,0,0,0,0), +(21636,530,1,1,0,1,-2898.17,4497.22,-42.8615,2.9147, 600,0,0,5914,0,0,0,0,0); + + +-- Escaping the Tomb was missing it's goal +UPDATE quest_template SET AreaDescription = "Escort Akuno" WHERE ID = 10887; + + +-- Redone Slain Sha'tar Vindicator +DELETE FROM creature WHERE id = 21859; +INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags) VALUES +(21859,530,1,1,0,1,-3736, 5333.73,-12.50,2.1171,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3750.4, 5301.33,-17.10,3.6650,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3649.6, 5322.93,-18.15,5.3430,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3779.2, 5225.73,-22.75,2.7725,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3714.4, 5214.93,-21.00,4.2144,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3750.4, 5171.73,-22.15,2.0036,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3764.8, 5128.53,-22.30,3.0938,150,0,0,6986,0,0,0,0,0), +(21859,530,1,1,0,1,-3750.4, 5085.33,-18.40,0.6098,150,0,0,6986,0,0,0,0,0); + +-- Redone Slain Auchenai Warrior +DELETE FROM creature WHERE id = 21846; +INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags) VALUES +(21846,530,1,1,0,1,-3714.4, 5290.53,-18.75,3.3858,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3714.4, 5225.73,-22.60,4.8247,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3692.8, 5344.53,-13.85,4.8579,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3642.4, 5290.53,-21.35,1.1159,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3750.4, 5268.93,-15.30,0.4874,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3772, 5214.93,-22.70,2.7571,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3736, 5160.93,-22.25,2.7343,150,0,0,6986,0,0,0,0,0), +(21846,530,1,1,0,1,-3764.8, 5106.93,-19.80,0.6078,150,0,0,6986,0,0,0,0,0); + + +-- Drop chance howling wind +UPDATE creature_loot_template SET ChanceOrQuestChance = 15 WHERE item = 24504 AND entry IN (17158,17159,17160); + + + + +-- $11 = {id = 1, QuestRewFactionValue = {0, 10, 25, 75, 150, 250, 350, 500, 1000, 5}} From 5eb55654a502d70eebe005487be6877122b34793 Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Sun, 28 May 2017 20:45:09 +0200 Subject: [PATCH 15/51] minor fixes in outland --- .../rev_1495729610203623150.sql | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql index 735fc4088..583e358a3 100644 --- a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql +++ b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql @@ -6,36 +6,36 @@ INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry (17,0,13982,0,0,29,0,9016,10,1,0,0,0,'',"Spell 'Bael'Gar's Fiery Essence' requires Bael'Gar's corpse"); -- Crimson Crysal Shard is a guaranteed drop -UPDATE creature_loot_template SET ChanceOrQuestChance = 100 WHERE entry = 19188 AND item = 29476; +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = 100 WHERE `entry` = 19188 AND `item` = 29476; -- Kurenai -UPDATE quest_template SET RewardFactionValue1 = 7 WHERE ID IN (9924,9954, 9917, 10476, 9923, 11502, 10477, 9871, 9873, 9878, 9874, 9921, 9936, 9940, 10116, 10115, 9835, 9833, 9905, 9834,9839,9830, 9902); -UPDATE quest_template SET RewardFactionOverride1 = 70000 WHERE ID IN (9955,9933,9956,9879,9922,9938); -UPDATE quest_template SET RewardFactionValue1 = 8 WHERE ID IN (9918); +UPDATE `quest_template SET RewardFactionValue1` = 7 WHERE `ID` IN (9924,9954, 9917, 10476, 9923, 11502, 10477, 9871, 9873, 9878, 9874, 9921, 9936, 9940, 10116, 10115, 9835, 9833, 9905, 9834,9839,9830, 9902); +UPDATE `quest_template SET RewardFactionOverride1` = 70000 WHERE `ID` IN (9955,9933,9956,9879,9922,9938); +UPDATE `quest_template SET RewardFactionValue1` = 8 WHERE `ID` IN (9918); -- Mag'har -UPDATE quest_template SET RewardFactionValue1 = 7 WHERE ID IN (9867, 9442,10102,10085, 9447, 9891, 9916, 11503, 9441, 9906, 10478, 9872, 9865, 10479, 9910, 10082, 9888, 10175, 9863, 9935, 9939, 9945, 10101); -UPDATE quest_template SET RewardFactionOverride1 = 70000 WHERE ID IN (9410, 9907, 10167, 9946, 9948, 10045, 9934, 9868, 9937, 10168); -UPDATE quest_template SET RewardFactionValue1 = 8 WHERE ID IN (9889); -UPDATE quest_template SET RewardFactionOverride1 = 200000 WHERE ID IN (10212); +UPDATE `quest_template` SET `RewardFactionValue1` = 7 WHERE `ID` IN (9867, 9442,10102,10085, 9447, 9891, 9916, 11503, 9441, 9906, 10478, 9872, 9865, 10479, 9910, 10082, 9888, 10175, 9863, 9935, 9939, 9945, 10101); +UPDATE `quest_template` SET `RewardFactionOverride1` = 70000 WHERE `ID` IN (9410, 9907, 10167, 9946, 9948, 10045, 9934, 9868, 9937, 10168); +UPDATE `quest_template` SET `RewardFactionValue1` = 8 WHERE `ID` IN (9889); +UPDATE `quest_template` SET `RewardFactionOverride1` = 200000 WHERE `ID` IN (10212); -- Sporeggar -UPDATE quest_template SET RewardFactionOverride1 = 75000 WHERE ID in (9739, 9743, 9742, 9744, 9919, 9806, 9808, 9807, 9809,9726, 9727, 9714, 9715); -UPDATE quest_template SET RewardFactionOverride1 = 105000 WHERE ID in (9719, 9717, 9729); +UPDATE `quest_template` SET `RewardFactionOverride1` = 75000 WHERE `ID` in (9739, 9743, 9742, 9744, 9919, 9806, 9808, 9807, 9809,9726, 9727, 9714, 9715); +UPDATE `quest_template` SET `RewardFactionOverride1` = 105000 WHERE `ID` in (9719, 9717, 9729); -- Diaphanous wing droprate -UPDATE creature_loot_template SET ChanceOrQuestChance = -40 WHERE item = 24372 AND entry IN (18132, 18133, 20197, 20198, 18283); +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = -40 WHERE `item` = 24372 AND `entry` IN (18132, 18133, 20197, 20198, 18283); -- Greater and Young Sporebat also drop eyes. -DELETE FROM creature_loot_template WHERE entry IN (20387, 18129) AND item = 24426; -INSERT INTO creature_loot_template VALUES +DELETE FROM `creature_loot_template` WHERE `entry` IN (20387, 18129) AND `item` = 24426; +INSERT INTO `creature_loot_template` VALUES (18129, 24426,-20,1,0,1,1), (20387, 24426,-20,1,0,1,1); -- Added vengeful draenei, from Trinity -DELETE FROM creature WHERE id = 21636; -INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags) VALUES +DELETE FROM `creature` WHERE `id` = 21636; +INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES (21636,530,1,1,0,0,-2981.75,4378.62,-49.227, 6.20934,600,0,0,5914,0,0,0,0,0), (21636,530,1,1,0,0,-2962.8, 4378.18,-49.227, 3.08974,600,0,0,5914,0,0,0,0,0), (21636,530,1,1,0,0,-2961.98,4363.85,-49.227, 1.88651,600,0,0,5914,0,0,0,0,0), @@ -47,12 +47,12 @@ INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x -- Escaping the Tomb was missing it's goal -UPDATE quest_template SET AreaDescription = "Escort Akuno" WHERE ID = 10887; +UPDATE `quest_template` SET `AreaDescription` = 'Escort Akuno' WHERE `ID` = 10887; -- Redone Slain Sha'tar Vindicator -DELETE FROM creature WHERE id = 21859; -INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags) VALUES +DELETE FROM `creature` WHERE id = 21859; +INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES (21859,530,1,1,0,1,-3736, 5333.73,-12.50,2.1171,150,0,0,6986,0,0,0,0,0), (21859,530,1,1,0,1,-3750.4, 5301.33,-17.10,3.6650,150,0,0,6986,0,0,0,0,0), (21859,530,1,1,0,1,-3649.6, 5322.93,-18.15,5.3430,150,0,0,6986,0,0,0,0,0), @@ -63,8 +63,8 @@ INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x (21859,530,1,1,0,1,-3750.4, 5085.33,-18.40,0.6098,150,0,0,6986,0,0,0,0,0); -- Redone Slain Auchenai Warrior -DELETE FROM creature WHERE id = 21846; -INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x,position_y,position_z,orientation,spawntimesecs,spawndist,currentwaypoint,curhealth,curmana,MovementType,npcflag,unit_flags,dynamicflags) VALUES +DELETE FROM `creature` WHERE `id` = 21846; +INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES (21846,530,1,1,0,1,-3714.4, 5290.53,-18.75,3.3858,150,0,0,6986,0,0,0,0,0), (21846,530,1,1,0,1,-3714.4, 5225.73,-22.60,4.8247,150,0,0,6986,0,0,0,0,0), (21846,530,1,1,0,1,-3692.8, 5344.53,-13.85,4.8579,150,0,0,6986,0,0,0,0,0), @@ -74,12 +74,7 @@ INSERT INTO creature (id,map,spawnMask,phaseMask,modelid,equipment_id,position_x (21846,530,1,1,0,1,-3736, 5160.93,-22.25,2.7343,150,0,0,6986,0,0,0,0,0), (21846,530,1,1,0,1,-3764.8, 5106.93,-19.80,0.6078,150,0,0,6986,0,0,0,0,0); - -- Drop chance howling wind -UPDATE creature_loot_template SET ChanceOrQuestChance = 15 WHERE item = 24504 AND entry IN (17158,17159,17160); +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = 15 WHERE `item` = 24504 AND `entry` IN (17158,17159,17160); - - --- $11 = {id = 1, QuestRewFactionValue = {0, 10, 25, 75, 150, 250, 350, 500, 1000, 5}} - From 4e5cf3dd01048ce59b12575078b18e01c3829cc5 Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Sun, 28 May 2017 20:53:48 +0200 Subject: [PATCH 16/51] minor fixes in outland --- .../updates/pending_db_world/rev_1495729610203623150.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql index 583e358a3..fe8e91d53 100644 --- a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql +++ b/data/sql/updates/pending_db_world/rev_1495729610203623150.sql @@ -9,9 +9,9 @@ INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = 100 WHERE `entry` = 19188 AND `item` = 29476; -- Kurenai -UPDATE `quest_template SET RewardFactionValue1` = 7 WHERE `ID` IN (9924,9954, 9917, 10476, 9923, 11502, 10477, 9871, 9873, 9878, 9874, 9921, 9936, 9940, 10116, 10115, 9835, 9833, 9905, 9834,9839,9830, 9902); -UPDATE `quest_template SET RewardFactionOverride1` = 70000 WHERE `ID` IN (9955,9933,9956,9879,9922,9938); -UPDATE `quest_template SET RewardFactionValue1` = 8 WHERE `ID` IN (9918); +UPDATE `quest_template` SET `RewardFactionValue1` = 7 WHERE `ID` IN (9924,9954, 9917, 10476, 9923, 11502, 10477, 9871, 9873, 9878, 9874, 9921, 9936, 9940, 10116, 10115, 9835, 9833, 9905, 9834,9839,9830, 9902); +UPDATE `quest_template` SET `RewardFactionOverride1` = 70000 WHERE `ID` IN (9955,9933,9956,9879,9922,9938); +UPDATE `quest_template` SET `RewardFactionValue1` = 8 WHERE `ID` IN (9918); -- Mag'har UPDATE `quest_template` SET `RewardFactionValue1` = 7 WHERE `ID` IN (9867, 9442,10102,10085, 9447, 9891, 9916, 11503, 9441, 9906, 10478, 9872, 9865, 10479, 9910, 10082, 9888, 10175, 9863, 9935, 9939, 9945, 10101); From 1b979e10a3d8f59514f1739b5cfd19601af3b085 Mon Sep 17 00:00:00 2001 From: talamortis Date: Fri, 30 Jun 2017 14:48:56 +0100 Subject: [PATCH 17/51] Closes #493 --- src/scripts/Kalimdor/zone_feralas.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scripts/Kalimdor/zone_feralas.cpp b/src/scripts/Kalimdor/zone_feralas.cpp index bc6f09242..0db854164 100644 --- a/src/scripts/Kalimdor/zone_feralas.cpp +++ b/src/scripts/Kalimdor/zone_feralas.cpp @@ -129,9 +129,9 @@ public: //Second Ambush(3 Gorillas) case 21: Talk(SAY_OOX_AMBUSH); - me->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - me->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_GORILLA, -4652.76f, 1956.69f, 67.99f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_GORILLA, -4654.73f, 1959.71f, 47.66f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + me->SummonCreature(NPC_GORILLA, -4657.01f, 1963.19f, 67.48f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); break; //Third Ambush(4 Gnolls) case 30: From 8c624cc2f19101d7d884bdf34301c97adbd5787a Mon Sep 17 00:00:00 2001 From: talamortis Date: Fri, 30 Jun 2017 16:15:53 +0100 Subject: [PATCH 18/51] Rin'ji will now appear to be male and also can not be attacked by alliance why in cage closes #408 --- data/sql/updates/pending_db_world/rev_1498835613715251400.sql | 3 +++ src/scripts/EasternKingdoms/zone_hinterlands.cpp | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1498835613715251400.sql diff --git a/data/sql/updates/pending_db_world/rev_1498835613715251400.sql b/data/sql/updates/pending_db_world/rev_1498835613715251400.sql new file mode 100644 index 000000000..42fa8fbaf --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1498835613715251400.sql @@ -0,0 +1,3 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1498835613715251400'); + +UPDATE `creature_template` SET `modelid1` = '6485' WHERE `entry` = '7780'; diff --git a/src/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/scripts/EasternKingdoms/zone_hinterlands.cpp index 751acb721..a09f7df1b 100644 --- a/src/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -170,6 +170,7 @@ public: { _IsByOutrunner = false; spawnId = 0; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); } void Reset() @@ -228,6 +229,7 @@ public: void sQuestAccept(Player* player, Quest const* quest) { + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_DISABLE_MOVE); if (quest->GetQuestId() == QUEST_RINJI_TRAPPED) { if (GameObject* go = me->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE)) From c4d5b19ba55c0c69dee987420e3f41a7a9da1996 Mon Sep 17 00:00:00 2001 From: talamortis Date: Fri, 30 Jun 2017 16:21:54 +0100 Subject: [PATCH 19/51] closes #290 --- src/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 6813a94ba..d629c582d 100644 --- a/src/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -89,6 +89,7 @@ class boss_akilzon : public CreatureScript memset(BirdGUIDs, 0, sizeof(BirdGUIDs)); StormCount = 0; isRaining = false; + instance->SetData(DATA_AKILZONEVENT, NOT_STARTED); SetWeather(WEATHER_STATE_FINE, 0.0f); } @@ -111,6 +112,7 @@ class boss_akilzon : public CreatureScript { Talk(SAY_DEATH); _JustDied(); + instance->SetData(DATA_AKILZONEVENT, DONE); } void KilledUnit(Unit* who) From ef7d1c39372a717889b707abc6801aa6b4e67761 Mon Sep 17 00:00:00 2001 From: talamortis Date: Sat, 1 Jul 2017 12:23:14 +0100 Subject: [PATCH 20/51] pets should now put players in combat unless they are feigned death or shadowmeld. closes #520 --- src/game/AI/CoreAI/PetAI.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index 66edbc541..be2d536b9 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -307,6 +307,13 @@ void PetAI::UpdateAllies() else if (owner->GetTypeId() == TYPEID_PLAYER) group = owner->ToPlayer()->GetGroup(); + //if Pet is in combat put player in combat + if (owner->HasAuraType(SPELL_AURA_MOD_STEALTH) || owner->HasAuraType(SPELL_AURA_FEIGN_DEATH)) + return; + else + if (me->IsInCombat()) + owner->IsInCombat(); + //only pet and owner/not in group->ok if (m_AllySet.size() == 2 && !group) return; From 3561d52b109a566d4300e8b87ec4e4fc99a4d2ad Mon Sep 17 00:00:00 2001 From: talamortis Date: Sat, 1 Jul 2017 23:28:17 +0100 Subject: [PATCH 21/51] PetAI update --- src/game/AI/CoreAI/PetAI.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index be2d536b9..2ff2422eb 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -99,6 +99,13 @@ void PetAI::UpdateAI(uint32 diff) Unit* owner = me->GetCharmerOrOwner(); + //if Pet is in combat put player in combat + if (owner->HasAuraType(SPELL_AURA_MOD_STEALTH) || owner->HasAuraType(SPELL_AURA_FEIGN_DEATH)) + return; + else + if (me->IsInCombat()) + owner->IsInCombat(); + if (m_updateAlliesTimer <= diff) // UpdateAllies self set update timer UpdateAllies(); @@ -307,13 +314,6 @@ void PetAI::UpdateAllies() else if (owner->GetTypeId() == TYPEID_PLAYER) group = owner->ToPlayer()->GetGroup(); - //if Pet is in combat put player in combat - if (owner->HasAuraType(SPELL_AURA_MOD_STEALTH) || owner->HasAuraType(SPELL_AURA_FEIGN_DEATH)) - return; - else - if (me->IsInCombat()) - owner->IsInCombat(); - //only pet and owner/not in group->ok if (m_AllySet.size() == 2 && !group) return; From 45f74604c3977e013bd654e1df980699c04d055a Mon Sep 17 00:00:00 2001 From: talamortis Date: Sun, 2 Jul 2017 11:52:39 +0100 Subject: [PATCH 22/51] these checks are not needed. --- src/game/AI/CoreAI/PetAI.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index 2ff2422eb..712fb0c5f 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -100,9 +100,6 @@ void PetAI::UpdateAI(uint32 diff) Unit* owner = me->GetCharmerOrOwner(); //if Pet is in combat put player in combat - if (owner->HasAuraType(SPELL_AURA_MOD_STEALTH) || owner->HasAuraType(SPELL_AURA_FEIGN_DEATH)) - return; - else if (me->IsInCombat()) owner->IsInCombat(); From 4c9dd9197df6b2e68ac4b98aacab8f5ce75cd28d Mon Sep 17 00:00:00 2001 From: Inifield Date: Sun, 2 Jul 2017 15:39:06 +0200 Subject: [PATCH 23/51] Core/Scripts: Adjust dalaran mageguards range Resolve #473 I get better result with 5.0f --- src/scripts/Northrend/zone_dalaran.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/Northrend/zone_dalaran.cpp b/src/scripts/Northrend/zone_dalaran.cpp index 79476d3b7..f89c35de4 100644 --- a/src/scripts/Northrend/zone_dalaran.cpp +++ b/src/scripts/Northrend/zone_dalaran.cpp @@ -446,7 +446,7 @@ public: if (!who || !who->IsInWorld() || who->GetZoneId() != 4395) return; - if (!me->IsWithinDist(who, 12.0f, false)) + if (!me->IsWithinDist(who, 5.0f, false)) return; Player* player = who->GetCharmerOrOwnerPlayerOrPlayerItself(); From 49e61d99d3f2ec4825095fee8a4671aefa154920 Mon Sep 17 00:00:00 2001 From: talamortis Date: Mon, 3 Jul 2017 18:13:33 +0100 Subject: [PATCH 24/51] Fix Midsummer fire quest An Innocent Disguise aswell as fixed indentation. --- .../rev_1499101625045878500.sql | 10 ++++ src/game/AI/CoreAI/PetAI.cpp | 4 +- src/scripts/Events/midsummer.cpp | 55 +++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1499101625045878500.sql diff --git a/data/sql/updates/pending_db_world/rev_1499101625045878500.sql b/data/sql/updates/pending_db_world/rev_1499101625045878500.sql new file mode 100644 index 000000000..922103401 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1499101625045878500.sql @@ -0,0 +1,10 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1499101625045878500'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (46337, 'spell_gen_crab_disguise'); +UPDATE `creature_template` SET `unit_class` = 8 WHERE `entry` = 25863; + +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 +(25863, 0, 0, 0, 4, 0, 100, 0, 1000, 1000, 1800000, 1800000, 11, 184, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - On Aggro - Cast \'Fire Shield\''), +(25863, 0, 1, 0, 0, 0, 100, 0, 0, 0, 3400, 5400, 11, 20793, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - In Combat CMC - Cast \'Fireball\''), +(25863, 0, 2, 0, 2, 0, 100, 1, 0, 15, 0, 0, 25, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - Between 0-15% Health - Flee For Assist (No Repeat)'); + diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index 712fb0c5f..8e2516db7 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -100,8 +100,8 @@ void PetAI::UpdateAI(uint32 diff) Unit* owner = me->GetCharmerOrOwner(); //if Pet is in combat put player in combat - if (me->IsInCombat()) - owner->IsInCombat(); + if (me->IsInCombat()) + owner->IsInCombat(); if (m_updateAlliesTimer <= diff) // UpdateAllies self set update timer diff --git a/src/scripts/Events/midsummer.cpp b/src/scripts/Events/midsummer.cpp index 8fce374e7..00ae527c0 100644 --- a/src/scripts/Events/midsummer.cpp +++ b/src/scripts/Events/midsummer.cpp @@ -201,6 +201,60 @@ class npc_midsummer_torch_target : public CreatureScript // SPELLS /////////////////////////////// +enum CrabDisguise +{ + SPELL_CRAB_DISGUISE = 46337, + SPELL_APPLY_DIGUISE = 34804, + SPELL_FADE_DIGUISE = 47693, +}; + +class spell_gen_crab_disguise : public SpellScriptLoader +{ +public: + spell_gen_crab_disguise() : SpellScriptLoader("spell_gen_crab_disguise") { } + + class spell_gen_crab_disguise_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_crab_disguise_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CRAB_DISGUISE)) + return false; + return true; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + caster->CastSpell(caster, SPELL_APPLY_DIGUISE, true); + caster->setFaction(88); + } + + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + caster->CastSpell(caster, SPELL_FADE_DIGUISE, true); + caster->RestoreFaction(); + } + } + + void Register() + { + AfterEffectApply += AuraEffectRemoveFn(spell_gen_crab_disguise_AuraScript::OnApply, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_crab_disguise_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_FORCE_REACTION, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_crab_disguise_AuraScript(); + } + enum RibbonPole { SPELL_RIBBON_POLE_CHANNEL_VISUAL = 29172, @@ -513,6 +567,7 @@ void AddSC_event_midsummer_scripts() new npc_midsummer_torch_target(); // Spells + new spell_gen_crab_disguise(); new spell_midsummer_ribbon_pole(); new spell_midsummer_torch_quest(); new spell_midsummer_fling_torch(); From f36b6a9f89c66f1678d6fdc7c400a71cf9213427 Mon Sep 17 00:00:00 2001 From: talamortis Date: Mon, 3 Jul 2017 18:36:12 +0100 Subject: [PATCH 25/51] Fix travis & compile error --- src/scripts/Events/midsummer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scripts/Events/midsummer.cpp b/src/scripts/Events/midsummer.cpp index 00ae527c0..77ffe83dd 100644 --- a/src/scripts/Events/midsummer.cpp +++ b/src/scripts/Events/midsummer.cpp @@ -254,6 +254,7 @@ public: { return new spell_gen_crab_disguise_AuraScript(); } +}; enum RibbonPole { From 79210edf4b1fd7ebd2848e2cbf9fba17e6899c4d Mon Sep 17 00:00:00 2001 From: talamortis Date: Mon, 3 Jul 2017 21:57:50 +0100 Subject: [PATCH 26/51] Stranglethorn Vale chapter quest should no longer be repeatable. quote of the day 'open source your home' --- .../updates/pending_db_world/rev_1499115152422618300.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1499115152422618300.sql diff --git a/data/sql/updates/pending_db_world/rev_1499115152422618300.sql b/data/sql/updates/pending_db_world/rev_1499115152422618300.sql new file mode 100644 index 000000000..d37fa66eb --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1499115152422618300.sql @@ -0,0 +1,7 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1499115152422618300'); + +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '338'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '339'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '340'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '341'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '342'; \ No newline at end of file From f353f9b5bb08cde4d75b13c1c1c33ae35da971b4 Mon Sep 17 00:00:00 2001 From: talamortis Date: Mon, 3 Jul 2017 22:53:57 +0100 Subject: [PATCH 27/51] When player has Animal blood applied the D.E.H.T.A camp will now be hostile if player goes near. --- .../rev_1499118515042687600.sql | 112 ++++++++++++++++++ src/scripts/Spells/spell_generic.cpp | 10 +- 2 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 data/sql/updates/pending_db_world/rev_1499118515042687600.sql diff --git a/data/sql/updates/pending_db_world/rev_1499118515042687600.sql b/data/sql/updates/pending_db_world/rev_1499118515042687600.sql new file mode 100644 index 000000000..c6fd350aa --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1499118515042687600.sql @@ -0,0 +1,112 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1499118515042687600'); + +-- D.E.T.H.A TEXT AND SAI +DELETE FROM `creature_text` WHERE `entry` IN (25808, 25809, 25819, 25812, 25811, 25810, 25838) AND `groupid` = 0; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(25808,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25808,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25808,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''), +-- +(25809,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25809,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25809,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''), +-- +(25812,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25812,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25812,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''), +-- +(25811,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25811,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25811,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''), +-- +(25810,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25810,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25810,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''), +-- +(25838,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25838,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25838,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''), +-- +(25819,0,0,' Do you think us fools! You\'re covered in animal blood!',12,0,100,5,4000,0,0,0,''), +(25819,0,1,' BUTCHER! DIE!',12,0,100,5,4000,0,0,0,''), +(25819,0,2,' Calf killer! Murderer! You will pay for this!',12,0,100,5,4000,0,0,0,''); + +SET @ENTRY := 25808; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"D.E.H.T.A. Enforcer - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,10,0,100,0,1,20,0,0,49,2,0,0,0,0,0,25,20,1,0,0,0,0,0,"D.E.H.T.A. Enforcer - Within 1-20 Range Out of Combat LoS - Start Attacking"); + +DELETE FROM `creature_formations` WHERE `leaderGUID`= 132974; +INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES +(132974,132974,0,0,2,0,0), +(132974,132976,0,0,2,0,0); + +SET @ENTRY := 25819; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"D.E.H.T.A. Enforcer - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,10,0,100,0,1,20,0,0,49,0,0,0,0,0,0,25,20,1,0,0,0,0,0,"D.E.H.T.A. Enforcer - Within 1-20 Range Out of Combat LoS - Start Attacking"), +(@ENTRY,0,2,0,4,0,100,0,0,0,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"D.E.H.T.A. Enforcer - On Aggro - Remove Flag Standstate Sit Down"), +(@ENTRY,0,3,0,25,0,100,0,0,0,0,0,90,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"D.E.H.T.A. Enforcer - On Reset - Set Flag Standstate Sit Down"); + +SET @ENTRY := 25809; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arch Druid Lathorius - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,83,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arch Druid Lathorius - On Aggro - Remove Npc Flags Gossip & Questgiver"), +(@ENTRY,0,2,0,10,0,100,0,1,20,0,0,49,0,0,0,0,0,0,25,20,1,0,0,0,0,0,"Arch Druid Lathorius - Within 1-20 Range Out of Combat LoS - Start Attacking"), +(@ENTRY,0,3,0,25,0,100,0,0,0,0,0,81,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Arch Druid Lathorius - On Reset - Set Npc Flags Gossip & Questgiver"); + +SET @ENTRY := 25811; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Zaza - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Zaza - On Aggro - Remove Npc Flag Questgiver"), +(@ENTRY,0,2,0,10,0,100,0,1,20,0,0,49,0,0,0,0,0,0,25,20,1,0,0,0,0,0,"Zaza - Within 1-20 Range Out of Combat LoS - Start Attacking"), +(@ENTRY,0,3,0,25,0,100,0,0,0,0,0,81,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Zaza - On Reset - Set Npc Flag Questgiver"); + +SET @ENTRY := 25810; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Cenius - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Cenius - On Aggro - Remove Npc Flag Questgiver"), +(@ENTRY,0,2,0,10,0,100,0,1,20,0,0,49,0,0,0,0,0,0,25,20,1,0,0,0,0,0,"Hierophant Cenius - Within 1-20 Range Out of Combat LoS - Start Attacking"), +(@ENTRY,0,3,0,25,0,100,0,0,0,0,0,81,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Cenius - On Reset - Set Npc Flag Questgiver"); + +SET @ENTRY := 25812; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Killinger the Den Watcher - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Killinger the Den Watcher - On Aggro - Remove Npc Flag Questgiver"), +(@ENTRY,0,2,0,10,0,100,0,1,20,0,0,49,0,0,0,0,0,0,25,20,1,0,0,0,0,0,"Killinger the Den Watcher - Within 1-20 Range Out of Combat LoS - Start Attacking"), +(@ENTRY,0,3,0,25,0,100,0,0,0,0,0,81,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Killinger the Den Watcher - On Reset - Set Npc Flag Questgiver"); + +SET @ENTRY := 25838; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,4,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Liandra - On Aggro - Say Line 0"), +(@ENTRY,0,1,0,4,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Liandra - On Aggro - Remove Npc Flag Questgiver"), +(@ENTRY,0,2,0,10,0,100,0,1,25,0,0,49,0,0,0,0,0,0,25,25,1,0,0,0,0,0,"Hierophant Liandra - Within 1-25 Range Out of Combat LoS - Start Attacking"), +(@ENTRY,0,3,0,25,0,100,0,0,0,0,0,81,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Liandra - On Reset - Set Npc Flag Questgiver"), +(@ENTRY,0,4,0,4,0,100,0,0,0,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Liandra - On Aggro - Remove Flag Standstate Sit Down"), +(@ENTRY,0,5,0,25,0,100,0,0,0,0,0,90,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Hierophant Liandra - On Reset - Set Flag Standstate Sit Down"); + +SET @ENTRY := 25839; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,5000,8000,60000,65000,11,5915,0,0,0,0,0,1,0,0,0,0,0,0,0,"Northsea Mercenary - In Combat - Cast 'Crazed'"); + +SET @ENTRY := 25844; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,5000,8000,60000,65000,11,5915,0,0,0,0,0,1,0,0,0,0,0,0,0,"Northsea Thug - In Combat - Cast 'Crazed'"); \ No newline at end of file diff --git a/src/scripts/Spells/spell_generic.cpp b/src/scripts/Spells/spell_generic.cpp index d9dae48c2..880c3eeeb 100644 --- a/src/scripts/Spells/spell_generic.cpp +++ b/src/scripts/Spells/spell_generic.cpp @@ -2242,7 +2242,8 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader enum AnimalBloodPoolSpell { SPELL_ANIMAL_BLOOD = 46221, - SPELL_SPAWN_BLOOD_POOL = 63471 + SPELL_SPAWN_BLOOD_POOL = 63471, + FACTION_DETHA_ATTACK = 942 }; class spell_gen_animal_blood : public SpellScriptLoader @@ -2266,13 +2267,20 @@ class spell_gen_animal_blood : public SpellScriptLoader // Remove all auras with spell id 46221, except the one currently being applied while (Aura* aur = GetUnitOwner()->GetOwnedAura(SPELL_ANIMAL_BLOOD, 0, 0, 0, GetAura())) GetUnitOwner()->RemoveOwnedAura(aur); + if (Unit* owner = GetUnitOwner()) + { + owner->setFaction(FACTION_DETHA_ATTACK); + } } void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { if (Unit* owner = GetUnitOwner()) + { + owner->RestoreFaction(); if (owner->IsInWater()) owner->CastSpell(owner, SPELL_SPAWN_BLOOD_POOL, true); + } } void Register() From 6aff74cd1760b4fd170f8869cc625741e83a9b23 Mon Sep 17 00:00:00 2001 From: Inifield Date: Wed, 2 Aug 2017 19:35:22 +0200 Subject: [PATCH 28/51] Core/Command: Fix a crash when using wp show info pathid Fix #530 thanks to @BarbzYHOOL for testing --- src/scripts/Commands/cs_wp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/Commands/cs_wp.cpp b/src/scripts/Commands/cs_wp.cpp index cdafdc2f2..870fb95e5 100644 --- a/src/scripts/Commands/cs_wp.cpp +++ b/src/scripts/Commands/cs_wp.cpp @@ -783,7 +783,7 @@ public: if (show == "info") { // Check if the user did specify a visual waypoint - if (target && target->GetEntry() != VISUAL_WAYPOINT) + if (!target || target->GetEntry() != VISUAL_WAYPOINT) { handler->PSendSysMessage(LANG_WAYPOINT_VP_SELECT); handler->SetSentErrorMessage(true); From 10eddae70087cdb8b2f6ce9e5208cc061ef682fc Mon Sep 17 00:00:00 2001 From: Ercules76 Date: Thu, 17 Aug 2017 15:28:58 +0200 Subject: [PATCH 29/51] Core/Spells now the spells for summon mount aren't affected by haste (#555) * Core/Spells now the spells for summon mount aren't affected by haste * Convert tabs to space * Cleaning garbage of last commit --- src/authserver/Thumbs.db | Bin 17408 -> 0 bytes src/game/Entities/Unit/Unit.cpp | 37 +++++++++++++++++++++----------- src/game/Spells/Spell.cpp | 5 +++-- 3 files changed, 28 insertions(+), 14 deletions(-) delete mode 100644 src/authserver/Thumbs.db diff --git a/src/authserver/Thumbs.db b/src/authserver/Thumbs.db deleted file mode 100644 index a7bf7199aadc5b6b63c807a2199a1e1fa97a4bb0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17408 zcmeIa1yCK$x9Hn@;{R!{NGPR0O{Ya`G21q{)59iM5eH@ImaOXI$!Vs z0U!uWfjO`O&j2s5f#;Th2cDb5xBry>vnTi;oDl#v0EPT(pZ$kF{Fg5f;qrIke<}D+ zivLgR|4&x;za0LbssCS({V)0dydL;xjz)l!^gphLr)_IfT&$LP|H~lzuY&(Ad*DCP zf4IgA1x$3Zf0lksB}F+ccn!Mk#jTJBY8P)uaKajD2!v z4mTo%C6wf(wcTGG`dqqw`IYutl)n%`Rr)v?%yztp$dyx0YN@LIG)(27RJG4wl<;Lq z?XQsHt(Whh@ZhnL(~BwzqZanL_ocQk@uoTE67;143b`%J$w&UGRC1Z}+V^VsUp8EYhwlS7owq+X+T)Bj% z?;#l|871F~CAD|$#Ac^{a&jJ`Z2TViw0Mdn*JVVPqlTM~U^V8Kzf!FDLCwm`TrPe9 z8xwss`D`kRnG#ru?IMkzVlMT6Q8Ve!c+K6)kt^g^o2v+YVwE4(3b&Uw$sc%eCniee z4XE^c`X9;8^k}jbf4=0eV94D08CxQ`?%M3NzqcnELnZpsdoN8T2LE1RL(!pG^?S-t zYprsTTVvjjmyADZOD7C}vHcMEL0U9w#65jvSlRmx4>h!h$hdOw!kbs4n&o6xWRwt@ zQ}QSOC)X2o5iq*qn@N9aWMq^+c=sg5RBPneu0(UBz0oi)b=k<|$yU7*c_A7Ykh5wl zs8X)$yvsYZQ;xQnOD)0)zhNZ8Tr+0R4)+1x*ZkvQD$k@Uu|4Z@YD>!QJK~2P)(bXf zPb{_eU6k^w5li%QTjX+CDB`X+F4Kb7b z6KQ;3-3Q4;H|hwGKim8$+D-U$#erEWR9gIno0^NAO8L{;8Wn~2f!ZEyxu|Zg1U%Pv zSICDt(kFKI12$oi&u&?C0V{rNiSE1iqCEyntZTb?tflYriy`L$?nguYPP#|yUo*7{ zKYT7}ubS{FY|5{@zuJ8g!%xh$;MpXa*O;Sw;5u6u{+Nd-xcn^YX0_JBG5M2HTC`tn zxJj!Gm1Fpm&Wh@4#(ilRQ;m7#F~?+paiTjzfP=JTm^vlu-&KjN`^xK~L^jB0p1=Zj zld_qR{F$|*%vZNRE&KCwDj^oXnKn2XpVh#gHpvyYyeKM!@F=S=5}>WNzIlP%FvOPI zSo}&%=WwlXkFdEUPfj^UFJj2^Pw#8#Lz>a0#3T8^L?%cv@9x>{?uCi{p~TMazNDV( z+7zj<>sdtu`*1FSN~TJJ98H|eN_{g1lQ$2;%ScfTY%Esp5XUTQAaj+e=9?dUp%H4|=%w??=z2Zrlfj=8D%xX{^U>uy0J+n8@>pgY(tq&-Qo9ed^3IrDRdqgKbhcK)14yY(hnl6dun&%U4m zmPij0t2qktnerGTT0~?-l3oR2j$Q@rPhf$7fh_Mx6E85%pbqIm$!s~vg}^EwmR&sG z&$rZ;a`8R(61OwCOj9|2VxsfjB_j1>J{|renAVQVt}}vd8rkeq23cYTIFa2H*O zKxQ^gG;dhrf9(p(L0?XXVv>xE+3Abr&$?@Y@#yPsn|?^nW#7u%s~$%-6RKa2DL$^g zVnsQPq`3IL)$j?!_$!zDDLXmu2I|+V7=(@iaU^Y&czrntBSjE9DMlD)m33kVUW`>B zC(h-1g_T5JC%#Z70XZ0LXhF2-E3YidtNz==Kc@2f7o^CE5u-gd=a%0QCJ0$}I0-X8 z2-4FaO}REx6{MdLdloy%XjiMYR@7;&EqgCYZfwEr&-*UWoJLzE3STUK-7y82rA-Cy zc$%Ed2s%HlztlBtISVjua#k`V$8B;EK7G;h33vymunbo$1oAdFM9}__b?i18IQn@) z8M?%^z$Sw_&Lh)ME&ZOKA)b?x_KP4_&~*T_jo1;OIbD!)zV-c9R9e5)v5L=V^^iPF z+<6xvH{QQSbDG0Sa2lzSGue5UTpQ+eJ+NZi9dk)Sg5GC=S4UX#=Z`C(UE@h@uSTSn z9k`>#NgJd2iO)~v2F8~}j0|;M=Xbw9bH3`COGw-{{Xik?q~A1e)RPk+F$2k7hZ5Xv zq9R<)$Q_L^r<&S86bDhw#|daLICy0m0=yyXBPF{!05uys?<}l5Jtz z>N9rtXVR2Zc}|Xo*&-}KoLNhMjbL%E9LgKiM#hL3a>RJ9nDt1<9wcZD5?uw0Y!uEs z3FQ}l_vdf_%*OT;0xMsX9rT^|Kg@jH9zFUSs|z-}cE3ejV^@tNadzbjL8`RIVg>rM=-G=^u&hp>O?zLZhHfh@Z~wb%^!HGrKto z5AusgF)i8beuq0Gu5hs>{t2B9Lhm(fY45|ks^f2Yr`cy0S;^JgnemDJF<~WNwUKzp8Kx35 zn)OQrMclm9LaQQ9Hdm23GVBrG=3B}}E>6&IF#FWZ8!Vm4!sq)t2+Sj5)#JvaR>Zws zr9>Mo_;YK50Pend$}Vs2UwOoiI*430JLX-k$Rq|gO2X}CF9{dFuH*Q<1Tq* z`9=keZmJ34=J@ekeY5@kIx7NSCFv}?Npj)5NU2A)1@knTA+_Zh)5Kn?;l<$8#1{^% zR?a8cbcGNFGXt`lM}1ArA_WRY`;t%<@6lBC(Q=y_3laWwZ9Qa7`UIg~_w&vJ22OfK zrTLa~;ws0)?@Rm%f)E`b>4-Fy_Q0#YKuCK6C1IV$qp|+w;h-m7SBO){fYFNo>!|)Vgvol`^QhtRmbxxb+`*K;mDf+Cf)2F<>_e*t~owVGK z`N;q~G??I3hxcep;%<#nIt(w4U6S?UN0#m&e&ER<8+ic!>$M1lH+MPXF@AU>k5Y9+ z4nw0iK~qz|2ErpvQ)WgbYX3%l5NfRQVf__lnuPmWqfP18W$(HryT9?C>`VojKP>^_ zbAjShiXNR9G8uP{-}CmYWs*#Fe+>&ODiH7Rt0YcwkKXRJZH2o;GYI_ZgTCDB&_FP} zOPuSa(Q8!9K(QWvHT!g$#iZ}p0Qp+2&GaW8&E`krb4-Ot4Y5PL+>yyN9O;nGTw`Wg zx>WhZ=NU~T*;@Oor^}Omb-nRI;aAolFJuieyp5D87S`k)`+K*`22}L8RMd?!rrh!7 z+KkDV%xjsM*rP_g$H#Z?nw2lNHMW(SLv9Fr_Fv_qF4@F@xh_RtBPku4_2DR-zCUCO z1}_KcL?eRMK41>B?f2~3>#DLz`zw_R51vuUi|I8I-99x;Wb1H`{Wyv=D4Z>h-%%Ev zjHxXpkI_j*G8Po<#_!phIm15Tdm?aB*BWP57k+KX_GaqsN#gF>*>Y7Y5xt`gHaBgA z2n%^N^$Jtq#G;RJjOF`ZDq|E$qg$U_*iE^$s+5-Ri0m^VRM5@{hVkO4k=F?W>s3l7 zlmRj?o{Z>SDa+v)$j)jlGnN_VB5SBoL&M~miGtZ&!kST9V&>_fGgl!C=0Oh3&r3`hPo#|0@HW!QTtCe8f_)Q)s(oDUb zjgk|$hsBhYaRWUZv^R*? z%{?4g3dJQHw#LO`k!fn4O4S-BFdHKxN{YiU-JuLqZ9{vWBtg^` zaW%c;4qsp^QKT5h`2c3oehB^U%d>pIToCDP=gyE8`(!g{mwYJH{$3)jo$tC0@s~op zx))*_y;OMmW7EpB*uVZZ)e1T+dE#Da?L!%Pj^} z8oLg%-~U+MEwv2cM&Tzdvj+xBoVlNd!?4+hnxn^j2 z-838S_w1Kd^tpE{Zc=q1EpCr=HAShZ4t{pPaFfJ%^p^kK#LgG6^5p`Dub1!4n?(oE zm7}Hhv87Y&28sMJG<+C*d#>%C+uEi^8Z4L;7hG{~;p3q_lM*5o7)HTGXoEt6m--}i zf>lN|)RRgz|F|7FpS#oEU@k1u5C4R~N>CPc6sgZSB^K29RK1c?d7@;%2y{cONx;=0OAKmP$9tr@uEa~+Ml9B0TBe&p*7^4I~JRH%fO8x8r9DP8cHEv z#@ZdBCBB3!ra=o$Ra7apKT>UJo6`W0AVJ9~)X_u+xrMMMF8xQ8GKMJh(*2WS7u+TE zgXX0C`LG(H;0ivv!hUQO6CHwb+?FG)o8zrZ!4&(UvvIE~o{uke^?WA$_5#E%?;@QJ zH0qt7TKf5BA{FRW`rbP$Z}gj;5wDz`QB0i7j+EFF;Why88^P}@Wu9T27~ed_>h;XO zWKF=bFR$f~zB+}41>TH`CTXHNHU&nR>+dePpxJS&7?6sA8qzoRuEU*yYVX>}-mS5o z+GG}-WeFDuWEM`GPe!_idGSzon93)g&NEGox+0EXo2%2mBX)yU1!GoCQ*3>j4D(h9B&D?=o%5 zEhL7!YNxXz6F*-I6cRT)S^tX9{SY(nzI!RE!$gH_HnYSpuwRyTFL7p1~G2GAV>3GA5!jh%mtp+xv=9z z-4r4#PYdlbzZ?I>n*(C4qq4vSH`UB$cj?h@ zKG~L5T008W9KOm#({K^tc2)T4zI#XBvw1&F5B1nc7?d4if_A6NTnEDDsRiN0(&-|%GuK5Fj9|NDMLEkj* zuKgxkJ?#U=K3VnGwD+4XE*{b$$BS_%tJ1(+PI=hGY2%Dh_(L|zk|$Pzd7U9o<3rwK`oY%MLkKYM*WUtYs zpVjtnkZ;QtMxzeTKSwN)#Na`+elH4O_H=pC#hax9Bx)4hkr3 zrfy8heUlKw&19k1Ps5&}@pkh}%zV5l$)x9WBHpsGS~*q!5DzJG5T^;nqDqQ<9i#ld zy7pP)#kGfF-{IhRdo!)m0t!N?sN37a;$#Pwcd~dv^|~4*j_Te|hWQW!KOosV@|ng3 z$Il~e3IgRAriNhaO$~P7!=QlHc>SSi@e3xiA=zz@$-+0X7aSe$ny=^j`FK6mXLLW& z6xS#AmhRd+mrmMy^Pe#QELVXM&4_PghNEf^S9TdBkF@ zHE7P+K_IN7H_W_|DK+w!s?`^c%C8mVD4+oe*xK2t_zXjKx+JEqDC1}HO~AqL#aE+o zr3}_+=@6b!@<^VQPD(>2P)NdAcVfpi{OPz1+97^+rwpYTW83mz;dO<;D9!cJ%%AZ3 z2T@Gmc9DT>p~_(rkZKA6zUT3(QHwfSG_aJ8+>-UGLk_CC4%a2j8eLqL*$^el#9J)Z0toiwPbTk zt<%*MqwW4t-%Obn%+^iak1LY}tYmpCPP+6w^*(*`yVlug?L*1bkh1i+IOun${ttT{u zRx!DwR}RQI;zanBLPsq8#?$}{B3duS&!g_>zuU^{r4%CPUurB&{d5>18v1n(R5Z+B z3&3V4z}kWSjLpxi7MyM(4LVeiiV1J?f`%X@{kcZ+`*N=I^sJG9H5`;9a*&4(GC#j? z6v!e{ux7VFVC1s|9YXwREf$=b!VV%A9eVd(L*9uwYy+~a0LWDi37oQ`B`J@C?Ds9i z6{I>+5$Lrmmo`R-yx-$^bkU>Ru>CG9(~R_!CvIdFPcH_Fx+y16UkauS{OX^!r#|P! z7rU%TSZ=Fi`*zxN_KH1Jm3Ww+oE6v`y%5pZ(+x=y<6>S~%C4DCKL0*VZ*yZT7|F5p zS<(AffZqErL0VJUwkauGm?RMx--0~7cVfH&7#U>-;}ecjFW7*)R+Gm@lilC25bELj zqfsOPBP3OV!j?xmdXt{?mC{LaztppKW`TRPf-{!b3MiPjeOSQ?4#vv{6D$T76j4$Co(E+x}Kj9Ek$A#OsTt^nrTxqEF9xB_BPpEANHF1hp3n zsX9pI{m6t!Nqe}cq&IQr+ar#T6rAq6>#e+P<#cJ~3bAV9(=kzQZrrmL! zCbz8)RrnKwPUUK@qXoI>94IJ`@eZUOB1Y`ksepp%h+=QLxR1sfGLp>TLk_;?&!NJr zxNxl^(?Pp>2~B&rmOkJswE1LrK@f_H9VBS z8^Xp*y3!I*il$mD<=>M^z;70Ss$hS0&lgy@oWU)TT#7@dC%&C?>y=kfYgoLvDa>qW znlJc#kcRIaI%(DdeRWj>Iw0ViyzDUpU2Z_KQ8M0bqb}JM!w}Sr2FQ zQz)$MHW%6v#ZhJ^K+LCK-X1bQ4^~|D)(C+vaHyl$|8Gi2mTkuKp9|09?rsClnj~?ONnt$aG5yNAOw9sJ9!T z@FGd+_-Eq8%ryOZbTrG-#o%5>eUFeZ!}>7p34Qcu4xcf{YBJPwMFL8NkEu=@@-{L% z?3A^F86q+}=T8-l-nYB&d72xzW@nu=ElL@ip}&FG~8J(IH zzy7n03@Fe*i}SVEPzwOX%#*xTOIdUGO-L?}f!qN079V`yd&rioG>rvP^#hso%m9X< zwLDJa3SGG{;uCUI?@Q@gd;OI;2dxV0hj&x1qUivyGY^YGm^+g;!@e%WOb%7t9%Lga z@c^0^AiFpaWE(Xcnd&4wUG|n_k$_v=>Yw%l>golpJRsx@-u!&n!^@jR@h{;n>`<(n zj_Mp}En+X)&#dj@*nbm?!5O()8fMRg{~JGPxy6{!WQ+XF6i4h8<8 zj>|`((X)TU$QW)VwAT^dc}y2yUUnj;w)2n2-f^q^ve*}R>1pQQ#w|Mp2T0)-LBSr61GStn?pITmXujQ1yMx|GW8ypOlKU+tLzG zi-j6z1n&?>yVD^^nj3IVEP)Q@UwA+&C{Cws_w+Fv=1v3Ty3Dn! zZ3ht(#IssX@zadXR5ZoeyyFf<-Et{QXQHjtGfT9~h#zvES&wgz+G_YZ`%vC{@1l@9 zUf9|+Ue6NTa|BwX&Pv7rHDQdl$&e$r2!wNwEi?{Rc49Z3=qjX`Ob;TR(YVb4!o@aG z4!_6Mn#D9j^*QypT|wtf9LT7hwXL+?X0PSzz1CUWsQd&TR7+izfg$$FqH1ZzNM&+$ zrGYJ7+%AI+)V@&rVX_E?kzbG5BiolxpiC0kK?5oEhLDwkw8&Y5NNsB683$~v!DSzwWB?21KmCpR>N(2$ij-P(slVW^ zH;kB>E@;LHiB0Z1fLR%=E1}IB|0yQYjxoFY4T?iaXrFFcP(h*SP}sG1%iHC%Amhhg z0jt}5Mre0IdA*+R{&e~9&p?!^QL;~?Z{yS1Zwf3Q@bz2t6#hg}Q_Hm4)^=gM;#*7M z_LN$}{@L!SH*_dE@N05>KVdZRerRWy(6F@FE(rk@r#4%r2ze|h?EBcj2(hH@tIiR! zV!wb{st~V19WjDAHQz>yX4Tup>R{7o(VesRyySrW8vlko+xEgs986F z5oz6QG#*9dnZvK#qO#J&{JIxc_o%gOz-r7wx06#2+X4x;XLxYP3?v@oN1`C01og97(zAYl<6sR-H?bwfPnn|kX1ZB z84|_cvBBM2cZ$+rTw%TwslvTeNSw>^kKTG6-mciqcW0MNMK}I;%i~?GamnS?KI<$O z%@P~<)HtT&VKgrZqzqEuO$ss#=y2_d`s%(j-?Gie;wN5q(D95^0E|0se07Eb6Ey(#^8W^V zPgeV=Ug7~$j343H*d82jDtLk<9*O7_(r4Wv;EYO?UEqVlpfQx@8+B>v6MJKS|5?;z z$Ai05c%-T-V#lM;{>MgMv6QMTnskA$r|_p?bbF=XLrpW@J#s^MBB;3duB7vHt>-cU zyy*#1pQ0KW9UAZ0W?RfG#N~MNiO;uz1{B_dLS5Q*hc5B7%O5HfKVn6iMK<%cU#Pfw zP1>uZQT)m;_2m>q>1?L{9dI1`Rn5AGckeahLID=c!0ZdKHAJ)b@r>tXARdr z4d=S#a+7C=nSb31hUs0xh}Pa(O<<;XybM^2Qks31*zIKLq(XG(J)(LU@M(Id1@>WtR(qIKGE!*snj8jV?&8X=` z8w+RQS<&gIZ#jvzwpn~PAGR=q4hnE9GfeaouXlOpj6(_a2h5a6oZIXc3aUH_?#2Jy zlJ5UPDsp~VRF#nQ(0nbv{#xCIQhR_DRwTVLFi4`@|J(C++sW+>#=Tnuvqk-Dtty7G zI1C#HSTQVFHltSFsVy|EokyzXD_@9iNDPi=4*KWjtYl@9;7Yvmk#7{fD=E|iYX@=` z>KzDT72n~eT~qIyWeNtsspZ8AK0wKpMd5KxCRcy*y>TV2ok_!qpl0u)fqt;Gu;DYX z!vyy-jFuq-EDG^t_}JYe5nnGOM}h`U_zATaNUuHbsVJZZh25Io^tsFMZ>uO{Kx?nLaYU^`qd zjW7XS`jL(0;vvsSP~rH|rYM6y*UFeiwhVE6b_J8P*~jE7%VN~0>EV*)dz0%eH$R1# zn#PR}B`T$&OKqG!POQ5w&mBpa(9^YzTM6T`0-NH+_hfv8Nk`ObuaPkaFm2DNTJP~m zA<3aOc^EYY*TuHFEfIqtaV5M+E!$l2C+aJuMGWPM>8_IFoI0!;(T6TP@bw@KW$AHF z^wG%I<=k&DW{Dk=uJCXmdGB>yEqN^=6%b>%-GbHF4kvE!F7qz`UTzv~ zf8Lz_sK!R9I`s5PAVbljpKoG0I~1~8$j_l5Wy>{qxPBcHW4_pSNsDeE88?n-*zv+x ze)fbM4@HS}C_%BE3w$ph4fnIwwf8;qBM_i&V)=o>J#^`Nn&5p*K30Sx$V|PQ(EaD- zkNgky2ix6;CVr<633ulL+N-vlX2kd$($Q05{8~uFgZtm(oU&WRqBeV{xRp|*x6?J( zeXM2IBron5S>5x=J(R6hV%<+pP*L6_y7PWly<{DKYx$8yC``f%jVCgc zZY0KsD=@2_HZZG|Hl_WPIU-YZhHmU!h*>uvxD~glvKuVA5P7y;KTvwC&)ZGjZxh|$ z1Re^YCI{>-PG_^RpQfDfqjA&ZQ{nw^4Ft3LJdP#aka zOpfA%JgGa+0P-!V|}yD zj35>AHPyl9ow;NR^aCRQn8|>m9BMRKSKaB(b{G^9N}~uc#Js_GPP!StTQ=8XRpqHy zbSSr;8(!sYLAIuPzgwMe`f5z%1H-tMYk8BFPyBuMucY@6t#aItc2|ZRf_Jt{lBvXl zRgV(S3}Q==TR(f|6}NGpT#2CQ5;1mQ;k`M)NXQ{nt-Bp&h3FFZuXq|KTLYQ^nSKUv z;|j_CX4=T4aeL2k(k2-3ojQG<-n3lMgCOp3eaJyx&%Vt!IkaCVTF|GpkbDQ<%Y~YP z8511%XoHHj90qzYYiK(x$z1ZLWh1@Cf14piY5(VN0E&>Z9=#k+ll+#-1lq_fE+RdUqA}_=+Hcj0a-8Vd-^R85y#1K_P zpMn&E({=g>6-Ed(TNAOs$eVCtfWTgeJzEGgel4-C{`!{XW*3FF%2et)3vYn}i z@}4?|9_o2i@C)DKHJ2>pRh~k@I8sU+fXOYjSk6L)?;IyL@*ptQK9ZYxx+$+?%9HYM zh-m6fJAG{r<&thPp7WI%Y_i`OGDwHg_$B&(d4Y}ehBB`=2ie80sRxyDhcEB1V6Nv^ zu6eiZ^Is)>GTAFx$co7{g?sR-@ZUs5T${`8;8?KPV)yrHcsxf3c(?^5p7Sw-Q>`Uy zm)vHLo~84@9{+yqcZ0wJwKlWnJw!J3F zj1)pMcZB-1ZcdJ1uOnDVF~C6tGO8uSs4xvP9l`PG`Sz!D?;~fmbaoTU*2li3;m?2m zIx!tytiax6`s>Qk=$WX;=o&7?8{C_iLvg`3SYL`OqcKm4?smbc{T``aY0XY#t=sJ&}VEWj1iTU~`D?G(MpWI5I4G@LEz z4>)=q6cx`W#_xMpV60~v)2-hOPWk0Z? zKoah0_kg=`Zf-m`r&U68>%}X-^{LKrDahab=}gisvjO_!_cc!N7nZX6reU00*kpfw z<~wE2cS3Rw7(vskI41}4RBK??55OVh0$-JULr+VZAVpVMQwb?TEEC1#lSBJil=pt# zN45n8El?46XcSPYp!ewT+w^&z16u2sEm}Z>1&^g1a4)+VZDQJ$`XK>1(TTY;K>C9o zb+IX6%g}h5Kl0lbVS@U(xMD=5XftX$Aqm%Ssd*o_+!=&7pyh7CkAwU1f_l*L;KQ>R zI=76&VdAElxwd8vaX0g@hjlNvP3mQNGZ_H^o2GHYx^gPdtien&0@tbR7Y=^<>5vNt zo9g19qK^@%M@D$v56B76T0S)K#6sju>v1D~puo1%+FV7acfAkD>lLr%E@C7owaUO&bEsz0gFCC2UPUXFTZ>r zIa*p`Aq{V9f^?!@SM>)>KgQX6J@R-W>oc`SjkC|M7itOHm{dn;gKVm?BbInp=!!Tn zb5<31W46%lEY`{FM4eL0u;GJr1WdP&HHL~I9Aw7G7)S_5Fa6{|=!lN9*zZg^L7jS+ zT$b_WOTzoYrOz_BS)-8DLy&Q3nT)N{66&+?_rcEji9yiS9CfTO@)^~j8i}uJ{WrhB zBpN>bfT0{M9K(yeSOT<_=Z22N;2WPb$krTV0CD#1>D4~p|I&gGoPEE?3pxO6^}JpG zIR-8jof0|fXI>(~&q06>kWv3aU}Fs~w6*&FhSg353N8g#2a~bZ?>r54YA48fRG=9r z>mT8vKN6OSOz{onx76Z5+YfOATy50Q9Yn621~mS?uBP1FzEOIY&#n>=cQ3ti)NzCR zUUqzU<9m^yEA-a*f8sZW2zyd~^jI=h`&1)?E^P==l~1g1MCK7c-(uz(rYNQk~!RRZ=nR(q<=ts40 z;io+t7%~H4m&dURk_dfNO4H=wMjI!EhO7z_U}1nyLWMOQu>u#kFBX%7H+yX?TukOP zS~la5jhEUkBU}#5m*<*Hg;QYU4}-P>Jv3zt;9*&_ppqmLmNNk&pVih1F)w zfyQ1^s5w?!Bv*oWQJs-t6n824ki1Blt^*HS-m*?3CKrCVS93jQtBAZz5ztg$@@Qm5 zAZn--r}`0y=jf+}HV`iv`56gJqr=~7lwzfF_>2x~sJfcgWd=0yM*;w+ll->n@n>h$ zHK7FImrs(~wJVjCa9{fs{Sr5zU}Ebv%2Dwl0sn7;^TS-nTKl?(krb zS2VVCw2c;Rb?{5`SV5)6)2p5Qon48o!~ukZB&Q3r^T6wOiFOZ*D$mi(P(Ui_ z*$fj{fdWL3Dr?j*_IzezD+#%y%J%ArF>@|`aX$GmS6xVtYITY99#`9s0V;(GLkORC z(8R-MD&JSJKWe07NS;BOTbCAFou^HIKTBT$%ayUNzOv*>Tc{ZB$$uHb>@zD6B-YL* zY7v!67hYs~bSk9Paa)e<$W?fXSviIx&o>(TThToZ8t~LiAL$*G6*5KS(Ji4d_EM1I zk}@b5A$#e>{sl-1xK8G(w|H2aQtQ1NtbLYhO51HDfVNdFkbb0*lWC#ELlRAOVM={u z%#t54;QeVP@jB`{@p@-2J5?R6W6aSjHS>`IC>EhAALD4P&Bo(7FHu}=P!p6Qf1{zn zNswY2kAqRR&ZY}Baxc%@1SzmEWW~HBRpUxTB2`9TnG4t{!jY{_PI8exc9TMY4N2_{ zu4ac$(^_3^E$}(7+oh2|=8XhA8(AvjbDeP)$$zM9cycry_WI2;%IK6FfOu$LoY^aj z!Ois5FBf`)u#p6s6vl_{SZ*d()5N8xP+(UpI~BWc)54WkOxC#*N#A_J+`7EJ^v?Qa z%+k}MDruj;{E<><;aq}4PQNv?$Aw{jF@O1SM=m@nioVY@qWI7vuCAU+5G2j}PqCK& zPU6$xp^#RHo_eUiX0oLQMdPd(ApAHVVP&tD?)ut`=W5`?G<6tavM~S`4gSRrSfutm z8BxCk{5i0uGdkQ6Y$oap9zS*19gV%w$o1n&WQ^a{*KJGjrA#YhzxURSP4^v3YfCwF zuz5!CSN!yj$(CDi#^P&ePu8_iMwp8F!eO#0D^TQH{^5Zp4xm zZYm);Iu7&Fff;7>ts7||WCO6}P*s=&U{938#4PD)?}Y z(&79dR<9ATy}KgauVQ+LjCoCRw(lt!AXw{vSQr((u<=b@qa|{vJg7XDkWBWo;JY|< zXqr&4O+C_uBJkBdJnUxE109u(e*+iy#7#L60tu@sfH^sz9#HzC9aF8O;MrJ{MA@#nZ5Hm?9?OJIV_1rox8|PUWn`Bgv5Y8 zjXXQWEKiRIB9))W0#QV3MFQD>5Y?ZdpyJg?Qk`JP@mw=(L6dfbG0f|GFI^1 zfi#0TAzgyi8a;ekd~MLnLjCpMbh-nCsN@1&3B_<9oXf|=D_?@+eTKNU*GNDPeeL2ZU!ZvJ{iP=@?~T$z1+i6Gjbts!Z#W~|q0xqdDiZ~eGC$|2HBXi`37$VN8c4J*#(-nQ4&{d195 zr}R~yQE{vNr?6Pa!P#=8$fGd@O{px-jV7`@25O}FqyjwD%JNXMSz~;DYPH`7h*^Q$ zydTa&AF78H0E3D2Jkpj3pl2Hh(L5lnam!VPl zAY5P9#iS8vYLUGN_6bfX!^Wj6e* zBoy@DJCWe|YtgV5BMgiXd;w$Aw{_BZpl|ua7G?9o&U{!fi@w6GB~r3gc0z#;_0_@? z*fRXT3!t3J2^h?$nBb4YkVxKbJQL&sK^8j(yKG}aj7-;O;!yB4LgkH%rXntxbOmw8 z&35(}UxcsaDl?$~BP`!UX+;E?9ORa$BtA#Ml;JZXr+vPoNeY`sUHo;AJ$ipepNe4b zJ%$Jv$)euTFhZoflQ7=8G3d3?LN1Ky82zy%58EYtK1x62V~9lTT6V#7x4RYoJm9wH zlCBIrvRh8a8a0OaDE)CReGq3i4Wvo`+7^HvchNt|i*QU*;y1Q*=T{;75m&N4JO=(| TB~X%oAy+127VwY!|91Lsel#zr diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index 164775656..5508d5fce 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -13635,25 +13635,38 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in return std::max(duration, 0); } -void Unit::ModSpellCastTime(SpellInfo const* spellProto, int32 & castTime, Spell* spell) -{ - if (!spellProto || castTime < 0) +void Unit::ModSpellCastTime(SpellInfo const* spellInfo, int32 & castTime, Spell* spell) +{ + if (!spellInfo || castTime < 0) return; + + if (spellInfo->IsChanneled() && !(spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION)) + return; + // called from caster if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CASTING_TIME, castTime, spell, bool(modOwner != this && !IsPet())); + // TODO:(MadAgos) Eventually check and delete the bool argument + modOwner->ApplySpellMod(spellInfo->Id, SPELLMOD_CASTING_TIME, castTime, spell, bool(modOwner != this && !IsPet())); - if (!spellProto->HasAttribute(SpellAttr0(SPELL_ATTR0_ABILITY|SPELL_ATTR0_TRADESPELL)) && (spellProto->SpellFamilyName || GetTypeId() != TYPEID_PLAYER)) + switch (spellInfo->DmgClass) { - if (CanInstantCast()) - castTime = 0; - else + case SPELL_DAMAGE_CLASS_NONE: + if (spellInfo->AttributesEx5 & SPELL_ATTR5_HASTE_AFFECT_DURATION) // required double check castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED)); - } - else if (spellProto->HasAttribute(SPELL_ATTR0_REQ_AMMO) && !spellProto->HasAttribute(SPELL_ATTR2_AUTOREPEAT_FLAG)) + else if (spellInfo->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat. + castTime = 500; + break; + case SPELL_DAMAGE_CLASS_MELEE: + break; // no known cases + case SPELL_DAMAGE_CLASS_MAGIC: + castTime = int32(float(castTime) * GetFloatValue(UNIT_MOD_CAST_SPEED)); + break; + case SPELL_DAMAGE_CLASS_RANGED: castTime = int32(float(castTime) * m_modAttackSpeedPct[RANGED_ATTACK]); - else if (spellProto->SpellVisual[0] == 3881 && HasAura(67556)) // cooking with Chef Hat. - castTime = 500; + break; + default: + break; + } } DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index a72675b7c..255283c61 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -3758,6 +3758,7 @@ void Spell::handle_immediate() // Apply duration mod if (Player* modOwner = m_caster->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_DURATION, duration); + // Apply haste mods if (m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_PERIODIC_HASTE, m_spellInfo) || m_spellInfo->HasAttribute(SPELL_ATTR5_HASTE_AFFECT_DURATION)) duration = int32(duration * m_caster->GetFloatValue(UNIT_MOD_CAST_SPEED)); @@ -3780,10 +3781,10 @@ void Spell::handle_immediate() // process immediate effects (items, ground, etc.) also initialize some variables _handle_immediate_phase(); - for (std::list::iterator ihit= m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) + for (std::list::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); - for (std::list::iterator ihit= m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) + for (std::list::iterator ihit = m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit) DoAllEffectOnTarget(&(*ihit)); FinishTargetProcessing(); From 2afb7676164db217339a4bd94f4fe44358411bb7 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Mon, 31 Jul 2017 13:01:44 +0000 Subject: [PATCH 30/51] Minor improvements for OnFirstLogin hook it can be casted with AT_LOGIN_FIRST flag check --- src/game/Handlers/CharacterHandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/Handlers/CharacterHandler.cpp b/src/game/Handlers/CharacterHandler.cpp index 08e301742..d3c294977 100644 --- a/src/game/Handlers/CharacterHandler.cpp +++ b/src/game/Handlers/CharacterHandler.cpp @@ -1072,9 +1072,12 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder) SendNotification(LANG_RESET_TALENTS); } - if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST)) + if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST)) { pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST); + sScriptMgr->OnFirstLogin(pCurrChar); + } + if (pCurrChar->HasAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS)) { pCurrChar->RemoveAtLoginFlag(AT_LOGIN_CHECK_ACHIEVS, true); From abc01d62f6cbe1a44665d901f60d3905221ff51c Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sun, 11 Jun 2017 08:44:36 +0000 Subject: [PATCH 31/51] added more info to run-engine conf file + added a function that could be useful if you want shutdown a screened server at restarter crash --- modules/acore/startup-scripts/conf.sh.dist | 28 ++++++++++++++++------ modules/acore/startup-scripts/run-engine | 11 +++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/modules/acore/startup-scripts/conf.sh.dist b/modules/acore/startup-scripts/conf.sh.dist index fbf31e3ca..774a7c01c 100644 --- a/modules/acore/startup-scripts/conf.sh.dist +++ b/modules/acore/startup-scripts/conf.sh.dist @@ -1,36 +1,50 @@ # enable/disable GDB execution export GDB_ENABLED=0 -# gdb file +# [optional] gdb file +# default: gdb.txt export GDB="" # directory where binary are stored export BINPATH="" - ### Put here the pid you configured on your worldserver.conf file ### +# Put here the pid you configured on your worldserver.conf file +# needed when GDB_ENABLED=1 export SERVERPID="" -# path to conf file +# path to configuration file (including the file name) +# ex: /home/user/azerothcore/etc/worldserver.conf export CONFIG="" # path of log files +# needed by restarter to store its logs export LOGS_PATH=""; # exec name +# ex: worldserver export SERVERBIN="" # prefix name for log files +# to avoid collision with other restarters export LOG_PREFIX_NAME="" -# name of screen service ( for restarter ) +# [optional] name of screen service # if no specified, screen util won't be used export SCREEN_NAME="" -# overwrite default screen options: -A -m -d -S +# [optional] overwrite default screen options: -A -m -d -S +# WARNING: if you are running it under a systemd service +# please do not remove -m -d arguments from screen if are you using it, +# or keep WITH_CONSOLE=0 . +# otherwise the journald-logging system will take 100% of CPU slowing +# down the whole machine. It's because a systemd service should have +# low console output. export SCREEN_OPTIONS="" -# enable it to show the output -# within console +# enable/disable it to show the output +# within console, if disable the output will be redirect to +# logging files +# export WITH_CONSOLE=0 diff --git a/modules/acore/startup-scripts/run-engine b/modules/acore/startup-scripts/run-engine index a12ebbc3b..86391f02a 100644 --- a/modules/acore/startup-scripts/run-engine +++ b/modules/acore/startup-scripts/run-engine @@ -5,6 +5,16 @@ if [ -e "$RUN_ENGINE_PATH/conf.dist" ]; then source "$RUN_ENGINE_PATH/conf.sh.dist" fi +function finish { + if [ ! -z "$SCREEN_NAME" ]; then + screen -X -S "$SCREEN_NAME" quit + fi +} + +# disabled for now, but could be useful if we want +# shutdown the process if restarter crashes for some reason +# trap finish EXIT + function configureFiles() { TRACE_BEGIN_STRING="SIGSEGV" TRACE_FILE="$LOGS_PATH/"$LOG_PREFIX_NAME"_trace.log" @@ -100,3 +110,4 @@ function restarter() { sleep 10 done } + From bd4ec74318ee16b43870da49660727cd2847e2ea Mon Sep 17 00:00:00 2001 From: Matteo Date: Sun, 7 May 2017 13:00:05 +0200 Subject: [PATCH 32/51] Created hooks for first login and LFGMgr --- src/game/DungeonFinding/LFGMgr.cpp | 8 +++++++- src/game/Scripting/ScriptMgr.cpp | 15 +++++++++++++++ src/game/Scripting/ScriptMgr.h | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/game/DungeonFinding/LFGMgr.cpp b/src/game/DungeonFinding/LFGMgr.cpp index 497eeeee7..14b7f1e29 100644 --- a/src/game/DungeonFinding/LFGMgr.cpp +++ b/src/game/DungeonFinding/LFGMgr.cpp @@ -419,6 +419,9 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */) lockData = LFG_LOCKSTATUS_MISSING_ITEM; } + + sScriptMgr->OnInitializeLockedDungeons(player, level, lockData); + /* TODO VoA closed if WG is not under team control (LFG_LOCKSTATUS_RAID_LOCKED) lockData = LFG_LOCKSTATUS_TOO_LOW_GEAR_SCORE; lockData = LFG_LOCKSTATUS_TOO_HIGH_GEAR_SCORE; @@ -429,6 +432,9 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */) if (lockData) lock[dungeon->Entry()] = lockData; } + + sScriptMgr->OnAfterInitializeLockedDungeons(player); + SetLockedDungeons(guid, lock); } @@ -713,7 +719,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const */ void LFGMgr::LeaveLfg(uint64 guid) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::Leave: [" UI64FMTD "]", guid); + //sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::LeaveLfg: [" UI64FMTD "]", guid); uint64 gguid = IS_GROUP_GUID(guid) ? guid : GetGroup(guid); LfgState state = GetState(guid); diff --git a/src/game/Scripting/ScriptMgr.cpp b/src/game/Scripting/ScriptMgr.cpp index 356ac8313..bea0e71a0 100644 --- a/src/game/Scripting/ScriptMgr.cpp +++ b/src/game/Scripting/ScriptMgr.cpp @@ -1379,6 +1379,11 @@ void ScriptMgr::OnQuestRewardItem(Player* player, Item* item, uint32 count) FOREACH_SCRIPT(PlayerScript)->OnQuestRewardItem(player, item, count); } +void ScriptMgr::OnFirstLogin(Player* player) +{ + FOREACH_SCRIPT(PlayerScript)->OnFirstLogin(player); +} + // Guild void ScriptMgr::OnGuildAddMember(Guild* guild, Player* player, uint8& plRank) { @@ -1495,6 +1500,16 @@ void ScriptMgr::OnBeforeDropAddItem(Player const* player, Loot& loot, LootStoreI FOREACH_SCRIPT(GlobalScript)->OnBeforeDropAddItem(player, loot, LootStoreItem); } +void ScriptMgr::OnInitializeLockedDungeons(Player* player, uint8& level, uint32& lockData) +{ + FOREACH_SCRIPT(GlobalScript)->OnInitializeLockedDungeons(player, level, lockData); +} + +void ScriptMgr::OnAfterInitializeLockedDungeons(Player* player) +{ + FOREACH_SCRIPT(GlobalScript)->OnAfterInitializeLockedDungeons(player); +} + uint32 ScriptMgr::DealDamage(Unit* AttackerUnit, Unit *pVictim, uint32 damage, DamageEffectType damagetype) { FOR_SCRIPTS_RET(UnitScript, itr, end, damage) diff --git a/src/game/Scripting/ScriptMgr.h b/src/game/Scripting/ScriptMgr.h index 9ef21f775..1f0965f02 100644 --- a/src/game/Scripting/ScriptMgr.h +++ b/src/game/Scripting/ScriptMgr.h @@ -906,6 +906,8 @@ class PlayerScript : public ScriptObject virtual void OnAfterUpdateAttackPowerAndDamage(Player* /*player*/, float& /*level*/, float& /*base_attPower*/, float& /*attPowerMod*/, float& /*attPowerMultiplier*/, bool /*ranged*/) { } virtual void OnBeforeInitTalentForLevel(Player* /*player*/, uint8& /*level*/, uint32& /*talentPointsForLevel*/) { } + + virtual void OnFirstLogin(Player* /*player*/) { } }; class GuildScript : public ScriptObject @@ -991,6 +993,9 @@ class GlobalScript : public ScriptObject virtual void OnMirrorImageDisplayItem(const Item* /*item*/, uint32& /*display*/) { } virtual void OnAfterRefCount(LootStoreItem* /*LootStoreItem*/, uint32& /*maxcount*/) { } virtual void OnBeforeDropAddItem(Player const* /*player*/, Loot& /*loot*/, LootStoreItem* /*LootStoreItem*/) { } + + virtual void OnInitializeLockedDungeons(Player* /*player*/, uint8& /*level*/, uint32& /*lockData*/) { } + virtual void OnAfterInitializeLockedDungeons(Player* /*player*/) { } // On Before arena points distribution virtual void OnBeforeUpdateArenaPoints(ArenaTeam* /*at*/, std::map & /*ap*/) { } @@ -1225,6 +1230,7 @@ class ScriptMgr void OnBeforeUpdateAttackPowerAndDamage(Player* player, float& level, float& val2, bool ranged); void OnAfterUpdateAttackPowerAndDamage(Player* player, float& level, float& base_attPower, float& attPowerMod, float& attPowerMultiplier, bool ranged); void OnBeforeInitTalentForLevel(Player* player, uint8& level, uint32& talentPointsForLevel); + void OnFirstLogin(Player* player); public: /* GuildScript */ @@ -1255,6 +1261,9 @@ class ScriptMgr void OnBeforeUpdateArenaPoints(ArenaTeam* at, std::map &ap); void OnAfterRefCount(LootStoreItem* LootStoreItem, uint32 &maxcount); void OnBeforeDropAddItem(Player const* player, Loot& loot, LootStoreItem* LootStoreItem); + void OnInitializeLockedDungeons(Player* player, uint8& level, uint32& lockData); + void OnAfterInitializeLockedDungeons(Player* player); + public: /* Scheduled scripts */ From 3d9fdeac76856f5b9d68c9e9367c7f0a0a1467b8 Mon Sep 17 00:00:00 2001 From: Rochet2 Date: Thu, 17 Aug 2017 18:06:05 +0300 Subject: [PATCH 33/51] Fix VS2017 build (#551) --- src/game/Movement/Spline/MovementTypedefs.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/game/Movement/Spline/MovementTypedefs.h b/src/game/Movement/Spline/MovementTypedefs.h index f28c075a1..5c9274582 100644 --- a/src/game/Movement/Spline/MovementTypedefs.h +++ b/src/game/Movement/Spline/MovementTypedefs.h @@ -35,12 +35,6 @@ namespace Movement float computeFallTime(float path_length, bool isSafeFall); float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity = 0.0f); -#ifndef static_assert - #define CONCAT(x, y) CONCAT1 (x, y) - #define CONCAT1(x, y) x##y - #define static_assert(expr, msg) typedef char CONCAT(static_assert_failed_at_line_, __LINE__) [(expr) ? 1 : -1] -#endif - template class counter { From cf750cef6175400de1f92ffc7cf21bce91b99d78 Mon Sep 17 00:00:00 2001 From: Ercules76 Date: Fri, 18 Aug 2017 11:40:38 +0200 Subject: [PATCH 34/51] Core/Misc Created handler for character creation (#562) --- src/scripts/ScriptLoader.cpp | 2 + src/scripts/World/CMakeLists.txt | 1 + src/scripts/World/character_creation.cpp | 56 ++++++++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/scripts/World/character_creation.cpp diff --git a/src/scripts/ScriptLoader.cpp b/src/scripts/ScriptLoader.cpp index 5a7d49919..d948a18c5 100644 --- a/src/scripts/ScriptLoader.cpp +++ b/src/scripts/ScriptLoader.cpp @@ -570,6 +570,7 @@ void AddSC_outdoorpvp_gh(); // player void AddSC_chat_log(); +void AddSC_character_creation(); #endif @@ -642,6 +643,7 @@ void AddWorldScripts() AddSC_npc_taxi(); AddSC_achievement_scripts(); AddSC_chat_log(); + AddSC_character_creation(); #endif } diff --git a/src/scripts/World/CMakeLists.txt b/src/scripts/World/CMakeLists.txt index 3b8d7066d..42ba3facc 100644 --- a/src/scripts/World/CMakeLists.txt +++ b/src/scripts/World/CMakeLists.txt @@ -22,6 +22,7 @@ set(scripts_STAT_SRCS ${AC_SCRIPTS_DIR}/World/npc_professions.cpp ${AC_SCRIPTS_DIR}/World/npc_taxi.cpp ${AC_SCRIPTS_DIR}/World/npcs_special.cpp + ${AC_SCRIPTS_DIR}/World/character_creation.cpp ) AC_ADD_SCRIPT_LOADER("World" "ScriptLoader.h") diff --git a/src/scripts/World/character_creation.cpp b/src/scripts/World/character_creation.cpp new file mode 100644 index 000000000..597dd87a0 --- /dev/null +++ b/src/scripts/World/character_creation.cpp @@ -0,0 +1,56 @@ +/* +* Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2 +* Copyright (C) 2008-2016 TrinityCore +* Copyright (C) 2005-2009 MaNGOS +*/ + +#include "ScriptMgr.h" +#include "Player.h" + +enum Creationabilities +{ + WARRIOR_CREATION_BATTLE_STANCE = 2457, // Battle Stance + DEATH_KNIGHT_CREATION_BLOOD_PRESENCE = 48266, // Blood Presence +}; + +// Instead of adding a hacky way into Player::Create, we use existing hooks to cast these spells on first character login +class CharacterCreationProcedures : public PlayerScript +{ +public: + CharacterCreationProcedures() : PlayerScript("CharacterCreationProcedures") + { + } + + void OnFirstLogin(Player* player) + { + switch (player->getClass()) + { + // Only two classes posses an aura on creation; + case CLASS_WARRIOR: + player->CastSpell(player, WARRIOR_CREATION_BATTLE_STANCE, true); + return; + case CLASS_DEATH_KNIGHT: + player->CastSpell(player, DEATH_KNIGHT_CREATION_BLOOD_PRESENCE, true); + return; + // We include, but do not change the other classes + case CLASS_NONE: + case CLASS_PALADIN: + case CLASS_HUNTER: + case CLASS_ROGUE: + case CLASS_PRIEST: + case CLASS_SHAMAN: + case CLASS_MAGE: + case CLASS_WARLOCK: + // case CLASS_UNK: // Does not exist! + case CLASS_DRUID: + default: + // Can be modified based on personal needs; + return; + } + } +}; + +void AddSC_character_creation() +{ + new CharacterCreationProcedures(); +} \ No newline at end of file From e197ffa1ef21167b65090813a8f011b56a7d4521 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Fri, 18 Aug 2017 17:36:52 +0200 Subject: [PATCH 35/51] importing pedings (please it MUST be done right after accepting PR) --- data/sql/updates/db_world/2017_08_18_00.sql | 27 +++++++++++++++++ .../2017_08_18_01.sql} | 24 +++++++++++++++ data/sql/updates/db_world/2017_08_18_02.sql | 30 +++++++++++++++++++ .../2017_08_18_03.sql} | 25 +++++++++++++++- .../rev_1498835613715251400.sql | 3 -- .../rev_1499115152422618300.sql | 7 ----- 6 files changed, 105 insertions(+), 11 deletions(-) create mode 100644 data/sql/updates/db_world/2017_08_18_00.sql rename data/sql/updates/{pending_db_world/rev_1499101625045878500.sql => db_world/2017_08_18_01.sql} (61%) create mode 100644 data/sql/updates/db_world/2017_08_18_02.sql rename data/sql/updates/{pending_db_world/rev_1499118515042687600.sql => db_world/2017_08_18_03.sql} (93%) delete mode 100644 data/sql/updates/pending_db_world/rev_1498835613715251400.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1499115152422618300.sql diff --git a/data/sql/updates/db_world/2017_08_18_00.sql b/data/sql/updates/db_world/2017_08_18_00.sql new file mode 100644 index 000000000..bee4471ca --- /dev/null +++ b/data/sql/updates/db_world/2017_08_18_00.sql @@ -0,0 +1,27 @@ +-- DB update 2017_06_29_00 -> 2017_08_18_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_06_29_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_06_29_00 2017_08_18_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1498835613715251400'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1498835613715251400'); + +UPDATE `creature_template` SET `modelid1` = '6485' WHERE `entry` = '7780'; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1499101625045878500.sql b/data/sql/updates/db_world/2017_08_18_01.sql similarity index 61% rename from data/sql/updates/pending_db_world/rev_1499101625045878500.sql rename to data/sql/updates/db_world/2017_08_18_01.sql index 922103401..e2479f25f 100644 --- a/data/sql/updates/pending_db_world/rev_1499101625045878500.sql +++ b/data/sql/updates/db_world/2017_08_18_01.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_18_00 -> 2017_08_18_01 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_18_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_18_00 2017_08_18_01 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1499101625045878500'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1499101625045878500'); INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (46337, 'spell_gen_crab_disguise'); @@ -8,3 +23,12 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ (25863, 0, 1, 0, 0, 0, 100, 0, 0, 0, 3400, 5400, 11, 20793, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - In Combat CMC - Cast \'Fireball\''), (25863, 0, 2, 0, 2, 0, 100, 1, 0, 15, 0, 0, 25, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Twilight Firesworn - Between 0-15% Health - Flee For Assist (No Repeat)'); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2017_08_18_02.sql b/data/sql/updates/db_world/2017_08_18_02.sql new file mode 100644 index 000000000..6dea4971f --- /dev/null +++ b/data/sql/updates/db_world/2017_08_18_02.sql @@ -0,0 +1,30 @@ +-- DB update 2017_08_18_01 -> 2017_08_18_02 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_18_01'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_18_01 2017_08_18_02 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1499115152422618300'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1499115152422618300'); + +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '338'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '339'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '340'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '341'; +UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '342';-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1499118515042687600.sql b/data/sql/updates/db_world/2017_08_18_03.sql similarity index 93% rename from data/sql/updates/pending_db_world/rev_1499118515042687600.sql rename to data/sql/updates/db_world/2017_08_18_03.sql index c6fd350aa..01aa65afd 100644 --- a/data/sql/updates/pending_db_world/rev_1499118515042687600.sql +++ b/data/sql/updates/db_world/2017_08_18_03.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_18_02 -> 2017_08_18_03 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_18_02'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_18_02 2017_08_18_03 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1499118515042687600'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1499118515042687600'); -- D.E.T.H.A TEXT AND SAI @@ -109,4 +124,12 @@ SET @ENTRY := 25844; UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES -(@ENTRY,0,0,0,0,0,100,0,5000,8000,60000,65000,11,5915,0,0,0,0,0,1,0,0,0,0,0,0,0,"Northsea Thug - In Combat - Cast 'Crazed'"); \ No newline at end of file +(@ENTRY,0,0,0,0,0,100,0,5000,8000,60000,65000,11,5915,0,0,0,0,0,1,0,0,0,0,0,0,0,"Northsea Thug - In Combat - Cast 'Crazed'");-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1498835613715251400.sql b/data/sql/updates/pending_db_world/rev_1498835613715251400.sql deleted file mode 100644 index 42fa8fbaf..000000000 --- a/data/sql/updates/pending_db_world/rev_1498835613715251400.sql +++ /dev/null @@ -1,3 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1498835613715251400'); - -UPDATE `creature_template` SET `modelid1` = '6485' WHERE `entry` = '7780'; diff --git a/data/sql/updates/pending_db_world/rev_1499115152422618300.sql b/data/sql/updates/pending_db_world/rev_1499115152422618300.sql deleted file mode 100644 index d37fa66eb..000000000 --- a/data/sql/updates/pending_db_world/rev_1499115152422618300.sql +++ /dev/null @@ -1,7 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1499115152422618300'); - -UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '338'; -UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '339'; -UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '340'; -UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '341'; -UPDATE `quest_template_addon` SET `SpecialFlags` = '0' WHERE `ID` = '342'; \ No newline at end of file From f26fcb49db06a80411b7a6889667348d3bf1005e Mon Sep 17 00:00:00 2001 From: Yehonal Date: Fri, 18 Aug 2017 18:38:55 +0200 Subject: [PATCH 36/51] Added GetBadges in Readme.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 31012fda1..6c6467740 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore +[![GetBadges Game](https://azerothcore-azerothcore-wotlk.getbadges.io/shield/company/azerothcore-azerothcore-wotlk)](https://azerothcore-azerothcore-wotlk.getbadges.io/?ref=shield-game) [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=40032087)](https://www.bountysource.com/teams/azerothcore/bounties) [![Master Build Status](https://travis-ci.org/azerothcore/azerothcore-wotlk.svg)](https://travis-ci.org/azerothcore/azerothcore-wotlk) [![Issue Stats](http://www.issuestats.com/github/AzerothCore/azerothcore-wotlk/badge/issue)](http://www.issuestats.com/github/AzerothCore/azerothcore-wotlk) [![Issue Stats](http://www.issuestats.com/github/AzerothCore/azerothcore-wotlk/badge/pr)](http://www.issuestats.com/github/AzerothCore/azerothcore-wotlk) ## Introduction From 30231de9db607d80afb1deada9f94e094926aaf6 Mon Sep 17 00:00:00 2001 From: Ercules76 Date: Fri, 18 Aug 2017 20:47:26 +0200 Subject: [PATCH 37/51] DB/Quests: Terrokkar Forest quest text typos. Tnx to 'tkrokli' (#564) * Core/Misc Created handler for character creation * DB/Quests: Terrokkar Forest quest text typos. Tnx to 'tkrokli' --- .../pending_db_world/rev_1503072683748672200.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1503072683748672200.sql diff --git a/data/sql/updates/pending_db_world/rev_1503072683748672200.sql b/data/sql/updates/pending_db_world/rev_1503072683748672200.sql new file mode 100644 index 000000000..e88469e5f --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1503072683748672200.sql @@ -0,0 +1,14 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1503072683748672200'); +-- 'Clues in the Thicket' (Quest ID 9971) RewardText typo (Is it was/Is it what) +UPDATE `quest_template` + SET `OfferRewardText`="So, I was right. That was the corpse of one of the Broken? And you can confirm that there was a strange object on the ground next to him?$B$BThis doesn't make any sense. What would one of the Broken be doing here? And what is that thing it had with him?$B$BIs it what caused all of this death?" + WHERE `ID`=9971; +-- `An Unseen Hand` (Quest ID 10013) RewardText typo (2x "it to me") +UPDATE `quest_template` + SET `OfferRewardText`="$B$BSo Kaide was right! Those fel orc scum are up to something. I never would've guessed they were colluding with the blood elves, though.$B$BAccording to this map, the fel orcs are to keep us busy... but why? This is disturbing news, $N. You were correct in bringing it to me right away." + WHERE `ID` = 10013; +-- 'Evil Draws Near' (Quest ID 10923) Progress typo (ben/been) +UPDATE `quest_template` + SET `RequestItemsText` = "Has Teribus the Cursed been purged from the skies of Terokkar?" + WHERE `ID` = 10923; + \ No newline at end of file From 14a8088f8624d92dae949193c6c1e31a455a0133 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 11:42:17 +0200 Subject: [PATCH 38/51] import pending sql --- .../2017_08_19_00.sql} | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) rename data/sql/updates/{pending_db_world/rev_1503072683748672200.sql => db_world/2017_08_19_00.sql} (61%) diff --git a/data/sql/updates/pending_db_world/rev_1503072683748672200.sql b/data/sql/updates/db_world/2017_08_19_00.sql similarity index 61% rename from data/sql/updates/pending_db_world/rev_1503072683748672200.sql rename to data/sql/updates/db_world/2017_08_19_00.sql index e88469e5f..d171c2fe2 100644 --- a/data/sql/updates/pending_db_world/rev_1503072683748672200.sql +++ b/data/sql/updates/db_world/2017_08_19_00.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_18_03 -> 2017_08_19_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_18_03'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_18_03 2017_08_19_00 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1503072683748672200'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1503072683748672200'); -- 'Clues in the Thicket' (Quest ID 9971) RewardText typo (Is it was/Is it what) UPDATE `quest_template` @@ -11,4 +26,12 @@ UPDATE `quest_template` UPDATE `quest_template` SET `RequestItemsText` = "Has Teribus the Cursed been purged from the skies of Terokkar?" WHERE `ID` = 10923; - \ No newline at end of file + -- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; From 25d92a454de7377c1dbd03aa104c27083cd180c2 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 11:43:44 +0200 Subject: [PATCH 39/51] [Auth\DB] Set default expansion to 2 --- data/sql/updates/db_auth/2017_08_19_00.sql | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 data/sql/updates/db_auth/2017_08_19_00.sql diff --git a/data/sql/updates/db_auth/2017_08_19_00.sql b/data/sql/updates/db_auth/2017_08_19_00.sql new file mode 100644 index 000000000..9facbfff4 --- /dev/null +++ b/data/sql/updates/db_auth/2017_08_19_00.sql @@ -0,0 +1,27 @@ +-- DB update 2016_11_19_00 -> 2017_08_19_00 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_auth' AND COLUMN_NAME = '2016_11_19_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_auth CHANGE COLUMN 2016_11_19_00 2017_08_19_00 bit; +SELECT sql_rev INTO OK FROM version_db_auth WHERE sql_rev = '1503135763068847900'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_auth (`sql_rev`) VALUES ('1503135763068847900'); + +ALTER TABLE `account` CHANGE `expansion` `expansion` TINYINT(3) UNSIGNED DEFAULT 2 NOT NULL; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; From 138c094c5dcf440feccfba2b215882c7cbf80d58 Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Sat, 19 Aug 2017 12:52:49 +0200 Subject: [PATCH 40/51] auto-attack for warbear matriarch (#491) * combat fix for warbear matriarch * Update rev_1495461970084153283.sql --- .../sql/updates/pending_db_world/rev_1495461970084153283.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1495461970084153283.sql diff --git a/data/sql/updates/pending_db_world/rev_1495461970084153283.sql b/data/sql/updates/pending_db_world/rev_1495461970084153283.sql new file mode 100644 index 000000000..0c5ee1d9b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1495461970084153283.sql @@ -0,0 +1,5 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1495461970084153283'); + +-- set Warbear Matriarch (NPC 29918) AI to PetAI +UPDATE `creature_template` SET `AIName`= 'PetAI', `mindmg`=1360, `maxdmg`=1840, `dmg_multiplier`=1 WHERE `entry`= 29918; + From 1903bfc43d53bc9b6e129129966ca9c0c22a4d97 Mon Sep 17 00:00:00 2001 From: Alan Date: Sat, 19 Aug 2017 07:59:47 -0300 Subject: [PATCH 41/51] Fixed Brewfest Building is Darkmoon Faire Building and log error * Create rev_1500226875532818300 Fixed Brewfest Building is Darkmoon Faire Building * Fixed Brewfest Building is Darkmoon Faire Building Fixed Brewfest Building is Darkmoon Faire Building --- .../rev_1500226875532818300.sql | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1500226875532818300.sql diff --git a/data/sql/updates/pending_db_world/rev_1500226875532818300.sql b/data/sql/updates/pending_db_world/rev_1500226875532818300.sql new file mode 100644 index 000000000..948dac3e9 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1500226875532818300.sql @@ -0,0 +1,190 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1500226875532818300'); + +-- Brewfest Building +DELETE FROM `gameobject` WHERE `id`=186737; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(66860, 186737, 0, 1, 1, -5188.76, -594.416, 397.176, -1.18682, 0, 0, -0.559193, 0.829038, 120, 255, 1, 12340), +(66861, 186737, 0, 1, 1, -5140.78, -578.32, 397.176, -2.35619, 0, 0, -0.923879, 0.382686, 120, 255, 1, 12340), +(66862, 186737, 0, 1, 1, -5155.75, -635.502, 397.177, 1.79769, 0, 0, 0.782608, 0.622515, 120, 255, 1, 12340); + +DELETE FROM `gameobject` WHERE `id`=186717; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(31406, 186717, 0, 1, 1, -5668.71, -475.584, 396.357, -1.67552, 0, 0, -0.743146, 0.669129, 180, 100, 1, 0), +(31404, 186717, 0, 1, 1, -5620.1, -473.021, 396.96, -0.244346, 0, 0, -0.121869, 0.992546, 180, 100, 1, 0), +(31403, 186717, 0, 1, 1, -5610.05, -457.484, 405.302, -0.366519, 0, 0, -0.182235, 0.983255, 180, 100, 1, 0), +(31416, 186717, 0, 1, 1, -5218.61, -491.613, 387.889, 1.76278, 0, 0, 0.771624, 0.636079, 180, 100, 1, 0), +(31415, 186717, 0, 1, 1, -5252.01, -477.25, 386.624, -1.37881, 0, 0, -0.636078, 0.771625, 180, 100, 1, 0), +(31417, 186717, 0, 1, 1, -5236.78, -635.825, 421.801, 0.558505, 0, 0, 0.275637, 0.961262, 180, 100, 1, 0), +(31418, 186717, 0, 1, 1, -5207.18, -535.754, 393.795, 1.78024, 0, 0, 0.777147, 0.629319, 180, 100, 1, 0), +(31420, 186717, 0, 1, 1, -5205.45, -479.062, 389.146, 2.09439, 0, 0, 0.866024, 0.500002, 180, 100, 1, 0), +(31422, 186717, 0, 1, 1, -5214.63, -514.152, 389.732, 1.74533, 0, 0, 0.766045, 0.642787, 180, 100, 1, 0), +(31428, 186717, 0, 1, 1, -5189.3, -525.506, 392.525, 1.98968, 0, 0, 0.838672, 0.544637, 180, 100, 1, 0), +(31429, 186717, 0, 1, 1, -5199.62, -432.817, 386.331, 2.72271, 0, 0, 0.978147, 0.207914, 180, 100, 1, 0), +(31434, 186717, 0, 1, 1, -5197.21, -505.307, 388.598, 2.00713, 0, 0, 0.843392, 0.537299, 180, 100, 1, 0), +(31438, 186717, 0, 1, 1, -5180.2, -615.989, 397.176, 0.418879, 0, 0, 0.207912, 0.978148, 180, 100, 1, 0), +(31452, 186717, 0, 1, 1, -5134.11, -586.723, 397.176, -2.80998, 0, 0, -0.986286, 0.165048, 180, 100, 1, 0), +(31455, 186717, 0, 1, 1, -5132.81, -616.437, 397.362, 2.49582, 0, 0, 0.948324, 0.317305, 180, 100, 1, 0), +(31463, 186717, 0, 1, 1, -5139.14, -632.325, 397.179, 1.69297, 0, 0, 0.748956, 0.66262, 180, 100, 1, 0), +(31467, 186717, 0, 1, 1, -5137.49, -622.278, 397.399, 2.33874, 0, 0, 0.920505, 0.390732, 180, 100, 1, 0), +(31472, 186717, 0, 1, 1, -5191.74, -736.322, 447.284, 0.837758, 0, 0, 0.406737, 0.913545, 180, 100, 1, 0), +(31512, 186717, 0, 1, 1, -5091.12, -734.743, 469.91, -1.48353, 0, 0, -0.67559, 0.737277, 180, 100, 1, 0), +(31603, 186717, 0, 1, 1, -4920.19, -940.244, 501.572, -1.50098, 0, 0, -0.681997, 0.731355, 180, 100, 1, 0), +(31604, 186717, 0, 1, 1, -4905.16, -956.521, 501.47, 2.9147, 0, 0, 0.993572, 0.113203, 180, 100, 1, 0), +(31610, 186717, 0, 1, 1, -4960.08, -1200.38, 501.659, 0.680678, 0, 0, 0.333807, 0.942642, 180, 100, 1, 0), +(31611, 186717, 0, 1, 1, -4983.49, -1204.28, 501.669, 2.32129, 0, 0, 0.91706, 0.398748, 180, 100, 1, 0), +(31612, 186717, 0, 1, 1, -4969.79, -1222.8, 501.67, -0.785398, 0, 0, -0.382683, 0.92388, 180, 100, 1, 0), +(31613, 186717, 0, 1, 1, -4678.11, -968.152, 501.659, -2.49582, 0, 0, -0.948324, 0.317305, 180, 100, 1, 0), +(31614, 186717, 0, 1, 1, -4673.02, -935.651, 501.659, 2.23402, 0, 0, 0.898794, 0.438372, 180, 100, 1, 0), +(31615, 186717, 0, 1, 1, -4649.49, -972.011, 501.66, -0.872665, 0, 0, -0.422618, 0.906308, 180, 100, 1, 0), +(31616, 186717, 0, 1, 1, -4712.87, -1213.87, 501.659, 2.35619, 0, 0, 0.923879, 0.382686, 180, 100, 1, 0), +(31617, 186717, 0, 1, 1, -4698.13, -1246.37, 501.659, -2.3911, 0, 0, -0.930417, 0.366502, 180, 100, 1, 0), +(31618, 186717, 0, 1, 1, -4675.36, -1228.17, 501.659, 0.663225, 0, 0, 0.325568, 0.945519, 180, 100, 1, 0), +(31620, 186717, 0, 1, 1, -9114.49, 342.775, 93.6672, 3.00197, 0, 0, 0.997564, 0.0697546, 180, 100, 1, 0), +(31621, 186717, 0, 1, 1, -9137.06, 372.115, 90.5726, 1.46608, 0, 0, 0.669132, 0.743144, 180, 100, 1, 0), +(31622, 186717, 0, 1, 1, -9137.36, 389.879, 90.9751, 0.366519, 0, 0, 0.182235, 0.983255, 180, 100, 1, 0), +(31623, 186717, 0, 1, 1, -9124.61, 357.999, 92.9819, -2.37365, 0, 0, -0.927184, 0.374606, 180, 100, 1, 0), +(31624, 186717, 0, 1, 1, -9150.72, 357.5, 89.9023, 2.80998, 0, 0, 0.986286, 0.165048, 180, 100, 1, 0), +(31625, 186717, 0, 1, 1, -9128.24, 325.459, 93.502, 1.85005, 0, 0, 0.798636, 0.601815, 180, 100, 1, 0), +(31626, 186717, 0, 1, 1, -9184.33, 335, 82.3169, -1.25664, 0, 0, -0.587786, 0.809016, 180, 100, 1, 0), +(26217, 186717, 1, 1, 1, 1959.5, -4694.7, 26.7062, 2.67035, 0, 0, 0.972369, 0.233447, 180, 100, 1, 0), +(26223, 186717, 1, 1, 1, 1934.4, -4678.79, 27.6517, 2.00713, 0, 0, 0.843392, 0.537299, 180, 100, 1, 0), +(30370, 186717, 1, 1, 1, 1629.97, -4407.76, 16.2626, -3.10669, 0, 0, -0.999848, 0.0174505, 180, 100, 1, 0), +(30382, 186717, 1, 1, 1, 1653.43, -4426.82, 16.7964, 2.26893, 0, 0, 0.906308, 0.422617, 180, 100, 1, 0), +(31120, 186717, 1, 1, 1, 1655.14, -4395.29, 21.8413, 0.279253, 0, 0, 0.139173, 0.990268, 180, 100, 1, 0), +(31637, 186717, 1, 1, 1, 1906.31, -4287.08, 30.3921, 2.46091, 0, 0, 0.942641, 0.333809, 180, 100, 1, 0), +(31638, 186717, 1, 1, 1, 1938.49, -4297.15, 24.7353, -2.14675, 0, 0, -0.878816, 0.477161, 180, 100, 1, 0), +(31639, 186717, 1, 1, 1, 1925.98, -4299.09, 24.9998, -1.29154, 0, 0, -0.601814, 0.798637, 180, 100, 1, 0), +(31663, 186717, 1, 1, 1, 1571.62, -4201.77, 42.7313, -0.907571, 0, 0, -0.438371, 0.898794, 180, 100, 1, 0), +(31664, 186717, 1, 1, 1, 1584.6, -4197.95, 41.3191, -1.55334, 0, 0, -0.700908, 0.713252, 180, 100, 1, 0), +(31665, 186717, 1, 1, 1, 1555.37, -4175.87, 40.5492, 2.77507, 0, 0, 0.983255, 0.182237, 180, 100, 1, 0), +(31688, 186717, 1, 1, 1, 1349.71, -4357.94, 26.9592, -0.593412, 0, 0, -0.292372, 0.956305, 120, 255, 1, 0), +(31704, 186717, 1, 1, 1, 1294.07, -4439.13, 27.457, 1.8675, 0, 0, 0.803856, 0.594824, 180, 100, 1, 0), +(31706, 186717, 1, 1, 1, 1294.49, -4412.17, 26.6057, 1.01229, 0, 0, 0.484809, 0.87462, 180, 100, 1, 0), +(31710, 186717, 1, 1, 1, 1305.78, -4408.33, 26.0013, -1.309, 0, 0, -0.608763, 0.793352, 180, 100, 1, 0), +(31711, 186717, 1, 1, 1, 1308.47, -4448.67, 26.1855, -1.27409, 0, 0, -0.594823, 0.803857, 180, 100, 1, 0), +(31714, 186717, 1, 1, 1, 1309.91, -4371.14, 27.8511, -0.820305, 0, 0, -0.398749, 0.91706, 180, 100, 1, 0), +(31716, 186717, 1, 1, 1, 1318.33, -4549.21, 23.3389, -1.53589, 0, 0, -0.694658, 0.71934, 180, 100, 1, 0), +(31717, 186717, 1, 1, 1, 1314.64, -4599.17, 24.5226, -1.11701, 0, 0, -0.529919, 0.848048, 180, 100, 1, 0), +(31719, 186717, 1, 1, 1, 1277.15, -4417.56, 26.4655, 2.75762, 0, 0, 0.981627, 0.190809, 180, 100, 1, 0), +(31720, 186717, 1, 1, 1, 1227.34, -4433.46, 24.402, 1.81514, 0, 0, 0.78801, 0.615662, 180, 100, 1, 0), +(31735, 186717, 1, 1, 1, 1161.78, -4398.23, 25.272, -1.71042, 0, 0, -0.754709, 0.65606, 180, 100, 1, 0), +(31737, 186717, 1, 1, 1, 1176.38, -4300.89, 21.1914, 0.383972, 0, 0, 0.190809, 0.981627, 180, 100, 1, 0), +(31742, 186717, 1, 1, 1, 1212.8, -4272.35, 21.0265, -2.14675, 0, 0, -0.878816, 0.477161, 180, 100, 1, 0), +(31752, 186717, 1, 1, 1, 1218.07, -4278.28, 21.0851, -2.44346, 0, 0, -0.939692, 0.342021, 180, 100, 1, 0), +(31754, 186717, 1, 1, 1, 1205.74, -4268.39, 21.0905, -1.88496, 0, 0, -0.809018, 0.587783, 180, 100, 1, 0), +(31755, 186717, 1, 1, 1, 1198.63, -4266.14, 21.1134, -1.51844, 0, 0, -0.688356, 0.725373, 180, 100, 1, 0), +(31764, 186717, 1, 1, 1, 1100.76, -4429.74, 20.5644, 2.21657, 0, 0, 0.894935, 0.446197, 180, 100, 1, 0), +(31873, 186717, 1, 1, 1, -1418.73, 102.123, 14.946, -2.05949, 0, 0, -0.857168, 0.515037, 180, 100, 1, 0), +(31880, 186717, 1, 1, 1, -1284.12, 120.319, 131.312, -0.907571, 0, 0, -0.438371, 0.898794, 180, 100, 1, 0), +(31881, 186717, 1, 1, 1, -1291.39, 153.72, 129.813, -1.39626, 0, 0, -0.642786, 0.766046, 180, 100, 1, 0), +(31882, 186717, 1, 1, 1, -1319.69, 185.807, 59.8067, 2.75762, 0, 0, 0.981627, 0.190809, 180, 100, 1, 0), +(31883, 186717, 1, 1, 1, -1273.6, 211.756, 59.5917, 0.506145, 0, 0, 0.25038, 0.968148, 180, 100, 1, 0), +(31884, 186717, 1, 1, 1, -1296.11, 219.047, 58.7385, -1.29154, 0, 0, -0.601814, 0.798637, 180, 100, 1, 0), +(31885, 186717, 1, 1, 1, -1250.5, 232.533, 41.1638, 1.43117, 0, 0, 0.656059, 0.75471, 180, 100, 1, 0), +(31920, 186717, 0, 1, 1, 1701.79, 242.017, 62.5471, -2.63545, 0, 0, -0.968148, 0.250379, 180, 100, 1, 0), +(31921, 186717, 0, 1, 1, 1838.35, 235.119, 60.4209, 1.6057, 0, 0, 0.719339, 0.694659, 180, 100, 1, 0), +(31922, 186717, 0, 1, 1, 1822.31, 259.144, 59.8849, -2.1293, 0, 0, -0.874619, 0.48481, 180, 100, 1, 0), +(31923, 186717, 0, 1, 1, 1815.78, 218.117, 59.7101, 1.50098, 0, 0, 0.681997, 0.731355, 180, 100, 1, 0), +(31924, 186717, 0, 1, 1, 1919.1, 246.858, 49.9504, 0.698132, 0, 0, 0.34202, 0.939693, 180, 100, 1, 0), +(31925, 186717, 0, 1, 1, 1889.78, 227.193, 56.9169, 0.20944, 0, 0, 0.104529, 0.994522, 180, 100, 1, 0), +(32290, 186717, 0, 1, 1, 1811.14, 316.887, 70.8147, 1.81514, 0, 0, 0.78801, 0.615662, 180, 100, 1, 0), +(81075, 186717, 530, 1, 1, -1756.52, 5499.92, -12.4281, -2.07694, 0, 0, -0.861629, 0.507539, 180, 255, 1, 0), +(81076, 186717, 530, 1, 1, -1791.72, 5550.14, -12.4281, -1.22173, 0, 0, -0.573576, 0.819152, 180, 255, 1, 0), +(81077, 186717, 530, 1, 1, -1996.52, 5442.87, -12.4281, -1.83259, 0, 0, -0.793352, 0.608764, 180, 255, 1, 0), +(81078, 186717, 530, 1, 1, -1884.83, 5488.84, -12.4281, -1.309, 0, 0, -0.608763, 0.793352, 180, 255, 1, 0), +(81079, 186717, 530, 1, 1, -1869.96, 5574.38, -12.4281, -2.05949, 0, 0, -0.857168, 0.515037, 180, 255, 1, 0), +(81080, 186717, 530, 1, 1, -1911.65, 5571.59, -12.4281, -1.39626, 0, 0, -0.642786, 0.766046, 180, 255, 1, 0), +(81081, 186717, 530, 1, 1, -1932.64, 5562.31, -12.4281, -1.309, 0, 0, -0.608763, 0.793352, 180, 255, 1, 0), +(59177, 186717, 530, 1, 1, -4008.29, -11857.1, 0.135722, 5.47893, 0, 0, 0.391377, -0.92023, 300, 0, 1, 0), +(59178, 186717, 530, 1, 1, -4002.56, -11851, 0.205429, 5.13728, 0, 0, 0.542116, -0.840304, 300, 0, 1, 0), +(59179, 186717, 1, 1, 1, 9962.87, 2218.32, 1329.82, 1.77101, 0, 0, 0.774235, 0.632899, 300, 0, 1, 0), +(59180, 186717, 1, 1, 1, 9963.64, 2192.59, 1328.52, 4.74374, 0, 0, 0.695936, -0.718104, 300, 0, 1, 0), +(59183, 186717, 530, 1, 1, 9319.23, -7265.19, 13.7578, 2.02761, 0, 0, 0.848849, 0.528635, 300, 0, 1, 0), +(59184, 186717, 530, 1, 1, 9310.25, -7291.41, 14.4908, 2.53027, 0, 0, 0.953648, 0.300924, 300, 0, 1, 0), +(66863, 186717, 0, 1, 1, -5209.84, -459.363, 386.537, 2.56563, 0, 0, 0.958819, 0.284016, 120, 255, 1, 12340), +(66864, 186717, 0, 1, 1, -5226.54, -479.026, 386.534, 2.23402, 0, 0, 0.898793, 0.438373, 120, 255, 1, 12340), +(66865, 186717, 0, 1, 1, -5233.38, -482.264, 386.337, 1.91986, 0, 0, 0.819152, 0.573577, 120, 255, 1, 12340), +(66866, 186717, 0, 1, 1, -5206.92, -452.243, 386.808, 3.01941, 0, 0, 0.998135, 0.0610518, 120, 255, 1, 12340); + +DELETE FROM `gameobject` WHERE `id`=180052; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(13840, 180052, 0, 1, 1, -9583.73, 38.0032, 60.1551, 0.139626, 0, 0, 0.0697563, 0.997564, 180, 100, 1, 0), +(66867, 180052, 0, 1, 1, -5175.3, -625.165, 397.176, 2.91469, 0, 0, 0.993571, 0.113208, 120, 255, 1, 12340); + +DELETE FROM `gameobject` WHERE `id`=186217; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(66868, 186217, 0, 1, 1, -5208.21, -456.072, 386.746, 2.70526, 0, 0, 0.976295, 0.216442, 120, 255, 1, 12340), +(66869, 186217, 0, 1, 1, -5230.03, -480.293, 386.4, 2.1293, 0, 0, 0.874619, 0.48481, 120, 255, 1, 12340); + +DELETE FROM `gameobject` WHERE `id`=180026; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(13895, 180026, 0, 1, 1, -9515.77, 144.288, 59.698, -0.575959, 0, 0, -0.284016, 0.95882, 180, 100, 1, 0), +(13829, 180026, 0, 1, 1, -9525.46, 71.1421, 58.898, 2.96706, 0, 0, 0.996195, 0.0871556, 180, 100, 1, 0), +(31878, 180026, 1, 1, 1, -1461.98, 170.177, -7.74639, -0.122173, 0, 0, -0.0610485, 0.998135, 180, 100, 1, 0), +(31914, 180026, 1, 1, 1, -1589.68, 101.771, -10.5788, -1.64061, 0, 0, -0.731354, 0.681998, 180, 100, 1, 0), +(66870, 180026, 0, 1, 1, -5208.1, -455.96, 386.515, -2.9845, 0, 0, -0.996917, 0.0784664, 120, 255, 1, 12340), +(66871, 180026, 0, 1, 1, -5229.86, -480.288, 386.363, 2.68781, 0, 0, 0.97437, 0.224951, 120, 255, 1, 12340); + + +DELETE FROM `gameobject` WHERE `id`=180052; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(13840, 180052, 0, 1, 1, -9583.73, 38.0032, 60.1551, 0.139626, 0, 0, 0.0697563, 0.997564, 180, 100, 1, 0), +(66867, 180052, 0, 1, 1, -5175.3, -625.165, 397.176, 2.91469, 0, 0, 0.993571, 0.113208, 120, 255, 1, 12340); + +DELETE FROM `gameobject` WHERE `id`=186217; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(66868, 186217, 0, 1, 1, -5208.21, -456.072, 386.746, 2.70526, 0, 0, 0.976295, 0.216442, 120, 255, 1, 12340), +(66869, 186217, 0, 1, 1, -5230.03, -480.293, 386.4, 2.1293, 0, 0, 0.874619, 0.48481, 120, 255, 1, 12340); + +DELETE FROM `gameobject` WHERE `id`=180026; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`,`VerifiedBuild`) VALUES +(13895, 180026, 0, 1, 1, -9515.77, 144.288, 59.698, -0.575959, 0, 0, -0.284016, 0.95882, 180, 100, 1, 0), +(13829, 180026, 0, 1, 1, -9525.46, 71.1421, 58.898, 2.96706, 0, 0, 0.996195, 0.0871556, 180, 100, 1, 0), +(31878, 180026, 1, 1, 1, -1461.98, 170.177, -7.74639, -0.122173, 0, 0, -0.0610485, 0.998135, 180, 100, 1, 0), +(31914, 180026, 1, 1, 1, -1589.68, 101.771, -10.5788, -1.64061, 0, 0, -0.731354, 0.681998, 180, 100, 1, 0), +(66870, 180026, 0, 1, 1, -5208.1, -455.96, 386.515, -2.9845, 0, 0, -0.996917, 0.0784664, 120, 255, 1, 12340), +(66871, 180026, 0, 1, 1, -5229.86, -480.288, 386.363, 2.68781, 0, 0, 0.97437, 0.224951, 120, 255, 1, 12340); + +DELETE FROM `game_event` WHERE `eventEntry`=70; +INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `description`, `world_event`) VALUES (70, '2016-09-20 01:01:00', '2020-12-31 06:00:00', 525600, 4320, 0, 'Brewfest Building (Iron Forge)', 0); + +DELETE FROM `game_event_creature` WHERE abs(`eventEntry`) = 70; +DELETE FROM `game_event_gameobject` WHERE abs(`eventEntry`) = 70; +INSERT INTO `game_event_gameobject` (`guid`, `eventEntry`) VALUES +(66860,70), +(66861,70), +(66862,70), +(66863,70), +(66864,70), +(66865,70), +(66866,70), +(66867,70), +(66868,70), +(66869,70), +(66870,70), +(66871,70); + +-- Darkmoon Faire Building +DELETE FROM `game_event` WHERE `eventEntry`=71; +INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `description`, `world_event`) VALUES (71, '2013-01-06 01:01:00', '2020-12-31 06:00:00', 131040, 8639, 0, 'Darkmoon Faire Building (Mulgore)', 0); + +DELETE FROM `game_event_creature` WHERE abs(`eventEntry`) = 71; +INSERT INTO `game_event_creature` (`guid`, `eventEntry`) VALUES +(54395,71); + +DELETE FROM `game_event_gameobject` WHERE abs(`eventEntry`) = 71; +INSERT INTO `game_event_gameobject` (`guid`, `eventEntry`) VALUES +(31872,71), +(31874,71), +(31875,71), +(31876,71), +(31877,71), +(31878,71), +(31879,71), +(31912,71), +(31913,71), +(31914,71), +(31915,71), +(31916,71), +(31918,71), +(31919,71); From 7cef10a653ce3187bce2648e5eec9a99b16842f8 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 13:05:33 +0200 Subject: [PATCH 42/51] importing peding sql --- data/sql/updates/db_world/2017_08_19_01.sql | 29 +++++++++++++++++++ .../2017_08_19_02.sql} | 24 +++++++++++++++ .../rev_1495461970084153283.sql | 5 ---- 3 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 data/sql/updates/db_world/2017_08_19_01.sql rename data/sql/updates/{pending_db_world/rev_1500226875532818300.sql => db_world/2017_08_19_02.sql} (95%) delete mode 100644 data/sql/updates/pending_db_world/rev_1495461970084153283.sql diff --git a/data/sql/updates/db_world/2017_08_19_01.sql b/data/sql/updates/db_world/2017_08_19_01.sql new file mode 100644 index 000000000..7ded5a444 --- /dev/null +++ b/data/sql/updates/db_world/2017_08_19_01.sql @@ -0,0 +1,29 @@ +-- DB update 2017_08_19_00 -> 2017_08_19_01 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_00'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_00 2017_08_19_01 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1495461970084153283'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1495461970084153283'); + +-- set Warbear Matriarch (NPC 29918) AI to PetAI +UPDATE `creature_template` SET `AIName`= 'PetAI', `mindmg`=1360, `maxdmg`=1840, `dmg_multiplier`=1 WHERE `entry`= 29918; + +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1500226875532818300.sql b/data/sql/updates/db_world/2017_08_19_02.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1500226875532818300.sql rename to data/sql/updates/db_world/2017_08_19_02.sql index 948dac3e9..a3e5ae184 100644 --- a/data/sql/updates/pending_db_world/rev_1500226875532818300.sql +++ b/data/sql/updates/db_world/2017_08_19_02.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_01 -> 2017_08_19_02 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_01'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_01 2017_08_19_02 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1500226875532818300'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1500226875532818300'); -- Brewfest Building @@ -188,3 +203,12 @@ INSERT INTO `game_event_gameobject` (`guid`, `eventEntry`) VALUES (31916,71), (31918,71), (31919,71); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1495461970084153283.sql b/data/sql/updates/pending_db_world/rev_1495461970084153283.sql deleted file mode 100644 index 0c5ee1d9b..000000000 --- a/data/sql/updates/pending_db_world/rev_1495461970084153283.sql +++ /dev/null @@ -1,5 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1495461970084153283'); - --- set Warbear Matriarch (NPC 29918) AI to PetAI -UPDATE `creature_template` SET `AIName`= 'PetAI', `mindmg`=1360, `maxdmg`=1840, `dmg_multiplier`=1 WHERE `entry`= 29918; - From d388a36cf177a9936beb98151463e7b671ca6400 Mon Sep 17 00:00:00 2001 From: Kizarr Date: Sat, 19 Aug 2017 08:16:47 -0600 Subject: [PATCH 43/51] [Database] Floating Corpse DK Starting/Scarlet Infantryman missing weapons (#539) * Scarlet Infantryman missing weapons.sql Fixes missing weapons from Scarlet Infantryman. * DB: Instructor Razuvious - Event with Acherus Necromancer and Death Knight Initiate.sql * DB: Instructor Razuvious - Event with Acherus Necromancer and Death Knight Initiate * Fixed path and added Header to file 1 * Update path and add header to file 2 * Update path and add header to file 3 * Missing Header * Rename \data\sql\updates\pending_db_world\rev_1503139021197350000.sql to data/sql/updates/pending_db_world/rev_1503139021197350000.sql * Rename data\sql\updates\pending_db_world\rev_1503138647187080900.sql to data/sql/updates/pending_db_world/rev_1503138647187080900.sql * Rename data\sql\updates\pending_db_world\rev_1503138789369120900.sql to data/sql/updates/pending_db_world/rev_1503138789369120900.sql --- .../rev_1503138647187080900.sql | 281 ++++++++++++++++++ .../rev_1503138789369120900.sql | 5 + .../rev_1503139021197350000.sql | 281 ++++++++++++++++++ 3 files changed, 567 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1503138647187080900.sql create mode 100644 data/sql/updates/pending_db_world/rev_1503138789369120900.sql create mode 100644 data/sql/updates/pending_db_world/rev_1503139021197350000.sql diff --git a/data/sql/updates/pending_db_world/rev_1503138647187080900.sql b/data/sql/updates/pending_db_world/rev_1503138647187080900.sql new file mode 100644 index 000000000..4c30134aa --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1503138647187080900.sql @@ -0,0 +1,281 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1503138647187080900'); + +-- Instructor Razuvious - Event with Acherus Necromancer and Death Knight Initiate -- http://wow.gamepedia.com/Death_Knight_Initiate +-- Instructor Razuvious +SET @NPC := 129307; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 2, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 3, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 4, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 5, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 6, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 7, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 8, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 9, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 10, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 11, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 12, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 13, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 14, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 15, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 16, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 17, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 18, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 19, 2481.1, -5560.54, 420.493, 5.58, 0), +(@PATH, 20, 2482.32, -5552.39, 420.641, 1.51, 70000), +(@PATH, 21, 2491.86, -5571.77, 420.459, 5.351, 0), +(@PATH, 22, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 23, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 24, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 25, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 26, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 27, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 28, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 29, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 30, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 31, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 32, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 33, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 34, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 35, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 36, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 37, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 38, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 39, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 40, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 41, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 42, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 43, 2510.38, -5592.75, 420.643, 6.19, 75000), +(@PATH, 44, 2492.94, -5573.05, 420.475, 2.147, 0), +(@PATH, 45, 2475.93, -5558.57, 420.485, 2.79, 0), +(@PATH, 46, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 47, 2472.56, -5558.04, 420.453, 6.06788, 0); + +-- Instructor Razuvious SAI +SET @ENTRY := 28357; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,34,0,100,0,2,19,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Instructor Razuvious - On Reached Point 19 - Run Script"), +(@ENTRY,0,1,0,34,0,100,0,2,42,0,0,80,@ENTRY*100+01,0,0,0,0,0,1,0,0,0,0,0,0,0,"Instructor Razuvious - On Reached Point 42 - Run Script"), +(@ENTRY,0,2,0,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.78367,"Instructor Razuvious - On Data Set 1 1 - Set Orientation 2.78367"), +(@ENTRY,0,3,0,38,0,100,0,2,2,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.50472,"Instructor Razuvious - On Data Set 2 2 - Set Orientation 1.50472"), +(@ENTRY,0,4,0,38,0,100,0,3,3,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.26755,"Instructor Razuvious - On Data Set 3 3 - Set Orientation 1.26755"), +(@ENTRY,0,5,0,38,0,100,0,4,4,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,6.19669,"Instructor Razuvious - On Data Set 4 4 - Set Orientation 6,19669"); + +-- Actionlist SAI +SET @ENTRY := 2835700; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Active On"), +(@ENTRY,9,1,0,0,0,100,0,1000,1000,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Say Line 0"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,129391,28383,0,0,0,0,0,"On Script - Set Data 1 1"); + +-- Actionlist SAI +SET @ENTRY := 2835701; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Active On"), +(@ENTRY,9,1,0,0,0,100,0,1000,1000,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Say Line 0"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,129390,28383,0,0,0,0,0,"On Script - Set Data 1 1"); + +-- Acherus Necromancer SAI +SET @GUID := -129391; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=28383; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID 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 +(@GUID,0,0,1,38,0,100,0,1,1,0,0,80,12939100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Run Script"), +(@GUID,0,1,0,61,0,100,0,1,1,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Set Active On"); + +UPDATE `creature` SET `id`=28391, `spawntimesecs`=1, `modelid`=25361 WHERE `guid` IN (130292); +UPDATE `creature` SET `position_x`=2477.361328, `position_y`=-5538.785156, `position_z`=420.645264, `orientation`=4.889500 WHERE `guid`=129458; +DELETE FROM `creature` WHERE `guid`=129452; +UPDATE `creature` SET `spawntimesecs`=1 WHERE `guid`=129459; + +-- Actionlist SAI +SET @ENTRY := 12939100; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,3000,3000,0,0,11,51516,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cast 'Raise Dead'"), +(@ENTRY,9,1,0,0,0,100,0,4000,4000,0,0,86,51517,0,10,130292,28391,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Raise Dead'"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,28,29266,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Aura 'Permanent Feign Death'"), +(@ENTRY,9,3,0,0,0,100,0,0,0,0,0,96,32,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Dynamic Flag Dead"), +(@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,537165824,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Stunned"), +(@ENTRY,9,5,0,0,0,100,0,0,0,0,0,19,1,1,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Server Controlled"), +(@ENTRY,9,6,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Standstate Dead"), +(@ENTRY,9,7,0,0,0,100,0,0,0,0,0,91,257,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag "), +(@ENTRY,9,8,0,0,0,100,0,2000,2000,0,0,2,1770,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Faction 1770"), +(@ENTRY,9,9,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 1 1"), +(@ENTRY,9,10,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Flag Standstate Kneel"), +(@ENTRY,9,11,0,0,0,100,0,4000,4000,0,0,1,0,5000,0,0,0,0,26,28391,50,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,12,0,0,0,100,0,5000,5000,0,0,1,1,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 1"), +(@ENTRY,9,13,0,0,0,100,0,5000,5000,0,0,45,1,1,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 1 1"), +(@ENTRY,9,14,0,0,0,100,0,3000,3000,0,0,1,2,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 2"), +(@ENTRY,9,15,0,0,0,100,0,3000,3000,0,0,45,2,2,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 2 2"), +(@ENTRY,9,16,0,0,0,100,0,0,0,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,17,0,0,0,100,0,4000,4000,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Run Off"), +(@ENTRY,9,18,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,2482.23,-5546.44,420.644,0.761266,"Acherus Necromancer - On Script - Move To Position"), +(@ENTRY,9,19,0,0,0,100,0,4000,4000,0,0,17,133,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Emote State 133"), +(@ENTRY,9,20,0,0,0,100,0,5000,5000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Emote State 0"), +(@ENTRY,9,21,0,0,0,100,0,0,0,0,0,86,51537,0,10,130292,28391,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Death Knight Initiate (Female, Dwarf)'"), +(@ENTRY,9,22,0,0,0,100,0,0,0,0,0,3,0,25406,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Morph To Model 25406"), +(@ENTRY,9,23,0,0,0,100,0,2000,2000,0,0,86,51519,0,10,130292,28391,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Death Knight Initiate Visual'"), +(@ENTRY,9,24,0,0,0,100,0,2000,2000,0,0,91,8,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Standstate Kneel"), +(@ENTRY,9,25,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,2477.37,-5551,420.647,0.77,"Acherus Necromancer - On Script - Move To Position"), +(@ENTRY,9,26,0,0,0,100,0,4000,4000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.746414,"Acherus Necromancer - On Script - Set Orientation 0.746414"), +(@ENTRY,9,27,0,0,0,100,0,1000,1000,0,0,1,3,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 3"), +(@ENTRY,9,28,0,0,0,100,0,5000,5000,0,0,1,1,5000,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 1"), +(@ENTRY,9,29,0,0,0,100,0,1000,1000,0,0,48,1,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Active On"), +(@ENTRY,9,30,0,0,0,100,0,0,0,0,0,45,2,2,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 2 2"), +(@ENTRY,9,31,0,0,0,100,0,1000,1000,0,0,48,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Active Off"); + +-- Acherus Necromancer SAI +SET @GUID := -129390; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=28383; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID 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 +(@GUID,0,0,1,38,0,100,0,1,1,0,0,80,12939000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Run Script"), +(@GUID,0,1,0,61,0,100,0,1,1,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Set Active On"); + +-- Actionlist SAI +SET @ENTRY := 12939000; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,3000,3000,0,0,11,51516,0,1,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Raise Dead'"), +(@ENTRY,9,1,0,0,0,100,0,4000,4000,0,0,86,51517,0,10,129459,28394,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Raise Dead'"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,28,29266,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Aura 'Permanent Feign Death'"), +(@ENTRY,9,3,0,0,0,100,0,0,0,0,0,96,32,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Dynamic Flag Dead"), +(@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,537165824,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Stunned"), +(@ENTRY,9,5,0,0,0,100,0,0,0,0,0,19,1,1,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Server Controlled"), +(@ENTRY,9,6,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Standstate Dead"), +(@ENTRY,9,7,0,0,0,100,0,0,0,0,0,91,257,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Dead"), +(@ENTRY,9,8,0,0,0,100,0,2000,2000,0,0,2,1770,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Set Faction 1770"), +(@ENTRY,9,9,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 1 1"), +(@ENTRY,9,10,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Set Flag Standstate Kneel"), +(@ENTRY,9,11,0,0,0,100,0,4000,4000,0,0,1,0,5000,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,12,0,0,0,100,0,5000,5000,0,0,1,4,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 4"), +(@ENTRY,9,13,0,0,0,100,0,6000,6000,0,0,1,5,6000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 5"), +(@ENTRY,9,14,0,0,0,100,0,5000,5000,0,0,45,3,3,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 3 3"), +(@ENTRY,9,15,0,0,0,100,0,4000,4000,0,0,1,6,6000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 6"), +(@ENTRY,9,16,0,0,0,100,0,6000,6000,0,0,45,4,4,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 4 4"), +(@ENTRY,9,17,0,0,0,100,0,0,0,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,18,0,0,0,100,0,5000,5000,0,0,1,1,5000,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 1"), +(@ENTRY,9,19,0,0,0,100,0,4000,4000,0,0,12,28405,3,19000,0,0,0,8,0,0,0,2520.44,-5593.01,420.727,3.4383,"Acherus Necromancer - On Script - Summon Creature 'Acherus Ghoul'"), +(@ENTRY,9,20,0,0,0,100,0,0,0,0,0,12,28405,3,19000,0,0,0,8,0,0,0,2516.65,-5596.68,420.727,1.39626,"Acherus Necromancer - On Script - Summon Creature 'Acherus Ghoul'"), +(@ENTRY,9,21,0,0,0,100,0,0,0,0,0,12,28405,3,19000,0,0,0,8,0,0,0,2515.93,-5589.89,420.727,4.92183,"Acherus Necromancer - On Script - Summon Creature 'Acherus Ghoul'"), +(@ENTRY,9,22,0,0,0,100,0,20000,20000,0,0,48,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Active Off"); + +DELETE FROM `creature_text` WHERE `entry` IN (28357, 28383, 28391, 28394); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +-- Instructor Razuvious +(28357, 0, 0, 'This one...', 12, 0, 100, 25, 0, 0, 27876, 'Instructor Razuvious'), +(28357, 1, 0, 'The Lich King will be pleased with this initiate.', 12, 0, 100, 5, 0, 0, 27869, 'Instructor Razuvious'), +(28357, 1, 1, 'Amidst the wretch, a champion has been found.', 12, 0, 100, 5, 0, 0, 27870, 'Instructor Razuvious'), +(28357, 1, 2, 'CHAOS! DOOM! DESTRUCTION! This one will claim them all!', 12, 0, 100, 5, 0, 0, 27871, 'Instructor Razuvious'), +(28357, 1, 3, 'Marvel at its tenacity and vigor! A champion has been found!', 12, 0, 100, 5, 0, 0, 27868, 'Instructor Razuvious'), +(28357, 1, 4, 'A harbinger of death is reborn...', 12, 0, 100, 5, 0, 0, 27872, 'Instructor Razuvious'), +(28357, 2, 0, 'Place upon it the trappings befitting a herald of Arthas.', 12, 0, 100, 1, 0, 0, 27873, 'Instructor Razuvious'), +(28357, 3, 0, 'Stand and be measured! Rise, for your master awaits your arrival. Go now!', 12, 0, 100, 5, 0, 0, 27883, 'Instructor Razuvious'), +(28357, 3, 1, 'Listen, death knight... Listen for the voice of your master. He calls to you now.', 12, 0, 100, 5, 0, 0, 27884, 'Instructor Razuvious'), +(28357, 4, 0, 'Pathetic...', 12, 0, 100, 1, 0, 0, 27865, 'Instructor Razuvious'), +(28357, 4, 1, 'Useless...', 12, 0, 100, 1, 0, 0, 27862, 'Instructor Razuvious'), +(28357, 4, 2, 'Another failure...', 12, 0, 100, 1, 0, 0, 27861, 'Instructor Razuvious'), +(28357, 4, 3, 'This one has awoken too soon. It retains emotion and memory...', 12, 0, 100, 1, 0, 0, 27864, 'Instructor Razuvious'), +(28357, 5, 0, 'You have been measured and found wanting...', 12, 0, 100, 25, 0, 0, 27866, 'Instructor Razuvious'), +(28357, 6, 0, 'Dispose of it...', 12, 0, 100, 1, 0, 0, 27867, 'Instructor Razuvious'), +-- Acherus Necromancer +(28383, 0, 0, 'Yes, instructor.', 12, 0, 100, 1, 0, 0, 27874, 'Acherus Necromancer'), +(28383, 0, 1, 'Right away, instructor.', 12, 0, 100, 1, 0, 0, 27881, 'Acherus Necromancer'), +(28383, 1, 0, 'Rise, minions. Rise and feast upon the weak!', 12, 0, 100, 22, 0, 0, 27875, 'Acherus Necromancer'), +-- Death Knight Initiate 1 +(28391, 0, 0, 'I return from the grave to do my master\'s bidding.', 12, 0, 100, 0, 0, 0, 27880, 'Death Knight Initiate'), +(28391, 0, 1, 'The voice... such splendor... Arthas... My king....', 12, 0, 100, 0, 0, 0, 27879, 'Death Knight Initiate'), +(28391, 0, 2, 'Reborn, I shall become an instrument of doom...', 12, 0, 100, 0, 0, 0, 27878, 'Death Knight Initiate'), +(28391, 0, 3, 'Dark energy courses through me... Such power! I hunger for more!', 12, 0, 100, 0, 0, 0, 27877, 'Death Knight Initiate'), +(28391, 1, 0, 'Death to all that oppose us!', 12, 0, 100, 66, 0, 0, 27888, 'Death Knight Initiate'), +(28391, 1, 1, 'Victory to the Scourge!', 12, 0, 100, 66, 0, 0, 27887, 'Death Knight Initiate'), +(28391, 1, 2, 'I live only to serve the Lich King!', 12, 0, 100, 66, 0, 0, 27886, 'Death Knight Initiate'), +(28391, 1, 3, 'As you command, instructor!', 12, 0, 100, 66, 0, 0, 27885, 'Death Knight Initiate'), +(28391, 2, 0, 'Woe unto those that dare oppose the Scourge!', 12, 0, 100, 66, 0, 0, 30176, 'Death Knight Initiate'), +(28391, 2, 1, 'I am reborn, my king, only to serve you.', 12, 0, 100, 66, 0, 0, 30179, 'Death Knight Initiate'), +(28391, 2, 2, 'I am an instrument of your destruction, my king! Command me!', 12, 0, 100, 66, 0, 0, 30175, 'Death Knight Initiate'), +(28391, 2, 3, 'Our enemies will be annihilated!', 12, 0, 100, 66, 0, 0, 30177, 'Death Knight Initiate'), +(28391, 2, 4, 'A thousand-thousand lives I will sacrifice for you, my lord.', 12, 0, 100, 66, 0, 0, 30172, 'Death Knight Initiate'), +(28391, 2, 5, 'I am yours to command, my king!', 12, 0, 100, 66, 0, 0, 30173, 'Death Knight Initiate'), +(28391, 2, 6, 'There will be no survivors, my lord.', 12, 0, 100, 66, 0, 0, 30180, 'Death Knight Initiate'), +(28391, 2, 7, 'My king, the world will tremble in reverence...', 12, 0, 100, 66, 0, 0, 30174, 'Death Knight Initiate'), +-- Death Knight Initiate 2 +(28394, 0, 0, 'Where am I? What is this place?', 12, 0, 100, 0, 0, 0, 27856, 'Death Knight Initiate'), +(28394, 0, 1, 'Who... who are you? Who... what am I?', 12, 0, 100, 0, 0, 0, 27858, 'Death Knight Initiate'), +(28394, 0, 2, 'I hurt... suffering unbearable... end my pain... I beg of you!', 12, 0, 100, 0, 0, 0, 27859, 'Death Knight Initiate'), +(28394, 0, 3, 'I... I have awoken to a nightmare?', 12, 0, 100, 0, 0, 0, 27857, 'Death Knight Initiate'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry` IN (51516); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 51516, 0, 0, 31, 0, 3, 28394, 0, 0, 0, 0, '', 'Rise dead only targets Death Knight Initiate'), +(13, 1, 51516, 0, 1, 31, 0, 3, 28391, 0, 0, 0, 0, '', 'Rise dead only targets Death Knight Initiate'); + +-- Death Knight Initiate SAI +SET @ENTRY := 28391; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.16204,"Death Knight Initiate - On Data Set 1 1 - Set Orientation 4.16204"), +(@ENTRY,0,1,6,38,0,100,0,2,2,0,0,53,1,28391,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Data Set 2 2 - Start Waypoint"), +(@ENTRY,0,2,3,40,0,100,0,7,28391,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Waypoint 7 Reached - Pause Waypoint"), +(@ENTRY,0,3,0,61,0,100,0,7,28391,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Waypoint 7 Reached - Run Script"), +(@ENTRY,0,4,0,40,0,100,0,9,28391,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Waypoint 9 Reached - Despawn In 2000 ms"), +(@ENTRY,0,5,0,25,0,100,0,0,0,0,0,18,295170,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Reset - Set Flags Not Attackable & Immune To Players & Stunned"), +(@ENTRY,0,6,0,61,0,100,0,2,2,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Data Set 2 2 - Set Active On"); + +-- Actionlist SAI +SET @ENTRY := 2839100; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,1000,1000,0,0,5,66,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Script - Play Emote 66"), +(@ENTRY,9,1,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Script - Say Line 2"), +(@ENTRY,9,2,0,0,0,100,0,6000,6000,0,0,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Script - Play Emote 2"); + +DELETE FROM `waypoints` WHERE `entry`=28391; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(28391,1,2453.87,-5545.37,420.643,'Death Knight Initiate'), +(28391,2,2423.38,-5574.52,420.631,'Death Knight Initiate'), +(28391,3,2423.38,-5610.59,420.6,'Death Knight Initiate'), +(28391,4,2410.19,-5626.02,420.654,'Death Knight Initiate'), +(28391,5,2381.18,-5637.17,420.858,'Death Knight Initiate'), +(28391,6,2372.68,-5645.34,426.017,'Death Knight Initiate'), +(28391,7,2348.248,-5666.514,426.029,'Death Knight Initiate'), +(28391,8,2373.07,-5652.69,426.126,'Death Knight Initiate'), +(28391,9,2382.63,-5645.56,421.512,'Death Knight Initiate'); + +-- Death Knight Initiate SAI +SET @ENTRY := 28394; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.07005,"Death Knight Initiate - On Data Set 1 1 - Set Orientation 3.07005"), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,18,295170,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Reset - Set Flags Not Attackable & Immune To Players & Stunned"); + +-- Acherus Ghoul SAI +SET @ENTRY := 28405; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,63,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Just Created - Run Script"); + +-- Actionlist SAI +SET @ENTRY := 2840500; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,17,373,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Emote State 373"), +(@ENTRY,9,1,0,0,0,100,0,1000,1000,0,0,11,26047,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Cast 'Birth'"), +(@ENTRY,9,2,0,0,0,100,0,2000,2000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Emote State 0"), +(@ENTRY,9,3,0,0,0,100,0,1000,1000,0,0,2,2093,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Faction 2093"), +(@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,514,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Remove Flags Not Attackable & Immune To NPC's"), +(@ENTRY,9,5,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Start Attacking"); diff --git a/data/sql/updates/pending_db_world/rev_1503138789369120900.sql b/data/sql/updates/pending_db_world/rev_1503138789369120900.sql new file mode 100644 index 000000000..855deaa11 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1503138789369120900.sql @@ -0,0 +1,5 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1503138789369120900'); + +-- Scarlet Infantryman +UPDATE creature_equip_template SET ItemID1= 38721, ItemID2= 12932 WHERE CreatureID= 28609; +UPDATE creature_equip_template SET ItemID1= 38723, ItemID2= 12932 WHERE CreatureID= 28896; diff --git a/data/sql/updates/pending_db_world/rev_1503139021197350000.sql b/data/sql/updates/pending_db_world/rev_1503139021197350000.sql new file mode 100644 index 000000000..77fc2459a --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1503139021197350000.sql @@ -0,0 +1,281 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1503139021197350000'); + +-- Instructor Razuvious - Event with Acherus Necromancer and Death Knight Initiate -- http://wow.gamepedia.com/Death_Knight_Initiate +-- Instructor Razuvious +SET @NPC := 129307; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@NPC,@PATH,0,0,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`, `orientation`, `delay`) VALUES +(@PATH, 1, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 2, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 3, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 4, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 5, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 6, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 7, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 8, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 9, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 10, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 11, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 12, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 13, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 14, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 15, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 16, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 17, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 18, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 19, 2481.1, -5560.54, 420.493, 5.58, 0), +(@PATH, 20, 2482.32, -5552.39, 420.641, 1.51, 70000), +(@PATH, 21, 2491.86, -5571.77, 420.459, 5.351, 0), +(@PATH, 22, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 23, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 24, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 25, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 26, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 27, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 28, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 29, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 30, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 31, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 32, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 33, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 34, 2492.94, -5573.05, 420.475, 2.14717, 0), +(@PATH, 35, 2475.93, -5558.57, 420.485, 2.79199, 0), +(@PATH, 36, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 37, 2472.56, -5558.04, 420.453, 6.06788, 0), +(@PATH, 38, 2481.1, -5560.54, 420.493, 5.58015, 0), +(@PATH, 39, 2491.86, -5571.77, 420.459, 5.3508, 0), +(@PATH, 40, 2497.91, -5588.32, 420.462, 4.9212, 0), +(@PATH, 41, 2494.03, -5612.09, 420.491, 1.24868, 0), +(@PATH, 42, 2498.68, -5591.69, 420.494, 1.78118, 0), +(@PATH, 43, 2510.38, -5592.75, 420.643, 6.19, 75000), +(@PATH, 44, 2492.94, -5573.05, 420.475, 2.147, 0), +(@PATH, 45, 2475.93, -5558.57, 420.485, 2.79, 0), +(@PATH, 46, 2455.66, -5554.78, 420.508, 0.040735, 0), +(@PATH, 47, 2472.56, -5558.04, 420.453, 6.06788, 0); + +-- Instructor Razuvious SAI +SET @ENTRY := 28357; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,34,0,100,0,2,19,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Instructor Razuvious - On Reached Point 19 - Run Script"), +(@ENTRY,0,1,0,34,0,100,0,2,42,0,0,80,@ENTRY*100+01,0,0,0,0,0,1,0,0,0,0,0,0,0,"Instructor Razuvious - On Reached Point 42 - Run Script"), +(@ENTRY,0,2,0,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.78367,"Instructor Razuvious - On Data Set 1 1 - Set Orientation 2.78367"), +(@ENTRY,0,3,0,38,0,100,0,2,2,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.50472,"Instructor Razuvious - On Data Set 2 2 - Set Orientation 1.50472"), +(@ENTRY,0,4,0,38,0,100,0,3,3,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.26755,"Instructor Razuvious - On Data Set 3 3 - Set Orientation 1.26755"), +(@ENTRY,0,5,0,38,0,100,0,4,4,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,6.19669,"Instructor Razuvious - On Data Set 4 4 - Set Orientation 6,19669"); + +-- Actionlist SAI +SET @ENTRY := 2835700; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Active On"), +(@ENTRY,9,1,0,0,0,100,0,1000,1000,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Say Line 0"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,129391,28383,0,0,0,0,0,"On Script - Set Data 1 1"); + +-- Actionlist SAI +SET @ENTRY := 2835701; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Set Active On"), +(@ENTRY,9,1,0,0,0,100,0,1000,1000,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"On Script - Say Line 0"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,129390,28383,0,0,0,0,0,"On Script - Set Data 1 1"); + +-- Acherus Necromancer SAI +SET @GUID := -129391; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=28383; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID 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 +(@GUID,0,0,1,38,0,100,0,1,1,0,0,80,12939100,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Run Script"), +(@GUID,0,1,0,61,0,100,0,1,1,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Set Active On"); + +UPDATE `creature` SET `id`=28391, `spawntimesecs`=1, `modelid`=25361 WHERE `guid` IN (130292); +UPDATE `creature` SET `position_x`=2477.361328, `position_y`=-5538.785156, `position_z`=420.645264, `orientation`=4.889500 WHERE `guid`=129458; +DELETE FROM `creature` WHERE `guid`=129452; +UPDATE `creature` SET `spawntimesecs`=1 WHERE `guid`=129459; + +-- Actionlist SAI +SET @ENTRY := 12939100; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,3000,3000,0,0,11,51516,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cast 'Raise Dead'"), +(@ENTRY,9,1,0,0,0,100,0,4000,4000,0,0,86,51517,0,10,130292,28391,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Raise Dead'"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,28,29266,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Aura 'Permanent Feign Death'"), +(@ENTRY,9,3,0,0,0,100,0,0,0,0,0,96,32,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Dynamic Flag Dead"), +(@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,537165824,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Stunned"), +(@ENTRY,9,5,0,0,0,100,0,0,0,0,0,19,1,1,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Server Controlled"), +(@ENTRY,9,6,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Standstate Dead"), +(@ENTRY,9,7,0,0,0,100,0,0,0,0,0,91,257,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag "), +(@ENTRY,9,8,0,0,0,100,0,2000,2000,0,0,2,1770,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Faction 1770"), +(@ENTRY,9,9,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 1 1"), +(@ENTRY,9,10,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Flag Standstate Kneel"), +(@ENTRY,9,11,0,0,0,100,0,4000,4000,0,0,1,0,5000,0,0,0,0,26,28391,50,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,12,0,0,0,100,0,5000,5000,0,0,1,1,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 1"), +(@ENTRY,9,13,0,0,0,100,0,5000,5000,0,0,45,1,1,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 1 1"), +(@ENTRY,9,14,0,0,0,100,0,3000,3000,0,0,1,2,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 2"), +(@ENTRY,9,15,0,0,0,100,0,3000,3000,0,0,45,2,2,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 2 2"), +(@ENTRY,9,16,0,0,0,100,0,0,0,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,17,0,0,0,100,0,4000,4000,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Run Off"), +(@ENTRY,9,18,0,0,0,100,0,0,0,0,0,69,0,0,0,0,0,0,8,0,0,0,2482.23,-5546.44,420.644,0.761266,"Acherus Necromancer - On Script - Move To Position"), +(@ENTRY,9,19,0,0,0,100,0,4000,4000,0,0,17,133,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Emote State 133"), +(@ENTRY,9,20,0,0,0,100,0,5000,5000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Emote State 0"), +(@ENTRY,9,21,0,0,0,100,0,0,0,0,0,86,51537,0,10,130292,28391,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Death Knight Initiate (Female, Dwarf)'"), +(@ENTRY,9,22,0,0,0,100,0,0,0,0,0,3,0,25406,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Morph To Model 25406"), +(@ENTRY,9,23,0,0,0,100,0,2000,2000,0,0,86,51519,0,10,130292,28391,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Death Knight Initiate Visual'"), +(@ENTRY,9,24,0,0,0,100,0,2000,2000,0,0,91,8,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Standstate Kneel"), +(@ENTRY,9,25,0,0,0,100,0,2000,2000,0,0,69,0,0,0,0,0,0,8,0,0,0,2477.37,-5551,420.647,0.77,"Acherus Necromancer - On Script - Move To Position"), +(@ENTRY,9,26,0,0,0,100,0,4000,4000,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,0.746414,"Acherus Necromancer - On Script - Set Orientation 0.746414"), +(@ENTRY,9,27,0,0,0,100,0,1000,1000,0,0,1,3,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 3"), +(@ENTRY,9,28,0,0,0,100,0,5000,5000,0,0,1,1,5000,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 1"), +(@ENTRY,9,29,0,0,0,100,0,1000,1000,0,0,48,1,0,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Active On"), +(@ENTRY,9,30,0,0,0,100,0,0,0,0,0,45,2,2,0,0,0,0,10,130292,28391,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 2 2"), +(@ENTRY,9,31,0,0,0,100,0,1000,1000,0,0,48,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Active Off"); + +-- Acherus Necromancer SAI +SET @GUID := -129390; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=28383; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID 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 +(@GUID,0,0,1,38,0,100,0,1,1,0,0,80,12939000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Run Script"), +(@GUID,0,1,0,61,0,100,0,1,1,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Data Set 1 1 - Set Active On"); + +-- Actionlist SAI +SET @ENTRY := 12939000; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,3000,3000,0,0,11,51516,0,1,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Raise Dead'"), +(@ENTRY,9,1,0,0,0,100,0,4000,4000,0,0,86,51517,0,10,129459,28394,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Cross Cast 'Raise Dead'"), +(@ENTRY,9,2,0,0,0,100,0,1000,1000,0,0,28,29266,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Aura 'Permanent Feign Death'"), +(@ENTRY,9,3,0,0,0,100,0,0,0,0,0,96,32,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Dynamic Flag Dead"), +(@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,537165824,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Stunned"), +(@ENTRY,9,5,0,0,0,100,0,0,0,0,0,19,1,1,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Server Controlled"), +(@ENTRY,9,6,0,0,0,100,0,0,0,0,0,91,7,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Standstate Dead"), +(@ENTRY,9,7,0,0,0,100,0,0,0,0,0,91,257,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Remove Flag Dead"), +(@ENTRY,9,8,0,0,0,100,0,2000,2000,0,0,2,1770,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Set Faction 1770"), +(@ENTRY,9,9,0,0,0,100,0,1000,1000,0,0,45,1,1,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 1 1"), +(@ENTRY,9,10,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Set Flag Standstate Kneel"), +(@ENTRY,9,11,0,0,0,100,0,4000,4000,0,0,1,0,5000,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,12,0,0,0,100,0,5000,5000,0,0,1,4,5000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 4"), +(@ENTRY,9,13,0,0,0,100,0,6000,6000,0,0,1,5,6000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 5"), +(@ENTRY,9,14,0,0,0,100,0,5000,5000,0,0,45,3,3,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 3 3"), +(@ENTRY,9,15,0,0,0,100,0,4000,4000,0,0,1,6,6000,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 6"), +(@ENTRY,9,16,0,0,0,100,0,6000,6000,0,0,45,4,4,0,0,0,0,10,129307,28357,0,0,0,0,0,"Acherus Necromancer - On Script - Set Data 4 4"), +(@ENTRY,9,17,0,0,0,100,0,0,0,0,0,1,0,5000,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 0"), +(@ENTRY,9,18,0,0,0,100,0,5000,5000,0,0,1,1,5000,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Say Line 1"), +(@ENTRY,9,19,0,0,0,100,0,4000,4000,0,0,12,28405,3,19000,0,0,0,8,0,0,0,2520.44,-5593.01,420.727,3.4383,"Acherus Necromancer - On Script - Summon Creature 'Acherus Ghoul'"), +(@ENTRY,9,20,0,0,0,100,0,0,0,0,0,12,28405,3,19000,0,0,0,8,0,0,0,2516.65,-5596.68,420.727,1.39626,"Acherus Necromancer - On Script - Summon Creature 'Acherus Ghoul'"), +(@ENTRY,9,21,0,0,0,100,0,0,0,0,0,12,28405,3,19000,0,0,0,8,0,0,0,2515.93,-5589.89,420.727,4.92183,"Acherus Necromancer - On Script - Summon Creature 'Acherus Ghoul'"), +(@ENTRY,9,22,0,0,0,100,0,20000,20000,0,0,48,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Necromancer - On Script - Set Active Off"); + +DELETE FROM `creature_text` WHERE `entry` IN (28357, 28383, 28391, 28394); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +-- Instructor Razuvious +(28357, 0, 0, 'This one...', 12, 0, 100, 25, 0, 0, 27876, 'Instructor Razuvious'), +(28357, 1, 0, 'The Lich King will be pleased with this initiate.', 12, 0, 100, 5, 0, 0, 27869, 'Instructor Razuvious'), +(28357, 1, 1, 'Amidst the wretch, a champion has been found.', 12, 0, 100, 5, 0, 0, 27870, 'Instructor Razuvious'), +(28357, 1, 2, 'CHAOS! DOOM! DESTRUCTION! This one will claim them all!', 12, 0, 100, 5, 0, 0, 27871, 'Instructor Razuvious'), +(28357, 1, 3, 'Marvel at its tenacity and vigor! A champion has been found!', 12, 0, 100, 5, 0, 0, 27868, 'Instructor Razuvious'), +(28357, 1, 4, 'A harbinger of death is reborn...', 12, 0, 100, 5, 0, 0, 27872, 'Instructor Razuvious'), +(28357, 2, 0, 'Place upon it the trappings befitting a herald of Arthas.', 12, 0, 100, 1, 0, 0, 27873, 'Instructor Razuvious'), +(28357, 3, 0, 'Stand and be measured! Rise, for your master awaits your arrival. Go now!', 12, 0, 100, 5, 0, 0, 27883, 'Instructor Razuvious'), +(28357, 3, 1, 'Listen, death knight... Listen for the voice of your master. He calls to you now.', 12, 0, 100, 5, 0, 0, 27884, 'Instructor Razuvious'), +(28357, 4, 0, 'Pathetic...', 12, 0, 100, 1, 0, 0, 27865, 'Instructor Razuvious'), +(28357, 4, 1, 'Useless...', 12, 0, 100, 1, 0, 0, 27862, 'Instructor Razuvious'), +(28357, 4, 2, 'Another failure...', 12, 0, 100, 1, 0, 0, 27861, 'Instructor Razuvious'), +(28357, 4, 3, 'This one has awoken too soon. It retains emotion and memory...', 12, 0, 100, 1, 0, 0, 27864, 'Instructor Razuvious'), +(28357, 5, 0, 'You have been measured and found wanting...', 12, 0, 100, 25, 0, 0, 27866, 'Instructor Razuvious'), +(28357, 6, 0, 'Dispose of it...', 12, 0, 100, 1, 0, 0, 27867, 'Instructor Razuvious'), +-- Acherus Necromancer +(28383, 0, 0, 'Yes, instructor.', 12, 0, 100, 1, 0, 0, 27874, 'Acherus Necromancer'), +(28383, 0, 1, 'Right away, instructor.', 12, 0, 100, 1, 0, 0, 27881, 'Acherus Necromancer'), +(28383, 1, 0, 'Rise, minions. Rise and feast upon the weak!', 12, 0, 100, 22, 0, 0, 27875, 'Acherus Necromancer'), +-- Death Knight Initiate 1 +(28391, 0, 0, 'I return from the grave to do my master\'s bidding.', 12, 0, 100, 0, 0, 0, 27880, 'Death Knight Initiate'), +(28391, 0, 1, 'The voice... such splendor... Arthas... My king....', 12, 0, 100, 0, 0, 0, 27879, 'Death Knight Initiate'), +(28391, 0, 2, 'Reborn, I shall become an instrument of doom...', 12, 0, 100, 0, 0, 0, 27878, 'Death Knight Initiate'), +(28391, 0, 3, 'Dark energy courses through me... Such power! I hunger for more!', 12, 0, 100, 0, 0, 0, 27877, 'Death Knight Initiate'), +(28391, 1, 0, 'Death to all that oppose us!', 12, 0, 100, 66, 0, 0, 27888, 'Death Knight Initiate'), +(28391, 1, 1, 'Victory to the Scourge!', 12, 0, 100, 66, 0, 0, 27887, 'Death Knight Initiate'), +(28391, 1, 2, 'I live only to serve the Lich King!', 12, 0, 100, 66, 0, 0, 27886, 'Death Knight Initiate'), +(28391, 1, 3, 'As you command, instructor!', 12, 0, 100, 66, 0, 0, 27885, 'Death Knight Initiate'), +(28391, 2, 0, 'Woe unto those that dare oppose the Scourge!', 12, 0, 100, 66, 0, 0, 30176, 'Death Knight Initiate'), +(28391, 2, 1, 'I am reborn, my king, only to serve you.', 12, 0, 100, 66, 0, 0, 30179, 'Death Knight Initiate'), +(28391, 2, 2, 'I am an instrument of your destruction, my king! Command me!', 12, 0, 100, 66, 0, 0, 30175, 'Death Knight Initiate'), +(28391, 2, 3, 'Our enemies will be annihilated!', 12, 0, 100, 66, 0, 0, 30177, 'Death Knight Initiate'), +(28391, 2, 4, 'A thousand-thousand lives I will sacrifice for you, my lord.', 12, 0, 100, 66, 0, 0, 30172, 'Death Knight Initiate'), +(28391, 2, 5, 'I am yours to command, my king!', 12, 0, 100, 66, 0, 0, 30173, 'Death Knight Initiate'), +(28391, 2, 6, 'There will be no survivors, my lord.', 12, 0, 100, 66, 0, 0, 30180, 'Death Knight Initiate'), +(28391, 2, 7, 'My king, the world will tremble in reverence...', 12, 0, 100, 66, 0, 0, 30174, 'Death Knight Initiate'), +-- Death Knight Initiate 2 +(28394, 0, 0, 'Where am I? What is this place?', 12, 0, 100, 0, 0, 0, 27856, 'Death Knight Initiate'), +(28394, 0, 1, 'Who... who are you? Who... what am I?', 12, 0, 100, 0, 0, 0, 27858, 'Death Knight Initiate'), +(28394, 0, 2, 'I hurt... suffering unbearable... end my pain... I beg of you!', 12, 0, 100, 0, 0, 0, 27859, 'Death Knight Initiate'), +(28394, 0, 3, 'I... I have awoken to a nightmare?', 12, 0, 100, 0, 0, 0, 27857, 'Death Knight Initiate'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceGroup`=1 AND `SourceEntry` IN (51516); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 51516, 0, 0, 31, 0, 3, 28394, 0, 0, 0, 0, '', 'Rise dead only targets Death Knight Initiate'), +(13, 1, 51516, 0, 1, 31, 0, 3, 28391, 0, 0, 0, 0, '', 'Rise dead only targets Death Knight Initiate'); + +-- Death Knight Initiate SAI +SET @ENTRY := 28391; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,4.16204,"Death Knight Initiate - On Data Set 1 1 - Set Orientation 4.16204"), +(@ENTRY,0,1,6,38,0,100,0,2,2,0,0,53,1,28391,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Data Set 2 2 - Start Waypoint"), +(@ENTRY,0,2,3,40,0,100,0,7,28391,0,0,54,11000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Waypoint 7 Reached - Pause Waypoint"), +(@ENTRY,0,3,0,61,0,100,0,7,28391,0,0,80,@ENTRY*100+00,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Waypoint 7 Reached - Run Script"), +(@ENTRY,0,4,0,40,0,100,0,9,28391,0,0,41,2000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Waypoint 9 Reached - Despawn In 2000 ms"), +(@ENTRY,0,5,0,25,0,100,0,0,0,0,0,18,295170,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Reset - Set Flags Not Attackable & Immune To Players & Stunned"), +(@ENTRY,0,6,0,61,0,100,0,2,2,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Data Set 2 2 - Set Active On"); + +-- Actionlist SAI +SET @ENTRY := 2839100; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,1000,1000,0,0,5,66,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Script - Play Emote 66"), +(@ENTRY,9,1,0,0,0,100,0,2000,2000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Script - Say Line 2"), +(@ENTRY,9,2,0,0,0,100,0,6000,6000,0,0,5,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Script - Play Emote 2"); + +DELETE FROM `waypoints` WHERE `entry`=28391; +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(28391,1,2453.87,-5545.37,420.643,'Death Knight Initiate'), +(28391,2,2423.38,-5574.52,420.631,'Death Knight Initiate'), +(28391,3,2423.38,-5610.59,420.6,'Death Knight Initiate'), +(28391,4,2410.19,-5626.02,420.654,'Death Knight Initiate'), +(28391,5,2381.18,-5637.17,420.858,'Death Knight Initiate'), +(28391,6,2372.68,-5645.34,426.017,'Death Knight Initiate'), +(28391,7,2348.248,-5666.514,426.029,'Death Knight Initiate'), +(28391,8,2373.07,-5652.69,426.126,'Death Knight Initiate'), +(28391,9,2382.63,-5645.56,421.512,'Death Knight Initiate'); + +-- Death Knight Initiate SAI +SET @ENTRY := 28394; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,3.07005,"Death Knight Initiate - On Data Set 1 1 - Set Orientation 3.07005"), +(@ENTRY,0,1,0,25,0,100,0,0,0,0,0,18,295170,0,0,0,0,0,1,0,0,0,0,0,0,0,"Death Knight Initiate - On Reset - Set Flags Not Attackable & Immune To Players & Stunned"); + +-- Acherus Ghoul SAI +SET @ENTRY := 28405; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,63,0,100,0,0,0,0,0,80,@ENTRY*100+00,2,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Just Created - Run Script"); + +-- Actionlist SAI +SET @ENTRY := 2840500; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,9,0,0,0,0,100,0,0,0,0,0,17,373,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Emote State 373"), +(@ENTRY,9,1,0,0,0,100,0,1000,1000,0,0,11,26047,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Cast 'Birth'"), +(@ENTRY,9,2,0,0,0,100,0,2000,2000,0,0,17,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Emote State 0"), +(@ENTRY,9,3,0,0,0,100,0,1000,1000,0,0,2,2093,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Faction 2093"), +(@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,514,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Remove Flags Not Attackable & Immune To NPC's"), +(@ENTRY,9,5,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Start Attacking"); From f5091ead96b2bf6f8a743cc85855d5608b2a106f Mon Sep 17 00:00:00 2001 From: PolarCookie Date: Sat, 19 Aug 2017 18:06:31 +0200 Subject: [PATCH 44/51] Various quest fixes The Troll Cave: needs 14 kills, not 10. http://wow.gamepedia.com/Quest:The_Troll_Cave The Grizzled Den The wendigos at this den, especially at the entrance, are very dense. It looks as if they're double spawned a lot. It's very hard on lvl 6-8 players, as you're forced to grab 2 at a time. The id list is gathered from this query. SELECT guid FROM sunwell_world.creature WHERE id in (1134,1135) AND guid NOT IN ( SELECT A.guid FROM sunwell_world.creature AS A JOIN trinity_world.creature AS B ON A.guid = B.guid WHERE A.id in (1134,1135) AND B.id IN (1134,1135) ); Turns out TC is a subset of AC, with this fix both are the same. This result is much more tolerable. The Perfect Stout: Rejold's New Brew has The Perfect Stout as prequest, not the otherway around. http://www.wowhead.com/quest=415/rejolds-new-brew#comments:id=190337 Tunnel Rat: Currently only 1 type drop ears, when all 6 should. Some mobs have 4/5 drop rate. http://www.wowhead.com/quest=416/rat-catching#comments:id=74106:reply=305815 Drop rate inside the cave is way higher. http://www.wowhead.com/item=3110/tunnel-rat-ear#comments:id=353270 Red Silk Bandanas: Follows the second to last Defias Brotherhood quest, not Red Leather Bandanas. http://wow.gamepedia.com/Quest:Red_Silk_Bandanas Letter to Stormpike: Has Encrypted Letter as prequest. http://wow.gamepedia.com/Quest:Letter_to_Stormpike Kurzen Jungle Fighter: These should also drop Jungle Remedy. http://www.wowhead.com/item=2633/jungle-remedy#comments:id=163587 Inspecting the Ruins: Has either They Call Him Smiling Jim or James Hyal as prequest, currently only the former. Forked Mudrock Tongue droprate: http://www.wowhead.com/quest=1204/mudrock-soup-and-bugs http://www.wowhead.com/item=5883/forked-mudrock-tongue#dropped-by Currently 25%, making it 40%. From the comments some complain it's terrible, some say it's 100% and great. I'm getting the suspicion it depends on the type of Mudrock. In the database there's 5 different Mudrocks, but as of patch 2.3, 4 turtle types were removed in favour of 1. http://www.wowhead.com/npc=4396/mudrock-tortoise#comments http://www.wowhead.com/npc=4398/mudrock-burrower#comments http://www.wowhead.com/npc=4399/mudrock-borer#comments http://www.wowhead.com/npc=4400/mudrock-snapjaw#comments Trouble in Winterspring!: This is a breadcrumb quest, not a prequest. http://www.wowhead.com/quest=6603/trouble-in-winterspring#comments:id=931604 Thick Yeti Fur droprate: Increasing drop rates from 33% across the board. http://www.wowhead.com/quest=3783/deprecated-are-we-there-yeti#comments:id=1043214 It varies between the types, and seems it was buffed at the end of wotlk. http://www.wowhead.com/npc=7457/ http://www.wowhead.com/npc=7458/ http://www.wowhead.com/npc=7459/ http://www.wowhead.com/npc=7460/ Flesh Eating Worm and Rotting Worm: These are the worms that spawn when a Rotted One in Duskwood and Rotting Cadaver in Western Plaguelands respectively dies. http://wow.gamepedia.com/File:Flesh_Eating_Worm.jpg I reduced the size based on the image from 2008, sorta got it right. I reduced their damage to be 50% of the associated ghoul based on http://www.wowhead.com/npc=10925/rotting-worm#comments:id=245916. Fool's Stout: Has Report Back to Fizzlebub as prequest. http://wow.gamepedia.com/Quest:Report_Back_to_Fizzlebub Half-Buried Bottle loottable: This one was dropping Raptor Eggs at 71%, I'm taking the wild guess that that's wrong and just replacing it with the trinity core table. SELECT name, gameobject_loot_template.* FROM item_template JOIN gameobject_loot_template ON item_template.entry = gameobject_loot_template.item WHERE gameobject_loot_template.entry = 2032; Run that for a quick laugh. Atal'Ai Artifacts I could hardly find any of these, turns out most of them were underground, so I moved them up a little. Found 21 artifacts and 1 mithril deposit underground and 3 double spawned artifacts that are deleted. Run around as a dwarf with the racial tracking to see what I mean. Blue Pearls: These only drop from the Giant Clam objects in the vile reef. Not Giant Clam objects in other zones nor clam items from murlocs. Black Dragonflight Molt: This item is a guaranteed drop from the Hoard of the Black Dragonflight. Currently 88.8% --- .../rev_1495464409315344160.sql | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 data/sql/updates/pending_db_world/rev_1495464409315344160.sql diff --git a/data/sql/updates/pending_db_world/rev_1495464409315344160.sql b/data/sql/updates/pending_db_world/rev_1495464409315344160.sql new file mode 100644 index 000000000..39fb5c0de --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1495464409315344160.sql @@ -0,0 +1,149 @@ +INSERT INTO version_db_world (`sql_rev`) VALUES ('1495464409315344160'); + +-- The Troll Cave requires 14 kills, not 10. +UPDATE `quest_template` SET `RequiredNpcOrGoCount1` = 14 where `ID` = 182; + +-- Make The Grizzled Den more tolerable. +DELETE FROM `creature` WHERE `guid` IN (3137,3255,3261,3262,3548,3551,3554,3558,3583,3239,3243,3246,3257,3258,3552,3565,3566,3567,3570,3573,3574,3578); + +-- The Perfect Stout does not require Rejold's New Brew, it's the otherway around. +UPDATE `quest_template_addon` SET `NextQuestID` = 0, `PrevQuestID` = 315 WHERE `ID` = 415; + +-- All Tunnel Rats should be able to drop ears, not just 1 out of 6 types. +DELETE FROM `creature_loot_template` WHERE `entry` in (1172,1174,1175,1176,1177) and `item` = 3110; +INSERT INTO `creature_loot_template` VALUES +(1172, 3110,-38,1,0,1,1), +(1174, 3110,-80,1,0,1,1), +(1175, 3110,-80,1,0,1,1), +(1176, 3110,-38,1,0,1,1), +(1177, 3110,-80,1,0,1,1); + +-- Red Silk Bandanas needs The Defias Brotherhood (6), not Red Leather Bandanas. +UPDATE `quest_template_addon` SET `PrevQuestID` = 155 WHERE `ID` = 214; + +-- Letter to Stormpike follows Encrypted Letter +UPDATE `quest_template_addon` SET `PrevQuestID` = 511 WHERE `ID` = 514; + +-- Kurzen Jungle Fighter also drops Jungle Remedy +DELETE FROM `creature_loot_template` WHERE `entry` = 937 AND `item` = 2633; +INSERT INTO `creature_loot_template` VALUES (937,2633,-33,1,0,1,1); + +-- Inspecting the ruins requires either They Call Him Smilling Jim or James Hyal +UPDATE `quest_template_addon` SET `NextQuestID` = 11123 WHERE `ID` = 1282; +UPDATE `quest_template_addon` SET `NextQuestID` = 11123 WHERE `ID` = 1302; +UPDATE `quest_template_addon` SET `PrevQuestID` = 0 WHERE `ID` = 11123; + +-- Raising the drop rate on Forked Mudrock Tongues +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = -40 WHERE `entry` = 4397 AND `item` = 5883; + +-- Trouble in Winterspring! is a breadcrumb quest, not prequest. +UPDATE `quest_template_addon` SET `PrevQuestID` = 0 WHERE `ID` = 5082; + +-- Raising the drop rate of Thick Yeti Fur +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = -71 WHERE `entry` = 7457 AND `item` = 12366; +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = -41 WHERE `entry` = 7458 AND `item` = 12366; +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = -43 WHERE `entry` = 7459 AND `item` = 12366; +UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = -45 WHERE `entry` = 7460 AND `item` = 12366; + +-- Flesh Eating Worm adjustment +UPDATE `creature_template` SET `mindmg` = 16, `maxdmg` = 25, `scale`=0.4 WHERE `entry` = 2462; + +-- Rotting Worm adjustment +UPDATE `creature_template` SET `mindmg` = 41, `maxdmg` = 66, `scale`=0.4 WHERE `entry` = 10925; + +-- Fool's stout follows Report Back to Fizzlebub +UPDATE `quest_template_addon` SET `PrevQuestID` = 1122 WHERE `ID` = 1127; + +-- Fixing Half-Buried Bottle loot table, it's not a raptor. +DELETE FROM `gameobject_loot_template` WHERE `entry` = 2032; +INSERT INTO `gameobject_loot_template` VALUES +(2032,1477,2.5,1,0,1,1), +(2032,1711,4.2,1,0,1,1), +(2032,2289,2.7,1,0,1,1), +(2032,2290,4.4,1,0,1,1), +(2032,3608,0.02,1,0,1,1), +(2032,4098,25,1,1,1,1), +(2032,4100,25,1,1,1,1), +(2032,4101,25,1,1,1,1), +(2032,4102,25,1,1,1,1), +(2032,4298,0.02,1,0,1,1), +(2032,4299,0.02,1,0,1,1), +(2032,4350,0.02,1,0,1,1), +(2032,4351,0.02,1,0,1,1), +(2032,4352,0.02,1,0,1,1), +(2032,4412,0.02,1,0,1,1), +(2032,4414,0.02,1,0,1,1), +(2032,4416,0.02,1,0,1,1), +(2032,4417,0.02,1,0,1,1), +(2032,5543,0.02,1,0,1,1), +(2032,5774,0.02,1,0,1,1), +(2032,6045,0.02,1,0,1,1), +(2032,6454,0.02,1,0,1,1), +(2032,7085,0.02,1,0,1,1), +(2032,7090,0.02,1,0,1,1), +(2032,7360,0.02,1,0,1,1), +(2032,7363,0.02,1,0,1,1), +(2032,7364,0.02,1,0,1,1), +(2032,7449,0.02,1,0,1,1), +(2032,7450,0.02,1,0,1,1), +(2032,7975,0.1,1,0,1,1), +(2032,7992,0.0508056,1,0,1,1), +(2032,8029,0.0508056,1,0,1,1), +(2032,8385,0.0508056,1,0,1,1), +(2032,8386,0.0580636,1,0,1,1), +(2032,8387,0.0725795,1,0,1,1), +(2032,9293,0.0435477,1,0,1,1), +(2032,10300,0.1,1,0,1,1), +(2032,10301,0.1,1,0,1,1), +(2032,10302,0.0653215,1,0,1,1), +(2032,10312,0.0290318,1,0,1,1), +(2032,10424,0.02,1,0,1,1), +(2032,10601,0.02,1,0,1,1), +(2032,10603,0.0362897,1,0,1,1), +(2032,10604,0.0653215,1,0,1,1), +(2032,10606,0.1,1,0,1,1), +(2032,11098,0.02,1,0,1,1), +(2032,11164,0.02,1,0,1,1), +(2032,11165,0.02,1,0,1,1), +(2032,11167,0.02,1,0,1,1), +(2032,11202,0.0290318,1,0,1,1), +(2032,11204,0.1,1,0,1,1); + +-- Atal'ai Artifacts (and 1 mithril deposit) are underground +UPDATE `gameobject` SET `position_z`=-15.29 WHERE `guid`=30371; +UPDATE `gameobject` SET `position_z`= 14.5 WHERE `guid`=30374; +UPDATE `gameobject` SET `position_z`= 31.63 WHERE `guid`=30380; +UPDATE `gameobject` SET `position_z`=-16.75 WHERE `guid`=30381; +UPDATE `gameobject` SET `position_z`= 19.57 WHERE `guid`=30383; +UPDATE `gameobject` SET `position_z`= 10.58 WHERE `guid`=30541; +UPDATE `gameobject` SET `position_z`=-19 WHERE `guid`=30542; +UPDATE `gameobject` SET `position_z`=-16.9 WHERE `guid`=30543; +UPDATE `gameobject` SET `position_z`= 20.2 WHERE `guid`=30546; +UPDATE `gameobject` SET `position_z`=-2.2 WHERE `guid`=30547; +UPDATE `gameobject` SET `position_z`= 10.5 WHERE `guid`=30550; +UPDATE `gameobject` SET `position_z`=-11.9 WHERE `guid`=30551; +UPDATE `gameobject` SET `position_z`= 10.91 WHERE `guid`=30554; +UPDATE `gameobject` SET `position_z`=-3.56 WHERE `guid`=30556; +UPDATE `gameobject` SET `position_z`= 18.70 WHERE `guid`=30558; +UPDATE `gameobject` SET `position_z`= 19.1 WHERE `guid`=30559; +UPDATE `gameobject` SET `position_z`= 18.66 WHERE `guid`=30561; +UPDATE `gameobject` SET `position_z`=-19 WHERE `guid`=30643; +UPDATE `gameobject` SET `position_z`=-6 WHERE `guid`=30646; +UPDATE `gameobject` SET `position_z`=-10.4 WHERE `guid`=30375; +UPDATE `gameobject` SET `position_z`=-8.5 WHERE `guid`=30378; +UPDATE `gameobject` SET `position_z`= 19 WHERE `guid`=31029; + +-- Atal'ai Artifact twin spawn +DELETE FROM `gameobject` WHERE `guid`=30593; +DELETE FROM `gameobject` WHERE `guid`=30594; +DELETE FROM `gameobject` WHERE `guid`=30587; + +-- Blue Pearls do not drop from giant clams outside of the Vile Reef in STV. +DELETE FROM `gameobject_loot_template` WHERE `entry` IN ( 2954, 2959) and `item` = 4611; +-- Blue Pearls do not drop from Small Barnacle Clam or Thick Shell Clam items. +DELETE FROM `spell_loot_template` WHERE `entry` IN (58168,58172) and `item` = 4611; + +-- Black Dragonflight Molt is a guaranteed drop from Hoard of the Black Dragonflight +UPDATE `item_loot_template` SET `ChanceOrQuestChance` = 100 WHERE `entry` = 10569 AND `item` = 10575; + + From 246826e002549dd7ed3b67cbf850c380bc391028 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 18:28:03 +0200 Subject: [PATCH 45/51] import all pendings sql --- .../2017_08_19_03.sql} | 24 ++++++++++++++ .../2017_08_19_04.sql} | 24 ++++++++++++++ .../2017_08_19_05.sql} | 24 ++++++++++++++ .../2017_08_19_06.sql} | 24 ++++++++++++++ .../2017_08_19_07.sql} | 24 ++++++++++++++ data/sql/updates/db_world/2017_08_19_08.sql | 30 ++++++++++++++++++ data/sql/updates/db_world/2017_08_19_09.sql | 26 ++++++++++++++++ data/sql/updates/db_world/2017_08_19_10.sql | 26 ++++++++++++++++ .../2017_08_19_11.sql} | 24 ++++++++++++++ data/sql/updates/db_world/2017_08_19_12.sql | 31 +++++++++++++++++++ .../2017_08_19_13.sql} | 24 ++++++++++++++ .../2017_08_19_14.sql} | 24 ++++++++++++++ .../2017_08_19_15.sql} | 24 ++++++++++++++ .../2017_08_19_16.sql} | 24 ++++++++++++++ .../2017_08_19_17.sql} | 24 ++++++++++++++ data/sql/updates/db_world/2017_08_19_18.sql | 29 +++++++++++++++++ .../2017_08_19_19.sql} | 24 ++++++++++++++ .../rev_1493343523138941000.sql | 6 ---- .../rev_1493344470069156600.sql | 2 -- .../rev_1493344929793898700.sql | 2 -- .../rev_1493347575872142000.sql | 7 ----- .../rev_1503138789369120900.sql | 5 --- 22 files changed, 430 insertions(+), 22 deletions(-) rename data/sql/updates/{pending_db_world/rev_1493320243875599900.sql => db_world/2017_08_19_03.sql} (68%) rename data/sql/updates/{pending_db_world/rev_1493320702119541800.sql => db_world/2017_08_19_04.sql} (72%) rename data/sql/updates/{pending_db_world/rev_1493321166929502700.sql => db_world/2017_08_19_05.sql} (80%) rename data/sql/updates/{pending_db_world/rev_1493321428049355400.sql => db_world/2017_08_19_06.sql} (95%) rename data/sql/updates/{pending_db_world/rev_1493321989278173500.sql => db_world/2017_08_19_07.sql} (96%) create mode 100644 data/sql/updates/db_world/2017_08_19_08.sql create mode 100644 data/sql/updates/db_world/2017_08_19_09.sql create mode 100644 data/sql/updates/db_world/2017_08_19_10.sql rename data/sql/updates/{pending_db_world/rev_1493346808800720600.sql => db_world/2017_08_19_11.sql} (87%) create mode 100644 data/sql/updates/db_world/2017_08_19_12.sql rename data/sql/updates/{pending_db_world/rev_1493349239278044600.sql => db_world/2017_08_19_13.sql} (76%) rename data/sql/updates/{pending_db_world/rev_1494230753178074480.sql => db_world/2017_08_19_14.sql} (65%) rename data/sql/updates/{pending_db_world/rev_1495464409315344160.sql => db_world/2017_08_19_15.sql} (89%) rename data/sql/updates/{pending_db_world/rev_1495729610203623150.sql => db_world/2017_08_19_16.sql} (88%) rename data/sql/updates/{pending_db_world/rev_1503138647187080900.sql => db_world/2017_08_19_17.sql} (97%) create mode 100644 data/sql/updates/db_world/2017_08_19_18.sql rename data/sql/updates/{pending_db_world/rev_1503139021197350000.sql => db_world/2017_08_19_19.sql} (97%) delete mode 100644 data/sql/updates/pending_db_world/rev_1493343523138941000.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1493344470069156600.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1493344929793898700.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1493347575872142000.sql delete mode 100644 data/sql/updates/pending_db_world/rev_1503138789369120900.sql diff --git a/data/sql/updates/pending_db_world/rev_1493320243875599900.sql b/data/sql/updates/db_world/2017_08_19_03.sql similarity index 68% rename from data/sql/updates/pending_db_world/rev_1493320243875599900.sql rename to data/sql/updates/db_world/2017_08_19_03.sql index f1f54115b..2e5df34ea 100644 --- a/data/sql/updates/pending_db_world/rev_1493320243875599900.sql +++ b/data/sql/updates/db_world/2017_08_19_03.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_02 -> 2017_08_19_03 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_02'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_02 2017_08_19_03 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493320243875599900'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493320243875599900'); SET @R3D0 := 21690; @@ -13,3 +28,12 @@ INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_ DELETE FROM `creature_text` WHERE `entry`=@R3D0; INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES (@R3D0, 0, 0, "WARNING! WARNING! AWAY HOSTILE BEINGS! DO NOT HEAD UP THE RIDGE TO TOSHLEY'S STATION!", 12, 0, 100, 35, 0, 0, 19311, 0, "R-3D0"); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493320702119541800.sql b/data/sql/updates/db_world/2017_08_19_04.sql similarity index 72% rename from data/sql/updates/pending_db_world/rev_1493320702119541800.sql rename to data/sql/updates/db_world/2017_08_19_04.sql index 22f1ad3a3..97256b245 100644 --- a/data/sql/updates/pending_db_world/rev_1493320702119541800.sql +++ b/data/sql/updates/db_world/2017_08_19_04.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_03 -> 2017_08_19_04 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_03'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_03 2017_08_19_04 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493320702119541800'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493320702119541800'); UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=1476; DELETE FROM `smart_scripts` WHERE `entryorguid`=1476; @@ -13,3 +28,12 @@ INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language (1476, 0, 2, "I'd go out and clear out some of those gnolls, but this leg has seen better days and I am afraid I'd just wind up dead.", 12, 6, 100, 0, 0, 0, 320, 0, "Hargin Mundar"), (1476, 0, 3, "Watch your step out there. Many an adventure seeker has not returned from the marsh. hic!", 12, 6, 100, 0, 0, 0, 321, 0, "Hargin Mundar"), (1476, 1, 0, "Huuup...Huuup...Bleeeeehh!", 12, 0, 100, 0, 0, 0, 397, 0, "Hargin Mundar"); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493321166929502700.sql b/data/sql/updates/db_world/2017_08_19_05.sql similarity index 80% rename from data/sql/updates/pending_db_world/rev_1493321166929502700.sql rename to data/sql/updates/db_world/2017_08_19_05.sql index 8d5cf95a6..22288d84d 100644 --- a/data/sql/updates/pending_db_world/rev_1493321166929502700.sql +++ b/data/sql/updates/db_world/2017_08_19_05.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_04 -> 2017_08_19_05 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_04'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_04 2017_08_19_05 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493321166929502700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493321166929502700'); SET @BETHOR := 1498; SET @GUNTHER := 5666; @@ -22,3 +37,12 @@ INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language (@GUNTHER, 1, 0, "When time permits, we must speak at length. For we have much to discuss.", 12, 0, 100, 1, 0, 0, 1974, 0, "Gunther's Visage"), (@GUNTHER, 2, 0, "And thank you, $n. Without your aid I may never have found my way to the Forsaken.", 12, 0, 100, 1, 0, 0, 1975, 0, "Gunther's Visage"), (@BETHOR, 0, 0, "Farewell, my friend.", 12, 0, 100, 1, 0, 0, 1976, 0, "Bethor Iceshard"); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493321428049355400.sql b/data/sql/updates/db_world/2017_08_19_06.sql similarity index 95% rename from data/sql/updates/pending_db_world/rev_1493321428049355400.sql rename to data/sql/updates/db_world/2017_08_19_06.sql index 82721555c..18cdb92df 100644 --- a/data/sql/updates/pending_db_world/rev_1493321428049355400.sql +++ b/data/sql/updates/db_world/2017_08_19_06.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_05 -> 2017_08_19_06 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_05'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_05 2017_08_19_06 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493321428049355400'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493321428049355400'); -- Tranquillien RP event SET @AURIFEROUS :=16231; @@ -96,3 +111,12 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr (@MALTENDIS, 0, 6, "%s fidgets with his armor, clearly uncomfortable at the tone of the discussion.", 16, 0, 100, 0, 0, 0, 12588, 0, "Deathstalker Maltendis"), (@MALTENDIS, 0, 7, "%s looks like he'd rather be anywhere else but here.", 16, 0, 100, 0, 0, 0, 12589, 0, "Deathstalker Maltendis"), (@MALTENDIS, 1, 0, "%s turns to Advisor Valwyn and winks lasciviously in her direction.", 16, 0, 100, 2, 0, 0, 13366, 0, "Deathstalker Maltendis"); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493321989278173500.sql b/data/sql/updates/db_world/2017_08_19_07.sql similarity index 96% rename from data/sql/updates/pending_db_world/rev_1493321989278173500.sql rename to data/sql/updates/db_world/2017_08_19_07.sql index db48f3eec..e8a0e22f9 100644 --- a/data/sql/updates/pending_db_world/rev_1493321989278173500.sql +++ b/data/sql/updates/db_world/2017_08_19_07.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_06 -> 2017_08_19_07 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_06'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_06 2017_08_19_07 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493321989278173500'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493321989278173500'); SET @GUID := 131324; DELETE FROM `creature` WHERE `guid` BETWEEN @GUID + 1 AND @GUID + 23; @@ -227,3 +242,12 @@ INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `positi (11283, 4, 1109.56, -2557.59, 59.2532, 'Sammy'), (11283, 5, 1111.49, -2556.4, 59.2532, 'Sammy'), (11283, 6, 1111.49, -2556.4, 59.2532, 'Sammy'); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2017_08_19_08.sql b/data/sql/updates/db_world/2017_08_19_08.sql new file mode 100644 index 000000000..bd5c05c96 --- /dev/null +++ b/data/sql/updates/db_world/2017_08_19_08.sql @@ -0,0 +1,30 @@ +-- DB update 2017_08_19_07 -> 2017_08_19_08 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_07'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_07 2017_08_19_08 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493343523138941000'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493343523138941000'); +-- replace "Mac" with actual player name ($N) in the reward text +UPDATE `quest_template` +SET `OfferRewardText`= "Great Spirit Totem! This is dire news indeed. I must begin to plan for whatever may come.$b$b$N, as promised, here is your reward for your brave service.$b$b" +WHERE `ID`= 5064; +-- +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2017_08_19_09.sql b/data/sql/updates/db_world/2017_08_19_09.sql new file mode 100644 index 000000000..2650ba0ff --- /dev/null +++ b/data/sql/updates/db_world/2017_08_19_09.sql @@ -0,0 +1,26 @@ +-- DB update 2017_08_19_08 -> 2017_08_19_09 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_08'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_08 2017_08_19_09 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493344470069156600'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493344470069156600'); +UPDATE `spell_dbc` SET `RangeIndex`=4 WHERE `Id`=61698; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2017_08_19_10.sql b/data/sql/updates/db_world/2017_08_19_10.sql new file mode 100644 index 000000000..918ed8112 --- /dev/null +++ b/data/sql/updates/db_world/2017_08_19_10.sql @@ -0,0 +1,26 @@ +-- DB update 2017_08_19_09 -> 2017_08_19_10 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_09'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_09 2017_08_19_10 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493344929793898700'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493344929793898700'); +UPDATE `creature_template` SET `faction` = 1873 WHERE `entry` = 16927; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493346808800720600.sql b/data/sql/updates/db_world/2017_08_19_11.sql similarity index 87% rename from data/sql/updates/pending_db_world/rev_1493346808800720600.sql rename to data/sql/updates/db_world/2017_08_19_11.sql index ab35fec3e..a2488b627 100644 --- a/data/sql/updates/pending_db_world/rev_1493346808800720600.sql +++ b/data/sql/updates/db_world/2017_08_19_11.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_10 -> 2017_08_19_11 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_10'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_10 2017_08_19_11 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493346808800720600'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493346808800720600'); -- Quest 27418, Challenge Overlord Mok'Morokk @@ -43,3 +58,12 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@OMM, 0, 9,0, 11,0,100,0, 0, 0, 0, 0, 42, 1, 0, 0,0,0,0, 1, 0,0,0,0,0,0,0,'Overlord Mok''Morokk - on Spawn - Set Invincibility at 1 HP'); -- +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2017_08_19_12.sql b/data/sql/updates/db_world/2017_08_19_12.sql new file mode 100644 index 000000000..0ae38e1d4 --- /dev/null +++ b/data/sql/updates/db_world/2017_08_19_12.sql @@ -0,0 +1,31 @@ +-- DB update 2017_08_19_11 -> 2017_08_19_12 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_11'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_11 2017_08_19_12 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493347575872142000'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1493347575872142000'); +-- Verifonix +UPDATE `creature_template` SET `faction`=47 WHERE `entry`=14492; + +DELETE FROM `creature_onkill_reputation` WHERE `creature_id`=14492; +INSERT INTO `creature_onkill_reputation` (`creature_id`,`RewOnKillRepFaction1`,`RewOnKillRepFaction2`,`MaxStanding1`,`IsTeamAward1`,`RewOnKillRepValue1`,`MaxStanding2`,`IsTeamAward2`,`RewOnKillRepValue2`,`TeamDependent`) VALUES +(14492, 21, 0, 5, 0, 5, 0, 0, 0, 0); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493349239278044600.sql b/data/sql/updates/db_world/2017_08_19_13.sql similarity index 76% rename from data/sql/updates/pending_db_world/rev_1493349239278044600.sql rename to data/sql/updates/db_world/2017_08_19_13.sql index f1df78966..ce8e5b1ed 100644 --- a/data/sql/updates/pending_db_world/rev_1493349239278044600.sql +++ b/data/sql/updates/db_world/2017_08_19_13.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_12 -> 2017_08_19_13 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_12'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_12 2017_08_19_13 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1493349239278044600'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1493349239278044600'); -- DELETE FROM conditions WHERE SourceTypeOrReferenceId=13 AND SourceEntry=45872; @@ -22,3 +37,12 @@ INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`pr (@ENTRY,1,2,'Live, damn you!',14,0,100,0,0,0,'Part of the Doctor Razorgin ooc lines',24868); UPDATE `creature` SET `position_x`=4402.431152, `position_y`=4554.557129, `position_z`=88.743332, `orientation`=0.395920, `MovementType`=0, `spawndist`=0 WHERE `id`=@ENTRY; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1494230753178074480.sql b/data/sql/updates/db_world/2017_08_19_14.sql similarity index 65% rename from data/sql/updates/pending_db_world/rev_1494230753178074480.sql rename to data/sql/updates/db_world/2017_08_19_14.sql index 72497c860..a2042bb15 100644 --- a/data/sql/updates/pending_db_world/rev_1494230753178074480.sql +++ b/data/sql/updates/db_world/2017_08_19_14.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_13 -> 2017_08_19_14 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_13'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_13 2017_08_19_14 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1494230753178074480'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1494230753178074480'); -- The boar hunter requires 12 kills, not 8 @@ -23,3 +38,12 @@ UPDATE `quest_template_addon` SET `PrevQuestID` = 32, `NextQuestID` = 4496, `Ex UPDATE `quest_template` SET RewardXPDifficulty = 4, RewardBonusMoney = 3600 WHERE ID = 4103; -- Salve via hunting repeatable quest for horde WAS! UPDATE `quest_template` SET RewardXPDifficulty = 0, RewardBonusMoney = 0 WHERE ID = 5887; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1495464409315344160.sql b/data/sql/updates/db_world/2017_08_19_15.sql similarity index 89% rename from data/sql/updates/pending_db_world/rev_1495464409315344160.sql rename to data/sql/updates/db_world/2017_08_19_15.sql index 39fb5c0de..7f933125e 100644 --- a/data/sql/updates/pending_db_world/rev_1495464409315344160.sql +++ b/data/sql/updates/db_world/2017_08_19_15.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_14 -> 2017_08_19_15 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_14'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_14 2017_08_19_15 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1495464409315344160'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1495464409315344160'); -- The Troll Cave requires 14 kills, not 10. @@ -147,3 +162,12 @@ DELETE FROM `spell_loot_template` WHERE `entry` IN (58168,58172) and `item` UPDATE `item_loot_template` SET `ChanceOrQuestChance` = 100 WHERE `entry` = 10569 AND `item` = 10575; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql b/data/sql/updates/db_world/2017_08_19_16.sql similarity index 88% rename from data/sql/updates/pending_db_world/rev_1495729610203623150.sql rename to data/sql/updates/db_world/2017_08_19_16.sql index fe8e91d53..73d1ba7d9 100644 --- a/data/sql/updates/pending_db_world/rev_1495729610203623150.sql +++ b/data/sql/updates/db_world/2017_08_19_16.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_15 -> 2017_08_19_16 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_15'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_15 2017_08_19_16 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1495729610203623150'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1495729610203623150'); -- Bael'Gar's Fiery Essence requires Bael'Gar's Corpse, borrowed from TrinityCore/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_00_world.sql @@ -78,3 +93,12 @@ INSERT INTO `creature` (`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_ UPDATE `creature_loot_template` SET `ChanceOrQuestChance` = 15 WHERE `item` = 24504 AND `entry` IN (17158,17159,17160); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1503138647187080900.sql b/data/sql/updates/db_world/2017_08_19_17.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1503138647187080900.sql rename to data/sql/updates/db_world/2017_08_19_17.sql index 4c30134aa..75e791cb5 100644 --- a/data/sql/updates/pending_db_world/rev_1503138647187080900.sql +++ b/data/sql/updates/db_world/2017_08_19_17.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_16 -> 2017_08_19_17 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_16'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_16 2017_08_19_17 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1503138647187080900'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1503138647187080900'); -- Instructor Razuvious - Event with Acherus Necromancer and Death Knight Initiate -- http://wow.gamepedia.com/Death_Knight_Initiate @@ -279,3 +294,12 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@ENTRY,9,3,0,0,0,100,0,1000,1000,0,0,2,2093,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Faction 2093"), (@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,514,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Remove Flags Not Attackable & Immune To NPC's"), (@ENTRY,9,5,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Start Attacking"); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/db_world/2017_08_19_18.sql b/data/sql/updates/db_world/2017_08_19_18.sql new file mode 100644 index 000000000..e17f62ffd --- /dev/null +++ b/data/sql/updates/db_world/2017_08_19_18.sql @@ -0,0 +1,29 @@ +-- DB update 2017_08_19_17 -> 2017_08_19_18 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_17'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_17 2017_08_19_18 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1503138789369120900'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- +INSERT INTO version_db_world (`sql_rev`) VALUES ('1503138789369120900'); + +-- Scarlet Infantryman +UPDATE creature_equip_template SET ItemID1= 38721, ItemID2= 12932 WHERE CreatureID= 28609; +UPDATE creature_equip_template SET ItemID1= 38723, ItemID2= 12932 WHERE CreatureID= 28896; +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1503139021197350000.sql b/data/sql/updates/db_world/2017_08_19_19.sql similarity index 97% rename from data/sql/updates/pending_db_world/rev_1503139021197350000.sql rename to data/sql/updates/db_world/2017_08_19_19.sql index 77fc2459a..ac2056bd8 100644 --- a/data/sql/updates/pending_db_world/rev_1503139021197350000.sql +++ b/data/sql/updates/db_world/2017_08_19_19.sql @@ -1,3 +1,18 @@ +-- DB update 2017_08_19_18 -> 2017_08_19_19 +DROP PROCEDURE IF EXISTS `updateDb`; +DELIMITER // +CREATE PROCEDURE updateDb () +proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE'; +SELECT COUNT(*) INTO @COLEXISTS +FROM information_schema.COLUMNS +WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2017_08_19_18'; +IF @COLEXISTS = 0 THEN LEAVE proc; END IF; +START TRANSACTION; +ALTER TABLE version_db_world CHANGE COLUMN 2017_08_19_18 2017_08_19_19 bit; +SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1503139021197350000'; IF OK <> 'FALSE' THEN LEAVE proc; END IF; +-- +-- START UPDATING QUERIES +-- INSERT INTO version_db_world (`sql_rev`) VALUES ('1503139021197350000'); -- Instructor Razuvious - Event with Acherus Necromancer and Death Knight Initiate -- http://wow.gamepedia.com/Death_Knight_Initiate @@ -279,3 +294,12 @@ INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type (@ENTRY,9,3,0,0,0,100,0,1000,1000,0,0,2,2093,0,0,0,0,0,1,0,0,0,0,0,0,0,"Acherus Ghoul - On Script - Set Faction 2093"), (@ENTRY,9,4,0,0,0,100,0,0,0,0,0,19,514,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Remove Flags Not Attackable & Immune To NPC's"), (@ENTRY,9,5,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,10,129459,28394,0,0,0,0,0,"Acherus Ghoul - On Script - Start Attacking"); +-- +-- END UPDATING QUERIES +-- +COMMIT; +END; +// +DELIMITER ; +CALL updateDb(); +DROP PROCEDURE IF EXISTS `updateDb`; diff --git a/data/sql/updates/pending_db_world/rev_1493343523138941000.sql b/data/sql/updates/pending_db_world/rev_1493343523138941000.sql deleted file mode 100644 index 57954ec85..000000000 --- a/data/sql/updates/pending_db_world/rev_1493343523138941000.sql +++ /dev/null @@ -1,6 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1493343523138941000'); --- replace "Mac" with actual player name ($N) in the reward text -UPDATE `quest_template` -SET `OfferRewardText`= "Great Spirit Totem! This is dire news indeed. I must begin to plan for whatever may come.$b$b$N, as promised, here is your reward for your brave service.$b$b" -WHERE `ID`= 5064; --- diff --git a/data/sql/updates/pending_db_world/rev_1493344470069156600.sql b/data/sql/updates/pending_db_world/rev_1493344470069156600.sql deleted file mode 100644 index b677181f5..000000000 --- a/data/sql/updates/pending_db_world/rev_1493344470069156600.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1493344470069156600'); -UPDATE `spell_dbc` SET `RangeIndex`=4 WHERE `Id`=61698; diff --git a/data/sql/updates/pending_db_world/rev_1493344929793898700.sql b/data/sql/updates/pending_db_world/rev_1493344929793898700.sql deleted file mode 100644 index 41c45c7e4..000000000 --- a/data/sql/updates/pending_db_world/rev_1493344929793898700.sql +++ /dev/null @@ -1,2 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1493344929793898700'); -UPDATE `creature_template` SET `faction` = 1873 WHERE `entry` = 16927; diff --git a/data/sql/updates/pending_db_world/rev_1493347575872142000.sql b/data/sql/updates/pending_db_world/rev_1493347575872142000.sql deleted file mode 100644 index 2415faa21..000000000 --- a/data/sql/updates/pending_db_world/rev_1493347575872142000.sql +++ /dev/null @@ -1,7 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1493347575872142000'); --- Verifonix -UPDATE `creature_template` SET `faction`=47 WHERE `entry`=14492; - -DELETE FROM `creature_onkill_reputation` WHERE `creature_id`=14492; -INSERT INTO `creature_onkill_reputation` (`creature_id`,`RewOnKillRepFaction1`,`RewOnKillRepFaction2`,`MaxStanding1`,`IsTeamAward1`,`RewOnKillRepValue1`,`MaxStanding2`,`IsTeamAward2`,`RewOnKillRepValue2`,`TeamDependent`) VALUES -(14492, 21, 0, 5, 0, 5, 0, 0, 0, 0); diff --git a/data/sql/updates/pending_db_world/rev_1503138789369120900.sql b/data/sql/updates/pending_db_world/rev_1503138789369120900.sql deleted file mode 100644 index 855deaa11..000000000 --- a/data/sql/updates/pending_db_world/rev_1503138789369120900.sql +++ /dev/null @@ -1,5 +0,0 @@ -INSERT INTO version_db_world (`sql_rev`) VALUES ('1503138789369120900'); - --- Scarlet Infantryman -UPDATE creature_equip_template SET ItemID1= 38721, ItemID2= 12932 WHERE CreatureID= 28609; -UPDATE creature_equip_template SET ItemID1= 38723, ItemID2= 12932 WHERE CreatureID= 28896; From f888e8c86b09d55587294921fbfeb58afb3d2282 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 18:37:47 +0200 Subject: [PATCH 46/51] Preprocessor option for logging functions (#567) * Update showoptions.cmake * Update config.cmake.dist * Example of preprocessor usage Other work must continue for PR https://github.com/azerothcore/azerothcore-wotlk/pull/519 --- conf/config.cmake.dist | 1 + .../lib-collision/src/Management/MMapManager.cpp | 4 +++- src/cmake/showoptions.cmake | 7 +++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/conf/config.cmake.dist b/conf/config.cmake.dist index d76098095..6b98015e0 100644 --- a/conf/config.cmake.dist +++ b/conf/config.cmake.dist @@ -10,3 +10,4 @@ option(WITH_MESHEXTRACTOR "Build meshextractor (alpha)" option(WITHOUT_GIT "Disable the GIT testing routines" 0) option(DISABLE_EXTRAS "Set to 1 to disable extra features optimizing performances" 0) option(DISABLE_VMAP_CHECKS "Remove DisableMgr Checks on vmap" 0) +option(DISABLE_EXTRA_LOGS "Disable extra log functions that can be CPU intensive" 1) diff --git a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp index 722a8321f..a4a50ce3e 100644 --- a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp +++ b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp @@ -34,7 +34,9 @@ namespace MMAP FILE* file = fopen(fileName, "rb"); if (!file) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName); +#if defined(DISABLE_EXTRAS) || defined(DISABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName); +#endif delete [] fileName; return false; } diff --git a/src/cmake/showoptions.cmake b/src/cmake/showoptions.cmake index 5199d7b14..827b6c15e 100644 --- a/src/cmake/showoptions.cmake +++ b/src/cmake/showoptions.cmake @@ -121,5 +121,12 @@ else() message("* Disable vmap DisableMgr checks : No (default)") endif() +if( DISABLE_EXTRA_LOGS ) + message("* Disable extra logging functions : Yes (default)") + add_definitions(-DDISABLE_EXTRA_LOGS) +else() + message("* Disable extra logging functions : No") +endif() + message("") From c1586e0d995de5dd278b0acfe410acf66f6c2c6d Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 19:42:48 +0200 Subject: [PATCH 47/51] changed DISABLED_ cmake variable to ENABLED_ and implemented for all disabled logs --- conf/config.cmake.dist | 6 +- .../src/Management/MMapManager.cpp | 54 +- .../src/Management/VMapManager2.cpp | 18 +- .../lib-collision/src/Maps/MapTree.cpp | 18 +- .../nucleus/src/Database/MySQLConnection.cpp | 4 +- src/authserver/Server/AuthSocket.cpp | 136 +++- src/cmake/showoptions.cmake | 24 +- src/game/AI/CoreAI/CombatAI.cpp | 4 +- src/game/AI/CoreAI/GuardAI.cpp | 4 +- src/game/AI/CoreAI/PetAI.cpp | 8 +- src/game/AI/CreatureAI.cpp | 4 +- src/game/AI/CreatureAISelector.cpp | 8 +- src/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 32 +- src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 36 +- src/game/AI/SmartScripts/SmartAI.cpp | 8 +- src/game/AI/SmartScripts/SmartScript.cpp | 172 +++-- src/game/AI/SmartScripts/SmartScriptMgr.h | 4 +- src/game/Achievements/AchievementMgr.cpp | 16 +- src/game/AuctionHouse/AuctionHouseMgr.cpp | 16 +- src/game/Battlefield/Battlefield.cpp | 4 +- src/game/Battlefield/BattlefieldMgr.cpp | 16 +- src/game/Battlegrounds/ArenaTeam.cpp | 16 +- src/game/Battlegrounds/Battleground.cpp | 8 +- .../Battlegrounds/Zones/BattlegroundAV.cpp | 120 +++- src/game/Calendar/CalendarMgr.cpp | 4 +- src/game/Chat/Channels/Channel.cpp | 8 +- src/game/Chat/ChatLink.cpp | 200 ++++-- src/game/Conditions/ConditionMgr.cpp | 32 +- src/game/DungeonFinding/LFGMgr.cpp | 92 ++- src/game/DungeonFinding/LFGScripts.cpp | 28 +- src/game/Entities/Creature/Creature.cpp | 20 +- src/game/Entities/Creature/CreatureGroups.cpp | 32 +- src/game/Entities/Creature/GossipDef.cpp | 24 +- src/game/Entities/GameObject/GameObject.cpp | 12 +- src/game/Entities/Item/Item.cpp | 12 +- src/game/Entities/Pet/Pet.cpp | 16 +- src/game/Entities/Player/Player.cpp | 596 +++++++++++++----- src/game/Entities/Player/SocialMgr.cpp | 4 +- src/game/Entities/Unit/Unit.cpp | 176 ++++-- src/game/Entities/Vehicle/Vehicle.cpp | 32 +- src/game/Events/GameEventMgr.cpp | 12 +- src/game/Globals/ObjectAccessor.cpp | 4 +- src/game/Globals/ObjectMgr.cpp | 16 +- src/game/Grids/ObjectGridLoader.cpp | 4 +- src/game/Groups/Group.cpp | 12 +- src/game/Guilds/Guild.cpp | 88 ++- src/game/Handlers/AddonHandler.cpp | 8 +- src/game/Handlers/ArenaTeamHandler.cpp | 52 +- src/game/Handlers/AuctionHouseHandler.cpp | 64 +- src/game/Handlers/BattleGroundHandler.cpp | 32 +- src/game/Handlers/ChannelHandler.cpp | 64 +- src/game/Handlers/CharacterHandler.cpp | 76 ++- src/game/Handlers/ChatHandler.cpp | 4 +- src/game/Handlers/CombatHandler.cpp | 4 +- src/game/Handlers/DuelHandler.cpp | 12 +- src/game/Handlers/GroupHandler.cpp | 72 ++- src/game/Handlers/GuildHandler.cpp | 132 +++- src/game/Handlers/ItemHandler.cpp | 120 +++- src/game/Handlers/LFGHandler.cpp | 104 ++- src/game/Handlers/LootHandler.cpp | 28 +- src/game/Handlers/MailHandler.cpp | 12 +- src/game/Handlers/MiscHandler.cpp | 320 +++++++--- src/game/Handlers/MovementHandler.cpp | 40 +- src/game/Handlers/NPCHandler.cpp | 116 +++- src/game/Handlers/PetHandler.cpp | 60 +- src/game/Handlers/PetitionsHandler.cpp | 104 ++- src/game/Handlers/QueryHandler.cpp | 48 +- src/game/Handlers/QuestHandler.cpp | 80 ++- src/game/Handlers/ReferAFriendHandler.cpp | 8 +- src/game/Handlers/SkillHandler.cpp | 12 +- src/game/Handlers/SpellHandler.cpp | 36 +- src/game/Handlers/TaxiHandler.cpp | 64 +- src/game/Handlers/TradeHandler.cpp | 24 +- src/game/Handlers/VehicleHandler.cpp | 12 +- src/game/Handlers/VoiceChatHandler.cpp | 12 +- src/game/Instances/InstanceScript.cpp | 16 +- src/game/Instances/InstanceScript.h | 16 +- src/game/Maps/Map.cpp | 60 +- src/game/Maps/MapInstanced.cpp | 8 +- src/game/Maps/MapManager.cpp | 16 +- src/game/Movement/MotionMaster.cpp | 112 +++- .../WaypointMovementGenerator.cpp | 16 +- src/game/OutdoorPvP/OutdoorPvP.cpp | 16 +- src/game/OutdoorPvP/OutdoorPvPMgr.cpp | 8 +- src/game/Pools/PoolMgr.cpp | 12 +- src/game/Server/WorldSession.cpp | 40 +- src/game/Server/WorldSocket.cpp | 24 +- src/game/Server/WorldSocketMgr.cpp | 8 +- src/game/Spells/Auras/SpellAuraEffects.cpp | 76 ++- src/game/Spells/Auras/SpellAuras.cpp | 16 +- src/game/Spells/Spell.cpp | 64 +- src/game/Spells/SpellEffects.cpp | 84 ++- src/game/Spells/SpellInfo.cpp | 4 +- src/game/Spells/SpellMgr.cpp | 24 +- src/game/Texts/CreatureTextMgr.cpp | 8 +- src/game/Warden/Warden.cpp | 32 +- src/game/Warden/WardenMac.cpp | 60 +- src/game/Warden/WardenWin.cpp | 140 +++- src/game/Weather/Weather.cpp | 12 +- src/game/World/World.cpp | 24 +- src/scripts/Commands/cs_misc.cpp | 8 +- src/scripts/Commands/cs_modify.cpp | 12 +- .../instance_blackrock_depths.cpp | 8 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 4 +- .../ScarletEnclave/chapter2.cpp | 4 +- src/scripts/Outland/zone_netherstorm.cpp | 4 +- src/scripts/World/npc_professions.cpp | 4 +- src/worldserver/RemoteAccess/RARunnable.cpp | 4 +- src/worldserver/TCSoap/TCSoap.cpp | 24 +- 109 files changed, 3620 insertions(+), 1228 deletions(-) diff --git a/conf/config.cmake.dist b/conf/config.cmake.dist index 6b98015e0..5884963ac 100644 --- a/conf/config.cmake.dist +++ b/conf/config.cmake.dist @@ -8,6 +8,6 @@ option(WITH_COREDEBUG "Include additional debug-code in core" option(WITH_PERFTOOLS "Enable compilation with gperftools libraries included" 0) option(WITH_MESHEXTRACTOR "Build meshextractor (alpha)" 0) option(WITHOUT_GIT "Disable the GIT testing routines" 0) -option(DISABLE_EXTRAS "Set to 1 to disable extra features optimizing performances" 0) -option(DISABLE_VMAP_CHECKS "Remove DisableMgr Checks on vmap" 0) -option(DISABLE_EXTRA_LOGS "Disable extra log functions that can be CPU intensive" 1) +option(ENABLE_EXTRAS "Set to 0 to disable extra features optimizing performances" 1) +option(ENABLE_VMAP_CHECKS "Enable Checks relative to DisableMgr system on vmap" 1) +option(ENABLE_EXTRA_LOGS "Enable extra log functions that can be CPU intensive" 0) diff --git a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp index a4a50ce3e..f18604f77 100644 --- a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp +++ b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp @@ -34,7 +34,7 @@ namespace MMAP FILE* file = fopen(fileName, "rb"); if (!file) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_EXTRA_LOGS) +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName); #endif delete [] fileName; @@ -63,7 +63,9 @@ namespace MMAP delete [] fileName; - ;//sLog->outDetail("MMAP:loadMapData: Loaded %03i.mmap", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:loadMapData: Loaded %03i.mmap", mapId); +#endif // store inside our map list MMapData* mmap_data = new MMapData(mesh); @@ -117,7 +119,9 @@ namespace MMAP FILE *file = fopen(fileName, "rb"); if (!file) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName); +#endif delete [] fileName; return false; } @@ -167,7 +171,9 @@ namespace MMAP { mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); ++loadedTiles; - ;//sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); +#endif return true; } else @@ -188,7 +194,9 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %03u%02i%02i.mmtile", mapId, x, y); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %03u%02i%02i.mmtile", mapId, x, y); +#endif return false; } @@ -199,7 +207,9 @@ namespace MMAP if (mmap->mmapLoadedTiles.find(packedGridPos) == mmap->mmapLoadedTiles.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); +#endif return false; } @@ -224,7 +234,9 @@ namespace MMAP { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; - ;//sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#endif return true; } @@ -238,7 +250,9 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map %03u", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map %03u", mapId); +#endif return false; } @@ -260,13 +274,17 @@ namespace MMAP else { --loadedTiles; - ;//sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); +#endif } } delete mmap; loadedMMaps.erase(mapId); - ;//sLog->outDetail("MMAP:unloadMap: Unloaded %03i.mmap", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMap: Unloaded %03i.mmap", mapId); +#endif return true; } @@ -279,14 +297,18 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %03u", mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %03u", mapId); +#endif return false; } MMapData* mmap = loadedMMaps[mapId]; if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end()) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %03u instanceId %u", mapId, instanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %03u instanceId %u", mapId, instanceId); +#endif return false; } @@ -294,7 +316,9 @@ namespace MMAP dtFreeNavMeshQuery(query); mmap->navMeshQueries.erase(instanceId); - ;//sLog->outDetail("MMAP:unloadMapInstance: Unloaded mapId %03u instanceId %u", mapId, instanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:unloadMapInstance: Unloaded mapId %03u instanceId %u", mapId, instanceId); +#endif return true; } @@ -336,7 +360,9 @@ namespace MMAP return NULL; } - ;//sLog->outDetail("MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); +#endif mmap->navMeshQueries.insert(std::pair(instanceId, query)); } } diff --git a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp index d67b465ae..e466929a0 100644 --- a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp +++ b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp @@ -124,7 +124,7 @@ namespace VMAP bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) return true; #endif @@ -149,7 +149,7 @@ namespace VMAP */ bool VMapManager2::getObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) #endif { @@ -181,7 +181,7 @@ namespace VMAP float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist) { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT)) #endif { @@ -202,7 +202,7 @@ namespace VMAP bool VMapManager2::getAreaInfo(unsigned int mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG)) #endif { @@ -222,7 +222,7 @@ namespace VMAP bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const { -#if defined(DISABLE_EXTRAS) || defined(DISABLE_VMAP_CHECKS) +#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS)) #endif { @@ -262,7 +262,9 @@ namespace VMAP delete worldmodel; return NULL; } - ;//sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); +#endif model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; model->second.setModel(worldmodel); } @@ -283,7 +285,9 @@ namespace VMAP } if (model->second.decRefCount() == 0) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: unloading file '%s'", filename.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: unloading file '%s'", filename.c_str()); +#endif delete model->second.getModel(); iLoadedModelFiles.erase(model); }*/ diff --git a/modules/worldengine/lib-collision/src/Maps/MapTree.cpp b/modules/worldengine/lib-collision/src/Maps/MapTree.cpp index ebd8656f4..092625dd9 100644 --- a/modules/worldengine/lib-collision/src/Maps/MapTree.cpp +++ b/modules/worldengine/lib-collision/src/Maps/MapTree.cpp @@ -44,8 +44,8 @@ namespace VMAP AreaInfoCallback(ModelInstance* val): prims(val) {} void operator()(const Vector3& point, uint32 entry) { -#ifdef VMAP_DEBUG - ;//sLog->outDebug(LOG_FILTER_MAPS, "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG + sLog->outDebug(LOG_FILTER_MAPS, "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); } @@ -60,8 +60,8 @@ namespace VMAP LocationInfoCallback(ModelInstance* val, LocationInfo &info): prims(val), locInfo(info), result(false) {} void operator()(const Vector3& point, uint32 entry) { -#ifdef VMAP_DEBUG - ;//sLog->outDebug(LOG_FILTER_MAPS, "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG + sLog->outDebug(LOG_FILTER_MAPS, "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) result = true; @@ -373,10 +373,10 @@ namespace VMAP { if (!iLoadedSpawns.count(referencedVal)) { -#ifdef VMAP_DEBUG +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG if (referencedVal > iNTreeValues) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); continue; } #endif @@ -386,11 +386,11 @@ namespace VMAP else { ++iLoadedSpawns[referencedVal]; -#ifdef VMAP_DEBUG +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG if (iTreeValues[referencedVal].ID != spawn.ID) - ;//sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); else if (iTreeValues[referencedVal].name != spawn.name) - ;//sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); + sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : name collision on GUID=%u", spawn.ID); #endif } } diff --git a/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp b/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp index b11f161be..2735d4940 100644 --- a/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp +++ b/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp @@ -121,7 +121,9 @@ bool MySQLConnection::Open() // sLog->outInfo(LOG_FILTER_SQL, "[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements."); } - ;//sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); +#endif mysql_autocommit(m_Mysql, 1); // set connection properties to UTF8 to properly handle locales for different diff --git a/src/authserver/Server/AuthSocket.cpp b/src/authserver/Server/AuthSocket.cpp index b9671c0d1..d53f7fcc4 100644 --- a/src/authserver/Server/AuthSocket.cpp +++ b/src/authserver/Server/AuthSocket.cpp @@ -197,7 +197,9 @@ void AuthSocket::OnAccept(void) void AuthSocket::OnClose(void) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "AuthSocket::OnClose"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "AuthSocket::OnClose"); +#endif } // Read the packet from the client @@ -229,11 +231,15 @@ void AuthSocket::OnRead() { if ((uint8)table[i].cmd == _cmd && (table[i].status == _status)) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); +#endif if (!(*this.*table[i].handler)()) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); +#endif return; } break; @@ -243,7 +249,9 @@ void AuthSocket::OnRead() // Report unknown packets in the error log if (i == AUTH_TOTAL_COMMANDS) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Got unknown packet from '%s'", socket().getRemoteAddress().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Got unknown packet from '%s'", socket().getRemoteAddress().c_str()); +#endif socket().shutdown(); return; } @@ -296,7 +304,9 @@ ACE_Thread_Mutex LastLoginAttemptMutex; // Logon Challenge command handler bool AuthSocket::_HandleLogonChallenge() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleLogonChallenge"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleLogonChallenge"); +#endif if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) return false; @@ -336,7 +346,9 @@ bool AuthSocket::_HandleLogonChallenge() EndianConvertPtr(&buf[0]); uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] got header, body is %#04x bytes", remaining); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] got header, body is %#04x bytes", remaining); +#endif if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining)) return false; @@ -348,8 +360,12 @@ bool AuthSocket::_HandleLogonChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] got full packet, %#04x bytes", ch->size); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] got full packet, %#04x bytes", ch->size); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); +#endif // BigEndian code, nop in little endian case // size already converted @@ -387,7 +403,9 @@ bool AuthSocket::_HandleLogonChallenge() if (result) { pkt << uint8(WOW_FAIL_BANNED); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); +#endif } else { @@ -405,20 +423,30 @@ bool AuthSocket::_HandleLogonChallenge() bool locked = false; if (fields[2].GetUInt8() == 1) // if ip is locked { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Player address is '%s'", ip_address.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Player address is '%s'", ip_address.c_str()); +#endif if (strcmp(fields[3].GetCString(), ip_address.c_str()) != 0) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP differs"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP differs"); +#endif pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); locked = true; } else - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP matches"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP matches"); +#endif } else - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); +#endif if (!locked) { @@ -434,12 +462,16 @@ bool AuthSocket::_HandleLogonChallenge() if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32()) { pkt << uint8(WOW_FAIL_BANNED); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); +#endif } else { pkt << uint8(WOW_FAIL_SUSPENDED); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); +#endif } } else @@ -451,7 +483,9 @@ bool AuthSocket::_HandleLogonChallenge() std::string databaseV = fields[5].GetString(); std::string databaseS = fields[6].GetString(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); +#endif // multiply with 2 since bytes are stored as hexstring if (databaseV.size() != s_BYTE_SIZE * 2 || databaseS.size() != s_BYTE_SIZE * 2) @@ -513,7 +547,9 @@ bool AuthSocket::_HandleLogonChallenge() for (int i = 0; i < 4; ++i) _localizationName[i] = ch->country[4-i-1]; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), +#endif // _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) // ); @@ -533,7 +569,9 @@ bool AuthSocket::_HandleLogonChallenge() // Logon Proof command handler bool AuthSocket::_HandleLogonProof() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleLogonProof"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleLogonProof"); +#endif // Read the packet sAuthLogonProof_C lp; @@ -546,7 +584,9 @@ bool AuthSocket::_HandleLogonProof() if (_expversion == NO_VALID_EXP_FLAG) { // Check if we have the appropriate patch on the disk - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); +#endif socket().shutdown(); return true; } @@ -630,7 +670,9 @@ bool AuthSocket::_HandleLogonProof() // Check if SRP6 results match (password is correct), else send an error if (!memcmp(M.AsByteArray().get(), lp.M1, 20)) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); +#endif // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket @@ -680,7 +722,9 @@ bool AuthSocket::_HandleLogonProof() char data[4] = { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0 }; socket().send(data, sizeof(data)); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); +#endif uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0); if (MaxWrongPassCount > 0) @@ -710,7 +754,9 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", +#endif // socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); } else @@ -720,7 +766,9 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", +#endif // socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); } } @@ -734,7 +782,9 @@ bool AuthSocket::_HandleLogonProof() // Reconnect Challenge command handler bool AuthSocket::_HandleReconnectChallenge() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleReconnectChallenge"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleReconnectChallenge"); +#endif if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) return false; @@ -747,7 +797,9 @@ bool AuthSocket::_HandleReconnectChallenge() EndianConvertPtr(&buf[0]); uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] got header, body is %#04x bytes", remaining); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] got header, body is %#04x bytes", remaining); +#endif if ((remaining < sizeof(sAuthLogonChallenge_C) - buf.size()) || (socket().recv_len() < remaining)) return false; @@ -762,8 +814,12 @@ bool AuthSocket::_HandleReconnectChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] got full packet, %#04x bytes", ch->size); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] got full packet, %#04x bytes", ch->size); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); +#endif _login = (const char*)ch->I; @@ -813,7 +869,9 @@ bool AuthSocket::_HandleReconnectChallenge() // Reconnect Proof command handler bool AuthSocket::_HandleReconnectProof() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleReconnectProof"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleReconnectProof"); +#endif // Read the packet sAuthReconnectProof_C lp; if (!socket().recv((char *)&lp, sizeof(sAuthReconnectProof_C))) @@ -880,7 +938,9 @@ ACE_INET_Addr const& AuthSocket::GetAddressForClient(Realm const& realm, ACE_INE // Realm List command handler bool AuthSocket::_HandleRealmList() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleRealmList"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleRealmList"); +#endif if (socket().recv_len() < 5) return false; @@ -1010,7 +1070,9 @@ bool AuthSocket::_HandleRealmList() // Resume patch transfer bool AuthSocket::_HandleXferResume() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferResume"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferResume"); +#endif // Check packet length and patch existence if (socket().recv_len() < 9 || !pPatch) // FIXME: pPatch is never used { @@ -1031,7 +1093,9 @@ bool AuthSocket::_HandleXferResume() // Cancel patch transfer bool AuthSocket::_HandleXferCancel() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferCancel"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferCancel"); +#endif // Close and delete the socket socket().recv_skip(1); //clear input buffer @@ -1043,7 +1107,9 @@ bool AuthSocket::_HandleXferCancel() // Accept patch transfer bool AuthSocket::_HandleXferAccept() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferAccept"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferAccept"); +#endif // Check packet length and patch existence if (!pPatch) @@ -1129,7 +1195,9 @@ void Patcher::LoadPatchMD5(char *szFileName) std::string path = "./patches/"; path += szFileName; FILE* pPatch = fopen(path.c_str(), "rb"); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Loading patch info from %s\n", path.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Loading patch info from %s\n", path.c_str()); +#endif if (!pPatch) { diff --git a/src/cmake/showoptions.cmake b/src/cmake/showoptions.cmake index 827b6c15e..1ec0e8754 100644 --- a/src/cmake/showoptions.cmake +++ b/src/cmake/showoptions.cmake @@ -107,25 +107,25 @@ endif() # Performance optimization options: -if( DISABLE_EXTRAS ) - message("* Disable extra features : Yes") - add_definitions(-DDISABLE_EXTRAS) +if( ENABLE_EXTRAS ) + message("* Enable extra features : Yes (default)") + add_definitions(-DENABLE_EXTRAS) else() - message("* Disable extra features : No (default)") + message("* Enable extra features : No") endif() -if( DISABLE_VMAP_CHECKS ) - message("* Disable vmap DisableMgr checks : Yes") - add_definitions(-DDISABLE_VMAP_CHECKS) +if( ENABLE_VMAP_CHECKS ) + message("* Enable vmap DisableMgr checks : Yes (default)") + add_definitions(-DENABLE_VMAP_CHECKS) else() - message("* Disable vmap DisableMgr checks : No (default)") + message("* Enable vmap DisableMgr checks : No") endif() -if( DISABLE_EXTRA_LOGS ) - message("* Disable extra logging functions : Yes (default)") - add_definitions(-DDISABLE_EXTRA_LOGS) +if( ENABLE_EXTRA_LOGS ) + message("* Enable extra logging functions : Yes") + add_definitions(-DENABLE_EXTRA_LOGS) else() - message("* Disable extra logging functions : No") + message("* Enable extra logging functions : No (default)") endif() message("") diff --git a/src/game/AI/CoreAI/CombatAI.cpp b/src/game/AI/CoreAI/CombatAI.cpp index f69ae8487..4b18bebff 100644 --- a/src/game/AI/CoreAI/CombatAI.cpp +++ b/src/game/AI/CoreAI/CombatAI.cpp @@ -281,7 +281,9 @@ void VehicleAI::LoadConditions() { conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry()); //if (!conditions.empty()) - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); +#endif } void VehicleAI::CheckConditions(uint32 diff) diff --git a/src/game/AI/CoreAI/GuardAI.cpp b/src/game/AI/CoreAI/GuardAI.cpp index fe3b8103f..118548321 100644 --- a/src/game/AI/CoreAI/GuardAI.cpp +++ b/src/game/AI/CoreAI/GuardAI.cpp @@ -39,7 +39,9 @@ void GuardAI::EnterEvadeMode() return; } - ;//sLog->outDebug(LOG_FILTER_UNITS, "Guard entry: %u enters evade mode.", me->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Guard entry: %u enters evade mode.", me->GetEntry()); +#endif me->RemoveAllAuras(); me->DeleteThreatList(); diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index 8e2516db7..0a3dc28b7 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -61,7 +61,9 @@ void PetAI::_stopAttack() { if (!me->IsAlive()) { - ;//sLog->outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow()); +#endif me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); me->CombatStop(); @@ -120,7 +122,9 @@ void PetAI::UpdateAI(uint32 diff) if (_needToStop()) { - ;//sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow()); +#endif _stopAttack(); return; } diff --git a/src/game/AI/CreatureAI.cpp b/src/game/AI/CreatureAI.cpp index f611f6d3c..a280e4977 100644 --- a/src/game/AI/CreatureAI.cpp +++ b/src/game/AI/CreatureAI.cpp @@ -132,7 +132,9 @@ void CreatureAI::EnterEvadeMode() if (!_EnterEvadeMode()) return; - ;//sLog->outDebug(LOG_FILTER_UNITS, "Creature %u enters evade mode.", me->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Creature %u enters evade mode.", me->GetEntry()); +#endif if (!me->GetVehicle()) // otherwise me will be in evade mode forever { diff --git a/src/game/AI/CreatureAISelector.cpp b/src/game/AI/CreatureAISelector.cpp index d76c624f4..e45097b7a 100644 --- a/src/game/AI/CreatureAISelector.cpp +++ b/src/game/AI/CreatureAISelector.cpp @@ -86,7 +86,9 @@ namespace FactorySelector // xinef: unused // ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key(); - ;//sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); +#endif return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature)); } @@ -134,7 +136,9 @@ namespace FactorySelector // xinef: unused //std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); - ;//sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); +#endif return (ai_factory == NULL ? new NullGameObjectAI(go) : ai_factory->Create(go)); } diff --git a/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp index cd7f0cea9..4fe6d9953 100644 --- a/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -156,7 +156,9 @@ void npc_escortAI::EnterEvadeMode() { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); +#endif } else { @@ -282,7 +284,9 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) //Combat start position reached, continue waypoint movement if (pointId == POINT_LAST_POINT) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); +#endif me->SetWalk(!m_bIsRunning); RemoveEscortState(STATE_ESCORT_RETURNING); @@ -292,7 +296,9 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) } else if (pointId == POINT_HOME) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); +#endif CurrentWP = WaypointList.begin(); m_uiWPWaitTimer = 1; @@ -380,14 +386,18 @@ void npc_escortAI::SetRun(bool on) if (!m_bIsRunning) me->SetWalk(false); else - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); +#endif } else { if (m_bIsRunning) me->SetWalk(true); else - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); +#endif } m_bIsRunning = on; @@ -433,13 +443,17 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false m_bCanReturnToStart = canLoopPath; //if (m_bCanReturnToStart && m_bCanInstantRespawn) - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); +#endif if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) { me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MoveIdle(); - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); +#endif } //disable npcflags @@ -450,7 +464,9 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); } - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); +#endif CurrentWP = WaypointList.begin(); diff --git a/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 37210250a..c1ca26c5c 100644 --- a/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -141,7 +141,9 @@ void FollowerAI::EnterEvadeMode() if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition."); +#endif if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) { @@ -167,7 +169,9 @@ void FollowerAI::UpdateAI(uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is set completed, despawns."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is set completed, despawns."); +#endif me->DespawnOrUnsummon(); return; } @@ -178,7 +182,9 @@ void FollowerAI::UpdateAI(uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_RETURNING)) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is returning to leader."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is returning to leader."); +#endif RemoveFollowState(STATE_FOLLOW_RETURNING); me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); @@ -207,7 +213,9 @@ void FollowerAI::UpdateAI(uint32 uiDiff) if (bIsMaxRangeExceeded) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI failed because player/group was to far away or not found"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI failed because player/group was to far away or not found"); +#endif me->DespawnOrUnsummon(); return; } @@ -250,7 +258,9 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu { if (me->GetVictim()) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI attempt to StartFollow while in combat."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI attempt to StartFollow while in combat."); +#endif return; } @@ -272,7 +282,9 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); +#endif } me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); @@ -281,7 +293,9 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID); +#endif } Player* FollowerAI::GetLeaderForFollower() @@ -300,7 +314,9 @@ Player* FollowerAI::GetLeaderForFollower() if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE) && member->IsAlive()) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader."); +#endif m_uiLeaderGUID = member->GetGUID(); return member; } @@ -309,7 +325,9 @@ Player* FollowerAI::GetLeaderForFollower() } } - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader."); +#endif return NULL; } diff --git a/src/game/AI/SmartScripts/SmartAI.cpp b/src/game/AI/SmartScripts/SmartAI.cpp index 40dea991e..95b1a5208 100644 --- a/src/game/AI/SmartScripts/SmartAI.cpp +++ b/src/game/AI/SmartScripts/SmartAI.cpp @@ -1096,7 +1096,9 @@ void SmartGameObjectAI::Reset() // Called when a player opens a gossip dialog with the gameobject. bool SmartGameObjectAI::GossipHello(Player* player, bool reportUse) { - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello"); +#endif GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, (uint32)reportUse, 0, false, NULL, go); return false; } @@ -1177,7 +1179,9 @@ class SmartTrigger : public AreaTriggerScript if (!player->IsAlive()) return false; - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "AreaTrigger %u is using SmartTrigger script", trigger->id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "AreaTrigger %u is using SmartTrigger script", trigger->id); +#endif SmartScript script; script.OnInitialize(NULL, trigger); script.ProcessEventsFor(SMART_EVENT_AREATRIGGER_ONTRIGGER, player, trigger->id); diff --git a/src/game/AI/SmartScripts/SmartScript.cpp b/src/game/AI/SmartScripts/SmartScript.cpp index 99a410f18..527c9c669 100644 --- a/src/game/AI/SmartScripts/SmartScript.cpp +++ b/src/game/AI/SmartScripts/SmartScript.cpp @@ -145,7 +145,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u mLastInvoker = unit->GetGUID(); //if (Unit* tempInvoker = GetLastInvoker()) - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName().c_str(), tempInvoker->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName().c_str(), tempInvoker->GetGUIDLow()); +#endif switch (e.GetActionType()) { @@ -191,7 +193,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u mTextTimer = e.action.talk.duration; mUseTextTimer = true; sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u", +#endif // talker->GetName().c_str(), talker->GetGUIDLow(), GUID_LOPART(mTextGUID)); break; } @@ -209,7 +213,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u Unit* templastInvoker = GetLastInvoker(); sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker : 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, (*itr)->ToPlayer()); } - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u", +#endif // (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID)); } @@ -227,7 +233,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) { (*itr)->ToUnit()->HandleEmoteCommand(e.action.emote.emote); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: %s (GuidLow: %u), emote: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: %s (GuidLow: %u), emote: %u", +#endif // (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.emote.emote); } } @@ -246,7 +254,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) { (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u", +#endif // (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound, e.action.sound.range); } } @@ -267,7 +277,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (e.action.faction.factionID) { (*itr)->ToCreature()->setFaction(e.action.faction.factionID); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", +#endif // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.faction.factionID); } else @@ -277,7 +289,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if ((*itr)->ToCreature()->getFaction() != ci->faction) { (*itr)->ToCreature()->setFaction(ci->faction); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", +#endif // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction); } } @@ -309,7 +323,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { uint32 displayId = ObjectMgr::ChooseDisplayId(ci); (*itr)->ToCreature()->SetDisplayId(displayId); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", +#endif // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), display_id); } } @@ -317,14 +333,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else { (*itr)->ToCreature()->SetDisplayId(e.action.morphOrMount.model); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", +#endif // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.morphOrMount.model); } } else { (*itr)->ToCreature()->DeMorph(); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u demorphs.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u demorphs.", +#endif // (*itr)->GetEntry(), (*itr)->GetGUIDLow()); } } @@ -343,7 +363,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsPlayer(*itr)) { (*itr)->ToPlayer()->FailQuest(e.action.quest.quest); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow %u fails quest %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow %u fails quest %u", +#endif // (*itr)->GetGUIDLow(), e.action.quest.quest); } } @@ -364,7 +386,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) { (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", +#endif // (*itr)->GetGUIDLow(), e.action.quest.quest); } } @@ -426,7 +450,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { uint32 emote = temp[urand(0, count - 1)]; (*itr)->ToUnit()->HandleEmoteCommand(emote); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow %u handle random emote %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow %u handle random emote %u", +#endif // (*itr)->GetGUIDLow(), emote); } } @@ -445,7 +471,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (Unit* target = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid())) { me->getThreatManager().modifyThreatPercent(target, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature guidLow %u modify threat for unit %u, value %i", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature guidLow %u modify threat for unit %u, value %i", +#endif // me->GetGUIDLow(), target->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); } } @@ -465,7 +493,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) { me->getThreatManager().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow %u modify threat for unit %u, value %i", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow %u modify threat for unit %u, value %i", +#endif // me->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); } } @@ -492,7 +522,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) { player->GroupEventHappens(e.action.quest.quest, me); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow %u credited quest %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow %u credited quest %u", +#endif // (*itr)->GetGUIDLow(), e.action.quest.quest); } } @@ -599,7 +631,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) { (*itr)->ToUnit()->AddAura(e.action.cast.spell, (*itr)->ToUnit()); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura %u to unit %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura %u to unit %u", +#endif // e.action.cast.spell, (*itr)->GetGUIDLow()); } } @@ -621,7 +655,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u // xinef: wtf is this shit? (*itr)->ToGameObject()->SetLootState(GO_READY); (*itr)->ToGameObject()->UseDoorOrButton(0, e.action.activateObject.alternative ? true : false, unit); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", +#endif // (*itr)->GetGUIDLow(), (*itr)->GetEntry()); } } @@ -640,7 +676,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsGameObject(*itr)) { (*itr)->ToGameObject()->ResetDoorOrButton(); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject %u (entry: %u) reset", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject %u (entry: %u) reset", +#endif // (*itr)->GetGUIDLow(), (*itr)->GetEntry()); } } @@ -659,7 +697,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (IsUnit(*itr)) { (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_EMOTESTATE, e.action.emote.emote); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set emotestate to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set emotestate to %u", +#endif // (*itr)->GetGUIDLow(), e.action.emote.emote); } } @@ -729,7 +769,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", +#endif // me->GetGUIDLow(), e.action.autoAttack.attack); break; } @@ -747,7 +789,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } else CAST_AI(SmartAI, me->AI())->SetCombatMove(move); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u", +#endif // me->GetGUIDLow(), e.action.combatMove.move); break; } @@ -757,7 +801,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; SetPhase(e.action.setEventPhase.phase); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", +#endif // GetBaseObject()->GetGUIDLow(), e.action.setEventPhase.phase); break; } @@ -768,7 +814,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u IncPhase(e.action.incEventPhase.inc); DecPhase(e.action.incEventPhase.dec); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature %u inc event phase by %u, " +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature %u inc event phase by %u, " +#endif // "decrease by %u", GetBaseObject()->GetGUIDLow(), e.action.incEventPhase.inc, e.action.incEventPhase.dec); break; } @@ -801,7 +849,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL); sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); } - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); +#endif break; } case SMART_ACTION_COMBAT_STOP: @@ -827,7 +877,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) player->GroupEventHappens(e.action.quest.quest, GetBaseObject()); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player %u, group credit for quest %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player %u, group credit for quest %u", +#endif // (*itr)->GetGUIDLow(), e.action.quest.quest); } } @@ -859,7 +911,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u else (*itr)->ToUnit()->RemoveAllAuras(); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", +#endif // (*itr)->GetGUIDLow(), e.action.removeAura.spell); } @@ -884,7 +938,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { float angle = e.action.follow.angle > 6 ? (e.action.follow.angle * M_PI / 180.0f) : e.action.follow.angle; CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), float(int32(e.action.follow.dist))+0.1f, angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType, e.action.follow.aliveState); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u", +#endif // me->GetGUIDLow(), (*itr)->GetGUIDLow()); break; } @@ -921,7 +977,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u uint32 phase = temp[urand(0, count - 1)]; SetPhase(phase); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature %u sets event phase to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature %u sets event phase to %u", +#endif // GetBaseObject()->GetGUIDLow(), phase); break; } @@ -932,7 +990,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u uint32 phase = urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax); SetPhase(phase); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature %u sets event phase to %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature %u sets event phase to %u", +#endif // GetBaseObject()->GetGUIDLow(), phase); break; } @@ -941,7 +1001,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (trigger && IsPlayer(unit)) { unit->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, unit); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player %u, Killcredit: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player %u, Killcredit: %u", +#endif // unit->GetGUIDLow(), e.action.killedMonster.creature); } else if (e.target.type == SMART_TARGET_NONE || e.target.type == SMART_TARGET_SELF) // Loot recipient and his group members @@ -972,7 +1034,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u continue; player->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, player); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", +#endif // (*itr)->GetGUIDLow(), e.action.killedMonster.creature); } @@ -997,7 +1061,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u", +#endif // e.action.setInstanceData.field, e.action.setInstanceData.data); break; } @@ -1022,7 +1088,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD, +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD, +#endif // e.action.setInstanceData64.field, targets->front()->GetGUID()); delete targets; @@ -1046,7 +1114,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (me && !me->isDead()) { Unit::Kill(me, me); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature %u", me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature %u", me->GetGUIDLow()); +#endif } break; } @@ -1088,7 +1158,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (me) { me->SetSheath(SheathState(e.action.setSheath.sheath)); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature %u, State: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature %u, State: %u", +#endif // me->GetGUIDLow(), e.action.setSheath.sheath); } break; @@ -2233,7 +2305,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!GetBaseObject()) break; - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", +#endif // e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); ObjectList* targets = GetTargets(e, unit); @@ -3683,7 +3757,9 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui } case SMART_EVENT_GOSSIP_SELECT: { - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters +#endif if (e.event.gossip.sender != var0 || e.event.gossip.action != var1) return; ProcessAction(e, unit, var0, var1); @@ -4027,9 +4103,13 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn if (e.empty()) { //if (obj) - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); +#endif //if (at) - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); +#endif return; } for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i) @@ -4091,12 +4171,16 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) case TYPEID_UNIT: mScriptType = SMART_SCRIPT_TYPE_CREATURE; me = obj->ToCreature(); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); +#endif break; case TYPEID_GAMEOBJECT: mScriptType = SMART_SCRIPT_TYPE_GAMEOBJECT; go = obj->ToGameObject(); - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); +#endif break; default: sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!"); @@ -4106,7 +4190,9 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) { mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); +#endif } else { diff --git a/src/game/AI/SmartScripts/SmartScriptMgr.h b/src/game/AI/SmartScripts/SmartScriptMgr.h index b53f3851c..5a72e3666 100644 --- a/src/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/game/AI/SmartScripts/SmartScriptMgr.h @@ -1635,7 +1635,9 @@ class SmartAIMgr else { //if (entry > 0)//first search is for guid (negative), do not drop error if not found - ;//sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); +#endif return temp; } } diff --git a/src/game/Achievements/AchievementMgr.cpp b/src/game/Achievements/AchievementMgr.cpp index a5461a7ed..ef514d635 100644 --- a/src/game/Achievements/AchievementMgr.cpp +++ b/src/game/Achievements/AchievementMgr.cpp @@ -649,8 +649,8 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) return; - #ifdef TRINITY_DEBUG - ;//sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); + #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && TRINITY_DEBUG + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); #endif if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildId())) @@ -739,7 +739,9 @@ static const uint32 achievIdForDungeon[][4] = */ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/) { - ;//sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); +#endif // disable for gamemasters with GM-mode enabled if (m_player->IsGameMaster()) @@ -1973,7 +1975,9 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; - ;//sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); +#endif CriteriaProgress* progress = GetCriteriaProgress(entry); if (!progress) @@ -2118,7 +2122,9 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) { - ;//sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); +#endif // disable for gamemasters with GM-mode enabled if (m_player->IsGameMaster()) diff --git a/src/game/AuctionHouse/AuctionHouseMgr.cpp b/src/game/AuctionHouse/AuctionHouseMgr.cpp index 9d977d17c..379030dc5 100644 --- a/src/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouse/AuctionHouseMgr.cpp @@ -65,10 +65,18 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(((multiplier * MSV * count / 3) * timeHr * 3) * sWorld->getRate(RATE_AUCTION_DEPOSIT)); - ;//sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "MSV: %u", MSV); - ;//sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Items: %u", count); - ;//sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Multiplier: %f", multiplier); - ;//sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Deposit: %u", deposit); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "MSV: %u", MSV); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Items: %u", count); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Multiplier: %f", multiplier); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Deposit: %u", deposit); +#endif if (deposit < AH_MINIMUM_DEPOSIT) return AH_MINIMUM_DEPOSIT; diff --git a/src/game/Battlefield/Battlefield.cpp b/src/game/Battlefield/Battlefield.cpp index ff26c0783..9dfa45d03 100644 --- a/src/game/Battlefield/Battlefield.cpp +++ b/src/game/Battlefield/Battlefield.cpp @@ -899,7 +899,9 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) { ASSERT(capturePoint); - ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", capturePoint->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", capturePoint->GetEntry()); +#endif m_capturePoint = capturePoint->GetGUID(); diff --git a/src/game/Battlefield/BattlefieldMgr.cpp b/src/game/Battlefield/BattlefieldMgr.cpp index 9e9296756..537fda701 100644 --- a/src/game/Battlefield/BattlefieldMgr.cpp +++ b/src/game/Battlefield/BattlefieldMgr.cpp @@ -44,13 +44,17 @@ void BattlefieldMgr::InitBattlefield() // respawn, init variables if(!pBf->SetupBattlefield()) { - ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad init failed."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad init failed."); +#endif delete pBf; } else { m_BattlefieldSet.push_back(pBf); - ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad successfully initiated."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad successfully initiated."); +#endif } */ } @@ -69,7 +73,9 @@ void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid) return; itr->second->HandlePlayerEnterZone(player, zoneid); - ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#endif } void BattlefieldMgr::HandlePlayerLeaveZone(Player * player, uint32 zoneid) @@ -82,7 +88,9 @@ void BattlefieldMgr::HandlePlayerLeaveZone(Player * player, uint32 zoneid) if (!itr->second->HasPlayer(player)) return; itr->second->HandlePlayerLeaveZone(player, zoneid); - ;//sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#endif } Battlefield *BattlefieldMgr::GetBattlefieldToZoneId(uint32 zoneid) diff --git a/src/game/Battlegrounds/ArenaTeam.cpp b/src/game/Battlegrounds/ArenaTeam.cpp index c855f032b..6548c294b 100644 --- a/src/game/Battlegrounds/ArenaTeam.cpp +++ b/src/game/Battlegrounds/ArenaTeam.cpp @@ -256,7 +256,9 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result) if (Empty() || !captainPresentInTeam) { // Arena team is empty or captain is not in team, delete from db - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); +#endif return false; } @@ -389,7 +391,9 @@ void ArenaTeam::Roster(WorldSession* session) } session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); +#endif } void ArenaTeam::Query(WorldSession* session) @@ -404,7 +408,9 @@ void ArenaTeam::Query(WorldSession* session) data << uint32(BorderStyle); // border style data << uint32(BorderColor); // border color session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); +#endif } void ArenaTeam::SendStats(WorldSession* session) @@ -514,7 +520,9 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun BroadcastPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_EVENT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_EVENT"); +#endif } void ArenaTeam::MassInviteToEvent(WorldSession* session) diff --git a/src/game/Battlegrounds/Battleground.cpp b/src/game/Battlegrounds/Battleground.cpp index 87ebfe2a2..8f6483540 100644 --- a/src/game/Battlegrounds/Battleground.cpp +++ b/src/game/Battlegrounds/Battleground.cpp @@ -296,7 +296,9 @@ inline void Battleground::_CheckSafePositions(uint32 diff) GetTeamStartLoc(itr->second->GetBgTeamId(), x, y, z, o); if (pos.GetExactDistSq(x, y, z) > maxDist) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", player->GetName().c_str(), GetMapId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", player->GetName().c_str(), GetMapId()); +#endif itr->second->TeleportTo(GetMapId(), x, y, z, o); } } @@ -1236,7 +1238,9 @@ void Battleground::AddPlayer(Player* player) AddOrSetPlayerToCorrectBgGroup(player, teamId); // Log - ;//sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", player->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", player->GetName().c_str()); +#endif } // this method adds player to his team's bg group, or sets his correct group if player is already in bg group diff --git a/src/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/game/Battlegrounds/Zones/BattlegroundAV.cpp index deb4d4af8..e800b84ce 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -59,7 +59,9 @@ void BattlegroundAV::HandleKillPlayer(Player* player, Player* killer) void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry()); +#endif if (GetStatus() != STATUS_IN_PROGRESS) return; uint32 entry = unit->GetEntry(); @@ -140,7 +142,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) return;//maybe we should log this, cause this must be a cheater or a big bug TeamId teamId = player->GetTeamId(); //TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed", questid); +#endif switch (questid) { case AV_QUEST_A_SCRAPS1: @@ -150,7 +154,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][0]+=20; if (m_Team_QuestStatus[teamId][0] == 500 || m_Team_QuestStatus[teamId][0] == 1000 || m_Team_QuestStatus[teamId][0] == 1500) //25, 50, 75 turn ins { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..", questid); +#endif for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) if (m_Nodes[i].OwnerId == player->GetTeamId() && m_Nodes[i].State == POINT_CONTROLED) { @@ -165,21 +171,27 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][1]++; RewardReputationToTeam(teamId, 1, teamId); //if (m_Team_QuestStatus[team][1] == 30) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif break; case AV_QUEST_A_COMMANDER2: case AV_QUEST_H_COMMANDER2: m_Team_QuestStatus[teamId][2]++; RewardReputationToTeam(teamId, 1, teamId); //if (m_Team_QuestStatus[team][2] == 60) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif break; case AV_QUEST_A_COMMANDER3: case AV_QUEST_H_COMMANDER3: m_Team_QuestStatus[teamId][3]++; RewardReputationToTeam(teamId, 1, teamId); //if (m_Team_QuestStatus[team][3] == 120) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif break; case AV_QUEST_A_BOSS1: case AV_QUEST_H_BOSS1: @@ -188,16 +200,22 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) case AV_QUEST_H_BOSS2: m_Team_QuestStatus[teamId][4]++; //if (m_Team_QuestStatus[team][4] >= 200) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif break; case AV_QUEST_A_NEAR_MINE: case AV_QUEST_H_NEAR_MINE: m_Team_QuestStatus[teamId][5]++; if (m_Team_QuestStatus[teamId][5] == 28) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif //if (m_Team_QuestStatus[team][6] == 7) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); +#endif } break; case AV_QUEST_A_OTHER_MINE: @@ -205,9 +223,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][6]++; if (m_Team_QuestStatus[teamId][6] == 7) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif //if (m_Team_QuestStatus[team][5] == 20) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); +#endif } break; case AV_QUEST_A_RIDER_HIDE: @@ -215,9 +237,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][7]++; if (m_Team_QuestStatus[teamId][7] == 25) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif //if (m_Team_QuestStatus[team][8] == 25) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); +#endif } break; case AV_QUEST_A_RIDER_TAME: @@ -225,13 +251,19 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][8]++; if (m_Team_QuestStatus[teamId][8] == 25) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); +#endif //if (m_Team_QuestStatus[team][7] == 25) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); +#endif } break; default: - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all", questid); +#endif return; //was no interesting quest at all break; } @@ -414,7 +446,9 @@ void BattlegroundAV::StartingEventCloseDoors() void BattlegroundAV::StartingEventOpenDoors() { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff"); +#endif for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++) @@ -561,7 +595,9 @@ void BattlegroundAV::UpdatePlayerScore(Player* player, uint32 type, uint32 value void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) { uint32 object = GetObjectThroughNode(node); - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i", node, object); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i", node, object); +#endif //despawn banner SpawnBGObject(object, RESPAWN_ONE_DAY); @@ -634,7 +670,9 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial) if (!initial) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north, 1=south)", mine); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north, 1=south)", mine); +#endif if (mine == AV_SOUTH_MINE) for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++) if (BgCreatures[i]) @@ -645,7 +683,9 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial) } SendMineWorldStates(mine); - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north, 1=south)", mine); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north, 1=south)", mine); +#endif uint16 miner; //also neutral team exists.. after a big time, the neutral team tries to conquer the mine if (mine == AV_NORTH_MINE) @@ -667,7 +707,9 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial) else miner = AV_NPC_S_MINE_N_1; //vermin - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "spawning vermin"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "spawning vermin"); +#endif if (teamId == TEAM_ALLIANCE) cinfo = AV_NPC_S_MINE_A_3; else if (teamId == TEAM_HORDE) @@ -785,7 +827,9 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node) BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i", object); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i", object); +#endif if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER) return BG_AV_Nodes(object); if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT) @@ -807,7 +851,9 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node) { //this function is the counterpart to GetNodeThroughObject() - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i", node); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i", node); +#endif if (m_Nodes[node].OwnerId == TEAM_ALLIANCE) { if (m_Nodes[node].State == POINT_ASSAULTED) @@ -888,7 +934,9 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) EventPlayerAssaultsPoint(player, object); return; } - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node); +#endif if (m_Nodes[node].PrevOwnerId != teamId) { sLog->outError("BG_AV: player defends point which doesn't belong to his team %i", node); @@ -950,7 +998,9 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) BG_AV_Nodes node = GetNodeThroughObject(object); TeamId prevOwnerId = m_Nodes[node].OwnerId; TeamId teamId = player->GetTeamId(); - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i", object, node); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i", object, node); +#endif if (prevOwnerId == teamId || teamId == m_Nodes[node].TotalOwnerId) return; //surely a gm used this object @@ -1304,7 +1354,9 @@ bool BattlegroundAV::SetupBattleground() } uint16 i; - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Alterac Valley: entering state STATUS_WAIT_JOIN ..."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Alterac Valley: entering state STATUS_WAIT_JOIN ..."); +#endif // Initial Nodes for (i = 0; i < BG_AV_OBJECT_MAX; i++) SpawnBGObject(i, RESPAWN_ONE_DAY); @@ -1353,22 +1405,30 @@ bool BattlegroundAV::SetupBattleground() SpawnBGObject(BG_AV_OBJECT_STORMPIKE_BANNER, RESPAWN_IMMEDIATELY); //creatures - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes"); +#endif for (i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) { if (m_Nodes[i].OwnerId != TEAM_NEUTRAL) PopulateNode(BG_AV_Nodes(i)); } //all creatures which don't get despawned through the script are static - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures"); +#endif for (i = 0; i < AV_STATICCPLACE_MAX; i++) AddAVCreature(0, i + AV_CPLACE_MAX); //mainspiritguides: - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures"); +#endif AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], TEAM_ALLIANCE); AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], TEAM_HORDE); //spawn the marshals (those who get deleted, if a tower gets destroyed) - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures"); +#endif for (i = AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++) AddAVCreature(i, AV_CPLACE_A_MARSHAL_SOUTH + (i - AV_NPC_A_MARSHAL_SOUTH)); AddAVCreature(AV_NPC_HERALD, AV_CPLACE_HERALD); diff --git a/src/game/Calendar/CalendarMgr.cpp b/src/game/Calendar/CalendarMgr.cpp index 10295c156..fbfa67941 100644 --- a/src/game/Calendar/CalendarMgr.cpp +++ b/src/game/Calendar/CalendarMgr.cpp @@ -306,7 +306,9 @@ CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) const if ((*itr2)->GetInviteId() == inviteId) return *itr2; - ;//sLog->outDebug(LOG_FILTER_CALENDAR, "CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CALENDAR, "CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); +#endif return NULL; } diff --git a/src/game/Chat/Channels/Channel.cpp b/src/game/Chat/Channels/Channel.cpp index f7facedaf..93d20b194 100644 --- a/src/game/Chat/Channels/Channel.cpp +++ b/src/game/Chat/Channels/Channel.cpp @@ -96,7 +96,9 @@ void Channel::UpdateChannelInDB() const stmt->setUInt32(2, _channelDBId); CharacterDatabase.Execute(stmt); - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) updated in database", _name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) updated in database", _name.c_str()); +#endif } } @@ -682,7 +684,9 @@ void Channel::List(Player const* player) return; } - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "SMSG_CHANNEL_LIST %s Channel: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "SMSG_CHANNEL_LIST %s Channel: %s", +#endif // player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str()); WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+playersStore.size()*(8+1)); diff --git a/src/game/Chat/ChatLink.cpp b/src/game/Chat/ChatLink.cpp index 61e6e0e4d..f01ff341b 100644 --- a/src/game/Chat/ChatLink.cpp +++ b/src/game/Chat/ChatLink.cpp @@ -64,7 +64,9 @@ inline bool CheckDelimiter(std::istringstream& iss, char delimiter, const char* char c = iss.peek(); if (c != delimiter) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid %s link structure ('%c' expected, '%c' found)", iss.str().c_str(), context, delimiter, c); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid %s link structure ('%c' expected, '%c' found)", iss.str().c_str(), context, delimiter, c); +#endif return false; } iss.ignore(1); @@ -98,20 +100,26 @@ bool ItemChatLink::Initialize(std::istringstream& iss) uint32 itemEntry = 0; if (!ReadUInt32(iss, itemEntry)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading item entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading item entry", iss.str().c_str()); +#endif return false; } // Validate item _item = sObjectMgr->GetItemTemplate(itemEntry); if (!_item) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid itemEntry %u in |item command", iss.str().c_str(), itemEntry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid itemEntry %u in |item command", iss.str().c_str(), itemEntry); +#endif return false; } // Validate item's color if (_color != ItemQualityColors[_item->Quality]) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked item has color %u, but user claims %u", iss.str().c_str(), ItemQualityColors[_item->Quality], _color); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked item has color %u, but user claims %u", iss.str().c_str(), ItemQualityColors[_item->Quality], _color); +#endif return false; } // Number of various item properties after item entry @@ -125,7 +133,9 @@ bool ItemChatLink::Initialize(std::istringstream& iss) int32 id = 0; if (!ReadInt32(iss, id)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading item property (%u)", iss.str().c_str(), index); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading item property (%u)", iss.str().c_str(), index); +#endif return false; } if (id && (index == randomPropertyPosition)) @@ -136,7 +146,9 @@ bool ItemChatLink::Initialize(std::istringstream& iss) _property = sItemRandomPropertiesStore.LookupEntry(id); if (!_property) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid item property id %u in |item command", iss.str().c_str(), id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid item property id %u in |item command", iss.str().c_str(), id); +#endif return false; } } @@ -145,7 +157,9 @@ bool ItemChatLink::Initialize(std::istringstream& iss) _suffix = sItemRandomSuffixStore.LookupEntry(-id); if (!_suffix) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid item suffix id %u in |item command", iss.str().c_str(), -id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid item suffix id %u in |item command", iss.str().c_str(), -id); +#endif return false; } } @@ -188,7 +202,9 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) } } //if (!res) - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked item (id: %u) name wasn't found in any localization", context, _item->ItemId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked item (id: %u) name wasn't found in any localization", context, _item->ItemId); +#endif return res; } @@ -200,14 +216,18 @@ bool QuestChatLink::Initialize(std::istringstream& iss) uint32 questId = 0; if (!ReadUInt32(iss, questId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest entry", iss.str().c_str()); +#endif return false; } // Validate quest _quest = sObjectMgr->GetQuestTemplate(questId); if (!_quest) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): quest template %u not found", iss.str().c_str(), questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): quest template %u not found", iss.str().c_str(), questId); +#endif return false; } // Check delimiter @@ -216,13 +236,17 @@ bool QuestChatLink::Initialize(std::istringstream& iss) // Read quest level if (!ReadInt32(iss, _questLevel)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest level", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest level", iss.str().c_str()); +#endif return false; } // Validate quest level if (_questLevel >= STRONG_MAX_LEVEL) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): quest level %d is too big", iss.str().c_str(), _questLevel); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): quest level %d is too big", iss.str().c_str(), _questLevel); +#endif return false; } return true; @@ -235,7 +259,9 @@ bool QuestChatLink::ValidateName(char* buffer, const char* context) bool res = (_quest->GetTitle() == buffer); //if (!res) - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked quest (id: %u) title wasn't found in any localization", context, _quest->GetQuestId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked quest (id: %u) title wasn't found in any localization", context, _quest->GetQuestId()); +#endif return res; } @@ -249,14 +275,18 @@ bool SpellChatLink::Initialize(std::istringstream& iss) uint32 spellId = 0; if (!ReadUInt32(iss, spellId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading spell entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading spell entry", iss.str().c_str()); +#endif return false; } // Validate spell _spell = sSpellMgr->GetSpellInfo(spellId); if (!_spell) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |spell command", iss.str().c_str(), spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |spell command", iss.str().c_str(), spellId); +#endif return false; } return true; @@ -272,19 +302,25 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(_spell->Id); if (bounds.first == bounds.second) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for spell %u", context, _spell->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for spell %u", context, _spell->Id); +#endif return false; } SkillLineAbilityEntry const* skillInfo = bounds.first->second; if (!skillInfo) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id); +#endif return false; } SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId); if (!skillLine) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId); +#endif return false; } @@ -311,7 +347,9 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) } //if (!res) - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked spell (id: %u) name wasn't found in any localization", context, _spell->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked spell (id: %u) name wasn't found in any localization", context, _spell->Id); +#endif return res; } @@ -325,14 +363,18 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) uint32 achievementId = 0; if (!ReadUInt32(iss, achievementId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str()); +#endif return false; } // Validate achievement _achievement = sAchievementStore.LookupEntry(achievementId); if (!_achievement) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid achivement id %u in |achievement command", iss.str().c_str(), achievementId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid achivement id %u in |achievement command", iss.str().c_str(), achievementId); +#endif return false; } // Check delimiter @@ -341,7 +383,9 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) // Read HEX if (!ReadHex(iss, _guid, 0)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid hexadecimal number while reading char's guid", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid hexadecimal number while reading char's guid", iss.str().c_str()); +#endif return false; } // Skip progress @@ -353,7 +397,9 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) if (!ReadUInt32(iss, _data[index])) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement property (%u)", iss.str().c_str(), index); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement property (%u)", iss.str().c_str(), index); +#endif return false; } } @@ -373,7 +419,9 @@ bool AchievementChatLink::ValidateName(char* buffer, const char* context) } //if (!res) - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); +#endif return res; } @@ -387,14 +435,18 @@ bool TradeChatLink::Initialize(std::istringstream& iss) uint32 spellId = 0; if (!ReadUInt32(iss, spellId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str()); +#endif return false; } // Validate spell _spell = sSpellMgr->GetSpellInfo(spellId); if (!_spell) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), spellId); +#endif return false; } // Check delimiter @@ -403,7 +455,9 @@ bool TradeChatLink::Initialize(std::istringstream& iss) // Minimum talent level if (!ReadInt32(iss, _minSkillLevel)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading minimum talent level", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading minimum talent level", iss.str().c_str()); +#endif return false; } // Check delimiter @@ -412,7 +466,9 @@ bool TradeChatLink::Initialize(std::istringstream& iss) // Maximum talent level if (!ReadInt32(iss, _maxSkillLevel)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading maximum talent level", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading maximum talent level", iss.str().c_str()); +#endif return false; } // Check delimiter @@ -421,7 +477,9 @@ bool TradeChatLink::Initialize(std::istringstream& iss) // Something hexadecimal if (!ReadHex(iss, _guid, 0)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement's owner guid", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement's owner guid", iss.str().c_str()); +#endif return false; } // Skip base64 encoded stuff @@ -438,21 +496,27 @@ bool TalentChatLink::Initialize(std::istringstream& iss) // Read talent entry if (!ReadUInt32(iss, _talentId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent entry", iss.str().c_str()); +#endif return false; } // Validate talent TalentEntry const* talentInfo = sTalentStore.LookupEntry(_talentId); if (!talentInfo) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid talent id %u in |talent command", iss.str().c_str(), _talentId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid talent id %u in |talent command", iss.str().c_str(), _talentId); +#endif return false; } // Validate talent's spell _spell = sSpellMgr->GetSpellInfo(talentInfo->RankID[0]); if (!_spell) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), talentInfo->RankID[0]); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), talentInfo->RankID[0]); +#endif return false; } // Delimiter @@ -461,7 +525,9 @@ bool TalentChatLink::Initialize(std::istringstream& iss) // Rank if (!ReadInt32(iss, _rankId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent rank", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent rank", iss.str().c_str()); +#endif return false; } return true; @@ -477,14 +543,18 @@ bool EnchantmentChatLink::Initialize(std::istringstream& iss) uint32 spellId = 0; if (!ReadUInt32(iss, spellId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading enchantment spell entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading enchantment spell entry", iss.str().c_str()); +#endif return false; } // Validate spell _spell = sSpellMgr->GetSpellInfo(spellId); if (!_spell) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |enchant command", iss.str().c_str(), spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |enchant command", iss.str().c_str(), spellId); +#endif return false; } return true; @@ -499,7 +569,9 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) // Slot if (!ReadUInt32(iss, _slotId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading slot id", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading slot id", iss.str().c_str()); +#endif return false; } // Check delimiter @@ -509,21 +581,27 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) uint32 glyphId = 0; if (!ReadUInt32(iss, glyphId)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading glyph entry", iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading glyph entry", iss.str().c_str()); +#endif return false; } // Validate glyph _glyph = sGlyphPropertiesStore.LookupEntry(glyphId); if (!_glyph) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid glyph id %u in |glyph command", iss.str().c_str(), glyphId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid glyph id %u in |glyph command", iss.str().c_str(), glyphId); +#endif return false; } // Validate glyph's spell _spell = sSpellMgr->GetSpellInfo(_glyph->SpellId); if (!_spell) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellId); +#endif return false; } return true; @@ -561,14 +639,18 @@ bool LinkExtractor::IsValidMessage() } else if (_iss.get() != PIPE_CHAR) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence aborted unexpectedly", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence aborted unexpectedly", _iss.str().c_str()); +#endif return false; } // pipe has always to be followed by at least one char if (_iss.peek() == '\0') { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): pipe followed by '\\0'", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): pipe followed by '\\0'", _iss.str().c_str()); +#endif return false; } @@ -591,14 +673,18 @@ bool LinkExtractor::IsValidMessage() } else { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid sequence, expected '%c' but got '%c'", _iss.str().c_str(), *validSequenceIterator, commandChar); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid sequence, expected '%c' but got '%c'", _iss.str().c_str(), *validSequenceIterator, commandChar); +#endif return false; } } else if (validSequence != validSequenceIterator) { // no escaped pipes in sequences - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got escaped pipe in sequence", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got escaped pipe in sequence", _iss.str().c_str()); +#endif return false; } @@ -607,7 +693,9 @@ bool LinkExtractor::IsValidMessage() case 'c': if (!ReadHex(_iss, color, 8)) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid hexadecimal number while reading color", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid hexadecimal number while reading color", _iss.str().c_str()); +#endif return false; } break; @@ -616,7 +704,9 @@ bool LinkExtractor::IsValidMessage() _iss.getline(buffer, 256, DELIMITER); if (_iss.eof()) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly", _iss.str().c_str()); +#endif return false; } @@ -638,7 +728,9 @@ bool LinkExtractor::IsValidMessage() link = new GlyphChatLink(); else { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): user sent unsupported link type '%s'", _iss.str().c_str(), buffer); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): user sent unsupported link type '%s'", _iss.str().c_str(), buffer); +#endif return false; } _links.push_back(link); @@ -653,13 +745,17 @@ bool LinkExtractor::IsValidMessage() // links start with '[' if (_iss.get() != '[') { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): link caption doesn't start with '['", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): link caption doesn't start with '['", _iss.str().c_str()); +#endif return false; } _iss.getline(buffer, 256, ']'); if (_iss.eof()) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly", _iss.str().c_str()); +#endif return false; } @@ -677,7 +773,9 @@ bool LinkExtractor::IsValidMessage() // no further payload break; default: - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid command |%c", _iss.str().c_str(), commandChar); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid command |%c", _iss.str().c_str(), commandChar); +#endif return false; } } @@ -685,7 +783,9 @@ bool LinkExtractor::IsValidMessage() // check if every opened sequence was also closed properly if (validSequence != validSequenceIterator) { - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): EOF in active sequence", _iss.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): EOF in active sequence", _iss.str().c_str()); +#endif return false; } diff --git a/src/game/Conditions/ConditionMgr.cpp b/src/game/Conditions/ConditionMgr.cpp index 038c8bef9..6857fcb9c 100644 --- a/src/game/Conditions/ConditionMgr.cpp +++ b/src/game/Conditions/ConditionMgr.cpp @@ -26,7 +26,9 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) // object not present, return false if (!object) { - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Condition object not found for condition (Entry: %u Type: %u Group: %u)", SourceEntry, SourceType, SourceGroup); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Condition object not found for condition (Entry: %u Type: %u Group: %u)", SourceEntry, SourceType, SourceGroup); +#endif return false; } bool condMeets = false; @@ -632,7 +634,9 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, std::map ElseGroupStore; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1); +#endif if ((*i)->isLoaded()) { //! Find ElseGroup in ElseGroupStore @@ -653,7 +657,9 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, } else { - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "IsPlayerMeetToConditionList: Reference template -%u not found", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "IsPlayerMeetToConditionList: Reference template -%u not found", +#endif // (*i)->ReferenceId);//checked at loading, should never happen } @@ -689,7 +695,9 @@ bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, Con if (conditions.empty()) return true; - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsObjectMeetToConditions"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsObjectMeetToConditions"); +#endif return IsObjectMeetToConditionList(sourceInfo, conditions); } @@ -733,7 +741,9 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType if (i != (*itr).second.end()) { spellCond = (*i).second; - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sourceType), entry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sourceType), entry); +#endif } } } @@ -750,7 +760,9 @@ ConditionList ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, u if (i != (*itr).second.end()) { cond = (*i).second; - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSpellClickEvent: found conditions for Vehicle entry %u spell %u", creatureId, spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSpellClickEvent: found conditions for Vehicle entry %u spell %u", creatureId, spellId); +#endif } } return cond; @@ -766,7 +778,9 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint if (i != (*itr).second.end()) { cond = (*i).second; - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureId, spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureId, spellId); +#endif } } return cond; @@ -782,7 +796,9 @@ ConditionList ConditionMgr::GetConditionsForSmartEvent(int32 entryOrGuid, uint32 if (i != (*itr).second.end()) { cond = (*i).second; - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSmartEvent: found conditions for Smart Event entry or guid %d event_id %u", entryOrGuid, eventId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSmartEvent: found conditions for Smart Event entry or guid %d event_id %u", entryOrGuid, eventId); +#endif } } return cond; diff --git a/src/game/DungeonFinding/LFGMgr.cpp b/src/game/DungeonFinding/LFGMgr.cpp index 14b7f1e29..c427de3bf 100644 --- a/src/game/DungeonFinding/LFGMgr.cpp +++ b/src/game/DungeonFinding/LFGMgr.cpp @@ -616,7 +616,9 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const // Can't join. Send result if (joinData.result != LFG_JOIN_OK) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); +#endif if (!dungeons.empty()) // Only should show lockmap when have no dungeons available joinData.lockmap.clear(); player->GetSession()->SendLfgJoinResult(joinData); @@ -707,7 +709,9 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const std::ostringstream o; o << "LFGMgr::Join: [" << guid << "] joined (" << (grp ? "group" : "player") << ") Members: " << debugNames.c_str() << ". Dungeons (" << uint32(dungeons.size()) << "): " << ConcatenateDungeons(dungeons); - ;//sLog->outDebug((LOG_FILTER_LFG, "%s", o.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "%s", o.str().c_str()); +#endif }*/ } @@ -1601,7 +1605,9 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) LfgProposalPlayer& player = itProposalPlayer->second; player.accept = LfgAnswer(accept); - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); +#endif if (!accept) { RemoveProposal(itProposal, LFG_UPDATETYPE_PROPOSAL_DECLINED); @@ -1692,7 +1698,9 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate LfgProposal& proposal = itProposal->second; proposal.state = LFG_PROPOSAL_FAILED; - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); +#endif // Mark all people that didn't answered as no accept if (type == LFG_UPDATETYPE_PROPOSAL_FAILED) for (LfgProposalPlayerContainer::iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) @@ -1736,12 +1744,16 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate if (it->second.accept == LFG_ANSWER_DENY) { updateData.updateType = type; - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); +#endif } else { updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE; - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); +#endif } RestoreState(guid, "Proposal Fail (didn't accepted or in group with someone that didn't accept"); @@ -1755,7 +1767,9 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate } else { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); +#endif SetState(guid, LFG_STATE_QUEUED); if (gguid != guid) { @@ -2131,7 +2145,9 @@ LfgState LFGMgr::GetState(uint64 guid) else state = PlayersStore[guid].GetState(); - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state); +#endif return state; } @@ -2143,14 +2159,18 @@ LfgState LFGMgr::GetOldState(uint64 guid) else state = PlayersStore[guid].GetOldState(); - ;//sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state); +#endif return state; } uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */) { uint32 dungeon = GroupsStore[guid].GetDungeon(asId); - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon); +#endif return dungeon; } @@ -2162,39 +2182,51 @@ uint32 LFGMgr::GetDungeonMapId(uint64 guid) if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId)) mapId = dungeon->map; - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetDungeonMapId: [" UI64FMTD "] = %u (DungeonId = %u)", guid, mapId, dungeonId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetDungeonMapId: [" UI64FMTD "] = %u (DungeonId = %u)", guid, mapId, dungeonId); +#endif return mapId; } uint8 LFGMgr::GetRoles(uint64 guid) { uint8 roles = PlayersStore[guid].GetRoles(); - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles); +#endif return roles; } const std::string& LFGMgr::GetComment(uint64 guid) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, PlayersStore[guid].GetComment().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, PlayersStore[guid].GetComment().c_str()); +#endif return PlayersStore[guid].GetComment(); } LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) { - ;//sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); +#endif return PlayersStore[guid].GetSelectedDungeons(); } LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); +#endif return PlayersStore[guid].GetLockedDungeons(); } uint8 LFGMgr::GetKicksLeft(uint64 guid) { uint8 kicks = GroupsStore[guid].GetKicksLeft(); - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "] = %u", guid, kicks); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "] = %u", guid, kicks); +#endif return kicks; } @@ -2256,19 +2288,25 @@ void LFGMgr::SetCanOverrideRBState(uint64 guid, bool val) void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); +#endif GroupsStore[guid].SetDungeon(dungeon); } void LFGMgr::SetRoles(uint64 guid, uint8 roles) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); +#endif PlayersStore[guid].SetRoles(roles); } void LFGMgr::SetComment(uint64 guid, std::string const& comment) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); +#endif PlayersStore[guid].SetComment(comment); } @@ -2287,25 +2325,33 @@ void LFGMgr::LfrSetComment(Player* p, std::string comment) void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); +#endif PlayersStore[guid].SetSelectedDungeons(dungeons); } void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); +#endif PlayersStore[guid].SetLockedDungeons(lock); } void LFGMgr::DecreaseKicksLeft(uint64 guid) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); +#endif GroupsStore[guid].DecreaseKicksLeft(); } void LFGMgr::RemoveGroupData(uint64 guid) { - ;//sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); +#endif LfgGroupDataContainer::iterator it = GroupsStore.find(guid); if (it == GroupsStore.end()) return; diff --git a/src/game/DungeonFinding/LFGScripts.cpp b/src/game/DungeonFinding/LFGScripts.cpp index c14f76a22..37424a65c 100644 --- a/src/game/DungeonFinding/LFGScripts.cpp +++ b/src/game/DungeonFinding/LFGScripts.cpp @@ -102,7 +102,9 @@ void LFGPlayerScript::OnMapChanged(Player* player) sLFGMgr->LeaveAllLfgQueues(player->GetGUID(), true); player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, 0.0f); - ;//sLog->outError(LOG_FILTER_LFG, "LFGPlayerScript::OnMapChanged, Player %s (%u) is in LFG dungeon map but does not have a valid group! " +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outError(LOG_FILTER_LFG, "LFGPlayerScript::OnMapChanged, Player %s (%u) is in LFG dungeon map but does not have a valid group! " +#endif // "Teleporting to homebind.", player->GetName().c_str(), player->GetGUIDLow()); return; } @@ -139,14 +141,18 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid) if (leader == guid) { - ;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "]", gguid, guid, leader); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "]", gguid, guid, leader); +#endif sLFGMgr->SetLeader(gguid, guid); } else { LfgState gstate = sLFGMgr->GetState(gguid); LfgState state = sLFGMgr->GetState(guid); - ;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state); +#endif if (state == LFG_STATE_QUEUED) sLFGMgr->LeaveLfg(guid); @@ -175,7 +181,9 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth return; uint64 gguid = group->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); +#endif bool isLFG = group->isLFGGroup(); LfgState state = sLFGMgr->GetState(gguid); @@ -234,7 +242,9 @@ void LFGGroupScript::OnDisband(Group* group) return; uint64 gguid = group->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid); +#endif // pussywizard: after all necessary actions handle raid browser if (sLFGMgr->GetState(group->GetLeaderGUID()) == LFG_STATE_RAIDBROWSER) @@ -250,7 +260,9 @@ void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 o uint64 gguid = group->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); +#endif sLFGMgr->SetLeader(gguid, newLeaderGuid); // pussywizard: after all necessary actions handle raid browser @@ -265,7 +277,9 @@ void LFGGroupScript::OnInviteMember(Group* group, uint64 guid) uint64 gguid = group->GetGUID(); uint64 leader = group->GetLeaderGUID(); - ;//sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, leader); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, leader); +#endif // No gguid == new group being formed // No leader == after group creation first invite is new leader // leader and no gguid == first invite after leader is added to new group (this is the real invite) diff --git a/src/game/Entities/Creature/Creature.cpp b/src/game/Entities/Creature/Creature.cpp index 4949c78ce..d8451bb9e 100644 --- a/src/game/Entities/Creature/Creature.cpp +++ b/src/game/Entities/Creature/Creature.cpp @@ -542,7 +542,9 @@ void Creature::Update(uint32 diff) else if (m_corpseRemoveTime <= time(NULL)) { RemoveCorpse(false); - ;//sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); +#endif } break; } @@ -768,7 +770,9 @@ bool Creature::AIM_Initialize(CreatureAI* ai) // make sure nothing can change the AI during AI update if (m_AI_locked) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "AIM_Initialize: failed to init, locked."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "AIM_Initialize: failed to init, locked."); +#endif return false; } @@ -1604,7 +1608,9 @@ void Creature::Respawn(bool force) if (m_DBTableGuid) GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid); - ;//sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName().c_str(), GetGUIDLow(), GetGUID(), GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName().c_str(), GetGUIDLow(), GetGUID(), GetEntry()); +#endif m_respawnTime = 0; ResetPickPocketLootTime(); @@ -1882,7 +1888,9 @@ void Creature::SendAIReaction(AiReaction reactionType) ((WorldObject*)this)->SendMessageToSet(&data, true); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); +#endif } void Creature::CallAssistance() @@ -2210,7 +2218,9 @@ bool Creature::LoadCreaturesAddon(bool reload) } AddAura(*itr, this); - ;//sLog->outDebug(LOG_FILTER_UNITS, "Spell: %u added to creature (GUID: %u Entry: %u)", *itr, GetGUIDLow(), GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Spell: %u added to creature (GUID: %u Entry: %u)", *itr, GetGUIDLow(), GetEntry()); +#endif } } diff --git a/src/game/Entities/Creature/CreatureGroups.cpp b/src/game/Entities/Creature/CreatureGroups.cpp index e808e1228..7bd69d66e 100644 --- a/src/game/Entities/Creature/CreatureGroups.cpp +++ b/src/game/Entities/Creature/CreatureGroups.cpp @@ -28,13 +28,17 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) //Add member to an existing group if (itr != map->CreatureGroupHolder.end()) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); +#endif itr->second->AddMember(member); } //Create new group else { - ;//sLog->outDebug(LOG_FILTER_UNITS, "Group not found: %u. Creating new group.", groupId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Group not found: %u. Creating new group.", groupId); +#endif CreatureGroup* group = new CreatureGroup(groupId); map->CreatureGroupHolder[groupId] = group; group->AddMember(member); @@ -43,7 +47,9 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); +#endif group->RemoveMember(member); if (group->isEmpty()) @@ -52,7 +58,9 @@ void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* membe if (!map) return; - ;//sLog->outDebug(LOG_FILTER_UNITS, "Deleting group with InstanceID %u", member->GetInstanceId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Deleting group with InstanceID %u", member->GetInstanceId()); +#endif map->CreatureGroupHolder.erase(group->GetId()); delete group; } @@ -131,12 +139,16 @@ void FormationMgr::LoadCreatureFormations() void CreatureGroup::AddMember(Creature* member) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); +#endif //Check if it is a leader if (member->GetDBTableGUIDLow() == m_groupID) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); +#endif m_leader = member; } @@ -165,7 +177,9 @@ void CreatureGroup::MemberAttackStart(Creature* member, Unit* target) for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { //if (m_leader) // avoid crash if leader was killed and reset. - ;//sLog->outDebug(LOG_FILTER_UNITS, "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); +#endif //Skip one check if (itr->first == member) @@ -195,7 +209,9 @@ void CreatureGroup::FormationReset(bool dismiss) itr->first->GetMotionMaster()->Initialize(); else itr->first->GetMotionMaster()->MoveIdle(); - ;//sLog->outDebug(LOG_FILTER_UNITS, "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); +#endif } } m_Formed = !dismiss; diff --git a/src/game/Entities/Creature/GossipDef.cpp b/src/game/Entities/Creature/GossipDef.cpp index 93d295c21..d944ddaf5 100644 --- a/src/game/Entities/Creature/GossipDef.cpp +++ b/src/game/Entities/Creature/GossipDef.cpp @@ -326,7 +326,9 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string data.put(count_pos, count); _session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); +#endif } void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const @@ -336,7 +338,9 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const data << uint8(questStatus); _session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); +#endif } void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const @@ -441,7 +445,9 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, } _session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); +#endif } void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const @@ -575,7 +581,9 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << questObjectiveText[i]; _session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId()); +#endif } void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const @@ -666,7 +674,9 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(quest->RewardFactionValueIdOverride[i]); _session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); +#endif } void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const @@ -760,5 +770,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << uint32(0x10); _session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); +#endif } diff --git a/src/game/Entities/GameObject/GameObject.cpp b/src/game/Entities/GameObject/GameObject.cpp index 58a476e5f..8f40adfe2 100644 --- a/src/game/Entities/GameObject/GameObject.cpp +++ b/src/game/Entities/GameObject/GameObject.cpp @@ -1389,7 +1389,9 @@ void GameObject::Use(Unit* user) if (info->goober.eventId) { - ;//sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); +#endif GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this); EventInform(info->goober.eventId); } @@ -1489,7 +1491,9 @@ void GameObject::Use(Unit* user) int32 roll = irand(1, 100); - ;//sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll); +#endif // but you will likely cause junk in areas that require a high fishing skill (not yet implemented) if (chance >= roll) @@ -1771,7 +1775,9 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this)) sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType()); else - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); +#endif return; } diff --git a/src/game/Entities/Item/Item.cpp b/src/game/Entities/Item/Item.cpp index e4148240e..d5ab1310e 100644 --- a/src/game/Entities/Item/Item.cpp +++ b/src/game/Entities/Item/Item.cpp @@ -283,7 +283,9 @@ void Item::UpdateDuration(Player* owner, uint32 diff) if (!GetUInt32Value(ITEM_FIELD_DURATION)) return; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); +#endif if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) { @@ -676,7 +678,9 @@ void Item::AddToUpdateQueueOf(Player* player) if (player->GetGUID() != GetOwnerGUID()) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); +#endif return; } @@ -696,7 +700,9 @@ void Item::RemoveFromUpdateQueueOf(Player* player) if (player->GetGUID() != GetOwnerGUID()) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); +#endif return; } diff --git a/src/game/Entities/Pet/Pet.cpp b/src/game/Entities/Pet/Pet.cpp index d405b118f..60f4aa324 100644 --- a/src/game/Entities/Pet/Pet.cpp +++ b/src/game/Entities/Pet/Pet.cpp @@ -625,7 +625,9 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner) bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask) { - ;//sLog->outDebug(LOG_FILTER_PETS, "Pet::CreateBaseForTamed"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PETS, "Pet::CreateBaseForTamed"); +#endif uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET); uint32 pet_number = sObjectMgr->GeneratePetNumber(); if (!Create(guid, map, phaseMask, cinfo->Entry, pet_number)) @@ -1080,7 +1082,9 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result) cooldowns[spell_id] = cooldown; _AddCreatureSpellCooldown(spell_id, cooldown); - ;//sLog->outDebug(LOG_FILTER_PETS, "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PETS, "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); +#endif } while (result->NextRow()); @@ -1187,7 +1191,9 @@ void Pet::_SaveSpells(SQLTransaction& trans) void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff) { - ;//sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow()); +#endif if (result) { @@ -1257,7 +1263,9 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff) } aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]); aura->ApplyForTargets(); - ;//sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask); +#endif } } while (result->NextRow()); diff --git a/src/game/Entities/Player/Player.cpp b/src/game/Entities/Player/Player.cpp index f08cb57b7..462eef692 100644 --- a/src/game/Entities/Player/Player.cpp +++ b/src/game/Entities/Player/Player.cpp @@ -1251,7 +1251,9 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Creating initial item, itemId = %u, count = %u", titem_id, titem_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Creating initial item, itemId = %u, count = %u", titem_id, titem_amount); +#endif // attempt equip by one while (titem_amount > 0) @@ -1347,7 +1349,9 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) { if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage { - ;//sLog->outStaticDebug("We are fall to death, loosing 10 percents durability"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("We are fall to death, loosing 10 percents durability"); +#endif DurabilityLossAll(0.10f, false); // durability lost message WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); @@ -2217,7 +2221,9 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // client without expansion support if (GetSession()->Expansion() < mEntry->Expansion()) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "Player %s using client without required expansion tried teleport to non accessible map %u", GetName().c_str(), mapid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "Player %s using client without required expansion tried teleport to non accessible map %u", GetName().c_str(), mapid); +#endif if (GetTransport()) { @@ -2233,7 +2239,9 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati return false; // normal client can't teleport to this map... } else - ;//sLog->outDebug(LOG_FILTER_MAPS, "Player %s is being teleported to map %u", GetName().c_str(), mapid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "Player %s is being teleported to map %u", GetName().c_str(), mapid); +#endif // xinef: do this here in case teleport failed in above checks if (!(options & TELE_TO_NOT_LEAVE_TAXI) && IsInFlight()) @@ -2908,7 +2916,9 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes if (go->IsWithinDistInMap(this, go->GetInteractionDistance())) return go; - ;//sLog->outDebug(LOG_FILTER_MAPS, "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), +#endif // go->GetGUIDLow(), GetName().c_str(), GetGUIDLow(), go->GetDistance(this)); } } @@ -4341,7 +4351,9 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) AddSpellCooldown(spell_id, item_id, (db_time-curTime)*IN_MILLISECONDS, needSend); - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); +#endif } while (result->NextRow()); } @@ -5523,7 +5535,9 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g { if (GetGuildId() == 0) { - ;//sLog->outStaticDebug("You are not member of a guild"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("You are not member of a guild"); +#endif return TotalCost; } @@ -5538,7 +5552,9 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g } else if (!HasEnoughMoney(costs)) { - ;//sLog->outStaticDebug("You do not have enough money"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("You do not have enough money"); +#endif return TotalCost; } else @@ -6160,7 +6176,9 @@ inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLeve bool Player::UpdateCraftSkill(uint32 spellid) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateCraftSkill spellid %d", spellid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateCraftSkill spellid %d", spellid); +#endif SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(spellid); @@ -6192,7 +6210,9 @@ bool Player::UpdateCraftSkill(uint32 spellid) bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); +#endif uint32 gathering_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING); @@ -6220,7 +6240,9 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve bool Player::UpdateFishingSkill() { - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateFishingSkill"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateFishingSkill"); +#endif uint32 SkillValue = GetPureSkillValue(SKILL_FISHING); @@ -6239,13 +6261,17 @@ static const size_t bonusSkillLevelsSize = sizeof(bonusSkillLevels) / sizeof(uin bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance / 10.0f); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance / 10.0f); +#endif if (!SkillId) return false; if (Chance <= 0) // speedup in 0 chance case { - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); +#endif return false; } @@ -6285,11 +6311,15 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) } UpdateSkillEnchantments(SkillId, SkillValue, new_value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f); +#endif return true; } - ;//sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); +#endif return false; } @@ -6668,7 +6698,9 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const void Player::SendActionButtons(uint32 state) const { - ;//sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); +#endif WorldPacket data(SMSG_ACTION_BUTTONS, 1+(MAX_ACTION_BUTTONS*4)); data << uint8(state); @@ -6691,7 +6723,9 @@ void Player::SendActionButtons(uint32 state) const } GetSession()->SendPacket(&data); - ;//sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec); +#endif } bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) @@ -6719,7 +6753,9 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) if (!HasSpell(action)) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::IsActionButtonDataValid Spell action %u not added into button %u for player %s: player don't known this spell", action, button, GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::IsActionButtonDataValid Spell action %u not added into button %u for player %s: player don't known this spell", action, button, GetName().c_str()); +#endif return false; } break; @@ -6748,7 +6784,9 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type) // set data and update to CHANGED if not NEW ab.SetActionAndType(action, ActionButtonType(type)); - ;//sLog->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button); +#endif return &ab; } @@ -6763,7 +6801,9 @@ void Player::removeActionButton(uint8 button) else buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save - ;//sLog->outDetail("Action Button '%u' Removed from Player '%u'", button, GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Action Button '%u' Removed from Player '%u'", button, GetGUIDLow()); +#endif } ActionButton const* Player::GetActionButton(uint8 button) @@ -6862,7 +6902,9 @@ void Player::CheckAreaExploreAndOutdoor() if (offset >= PLAYER_EXPLORED_ZONES_SIZE) { - ;//sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE); +#endif return; } @@ -6915,7 +6957,9 @@ void Player::CheckAreaExploreAndOutdoor() GiveXP(XP, NULL); SendExplorationExperience(area, XP); } - ;//sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area); +#endif } } } @@ -7716,7 +7760,9 @@ void Player::DuelComplete(DuelCompleteType type) if (!duel) return; - ;//sLog->outDebug(LOG_FILTER_UNITS, "Duel Complete %s %s", GetName().c_str(), duel->opponent->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Duel Complete %s %s", GetName().c_str(), duel->opponent->GetName().c_str()); +#endif WorldPacket data(SMSG_DUEL_COMPLETE, (1)); data << (uint8)((type != DUEL_INTERRUPTED) ? 1 : 0); @@ -7839,7 +7885,9 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) if (item->IsBroken()) return; - ;//sLog->outDetail("applying mods for item %u ", item->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("applying mods for item %u ", item->GetGUIDLow()); +#endif uint8 attacktype = Player::GetAttackBySlot(slot); @@ -7857,7 +7905,9 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) ApplyItemEquipSpell(item, apply); ApplyEnchantment(item, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyItemMods complete."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyItemMods complete."); +#endif } void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply, bool only_level_scale /*= false*/) @@ -8336,7 +8386,9 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, return; } - ;//sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); +#endif CastSpell(this, spellInfo, true, item); } @@ -8687,7 +8739,9 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 void Player::_RemoveAllItemMods() { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods start."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods start."); +#endif for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -8730,12 +8784,16 @@ void Player::_RemoveAllItemMods() } } - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods complete."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods complete."); +#endif } void Player::_ApplyAllItemMods() { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods start."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods start."); +#endif for (uint8 i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -8779,7 +8837,9 @@ void Player::_ApplyAllItemMods() } } - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods complete."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods complete."); +#endif } void Player::_ApplyAllLevelScaleItemMods(bool apply) @@ -8904,10 +8964,14 @@ void Player::SendLoot(uint64 guid, LootType loot_type) Loot* loot = 0; PermissionTypes permission = ALL_PERMISSION; - ;//sLog->outDebug(LOG_FILTER_LOOT, "Player::SendLoot"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LOOT, "Player::SendLoot"); +#endif if (IS_GAMEOBJECT_GUID(guid)) { - ;//sLog->outDebug(LOG_FILTER_LOOT, "IS_GAMEOBJECT_GUID(guid)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LOOT, "IS_GAMEOBJECT_GUID(guid)"); +#endif GameObject* go = GetMap()->GetGameObject(guid); // not check distance for GO in case owned GO (fishing bobber case, for example) @@ -9300,7 +9364,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) InstanceScript* instance = GetInstanceScript(); Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneid); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); +#endif WorldPacket data(SMSG_INIT_WORLD_STATES, (4+4+4+2+(12*8))); data << uint32(mapid); // mapid @@ -9965,7 +10031,9 @@ uint32 Player::GetXPRestBonus(uint32 xp) SetRestBonus(GetRestBonus() - rested_bonus); - ;//sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus()); +#endif return rested_bonus; } @@ -11036,7 +11104,9 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); +#endif ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) @@ -11526,7 +11596,9 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const if (!pItem) continue; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); +#endif ItemTemplate const* pProto = pItem->GetTemplate(); // strange item @@ -11743,7 +11815,9 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool dest = 0; if (pItem) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); +#endif ItemTemplate const* pProto = pItem->GetTemplate(); if (pProto) { @@ -11918,7 +11992,9 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const if (!pItem) return EQUIP_ERR_OK; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); +#endif ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) @@ -11958,7 +12034,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest uint32 count = pItem->GetCount(); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); +#endif ItemTemplate const* pProto = pItem->GetTemplate(); if (!pProto) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_ITEM_NOT_FOUND; @@ -12142,7 +12220,9 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { if (pItem) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); +#endif if (!IsAlive() && not_loading) return EQUIP_ERR_YOU_ARE_DEAD; @@ -12315,7 +12395,9 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje InventoryResult Player::CanUseAmmo(uint32 item) const { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); +#endif if (!IsAlive()) return EQUIP_ERR_YOU_ARE_DEAD; //if (isStunned()) @@ -12472,7 +12554,9 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool uint8 bag = pos >> 8; uint8 slot = pos & 255; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); +#endif Item* pItem2 = GetItemByPos(bag, slot); @@ -12733,7 +12817,9 @@ void Player::VisualizeItem(uint8 slot, Item* pItem) if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) pItem->SetBinding(true); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); +#endif m_items[slot] = pItem; SetUInt64Value(PLAYER_FIELD_INV_SLOT_HEAD + (slot * 2), pItem->GetGUID()); @@ -12758,7 +12844,9 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update, bool swap) Item* pItem = GetItemByPos(bag, slot); if (pItem) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); +#endif RemoveEnchantmentDurations(pItem); RemoveItemDurations(pItem); @@ -12882,7 +12970,9 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) Item* pItem = GetItemByPos(bag, slot); if (pItem) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); +#endif // Also remove all contained items if the item is a bag. // This if () prevents item saving crashes if the condition for a bag to be empty before being destroyed was bypassed somehow. if (pItem->IsNotEmptyBag()) @@ -12977,7 +13067,9 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool unequip_check) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", itemEntry, count); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", itemEntry, count); +#endif uint32 remcount = 0; // in inventory @@ -13168,7 +13260,9 @@ void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); +#endif // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -13200,7 +13294,9 @@ void Player::DestroyConjuredItems(bool update) { // used when entering arena // destroys all conjured items - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); +#endif // in inventory for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) @@ -13256,7 +13352,9 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); +#endif if (pItem->GetCount() <= count) { @@ -13319,7 +13417,9 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); +#endif Item* pNewItem = pSrcItem->CloneItem(count, this); if (!pNewItem) { @@ -13404,7 +13504,9 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!pSrcItem) return; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); +#endif if (!IsAlive()) { @@ -13795,7 +13897,9 @@ void Player::AddItemToBuyBackSlot(Item* pItem) } RemoveItemFromBuyBackSlot(slot, true); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); +#endif m_items[slot] = pItem; time_t base = time(NULL); @@ -13817,7 +13921,9 @@ void Player::AddItemToBuyBackSlot(Item* pItem) Item* Player::GetItemFromBuyBackSlot(uint32 slot) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); +#endif if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) return m_items[slot]; return NULL; @@ -13825,7 +13931,9 @@ Item* Player::GetItemFromBuyBackSlot(uint32 slot) void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); +#endif if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) { Item* pItem = m_items[slot]; @@ -13851,7 +13959,9 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); +#endif WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); data << uint8(msg); @@ -13894,7 +14004,9 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED"); +#endif WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1)); data << uint64(creature ? creature->GetGUID() : 0); data << uint32(item); @@ -13906,7 +14018,9 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); +#endif WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10 data << uint64(creature ? creature->GetGUID() : 0); data << uint64(guid); @@ -13978,7 +14092,9 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) if (m_itemDuration.empty()) return; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Player::UpdateItemDuration(%u, %u)", time, realtimeonly); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Player::UpdateItemDuration(%u, %u)", time, realtimeonly); +#endif for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end();) { @@ -14261,81 +14377,117 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool } } - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Adding %u to stat nb %u", enchant_amount, enchant_spell_id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Adding %u to stat nb %u", enchant_amount, enchant_spell_id); +#endif switch (enchant_spell_id) { case ITEM_MOD_MANA: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_HEALTH: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_AGILITY: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u AGILITY", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u AGILITY", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_AGILITY, (float)enchant_amount, apply); break; case ITEM_MOD_STRENGTH: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STRENGTH", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STRENGTH", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STRENGTH, (float)enchant_amount, apply); break; case ITEM_MOD_INTELLECT: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u INTELLECT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u INTELLECT", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_INTELLECT, (float)enchant_amount, apply); break; case ITEM_MOD_SPIRIT: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPIRIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPIRIT", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_SPIRIT, (float)enchant_amount, apply); break; case ITEM_MOD_STAMINA: - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STAMINA", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STAMINA", enchant_amount); +#endif HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STAMINA, (float)enchant_amount, apply); break; case ITEM_MOD_DEFENSE_SKILL_RATING: ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DEFENCE", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DEFENCE", enchant_amount); +#endif break; case ITEM_MOD_DODGE_RATING: ApplyRatingMod(CR_DODGE, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DODGE", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DODGE", enchant_amount); +#endif break; case ITEM_MOD_PARRY_RATING: ApplyRatingMod(CR_PARRY, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u PARRY", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u PARRY", enchant_amount); +#endif break; case ITEM_MOD_BLOCK_RATING: ApplyRatingMod(CR_BLOCK, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SHIELD_BLOCK", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SHIELD_BLOCK", enchant_amount); +#endif break; case ITEM_MOD_HIT_MELEE_RATING: ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_HIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_HIT", enchant_amount); +#endif break; case ITEM_MOD_HIT_RANGED_RATING: ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_HIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_HIT", enchant_amount); +#endif break; case ITEM_MOD_HIT_SPELL_RATING: ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_HIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_HIT", enchant_amount); +#endif break; case ITEM_MOD_CRIT_MELEE_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_CRIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_CRIT", enchant_amount); +#endif break; case ITEM_MOD_CRIT_RANGED_RATING: ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_CRIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_CRIT", enchant_amount); +#endif break; case ITEM_MOD_CRIT_SPELL_RATING: ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_CRIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_CRIT", enchant_amount); +#endif break; // Values from ITEM_STAT_MELEE_HA_RATING to ITEM_MOD_HASTE_RANGED_RATING are never used // in Enchantments @@ -14370,13 +14522,17 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HIT", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HIT", enchant_amount); +#endif break; case ITEM_MOD_CRIT_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u CRITICAL", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u CRITICAL", enchant_amount); +#endif break; // Values ITEM_MOD_HIT_TAKEN_RATING and ITEM_MOD_CRIT_TAKEN_RATING are never used in Enchantment // case ITEM_MOD_HIT_TAKEN_RATING: @@ -14393,54 +14549,78 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RESILIENCE", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RESILIENCE", enchant_amount); +#endif break; case ITEM_MOD_HASTE_RATING: ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HASTE", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HASTE", enchant_amount); +#endif break; case ITEM_MOD_EXPERTISE_RATING: ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u EXPERTISE", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u EXPERTISE", enchant_amount); +#endif break; case ITEM_MOD_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply); HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ATTACK_POWER", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ATTACK_POWER", enchant_amount); +#endif break; case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_ATTACK_POWER", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_ATTACK_POWER", enchant_amount); +#endif break; // case ITEM_MOD_FERAL_ATTACK_POWER: // ApplyFeralAPBonus(enchant_amount, apply); -// ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u FERAL_ATTACK_POWER", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +// sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u FERAL_ATTACK_POWER", enchant_amount); +#endif // break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA_REGENERATION", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA_REGENERATION", enchant_amount); +#endif break; case ITEM_MOD_ARMOR_PENETRATION_RATING: ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ARMOR PENETRATION", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ARMOR PENETRATION", enchant_amount); +#endif break; case ITEM_MOD_SPELL_POWER: ApplySpellPowerBonus(enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_POWER", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_POWER", enchant_amount); +#endif break; case ITEM_MOD_HEALTH_REGEN: ApplyHealthRegenBonus(enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH_REGENERATION", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH_REGENERATION", enchant_amount); +#endif break; case ITEM_MOD_SPELL_PENETRATION: ApplySpellPenetrationBonus(enchant_amount, apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_PENETRATION", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_PENETRATION", enchant_amount); +#endif break; case ITEM_MOD_BLOCK_VALUE: HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(enchant_amount), apply); - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u BLOCK_VALUE", enchant_amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u BLOCK_VALUE", enchant_amount); +#endif break; case ITEM_MOD_SPELL_HEALING_DONE: // deprecated case ITEM_MOD_SPELL_DAMAGE_DONE: // deprecated @@ -15822,7 +16002,9 @@ bool Player::SatisfyQuestLog(bool msg) { WorldPacket data(SMSG_QUESTLOG_FULL, 0); GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTLOG_FULL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTLOG_FULL"); +#endif } return false; } @@ -15994,7 +16176,9 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); +#endif return false; } return true; @@ -17056,14 +17240,18 @@ void Player::SendQuestComplete(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); +#endif } } void Player::SendQuestReward(Quest const* quest, uint32 XP) { uint32 questid = quest->GetQuestId(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); +#endif sGameEventMgr->HandleQuestComplete(questid); WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4)); data << uint32(questid); @@ -17093,7 +17281,9 @@ void Player::SendQuestFailed(uint32 questId, InventoryResult reason) data << uint32(questId); data << uint32(reason); // failed reason (valid reasons: 4, 16, 50, 17, 74, other values show default message) GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); +#endif } } @@ -17104,7 +17294,9 @@ void Player::SendQuestTimerFailed(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_FAILEDTIMER, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); +#endif } } @@ -17113,7 +17305,9 @@ void Player::SendCanTakeQuestResponse(uint32 msg) const WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4); data << uint32(msg); GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); +#endif } void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver) @@ -17134,7 +17328,9 @@ void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver) data << uint64(GetGUID()); pReceiver->GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); +#endif } } @@ -17146,14 +17342,18 @@ void Player::SendPushToPartyResponse(Player* player, uint8 msg) data << uint64(player->GetGUID()); data << uint8(msg); // valid values: 0-8 GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_QUEST_PUSH_RESULT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_QUEST_PUSH_RESULT"); +#endif } } void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, uint16 /*count*/) { WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); +#endif //data << quest->RequiredItemId[item_idx]; //data << count; GetSession()->SendPacket(&data); @@ -17169,7 +17369,9 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uin entry = (-entry) | 0x80000000; WorldPacket data(SMSG_QUESTUPDATE_ADD_KILL, (4*4+8)); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); +#endif data << uint32(quest->GetQuestId()); data << uint32(entry); data << uint32(old_count + add_count); @@ -17187,7 +17389,9 @@ void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint ASSERT(old_count + add_count < 65536 && "player count store in 16 bits"); WorldPacket data(SMSG_QUESTUPDATE_ADD_PVP_KILL, (3*4)); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_PVP_KILL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_PVP_KILL"); +#endif data << uint32(quest->GetQuestId()); data << uint32(old_count + add_count); data << uint32(quest->GetPlayersSlain()); @@ -17499,7 +17703,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_items[slot] = NULL; } - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Load Basic value of player %s is: ", m_name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Load Basic value of player %s is: ", m_name.c_str()); +#endif outDebugValues(); //Need to call it to initialize m_team (m_team can be calculated from race) @@ -17680,7 +17886,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { if (GetSession()->Expansion() < mapEntry->Expansion()) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player %s using client without required expansion tried login at non accessible map %u", GetName().c_str(), mapId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player %s using client without required expansion tried login at non accessible map %u", GetName().c_str(), mapId); +#endif RelocateToHomebind(); } @@ -17936,7 +18144,9 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); +#endif outDebugValues(); // GM state @@ -18101,7 +18311,9 @@ void Player::_LoadActions(PreparedQueryResult result) ab->uState = ACTIONBUTTON_UNCHANGED; else { - ;//sLog->outError("ActionButton loading problem, will be deleted from db..."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outError("ActionButton loading problem, will be deleted from db..."); +#endif // Will deleted in DB at next save (it can create data until save but marked as deleted) m_actionButtons[button].uState = ACTIONBUTTON_DELETED; @@ -18112,7 +18324,9 @@ void Player::_LoadActions(PreparedQueryResult result) void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Loading auras for player %u", GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Loading auras for player %u", GetGUIDLow()); +#endif /* 0 1 2 3 4 5 6 7 8 9 10 QueryResult* result = CharacterDatabase.PQuery("SELECT casterGuid, spell, effectMask, recalculateMask, stackCount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, @@ -18186,7 +18400,9 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]); aura->ApplyForTargets(); - ;//sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask); +#endif } } while (result->NextRow()); @@ -18386,14 +18602,18 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F // Do not allow to have item limited to another map/zone in alive state if (IsAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId)) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', map: %u) has item (GUID: %u, entry: %u) limited to another map (%u). Deleting item.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', map: %u) has item (GUID: %u, entry: %u) limited to another map (%u). Deleting item.", +#endif // GetGUIDLow(), GetName().c_str(), GetMapId(), item->GetGUIDLow(), item->GetEntry(), zoneId); remove = true; } // "Conjured items disappear if you are logged out for more than 15 minutes" else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.", +#endif // GetGUIDLow(), GetName().c_str(), timeDiff, item->GetGUIDLow(), item->GetEntry()); remove = true; } @@ -18401,7 +18621,9 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { if (item->GetPlayedTime() > (2 * HOUR)) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", +#endif // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); @@ -18425,7 +18647,9 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F } else { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.", +#endif // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } @@ -18453,7 +18677,9 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F } else { - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.", +#endif // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); } @@ -18800,7 +19026,9 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) ++slot; } - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.Status, quest_id, GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.Status, quest_id, GetGUIDLow()); +#endif } } while (result->NextRow()); @@ -18891,7 +19119,9 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id); ++quest_daily_idx; - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); +#endif } while (result->NextRow()); } @@ -18914,7 +19144,9 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result) continue; m_weeklyquests.insert(quest_id); - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); +#endif } while (result->NextRow()); } @@ -18938,7 +19170,9 @@ void Player::_LoadSeasonalQuestStatus(PreparedQueryResult result) continue; m_seasonalquests[event_id].insert(quest_id); - ;//sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Seasonal quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Seasonal quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); +#endif } while (result->NextRow()); } @@ -19254,7 +19488,9 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) CharacterDatabase.Execute(stmt); } - ;//sLog->outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", +#endif // m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); return true; @@ -19280,7 +19516,9 @@ void Player::SaveToDB(bool create, bool logout) // first save/honor gain after midnight will also update the player's honor fields UpdateHonorFields(); - ;//sLog->outDebug(LOG_FILTER_UNITS, "The value of player %s at save: ", m_name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "The value of player %s at save: ", m_name.c_str()); +#endif outDebugValues(); SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -19989,18 +20227,42 @@ void Player::outDebugValues() const if (!sLog->IsOutDebug()) // optimize disabled debug output return; - ;//sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u", GetMaxHealth(), GetMaxPower(POWER_MANA)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f", GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f", GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "STAMINA is: \t\t%f", GetStat(STAT_STAMINA)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "Armor is: \t\t%u\t\tBlock is: \t\t%f", GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "HolyRes is: \t\t%u\t\tFireRes is: \t\t%u", GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u", GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u", GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f", GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); - ;//sLog->outDebug(LOG_FILTER_UNITS, "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u", GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u", GetMaxHealth(), GetMaxPower(POWER_MANA)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f", GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f", GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "STAMINA is: \t\t%f", GetStat(STAT_STAMINA)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Armor is: \t\t%u\t\tBlock is: \t\t%f", GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "HolyRes is: \t\t%u\t\tFireRes is: \t\t%u", GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u", GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u", GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f", GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u", GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); +#endif } /*********************************************************/ @@ -20398,7 +20660,9 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if (!pet->IsAlive() && mode == PET_SAVE_AS_CURRENT && pet->getPetType() == HUNTER_PET) mode = PET_SAVE_NOT_IN_SLOT; - ;//sLog->outDebug(LOG_FILTER_PETS, "RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PETS, "RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); +#endif if (pet->m_removed) return; } @@ -20561,7 +20825,9 @@ void Player::PetSpellInitialize() if (!pet) return; - ;//sLog->outDebug(LOG_FILTER_PETS, "Pet Spells Groups"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PETS, "Pet Spells Groups"); +#endif CharmInfo* charmInfo = pet->GetCharmInfo(); @@ -20673,7 +20939,9 @@ void Player::VehicleSpellInitialize() ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(vehicle->GetEntry(), spellId); if (!sConditionMgr->IsObjectMeetToConditions(this, vehicle, conditions)) { - ;//sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", vehicle->ToCreature()->GetEntry(), spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", vehicle->ToCreature()->GetEntry(), spellId); +#endif data << uint16(0) << uint8(0) << uint8(i+8); continue; } @@ -20821,7 +21089,9 @@ class MageSpellModPred void Player::AddSpellMod(SpellModifier* mod, bool apply) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); +#endif uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; int i = 0; @@ -21382,7 +21652,9 @@ void Player::ContinueTaxiFlight() if (!sourceNode) return; - ;//sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Restart character %u taxi flight", GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Restart character %u taxi flight", GetGUIDLow()); +#endif uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeamId(true), true); if (!mountDisplayId) @@ -21637,7 +21909,9 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 Creature* creature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); +#endif SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0); return false; } @@ -21829,7 +22103,9 @@ void Player::UpdateHomebindTime(uint32 time) data << uint32(m_HomebindTimer); data << uint32(1); GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_MAPS, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName().c_str(), GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName().c_str(), GetGUIDLow()); +#endif } } @@ -22144,7 +22420,9 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) } } - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); +#endif return activate; } @@ -24230,7 +24508,9 @@ void Player::SetViewpoint(WorldObject* target, bool apply) if (!IsInWorld() || IsDuringRemoveFromWorld()) return; - ;//sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName().c_str(), target->GetEntry(), target->GetTypeId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName().c_str(), target->GetEntry(), target->GetTypeId()); +#endif if (!AddUInt64Value(PLAYER_FARSIGHT, target->GetGUID())) { @@ -24249,7 +24529,9 @@ void Player::SetViewpoint(WorldObject* target, bool apply) //must immediately set seer back otherwise may crash m_seer = this; - ;//sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s remove seer", GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s remove seer", GetName().c_str()); +#endif if (target->isType(TYPEMASK_UNIT) && !GetVehicle()) ((Unit*)target)->RemovePlayerFromVision(this); @@ -25086,7 +25368,9 @@ void Player::HandleFall(MovementInfo const& movementInfo) } //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction - ;//sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall); +#endif } // recheck alive, might have died of EnvironmentalDamage, avoid cases when player die in fact like Spirit of Redemption case @@ -25384,7 +25668,9 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) // learn! (other talent ranks will unlearned at learning) pet->learnSpell(spellid); - ;//sLog->outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid); +#endif // update free talent points pet->SetFreeTalentPoints(CurTalentPoints - (talentRank - curtalent_maxrank + 1)); @@ -26662,13 +26948,17 @@ void Player::SendRefundInfo(Item* item) if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); +#endif return; } if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); +#endif item->SetNotRefundable(this); return; } @@ -26676,7 +26966,9 @@ void Player::SendRefundInfo(Item* item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); +#endif return; } @@ -26722,7 +27014,9 @@ void Player::RefundItem(Item* item) { if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); +#endif return; } @@ -26738,7 +27032,9 @@ void Player::RefundItem(Item* item) if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); +#endif item->SetNotRefundable(this); return; } @@ -26746,7 +27042,9 @@ void Player::RefundItem(Item* item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); +#endif return; } diff --git a/src/game/Entities/Player/SocialMgr.cpp b/src/game/Entities/Player/SocialMgr.cpp index eb96a0ff8..0b8e03cfa 100644 --- a/src/game/Entities/Player/SocialMgr.cpp +++ b/src/game/Entities/Player/SocialMgr.cpp @@ -167,7 +167,9 @@ void PlayerSocial::SendSocialList(Player* player) } player->GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CONTACT_LIST"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CONTACT_LIST"); +#endif } bool PlayerSocial::HasFriend(uint32 friend_guid) const diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index 5508d5fce..9740fc2c1 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -789,10 +789,14 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage return 0; } - ;//sLog->outStaticDebug("DealDamageStart"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("DealDamageStart"); +#endif uint32 health = victim->GetHealth(); - ;//sLog->outDetail("deal dmg:%d to health:%d ", damage, health); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("deal dmg:%d to health:%d ", damage, health); +#endif // duel ends when player has 1 or less hp bool duel_hasEnded = false; @@ -856,7 +860,9 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage if (health <= damage) { - ;//sLog->outStaticDebug("DealDamage: victim just died"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("DealDamage: victim just died"); +#endif //if (attacker && victim->GetTypeId() == TYPEID_PLAYER && victim != attacker) //victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, health); // pussywizard: optimization @@ -865,7 +871,9 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage } else { - ;//sLog->outStaticDebug("DealDamageAlive"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("DealDamageAlive"); +#endif //if (victim->GetTypeId() == TYPEID_PLAYER) // victim->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, damage); // pussywizard: optimization @@ -956,7 +964,9 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage } } - ;//sLog->outStaticDebug("DealDamageEnd returned %d damage", damage); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("DealDamageEnd returned %d damage", damage); +#endif return damage; } @@ -1216,7 +1226,9 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID); if (spellProto == NULL) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "Unit::DealSpellDamage has wrong damageInfo->SpellID: %u", damageInfo->SpellID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "Unit::DealSpellDamage has wrong damageInfo->SpellID: %u", damageInfo->SpellID); +#endif return; } @@ -2149,10 +2161,14 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType); /*if (GetTypeId() == TYPEID_PLAYER) - ;//sLog->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", +#endif GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); else - ;//sLog->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", +#endif GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);*/ } } @@ -2223,7 +2239,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // always crit against a sitting target (except 0 crit chance) if (victim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !victim->IsStandState()) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); +#endif return MELEE_HIT_CRIT; } @@ -2257,7 +2275,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && ((tmp -= skillBonus) > 0) && roll < (sum += tmp)) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); +#endif return MELEE_HIT_DODGE; } } @@ -2266,7 +2286,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // check if attack comes from behind, nobody can parry or block if attacker is behind if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); +#endif else { // Reduce parry chance by attacker expertise rating @@ -2287,7 +2309,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && (tmp -= skillBonus) > 0 && roll < (sum += tmp)) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); +#endif return MELEE_HIT_PARRY; } } @@ -2304,7 +2328,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && (tmp -= skillBonus) > 0 && roll < (sum += tmp)) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); +#endif return MELEE_HIT_BLOCK; } } @@ -2325,7 +2351,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy tmp = tmp > 4000 ? 4000 : tmp; if (roll < (sum += tmp)) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); +#endif return MELEE_HIT_GLANCING; } } @@ -2349,7 +2377,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy tmp = tmp * 200 - 1500; if (roll < (sum += tmp)) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); +#endif return MELEE_HIT_CRUSHING; } } @@ -2360,14 +2390,20 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy if (tmp > 0 && roll < (sum += tmp)) { - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); +#endif if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); +#endif else return MELEE_HIT_CRIT; } - ;//sLog->outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL"); +#endif return MELEE_HIT_NORMAL; } @@ -2439,7 +2475,9 @@ void Unit::SendMeleeAttackStart(Unit* victim, Player* sendTo) sendTo->SendDirectMessage(&data); else SendMessageToSet(&data, true); - ;//sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); +#endif } void Unit::SendMeleeAttackStop(Unit* victim) @@ -2453,12 +2491,18 @@ void Unit::SendMeleeAttackStop(Unit* victim) data.append(victim ? victim->GetPackGUID() : 0); data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation SendMessageToSet(&data, true); - ;//sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP"); +#endif /*if (victim) - ;//sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow()); +#endif else - ;//sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());*/ +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());*/ +#endif } bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType) @@ -2617,7 +2661,9 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) case MELEE_HIT_BLOCK: canBlock = false; break; case MELEE_HIT_PARRY: canParry = false; break; default: - ;//sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); +#endif break; } } @@ -3899,7 +3945,9 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo aurApp->SetRemoveMode(removeMode); Aura* aura = aurApp->GetBase(); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u now is remove mode %d", aura->GetId(), removeMode); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u now is remove mode %d", aura->GetId(), removeMode); +#endif // dead loop is killing the server probably ASSERT(m_removedAurasCount < 0xFFFFFFFF); @@ -4734,7 +4782,9 @@ void Unit::DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime) // update for out of range group members (on 1 slot use) aura->SetNeedClientUpdateForTargets(); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u partially interrupted on unit %u, new duration: %u ms", aura->GetId(), GetGUIDLow(), aura->GetDuration()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u partially interrupted on unit %u, new duration: %u ms", aura->GetId(), GetGUIDLow(), aura->GetDuration()); +#endif } } } @@ -5642,7 +5692,9 @@ void Unit::SendSpellDamageImmune(Unit* target, uint32 spellId) void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); +#endif uint32 count = 1; size_t maxsize = 4+5+5+4+4+1+4+4+4+4+4+1+4+4+4+4+4*12; @@ -9686,7 +9738,9 @@ Unit* Unit::GetCharm() const void Unit::SetMinion(Minion *minion, bool apply) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); +#endif if (apply) { @@ -15026,7 +15080,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u // "handled" is needed as long as proc can be handled in multiple places if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); +#endif takeCharges = true; } @@ -15050,7 +15106,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u { case SPELL_AURA_PROC_TRIGGER_SPELL: { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#endif // Don`t drop charge or add cooldown for not started trigger if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -15069,7 +15127,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_MANA_SHIELD: case SPELL_AURA_DUMMY: { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#endif if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; @@ -15083,14 +15143,18 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u break; case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#endif if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell, cooldown)) takeCharges = true; break; } case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", +#endif // (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (damage > 0) @@ -15102,7 +15166,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } case SPELL_AURA_RAID_PROC_FROM_CHARGE: { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", +#endif // (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); HandleAuraRaidProcFromCharge(triggeredByAura); @@ -15111,7 +15177,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); +#endif if (HandleProcTriggerSpell(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -16085,7 +16153,9 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura) // Currently only Prayer of Mending if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20)) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); +#endif return false; } @@ -16389,7 +16459,9 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp if (!spiritOfRedemption) { - ;//sLog->outStaticDebug("SET JUST_DIED"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("SET JUST_DIED"); +#endif victim->setDeathState(JUST_DIED); } @@ -16414,7 +16486,9 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !plrVictim->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { - ;//sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); +#endif plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); // durability lost message WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); @@ -16434,7 +16508,9 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp } else // creature died { - ;//sLog->outStaticDebug("DealDamageNotPlayer"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("DealDamageNotPlayer"); +#endif if (!creature->IsPet() && creature->GetLootMode() > 0) { @@ -16835,7 +16911,9 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au throw 1; ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle()); - ;//sLog->outDebug(LOG_FILTER_UNITS, "SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); +#endif if (this == charmer) { @@ -18043,7 +18121,9 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a { if (seatId >= 0 && seatId != GetTransSeat()) { - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); +#endif ChangeSeat(seatId); } @@ -18051,7 +18131,9 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a } else { - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); +#endif ExitVehicle(); } } @@ -18421,7 +18503,9 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) { uint32 count = getThreatManager().getThreatList().size(); - ;//sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); +#endif WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8); data.append(GetPackGUID()); data.appendPackGUID(pHostileReference->getUnitGuid()); @@ -18438,7 +18522,9 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) void Unit::SendClearThreatListOpcode() { - ;//sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_CLEAR Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_CLEAR Message"); +#endif WorldPacket data(SMSG_THREAT_CLEAR, 8); data.append(GetPackGUID()); SendMessageToSet(&data, false); @@ -18446,7 +18532,9 @@ void Unit::SendClearThreatListOpcode() void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_REMOVE Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_REMOVE Message"); +#endif WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8); data.append(GetPackGUID()); data.appendPackGUID(pHostileReference->getUnitGuid()); diff --git a/src/game/Entities/Vehicle/Vehicle.cpp b/src/game/Entities/Vehicle/Vehicle.cpp index d20b43171..bf1dafee1 100644 --- a/src/game/Entities/Vehicle/Vehicle.cpp +++ b/src/game/Entities/Vehicle/Vehicle.cpp @@ -100,7 +100,9 @@ void Vehicle::Uninstall() return; } _status = STATUS_UNINSTALLING; - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Uninstall Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Uninstall Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); +#endif RemoveAllPassengers(); if (GetBase()->GetTypeId() == TYPEID_UNIT) @@ -109,7 +111,9 @@ void Vehicle::Uninstall() void Vehicle::Reset(bool evading /*= false*/) { - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Reset Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Reset Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); +#endif if (_me->GetTypeId() == TYPEID_PLAYER) { if (_usableSeatNum) @@ -193,7 +197,9 @@ void Vehicle::ApplyAllImmunities() void Vehicle::RemoveAllPassengers() { - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::RemoveAllPassengers. Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::RemoveAllPassengers. Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); +#endif // Passengers always cast an aura with SPELL_AURA_CONTROL_VEHICLE on the vehicle // We just remove the aura and the unapply handler will make the target leave the vehicle. @@ -262,7 +268,9 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ return; } - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId); +#endif if (Unit* passenger = GetPassenger(seatId)) { // already installed @@ -301,7 +309,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) /// @Prevent adding passengers when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.) if (_status == STATUS_UNINSTALLING) { - ;//sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", +#endif // unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); return false; } @@ -336,7 +346,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) ASSERT(seat->second.IsEmpty()); } - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUIDLow(), (int32)seat->first); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUIDLow(), (int32)seat->first); +#endif seat->second.Passenger.Guid = unit->GetGUID(); seat->second.Passenger.IsUnselectable = unit->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); @@ -445,7 +457,9 @@ void Vehicle::RemovePassenger(Unit* unit) if (seat == Seats.end()) return; - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUIDLow(), (int32)seat->first); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUIDLow(), (int32)seat->first); +#endif if (seat->second.SeatInfo->CanEnterOrExit() && ++_usableSeatNum) _me->SetFlag(UNIT_NPC_FLAGS, (_me->GetTypeId() == TYPEID_PLAYER ? UNIT_NPC_FLAG_PLAYER_VEHICLE : UNIT_NPC_FLAG_SPELLCLICK)); @@ -505,7 +519,9 @@ void Vehicle::Dismiss() if (GetBase()->GetTypeId() != TYPEID_UNIT) return; - ;//sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow()); +#endif Uninstall(); GetBase()->ToCreature()->DespawnOrUnsummon(); } diff --git a/src/game/Events/GameEventMgr.cpp b/src/game/Events/GameEventMgr.cpp index 5dc2c5158..aef25c391 100644 --- a/src/game/Events/GameEventMgr.cpp +++ b/src/game/Events/GameEventMgr.cpp @@ -1096,13 +1096,17 @@ uint32 GameEventMgr::Update() // return the next e nextEventDelay = 0; for (std::set::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr) StopEvent(*itr); - ;//sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1); +#endif return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call } void GameEventMgr::UnApplyEvent(uint16 event_id) { - ;//sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); +#endif //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END RunSmartAIScripts(event_id, false); // un-spawn positive event tagged objects @@ -1136,7 +1140,9 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) break; } - ;//sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); +#endif //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END RunSmartAIScripts(event_id, true); diff --git a/src/game/Globals/ObjectAccessor.cpp b/src/game/Globals/ObjectAccessor.cpp index 03e1a856c..1199c6b32 100644 --- a/src/game/Globals/ObjectAccessor.cpp +++ b/src/game/Globals/ObjectAccessor.cpp @@ -313,7 +313,9 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia return NULL; } - ;//sLog->outStaticDebug("Deleting Corpse and spawned bones."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Deleting Corpse and spawned bones."); +#endif // Map can be NULL Map* map = corpse->FindMap(); diff --git a/src/game/Globals/ObjectMgr.cpp b/src/game/Globals/ObjectMgr.cpp index df975b2c2..c044413d4 100644 --- a/src/game/Globals/ObjectMgr.cpp +++ b/src/game/Globals/ObjectMgr.cpp @@ -1865,7 +1865,9 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float } } - ;//sLog->outDebug(LOG_FILTER_MAPS, "AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); +#endif return guid; } @@ -3108,7 +3110,9 @@ void ObjectMgr::LoadPetLevelInfo() sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - ;//sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level); +#endif ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3609,7 +3613,9 @@ void ObjectMgr::LoadPlayerInfo() sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - ;//sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level); +#endif ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3711,7 +3717,9 @@ void ObjectMgr::LoadPlayerInfo() sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - ;//sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level); +#endif ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; diff --git a/src/game/Grids/ObjectGridLoader.cpp b/src/game/Grids/ObjectGridLoader.cpp index 013d2fc4e..0670203e8 100644 --- a/src/game/Grids/ObjectGridLoader.cpp +++ b/src/game/Grids/ObjectGridLoader.cpp @@ -204,7 +204,9 @@ void ObjectGridLoader::LoadN(void) } } } - ;//sLog->outDebug(LOG_FILTER_MAPS, "%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses, i_grid.GetGridId(), i_map->GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses, i_grid.GetGridId(), i_map->GetId()); +#endif } template diff --git a/src/game/Groups/Group.cpp b/src/game/Groups/Group.cpp index ebac30cfb..32ca11095 100644 --- a/src/game/Groups/Group.cpp +++ b/src/game/Groups/Group.cpp @@ -65,7 +65,9 @@ Group::~Group() { if (m_bgGroup) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted."); +#endif if (m_bgGroup->GetBgRaid(TEAM_ALLIANCE) == this) m_bgGroup->SetBgRaid(TEAM_ALLIANCE, NULL); else if (m_bgGroup->GetBgRaid(TEAM_HORDE) == this) m_bgGroup->SetBgRaid(TEAM_HORDE, NULL); else sLog->outError("Group::~Group: battleground group is not linked to the correct battleground."); @@ -1215,7 +1217,9 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); +#endif for (std::vector::iterator i = loot->items.begin(); i != loot->items.end(); ++i) { @@ -2009,7 +2013,9 @@ void Group::BroadcastGroupUpdate(void) { pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2); pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE); - ;//sLog->outStaticDebug("-- Forced group value update for '%s'", pp->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("-- Forced group value update for '%s'", pp->GetName().c_str()); +#endif } } } diff --git a/src/game/Guilds/Guild.cpp b/src/game/Guilds/Guild.cpp index 325aa9759..f332ad6cf 100644 --- a/src/game/Guilds/Guild.cpp +++ b/src/game/Guilds/Guild.cpp @@ -92,7 +92,9 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil data << uint32(errCode); session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_COMMAND_RESULT [%s]: Type: %u, code: %u, param: %s" +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_COMMAND_RESULT [%s]: Type: %u, code: %u, param: %s" +#endif // , session->GetPlayerInfo().c_str(), type, errCode, param.c_str()); } @@ -102,7 +104,9 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode data << uint32(errCode); session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s] Code: %u", session->GetPlayerInfo().c_str(), errCode); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s] Code: %u", session->GetPlayerInfo().c_str(), errCode); +#endif } // LogHolder @@ -561,13 +565,17 @@ void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const if (session) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: Tabid: %u, Text: %s" +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: Tabid: %u, Text: %s" +#endif // , session->GetPlayerInfo().c_str(), m_tabId, m_text.c_str()); session->SendPacket(&data); } else { - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [Broadcast]: Tabid: %u, Text: %s", m_tabId, m_text.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [Broadcast]: Tabid: %u, Text: %s", m_tabId, m_text.c_str()); +#endif guild->BroadcastPacket(&data); } } @@ -953,7 +961,9 @@ Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) ItemPosCount pos(*itr); ++itr; - ;//sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", +#endif // m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } @@ -1056,7 +1066,9 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, b InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", +#endif // m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); uint32 count = pItem->GetCount(); @@ -1154,7 +1166,9 @@ bool Guild::Create(Player* pLeader, std::string const& name) m_createdDate = ::time(NULL); _CreateLogHolders(); - ;//sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", +#endif // name.c_str(), pLeader->GetName().c_str(), GUID_LOPART(m_leaderGuid)); SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -1286,7 +1300,9 @@ void Guild::HandleRoster(WorldSession* session) itr->second->WritePacket(data, _HasRankRight(session->GetPlayer(), GR_RIGHT_VIEWOFFNOTE)); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_ROSTER [%s]", session->GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_ROSTER [%s]", session->GetPlayerInfo().c_str()); +#endif session->SendPacket(&data); } @@ -1309,7 +1325,9 @@ void Guild::HandleQuery(WorldSession* session) data << uint32(_GetRanksSize()); // Number of ranks used session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_QUERY_RESPONSE [%s]", session->GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_QUERY_RESPONSE [%s]", session->GetPlayerInfo().c_str()); +#endif } void Guild::HandleSetMOTD(WorldSession* session, std::string const& motd) @@ -1433,7 +1451,9 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string c SendCommandResult(session, GUILD_COMMAND_CHANGE_RANK, ERR_GUILD_PERMISSIONS); else if (RankInfo* rankInfo = GetRankInfo(rankId)) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); +#endif rankInfo->SetName(name); rankInfo->SetRights(rights); @@ -1519,7 +1539,9 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name) SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_COMMAND_SUCCESS, name); - ;//sLog->outDebug(LOG_FILTER_GUILD, "Player %s invited %s to join his Guild", player->GetName().c_str(), name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "Player %s invited %s to join his Guild", player->GetName().c_str(), name.c_str()); +#endif pInvitee->SetGuildIdInvited(m_id); _LogEvent(GUILD_EVENT_LOG_INVITE_PLAYER, player->GetGUIDLow(), pInvitee->GetGUIDLow()); @@ -1528,7 +1550,9 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name) data << player->GetName(); data << m_name; pInvitee->GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_INVITE [%s]", pInvitee->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_INVITE [%s]", pInvitee->GetName().c_str()); +#endif } void Guild::HandleAcceptMember(WorldSession* session) @@ -1787,7 +1811,9 @@ void Guild::HandleDisband(WorldSession* session) if (_IsLeader(session->GetPlayer())) { Disband(); - ;//sLog->outDebug(LOG_FILTER_GUILD, "Guild Successfully Disbanded"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "Guild Successfully Disbanded"); +#endif delete this; } } @@ -1802,7 +1828,9 @@ void Guild::SendInfo(WorldSession* session) const data << m_accountsNumber; // Number of accounts session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_INFO [%s]", session->GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_INFO [%s]", session->GetPlayerInfo().c_str()); +#endif } void Guild::SendEventLog(WorldSession* session) const @@ -1810,7 +1838,9 @@ void Guild::SendEventLog(WorldSession* session) const WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); m_eventLog->WritePacket(data); session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", session->GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", session->GetPlayerInfo().c_str()); +#endif } void Guild::SendBankLog(WorldSession* session, uint8 tabId) const @@ -1823,7 +1853,9 @@ void Guild::SendBankLog(WorldSession* session, uint8 tabId) const data << uint8(tabId); pLog->WritePacket(data); session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]", session->GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]", session->GetPlayerInfo().c_str()); +#endif } } @@ -1864,7 +1896,9 @@ void Guild::SendPermissions(WorldSession* session) const } session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s] Rank: %u", session->GetPlayerInfo().c_str(), rankId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s] Rank: %u", session->GetPlayerInfo().c_str(), rankId); +#endif } void Guild::SendMoneyInfo(WorldSession* session) const @@ -1877,7 +1911,9 @@ void Guild::SendMoneyInfo(WorldSession* session) const WorldPacket data(MSG_GUILD_BANK_MONEY_WITHDRAWN, 4); data << int32(amount); session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s] Money: %u", session->GetPlayerInfo().c_str(), amount); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s] Money: %u", session->GetPlayerInfo().c_str(), amount); +#endif } void Guild::SendLoginInfo(WorldSession* session) @@ -1888,7 +1924,9 @@ void Guild::SendLoginInfo(WorldSession* session) data << m_motd; session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [%s] MOTD", session->GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [%s] MOTD", session->GetPlayerInfo().c_str()); +#endif SendBankTabsInfo(session); @@ -2825,7 +2863,9 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par data << uint64(guid); BroadcastPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [Broadcast] Event: %u", guildEvent); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [Broadcast] Event: %u", guildEvent); +#endif } void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/, bool sendAllSlots /*= false*/, SlotIds *slots /*= NULL*/) const @@ -2865,7 +2905,9 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/ numSlots = _GetMemberRemainingSlots(member, tabId); data.put(rempos, numSlots); session->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %d", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %d", +#endif // session->GetPlayerInfo().c_str(), tabId, sendAllSlots, numSlots); } else // TODO - Probably this is just sent to session + those that have sent CMSG_GUILD_BANKER_ACTIVATE @@ -2881,7 +2923,9 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/ uint32 numSlots = _GetMemberRemainingSlots(itr->second, tabId); data.put(rempos, numSlots); player->GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %u" +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %u" +#endif // , player->GetName().c_str(), tabId, sendAllSlots, numSlots); } } diff --git a/src/game/Handlers/AddonHandler.cpp b/src/game/Handlers/AddonHandler.cpp index 697363e59..1f60031e7 100644 --- a/src/game/Handlers/AddonHandler.cpp +++ b/src/game/Handlers/AddonHandler.cpp @@ -66,7 +66,9 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target) AddOnPacked >> enabled >> crc >> unk2; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); +#endif uint8 state = (enabled ? 2 : 1); *Target << uint8(state); @@ -120,7 +122,9 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target) *Target << uint32(count); //if (AddOnPacked.rpos() != AddOnPacked.size()) - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under read!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under read!"); +#endif } else { diff --git a/src/game/Handlers/ArenaTeamHandler.cpp b/src/game/Handlers/ArenaTeamHandler.cpp index 3add4243b..3172fded1 100644 --- a/src/game/Handlers/ArenaTeamHandler.cpp +++ b/src/game/Handlers/ArenaTeamHandler.cpp @@ -19,11 +19,15 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_ARENA_TEAMS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_ARENA_TEAMS"); +#endif uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); +#endif if (Player* player = ObjectAccessor::FindPlayer(guid)) { @@ -40,7 +44,9 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_QUERY"); +#endif uint32 arenaTeamId; recvData >> arenaTeamId; @@ -54,7 +60,9 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_ROSTER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_ROSTER"); +#endif uint32 arenaTeamId; // arena team id recvData >> arenaTeamId; @@ -65,7 +73,9 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_INVITE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_INVITE"); +#endif uint32 arenaTeamId; // arena team id std::string invitedName; @@ -135,7 +145,9 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) return; } - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName().c_str(), invitedName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName().c_str(), invitedName.c_str()); +#endif player->SetArenaTeamIdInvited(arenaTeam->GetId()); @@ -144,12 +156,16 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) data << arenaTeam->GetName(); player->GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE"); +#endif } void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode +#endif ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(_player->GetArenaTeamIdInvited()); if (!arenaTeam) @@ -182,7 +198,9 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode +#endif // Remove invite from player _player->SetArenaTeamIdInvited(0); @@ -190,7 +208,9 @@ void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEAVE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEAVE"); +#endif uint32 arenaTeamId; recvData >> arenaTeamId; @@ -232,7 +252,9 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DISBAND"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DISBAND"); +#endif uint32 arenaTeamId; recvData >> arenaTeamId; @@ -254,7 +276,9 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_REMOVE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_REMOVE"); +#endif uint32 arenaTeamId; std::string name; @@ -304,7 +328,9 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEADER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEADER"); +#endif uint32 arenaTeamId; std::string name; diff --git a/src/game/Handlers/AuctionHouseHandler.cpp b/src/game/Handlers/AuctionHouseHandler.cpp index ad1ddce77..c85c74209 100644 --- a/src/game/Handlers/AuctionHouseHandler.cpp +++ b/src/game/Handlers/AuctionHouseHandler.cpp @@ -29,7 +29,9 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -141,7 +143,9 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (bid > MAX_MONEY_AMOUNT || buyout > MAX_MONEY_AMOUNT) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Player %s (GUID %u) attempted to sell item with higher price than max gold amount.", _player->GetName().c_str(), _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Player %s (GUID %u) attempted to sell item with higher price than max gold amount.", _player->GetName().c_str(), _player->GetGUIDLow()); +#endif SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); return; } @@ -149,14 +153,18 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(auctioneer)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(auctioneer)); +#endif return; } AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction()); if (!auctionHouseEntry) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", GUID_LOPART(auctioneer)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", GUID_LOPART(auctioneer)); +#endif return; } @@ -274,7 +282,9 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; - ;//sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); +#endif sAuctionMgr->AddAItem(item); auctionHouse->AddAuction(AH); @@ -314,7 +324,9 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; - ;//sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); +#endif sAuctionMgr->AddAItem(newItem); auctionHouse->AddAuction(AH); @@ -363,7 +375,9 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) //this function is called when client bids or buys out auction void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID"); +#endif uint64 auctioneer; uint32 auctionId; @@ -377,7 +391,9 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); +#endif return; } @@ -489,7 +505,9 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData) //this void is called when auction_owner cancels his auction void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM"); +#endif uint64 auctioneer; uint32 auctionId; @@ -500,7 +518,9 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); +#endif return; } @@ -566,7 +586,9 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) //called when player lists his bids void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS"); +#endif uint64 guid; //NPC guid uint32 listfrom; //page of auctions @@ -584,7 +606,9 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif recvData.rfinish(); return; } @@ -638,7 +662,9 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recvData) void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS"); +#endif _lastAuctionListOwnerItemsMSTime = World::GetGameTimeMS(); // pussywizard @@ -651,7 +677,9 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -677,7 +705,9 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData) //this void is called when player clicks on search button void WorldSession::HandleAuctionListItems(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_ITEMS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_ITEMS"); +#endif std::string searchedname; uint8 levelmin, levelmax, usable; @@ -722,7 +752,9 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData) void WorldSession::HandleAuctionListPendingSales(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES"); +#endif recvData.read_skip(); diff --git a/src/game/Handlers/BattleGroundHandler.cpp b/src/game/Handlers/BattleGroundHandler.cpp index 0a44ef087..112b07354 100644 --- a/src/game/Handlers/BattleGroundHandler.cpp +++ b/src/game/Handlers/BattleGroundHandler.cpp @@ -28,7 +28,9 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recvData) { uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); +#endif Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) @@ -256,7 +258,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); +#endif Battleground* bg = _player->GetBattleground(); if (!bg) // can't be received if player not in battleground @@ -307,7 +311,9 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvDa void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); +#endif Battleground* bg = _player->GetBattleground(); if (!bg) @@ -321,12 +327,16 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); +#endif } void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); +#endif uint32 bgTypeId; recvData >> bgTypeId; // id from DBC @@ -469,7 +479,9 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); +#endif recvData.read_skip(); // unk1 recvData.read_skip(); // unk2 @@ -772,11 +784,15 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recvData) if (!reportedPlayer) { - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: player not found"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: player not found"); +#endif return; } - ;//sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName().c_str(), reportedPlayer->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName().c_str(), reportedPlayer->GetName().c_str()); +#endif reportedPlayer->ReportedAfkBy(_player); } diff --git a/src/game/Handlers/ChannelHandler.cpp b/src/game/Handlers/ChannelHandler.cpp index d37402b22..70b2618e3 100644 --- a/src/game/Handlers/ChannelHandler.cpp +++ b/src/game/Handlers/ChannelHandler.cpp @@ -18,7 +18,9 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) recvPacket >> channelId >> unknown1 >> unknown2 >> channelName >> password; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", +#endif // GetPlayerInfo().c_str(), channelId, unknown1, unknown2, channelName.c_str(), password.c_str()); if (channelId) @@ -56,7 +58,9 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) std::string channelName; recvPacket >> unk >> channelName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_LEAVE_CHANNEL %s Channel: %s, unk1: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_LEAVE_CHANNEL %s Channel: %s, unk1: %u", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), unk); if (channelName.empty()) @@ -74,7 +78,9 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) std::string channelName; recvPacket >> channelName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "%s %s Channel: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "%s %s Channel: %s", +#endif // recvPacket.GetOpcode() == CMSG_CHANNEL_DISPLAY_LIST ? "CMSG_CHANNEL_DISPLAY_LIST" : "CMSG_CHANNEL_LIST", // GetPlayerInfo().c_str(), channelName.c_str()); @@ -88,7 +94,9 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) std::string channelName, password; recvPacket >> channelName >> password; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_PASSWORD %s Channel: %s, Password: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_PASSWORD %s Channel: %s, Password: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), password.c_str()); if (password.length() > MAX_CHANNEL_PASS_STR) @@ -104,7 +112,9 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_SET_OWNER %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_SET_OWNER %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -120,7 +130,9 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) std::string channelName; recvPacket >> channelName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_OWNER %s Channel: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_OWNER %s Channel: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str()); if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) @@ -133,7 +145,9 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MODERATOR %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MODERATOR %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -149,7 +163,9 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMODERATOR %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMODERATOR %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -165,7 +181,9 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MUTE %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MUTE %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -181,7 +199,9 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMUTE %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMUTE %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -197,7 +217,9 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_INVITE %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_INVITE %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -213,7 +235,9 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_KICK %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_KICK %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -229,7 +253,9 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_BAN %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_BAN %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -245,7 +271,9 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNBAN %s Channel: %s, Target: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNBAN %s Channel: %s, Target: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); if (!normalizePlayerName(targetName)) @@ -261,7 +289,9 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) std::string channelName; recvPacket >> channelName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str()); if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) @@ -280,7 +310,9 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) std::string channelName; recvPacket >> channelName; - ;//sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_GET_CHANNEL_MEMBER_COUNT %s Channel: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_GET_CHANNEL_MEMBER_COUNT %s Channel: %s", +#endif // GetPlayerInfo().c_str(), channelName.c_str()); if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) diff --git a/src/game/Handlers/CharacterHandler.cpp b/src/game/Handlers/CharacterHandler.cpp index d3c294977..f5a1237dc 100644 --- a/src/game/Handlers/CharacterHandler.cpp +++ b/src/game/Handlers/CharacterHandler.cpp @@ -204,7 +204,9 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result) do { uint32 guidlow = (*result)[0].GetUInt32(); - ;//sLog->outDetail("Loading char guid %u from account %u.", guidlow, GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Loading char guid %u from account %u.", guidlow, GetAccountId()); +#endif if (Player::BuildEnumData(result, &data)) { _legitCharacters.insert(guidlow); @@ -593,7 +595,9 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte { uint8 unk; createInfo->Data >> unk; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Character creation %s (account %u) has unhandled tail data: [%u]", createInfo->Name.c_str(), GetAccountId(), unk); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Character creation %s (account %u) has unhandled tail data: [%u]", createInfo->Name.c_str(), GetAccountId(), unk); +#endif } // pussywizard: @@ -651,7 +655,9 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte SendPacket(&data); std::string IP_str = GetRemoteAddress(); - ;//sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); +#endif sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); sScriptMgr->OnPlayerCreate(&newChar); sWorld->AddGlobalPlayerData(newChar.GetGUIDLow(), GetAccountId(), newChar.GetName(), newChar.getGender(), newChar.getRace(), newChar.getClass(), newChar.getLevel(), 0, 0); @@ -710,7 +716,9 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData) return; std::string IP_str = GetRemoteAddress(); - ;//sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); +#endif sLog->outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); sScriptMgr->OnPlayerDelete(guid); @@ -916,13 +924,17 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder) data.put(0, linecount); SendPacket(&data); - ;//sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); +#endif // send server info if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); - ;//sLog->outStaticDebug("WORLD: Sent server info"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Sent server info"); +#endif } if (uint32 guildId = Player::GetGuildIdFromStorage(pCurrChar->GetGUIDLow())) @@ -1214,13 +1226,17 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar) data.put(0, linecount); SendPacket(&data); - ;//sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); +#endif // send server info if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); - ;//sLog->outStaticDebug("WORLD: Sent server info"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Sent server info"); +#endif } data.Initialize(SMSG_LEARNED_DANCE_MOVES, 4+4); @@ -1319,7 +1335,9 @@ void WorldSession::HandlePlayerLoginToCharOutOfWorld(Player* pCurrChar) void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData) { - ;//sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR"); +#endif uint32 repListID; uint8 flag; @@ -1367,7 +1385,9 @@ void WorldSession::HandleTutorialReset(WorldPacket & /*recvData*/) void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket& recvData) { - ;//sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION"); +#endif uint32 fact; recvData >> fact; GetPlayer()->SetUInt32Value(PLAYER_FIELD_WATCHED_FACTION_INDEX, fact); @@ -1375,7 +1395,9 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket& recvData) void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData) { - ;//sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE"); +#endif uint32 replistid; uint8 inactive; recvData >> replistid >> inactive; @@ -1385,14 +1407,18 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData) void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData) { - ;//sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName().c_str()); +#endif recvData.read_skip(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM); } void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData) { - ;//sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str()); +#endif recvData.read_skip(); // unknown, bool? _player->ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK); } @@ -1610,7 +1636,9 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData) void WorldSession::HandleAlterAppearance(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); +#endif uint32 Hair, Color, FacialHair, SkinColor; recvData >> Hair >> Color >> FacialHair >> SkinColor; @@ -1687,7 +1715,9 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData) if (slot >= MAX_GLYPH_SLOT_INDEX) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); +#endif return; } @@ -1847,7 +1877,9 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); +#endif uint64 setGuid; recvData.readPackGUID(setGuid); @@ -1906,7 +1938,9 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData) void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE"); +#endif uint64 setGuid; recvData.readPackGUID(setGuid); @@ -1916,7 +1950,9 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData) void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_USE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_USE"); +#endif for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i) { @@ -1926,7 +1962,9 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData) uint8 srcbag, srcslot; recvData >> srcbag >> srcslot; - ;//sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); +#endif // check if item slot is set to "ignored" (raw value == 1), must not be unequipped then if (itemGuid == 1) diff --git a/src/game/Handlers/ChatHandler.cpp b/src/game/Handlers/ChatHandler.cpp index 1a4b97315..2a02158b8 100644 --- a/src/game/Handlers/ChatHandler.cpp +++ b/src/game/Handlers/ChatHandler.cpp @@ -699,7 +699,9 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData) void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); +#endif } void WorldSession::SendPlayerNotFoundNotice(std::string const& name) diff --git a/src/game/Handlers/CombatHandler.cpp b/src/game/Handlers/CombatHandler.cpp index 0d9190268..a6d68d189 100644 --- a/src/game/Handlers/CombatHandler.cpp +++ b/src/game/Handlers/CombatHandler.cpp @@ -21,7 +21,9 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData) uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); +#endif Unit* pEnemy = ObjectAccessor::GetUnit(*_player, guid); diff --git a/src/game/Handlers/DuelHandler.cpp b/src/game/Handlers/DuelHandler.cpp index c33bac3df..01287009e 100644 --- a/src/game/Handlers/DuelHandler.cpp +++ b/src/game/Handlers/DuelHandler.cpp @@ -30,8 +30,12 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) return; //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_ACCEPTED"); - ;//sLog->outStaticDebug("Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName().c_str()); - ;//sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName().c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName().c_str()); +#endif time_t now = time(NULL); player->duel->startTimer = now; @@ -43,7 +47,9 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DUEL_CANCELLED"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DUEL_CANCELLED"); +#endif uint64 guid; recvPacket >> guid; diff --git a/src/game/Handlers/GroupHandler.cpp b/src/game/Handlers/GroupHandler.cpp index bac0073b6..3d2d52ee6 100644 --- a/src/game/Handlers/GroupHandler.cpp +++ b/src/game/Handlers/GroupHandler.cpp @@ -47,7 +47,9 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); +#endif std::string membername; recvData >> membername; @@ -196,7 +198,9 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); +#endif recvData.read_skip(); Group* group = GetPlayer()->GetGroupInvite(); @@ -254,7 +258,9 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); +#endif Group* group = GetPlayer()->GetGroupInvite(); if (!group) @@ -277,7 +283,9 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); +#endif uint64 guid; std::string reason, name; @@ -335,7 +343,9 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE"); +#endif std::string membername; recvData >> membername; @@ -379,7 +389,9 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData) void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); +#endif uint64 guid; recvData >> guid; @@ -400,7 +412,9 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); +#endif Group* grp = GetPlayer()->GetGroup(); if (!grp) @@ -423,7 +437,9 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleLootMethodOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD"); +#endif uint32 lootMethod; uint64 lootMaster; @@ -484,7 +500,9 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData) void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING"); +#endif if (!GetPlayer()->GetGroup()) return; @@ -508,7 +526,9 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData) void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL"); +#endif uint32 minimum, maximum, roll; recvData >> minimum; @@ -537,7 +557,9 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData) void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); +#endif Group* group = GetPlayer()->GetGroup(); if (!group) @@ -576,7 +598,9 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); +#endif Group* group = GetPlayer()->GetGroup(); if (!group) @@ -597,7 +621,9 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); +#endif // we will get correct pointer for group here, so we don't have to check if group is BG raid Group* group = GetPlayer()->GetGroup(); @@ -636,7 +662,9 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData) void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); +#endif Group* group = GetPlayer()->GetGroup(); if (!group) @@ -657,7 +685,9 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData) void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); +#endif Group* group = GetPlayer()->GetGroup(); if (!group) @@ -691,7 +721,9 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData) void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); +#endif Group* group = GetPlayer()->GetGroup(); if (!group) @@ -1065,12 +1097,16 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) /*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData) { - ;//sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL."); +#endif }*/ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); +#endif uint32 passOnLoot; recvData >> passOnLoot; // 1 always pass, 0 do not pass diff --git a/src/game/Handlers/GuildHandler.cpp b/src/game/Handlers/GuildHandler.cpp index 874c95d9f..72aa595ea 100644 --- a/src/game/Handlers/GuildHandler.cpp +++ b/src/game/Handlers/GuildHandler.cpp @@ -21,7 +21,9 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) uint32 guildId; recvPacket >> guildId; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY [%s]: Guild: %u", GetPlayerInfo().c_str(), guildId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY [%s]: Guild: %u", GetPlayerInfo().c_str(), guildId); +#endif if (!guildId) return; @@ -42,7 +44,9 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) std::string invitedName; recvPacket >> invitedName; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INVITE [%s]: Invited: %s", GetPlayerInfo().c_str(), invitedName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INVITE [%s]: Invited: %s", GetPlayerInfo().c_str(), invitedName.c_str()); +#endif if (normalizePlayerName(invitedName)) if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleInviteMember(this, invitedName); @@ -53,7 +57,9 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) std::string playerName; recvPacket >> playerName; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_REMOVE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_REMOVE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); +#endif if (normalizePlayerName(playerName)) if (Guild* guild = GetPlayer()->GetGuild()) @@ -62,7 +68,9 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ACCEPT [%s]", GetPlayer()->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ACCEPT [%s]", GetPlayer()->GetName().c_str()); +#endif if (!GetPlayer()->GetGuildId()) if (Guild* guild = sGuildMgr->GetGuildById(GetPlayer()->GetGuildIdInvited())) @@ -71,7 +79,9 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DECLINE [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DECLINE [%s]", GetPlayerInfo().c_str()); +#endif GetPlayer()->SetGuildIdInvited(0); GetPlayer()->SetInGuild(0); @@ -79,7 +89,9 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SendInfo(this); @@ -87,7 +99,9 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ROSTER [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ROSTER [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleRoster(this); @@ -100,7 +114,9 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) std::string playerName; recvPacket >> playerName; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PROMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PROMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); +#endif if (normalizePlayerName(playerName)) if (Guild* guild = GetPlayer()->GetGuild()) @@ -112,7 +128,9 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) std::string playerName; recvPacket >> playerName; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); +#endif if (normalizePlayerName(playerName)) if (Guild* guild = GetPlayer()->GetGuild()) @@ -121,7 +139,9 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEAVE [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEAVE [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleLeaveMember(this); @@ -129,7 +149,9 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DISBAND [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DISBAND [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleDisband(this); @@ -140,7 +162,9 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) std::string name; recvPacket >> name; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEADER [%s]: Target: %s", GetPlayerInfo().c_str(), name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEADER [%s]: Target: %s", GetPlayerInfo().c_str(), name.c_str()); +#endif if (normalizePlayerName(name)) if (Guild* guild = GetPlayer()->GetGuild()) @@ -152,7 +176,9 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) std::string motd; recvPacket >> motd; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_MOTD [%s]: MOTD: %s", GetPlayerInfo().c_str(), motd.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_MOTD [%s]: MOTD: %s", GetPlayerInfo().c_str(), motd.c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleSetMOTD(this, motd); @@ -164,7 +190,9 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) std::string note; recvPacket >> playerName >> note; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s", +#endif // GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); if (normalizePlayerName(playerName)) @@ -178,7 +206,9 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) std::string note; recvPacket >> playerName >> note; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_OFFICER_NOTE [%s]: Target: %s, Note: %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_OFFICER_NOTE [%s]: Target: %s, Note: %s", +#endif // GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); if (normalizePlayerName(playerName)) @@ -200,7 +230,9 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) uint32 money; recvPacket >> money; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_RANK [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), rankName.c_str(), rankId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_RANK [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), rankName.c_str(), rankId); +#endif Guild* guild = GetPlayer()->GetGuild(); if (!guild) @@ -230,7 +262,9 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) std::string rankName; recvPacket >> rankName; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ADD_RANK [%s]: Rank: %s", GetPlayerInfo().c_str(), rankName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ADD_RANK [%s]: Rank: %s", GetPlayerInfo().c_str(), rankName.c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleAddNewRank(this, rankName); @@ -238,7 +272,9 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEL_RANK [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEL_RANK [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleRemoveLowestRank(this); @@ -249,7 +285,9 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) std::string info; recvPacket >> info; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO_TEXT [%s]: %s", GetPlayerInfo().c_str(), info.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO_TEXT [%s]: %s", GetPlayerInfo().c_str(), info.c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleSetInfo(this, info); @@ -263,7 +301,9 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) EmblemInfo emblemInfo; emblemInfo.ReadPacket(recvPacket); - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s]: Guid: [" UI64FMTD +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s]: Guid: [" UI64FMTD +#endif // "] Style: %d, Color: %d, BorderStyle: %d, BorderColor: %d, BackgroundColor: %d" // , GetPlayerInfo().c_str(), vendorGuid, emblemInfo.GetStyle() // , emblemInfo.GetColor(), emblemInfo.GetBorderStyle() @@ -286,7 +326,9 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SendEventLog(this); @@ -294,7 +336,9 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SendMoneyInfo(this); @@ -302,7 +346,9 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s]", GetPlayerInfo().c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SendPermissions(this); @@ -315,7 +361,9 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) bool sendAllSlots; recvData >> guid >> sendAllSlots; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" +#endif // , GetPlayerInfo().c_str(), guid, sendAllSlots); Guild * const guild = GetPlayer()->GetGuild(); @@ -337,7 +385,9 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvData) recvData >> guid >> tabId >> full; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, ShowTabs: %u" +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, ShowTabs: %u" +#endif // , GetPlayerInfo().c_str(), guid, tabId, full); if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) @@ -351,7 +401,9 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData) uint32 money; recvData >> guid >> money; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [" UI64FMTD "], money: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [" UI64FMTD "], money: %u", +#endif // GetPlayerInfo().c_str(), guid, money); if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) @@ -366,7 +418,9 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) uint32 money; recvData >> guid >> money; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [" UI64FMTD "], money: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [" UI64FMTD "], money: %u", +#endif // GetPlayerInfo().c_str(), guid, money); if (money && GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) @@ -376,7 +430,9 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_SWAP_ITEMS [%s]", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_SWAP_ITEMS [%s]", GetPlayerInfo().c_str()); +#endif uint64 GoGuid; recvData >> GoGuid; @@ -462,7 +518,9 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvData) recvData >> guid >> tabId; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_BUY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u", GetPlayerInfo().c_str(), guid, tabId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_BUY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u", GetPlayerInfo().c_str(), guid, tabId); +#endif if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) @@ -478,7 +536,9 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData) recvData >> guid >> tabId >> name >> icon; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, Name: %s, Icon: %s" +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, Name: %s, Icon: %s" +#endif // , GetPlayerInfo().c_str(), guid, tabId, name.c_str(), icon.c_str()); if (!name.empty() && !icon.empty()) @@ -492,7 +552,9 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvData) uint8 tabId; recvData >> tabId; - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SendBankLog(this, tabId); @@ -503,7 +565,9 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData) uint8 tabId; recvData >> tabId; - ;//sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SendBankTabText(this, tabId); @@ -515,7 +579,9 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recvData) std::string text; recvData >> tabId >> text; - ;//sLog->outDebug(LOG_FILTER_GUILD, "CMSG_SET_GUILD_BANK_TEXT [%s]: TabId: %u, Text: %s", GetPlayerInfo().c_str(), tabId, text.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_SET_GUILD_BANK_TEXT [%s]: TabId: %u, Text: %s", GetPlayerInfo().c_str(), tabId, text.c_str()); +#endif if (Guild* guild = GetPlayer()->GetGuild()) guild->SetBankTabText(tabId, text); diff --git a/src/game/Handlers/ItemHandler.cpp b/src/game/Handlers/ItemHandler.cpp index 7573c4280..1df88e43b 100644 --- a/src/game/Handlers/ItemHandler.cpp +++ b/src/game/Handlers/ItemHandler.cpp @@ -428,7 +428,9 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recvData) uint32 item; recvData >> item; - ;//sLog->outDetail("STORAGE: Item Query = %u", item); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("STORAGE: Item Query = %u", item); +#endif ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item); if (pProto) @@ -574,7 +576,9 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recvData) } else { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); +#endif WorldPacket queryData(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4); queryData << uint32(item | 0x80000000); SendPacket(&queryData); @@ -599,12 +603,16 @@ void WorldSession::HandleReadItem(WorldPacket & recvData) if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); - ;//sLog->outDetail("STORAGE: Item page sent"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("STORAGE: Item page sent"); +#endif } else { data.Initialize(SMSG_READ_ITEM_FAILED, 8); - ;//sLog->outDetail("STORAGE: Unable to read item"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("STORAGE: Unable to read item"); +#endif _player->SendEquipError(msg, pItem, NULL); } data << pItem->GetGUID(); @@ -616,7 +624,9 @@ void WorldSession::HandleReadItem(WorldPacket & recvData) void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); +#endif uint64 vendorguid, itemguid; uint32 count; @@ -628,7 +638,9 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); +#endif _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0); return; } @@ -731,7 +743,9 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) void WorldSession::HandleBuybackItem(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM"); +#endif uint64 vendorguid; uint32 slot; @@ -740,7 +754,9 @@ void WorldSession::HandleBuybackItem(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); +#endif _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); return; } @@ -779,7 +795,9 @@ void WorldSession::HandleBuybackItem(WorldPacket & recvData) void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); +#endif uint64 vendorguid, bagguid; uint32 item, slot, count; uint8 bagslot; @@ -821,7 +839,9 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recvData) void WorldSession::HandleBuyItemOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); +#endif uint64 vendorguid; uint32 item, slot, count; uint8 unk1; @@ -846,19 +866,25 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData) if (!GetPlayer()->IsAlive()) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LIST_INVENTORY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LIST_INVENTORY"); +#endif SendListInventory(guid); } void WorldSession::SendListInventory(uint64 vendorGuid) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); +#endif Creature* vendor = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR); if (!vendor) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorGuid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorGuid))); +#endif _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); return; } @@ -1001,7 +1027,9 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recvData) void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BUY_BANK_SLOT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BUY_BANK_SLOT"); +#endif uint64 guid; recvPacket >> guid; @@ -1017,7 +1045,9 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) // next slot ++slot; - ;//sLog->outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot); +#endif BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot); @@ -1050,11 +1080,15 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOBANK_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOBANK_ITEM"); +#endif uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); +#endif if (!CanUseBank()) { @@ -1088,11 +1122,15 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_BANK_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_BANK_ITEM"); +#endif uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); +#endif if (!CanUseBank()) { @@ -1142,7 +1180,9 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket & recvData) return; } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO"); +#endif uint32 item; recvData >> item; @@ -1188,7 +1228,9 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recvData) recvData >> itemid; recvData.read_skip(); // guid - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); +#endif ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid); if (pName) { @@ -1208,14 +1250,18 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recvData) void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); +#endif uint8 gift_bag, gift_slot, item_bag, item_slot; recvData >> gift_bag >> gift_slot; // paper recvData >> item_bag >> item_slot; // item - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); +#endif Item* gift = _player->GetItemByPos(gift_bag, gift_slot); if (!gift) @@ -1323,7 +1369,9 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS"); +#endif uint64 item_guid; uint64 gem_guids[MAX_GEM_SOCKETS]; @@ -1521,7 +1569,9 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); +#endif uint32 eslot; @@ -1545,7 +1595,9 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData) void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO"); +#endif uint64 guid; recvData >> guid; // item guid @@ -1553,7 +1605,9 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) Item* item = _player->GetItemByGuid(guid); if (!item) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); +#endif return; } @@ -1562,14 +1616,18 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) void WorldSession::HandleItemRefund(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND"); +#endif uint64 guid; recvData >> guid; // item guid Item* item = _player->GetItemByGuid(guid); if (!item) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); +#endif return; } @@ -1590,7 +1648,9 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recvData ) uint64 itemGuid; recvData >> itemGuid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); +#endif WorldPacket data(SMSG_ITEM_TEXT_QUERY_RESPONSE, 50); // guess size diff --git a/src/game/Handlers/LFGHandler.cpp b/src/game/Handlers/LFGHandler.cpp index 68ec86a04..f8ca38008 100644 --- a/src/game/Handlers/LFGHandler.cpp +++ b/src/game/Handlers/LFGHandler.cpp @@ -56,7 +56,9 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) recvData >> numDungeons; if (!numDungeons) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); +#endif recvData.rfinish(); return; } @@ -75,7 +77,9 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) std::string comment; recvData >> comment; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); +#endif sLFGMgr->JoinLfg(GetPlayer(), uint8(roles), newDungeons, comment); } @@ -86,7 +90,9 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/) uint64 guid = GetPlayer()->GetGUID(); uint64 gguid = group ? group->GetGUID() : guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", guid, grp ? 1 : 0); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", guid, grp ? 1 : 0); +#endif // Check cheating - only leader can leave the queue if (!group || group->GetLeaderGUID() == guid) @@ -103,7 +109,9 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData) recvData >> proposalID; recvData >> accept; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); +#endif sLFGMgr->UpdateProposal(proposalID, GetPlayer()->GetGUID(), accept); } @@ -115,11 +123,15 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) Group* group = GetPlayer()->GetGroup(); if (!group) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); +#endif return; } uint64 gguid = group->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); +#endif sLFGMgr->UpdateRoleCheck(gguid, guid, roles); } @@ -127,7 +139,9 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) { std::string comment; recvData >> comment; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); +#endif sLFGMgr->SetComment(GetPlayer()->GetGUID(), comment); sLFGMgr->LfrSetComment(GetPlayer(), comment); @@ -139,7 +153,9 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData) recvData >> agree; uint64 guid = GetPlayer()->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", guid, agree ? 1 : 0); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", guid, agree ? 1 : 0); +#endif sLFGMgr->UpdateBoot(guid, agree); } @@ -148,14 +164,18 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData) bool out; recvData >> out; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); +#endif sLFGMgr->TeleportPlayer(GetPlayer(), out, true); } void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*/) { uint64 guid = GetPlayer()->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); +#endif // Get Random dungeons that can be done at a certain level and expansion uint8 level = GetPlayer()->getLevel(); @@ -168,7 +188,9 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* uint32 rsize = uint32(randomDungeons.size()); uint32 lsize = uint32(lock.size()); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); +#endif WorldPacket data(SMSG_LFG_PLAYER_INFO, 1 + rsize * (4 + 1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4) + 4 + lsize * (1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4)); data << uint8(randomDungeons.size()); // Random Dungeon count @@ -226,7 +248,9 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/) { uint64 guid = GetPlayer()->GetGUID(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); +#endif Group* group = GetPlayer()->GetGroup(); if (!group) @@ -252,7 +276,9 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData* for (lfg::LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); +#endif WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size); BuildPartyLockDungeonBlock(data, lockMap); SendPacket(&data); @@ -276,7 +302,9 @@ void WorldSession::HandleLfrSearchLeaveOpcode(WorldPacket& recvData) void WorldSession::HandleLfgGetStatus(WorldPacket& /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_GET_STATUS %s", GetPlayerInfo().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_GET_STATUS %s", GetPlayerInfo().c_str()); +#endif uint64 guid = GetPlayer()->GetGUID(); lfg::LfgUpdateData updateData = sLFGMgr->GetLfgStatus(guid); @@ -313,7 +341,9 @@ void WorldSession::SendLfgUpdatePlayer(lfg::LfgUpdateData const& updateData) break; } - ;//sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PLAYER %s updatetype: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PLAYER %s updatetype: %u", +#endif // GetPlayerInfo().c_str(), updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type @@ -354,7 +384,9 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData) break; } - ;//sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PARTY %s updatetype: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PARTY %s updatetype: %u", +#endif // GetPlayerInfo().c_str(), updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type @@ -378,7 +410,9 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData) void WorldSession::SendLfgRoleChosen(uint64 guid, uint8 roles) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); +#endif WorldPacket data(SMSG_LFG_ROLE_CHOSEN, 8 + 1 + 4); data << uint64(guid); // Guid @@ -395,7 +429,9 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck) else dungeons = roleCheck.dungeons; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); +#endif WorldPacket data(SMSG_LFG_ROLE_CHECK_UPDATE, 4 + 1 + 1 + dungeons.size() * 4 + 1 + roleCheck.roles.size() * (8 + 1 + 4 + 1)); data << uint32(roleCheck.state); // Check result @@ -440,7 +476,9 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData) for (lfg::LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); +#endif WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size); data << uint32(joinData.result); // Check Result data << uint32(joinData.state); // Check Value @@ -451,7 +489,9 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData) void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", +#endif // GetPlayer()->GetGUID(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps); WorldPacket data(SMSG_LFG_QUEUE_STATUS, 4 + 4 + 4 + 4 + 4 +4 + 1 + 1 + 1 + 4); @@ -518,7 +558,9 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot) ++agreeNum; } } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", +#endif // guid, uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING), uint8(playerVote == lfg::LFG_ANSWER_AGREE), boot.victim, votesNum, agreeNum, secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str()); WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length()); data << uint8(boot.inProgress); // Vote in progress @@ -540,7 +582,9 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal) bool silent = !proposal.isNew && gguid == proposal.group; uint32 dungeonEntry = proposal.dungeonId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", guid, proposal.state); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", guid, proposal.state); +#endif // show random dungeon if player selected random dungeon and it's not lfg group if (!silent) @@ -583,7 +627,9 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal) void WorldSession::SendLfgLfrList(bool update) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_LFR_LIST [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_LFR_LIST [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); +#endif WorldPacket data(SMSG_LFG_UPDATE_SEARCH, 1); data << uint8(update); // In Lfg Queue? SendPacket(&data); @@ -591,14 +637,18 @@ void WorldSession::SendLfgLfrList(bool update) void WorldSession::SendLfgDisabled() { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); +#endif WorldPacket data(SMSG_LFG_DISABLED, 0); SendPacket(&data); } void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); +#endif WorldPacket data(SMSG_LFG_OFFER_CONTINUE, 4); data << uint32(dungeonEntry); SendPacket(&data); @@ -606,7 +656,9 @@ void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) void WorldSession::SendLfgTeleportError(uint8 err) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); +#endif WorldPacket data(SMSG_LFG_TELEPORT_DENIED, 4); data << uint32(err); // Error SendPacket(&data); diff --git a/src/game/Handlers/LootHandler.cpp b/src/game/Handlers/LootHandler.cpp index 8b56e2150..dae205d97 100644 --- a/src/game/Handlers/LootHandler.cpp +++ b/src/game/Handlers/LootHandler.cpp @@ -23,7 +23,9 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); +#endif Player* player = GetPlayer(); uint64 lguid = player->GetLootGUID(); Loot* loot = NULL; @@ -93,7 +95,9 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); +#endif Player* player = GetPlayer(); uint64 guid = player->GetLootGUID(); @@ -211,7 +215,9 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleLootOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT"); +#endif uint64 guid; recvData >> guid; @@ -229,7 +235,9 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData) void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE"); +#endif // cheaters can modify lguid to prevent correct apply loot release code and re-loot // use internal stored guid @@ -288,7 +296,9 @@ void WorldSession::DoLootRelease(uint64 lguid) // Xinef: prevents exploits with just opening GO and spawning bilions of npcs, which can crash core if you know what you're doin ;) if (go->GetGoType() == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.eventId) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId, gameObjTarget->GetDBTableGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId, gameObjTarget->GetDBTableGUIDLow()); +#endif player->GetMap()->ScriptsStart(sEventScripts, go->GetGOInfo()->chest.eventId, player, go); } } @@ -409,7 +419,9 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) return; } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName().c_str()); +#endif if (_player->GetLootGUID() != lootguid) { @@ -448,7 +460,9 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) if (slotid >= loot->items.size() + loot->quest_items.size()) { - ;//sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName().c_str(), slotid, (unsigned long)loot->items.size()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName().c_str(), slotid, (unsigned long)loot->items.size()); +#endif return; } diff --git a/src/game/Handlers/MailHandler.cpp b/src/game/Handlers/MailHandler.cpp index 3f52cb678..2debf09c3 100644 --- a/src/game/Handlers/MailHandler.cpp +++ b/src/game/Handlers/MailHandler.cpp @@ -101,13 +101,17 @@ void WorldSession::HandleSendMail(WorldPacket & recvData) if (!rc) { - ;//sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", +#endif // player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); return; } - ;//sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); +#endif if (player->GetGUID() == rc) { @@ -718,7 +722,9 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recvData) bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK); - ;//sLog->outDetail("HandleMailCreateTextItem mailid=%u", mailId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("HandleMailCreateTextItem mailid=%u", mailId); +#endif ItemPosCountVec dest; uint8 msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, bodyItem, false); diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 708db524f..3af18fd58 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -46,7 +46,9 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REPOP_REQUEST Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REPOP_REQUEST Message"); +#endif recv_data.read_skip(); @@ -63,7 +65,9 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) // release spirit after he's killed but before he is updated if (GetPlayer()->getDeathState() == JUST_DIED) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); +#endif GetPlayer()->KillPlayer(); } @@ -75,7 +79,9 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); +#endif uint32 gossipListId; uint32 menuId; @@ -95,7 +101,9 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } } @@ -104,7 +112,9 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) go = _player->GetMap()->GetGameObject(guid); if (!go) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); +#endif return; } } @@ -127,7 +137,9 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) } else { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); +#endif return; } @@ -137,7 +149,9 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if ((unit && unit->GetCreatureTemplate()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); +#endif if (unit) unit->LastUsedScriptID = unit->GetCreatureTemplate()->ScriptID; if (go) @@ -393,7 +407,9 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData) void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); +#endif if (uint64 lguid = GetPlayer()->GetLootGUID()) DoLootRelease(lguid); @@ -447,7 +463,9 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recv_data*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); +#endif } void WorldSession::HandleLogoutCancelOpcode(WorldPacket & /*recv_data*/) @@ -496,7 +514,9 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) uint32 newZone; recv_data >> newZone; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd ZONE_UPDATE: %u", newZone); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd ZONE_UPDATE: %u", newZone); +#endif // use server size data uint32 newzone, newarea; @@ -515,7 +535,9 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) { - // ;//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + // sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop +#endif uint32 animstate; recv_data >> animstate; @@ -526,13 +548,17 @@ void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) { uint32 unk; recv_data >> unk; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST - Unk: %d", unk); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST - Unk: %d", unk); +#endif _player->GetSocial()->SendSocialList(_player); } void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND"); +#endif std::string friendName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); std::string friendNote; @@ -544,7 +570,9 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) if (!normalizePlayerName(friendName)) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName().c_str(), friendName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName().c_str(), friendName.c_str()); +#endif // xinef: Get Data From global storage uint32 guidLow = sWorld->GetGlobalPlayerGUID(friendName); @@ -580,7 +608,9 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) if (!GetPlayer()->GetSocial()->AddToSocialList(guidLow, false)) { friendResult = FRIEND_LIST_FULL; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s's friend list is full.", GetPlayer()->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s's friend list is full.", GetPlayer()->GetName().c_str()); +#endif } } GetPlayer()->GetSocial()->SetFriendNote(guidLow, friendNote); @@ -589,14 +619,18 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, guidLow, false); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); +#endif } void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) { uint64 FriendGUID; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_FRIEND"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_FRIEND"); +#endif recv_data >> FriendGUID; @@ -604,12 +638,16 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); +#endif } void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE"); +#endif std::string ignoreName = GetTrinityString(LANG_FRIEND_IGNORE_UNKNOWN); @@ -618,7 +656,9 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) if (!normalizePlayerName(ignoreName)) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", +#endif // GetPlayer()->GetName().c_str(), ignoreName.c_str()); uint32 lowGuid = sWorld->GetGlobalPlayerGUID(ignoreName); @@ -643,7 +683,9 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, lowGuid, false); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); +#endif } void WorldSession::HandleLoadActionsSwitchSpec(PreparedQueryResult result) @@ -688,7 +730,9 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) { uint64 IgnoreGUID; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_IGNORE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_IGNORE"); +#endif recv_data >> IgnoreGUID; @@ -696,12 +740,16 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); +#endif } void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_CONTACT_NOTES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_CONTACT_NOTES"); +#endif uint64 guid; std::string note; recv_data >> guid >> note; @@ -718,12 +766,20 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) recv_data >> typelen >> type; if (suggestion == 0) - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); +#endif else - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Suggestion]"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Suggestion]"); +#endif - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", type.c_str()); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", content.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", type.c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", content.c_str()); +#endif PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_BUG_REPORT); @@ -735,7 +791,9 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RECLAIM_CORPSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RECLAIM_CORPSE"); +#endif uint64 guid; recv_data >> guid; @@ -772,7 +830,9 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RESURRECT_RESPONSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RESURRECT_RESPONSE"); +#endif uint64 guid; uint8 status; @@ -817,12 +877,16 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) uint32 triggerId; recv_data >> triggerId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_AREATRIGGER. Trigger ID: %u", triggerId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_AREATRIGGER. Trigger ID: %u", triggerId); +#endif Player* player = GetPlayer(); if (player->IsInFlight()) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", +#endif // player->GetName().c_str(), player->GetGUIDLow(), triggerId); return; } @@ -830,14 +894,18 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); if (!atEntry) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", +#endif // player->GetName().c_str(), player->GetGUIDLow(), triggerId); return; } if (!player->IsInAreaTriggerRadius(atEntry)) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", +#endif // player->GetName().c_str(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId); return; } @@ -896,12 +964,16 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); +#endif uint32 type, timestamp, decompressedSize; recv_data >> type >> timestamp >> decompressedSize; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); +#endif if (type > NUM_ACCOUNT_DATA_TYPES) return; @@ -951,12 +1023,16 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); +#endif uint32 type; recv_data >> type; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: type %u", type); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: type %u", type); +#endif if (type >= NUM_ACCOUNT_DATA_TYPES) return; @@ -972,7 +1048,9 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) if (size && compress(dest.contents(), &destSize, (uint8 const*)adata->Data.c_str(), size) != Z_OK) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: Failed to compress account data"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: Failed to compress account data"); +#endif return; } @@ -989,7 +1067,9 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_ACTION_BUTTON"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_ACTION_BUTTON"); +#endif uint8 button; uint32 packetData; recv_data >> button >> packetData; @@ -997,10 +1077,14 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) uint32 action = ACTION_BUTTON_ACTION(packetData); uint8 type = ACTION_BUTTON_TYPE(packetData); - ;//sLog->outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type); +#endif if (!packetData) { - ;//sLog->outDetail("MISC: Remove action from button %u", button); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MISC: Remove action from button %u", button); +#endif GetPlayer()->removeActionButton(button); } else @@ -1009,16 +1093,24 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { case ACTION_BUTTON_MACRO: case ACTION_BUTTON_CMACRO: - ;//sLog->outDetail("MISC: Added Macro %u into button %u", action, button); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MISC: Added Macro %u into button %u", action, button); +#endif break; case ACTION_BUTTON_EQSET: - ;//sLog->outDetail("MISC: Added EquipmentSet %u into button %u", action, button); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MISC: Added EquipmentSet %u into button %u", action, button); +#endif break; case ACTION_BUTTON_SPELL: - ;//sLog->outDetail("MISC: Added Spell %u into button %u", action, button); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MISC: Added Spell %u into button %u", action, button); +#endif break; case ACTION_BUTTON_ITEM: - ;//sLog->outDetail("MISC: Added Item %u into button %u", action, button); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MISC: Added Item %u into button %u", action, button); +#endif break; default: sLog->outError("MISC: Unknown action button type %u for action %u into button %u for player %s (GUID: %u)", type, action, button, _player->GetName().c_str(), _player->GetGUIDLow()); @@ -1030,12 +1122,16 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); +#endif } void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); +#endif } void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) @@ -1048,7 +1144,9 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); +#endif // no used recv_data.rfinish(); // prevent warnings spam @@ -1069,7 +1167,9 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data) return; } - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); +#endif recv_data.read_skip(); // unk @@ -1095,7 +1195,9 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) return; } - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); +#endif recv_data.read_skip(); // unk @@ -1137,12 +1239,16 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) uint64 guid; recv_data >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_INSPECT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_INSPECT"); +#endif Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT: No player found from GUID: " UI64FMTD, guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT: No player found from GUID: " UI64FMTD, guid); +#endif return; } @@ -1174,7 +1280,9 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); +#endif return; } @@ -1204,15 +1312,21 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) recv_data >> PositionZ; recv_data >> Orientation; // o (3.141593 = 180 degrees) - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_WORLD_TELEPORT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_WORLD_TELEPORT"); +#endif if (GetPlayer()->IsInFlight()) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); +#endif return; } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_WORLD_TELEPORT: Player = %s, Time = %u, map = %u, x = %f, y = %f, z = %f, o = %f", GetPlayer()->GetName().c_str(), time, mapid, PositionX, PositionY, PositionZ, Orientation); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_WORLD_TELEPORT: Player = %s, Time = %u, map = %u, x = %f, y = %f, z = %f, o = %f", GetPlayer()->GetName().c_str(), time, mapid, PositionX, PositionY, PositionZ, Orientation); +#endif if (AccountMgr::IsAdminAccount(GetSecurity())) GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation); @@ -1222,7 +1336,9 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WHOIS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WHOIS"); +#endif std::string charname; recv_data >> charname; @@ -1277,12 +1393,16 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) data << msg; SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName().c_str(), charname.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName().c_str(), charname.c_str()); +#endif } void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_COMPLAIN"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_COMPLAIN"); +#endif uint8 spam_type; // 0 - mail, 1 - chat uint64 spammer_guid; @@ -1317,12 +1437,16 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) data << uint8(0); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); +#endif } void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_REALM_SPLIT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_REALM_SPLIT"); +#endif uint32 unk; std::string split_date = "01/01/01"; @@ -1342,22 +1466,30 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_FAR_SIGHT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_FAR_SIGHT"); +#endif bool apply; recvData >> apply; if (apply) { - ;//sLog->outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); +#endif if (WorldObject* target = _player->GetViewpoint()) _player->SetSeer(target); else - ;//sLog->outError("Player %s requests non-existing seer " UI64FMTD, _player->GetName().c_str(), _player->GetUInt64Value(PLAYER_FARSIGHT)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outError("Player %s requests non-existing seer " UI64FMTD, _player->GetName().c_str(), _player->GetUInt64Value(PLAYER_FARSIGHT)); +#endif } else { - ;//sLog->outDebug("Player %u set vision to self", _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug("Player %u set vision to self", _player->GetGUIDLow()); +#endif _player->SetSeer(_player); } @@ -1366,7 +1498,9 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_TITLE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_TITLE"); +#endif int32 title; recv_data >> title; @@ -1393,7 +1527,9 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES"); +#endif if (Group* group = _player->GetGroup()) { @@ -1406,7 +1542,9 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_DUNGEON_DIFFICULTY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_DUNGEON_DIFFICULTY"); +#endif uint32 mode; recv_data >> mode; @@ -1459,7 +1597,9 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_RAID_DIFFICULTY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_RAID_DIFFICULTY"); +#endif uint32 mode; recv_data >> mode; @@ -1616,7 +1756,9 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_MOUNT_AURA"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_MOUNT_AURA"); +#endif //If player is not mounted, so go out :) if (!_player->IsMounted()) // not blizz like; no any messages on blizz @@ -1638,7 +1780,9 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) { // fly mode on/off - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); +#endif uint64 guid; // guid - unused recv_data.readPackGUID(guid); @@ -1664,7 +1808,9 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recv_data */) { /* - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_REQUEST_PET_INFO"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_REQUEST_PET_INFO"); +#endif recv_data.hexlike(); */ } @@ -1676,7 +1822,9 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket & recv_data) mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); +#endif } void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) @@ -1694,7 +1842,9 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) { // empty opcode - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); +#endif WorldPacket data(SMSG_WORLD_STATE_UI_TIMER_UPDATE, 4); data << uint32(time(NULL)); @@ -1704,7 +1854,9 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recv_data*/) { // empty opcode - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); +#endif SendAccountDataTimes(GLOBAL_CACHE_MASK); } @@ -1719,7 +1871,9 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift) //Battlefield and Battleground void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); +#endif Battleground* bg = _player->GetBattleground(); @@ -1742,7 +1896,9 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); +#endif Battleground* bg = _player->GetBattleground(); @@ -1791,7 +1947,9 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) if (!_player->HasPendingBind() || _player->GetPendingBind() != _player->GetInstanceId() || (_player->GetGroup() && _player->GetGroup()->isLFGGroup() && _player->GetGroup()->IsLfgRandomInstance())) { - ;//sLog->outDetail("InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName().c_str(), _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName().c_str(), _player->GetGUIDLow()); +#endif return; } @@ -1805,7 +1963,9 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY"); +#endif uint64 guid; uint32 spellId; diff --git a/src/game/Handlers/MovementHandler.cpp b/src/game/Handlers/MovementHandler.cpp index 8707e7685..c8f321780 100644 --- a/src/game/Handlers/MovementHandler.cpp +++ b/src/game/Handlers/MovementHandler.cpp @@ -29,7 +29,9 @@ void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); +#endif HandleMoveWorldportAckOpcode(); } @@ -222,15 +224,21 @@ void WorldSession::HandleMoveWorldportAckOpcode() void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); +#endif uint64 guid; recvData.readPackGUID(guid); uint32 flags, time; recvData >> flags >> time; // unused - ;//sLog->outStaticDebug("Guid " UI64FMTD, guid); - ;//sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Guid " UI64FMTD, guid); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); +#endif Player* plMover = _player->m_mover->ToPlayer(); @@ -484,7 +492,9 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) { uint32 opcode = recvData.GetOpcode(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); +#endif /* extract packet */ uint64 guid; @@ -562,7 +572,9 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); +#endif uint64 guid; recvData >> guid; @@ -576,7 +588,9 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData) void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); +#endif uint64 old_mover_guid; recvData.readPackGUID(old_mover_guid); @@ -605,7 +619,9 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/) void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); +#endif uint64 guid; recvData.readPackGUID(guid); @@ -640,7 +656,9 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData) void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); +#endif uint64 guid; // guid - unused recvData.readPackGUID(guid); @@ -656,7 +674,9 @@ void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); +#endif uint64 guid; // guid - unused recvData.readPackGUID(guid); diff --git a/src/game/Handlers/NPCHandler.cpp b/src/game/Handlers/NPCHandler.cpp index 19820f6ca..8e87dc467 100644 --- a/src/game/Handlers/NPCHandler.cpp +++ b/src/game/Handlers/NPCHandler.cpp @@ -44,7 +44,9 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -66,14 +68,18 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recvData) { uint64 guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE"); +#endif recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -115,12 +121,16 @@ void WorldSession::SendTrainerList(uint64 guid) void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList"); +#endif Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -132,14 +142,18 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!ci) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!", GUID_LOPART(guid)); +#endif return; } TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if (!trainer_spells) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", +#endif // GUID_LOPART(guid), unit->GetEntry()); return; } @@ -233,12 +247,16 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) uint32 spellId = 0; recvData >> guid >> spellId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); +#endif Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -286,7 +304,9 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO"); +#endif uint64 guid; recvData >> guid; @@ -294,7 +314,9 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -345,7 +367,9 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) /*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); +#endif uint32 option; uint32 unk; @@ -356,15 +380,21 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) if (_player->PlayerTalkClass->GossipOptionCoded(option)) { - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "reading string"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "reading string"); +#endif recvData >> code; - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str()); +#endif } Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -386,7 +416,9 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); +#endif uint64 guid; @@ -395,7 +427,9 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -448,7 +482,9 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); +#endif return; } @@ -480,7 +516,9 @@ void WorldSession::SendBindPoint(Creature* npc) void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS"); +#endif uint64 npcGUID; recvData >> npcGUID; @@ -516,7 +554,9 @@ void WorldSession::SendStablePetCallback(PreparedQueryResult result, uint64 guid if (!GetPlayer()) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS Send."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS Send."); +#endif WorldPacket data(MSG_LIST_STABLED_PETS, 200); // guess size @@ -573,7 +613,9 @@ void WorldSession::SendStableResult(uint8 res) void WorldSession::HandleStablePet(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET"); +#endif uint64 npcGUID; recvData >> npcGUID; @@ -648,7 +690,9 @@ void WorldSession::HandleStablePetCallback(PreparedQueryResult result) void WorldSession::HandleUnstablePet(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET."); +#endif uint64 npcGUID; uint32 petnumber; @@ -724,7 +768,9 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32 void WorldSession::HandleBuyStableSlot(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT."); +#endif uint64 npcGUID; recvData >> npcGUID; @@ -757,12 +803,16 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recvData) void WorldSession::HandleStableRevivePet(WorldPacket &/* recvData */) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented"); +#endif } void WorldSession::HandleStableSwapPet(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET."); +#endif uint64 npcGUID; uint32 petId; @@ -852,7 +902,9 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3 void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); +#endif uint64 npcGUID, itemGUID; uint8 guildBank; // new in 2.3.2, bool that means from guild bank money @@ -862,7 +914,9 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); +#endif return; } @@ -875,7 +929,9 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) if (itemGUID) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); +#endif Item* item = _player->GetItemByGuid(itemGUID); if (item) @@ -883,7 +939,9 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) } else { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); +#endif _player->DurabilityRepairAll(true, discountMod, guildBank); } } diff --git a/src/game/Handlers/PetHandler.cpp b/src/game/Handlers/PetHandler.cpp index 7142d11dc..9ff4d2738 100644 --- a/src/game/Handlers/PetHandler.cpp +++ b/src/game/Handlers/PetHandler.cpp @@ -354,13 +354,17 @@ void WorldSession::HandleDismissCritter(WorldPacket &recvData) uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); +#endif Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", +#endif // uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), GetAccountId()); return; } @@ -386,7 +390,9 @@ void WorldSession::HandlePetAction(WorldPacket & recvData) // used also for charmed creature Unit* pet= ObjectAccessor::GetUnit(*_player, guid1); - ;//sLog->outDetail("HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2))); +#endif if (!pet) { @@ -440,7 +446,9 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData) uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); +#endif Unit* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); @@ -894,7 +902,9 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid void WorldSession::HandlePetNameQuery(WorldPacket & recvData) { - ;//sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY"); +#endif uint32 petnumber; uint64 petguid; @@ -945,7 +955,9 @@ bool WorldSession::CheckStableMaster(uint64 guid) { if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE)) { - ;//sLog->outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid)); +#endif return false; } } @@ -954,7 +966,9 @@ bool WorldSession::CheckStableMaster(uint64 guid) { if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER)) { - ;//sLog->outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid)); +#endif return false; } } @@ -963,7 +977,9 @@ bool WorldSession::CheckStableMaster(uint64 guid) void WorldSession::HandlePetSetAction(WorldPacket & recvData) { - ;//sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION"); +#endif uint64 petguid; uint8 count; @@ -1090,7 +1106,9 @@ void WorldSession::HandlePetSetAction(WorldPacket & recvData) void WorldSession::HandlePetRename(WorldPacket & recvData) { - ;//sLog->outDetail("HandlePetRename. CMSG_PET_RENAME"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("HandlePetRename. CMSG_PET_RENAME"); +#endif uint64 petguid; uint8 isdeclined; @@ -1180,7 +1198,9 @@ void WorldSession::HandlePetAbandon(WorldPacket & recvData) { uint64 guid; recvData >> guid; //pet guid - ;//sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); +#endif if (!_player->IsInWorld()) return; @@ -1206,7 +1226,9 @@ void WorldSession::HandlePetAbandon(WorldPacket & recvData) void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) { - ;//sLog->outDetail("CMSG_PET_SPELL_AUTOCAST"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("CMSG_PET_SPELL_AUTOCAST"); +#endif uint64 guid; uint32 spellid; uint8 state; //1 for on, 0 for off @@ -1264,7 +1286,9 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL"); +#endif uint64 guid; uint8 castCount; @@ -1273,7 +1297,9 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> guid >> castCount >> spellId >> castFlags; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); +#endif // This opcode is also sent from charmed and possessed units (players and creatures) if (!_player->GetGuardianPet() && !_player->GetCharm()) @@ -1381,7 +1407,9 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec void WorldSession::HandlePetLearnTalent(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); +#endif uint64 guid; uint32 talent_id, requested_rank; @@ -1393,7 +1421,9 @@ void WorldSession::HandlePetLearnTalent(WorldPacket & recvData) void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET"); +#endif uint64 guid; recvData >> guid; diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index e5d8be0e9..8aaed09d5 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -41,7 +41,9 @@ enum CharterCosts void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY"); +#endif uint64 guidNPC; uint32 clientIndex; // 1 for guild and arenaslot+1 for arenas in client @@ -70,13 +72,17 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) recvData >> clientIndex; // index recvData.read_skip(); // 0 - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); +#endif // prevent cheating Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); +#endif return; } @@ -125,7 +131,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) type = ARENA_TEAM_CHARTER_5v5_TYPE; break; default: - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "unknown selection at buy arena petition: %u", clientIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "unknown selection at buy arena petition: %u", clientIndex); +#endif return; } @@ -201,7 +209,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) // datacorruption Petition const* petition = sPetitionMgr->GetPetitionByOwnerWithType(_player->GetGUIDLow(), type); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); +#endif CharacterDatabase.EscapeString(name); SQLTransaction trans = CharacterDatabase.BeginTransaction(); @@ -230,7 +240,9 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES"); +#endif uint64 petitionguid; recvData >> petitionguid; // petition guid @@ -251,7 +263,9 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) Signatures const* signatures = sPetitionMgr->GetSignature(petitionGuidLow); uint8 signs = signatures ? signatures->signatureMap.size() : 0; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuidLow); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuidLow); +#endif WorldPacket data(SMSG_PETITION_SHOW_SIGNATURES, (8+8+4+1+signs*12)); data << uint64(petitionguid); // petition guid @@ -271,13 +285,17 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok +#endif uint32 guildguid; uint64 petitionguid; recvData >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) recvData >> petitionguid; // petition guid - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); +#endif SendPetitionQueryOpcode(petitionguid); } @@ -287,7 +305,9 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) Petition const* petition = sPetitionMgr->GetPetition(GUID_LOPART(petitionguid)); if (!petition) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); +#endif return; } @@ -331,7 +351,9 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok +#endif uint64 petitionGuid; std::string newName; @@ -346,7 +368,9 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) Petition const* petition = sPetitionMgr->GetPetition(GUID_LOPART(petitionGuid)); if (!petition) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionGuid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionGuid)); +#endif return; } @@ -387,7 +411,9 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) // xinef: update petition container const_cast(petition)->petitionName = newName; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionGuid), newName.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionGuid), newName.c_str()); +#endif WorldPacket data(MSG_PETITION_RENAME, (8+newName.size()+1)); data << uint64(petitionGuid); data << newName; @@ -396,7 +422,9 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok +#endif uint64 petitionGuid; uint8 unk; @@ -514,7 +542,9 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) // xinef: fill petition store sPetitionMgr->AddSignature(GUID_LOPART(petitionGuid), GetAccountId(), playerGuid); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionGuid), _player->GetName().c_str(), playerGuid, GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionGuid), _player->GetName().c_str(), playerGuid, GetAccountId()); +#endif WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << uint64(petitionGuid); @@ -536,12 +566,16 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok +#endif uint64 petitionguid; uint64 ownerguid; recvData >> petitionguid; // petition guid - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); +#endif Petition const* petition = sPetitionMgr->GetPetition(GUID_LOPART(petitionguid)); if (!petition) @@ -558,7 +592,9 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData) void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok +#endif uint64 petitionguid, plguid; uint32 junk; @@ -646,7 +682,9 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION"); +#endif // Get petition guid from packet WorldPacket data; @@ -659,7 +697,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) if (!item) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u turned in by %u", GUID_LOPART(petitionGuid), _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u turned in by %u", GUID_LOPART(petitionGuid), _player->GetGUIDLow()); +#endif Petition const* petition = sPetitionMgr->GetPetition(GUID_LOPART(petitionGuid)); if (!petition) @@ -782,13 +822,17 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) // Register arena team sArenaTeamMgr->AddArenaTeam(arenaTeam); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitonsHandler: Arena team (guid: %u) added to ObjectMgr", arenaTeam->GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitonsHandler: Arena team (guid: %u) added to ObjectMgr", arenaTeam->GetId()); +#endif // Add members if (signs) for (SignatureMap::const_iterator itr = signatureCopy.begin(); itr != signatureCopy.end(); ++itr) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitionsHandler: Adding arena team (guid: %u) member %u", arenaTeam->GetId(), memberGUID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitionsHandler: Adding arena team (guid: %u) member %u", arenaTeam->GetId(), memberGUID); +#endif arenaTeam->AddMember(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)); } } @@ -809,7 +853,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) sPetitionMgr->RemovePetition(GUID_LOPART(petitionGuid)); // created - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TURN IN PETITION GUID %u", GUID_LOPART(petitionGuid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TURN IN PETITION GUID %u", GUID_LOPART(petitionGuid)); +#endif data.Initialize(SMSG_TURN_IN_PETITION_RESULTS, 4); data << (uint32)PETITION_TURN_OK; @@ -818,7 +864,9 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST"); +#endif uint64 guid; recvData >> guid; @@ -831,7 +879,9 @@ void WorldSession::SendPetitionShowList(uint64 guid) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -875,5 +925,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) } SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Sent SMSG_PETITION_SHOWLIST"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Sent SMSG_PETITION_SHOWLIST"); +#endif } diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index bb0df7fa5..fc12e0b92 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -135,12 +135,16 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recvData) } else { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", +#endif // GUID_LOPART(guid), entry); WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); +#endif } } @@ -171,7 +175,9 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) ObjectMgr::GetLocaleString(gameObjectLocale->CastBarCaption, localeConstant, CastBarCaption); } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry); +#endif WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150); data << uint32(entry); data << uint32(info->type); @@ -193,22 +199,30 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) data << uint32(0); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); +#endif } else { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", +#endif // GUID_LOPART(guid), entry); WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); +#endif } } void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); +#endif Corpse* corpse = GetPlayer()->GetCorpse(); @@ -263,7 +277,9 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) uint64 guid; recvData >> textID; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); +#endif recvData >> guid; @@ -340,13 +356,17 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE"); +#endif } /// Only _static_ data is sent in this packet !!! void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); +#endif uint32 pageID; recvData >> pageID; @@ -380,13 +400,17 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) } SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); +#endif } } void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); +#endif uint32 unk; recvData >> unk; diff --git a/src/game/Handlers/QuestHandler.cpp b/src/game/Handlers/QuestHandler.cpp index abb17fd51..b1b1e4f73 100644 --- a/src/game/Handlers/QuestHandler.cpp +++ b/src/game/Handlers/QuestHandler.cpp @@ -30,7 +30,9 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) Object* questGiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!questGiver) { - ;//sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid)); +#endif return; } @@ -38,14 +40,18 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) { case TYPEID_UNIT: { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); +#endif if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies questStatus = _player->GetQuestDialogStatus(questGiver); break; } case TYPEID_GAMEOBJECT: { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", uint32(GUID_LOPART(guid))); +#endif questStatus = _player->GetQuestDialogStatus(questGiver); break; } @@ -63,12 +69,16 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); +#endif Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!creature) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", +#endif // GUID_LOPART(guid)); return; } @@ -96,7 +106,9 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recvData) uint32 unk1; recvData >> guid >> questId >> unk1; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); +#endif Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); @@ -185,7 +197,9 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recvData) uint32 questId; uint8 unk1; recvData >> guid >> questId >> unk1; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); +#endif // Verify that the guid is valid and is a questgiver or involved in the requested quest Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT | TYPEMASK_ITEM); @@ -220,7 +234,9 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recvData) uint32 questId; recvData >> questId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); +#endif if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) _player->PlayerTalkClass->SendQuestQueryResponse(quest); @@ -238,7 +254,9 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recvData) return; } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u", uint32(GUID_LOPART(guid)), questId, reward); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u", uint32(GUID_LOPART(guid)), questId, reward); +#endif Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!object || !object->hasInvolvedQuest(questId)) @@ -318,7 +336,9 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid >> questId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); +#endif Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!object || !object->hasInvolvedQuest(questId)) @@ -340,7 +360,9 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData) void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL"); +#endif _player->PlayerTalkClass->SendCloseGossip(); } @@ -353,7 +375,9 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recvData) if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); +#endif GetPlayer()->SwapQuestSlot(slot1, slot2); } @@ -363,7 +387,9 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) uint8 slot; recvData >> slot; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot); +#endif if (slot < MAX_QUEST_LOG_SIZE) { @@ -388,7 +414,9 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) _player->RemoveActiveQuest(questId); _player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId); - ;//sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId); +#endif } _player->SetQuestSlot(slot, 0); @@ -402,7 +430,9 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) uint32 questId; recvData >> questId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId); +#endif if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { @@ -439,7 +469,9 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) recvData >> guid >> questId; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); +#endif Object* object = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!object || !object->hasInvolvedQuest(questId)) @@ -481,7 +513,9 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); +#endif } void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) @@ -492,7 +526,9 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) if (!_player->CanShareQuest(questId)) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); +#endif if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { @@ -559,7 +595,9 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) uint8 msg; recvPacket >> guid >> questId >> msg; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUEST_PUSH_RESULT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUEST_PUSH_RESULT"); +#endif if (_player->GetDivider() && _player->GetDivider() == guid) { @@ -576,7 +614,9 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); +#endif uint32 count = 0; diff --git a/src/game/Handlers/ReferAFriendHandler.cpp b/src/game/Handlers/ReferAFriendHandler.cpp index 45a212186..0cdfaf78b 100644 --- a/src/game/Handlers/ReferAFriendHandler.cpp +++ b/src/game/Handlers/ReferAFriendHandler.cpp @@ -12,7 +12,9 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GRANT_LEVEL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GRANT_LEVEL"); +#endif uint64 guid; recvData.readPackGUID(guid); @@ -54,7 +56,9 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ACCEPT_LEVEL_GRANT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ACCEPT_LEVEL_GRANT"); +#endif uint64 guid; recvData.readPackGUID(guid); diff --git a/src/game/Handlers/SkillHandler.cpp b/src/game/Handlers/SkillHandler.cpp index 837a40b60..757907d02 100644 --- a/src/game/Handlers/SkillHandler.cpp +++ b/src/game/Handlers/SkillHandler.cpp @@ -26,7 +26,9 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket & recvData) void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS"); +#endif uint32 talentsCount; recvPacket >> talentsCount; @@ -50,14 +52,18 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); +#endif uint64 guid; recvData >> guid; Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } diff --git a/src/game/Handlers/SpellHandler.cpp b/src/game/Handlers/SpellHandler.cpp index 0f7650d4a..7bc5f1803 100644 --- a/src/game/Handlers/SpellHandler.cpp +++ b/src/game/Handlers/SpellHandler.cpp @@ -82,7 +82,9 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); +#endif ItemTemplate const* proto = pItem->GetTemplate(); if (!proto) @@ -159,7 +161,9 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); +#endif Player* pUser = _player; @@ -178,7 +182,9 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) recvPacket >> bagIndex >> slot; - ;//sLog->outDetail("bagIndex: %u, slot: %u", bagIndex, slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("bagIndex: %u, slot: %u", bagIndex, slot); +#endif Item* item = pUser->GetItemByPos(bagIndex, slot); if (!item) @@ -285,7 +291,9 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); +#endif if (GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid)) { @@ -306,7 +314,9 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) uint64 guid; recvPacket >> guid; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); +#endif // ignore for remote control state if (_player->m_mover != _player) @@ -331,7 +341,9 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) uint8 castCount, castFlags; recvPacket >> castCount >> spellId >> castFlags; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); +#endif // ignore for remote control state (for player case) Unit* mover = _player->m_mover; @@ -559,7 +571,9 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode +#endif if (_player->HasAuraType(SPELL_AURA_PREVENT_RESURRECTION)) return; // silent return, client should display error by itself and not send this opcode @@ -597,7 +611,9 @@ void WorldSession::HandleSpellClick(WorldPacket& recvData) void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); +#endif uint64 guid; recvData >> guid; @@ -690,7 +706,9 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData) void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_PROJECTILE_POSITION"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_PROJECTILE_POSITION"); +#endif uint64 casterGuid; uint32 spellId; diff --git a/src/game/Handlers/TaxiHandler.cpp b/src/game/Handlers/TaxiHandler.cpp index 7347932bc..d87e98839 100644 --- a/src/game/Handlers/TaxiHandler.cpp +++ b/src/game/Handlers/TaxiHandler.cpp @@ -17,7 +17,9 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); +#endif uint64 guid; @@ -31,7 +33,9 @@ void WorldSession::SendTaxiStatus(uint64 guid) Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -41,18 +45,24 @@ void WorldSession::SendTaxiStatus(uint64 guid) if (curloc == 0) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: current location %u ", curloc); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: current location %u ", curloc); +#endif WorldPacket data(SMSG_TAXINODE_STATUS, 9); data << guid; data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); +#endif } void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); +#endif uint64 guid; recvData >> guid; @@ -61,7 +71,9 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!unit) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -88,7 +100,9 @@ void WorldSession::SendTaxiMenu(Creature* unit) bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater(); if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); +#endif WorldPacket data(SMSG_SHOWTAXINODES, (4 + 8 + 4 + 8 * 4)); data << uint32(1); @@ -97,7 +111,9 @@ void WorldSession::SendTaxiMenu(Creature* unit) GetPlayer()->m_taxi.AppendTaximaskTo(data, GetPlayer()->isTaxiCheater()); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SHOWTAXINODES"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SHOWTAXINODES"); +#endif GetPlayer()->SetTaxiCheater(lastTaxiCheaterState); } @@ -152,7 +168,9 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid) void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); +#endif uint64 guid; uint32 node_count; @@ -162,7 +180,9 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); +#endif return; } std::vector nodes; @@ -185,14 +205,18 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) if (nodes.empty()) return; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d", nodes.front(), nodes.back()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d", nodes.front(), nodes.back()); +#endif GetPlayer()->ActivateTaxiPathTo(nodes, npc, 0); } void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); +#endif uint64 guid; // used only for proper packet read recvData.readPackGUID(guid); @@ -206,18 +230,24 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI"); +#endif uint64 guid; std::vector nodes; nodes.resize(2); recvData >> guid >> nodes[0] >> nodes[1]; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]); +#endif Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); +#endif return; } @@ -239,5 +269,7 @@ void WorldSession::SendActivateTaxiReply(ActivateTaxiReply reply) data << uint32(reply); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ACTIVATETAXIREPLY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ACTIVATETAXIREPLY"); +#endif } diff --git a/src/game/Handlers/TradeHandler.cpp b/src/game/Handlers/TradeHandler.cpp index c10127e63..936f5bf4b 100644 --- a/src/game/Handlers/TradeHandler.cpp +++ b/src/game/Handlers/TradeHandler.cpp @@ -58,13 +58,17 @@ void WorldSession::SendTradeStatus(TradeStatus status) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u", _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u", _player->GetGUIDLow()); +#endif // recvPacket.print_storage(); } void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u", _player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u", _player->GetGUIDLow()); +#endif // recvPacket.print_storage(); } @@ -139,7 +143,9 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { // logging - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow()); +#endif // adjust time (depends on /played) if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) @@ -150,7 +156,9 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (hisItems[i]) { // logging - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow()); +#endif // adjust time (depends on /played) if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) @@ -198,7 +206,9 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m { if (Item* item = myTrade->GetItem(TradeSlots(i))) { - ;//sLog->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); +#endif //Can return NULL myItems[i] = item; myItems[i]->SetInTrade(); @@ -206,7 +216,9 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m if (Item* item = hisTrade->GetItem(TradeSlots(i))) { - ;//sLog->outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); +#endif hisItems[i] = item; hisItems[i]->SetInTrade(); } diff --git a/src/game/Handlers/VehicleHandler.cpp b/src/game/Handlers/VehicleHandler.cpp index 42494a642..7dafed7af 100644 --- a/src/game/Handlers/VehicleHandler.cpp +++ b/src/game/Handlers/VehicleHandler.cpp @@ -14,7 +14,9 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); +#endif uint64 vehicleGUID = _player->GetCharmGUID(); @@ -47,7 +49,9 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); +#endif Unit* vehicle_base = GetPlayer()->GetVehicleBase(); if (!vehicle_base) @@ -216,7 +220,9 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data) void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); +#endif if (Vehicle* vehicle = GetPlayer()->GetVehicle()) { diff --git a/src/game/Handlers/VoiceChatHandler.cpp b/src/game/Handlers/VoiceChatHandler.cpp index 452f43c3b..7103bf1da 100644 --- a/src/game/Handlers/VoiceChatHandler.cpp +++ b/src/game/Handlers/VoiceChatHandler.cpp @@ -12,7 +12,9 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE"); +#endif // uint8 isVoiceEnabled, uint8 isMicrophoneEnabled recvData.read_skip(); recvData.read_skip(); @@ -20,13 +22,17 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData) void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); +#endif // Enable Voice button in channel context menu } void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recvData) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); +#endif recvData.read_skip(); recvData.read_skip(); } diff --git a/src/game/Instances/InstanceScript.cpp b/src/game/Instances/InstanceScript.cpp index 72fc24d3d..4b5c17977 100644 --- a/src/game/Instances/InstanceScript.cpp +++ b/src/game/Instances/InstanceScript.cpp @@ -43,7 +43,9 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject* go) if (go) go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); else - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed"); +#endif } bool InstanceScript::IsEncounterInProgress() const @@ -64,7 +66,9 @@ void InstanceScript::LoadMinionData(const MinionData* data) ++data; } - ;//sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); +#endif } void InstanceScript::LoadDoorData(const DoorData* data) @@ -76,7 +80,9 @@ void InstanceScript::LoadDoorData(const DoorData* data) ++data; } - ;//sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); +#endif } void InstanceScript::UpdateMinionState(Creature* minion, EncounterState state) @@ -295,7 +301,9 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) player->SendUpdateWorldState(uiStateId, uiStateData); } else - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map."); +#endif } // Send Notify to all players in instance diff --git a/src/game/Instances/InstanceScript.h b/src/game/Instances/InstanceScript.h index 8f99c9f2d..4f3604bd9 100644 --- a/src/game/Instances/InstanceScript.h +++ b/src/game/Instances/InstanceScript.h @@ -13,10 +13,18 @@ //#include "GameObject.h" //#include "Map.h" -#define OUT_SAVE_INST_DATA ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -#define OUT_SAVE_INST_DATA_COMPLETE ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -#define OUT_LOAD_INST_DATA(a) ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) -#define OUT_LOAD_INST_DATA_COMPLETE ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#endif #define OUT_LOAD_INST_DATA_FAIL sLog->outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) class Map; diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 5fa7b8d75..308b71e1b 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -114,13 +114,19 @@ void Map::LoadMMap(int gx, int gy) switch (mmapLoadResult) { case MMAP::MMAP_LOAD_RESULT_OK: - ;//sLog->outDetail("MMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#endif break; case MMAP::MMAP_LOAD_RESULT_ERROR: - ;//sLog->outDetail("Could not load MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Could not load MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#endif break; case MMAP::MMAP_LOAD_RESULT_IGNORED: - ;//sLog->outStaticDebug("Ignored MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Ignored MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#endif break; } } @@ -132,13 +138,19 @@ void Map::LoadVMap(int gx, int gy) switch (vmapLoadResult) { case VMAP::VMAP_LOAD_RESULT_OK: - ;//sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#endif break; case VMAP::VMAP_LOAD_RESULT_ERROR: - ;//sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#endif break; case VMAP::VMAP_LOAD_RESULT_IGNORED: - ;//sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); +#endif break; } } @@ -163,7 +175,9 @@ void Map::LoadMap(int gx, int gy, bool reload) //map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?) if (GridMaps[gx][gy]) { - ;//sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId()); +#endif sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy); delete (GridMaps[gx][gy]); @@ -175,7 +189,9 @@ void Map::LoadMap(int gx, int gy, bool reload) int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; tmp = new char[len]; snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy); - ;//sLog->outDetail("Loading map %s", tmp); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Loading map %s", tmp); +#endif // loading data GridMaps[gx][gy] = new GridMap(); if (!GridMaps[gx][gy]->loadData(tmp)) @@ -300,7 +316,9 @@ void Map::SwitchGridContainers(Creature* obj, bool on) if (!IsGridLoaded(GridCoord(cell.data.Part.grid_x, cell.data.Part.grid_y))) return; - ;//sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on); +#endif NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(ngrid != NULL); @@ -424,7 +442,9 @@ bool Map::EnsureGridLoaded(const Cell &cell) { //if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) //{ - ;//sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); +#endif setGridObjectDataLoaded(true, cell.GridX(), cell.GridY()); @@ -1120,7 +1140,9 @@ bool Map::UnloadGrid(NGridType& ngrid) GridMaps[gx][gy] = NULL; - ;//sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId()); +#endif return true; } @@ -1862,7 +1884,9 @@ bool Map::IsOutdoors(float x, float y, float z) const WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId); if (wmoEntry) { - ;//sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId); +#endif atEntry = GetAreaEntryByAreaID(wmoEntry->areaId); } return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry); @@ -1943,7 +1967,9 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp uint32 liquid_type = 0; if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type)) { - ;//sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); +#endif // Check water level and ground level if (liquid_level > ground_level && z > ground_level - 2) { @@ -2102,7 +2128,9 @@ char const* Map::GetMapName() const void Map::SendInitSelf(Player* player) { - ;//sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow()); +#endif UpdateData data; @@ -2435,7 +2463,9 @@ bool InstanceMap::CanEnter(Player* player, bool loginCheck) uint32 maxPlayers = GetMaxPlayers(); if (GetPlayersCountExceptGMs() >= (loginCheck ? maxPlayers+1 : maxPlayers)) { - ;//sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName().c_str()); +#endif player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); return false; } diff --git a/src/game/Maps/MapInstanced.cpp b/src/game/Maps/MapInstanced.cpp index 5f04566b7..79ea5e19f 100644 --- a/src/game/Maps/MapInstanced.cpp +++ b/src/game/Maps/MapInstanced.cpp @@ -190,7 +190,9 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, // some instances only have one difficulty GetDownscaledMapDifficultyData(GetId(), difficulty); - ;//sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); +#endif InstanceMap* map = new InstanceMap(GetId(), InstanceId, difficulty, this); ASSERT(map->IsDungeon()); @@ -214,7 +216,9 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun // load/create a map TRINITY_GUARD(ACE_Thread_Mutex, Lock); - ;//sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); +#endif PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel()); diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index aae4a117d..760745078 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -151,7 +151,9 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) // probably there must be special opcode, because client has this string constant in GlobalStrings.lua // TODO: this is not a good place to send the message player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName); - ;//sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName().c_str(), mapName); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName().c_str(), mapName); +#endif return false; } } @@ -184,15 +186,21 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) { WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE, 0); player->GetSession()->SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName().c_str(), mapName); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName().c_str(), mapName); +#endif return false; } - ;//sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName().c_str(), mapName); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName().c_str(), mapName); +#endif player->ResurrectPlayer(0.5f, false); player->SpawnCorpseBones(); } else - ;//sLog->outDebug(LOG_FILTER_MAPS, "Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPS, "Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName().c_str()); +#endif } // if map exists - check for being full, etc. diff --git a/src/game/Movement/MotionMaster.cpp b/src/game/Movement/MotionMaster.cpp index dd52e028e..f6a35c90b 100644 --- a/src/game/Movement/MotionMaster.cpp +++ b/src/game/Movement/MotionMaster.cpp @@ -225,7 +225,9 @@ void MotionMaster::MoveRandom(float spawndist) if (_owner->GetTypeId() == TYPEID_UNIT) { - ;//sLog->outStaticDebug("Creature (GUID: %u) start moving random", _owner->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (GUID: %u) start moving random", _owner->GetGUIDLow()); +#endif Mutate(new RandomMovementGenerator(spawndist), MOTION_SLOT_IDLE); } } @@ -236,7 +238,9 @@ void MotionMaster::MoveTargetedHome() if (_owner->GetTypeId() == TYPEID_UNIT && !_owner->ToCreature()->GetCharmerOrOwnerGUID()) { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow()); +#endif Mutate(new HomeMovementGenerator(), MOTION_SLOT_ACTIVE); } else if (_owner->GetTypeId() == TYPEID_UNIT && _owner->ToCreature()->GetCharmerOrOwnerGUID()) @@ -246,11 +250,15 @@ void MotionMaster::MoveTargetedHome() if (_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; - ;//sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); +#endif Unit* target = _owner->ToCreature()->GetCharmerOrOwner(); if (target) { - ;//sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); +#endif Mutate(new FollowMovementGenerator(target, PET_FOLLOW_DIST, _owner->GetFollowAngle()), MOTION_SLOT_ACTIVE); } } @@ -268,12 +276,16 @@ void MotionMaster::MoveConfused() if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) move confused", _owner->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) move confused", _owner->GetGUIDLow()); +#endif Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused", +#endif // _owner->GetEntry(), _owner->GetGUIDLow()); Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } @@ -289,7 +301,9 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) //_owner->ClearUnitState(UNIT_STATE_FOLLOW); if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", +#endif // _owner->GetGUIDLow(), // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); @@ -297,7 +311,9 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); @@ -315,14 +331,18 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo //_owner->AddUnitState(UNIT_STATE_FOLLOW); if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(), +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(), +#endif // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); Mutate(new FollowMovementGenerator(target, dist, angle), slot); } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); @@ -338,12 +358,16 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); +#endif Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); } @@ -357,12 +381,16 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path) if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); +#endif Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); } @@ -377,7 +405,9 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed) float x, y, z; pos.GetPosition(x, y, z); - ;//sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); +#endif Movement::MoveSplineInit init(_owner); init.MoveTo(x, y, z); @@ -402,7 +432,9 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed) float x, y, z; pos.GetPosition(x, y, z); - ;//sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); +#endif Movement::MoveSplineInit init(_owner); init.MoveTo(x, y, z); @@ -466,7 +498,9 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id, Unit const* target) { - ;//sLog->outStaticDebug("Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); +#endif if (speedXY <= 0.1f) return; @@ -494,7 +528,9 @@ void MotionMaster::MoveFall(uint32 id /*=0*/, bool addFlagForNPC) float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE); if (tz <= INVALID_HEIGHT) { - ;//sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).", +#endif // _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ()); return; } @@ -536,12 +572,16 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id, if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); +#endif Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); } @@ -559,7 +599,9 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z) } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); _owner->AttackStop(); _owner->CastStop(0, false); @@ -580,7 +622,9 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time) } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), time); Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); } @@ -597,14 +641,18 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time) if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(), +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(), +#endif // enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", // enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow()); Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", +#endif // _owner->GetEntry(), _owner->GetGUIDLow(), // enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", // enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(), @@ -622,7 +670,9 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode) { if (path < sTaxiPathNodesByPath.size()) { - ;//sLog->outStaticDebug("%s taxi to (Path %u node %u)", _owner->GetName().c_str(), path, pathnode); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("%s taxi to (Path %u node %u)", _owner->GetName().c_str(), path, pathnode); +#endif FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(pathnode); mgen->LoadPath(_owner->ToPlayer()); Mutate(mgen, MOTION_SLOT_CONTROLLED); @@ -651,11 +701,15 @@ void MotionMaster::MoveDistract(uint32 timer) /*if (_owner->GetTypeId() == TYPEID_PLAYER) { - ;//sLog->outStaticDebug("Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer); +#endif } else { - ;//sLog->outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)", +#endif _owner->GetEntry(), _owner->GetGUIDLow(), timer); }*/ @@ -717,7 +771,9 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable) //Mutate(new WaypointMovementGenerator(path_id, repeatable)): Mutate(new WaypointMovementGenerator(path_id, repeatable), MOTION_SLOT_IDLE); - ;//sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", +#endif // _owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature", // _owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO"); } diff --git a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 324c3ad0e..f21e1989b 100644 --- a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -68,7 +68,9 @@ void WaypointMovementGenerator::OnArrived(Creature* creature) if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) { - ;//sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID()); +#endif creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); creature->GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, creature, NULL); } @@ -439,7 +441,9 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry { if (uint32 eventid = departure ? node->departureEventID : node->arrivalEventID) { - ;//sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName().c_str()); +#endif player->GetMap()->ScriptsStart(sEventScripts, eventid, player, player); } } @@ -475,9 +479,13 @@ void FlightPathMovementGenerator::PreloadEndGrid() // Load the grid if (endMap) { - ;//sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1)); +#endif endMap->LoadGrid(_endGridX, _endGridY); } else - ;//sLog->outDetail("Unable to determine map to preload flightmaster grid"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Unable to determine map to preload flightmaster grid"); +#endif } diff --git a/src/game/OutdoorPvP/OutdoorPvP.cpp b/src/game/OutdoorPvP/OutdoorPvP.cpp index 9f87e95f3..892bf33c3 100644 --- a/src/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP/OutdoorPvP.cpp @@ -105,7 +105,9 @@ bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 map, float bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3) { - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Creating capture point %u", entry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Creating capture point %u", entry); +#endif // check info existence GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(entry); @@ -132,7 +134,9 @@ bool OPvPCapturePoint::DelCreature(uint32 type) { if (!m_Creatures[type]) { - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted", type); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted", type); +#endif return false; } @@ -143,7 +147,9 @@ bool OPvPCapturePoint::DelCreature(uint32 type) m_Creatures[type] = 0; return false; } - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u", type); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u", type); +#endif uint32 guid = cr->GetDBTableGUIDLow(); // Don't save respawn time cr->SetRespawnTime(0); @@ -241,7 +247,9 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/) if (!player->GetSession()->PlayerLogout()) SendRemoveWorldStates(player); m_players[player->GetTeamId()].erase(player->GetGUID()); - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %s left an outdoorpvp zone", player->GetName().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %s left an outdoorpvp zone", player->GetName().c_str()); +#endif } void OutdoorPvP::HandlePlayerResurrects(Player* /*player*/, uint32 /*zone*/) diff --git a/src/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/game/OutdoorPvP/OutdoorPvPMgr.cpp index 1bd6f3d52..f2260c76c 100644 --- a/src/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -116,7 +116,9 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid) return; itr->second->HandlePlayerEnterZone(player, zoneid); - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#endif } void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid) @@ -132,7 +134,9 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid) return; itr->second->HandlePlayerLeaveZone(player, zoneid); - ;//sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); +#endif } OutdoorPvP* OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid) diff --git a/src/game/Pools/PoolMgr.cpp b/src/game/Pools/PoolMgr.cpp index 64d62576a..5ebb8c112 100644 --- a/src/game/Pools/PoolMgr.cpp +++ b/src/game/Pools/PoolMgr.cpp @@ -409,7 +409,9 @@ void PoolGroup::Spawn1Object(PoolObject* obj) PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { - ;//sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); +#endif questMap->insert(QuestRelations::value_type(itr->second, itr->first)); } @@ -418,7 +420,9 @@ void PoolGroup::Spawn1Object(PoolObject* obj) qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { - ;//sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); +#endif questMap->insert(QuestRelations::value_type(itr->second, itr->first)); } } @@ -426,7 +430,9 @@ void PoolGroup::Spawn1Object(PoolObject* obj) template <> void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 triggerFrom) { - ;//sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Spawning pool %u", poolId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Spawning pool %u", poolId); +#endif // load state from db if (!triggerFrom) { diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index 8fd98aa42..eebe18aae 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -193,8 +193,12 @@ void WorldSession::SendPacket(WorldPacket const* packet) { uint64 minTime = uint64(cur_time - lastTime); uint64 fullTime = uint64(lastTime - firstTime); - ;//sLog->outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime)); - ;//sLog->outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime)); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime); +#endif lastTime = cur_time; sendLastPacketCount = 1; @@ -543,7 +547,9 @@ void WorldSession::LogoutPlayer(bool save) //! Client will respond by sending 3x CMSG_CANCEL_TRADE, which we currently dont handle WorldPacket data(SMSG_LOGOUT_COMPLETE, 0); SendPacket(&data); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); +#endif //! Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ACCOUNT_ONLINE); @@ -969,7 +975,9 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) addonInfo >> enabled >> crc >> unk1; - ;//sLog->outDetail("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1); +#endif AddonInfo addon(addonName, enabled, crc, 2, true); @@ -982,15 +990,21 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) match = false; if (!match) - ;//sLog->outDetail("ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC); +#endif else - ;//sLog->outDetail("ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC); +#endif } else { AddonMgr::SaveAddon(addon); - ;//sLog->outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC); +#endif } // TODO: Find out when to not use CRC/pubkey, and other possible states. @@ -999,10 +1013,14 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) uint32 currentTime; addonInfo >> currentTime; - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: CurrentTime: %u", currentTime); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: CurrentTime: %u", currentTime); +#endif //if (addonInfo.rpos() != addonInfo.size()) - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under-read!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under-read!"); +#endif } else sLog->outError("Addon packet uncompress error!"); @@ -1044,7 +1062,9 @@ void WorldSession::SendAddonsInfo() data << uint8(usepk); if (usepk) // if CRC is wrong, add public key (client need it) { - ;//sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey", +#endif // itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC); data.append(addonPublicKey, sizeof(addonPublicKey)); diff --git a/src/game/Server/WorldSocket.cpp b/src/game/Server/WorldSocket.cpp index bae62d44c..6ce00ee75 100644 --- a/src/game/Server/WorldSocket.cpp +++ b/src/game/Server/WorldSocket.cpp @@ -282,14 +282,18 @@ int WorldSocket::handle_input (ACE_HANDLE) return Update(); // interesting line, isn't it ? } - ;//sLog->outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); +#endif errno = ECONNRESET; return -1; } case 0: { - ;//sLog->outStaticDebug("WorldSocket::handle_input: Peer has closed connection"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WorldSocket::handle_input: Peer has closed connection"); +#endif errno = ECONNRESET; return -1; @@ -752,7 +756,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) recvPacket >> unk4; recvPacket.read(digest, 20); - ;//sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", +#endif // BuiltNumberClient, // unk2, // account.c_str(), @@ -878,7 +884,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Check locked state for server AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); +#endif if (AccountTypes(security) < allowedAccountType) { WorldPacket Packet (SMSG_AUTH_RESPONSE, 1); @@ -886,7 +894,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendPacket(packet); - ;//sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); +#endif return -1; } @@ -914,7 +924,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) return -1; } - ;//sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", +#endif // account.c_str(), // address.c_str()); diff --git a/src/game/Server/WorldSocketMgr.cpp b/src/game/Server/WorldSocketMgr.cpp index f4f8ad972..317d89295 100644 --- a/src/game/Server/WorldSocketMgr.cpp +++ b/src/game/Server/WorldSocketMgr.cpp @@ -143,7 +143,9 @@ class ReactorRunnable : protected ACE_Task_Base virtual int svc() { - ;//sLog->outStaticDebug ("Network Thread Starting"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("Network Thread Starting"); +#endif ACE_ASSERT (m_Reactor); @@ -180,7 +182,9 @@ class ReactorRunnable : protected ACE_Task_Base } } - ;//sLog->outStaticDebug ("Network Thread exits"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug ("Network Thread exits"); +#endif return 0; } diff --git a/src/game/Spells/Auras/SpellAuraEffects.cpp b/src/game/Spells/Auras/SpellAuraEffects.cpp index 34923f1b2..479086524 100644 --- a/src/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/game/Spells/Auras/SpellAuraEffects.cpp @@ -5991,7 +5991,9 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) triggerFlags = TriggerCastFlags(TRIGGERED_FULL_MASK&~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST); triggerCaster->CastSpell(targets, triggeredSpellInfo, NULL, triggerFlags, NULL, this); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); +#endif } } } @@ -6015,11 +6017,15 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* values.AddSpellMod(SPELLVALUE_BASE_POINT0, GetAmount()); triggerCaster->CastSpell(targets, triggeredSpellInfo, &values, TRIGGERED_FULL_MASK, NULL, this); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); +#endif } } else - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); +#endif } void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const @@ -6132,7 +6138,9 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const Unit::CalcAbsorbResist(caster, target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo()); - ;//sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", +#endif // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); Unit::DealDamageMods(target, damage, &absorb); @@ -6227,7 +6235,9 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c if (target->GetHealth() < damage) damage = target->GetHealth(); - ;//sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", +#endif // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); if (caster) @@ -6271,7 +6281,9 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) return; caster->ModifyHealth(-(int32)damage); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: donator %u target %u damage %u.", caster->GetEntry(), target->GetEntry(), damage); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: donator %u target %u damage %u.", caster->GetEntry(), target->GetEntry(), damage); +#endif float gainMultiplier = GetSpellInfo()->Effects[GetEffIndex()].CalcValueMultiplier(caster); @@ -6372,7 +6384,9 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const if (crit = roll_chance_f(GetCritChance())) damage = Unit::SpellCriticalHealingBonus(caster, GetSpellInfo(), damage, target); - ;//sLog->outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u", +#endif // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId()); uint32 absorb = 0; @@ -6451,7 +6465,9 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con drainAmount = maxmana; } - ;//sLog->outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u", +#endif // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId()); // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) @@ -6517,7 +6533,9 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const // ignore negative values (can be result apply spellmods to aura damage uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) /100; - ;//sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", +#endif // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false); @@ -6555,7 +6573,9 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false); target->SendPeriodicAuraLog(&pInfo); - ;//sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", +#endif // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); int32 gain = target->ModifyPower(powerType, amount); @@ -6617,11 +6637,15 @@ void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEve uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell %u from aura %u proc", triggeredSpellInfo->Id, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell %u from aura %u proc", triggeredSpellInfo->Id, GetId()); +#endif triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); } else - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); +#endif } void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) @@ -6633,11 +6657,15 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { int32 basepoints0 = GetAmount(); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId()); +#endif triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, NULL, NULL, true, NULL, this); } else - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); +#endif } void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) @@ -6650,7 +6678,9 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo()); Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); target->SendSpellNonMeleeDamageLog(&damageInfo); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering %u spell damage from aura %u proc", damage, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering %u spell damage from aura %u proc", damage, GetId()); +#endif target->DealSpellDamage(&damageInfo, true); } @@ -6672,7 +6702,9 @@ void AuraEffect::HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcE triggerSpellId = 43594; break; default: - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: %u", GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: %u", GetId()); +#endif return; } @@ -6698,7 +6730,9 @@ void AuraEffect::HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcE } } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); +#endif target->CastSpell(target, triggerSpellId, true, NULL, this, GetCasterGUID()); } @@ -6710,7 +6744,9 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA // Currently only Prayer of Mending if (!(GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && GetSpellInfo()->SpellFamilyFlags[1] & 0x20)) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: %u", GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: %u", GetId()); +#endif return; } uint32 triggerSpellId = 33110; @@ -6739,6 +6775,8 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA } } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); +#endif target->CastCustomSpell(target, triggerSpellId, &value, NULL, NULL, true, NULL, this, GetCasterGUID()); } diff --git a/src/game/Spells/Auras/SpellAuras.cpp b/src/game/Spells/Auras/SpellAuras.cpp index b1bdd291d..1d3c145d0 100644 --- a/src/game/Spells/Auras/SpellAuras.cpp +++ b/src/game/Spells/Auras/SpellAuras.cpp @@ -62,10 +62,14 @@ _flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disable _slot = slot; GetTarget()->SetVisibleAura(slot, this); SetNeedClientUpdate(); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); +#endif } else - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); +#endif } _InitFlags(caster, effMask); @@ -144,7 +148,9 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) ASSERT(aurEff); ASSERT(HasEffect(effIndex) == (!apply)); ASSERT((1<outDebug(LOG_FILTER_SPELLS_AURAS, "AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); +#endif if (apply) { @@ -2172,7 +2178,9 @@ void Aura::LoadScripts() m_loadedScripts.erase(bitr); continue; } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); +#endif (*itr)->Register(); ++itr; } diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 255283c61..226500785 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -959,7 +959,9 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar } break; case TARGET_SELECT_CATEGORY_NYI: - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: target type %u, found in spellID %u, effect %u is not implemented yet!", m_spellInfo->Id, effIndex, targetType.GetTarget()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: target type %u, found in spellID %u, effect %u is not implemented yet!", m_spellInfo->Id, effIndex, targetType.GetTarget()); +#endif break; default: ASSERT(false && "Spell::SelectEffectImplicitTargets: received not implemented select target category"); @@ -989,7 +991,9 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa AddUnitTarget(target->ToUnit(), 1 << effIndex); } else - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); +#endif break; } case TARGET_DEST_CHANNEL_TARGET: @@ -1002,7 +1006,9 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa m_targets.SetDst(*target); } else //if (!m_targets.HasDst()) - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex); +#endif break; case TARGET_DEST_CHANNEL_CASTER: if (GetOriginalCaster()) @@ -1048,7 +1054,9 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar // handle emergency case - try to use other provided targets if no conditions provided if (targetType.GetCheckType() == TARGET_CHECK_ENTRY && (!condList || condList->empty())) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: no conditions entry for target with TARGET_CHECK_ENTRY of spell ID %u, effect %u - selecting default targets", m_spellInfo->Id, effIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: no conditions entry for target with TARGET_CHECK_ENTRY of spell ID %u, effect %u - selecting default targets", m_spellInfo->Id, effIndex); +#endif switch (targetType.GetObjectType()) { case TARGET_OBJECT_TYPE_GOBJ: @@ -1075,7 +1083,9 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar WorldObject* target = SearchNearbyTarget(range, targetType.GetObjectType(), targetType.GetCheckType(), condList); if (!target) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); +#endif return; } @@ -1278,7 +1288,9 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici } else { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); +#endif if (WorldObject* target = m_targets.GetObjectTarget()) dest = SpellDestination(*target); } @@ -3097,7 +3109,9 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask) if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance)) { m_caster->CastSpell(unit, i->triggeredSpell, true); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id); +#endif // SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration // set duration of current aura to the triggered spell @@ -3397,7 +3411,9 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // set timer base at cast time ReSetTimer(); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::prepare: spell id %u source %u caster %d customCastFlags %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, _triggeredCastFlags, m_targets.GetTargetMask()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::prepare: spell id %u source %u caster %d customCastFlags %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, _triggeredCastFlags, m_targets.GetTargetMask()); +#endif //Containers for channeled spells have to be set //TODO:Apply this to all casted spells if needed @@ -3990,7 +4006,9 @@ void Spell::update(uint32 difftime) if (m_targets.GetUnitTargetGUID() && !m_targets.GetUnitTarget()) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u is cancelled due to removal of target.", m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u is cancelled due to removal of target.", m_spellInfo->Id); +#endif cancel(); return; } @@ -4048,7 +4066,9 @@ void Spell::update(uint32 difftime) // Xinef: so the aura can be removed in different updates for all units else if ((m_timer < 0 || m_timer > 300) && !UpdateChanneledTargetList()) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); +#endif SendChannelUpdate(0); finish(); } @@ -4112,7 +4132,9 @@ void Spell::finish(bool ok) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); if (spellInfo && spellInfo->SpellIconID == 2056) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); +#endif m_caster->setDeathState(JUST_DIED); return; } @@ -5148,7 +5170,9 @@ void Spell::HandleThreatSpells() else if (!m_spellInfo->_IsPositiveSpell() && !IsFriendly && target->CanHaveThreatList()) target->AddThreat(m_caster, threatToAdd, m_spellInfo->GetSchoolMask(), m_spellInfo); } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); +#endif } void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode) @@ -5161,7 +5185,9 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT uint8 eff = m_spellInfo->Effects[i].Effect; - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: %u Effect : %u", m_spellInfo->Id, eff); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: %u Effect : %u", m_spellInfo->Id, eff); +#endif // we do not need DamageMultiplier here. damage = CalculateSpellDamage(i, NULL); @@ -7161,7 +7187,9 @@ void Spell::Delayed() // only called in DealDamage() else m_timer += delaytime; - ;//sLog->outDetail("Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime); +#endif WorldPacket data(SMSG_SPELL_DELAYED, 8+4); data.append(m_caster->GetPackGUID()); @@ -7199,7 +7227,9 @@ void Spell::DelayedChannel() else m_timer -= delaytime; - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); +#endif for (std::list::const_iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) if ((*ihit).missCondition == SPELL_MISS_NONE) @@ -7856,7 +7886,9 @@ void Spell::LoadScripts() m_loadedScripts.erase(bitr); continue; } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::LoadScripts: Script `%s` for spell `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::LoadScripts: Script `%s` for spell `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); +#endif (*itr)->Register(); ++itr; } diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index b87ba7653..8f783d029 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -229,7 +229,9 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= void Spell::EffectNULL(SpellEffIndex /*effIndex*/) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Spell Effect DUMMY"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Spell Effect DUMMY"); +#endif } void Spell::EffectUnused(SpellEffIndex /*effIndex*/) @@ -767,7 +769,9 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } // normal DB scripted effect - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); +#endif m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); } @@ -901,7 +905,9 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); +#endif return; } @@ -957,7 +963,9 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); +#endif return; } @@ -1180,7 +1188,9 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) destTarget->GetPosition(x, y, z, orientation); if (!orientation && m_targets.GetUnitTarget()) orientation = m_targets.GetUnitTarget()->GetOrientation(); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); +#endif if (mapid == unitTarget->GetMapId()) { @@ -1333,7 +1343,9 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex) uint32 spellToUnlearn = m_spellInfo->Effects[effIndex].TriggerSpell; player->removeSpell(spellToUnlearn, SPEC_MASK_ALL, false); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); +#endif } void Spell::EffectPowerDrain(SpellEffIndex effIndex) @@ -1405,7 +1417,9 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) // TODO: there should be a possibility to pass dest target to event script } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->Effects[effIndex].MiscValue, m_spellInfo->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->Effects[effIndex].MiscValue, m_spellInfo->Id); +#endif if (ZoneScript* zoneScript = m_caster->GetZoneScript()) zoneScript->ProcessEvent(target, m_spellInfo->Effects[effIndex].MiscValue); @@ -1610,7 +1624,9 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); +#endif // xinef: handled in spell.cpp //float healMultiplier = m_spellInfo->Effects[effIndex].CalcValueMultiplier(m_originalCaster, this); @@ -1976,7 +1992,9 @@ void Spell::SendLoot(uint64 guid, LootType loottype) // Players shouldn't be able to loot gameobjects that are currently despawned if (!gameObjTarget->isSpawned() && !player->IsGameMaster()) { - ;//sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!", +#endif // player->GetName().c_str(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow()); return; } @@ -2038,7 +2056,9 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) if (m_caster->GetTypeId() != TYPEID_PLAYER) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No Player Caster!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No Player Caster!"); +#endif return; } @@ -2096,7 +2116,9 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) } else { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No GameObject/Item Target!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No GameObject/Item Target!"); +#endif return; } @@ -2498,7 +2520,9 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->Effects[effIndex].TriggerSpell; player->learnSpell(spellToLearn); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); +#endif } typedef std::list< std::pair > DispelList; @@ -2746,7 +2770,9 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) if (m_CastItem) { unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10, false); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow()); +#endif return; } @@ -2755,13 +2781,17 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) { uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward, false); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); +#endif } else { //maybe we have correct honor_gain in damage already unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage, false); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); +#endif } } @@ -4100,7 +4130,9 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } // normal DB scripted effect - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); +#endif m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); } @@ -5380,7 +5412,9 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) ExecuteLogEffectSummonObject(effIndex, pGameObj); - ;//sLog->outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted"); +#endif //m_caster->AddGameObject(pGameObj); //m_ObjToDel.push_back(pGameObj); @@ -5464,7 +5498,9 @@ void Spell::EffectSkill(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: SkillEFFECT"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: SkillEFFECT"); +#endif } /* There is currently no need for this effect. We handle it in Battleground.cpp @@ -5495,7 +5531,9 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: SkinPlayerCorpse"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: SkinPlayerCorpse"); +#endif if ((m_caster->GetTypeId() != TYPEID_PLAYER) || (unitTarget->GetTypeId() != TYPEID_PLAYER) || (unitTarget->IsAlive())) return; @@ -5507,7 +5545,9 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: StealBeneficialBuff"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: StealBeneficialBuff"); +#endif if (!unitTarget || unitTarget == m_caster) // can't steal from self return; @@ -6157,7 +6197,9 @@ void Spell::EffectBind(SpellEffIndex effIndex) data << uint32(areaId); player->SendDirectMessage(&data); - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u", +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u", +#endif // homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId); // zone update diff --git a/src/game/Spells/SpellInfo.cpp b/src/game/Spells/SpellInfo.cpp index be189de05..0dca3e572 100644 --- a/src/game/Spells/SpellInfo.cpp +++ b/src/game/Spells/SpellInfo.cpp @@ -2365,7 +2365,9 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, S break; case POWER_RUNE: case POWER_RUNIC_POWER: - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!"); +#endif break; default: sLog->outError("CalculateManaCost: Unknown power type '%d' in spell %d", PowerType, Id); diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index 8b524c9cf..6e0dafc7f 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -490,13 +490,17 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con SpellDifficultyEntry const* difficultyEntry = sSpellDifficultyStore.LookupEntry(difficultyId); if (!difficultyEntry) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId); +#endif return spellId; //return source spell } if (difficultyEntry->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is NULL, using mode %u", spellId, mode, mode - 2); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is NULL, using mode %u", spellId, mode, mode - 2); +#endif mode -= 2; } @@ -506,7 +510,9 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con return spellId; } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]); +#endif return uint32(difficultyEntry->SpellID[mode]); } @@ -516,11 +522,15 @@ SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell SpellInfo const* newSpell = GetSpellInfo(newSpellId); if (!newSpell) { - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellForDifficultyFromSpell: spell %u not found. Check spelldifficulty_dbc!", newSpellId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellForDifficultyFromSpell: spell %u not found. Check spelldifficulty_dbc!", newSpellId); +#endif return spell; } - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is %u (original %u)", newSpell->Id, spell->Id); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is %u (original %u)", newSpell->Id, spell->Id); +#endif return newSpell; } @@ -1546,7 +1556,9 @@ void SpellMgr::LoadSpellTargetPositions() if (found) { if (!sSpellMgr->GetSpellTargetPosition(i)) - ;//sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) does not have record in `spell_target_position`", i); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) does not have record in `spell_target_position`", i); +#endif } }*/ diff --git a/src/game/Texts/CreatureTextMgr.cpp b/src/game/Texts/CreatureTextMgr.cpp index 94ff6cf68..c1f475f35 100644 --- a/src/game/Texts/CreatureTextMgr.cpp +++ b/src/game/Texts/CreatureTextMgr.cpp @@ -429,7 +429,9 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry); if (sList == mTextMap.end()) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); +#endif return false; } @@ -437,7 +439,9 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); if (itr == textHolder.end()) { - ;//sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry); +#endif return false; } diff --git a/src/game/Warden/Warden.cpp b/src/game/Warden/Warden.cpp index 11170ba07..0676b03c2 100644 --- a/src/game/Warden/Warden.cpp +++ b/src/game/Warden/Warden.cpp @@ -36,7 +36,9 @@ Warden::~Warden() void Warden::SendModuleToClient() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Send module to client"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Send module to client"); +#endif // Create packet structure WardenModuleTransfer packet; @@ -62,7 +64,9 @@ void Warden::SendModuleToClient() void Warden::RequestModule() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request module"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request module"); +#endif // Create packet structure WardenModuleUse request; @@ -125,12 +129,16 @@ bool Warden::IsValidCheckSum(uint32 checksum, const uint8* data, const uint16 le if (checksum != newChecksum) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS NOT VALID"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS NOT VALID"); +#endif return false; } else { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS VALID"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS VALID"); +#endif return true; } } @@ -237,7 +245,9 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->DecryptData(recvData.contents(), recvData.size()); uint8 opcode; recvData >> opcode; - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); +#endif recvData.hexlike(); switch (opcode) @@ -252,17 +262,23 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->HandleData(recvData); break; case WARDEN_CMSG_MEM_CHECKS_RESULT: - ;//sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MEM_CHECKS_RESULT received!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MEM_CHECKS_RESULT received!"); +#endif break; case WARDEN_CMSG_HASH_RESULT: _warden->HandleHashResult(recvData); _warden->InitializeModule(); break; case WARDEN_CMSG_MODULE_FAILED: - ;//sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); +#endif break; default: - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, uint32(recvData.size() - 1)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, uint32(recvData.size() - 1)); +#endif break; } } diff --git a/src/game/Warden/WardenMac.cpp b/src/game/Warden/WardenMac.cpp index 27f697263..a733ce38d 100644 --- a/src/game/Warden/WardenMac.cpp +++ b/src/game/Warden/WardenMac.cpp @@ -46,16 +46,30 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K) _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", pClient->GetAccountId()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", pClient->GetAccountId()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); +#endif _module = GetModuleForClient(); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); +#endif RequestModule(); } @@ -82,12 +96,16 @@ ClientWardenModule* WardenMac::GetModuleForClient() void WardenMac::InitializeModule() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); +#endif } void WardenMac::RequestHash() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); +#endif // Create packet structure WardenHashRequest Request; @@ -155,12 +173,16 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); +#endif Penalty(); return; } - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); +#endif // client 7F96EEFDA5B63D20A4DF8E00CBF48304 //const uint8 client_key[16] = { 0x7F, 0x96, 0xEE, 0xFD, 0xA5, 0xB6, 0x3D, 0x20, 0xA4, 0xDF, 0x8E, 0x00, 0xCB, 0xF4, 0x83, 0x04 }; @@ -182,7 +204,9 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) void WardenMac::RequestData() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); +#endif ByteBuffer buff; buff << uint8(WARDEN_SMSG_CHEAT_CHECKS_REQUEST); @@ -206,7 +230,9 @@ void WardenMac::RequestData() void WardenMac::HandleData(ByteBuffer &buff) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); +#endif _dataSent = false; _clientResponseTimer = 0; @@ -239,7 +265,9 @@ void WardenMac::HandleData(ByteBuffer &buff) if (memcmp(sha1Hash, sha1.GetDigest(), 20)) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: SHA1 hash is wrong!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: SHA1 hash is wrong!"); +#endif //found = true; } @@ -254,7 +282,9 @@ void WardenMac::HandleData(ByteBuffer &buff) if (memcmp(ourMD5Hash, theirsMD5Hash, 16)) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: MD5 hash is wrong!"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: MD5 hash is wrong!"); +#endif //found = true; } diff --git a/src/game/Warden/WardenWin.cpp b/src/game/Warden/WardenWin.cpp index 13c8a77cd..288804272 100644 --- a/src/game/Warden/WardenWin.cpp +++ b/src/game/Warden/WardenWin.cpp @@ -53,16 +53,30 @@ void WardenWin::Init(WorldSession* session, BigNumber *k) _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", session->GetAccountId()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", session->GetAccountId()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); +#endif _module = GetModuleForClient(); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); +#endif RequestModule(); } @@ -89,7 +103,9 @@ ClientWardenModule* WardenWin::GetModuleForClient() void WardenWin::InitializeModule() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); +#endif // Create packet structure WardenInitModuleRequest Request; @@ -133,7 +149,9 @@ void WardenWin::InitializeModule() void WardenWin::RequestHash() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); +#endif // Create packet structure WardenHashRequest Request; @@ -155,12 +173,16 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); +#endif Penalty(); return; } - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); +#endif // Change keys here memcpy(_inputKey, Module.ClientKeySeed, 16); @@ -176,7 +198,9 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) void WardenWin::RequestData() { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); +#endif // If all checks were done, fill the todo list again if (_memChecksTodo.empty()) @@ -326,12 +350,16 @@ void WardenWin::RequestData() for (std::list::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) stream << *itr << " "; - ;//sLog->outDebug(LOG_FILTER_WARDEN, "%s", stream.str().c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "%s", stream.str().c_str()); +#endif } void WardenWin::HandleData(ByteBuffer &buff) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); +#endif _dataSent = false; _clientResponseTimer = 0; @@ -344,7 +372,9 @@ void WardenWin::HandleData(ByteBuffer &buff) if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length)) { buff.rpos(buff.wpos()); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL"); +#endif Penalty(); return; } @@ -356,7 +386,9 @@ void WardenWin::HandleData(ByteBuffer &buff) // TODO: test it. if (result == 0x00) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00"); +#endif Penalty(); return; } @@ -367,10 +399,18 @@ void WardenWin::HandleData(ByteBuffer &buff) uint32 ticksNow = World::GetGameTimeMS(); uint32 ourTicks = newClientTicks + (ticksNow - _serverTicks); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "ServerTicks %u", ticksNow); // Now - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RequestTicks %u", _serverTicks); // At request - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Ticks %u", newClientTicks); // At response - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "ServerTicks %u", ticksNow); // Now +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RequestTicks %u", _serverTicks); // At request +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Ticks %u", newClientTicks); // At response +#endif +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); +#endif } WardenCheckResult *rs; @@ -395,21 +435,27 @@ void WardenWin::HandleData(ByteBuffer &buff) if (Mem_Result != 0) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK not 0x00, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK not 0x00, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif checkFailed = *itr; continue; } if (memcmp(buff.contents() + buff.rpos(), rs->Result.AsByteArray(0, false).get(), rd->Length) != 0) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK fail CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK fail CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif checkFailed = *itr; buff.rpos(buff.rpos() + rd->Length); continue; } buff.rpos(buff.rpos() + rd->Length); - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif break; } case PAGE_CHECK_A: @@ -421,11 +467,17 @@ void WardenWin::HandleData(ByteBuffer &buff) if (memcmp(buff.contents() + buff.rpos(), &byte, sizeof(uint8)) != 0) { /*if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif if (type == MODULE_CHECK) - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif if (type == DRIVER_CHECK) - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId());*/ +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId());*/ +#endif checkFailed = *itr; buff.rpos(buff.rpos() + 1); continue; @@ -433,11 +485,17 @@ void WardenWin::HandleData(ByteBuffer &buff) buff.rpos(buff.rpos() + 1); /*if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif else if (type == MODULE_CHECK) - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif else if (type == DRIVER_CHECK) - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId());*/ +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId());*/ +#endif break; } case LUA_STR_CHECK: @@ -447,7 +505,9 @@ void WardenWin::HandleData(ByteBuffer &buff) if (Lua_Result != 0) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif checkFailed = *itr; continue; } @@ -460,11 +520,15 @@ void WardenWin::HandleData(ByteBuffer &buff) char *str = new char[luaStrLen + 1]; memcpy(str, buff.contents() + buff.rpos(), luaStrLen); str[luaStrLen] = '\0'; // null terminator - ;//sLog->outDebug(LOG_FILTER_WARDEN, "Lua string: %s", str); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "Lua string: %s", str); +#endif delete[] str; } buff.rpos(buff.rpos() + luaStrLen); // Skip string - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif break; } case MPQ_CHECK: @@ -474,21 +538,27 @@ void WardenWin::HandleData(ByteBuffer &buff) if (Mpq_Result != 0) { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK not 0x00 account id %u", _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK not 0x00 account id %u", _session->GetAccountId()); +#endif checkFailed = *itr; continue; } if (memcmp(buff.contents() + buff.rpos(), rs->Result.AsByteArray(0, false).get(), 20) != 0) // SHA1 { - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif checkFailed = *itr; buff.rpos(buff.rpos() + 20); // 20 bytes SHA1 continue; } buff.rpos(buff.rpos() + 20); // 20 bytes SHA1 - ;//sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); +#endif break; } default: // Should never happen diff --git a/src/game/Weather/Weather.cpp b/src/game/Weather/Weather.cpp index b40f2c806..d8f945a91 100644 --- a/src/game/Weather/Weather.cpp +++ b/src/game/Weather/Weather.cpp @@ -26,7 +26,9 @@ Weather::Weather(uint32 zone, WeatherData const* weatherChances) m_type = WEATHER_TYPE_FINE; m_grade = 0; - ;//sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS))); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS))); +#endif } /// Launch a weather update @@ -87,7 +89,9 @@ bool Weather::ReGenerate() static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" }; - ;//sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); +#endif if ((u < 60) && (m_grade < 0.33333334f)) // Get fair { @@ -252,7 +256,9 @@ bool Weather::UpdateWeather() wthstr = "fine"; break; } - ;//sLog->outDetail("Change the weather of zone %u to %s.", m_zone, wthstr); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Change the weather of zone %u to %s.", m_zone, wthstr); +#endif sScriptMgr->OnWeatherChange(this, state, m_grade); return true; } diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp index 21f30b787..204056ba5 100644 --- a/src/game/World/World.cpp +++ b/src/game/World/World.cpp @@ -2097,7 +2097,9 @@ void World::Update(uint32 diff) if (m_timers[WUPDATE_PINGDB].Passed()) { m_timers[WUPDATE_PINGDB].Reset(); - ;//sLog->outDetail("Ping MySQL to keep connection alive"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Ping MySQL to keep connection alive"); +#endif CharacterDatabase.KeepAlive(); LoginDatabase.KeepAlive(); WorldDatabase.KeepAlive(); @@ -2567,7 +2569,9 @@ void World::ShutdownMsg(bool show, Player* player) ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME; SendServerMessage(msgid, str.c_str(), player); - ;//sLog->outStaticDebug("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str()); +#endif } } @@ -2585,7 +2589,9 @@ void World::ShutdownCancel() m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value SendServerMessage(msgid); - ;//sLog->outStaticDebug("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); +#endif sScriptMgr->OnShutdownCancel(); } @@ -2679,7 +2685,9 @@ void World::ProcessCliCommands() CliCommandHolder* command = NULL; while (cliCmdQueue.next(command)) { - ;//sLog->outDetail("CLI command under processing..."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("CLI command under processing..."); +#endif zprint = command->m_print; callbackArg = command->m_callbackArg; CliHandler handler(callbackArg, zprint); @@ -2747,7 +2755,9 @@ void World::SendAutoBroadcast() sWorld->SendGlobalMessage(&data); } - ;//sLog->outDetail("AutoBroadcast: '%s'", msg.c_str()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("AutoBroadcast: '%s'", msg.c_str()); +#endif } void World::UpdateRealmCharCount(uint32 accountId) @@ -2947,7 +2957,9 @@ void World::ResetEventSeasonalQuests(uint16 event_id) void World::ResetRandomBG() { - ;//sLog->outDetail("Random BG status reset for all characters."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Random BG status reset for all characters."); +#endif PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BATTLEGROUND_RANDOM); CharacterDatabase.Execute(stmt); diff --git a/src/scripts/Commands/cs_misc.cpp b/src/scripts/Commands/cs_misc.cpp index 6fadd18e7..715acec47 100644 --- a/src/scripts/Commands/cs_misc.cpp +++ b/src/scripts/Commands/cs_misc.cpp @@ -1510,7 +1510,9 @@ public: if (!playerTarget) playerTarget = player; - ;//sLog->outDetail(handler->GetTrinityString(LANG_ADDITEM), itemId, count); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail(handler->GetTrinityString(LANG_ADDITEM), itemId, count); +#endif ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemId); if (!itemTemplate) @@ -1597,7 +1599,9 @@ public: if (!playerTarget) playerTarget = player; - ;//sLog->outDetail(handler->GetTrinityString(LANG_ADDITEMSET), itemSetId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail(handler->GetTrinityString(LANG_ADDITEMSET), itemSetId); +#endif bool found = false; ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); diff --git a/src/scripts/Commands/cs_modify.cpp b/src/scripts/Commands/cs_modify.cpp index d05078869..ee4d499c4 100644 --- a/src/scripts/Commands/cs_modify.cpp +++ b/src/scripts/Commands/cs_modify.cpp @@ -190,7 +190,9 @@ public: target->SetMaxPower(POWER_ENERGY, energym); target->SetPower(POWER_ENERGY, energy); - ;//sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY)); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY)); +#endif return true; } @@ -1016,7 +1018,9 @@ public: { int32 newmoney = int32(targetMoney) + moneyToAdd; - ;//sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney); +#endif if (newmoney <= 0) { handler->PSendSysMessage(LANG_YOU_TAKE_ALL_MONEY, handler->GetNameLink(target).c_str()); @@ -1051,7 +1055,9 @@ public: target->ModifyMoney(moneyToAdd); } - ;//sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney()); +#endif return true; } diff --git a/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 994adff12..0eedf609b 100644 --- a/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -206,7 +206,9 @@ public: void SetData64(uint32 type, uint64 data) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); +#endif switch (type) { @@ -222,7 +224,9 @@ public: void SetData(uint32 type, uint32 data) { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); +#endif switch (type) { diff --git a/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 5c4d39e78..6548faecf 100644 --- a/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -228,7 +228,9 @@ public: void PrepareEncounter() { - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); +#endif uint8 index = 0; uint8 count = 0; diff --git a/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 36f711405..4b27e4c72 100644 --- a/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -240,7 +240,9 @@ public: { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); +#endif } else { diff --git a/src/scripts/Outland/zone_netherstorm.cpp b/src/scripts/Outland/zone_netherstorm.cpp index be0adb838..45574e3a3 100644 --- a/src/scripts/Outland/zone_netherstorm.cpp +++ b/src/scripts/Outland/zone_netherstorm.cpp @@ -416,7 +416,9 @@ public: return true; } - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait."); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait."); +#endif return false; } diff --git a/src/scripts/World/npc_professions.cpp b/src/scripts/World/npc_professions.cpp index 7daab5d30..28757c505 100644 --- a/src/scripts/World/npc_professions.cpp +++ b/src/scripts/World/npc_professions.cpp @@ -227,7 +227,9 @@ bool EquippedOk(Player* player, uint32 spellId) if (item && item->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first - ;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); +#endif return false; } } diff --git a/src/worldserver/RemoteAccess/RARunnable.cpp b/src/worldserver/RemoteAccess/RARunnable.cpp index da2467c99..220384b10 100644 --- a/src/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/worldserver/RemoteAccess/RARunnable.cpp @@ -69,5 +69,7 @@ void RARunnable::run() break; } - ;//sLog->outStaticDebug("Trinity RA thread exiting"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outStaticDebug("Trinity RA thread exiting"); +#endif } diff --git a/src/worldserver/TCSoap/TCSoap.cpp b/src/worldserver/TCSoap/TCSoap.cpp index 3c6a32fff..c0a554a1d 100644 --- a/src/worldserver/TCSoap/TCSoap.cpp +++ b/src/worldserver/TCSoap/TCSoap.cpp @@ -34,7 +34,9 @@ void TCSoapRunnable::run() if (!soap_valid_socket(soap_accept(&soap))) continue; // ran into an accept timeout - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); +#endif struct soap* thread_soap = soap_copy(&soap);// make a safe copy ACE_Message_Block* mb = new ACE_Message_Block(sizeof(struct soap*)); @@ -69,33 +71,43 @@ int ns1__executeCommand(soap* soap, char* command, char** result) // security check if (!soap->userid || !soap->passwd) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client didn't provide login information"); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client didn't provide login information"); +#endif return 401; } uint32 accountId = AccountMgr::GetId(soap->userid); if (!accountId) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client used invalid username '%s'", soap->userid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client used invalid username '%s'", soap->userid); +#endif return 401; } if (!AccountMgr::CheckPassword(accountId, soap->passwd)) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: invalid password for account '%s'", soap->userid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: invalid password for account '%s'", soap->userid); +#endif return 401; } if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR) { - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: %s's gmlevel is too low", soap->userid); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: %s's gmlevel is too low", soap->userid); +#endif return 403; } if (!command || !*command) return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string"); - ;//sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: got command '%s'", command); +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: got command '%s'", command); +#endif SOAPCommand connection; // commands are executed in the world thread. We have to wait for them to be completed From f794ad2acfd8156ffe60ea5df1233ff5bb63be53 Mon Sep 17 00:00:00 2001 From: Barbz Date: Fri, 30 Jun 2017 18:16:17 +0200 Subject: [PATCH 48/51] Fixed these 3 fatal errors for travis build (thanks to @Talamortis ) # Conflicts: # src/authserver/Server/AuthSocket.cpp # src/game/AI/SmartScripts/SmartScript.cpp --- src/authserver/Server/AuthSocket.cpp | 5 ++--- src/game/AI/CreatureAISelector.cpp | 2 +- src/game/AI/SmartScripts/SmartScript.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/authserver/Server/AuthSocket.cpp b/src/authserver/Server/AuthSocket.cpp index d53f7fcc4..763114079 100644 --- a/src/authserver/Server/AuthSocket.cpp +++ b/src/authserver/Server/AuthSocket.cpp @@ -547,11 +547,10 @@ bool AuthSocket::_HandleLogonChallenge() for (int i = 0; i < 4; ++i) _localizationName[i] = ch->country[4-i-1]; + #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), + sLog->outDebug( LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) ); #endif - // _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) - // ); ///- All good, await client's proof _status = STATUS_LOGON_PROOF; diff --git a/src/game/AI/CreatureAISelector.cpp b/src/game/AI/CreatureAISelector.cpp index e45097b7a..cde8e0b81 100644 --- a/src/game/AI/CreatureAISelector.cpp +++ b/src/game/AI/CreatureAISelector.cpp @@ -134,7 +134,7 @@ namespace FactorySelector //future goAI types go here // xinef: unused - //std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); + std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); diff --git a/src/game/AI/SmartScripts/SmartScript.cpp b/src/game/AI/SmartScripts/SmartScript.cpp index 527c9c669..9eceda60b 100644 --- a/src/game/AI/SmartScripts/SmartScript.cpp +++ b/src/game/AI/SmartScripts/SmartScript.cpp @@ -144,8 +144,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (unit) mLastInvoker = unit->GetGUID(); - //if (Unit* tempInvoker = GetLastInvoker()) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + if (Unit* tempInvoker = GetLastInvoker()) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName().c_str(), tempInvoker->GetGUIDLow()); #endif From bf80a43d7861e6d53946e156b80ed5be3f2a2127 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 19 Aug 2017 20:31:24 +0200 Subject: [PATCH 49/51] Fixed travis build errors with Talamortis. # Conflicts: # src/authserver/Server/AuthSocket.cpp # src/game/AI/SmartScripts/SmartScript.cpp # src/game/Calendar/CalendarMgr.cpp # src/game/Chat/Channels/Channel.cpp # src/game/Conditions/ConditionMgr.cpp # src/game/DungeonFinding/LFGMgr.cpp # src/game/DungeonFinding/LFGScripts.cpp # src/game/Entities/Player/Player.cpp # src/game/Entities/Unit/Unit.cpp # src/game/Entities/Vehicle/Vehicle.cpp # src/game/Guilds/Guild.cpp # src/game/Handlers/ChannelHandler.cpp # src/game/Handlers/GuildHandler.cpp # src/game/Handlers/LFGHandler.cpp # src/game/Handlers/LootHandler.cpp # src/game/Handlers/MailHandler.cpp # src/game/Handlers/MiscHandler.cpp # src/game/Handlers/NPCHandler.cpp # src/game/Handlers/PetHandler.cpp # src/game/Handlers/PetitionsHandler.cpp # src/game/Handlers/QueryHandler.cpp # src/game/Handlers/QuestHandler.cpp # src/game/Movement/MotionMaster.cpp # src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp # src/game/Server/WorldSession.cpp # src/game/Server/WorldSocket.cpp # src/game/Spells/SpellEffects.cpp # src/scripts/Commands/cs_modify.cpp --- src/authserver/Server/AuthSocket.cpp | 3 +-- src/game/AI/SmartScripts/SmartScript.cpp | 6 ++---- src/game/Battlegrounds/Battleground.cpp | 3 ++- src/game/Chat/Channels/Channel.cpp | 4 +--- src/game/Conditions/ConditionMgr.cpp | 6 ++---- src/game/DungeonFinding/LFGMgr.cpp | 2 +- src/game/DungeonFinding/LFGScripts.cpp | 6 ++---- src/game/Entities/Player/Player.cpp | 6 ++---- src/game/Entities/Unit/Unit.cpp | 2 +- src/game/Entities/Vehicle/Vehicle.cpp | 6 ++---- src/game/Guilds/Guild.cpp | 6 ++---- src/game/Handlers/ChannelHandler.cpp | 4 +--- src/game/Handlers/GuildHandler.cpp | 4 +--- src/game/Handlers/LFGHandler.cpp | 2 +- src/game/Handlers/LootHandler.cpp | 2 +- src/game/Handlers/MailHandler.cpp | 6 ++---- src/game/Handlers/MiscHandler.cpp | 4 +--- src/game/Handlers/NPCHandler.cpp | 6 ++---- src/game/Handlers/PetHandler.cpp | 6 ++---- src/game/Handlers/PetitionsHandler.cpp | 7 ++++--- src/game/Handlers/QueryHandler.cpp | 6 ++---- src/game/Handlers/QuestHandler.cpp | 6 ++---- src/game/Movement/MotionMaster.cpp | 6 ++---- .../MovementGenerators/WaypointMovementGenerator.cpp | 2 +- src/game/Server/WorldSession.cpp | 4 +--- src/game/Server/WorldSocket.cpp | 8 +------- src/game/Spells/SpellEffects.cpp | 6 ++---- 27 files changed, 44 insertions(+), 85 deletions(-) diff --git a/src/authserver/Server/AuthSocket.cpp b/src/authserver/Server/AuthSocket.cpp index 763114079..71ea08629 100644 --- a/src/authserver/Server/AuthSocket.cpp +++ b/src/authserver/Server/AuthSocket.cpp @@ -754,9 +754,8 @@ bool AuthSocket::_HandleLogonProof() LoginDatabase.Execute(stmt); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", + sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); #endif - // socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); } else { diff --git a/src/game/AI/SmartScripts/SmartScript.cpp b/src/game/AI/SmartScripts/SmartScript.cpp index 9eceda60b..d7c1d0af1 100644 --- a/src/game/AI/SmartScripts/SmartScript.cpp +++ b/src/game/AI/SmartScripts/SmartScript.cpp @@ -194,10 +194,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u mUseTextTimer = true; sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u", -#endif - // talker->GetName().c_str(), talker->GetGUIDLow(), GUID_LOPART(mTextGUID)); - break; + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u", talker->GetName().c_str(), talker->GetGUIDLow(), GUID_LOPART(mTextGUID)); +#endif break; } case SMART_ACTION_SIMPLE_TALK: { diff --git a/src/game/Battlegrounds/Battleground.cpp b/src/game/Battlegrounds/Battleground.cpp index 8f6483540..f178f0304 100644 --- a/src/game/Battlegrounds/Battleground.cpp +++ b/src/game/Battlegrounds/Battleground.cpp @@ -289,6 +289,7 @@ inline void Battleground::_CheckSafePositions(uint32 diff) m_ValidStartPositionTimer = 0; Position pos; + Player* player; float x, y, z, o; for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr) { @@ -1919,4 +1920,4 @@ void Battleground::RewardXPAtKill(Player* killer, Player* victim) uint8 Battleground::GetUniqueBracketId() const { return GetMinLevel() / 10; -} \ No newline at end of file +} diff --git a/src/game/Chat/Channels/Channel.cpp b/src/game/Chat/Channels/Channel.cpp index 93d20b194..ff1615da9 100644 --- a/src/game/Chat/Channels/Channel.cpp +++ b/src/game/Chat/Channels/Channel.cpp @@ -685,10 +685,8 @@ void Channel::List(Player const* player) } #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_CHATSYS, "SMSG_CHANNEL_LIST %s Channel: %s", + sLog->outDebug(LOG_FILTER_CHATSYS, "SMSG_CHANNEL_LIST %s Channel: %s", player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str()); #endif - // player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str()); - WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+playersStore.size()*(8+1)); data << uint8(1); // channel type? data << GetName(); // channel name diff --git a/src/game/Conditions/ConditionMgr.cpp b/src/game/Conditions/ConditionMgr.cpp index 6857fcb9c..ba2ded825 100644 --- a/src/game/Conditions/ConditionMgr.cpp +++ b/src/game/Conditions/ConditionMgr.cpp @@ -658,10 +658,8 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_CONDITIONSYS, "IsPlayerMeetToConditionList: Reference template -%u not found", -#endif - // (*i)->ReferenceId);//checked at loading, should never happen - } + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->ReferenceId); +#endif } } else //handle normal condition diff --git a/src/game/DungeonFinding/LFGMgr.cpp b/src/game/DungeonFinding/LFGMgr.cpp index c427de3bf..625780945 100644 --- a/src/game/DungeonFinding/LFGMgr.cpp +++ b/src/game/DungeonFinding/LFGMgr.cpp @@ -617,7 +617,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const if (joinData.result != LFG_JOIN_OK) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); #endif if (!dungeons.empty()) // Only should show lockmap when have no dungeons available joinData.lockmap.clear(); diff --git a/src/game/DungeonFinding/LFGScripts.cpp b/src/game/DungeonFinding/LFGScripts.cpp index 37424a65c..abb0710df 100644 --- a/src/game/DungeonFinding/LFGScripts.cpp +++ b/src/game/DungeonFinding/LFGScripts.cpp @@ -103,10 +103,8 @@ void LFGPlayerScript::OnMapChanged(Player* player) player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, 0.0f); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outError(LOG_FILTER_LFG, "LFGPlayerScript::OnMapChanged, Player %s (%u) is in LFG dungeon map but does not have a valid group! " -#endif - // "Teleporting to homebind.", player->GetName().c_str(), player->GetGUIDLow()); - return; + sLog->outDebug(LOG_FILTER_LFG, "LFGPlayerScript::OnMapChanged, Player %s (%u) is in LFG dungeon map but does not have a valid group! Teleporting to homebind.", player->GetName().c_str(), player->GetGUIDLow()); +#endif return; } for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) diff --git a/src/game/Entities/Player/Player.cpp b/src/game/Entities/Player/Player.cpp index 462eef692..db7c41e3f 100644 --- a/src/game/Entities/Player/Player.cpp +++ b/src/game/Entities/Player/Player.cpp @@ -2917,10 +2917,8 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes return go; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_MAPS, "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), -#endif - // go->GetGUIDLow(), GetName().c_str(), GetGUIDLow(), go->GetDistance(this)); - } + sLog->outDebug(LOG_FILTER_MAPS, "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), go->GetGUIDLow(), GetName().c_str(), GetGUIDLow(), go->GetDistance(this)); +#endif } } return NULL; } diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index 9740fc2c1..fb7cb42b3 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -2310,7 +2310,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && roll < (sum += tmp)) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp2, sum); + sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp, sum); #endif return MELEE_HIT_PARRY; } diff --git a/src/game/Entities/Vehicle/Vehicle.cpp b/src/game/Entities/Vehicle/Vehicle.cpp index bf1dafee1..5d61c40a9 100644 --- a/src/game/Entities/Vehicle/Vehicle.cpp +++ b/src/game/Entities/Vehicle/Vehicle.cpp @@ -310,10 +310,8 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) if (_status == STATUS_UNINSTALLING) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", -#endif - // unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); - return false; + sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); +#endif return false; } if (unit->GetVehicle() != this) diff --git a/src/game/Guilds/Guild.cpp b/src/game/Guilds/Guild.cpp index f332ad6cf..e80f36134 100644 --- a/src/game/Guilds/Guild.cpp +++ b/src/game/Guilds/Guild.cpp @@ -93,10 +93,8 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil session->SendPacket(&data); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_COMMAND_RESULT [%s]: Type: %u, code: %u, param: %s" -#endif - // , session->GetPlayerInfo().c_str(), type, errCode, param.c_str()); -} + sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_COMMAND_RESULT [%s]: Type: %u, code: %u, param: %s", session->GetPlayerInfo().c_str(), type, errCode, param.c_str()); +#endif} void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode) { diff --git a/src/game/Handlers/ChannelHandler.cpp b/src/game/Handlers/ChannelHandler.cpp index 70b2618e3..58c2819cc 100644 --- a/src/game/Handlers/ChannelHandler.cpp +++ b/src/game/Handlers/ChannelHandler.cpp @@ -19,10 +19,8 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) recvPacket >> channelId >> unknown1 >> unknown2 >> channelName >> password; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", + sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", GetPlayerInfo().c_str(), channelId, unknown1, unknown2, channelName.c_str(), password.c_str()); #endif - // GetPlayerInfo().c_str(), channelId, unknown1, unknown2, channelName.c_str(), password.c_str()); - if (channelId) { ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channelId); diff --git a/src/game/Handlers/GuildHandler.cpp b/src/game/Handlers/GuildHandler.cpp index 72aa595ea..6a4c3ad47 100644 --- a/src/game/Handlers/GuildHandler.cpp +++ b/src/game/Handlers/GuildHandler.cpp @@ -191,10 +191,8 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) recvPacket >> playerName >> note; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s", + sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s", GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); #endif - // GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); - if (normalizePlayerName(playerName)) if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleSetMemberNote(this, playerName, note, true); diff --git a/src/game/Handlers/LFGHandler.cpp b/src/game/Handlers/LFGHandler.cpp index f8ca38008..f2d685232 100644 --- a/src/game/Handlers/LFGHandler.cpp +++ b/src/game/Handlers/LFGHandler.cpp @@ -91,7 +91,7 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/) uint64 gguid = group ? group->GetGUID() : guid; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", guid, grp ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", guid, group ? 1 : 0); #endif // Check cheating - only leader can leave the queue diff --git a/src/game/Handlers/LootHandler.cpp b/src/game/Handlers/LootHandler.cpp index dae205d97..e18f6127e 100644 --- a/src/game/Handlers/LootHandler.cpp +++ b/src/game/Handlers/LootHandler.cpp @@ -297,7 +297,7 @@ void WorldSession::DoLootRelease(uint64 lguid) if (go->GetGoType() == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.eventId) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId, gameObjTarget->GetDBTableGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", go->getLevelForTarget->GetGOInfo()->chest.eventId, go->getLevelForTarget->GetDBTableGUIDLow()); #endif player->GetMap()->ScriptsStart(sEventScripts, go->GetGOInfo()->chest.eventId, player, go); } diff --git a/src/game/Handlers/MailHandler.cpp b/src/game/Handlers/MailHandler.cpp index 2debf09c3..3e6792ea5 100644 --- a/src/game/Handlers/MailHandler.cpp +++ b/src/game/Handlers/MailHandler.cpp @@ -102,10 +102,8 @@ void WorldSession::HandleSendMail(WorldPacket & recvData) if (!rc) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", -#endif - // player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); - player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); + sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); +#endif player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); return; } diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 3af18fd58..2fa32ba9e 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -657,10 +657,8 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) return; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", GetPlayer()->GetName().c_str(), ignoreName.c_str()); #endif - // GetPlayer()->GetName().c_str(), ignoreName.c_str()); - uint32 lowGuid = sWorld->GetGlobalPlayerGUID(ignoreName); if (!lowGuid) return; diff --git a/src/game/Handlers/NPCHandler.cpp b/src/game/Handlers/NPCHandler.cpp index 8e87dc467..18d055657 100644 --- a/src/game/Handlers/NPCHandler.cpp +++ b/src/game/Handlers/NPCHandler.cpp @@ -152,10 +152,8 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!trainer_spells) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", -#endif - // GUID_LOPART(guid), unit->GetEntry()); - return; + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", GUID_LOPART(guid), unit->GetEntry()); +#endif return; } WorldPacket data(SMSG_TRAINER_LIST, 8+4+4+trainer_spells->spellList.size()*38 + strTitle.size()+1); diff --git a/src/game/Handlers/PetHandler.cpp b/src/game/Handlers/PetHandler.cpp index 9ff4d2738..bbd9fcbd7 100644 --- a/src/game/Handlers/PetHandler.cpp +++ b/src/game/Handlers/PetHandler.cpp @@ -363,10 +363,8 @@ void WorldSession::HandleDismissCritter(WorldPacket &recvData) if (!pet) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", -#endif - // uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), GetAccountId()); - return; + sLog->outDebug(LOG_FILTER_NETWORKIO, "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), GetAccountId()); +#endif return; } if (_player->GetCritterGUID() == pet->GetGUID()) diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index 8aaed09d5..0e87f23f1 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -209,14 +209,15 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) // datacorruption Petition const* petition = sPetitionMgr->GetPetitionByOwnerWithType(_player->GetGUIDLow(), type); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", ssInvalidPetitionGUIDs.str().c_str()); -#endif CharacterDatabase.EscapeString(name); SQLTransaction trans = CharacterDatabase.BeginTransaction(); if (petition) { +#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", petition.str().c_str()); +#endif + trans->PAppend("DELETE FROM petition WHERE petitionguid = %u", petition->petitionGuid); trans->PAppend("DELETE FROM petition_sign WHERE petitionguid = %u", petition->petitionGuid); // xinef: clear petition store diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index fc12e0b92..3b341d0d6 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -136,10 +136,8 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recvData) else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", -#endif - // GUID_LOPART(guid), entry); - WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entry); +#endif WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS diff --git a/src/game/Handlers/QuestHandler.cpp b/src/game/Handlers/QuestHandler.cpp index b1b1e4f73..4b783e3db 100644 --- a/src/game/Handlers/QuestHandler.cpp +++ b/src/game/Handlers/QuestHandler.cpp @@ -77,10 +77,8 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData) if (!creature) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", -#endif - // GUID_LOPART(guid)); - return; + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guid)); +#endif return; } // remove fake death diff --git a/src/game/Movement/MotionMaster.cpp b/src/game/Movement/MotionMaster.cpp index f6a35c90b..829fd75c8 100644 --- a/src/game/Movement/MotionMaster.cpp +++ b/src/game/Movement/MotionMaster.cpp @@ -284,10 +284,8 @@ void MotionMaster::MoveConfused() else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow()); - Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); + sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused", _owner->GetEntry(), _owner->GetGUIDLow()); +#endif Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } } diff --git a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index f21e1989b..17b10e81b 100644 --- a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -442,7 +442,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry if (uint32 eventid = departure ? node->departureEventID : node->arrivalEventID) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node.index, node.path, player.GetName().c_str()); + sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node->index, node->path, player->GetName().c_str()); #endif player->GetMap()->ScriptsStart(sEventScripts, eventid, player, player); } diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index eebe18aae..64f555415 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -1063,10 +1063,8 @@ void WorldSession::SendAddonsInfo() if (usepk) // if CRC is wrong, add public key (client need it) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey", + sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey", itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC); #endif - // itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC); - data.append(addonPublicKey, sizeof(addonPublicKey)); } diff --git a/src/game/Server/WorldSocket.cpp b/src/game/Server/WorldSocket.cpp index 6ce00ee75..91c5efe6a 100644 --- a/src/game/Server/WorldSocket.cpp +++ b/src/game/Server/WorldSocket.cpp @@ -757,14 +757,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) recvPacket.read(digest, 20); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", BuiltNumberClient, unk2, account.c_str(), unk3, clientSeed); #endif - // BuiltNumberClient, - // unk2, - // account.c_str(), - // unk3, - // clientSeed); - // Get the account information from the realmd database // 0 1 2 3 4 5 6 7 8 // SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ? diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 8f783d029..235f5e990 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -1993,10 +1993,8 @@ void Spell::SendLoot(uint64 guid, LootType loottype) if (!gameObjTarget->isSpawned() && !player->IsGameMaster()) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!", -#endif - // player->GetName().c_str(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow()); - return; + sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!", player->GetName().c_str(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow()); +#endif return; } // special case, already has GossipHello inside so return and avoid calling twice if (gameObjTarget->GetGoType() == GAMEOBJECT_TYPE_GOOBER) From e471c1bb6a241cfffe9c7ae61aa502eba9a046a0 Mon Sep 17 00:00:00 2001 From: talamortis Date: Fri, 30 Jun 2017 20:06:12 +0100 Subject: [PATCH 50/51] fix for PR # Conflicts: # src/authserver/Server/AuthSocket.cpp # src/game/AI/SmartScripts/SmartScript.cpp # src/game/DungeonFinding/LFGMgr.cpp # src/game/Entities/Player/Player.cpp # src/game/Entities/Unit/Unit.cpp # src/game/Entities/Vehicle/Vehicle.cpp # src/game/Guilds/Guild.cpp # src/game/Handlers/ChannelHandler.cpp # src/game/Handlers/GuildHandler.cpp # src/game/Handlers/LFGHandler.cpp # src/game/Handlers/LootHandler.cpp # src/game/Handlers/MiscHandler.cpp # src/game/Handlers/PetitionsHandler.cpp # src/game/Handlers/QueryHandler.cpp # src/game/Movement/MotionMaster.cpp # src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp # src/game/Server/WorldSocket.cpp # src/game/Spells/Auras/SpellAuraEffects.cpp # src/game/Spells/SpellEffects.cpp # src/scripts/Commands/cs_modify.cpp --- src/authserver/Server/AuthSocket.cpp | 5 +- src/game/AI/SmartScripts/SmartScript.cpp | 167 +++++++----------- src/game/DungeonFinding/LFGMgr.cpp | 45 +++-- src/game/Entities/Player/Player.cpp | 26 ++- src/game/Entities/Unit/Unit.cpp | 6 +- src/game/Entities/Vehicle/Vehicle.cpp | 5 +- src/game/Guilds/Guild.cpp | 26 ++- src/game/Handlers/ChannelHandler.cpp | 47 ++--- src/game/Handlers/GuildHandler.cpp | 27 ++- src/game/Handlers/LFGHandler.cpp | 21 +-- src/game/Handlers/MiscHandler.cpp | 15 +- src/game/Handlers/PetitionsHandler.cpp | 2 +- src/game/Handlers/QueryHandler.cpp | 5 +- src/game/Movement/MotionMaster.cpp | 92 +++++----- .../WaypointMovementGenerator.cpp | 2 +- src/game/Server/WorldSocket.cpp | 5 +- src/game/Spells/Auras/SpellAuraEffects.cpp | 18 +- src/game/Spells/SpellEffects.cpp | 3 +- 18 files changed, 211 insertions(+), 306 deletions(-) diff --git a/src/authserver/Server/AuthSocket.cpp b/src/authserver/Server/AuthSocket.cpp index 71ea08629..98d204fa9 100644 --- a/src/authserver/Server/AuthSocket.cpp +++ b/src/authserver/Server/AuthSocket.cpp @@ -766,9 +766,8 @@ bool AuthSocket::_HandleLogonProof() #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", -#endif - // socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); - } + socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); +#endif } } } } diff --git a/src/game/AI/SmartScripts/SmartScript.cpp b/src/game/AI/SmartScripts/SmartScript.cpp index d7c1d0af1..c665b2610 100644 --- a/src/game/AI/SmartScripts/SmartScript.cpp +++ b/src/game/AI/SmartScripts/SmartScript.cpp @@ -194,9 +194,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u mUseTextTimer = true; sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textGuid: %u", talker->GetName().c_str(), talker->GetGUIDLow(), GUID_LOPART(mTextGUID)); -#endif break; - } + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textId: %u", talker->GetName().c_str(), talker->GetGUIDLow(), mLastTextID); +#endif + break; } case SMART_ACTION_SIMPLE_TALK: { ObjectList* targets = GetTargets(e, unit); @@ -213,9 +213,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u } #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u", -#endif - // (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID)); - } + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID)); +#endif } delete targets; } @@ -233,9 +232,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToUnit()->HandleEmoteCommand(e.action.emote.emote); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: %s (GuidLow: %u), emote: %u", -#endif - // (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.emote.emote); - } + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.emote.emote); +#endif } } delete targets; @@ -254,9 +252,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u", -#endif - // (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound, e.action.sound.range); - } + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound); +#endif } } delete targets; @@ -277,9 +274,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToCreature()->setFaction(e.action.faction.factionID); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", -#endif - // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.faction.factionID); - } + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.faction.factionID); +#endif } else { if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry())) @@ -289,9 +285,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToCreature()->setFaction(ci->faction); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", -#endif - // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction); - } + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction); +#endif } } } } @@ -323,9 +318,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToCreature()->SetDisplayId(displayId); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", -#endif - // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), display_id); - } + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), displayId); +#endif } } //if no param1, then use value from param2 (modelId) else @@ -333,18 +327,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToCreature()->SetDisplayId(e.action.morphOrMount.model); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", -#endif - // (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.morphOrMount.model); - } + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.morphOrMount.model); +#endif } } else { (*itr)->ToCreature()->DeMorph(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u demorphs.", -#endif - // (*itr)->GetEntry(), (*itr)->GetGUIDLow()); - } + (*itr)->GetEntry(), (*itr)->GetGUIDLow()); +#endif } } delete targets; @@ -363,9 +355,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToPlayer()->FailQuest(e.action.quest.quest); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow %u fails quest %u", -#endif - // (*itr)->GetGUIDLow(), e.action.quest.quest); - } + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif } } delete targets; @@ -386,9 +377,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", -#endif - // (*itr)->GetGUIDLow(), e.action.quest.quest); - } + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif } } } @@ -450,9 +440,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToUnit()->HandleEmoteCommand(emote); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow %u handle random emote %u", -#endif - // (*itr)->GetGUIDLow(), emote); - } + (*itr)->GetGUIDLow(), emote); +#endif } } delete targets; @@ -471,9 +460,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->getThreatManager().modifyThreatPercent(target, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature guidLow %u modify threat for unit %u, value %i", -#endif - // me->GetGUIDLow(), target->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); - } + me->GetGUIDLow(), target->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); +#endif } } break; } @@ -493,9 +481,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->getThreatManager().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow %u modify threat for unit %u, value %i", -#endif - // me->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); - } + me->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); +#endif } } delete targets; @@ -522,9 +509,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u player->GroupEventHappens(e.action.quest.quest, me); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow %u credited quest %u", -#endif - // (*itr)->GetGUIDLow(), e.action.quest.quest); - } + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif } } } @@ -631,9 +617,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToUnit()->AddAura(e.action.cast.spell, (*itr)->ToUnit()); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura %u to unit %u", -#endif - // e.action.cast.spell, (*itr)->GetGUIDLow()); - } + e.action.cast.spell, (*itr)->GetGUIDLow()); +#endif } } delete targets; @@ -655,9 +640,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToGameObject()->UseDoorOrButton(0, e.action.activateObject.alternative ? true : false, unit); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", -#endif - // (*itr)->GetGUIDLow(), (*itr)->GetEntry()); - } + (*itr)->GetGUIDLow(), (*itr)->GetEntry()); +#endif } } delete targets; @@ -676,9 +660,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToGameObject()->ResetDoorOrButton(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject %u (entry: %u) reset", -#endif - // (*itr)->GetGUIDLow(), (*itr)->GetEntry()); - } + (*itr)->GetGUIDLow(), (*itr)->GetEntry()); +#endif } } delete targets; @@ -697,9 +680,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_EMOTESTATE, e.action.emote.emote); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set emotestate to %u", -#endif - // (*itr)->GetGUIDLow(), e.action.emote.emote); - } + (*itr)->GetGUIDLow(), e.action.emote.emote); +#endif } } delete targets; @@ -769,9 +751,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", -#endif - // me->GetGUIDLow(), e.action.autoAttack.attack); - break; + me->GetGUIDLow(), e.action.autoAttack.attack); +#endif break; } case SMART_ACTION_ALLOW_COMBAT_MOVEMENT: { @@ -789,9 +770,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u CAST_AI(SmartAI, me->AI())->SetCombatMove(move); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u", -#endif - // me->GetGUIDLow(), e.action.combatMove.move); - break; + me->GetGUIDLow(), e.action.combatMove.move); +#endif break; } case SMART_ACTION_SET_EVENT_PHASE: { @@ -801,9 +781,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u SetPhase(e.action.setEventPhase.phase); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", -#endif - // GetBaseObject()->GetGUIDLow(), e.action.setEventPhase.phase); - break; + GetBaseObject()->GetGUIDLow(), e.action.setEventPhase.phase); +#endif break; } case SMART_ACTION_INC_EVENT_PHASE: { @@ -814,9 +793,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u DecPhase(e.action.incEventPhase.dec); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature %u inc event phase by %u, " -#endif - // "decrease by %u", GetBaseObject()->GetGUIDLow(), e.action.incEventPhase.inc, e.action.incEventPhase.dec); - break; + "decrease by %u", GetBaseObject()->GetGUIDLow(), e.action.incEventPhase.inc, e.action.incEventPhase.dec); +#endif break; } case SMART_ACTION_EVADE: { @@ -877,9 +855,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u player->GroupEventHappens(e.action.quest.quest, GetBaseObject()); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player %u, group credit for quest %u", -#endif - // (*itr)->GetGUIDLow(), e.action.quest.quest); - } + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif } } delete targets; @@ -911,9 +888,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", -#endif - // (*itr)->GetGUIDLow(), e.action.removeAura.spell); - } + (*itr)->GetGUIDLow(), e.action.removeAura.spell); +#endif } delete targets; break; @@ -938,9 +914,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), float(int32(e.action.follow.dist))+0.1f, angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType, e.action.follow.aliveState); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u", -#endif - // me->GetGUIDLow(), (*itr)->GetGUIDLow()); - break; + me->GetGUIDLow(), (*itr)->GetGUIDLow()); +#endif break; } } @@ -977,9 +952,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u SetPhase(phase); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature %u sets event phase to %u", -#endif - // GetBaseObject()->GetGUIDLow(), phase); - break; + GetBaseObject()->GetGUIDLow(), phase); +#endif break; } case SMART_ACTION_RANDOM_PHASE_RANGE: { @@ -990,9 +964,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u SetPhase(phase); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature %u sets event phase to %u", -#endif - // GetBaseObject()->GetGUIDLow(), phase); - break; + GetBaseObject()->GetGUIDLow(), phase); +#endif break; } case SMART_ACTION_CALL_KILLEDMONSTER: { @@ -1001,9 +974,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u unit->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, unit); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player %u, Killcredit: %u", -#endif - // unit->GetGUIDLow(), e.action.killedMonster.creature); - } + unit->GetGUIDLow(), e.action.killedMonster.creature); +#endif } else if (e.target.type == SMART_TARGET_NONE || e.target.type == SMART_TARGET_SELF) // Loot recipient and his group members { if (!me) @@ -1034,9 +1006,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u player->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, player); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", -#endif - // (*itr)->GetGUIDLow(), e.action.killedMonster.creature); - } + (*itr)->GetGUIDLow(), e.action.killedMonster.creature); +#endif } delete targets; } @@ -1061,9 +1032,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u", -#endif - // e.action.setInstanceData.field, e.action.setInstanceData.data); - break; + e.action.setInstanceData.field, e.action.setInstanceData.data); +#endif break; } case SMART_ACTION_SET_INST_DATA64: { @@ -1088,9 +1058,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD, + e.action.setInstanceData64.field, targets->front()->GetGUID()); #endif - // e.action.setInstanceData64.field, targets->front()->GetGUID()); - delete targets; break; } @@ -1158,9 +1127,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u me->SetSheath(SheathState(e.action.setSheath.sheath)); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature %u, State: %u", -#endif - // me->GetGUIDLow(), e.action.setSheath.sheath); - } + me->GetGUIDLow(), e.action.setSheath.sheath); +#endif } break; } case SMART_ACTION_FORCE_DESPAWN: @@ -2305,9 +2273,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", + e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); #endif - // e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); - ObjectList* targets = GetTargets(e, unit); if (!targets) break; diff --git a/src/game/DungeonFinding/LFGMgr.cpp b/src/game/DungeonFinding/LFGMgr.cpp index 625780945..a7fb602bc 100644 --- a/src/game/DungeonFinding/LFGMgr.cpp +++ b/src/game/DungeonFinding/LFGMgr.cpp @@ -723,8 +723,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const */ void LFGMgr::LeaveLfg(uint64 guid) { - //sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::LeaveLfg: [" UI64FMTD "]", guid); - + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Leave: [" UI64FMTD "]", guid); uint64 gguid = IS_GROUP_GUID(guid) ? guid : GetGroup(guid); LfgState state = GetState(guid); switch (state) @@ -1606,7 +1605,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) player.accept = LfgAnswer(accept); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); #endif if (!accept) { @@ -1699,7 +1698,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate proposal.state = LFG_PROPOSAL_FAILED; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); #endif // Mark all people that didn't answered as no accept if (type == LFG_UPDATETYPE_PROPOSAL_FAILED) @@ -1745,14 +1744,14 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate { updateData.updateType = type; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); #endif } else { updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); #endif } @@ -1768,7 +1767,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); #endif SetState(guid, LFG_STATE_QUEUED); if (gguid != guid) @@ -2146,7 +2145,7 @@ LfgState LFGMgr::GetState(uint64 guid) state = PlayersStore[guid].GetState(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state); #endif return state; } @@ -2160,7 +2159,7 @@ LfgState LFGMgr::GetOldState(uint64 guid) state = PlayersStore[guid].GetOldState(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state); #endif return state; } @@ -2169,7 +2168,7 @@ uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */) { uint32 dungeon = GroupsStore[guid].GetDungeon(asId); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon); #endif return dungeon; } @@ -2183,7 +2182,7 @@ uint32 LFGMgr::GetDungeonMapId(uint64 guid) mapId = dungeon->map; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetDungeonMapId: [" UI64FMTD "] = %u (DungeonId = %u)", guid, mapId, dungeonId); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeonMapId: [" UI64FMTD "] = %u (DungeonId = %u)", guid, mapId, dungeonId); #endif return mapId; } @@ -2192,7 +2191,7 @@ uint8 LFGMgr::GetRoles(uint64 guid) { uint8 roles = PlayersStore[guid].GetRoles(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles); #endif return roles; } @@ -2200,7 +2199,7 @@ uint8 LFGMgr::GetRoles(uint64 guid) const std::string& LFGMgr::GetComment(uint64 guid) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, PlayersStore[guid].GetComment().c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, PlayersStore[guid].GetComment().c_str()); #endif return PlayersStore[guid].GetComment(); } @@ -2208,7 +2207,7 @@ const std::string& LFGMgr::GetComment(uint64 guid) LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); #endif return PlayersStore[guid].GetSelectedDungeons(); } @@ -2216,7 +2215,7 @@ LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); #endif return PlayersStore[guid].GetLockedDungeons(); } @@ -2225,7 +2224,7 @@ uint8 LFGMgr::GetKicksLeft(uint64 guid) { uint8 kicks = GroupsStore[guid].GetKicksLeft(); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "] = %u", guid, kicks); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "] = %u", guid, kicks); #endif return kicks; } @@ -2289,7 +2288,7 @@ void LFGMgr::SetCanOverrideRBState(uint64 guid, bool val) void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); #endif GroupsStore[guid].SetDungeon(dungeon); } @@ -2297,7 +2296,7 @@ void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon) void LFGMgr::SetRoles(uint64 guid, uint8 roles) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); #endif PlayersStore[guid].SetRoles(roles); } @@ -2305,7 +2304,7 @@ void LFGMgr::SetRoles(uint64 guid, uint8 roles) void LFGMgr::SetComment(uint64 guid, std::string const& comment) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); #endif PlayersStore[guid].SetComment(comment); } @@ -2326,7 +2325,7 @@ void LFGMgr::LfrSetComment(Player* p, std::string comment) void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); #endif PlayersStore[guid].SetSelectedDungeons(dungeons); } @@ -2334,7 +2333,7 @@ void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons) void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); #endif PlayersStore[guid].SetLockedDungeons(lock); } @@ -2342,7 +2341,7 @@ void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock) void LFGMgr::DecreaseKicksLeft(uint64 guid) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); #endif GroupsStore[guid].DecreaseKicksLeft(); } @@ -2350,7 +2349,7 @@ void LFGMgr::DecreaseKicksLeft(uint64 guid) void LFGMgr::RemoveGroupData(uint64 guid) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug((LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); #endif LfgGroupDataContainer::iterator it = GroupsStore.find(guid); if (it == GroupsStore.end()) diff --git a/src/game/Entities/Player/Player.cpp b/src/game/Entities/Player/Player.cpp index db7c41e3f..f947eb860 100644 --- a/src/game/Entities/Player/Player.cpp +++ b/src/game/Entities/Player/Player.cpp @@ -18602,18 +18602,16 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', map: %u) has item (GUID: %u, entry: %u) limited to another map (%u). Deleting item.", -#endif - // GetGUIDLow(), GetName().c_str(), GetMapId(), item->GetGUIDLow(), item->GetEntry(), zoneId); - remove = true; + GetGUIDLow(), GetName().c_str(), GetMapId(), item->GetGUIDLow(), item->GetEntry(), zoneId); +#endif remove = true; } // "Conjured items disappear if you are logged out for more than 15 minutes" else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.", -#endif - // GetGUIDLow(), GetName().c_str(), timeDiff, item->GetGUIDLow(), item->GetEntry()); - remove = true; + GetGUIDLow(), GetName().c_str(), timeDiff, item->GetGUIDLow(), item->GetEntry()); +#endif remove = true; } else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { @@ -18621,9 +18619,8 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", + GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); #endif - // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE); stmt->setUInt32(0, item->GetGUIDLow()); trans->Append(stmt); @@ -18647,9 +18644,8 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.", -#endif // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); +#endif item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } } } @@ -18677,9 +18673,8 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.", -#endif - // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); + GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); +#endif item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); } } else if (proto->HolidayId) @@ -19488,9 +19483,8 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", + m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); #endif - // m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); - return true; } @@ -25367,7 +25361,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), height, GetPositionZ(), movementInfo.fallTime, height, damage, safe_fall); + sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), GetPositionZ(), movementInfo.fallTime, damage, safe_fall); #endif } diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index fb7cb42b3..a6004c12f 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -15154,9 +15154,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", + (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif - // (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (damage > 0) { HandleAuraRaidProcFromChargeWithValue(triggeredByAura); @@ -15168,9 +15167,8 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", + (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif - // (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - HandleAuraRaidProcFromCharge(triggeredByAura); takeCharges = true; break; diff --git a/src/game/Entities/Vehicle/Vehicle.cpp b/src/game/Entities/Vehicle/Vehicle.cpp index 5d61c40a9..b1975b91a 100644 --- a/src/game/Entities/Vehicle/Vehicle.cpp +++ b/src/game/Entities/Vehicle/Vehicle.cpp @@ -310,8 +310,9 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) if (_status == STATUS_UNINSTALLING) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outError(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); -#endif return false; + sLog->outDebug(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); + return false; +#endif } if (unit->GetVehicle() != this) diff --git a/src/game/Guilds/Guild.cpp b/src/game/Guilds/Guild.cpp index e80f36134..bbbb78ed9 100644 --- a/src/game/Guilds/Guild.cpp +++ b/src/game/Guilds/Guild.cpp @@ -565,9 +565,8 @@ void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: Tabid: %u, Text: %s" -#endif - // , session->GetPlayerInfo().c_str(), m_tabId, m_text.c_str()); - session->SendPacket(&data); + , session->GetPlayerInfo().c_str(), m_tabId, m_text.c_str()); +#endif session->SendPacket(&data); } else { @@ -961,9 +960,8 @@ Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", -#endif - // m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); - pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); + m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); +#endif pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } return pLastItem; } @@ -1066,9 +1064,8 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", + m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); #endif - // m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); - uint32 count = pItem->GetCount(); // Soulbound items cannot be moved if (pItem->IsSoulBound()) @@ -1166,9 +1163,8 @@ bool Guild::Create(Player* pLeader, std::string const& name) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", + name.c_str(), pLeader->GetName().c_str(), GUID_LOPART(m_leaderGuid)); #endif - // name.c_str(), pLeader->GetName().c_str(), GUID_LOPART(m_leaderGuid)); - SQLTransaction trans = CharacterDatabase.BeginTransaction(); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBERS); @@ -2905,9 +2901,8 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/ session->SendPacket(&data); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %d", -#endif - // session->GetPlayerInfo().c_str(), tabId, sendAllSlots, numSlots); - } + session->GetPlayerInfo().c_str(), tabId, sendAllSlots, numSlots); +#endif } else // TODO - Probably this is just sent to session + those that have sent CMSG_GUILD_BANKER_ACTIVATE { for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) @@ -2923,9 +2918,8 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/ player->GetSession()->SendPacket(&data); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %u" -#endif - // , player->GetName().c_str(), tabId, sendAllSlots, numSlots); - } + , player->GetName().c_str(), tabId, sendAllSlots, numSlots); +#endif } } } diff --git a/src/game/Handlers/ChannelHandler.cpp b/src/game/Handlers/ChannelHandler.cpp index 58c2819cc..36a252dd7 100644 --- a/src/game/Handlers/ChannelHandler.cpp +++ b/src/game/Handlers/ChannelHandler.cpp @@ -58,9 +58,8 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_LEAVE_CHANNEL %s Channel: %s, unk1: %u", + GetPlayerInfo().c_str(), channelName.c_str(), unk); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), unk); - if (channelName.empty()) return; @@ -78,10 +77,9 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "%s %s Channel: %s", + recvPacket.GetOpcode() == CMSG_CHANNEL_DISPLAY_LIST ? "CMSG_CHANNEL_DISPLAY_LIST" : "CMSG_CHANNEL_LIST", + GetPlayerInfo().c_str(), channelName.c_str()); #endif - // recvPacket.GetOpcode() == CMSG_CHANNEL_DISPLAY_LIST ? "CMSG_CHANNEL_DISPLAY_LIST" : "CMSG_CHANNEL_LIST", - // GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) channel->List(GetPlayer()); @@ -94,9 +92,8 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_PASSWORD %s Channel: %s, Password: %s", + GetPlayerInfo().c_str(), channelName.c_str(), password.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), password.c_str()); - if (password.length() > MAX_CHANNEL_PASS_STR) return; @@ -112,9 +109,8 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_SET_OWNER %s Channel: %s, Target: %s", -#endif // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - +#endif if (!normalizePlayerName(targetName)) return; @@ -130,9 +126,8 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_OWNER %s Channel: %s", + GetPlayerInfo().c_str(), channelName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) channel->SendWhoOwner(GetPlayer()->GetGUID()); @@ -145,9 +140,8 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MODERATOR %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -163,9 +157,8 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMODERATOR %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -181,9 +174,8 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MUTE %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -199,9 +191,8 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMUTE %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -217,9 +208,8 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_INVITE %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -235,9 +225,8 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_KICK %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -253,9 +242,8 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_BAN %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -271,9 +259,8 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNBAN %s Channel: %s, Target: %s", + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); - if (!normalizePlayerName(targetName)) return; @@ -289,9 +276,8 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s", + GetPlayerInfo().c_str(), channelName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) channel->Announce(GetPlayer()); @@ -310,9 +296,8 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_GET_CHANNEL_MEMBER_COUNT %s Channel: %s", + GetPlayerInfo().c_str(), channelName.c_str()); #endif - // GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeamId())) { if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) diff --git a/src/game/Handlers/GuildHandler.cpp b/src/game/Handlers/GuildHandler.cpp index 6a4c3ad47..0cbbc2929 100644 --- a/src/game/Handlers/GuildHandler.cpp +++ b/src/game/Handlers/GuildHandler.cpp @@ -206,9 +206,8 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_OFFICER_NOTE [%s]: Target: %s, Note: %s", + GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); #endif - // GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); - if (normalizePlayerName(playerName)) if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleSetMemberNote(this, playerName, note, false); @@ -301,12 +300,11 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s]: Guid: [" UI64FMTD + "] Style: %d, Color: %d, BorderStyle: %d, BorderColor: %d, BackgroundColor: %d" + , GetPlayerInfo().c_str(), vendorGuid, emblemInfo.GetStyle() + , emblemInfo.GetColor(), emblemInfo.GetBorderStyle() + , emblemInfo.GetBorderColor(), emblemInfo.GetBackgroundColor()); #endif - // "] Style: %d, Color: %d, BorderStyle: %d, BorderColor: %d, BackgroundColor: %d" - // , GetPlayerInfo().c_str(), vendorGuid, emblemInfo.GetStyle() - // , emblemInfo.GetColor(), emblemInfo.GetBorderStyle() - // , emblemInfo.GetBorderColor(), emblemInfo.GetBackgroundColor()); - if (GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_TABARDDESIGNER)) { // Remove fake death @@ -361,9 +359,8 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" + , GetPlayerInfo().c_str(), guid, sendAllSlots); #endif - // , GetPlayerInfo().c_str(), guid, sendAllSlots); - Guild * const guild = GetPlayer()->GetGuild(); if (!guild) { @@ -385,9 +382,8 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, ShowTabs: %u" + , GetPlayerInfo().c_str(), guid, tabId, full); #endif - // , GetPlayerInfo().c_str(), guid, tabId, full); - if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = GetPlayer()->GetGuild()) guild->SendBankTabData(this, tabId); @@ -401,9 +397,8 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [" UI64FMTD "], money: %u", + GetPlayerInfo().c_str(), guid, money); #endif - // GetPlayerInfo().c_str(), guid, money); - if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) if (money && GetPlayer()->HasEnoughMoney(money)) if (Guild* guild = GetPlayer()->GetGuild()) @@ -418,9 +413,8 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [" UI64FMTD "], money: %u", + GetPlayerInfo().c_str(), guid, money); #endif - // GetPlayerInfo().c_str(), guid, money); - if (money && GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = GetPlayer()->GetGuild()) guild->HandleMemberWithdrawMoney(this, money); @@ -536,9 +530,8 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, Name: %s, Icon: %s" + , GetPlayerInfo().c_str(), guid, tabId, name.c_str(), icon.c_str()); #endif - // , GetPlayerInfo().c_str(), guid, tabId, name.c_str(), icon.c_str()); - if (!name.empty() && !icon.empty()) if (GetPlayer()->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_GUILD_BANK)) if (Guild* guild = GetPlayer()->GetGuild()) diff --git a/src/game/Handlers/LFGHandler.cpp b/src/game/Handlers/LFGHandler.cpp index f2d685232..114260223 100644 --- a/src/game/Handlers/LFGHandler.cpp +++ b/src/game/Handlers/LFGHandler.cpp @@ -110,7 +110,7 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData) recvData >> accept; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), lfgGroupID, accept ? 1 : 0); + sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), proposalID, accept ? 1 : 0); #endif sLFGMgr->UpdateProposal(proposalID, GetPlayer()->GetGUID(), accept); } @@ -137,6 +137,7 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) { + uint64 guid = GetPlayer()->GetGUID(); std::string comment; recvData >> comment; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS @@ -343,9 +344,8 @@ void WorldSession::SendLfgUpdatePlayer(lfg::LfgUpdateData const& updateData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PLAYER %s updatetype: %u", -#endif - // GetPlayerInfo().c_str(), updateData.updateType); - WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); + GetPlayerInfo().c_str(), updateData.updateType); +#endif WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(size > 0); // Extra info if (size) @@ -386,9 +386,8 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PARTY %s updatetype: %u", -#endif - // GetPlayerInfo().c_str(), updateData.updateType); - WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); + GetPlayerInfo().c_str(), updateData.updateType); +#endif WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(size > 0); // Extra info if (size) @@ -491,9 +490,8 @@ void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", + GetPlayer()->GetGUID(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps); #endif - // GetPlayer()->GetGUID(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps); - WorldPacket data(SMSG_LFG_QUEUE_STATUS, 4 + 4 + 4 + 4 + 4 +4 + 1 + 1 + 1 + 4); data << uint32(queueData.dungeonId); // Dungeon data << int32(queueData.waitTimeAvg); // Average Wait time @@ -560,9 +558,8 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot) } #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", -#endif - // guid, uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING), uint8(playerVote == lfg::LFG_ANSWER_AGREE), boot.victim, votesNum, agreeNum, secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str()); - WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length()); + guid, uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING), uint8(playerVote == lfg::LFG_ANSWER_AGREE), boot.victim, votesNum, agreeNum, secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str()); +#endif WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length()); data << uint8(boot.inProgress); // Vote in progress data << uint8(playerVote != lfg::LFG_ANSWER_PENDING); // Did Vote data << uint8(playerVote == lfg::LFG_ANSWER_AGREE); // Agree diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 2fa32ba9e..494832dea 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -884,9 +884,8 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", -#endif - // player->GetName().c_str(), player->GetGUIDLow(), triggerId); - return; + player->GetName().c_str(), player->GetGUIDLow(), triggerId); +#endif return; } AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); @@ -894,18 +893,16 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", -#endif - // player->GetName().c_str(), player->GetGUIDLow(), triggerId); - return; + player->GetName().c_str(), player->GetGUIDLow(), triggerId); +#endif return; } if (!player->IsInAreaTriggerRadius(atEntry)) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", -#endif - // player->GetName().c_str(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId); - return; + player->GetName().c_str(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId); +#endif return; } if (player->isDebugAreaTriggers) diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index 0e87f23f1..8a9b6e8b1 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -832,7 +832,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) for (SignatureMap::const_iterator itr = signatureCopy.begin(); itr != signatureCopy.end(); ++itr) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitionsHandler: Adding arena team (guid: %u) member %u", arenaTeam->GetId(), memberGUID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitionsHandler: Adding arena team (guid: %u) member %u", arenaTeam->GetId()); #endif arenaTeam->AddMember(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)); } diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 3b341d0d6..962ebdc94 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -205,9 +205,8 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", -#endif - // GUID_LOPART(guid), entry); - WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); + GUID_LOPART(guid), entry); +#endif WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS diff --git a/src/game/Movement/MotionMaster.cpp b/src/game/Movement/MotionMaster.cpp index 829fd75c8..67909a66a 100644 --- a/src/game/Movement/MotionMaster.cpp +++ b/src/game/Movement/MotionMaster.cpp @@ -301,21 +301,19 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", -#endif - // _owner->GetGUIDLow(), - // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", - // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); + _owner->GetGUIDLow(), + target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", + target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); +#endif Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); } else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), - // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", - // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); + _owner->GetEntry(), _owner->GetGUIDLow(), + target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", + target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); +#endif Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); } } @@ -331,20 +329,18 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(), -#endif - // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", - // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator(target, dist, angle), slot); + target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", + target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); +#endif Mutate(new FollowMovementGenerator(target, dist, angle), slot); } else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), - // target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", - // target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FollowMovementGenerator(target, dist, angle), slot); + _owner->GetEntry(), _owner->GetGUIDLow(), + target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", + target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); +#endif Mutate(new FollowMovementGenerator(target, dist, angle), slot); } } @@ -365,14 +361,16 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); - Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); + _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); +#endif Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); } } void MotionMaster::MoveSplinePath(Movement::PointsArray* path) { + uint32 id; + float x, y, z; + // Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE if (_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; @@ -388,9 +386,8 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); - Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); + _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); +#endif Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); } } @@ -528,9 +525,8 @@ void MotionMaster::MoveFall(uint32 id /*=0*/, bool addFlagForNPC) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).", -#endif - // _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ()); - return; + _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ()); +#endif return; } // Abort too if the ground is very near @@ -579,9 +575,8 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id, { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); - Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); + _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); +#endif Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); } } @@ -599,9 +594,8 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); - _owner->AttackStop(); + _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); +#endif _owner->AttackStop(); _owner->CastStop(0, false); _owner->ToCreature()->SetReactState(REACT_PASSIVE); Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE); @@ -622,9 +616,8 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), time); - Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); + _owner->GetEntry(), _owner->GetGUIDLow(), time); +#endif Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); } } @@ -641,21 +634,19 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time) { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(), -#endif - // enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", - // enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow()); - Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); + enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", + enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow()); +#endif Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); } else { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", -#endif - // _owner->GetEntry(), _owner->GetGUIDLow(), - // enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", - // enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(), - // time ? " for a limited time" : ""); - if (time) + _owner->GetEntry(), _owner->GetGUIDLow(), + enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", + enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(), + time ? " for a limited time" : ""); +#endif if (time) Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time), MOTION_SLOT_CONTROLLED); else Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); @@ -771,10 +762,9 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", -#endif - // _owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature", - // _owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO"); -} + _owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature", + _owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO"); +#endif} void MotionMaster::MoveRotate(uint32 time, RotateDirection direction) { diff --git a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index 17b10e81b..ffa91d291 100644 --- a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -481,7 +481,7 @@ void FlightPathMovementGenerator::PreloadEndGrid() { #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1)); -#endif +#endi endMap->LoadGrid(_endGridX, _endGridY); } else diff --git a/src/game/Server/WorldSocket.cpp b/src/game/Server/WorldSocket.cpp index 91c5efe6a..928f8b5b5 100644 --- a/src/game/Server/WorldSocket.cpp +++ b/src/game/Server/WorldSocket.cpp @@ -920,10 +920,9 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", + account.c_str(), + address.c_str()); #endif - // account.c_str(), - // address.c_str()); - // Check if this user is by any chance a recruiter stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_RECRUITER); diff --git a/src/game/Spells/Auras/SpellAuraEffects.cpp b/src/game/Spells/Auras/SpellAuraEffects.cpp index 479086524..070b15574 100644 --- a/src/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/game/Spells/Auras/SpellAuraEffects.cpp @@ -6140,9 +6140,8 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); #endif - // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); - Unit::DealDamageMods(target, damage, &absorb); // Auras reducing damage from AOE spells @@ -6237,9 +6236,8 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); #endif - // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); - if (caster) caster->SendSpellNonMeleeDamageLog(target, GetId(), damage+absorb+resist, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit); @@ -6386,9 +6384,8 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId()); #endif - // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId()); - uint32 absorb = 0; uint32 heal = uint32(damage); @@ -6467,9 +6464,8 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId()); #endif - // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId()); - // resilience reduce mana draining effect at spell crit damage reduction (added in 2.4) if (powerType == POWER_MANA) drainAmount -= target->GetSpellCritDamageReduction(drainAmount); @@ -6535,9 +6531,8 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) /100; #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); #endif - // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); - SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false); target->SendPeriodicAuraLog(&pInfo); @@ -6575,9 +6570,8 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); #endif - // GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); - int32 gain = target->ModifyPower(powerType, amount); if (caster) diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 235f5e990..3136acb94 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -6197,9 +6197,8 @@ void Spell::EffectBind(SpellEffIndex effIndex) #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u", + homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId); #endif - // homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId); - // zone update data.Initialize(SMSG_PLAYERBOUND, 8 + 4); data << uint64(m_caster->GetGUID()); From 0dd68dfbee97eb7ed2c9bd4109ba3f2aed697860 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sun, 20 Aug 2017 04:48:07 +0200 Subject: [PATCH 51/51] Another huge compilation fix please delete cache and re-run cmake --- .../extractors/mmaps_generator/MapBuilder.cpp | 5 + .../src/Management/MMapManager.cpp | 28 +- .../src/Management/VMapManager2.cpp | 14 +- .../lib-collision/src/Maps/MapTree.cpp | 8 +- .../nucleus/src/Database/MySQLConnection.cpp | 2 +- src/authserver/Server/AuthSocket.cpp | 71 +- src/game/AI/CoreAI/CombatAI.cpp | 2 +- src/game/AI/CoreAI/GuardAI.cpp | 2 +- src/game/AI/CoreAI/PetAI.cpp | 4 +- src/game/AI/CreatureAI.cpp | 2 +- src/game/AI/CreatureAISelector.cpp | 4 +- src/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 16 +- src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 18 +- src/game/AI/SmartScripts/SmartAI.cpp | 4 +- src/game/AI/SmartScripts/SmartScript.cpp | 7003 +++++++++-------- src/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- src/game/Achievements/AchievementMgr.cpp | 8 +- src/game/AuctionHouse/AuctionHouseMgr.cpp | 8 +- src/game/Battlefield/Battlefield.cpp | 2 +- src/game/Battlefield/BattlefieldMgr.cpp | 8 +- src/game/Battlegrounds/ArenaTeam.cpp | 8 +- src/game/Battlegrounds/Battleground.cpp | 6 +- .../Battlegrounds/Zones/BattlegroundAV.cpp | 60 +- src/game/Calendar/CalendarMgr.cpp | 4 +- src/game/Chat/Channels/Channel.cpp | 4 +- src/game/Chat/ChatLink.cpp | 100 +- src/game/Conditions/ConditionMgr.cpp | 19 +- src/game/DungeonFinding/LFGMgr.cpp | 46 +- src/game/DungeonFinding/LFGScripts.cpp | 17 +- src/game/Entities/Creature/Creature.cpp | 10 +- src/game/Entities/Creature/CreatureGroups.cpp | 16 +- src/game/Entities/Creature/GossipDef.cpp | 12 +- src/game/Entities/GameObject/GameObject.cpp | 6 +- src/game/Entities/Item/Item.cpp | 6 +- src/game/Entities/Pet/Pet.cpp | 8 +- src/game/Entities/Player/Player.cpp | 315 +- src/game/Entities/Player/SocialMgr.cpp | 2 +- src/game/Entities/Unit/Unit.cpp | 91 +- src/game/Entities/Vehicle/Vehicle.cpp | 16 +- src/game/Events/GameEventMgr.cpp | 6 +- src/game/Globals/ObjectAccessor.cpp | 2 +- src/game/Globals/ObjectMgr.cpp | 8 +- src/game/Grids/ObjectGridLoader.cpp | 2 +- src/game/Groups/Group.cpp | 6 +- src/game/Guilds/Guild.cpp | 59 +- src/game/Handlers/AddonHandler.cpp | 4 +- src/game/Handlers/ArenaTeamHandler.cpp | 26 +- src/game/Handlers/AuctionHouseHandler.cpp | 32 +- src/game/Handlers/BattleGroundHandler.cpp | 16 +- src/game/Handlers/ChannelHandler.cpp | 34 +- src/game/Handlers/CharacterHandler.cpp | 38 +- src/game/Handlers/ChatHandler.cpp | 2 +- src/game/Handlers/CombatHandler.cpp | 2 +- src/game/Handlers/DuelHandler.cpp | 6 +- src/game/Handlers/GroupHandler.cpp | 36 +- src/game/Handlers/GuildHandler.cpp | 66 +- src/game/Handlers/ItemHandler.cpp | 60 +- src/game/Handlers/LFGHandler.cpp | 61 +- src/game/Handlers/LootHandler.cpp | 16 +- src/game/Handlers/MailHandler.cpp | 9 +- src/game/Handlers/MiscHandler.cpp | 182 +- src/game/Handlers/MovementHandler.cpp | 20 +- src/game/Handlers/NPCHandler.cpp | 61 +- src/game/Handlers/PetHandler.cpp | 33 +- src/game/Handlers/PetitionsHandler.cpp | 54 +- src/game/Handlers/QueryHandler.cpp | 30 +- src/game/Handlers/QuestHandler.cpp | 43 +- src/game/Handlers/ReferAFriendHandler.cpp | 4 +- src/game/Handlers/SkillHandler.cpp | 6 +- src/game/Handlers/SpellHandler.cpp | 18 +- src/game/Handlers/TaxiHandler.cpp | 32 +- src/game/Handlers/TradeHandler.cpp | 12 +- src/game/Handlers/VehicleHandler.cpp | 6 +- src/game/Handlers/VoiceChatHandler.cpp | 6 +- src/game/Instances/InstanceScript.cpp | 8 +- src/game/Instances/InstanceScript.h | 8 +- src/game/Maps/Map.cpp | 30 +- src/game/Maps/MapInstanced.cpp | 4 +- src/game/Maps/MapManager.cpp | 8 +- src/game/Movement/MotionMaster.cpp | 108 +- .../WaypointMovementGenerator.cpp | 12 +- src/game/OutdoorPvP/OutdoorPvP.cpp | 8 +- src/game/OutdoorPvP/OutdoorPvPMgr.cpp | 4 +- src/game/Pools/PoolMgr.cpp | 6 +- src/game/Server/WorldSession.cpp | 27 +- src/game/Server/WorldSocket.cpp | 12 +- src/game/Server/WorldSocketMgr.cpp | 4 +- src/game/Spells/Auras/SpellAuraEffects.cpp | 38 +- src/game/Spells/Auras/SpellAuras.cpp | 8 +- src/game/Spells/Spell.cpp | 32 +- src/game/Spells/SpellEffects.cpp | 45 +- src/game/Spells/SpellInfo.cpp | 2 +- src/game/Spells/SpellMgr.cpp | 12 +- src/game/Texts/CreatureTextMgr.cpp | 4 +- src/game/Warden/Warden.cpp | 16 +- src/game/Warden/WardenMac.cpp | 30 +- src/game/Warden/WardenWin.cpp | 89 +- src/game/Weather/Weather.cpp | 6 +- src/game/World/World.cpp | 12 +- src/scripts/Commands/cs_misc.cpp | 4 +- src/scripts/Commands/cs_modify.cpp | 10 +- .../instance_blackrock_depths.cpp | 4 +- .../EasternKingdoms/Karazhan/karazhan.cpp | 2 +- .../ScarletEnclave/chapter2.cpp | 2 +- src/scripts/Outland/zone_netherstorm.cpp | 2 +- src/scripts/World/npc_professions.cpp | 2 +- src/worldserver/RemoteAccess/RARunnable.cpp | 2 +- src/worldserver/TCSoap/TCSoap.cpp | 12 +- 108 files changed, 4784 insertions(+), 4744 deletions(-) diff --git a/modules/acore/extractors/mmaps_generator/MapBuilder.cpp b/modules/acore/extractors/mmaps_generator/MapBuilder.cpp index cea205cef..e5edd4a61 100644 --- a/modules/acore/extractors/mmaps_generator/MapBuilder.cpp +++ b/modules/acore/extractors/mmaps_generator/MapBuilder.cpp @@ -14,9 +14,14 @@ #include "DetourNavMesh.h" #include "DetourCommon.h" +#include "DisableMgr.h" #include uint32 GetLiquidFlags(uint32 /*liquidType*/) { return 0; } +namespace DisableMgr +{ + bool IsDisabledFor(DisableType /*type*/, uint32 /*entry*/, Unit const* /*unit*/, uint8 /*flags*/ /*= 0*/) { return false; } +} #define MMAP_MAGIC 0x4d4d4150 // 'MMAP' #define MMAP_VERSION 3 diff --git a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp index f18604f77..26fa9fb59 100644 --- a/modules/worldengine/lib-collision/src/Management/MMapManager.cpp +++ b/modules/worldengine/lib-collision/src/Management/MMapManager.cpp @@ -34,7 +34,7 @@ namespace MMAP FILE* file = fopen(fileName, "rb"); if (!file) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMapData: Error: Could not open mmap file '%s'", fileName); #endif delete [] fileName; @@ -63,7 +63,7 @@ namespace MMAP delete [] fileName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:loadMapData: Loaded %03i.mmap", mapId); #endif @@ -119,7 +119,7 @@ namespace MMAP FILE *file = fopen(fileName, "rb"); if (!file) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:loadMap: Could not open mmtile file '%s'", fileName); #endif delete [] fileName; @@ -171,7 +171,7 @@ namespace MMAP { mmap->mmapLoadedTiles.insert(std::pair(packedGridPos, tileRef)); ++loadedTiles; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:loadMap: Loaded mmtile %03i[%02i,%02i] into %03i[%02i,%02i]", mapId, x, y, mapId, header->x, header->y); #endif return true; @@ -194,7 +194,7 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map. %03u%02i%02i.mmtile", mapId, x, y); #endif return false; @@ -207,7 +207,7 @@ namespace MMAP if (mmap->mmapLoadedTiles.find(packedGridPos) == mmap->mmapLoadedTiles.end()) { // file may not exist, therefore not loaded -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh tile. %03u%02i%02i.mmtile", mapId, x, y); #endif return false; @@ -234,7 +234,7 @@ namespace MMAP { mmap->mmapLoadedTiles.erase(packedGridPos); --loadedTiles; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); #endif return true; @@ -250,7 +250,7 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMap: Asked to unload not loaded navmesh map %03u", mapId); #endif return false; @@ -274,7 +274,7 @@ namespace MMAP else { --loadedTiles; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:unloadMap: Unloaded mmtile %03i[%02i,%02i] from %03i", mapId, x, y, mapId); #endif } @@ -282,7 +282,7 @@ namespace MMAP delete mmap; loadedMMaps.erase(mapId); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:unloadMap: Unloaded %03i.mmap", mapId); #endif @@ -297,7 +297,7 @@ namespace MMAP if (loadedMMaps.find(mapId) == loadedMMaps.end()) { // file may not exist, therefore not loaded -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded navmesh map %03u", mapId); #endif return false; @@ -306,7 +306,7 @@ namespace MMAP MMapData* mmap = loadedMMaps[mapId]; if (mmap->navMeshQueries.find(instanceId) == mmap->navMeshQueries.end()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId %03u instanceId %u", mapId, instanceId); #endif return false; @@ -316,7 +316,7 @@ namespace MMAP dtFreeNavMeshQuery(query); mmap->navMeshQueries.erase(instanceId); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:unloadMapInstance: Unloaded mapId %03u instanceId %u", mapId, instanceId); #endif @@ -360,7 +360,7 @@ namespace MMAP return NULL; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId %03u instanceId %u", mapId, instanceId); #endif mmap->navMeshQueries.insert(std::pair(instanceId, query)); diff --git a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp index e466929a0..2751db4ea 100644 --- a/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp +++ b/modules/worldengine/lib-collision/src/Management/VMapManager2.cpp @@ -124,7 +124,7 @@ namespace VMAP bool VMapManager2::isInLineOfSight(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2) { -#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS) if (!isLineOfSightCalcEnabled() || DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) return true; #endif @@ -149,7 +149,7 @@ namespace VMAP */ bool VMapManager2::getObjectHitPos(unsigned int mapId, float x1, float y1, float z1, float x2, float y2, float z2, float& rx, float &ry, float& rz, float modifyDist) { -#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS) if (isLineOfSightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LOS)) #endif { @@ -181,7 +181,7 @@ namespace VMAP float VMapManager2::getHeight(unsigned int mapId, float x, float y, float z, float maxSearchDist) { -#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS) if (isHeightCalcEnabled() && !DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_HEIGHT)) #endif { @@ -202,7 +202,7 @@ namespace VMAP bool VMapManager2::getAreaInfo(unsigned int mapId, float x, float y, float& z, uint32& flags, int32& adtId, int32& rootId, int32& groupId) const { -#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS) if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_AREAFLAG)) #endif { @@ -222,7 +222,7 @@ namespace VMAP bool VMapManager2::GetLiquidLevel(uint32 mapId, float x, float y, float z, uint8 reqLiquidType, float& level, float& floor, uint32& type) const { -#if ENABLE_EXTRAS && ENABLE_VMAP_CHECKS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_VMAP_CHECKS) if (!DisableMgr::IsDisabledFor(DISABLE_TYPE_VMAP, mapId, NULL, VMAP_DISABLE_LIQUIDSTATUS)) #endif { @@ -262,7 +262,7 @@ namespace VMAP delete worldmodel; return NULL; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: loading file '%s%s'", basepath.c_str(), filename.c_str()); #endif model = iLoadedModelFiles.insert(std::pair(filename, ManagedModel())).first; @@ -285,7 +285,7 @@ namespace VMAP } if (model->second.decRefCount() == 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "VMapManager2: unloading file '%s'", filename.c_str()); #endif delete model->second.getModel(); diff --git a/modules/worldengine/lib-collision/src/Maps/MapTree.cpp b/modules/worldengine/lib-collision/src/Maps/MapTree.cpp index 092625dd9..c2056c90b 100644 --- a/modules/worldengine/lib-collision/src/Maps/MapTree.cpp +++ b/modules/worldengine/lib-collision/src/Maps/MapTree.cpp @@ -44,7 +44,7 @@ namespace VMAP AreaInfoCallback(ModelInstance* val): prims(val) {} void operator()(const Vector3& point, uint32 entry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(VMAP_DEBUG) sLog->outDebug(LOG_FILTER_MAPS, "AreaInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif prims[entry].intersectPoint(point, aInfo); @@ -60,7 +60,7 @@ namespace VMAP LocationInfoCallback(ModelInstance* val, LocationInfo &info): prims(val), locInfo(info), result(false) {} void operator()(const Vector3& point, uint32 entry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(VMAP_DEBUG) sLog->outDebug(LOG_FILTER_MAPS, "LocationInfoCallback: trying to intersect '%s'", prims[entry].name.c_str()); #endif if (prims[entry].GetLocationInfo(point, locInfo)) @@ -373,7 +373,7 @@ namespace VMAP { if (!iLoadedSpawns.count(referencedVal)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(VMAP_DEBUG) if (referencedVal > iNTreeValues) { sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : invalid tree element (%u/%u)", referencedVal, iNTreeValues); @@ -386,7 +386,7 @@ namespace VMAP else { ++iLoadedSpawns[referencedVal]; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && VMAP_DEBUG +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(VMAP_DEBUG) if (iTreeValues[referencedVal].ID != spawn.ID) sLog->outDebug(LOG_FILTER_MAPS, "StaticMapTree::LoadMapTile() : trying to load wrong spawn in node"); else if (iTreeValues[referencedVal].name != spawn.name) diff --git a/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp b/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp index 2735d4940..6b554ce8e 100644 --- a/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp +++ b/modules/worldengine/nucleus/src/Database/MySQLConnection.cpp @@ -121,7 +121,7 @@ bool MySQLConnection::Open() // sLog->outInfo(LOG_FILTER_SQL, "[WARNING] MySQL client/server version mismatch; may conflict with behaviour of prepared statements."); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Connected to MySQL database at %s", m_connectionInfo.host.c_str()); #endif mysql_autocommit(m_Mysql, 1); diff --git a/src/authserver/Server/AuthSocket.cpp b/src/authserver/Server/AuthSocket.cpp index 98d204fa9..81a065e46 100644 --- a/src/authserver/Server/AuthSocket.cpp +++ b/src/authserver/Server/AuthSocket.cpp @@ -197,7 +197,7 @@ void AuthSocket::OnAccept(void) void AuthSocket::OnClose(void) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "AuthSocket::OnClose"); #endif } @@ -231,13 +231,13 @@ void AuthSocket::OnRead() { if ((uint8)table[i].cmd == _cmd && (table[i].status == _status)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Got data for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); #endif if (!(*this.*table[i].handler)()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Command handler failed for cmd %u recv length %u", (uint32)_cmd, (uint32)socket().recv_len()); #endif return; @@ -249,7 +249,7 @@ void AuthSocket::OnRead() // Report unknown packets in the error log if (i == AUTH_TOTAL_COMMANDS) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Got unknown packet from '%s'", socket().getRemoteAddress().c_str()); #endif socket().shutdown(); @@ -304,7 +304,7 @@ ACE_Thread_Mutex LastLoginAttemptMutex; // Logon Challenge command handler bool AuthSocket::_HandleLogonChallenge() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleLogonChallenge"); #endif if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) @@ -346,7 +346,7 @@ bool AuthSocket::_HandleLogonChallenge() EndianConvertPtr(&buf[0]); uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] got header, body is %#04x bytes", remaining); #endif @@ -360,10 +360,8 @@ bool AuthSocket::_HandleLogonChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] got full packet, %#04x bytes", ch->size); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] name(%d): '%s'", ch->I_len, ch->I); #endif @@ -403,7 +401,7 @@ bool AuthSocket::_HandleLogonChallenge() if (result) { pkt << uint8(WOW_FAIL_BANNED); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned ip tries to login!",socket().getRemoteAddress().c_str(), socket().getRemotePort()); #endif } @@ -423,28 +421,26 @@ bool AuthSocket::_HandleLogonChallenge() bool locked = false; if (fields[2].GetUInt8() == 1) // if ip is locked { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is locked to IP - '%s'", _login.c_str(), fields[3].GetCString()); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Player address is '%s'", ip_address.c_str()); #endif if (strcmp(fields[3].GetCString(), ip_address.c_str()) != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP differs"); #endif pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); locked = true; } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account IP matches"); #endif } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[AuthChallenge] Account '%s' is not locked to ip", _login.c_str()); #endif @@ -462,14 +458,14 @@ bool AuthSocket::_HandleLogonChallenge() if ((*banresult)[0].GetUInt32() == (*banresult)[1].GetUInt32()) { pkt << uint8(WOW_FAIL_BANNED); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); #endif } else { pkt << uint8(WOW_FAIL_SUSPENDED); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); #endif } @@ -483,7 +479,7 @@ bool AuthSocket::_HandleLogonChallenge() std::string databaseV = fields[5].GetString(); std::string databaseS = fields[6].GetString(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "database authentication values: v='%s' s='%s'", databaseV.c_str(), databaseS.c_str()); #endif @@ -548,7 +544,7 @@ bool AuthSocket::_HandleLogonChallenge() _localizationName[i] = ch->country[4-i-1]; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug( LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s is using '%c%c%c%c' locale (%u)", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str (), ch->country[3], ch->country[2], ch->country[1], ch->country[0], GetLocaleByName(_localizationName) ); #endif @@ -568,7 +564,7 @@ bool AuthSocket::_HandleLogonChallenge() // Logon Proof command handler bool AuthSocket::_HandleLogonProof() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleLogonProof"); #endif // Read the packet @@ -583,7 +579,7 @@ bool AuthSocket::_HandleLogonProof() if (_expversion == NO_VALID_EXP_FLAG) { // Check if we have the appropriate patch on the disk -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Client with invalid version, patching is not implemented"); #endif socket().shutdown(); @@ -669,7 +665,7 @@ bool AuthSocket::_HandleLogonProof() // Check if SRP6 results match (password is correct), else send an error if (!memcmp(M.AsByteArray().get(), lp.M1, 20)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' User '%s' successfully authenticated", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str()); #endif @@ -721,7 +717,7 @@ bool AuthSocket::_HandleLogonProof() char data[4] = { AUTH_LOGON_PROOF, WOW_FAIL_UNKNOWN_ACCOUNT, 3, 0 }; socket().send(data, sizeof(data)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ()); #endif @@ -753,7 +749,7 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str(), WrongPassBanTime, failed_logins); #endif } @@ -764,10 +760,11 @@ bool AuthSocket::_HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] IP %s got banned for '%u' seconds because account %s failed to authenticate '%u' times", socket().getRemoteAddress().c_str(), socket().getRemotePort(), socket().getRemoteAddress().c_str(), WrongPassBanTime, _login.c_str(), failed_logins); -#endif } +#endif + } } } } @@ -779,7 +776,7 @@ bool AuthSocket::_HandleLogonProof() // Reconnect Challenge command handler bool AuthSocket::_HandleReconnectChallenge() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleReconnectChallenge"); #endif if (socket().recv_len() < sizeof(sAuthLogonChallenge_C)) @@ -794,7 +791,7 @@ bool AuthSocket::_HandleReconnectChallenge() EndianConvertPtr(&buf[0]); uint16 remaining = ((sAuthLogonChallenge_C *)&buf[0])->size; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] got header, body is %#04x bytes", remaining); #endif @@ -811,10 +808,8 @@ bool AuthSocket::_HandleReconnectChallenge() // Read the remaining of the packet socket().recv((char *)&buf[4], remaining); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] got full packet, %#04x bytes", ch->size); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "[ReconnectChallenge] name(%d): '%s'", ch->I_len, ch->I); #endif @@ -866,7 +861,7 @@ bool AuthSocket::_HandleReconnectChallenge() // Reconnect Proof command handler bool AuthSocket::_HandleReconnectProof() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleReconnectProof"); #endif // Read the packet @@ -935,7 +930,7 @@ ACE_INET_Addr const& AuthSocket::GetAddressForClient(Realm const& realm, ACE_INE // Realm List command handler bool AuthSocket::_HandleRealmList() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleRealmList"); #endif if (socket().recv_len() < 5) @@ -1067,7 +1062,7 @@ bool AuthSocket::_HandleRealmList() // Resume patch transfer bool AuthSocket::_HandleXferResume() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferResume"); #endif // Check packet length and patch existence @@ -1090,7 +1085,7 @@ bool AuthSocket::_HandleXferResume() // Cancel patch transfer bool AuthSocket::_HandleXferCancel() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferCancel"); #endif @@ -1104,7 +1099,7 @@ bool AuthSocket::_HandleXferCancel() // Accept patch transfer bool AuthSocket::_HandleXferAccept() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Entering _HandleXferAccept"); #endif @@ -1192,7 +1187,7 @@ void Patcher::LoadPatchMD5(char *szFileName) std::string path = "./patches/"; path += szFileName; FILE* pPatch = fopen(path.c_str(), "rb"); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Loading patch info from %s\n", path.c_str()); #endif diff --git a/src/game/AI/CoreAI/CombatAI.cpp b/src/game/AI/CoreAI/CombatAI.cpp index 4b18bebff..989d3d007 100644 --- a/src/game/AI/CoreAI/CombatAI.cpp +++ b/src/game/AI/CoreAI/CombatAI.cpp @@ -281,7 +281,7 @@ void VehicleAI::LoadConditions() { conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE, me->GetEntry()); //if (!conditions.empty()) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleAI::LoadConditions: loaded %u conditions", uint32(conditions.size())); #endif } diff --git a/src/game/AI/CoreAI/GuardAI.cpp b/src/game/AI/CoreAI/GuardAI.cpp index 118548321..59ee6932f 100644 --- a/src/game/AI/CoreAI/GuardAI.cpp +++ b/src/game/AI/CoreAI/GuardAI.cpp @@ -39,7 +39,7 @@ void GuardAI::EnterEvadeMode() return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Guard entry: %u enters evade mode.", me->GetEntry()); #endif diff --git a/src/game/AI/CoreAI/PetAI.cpp b/src/game/AI/CoreAI/PetAI.cpp index 0a3dc28b7..8a0b97951 100644 --- a/src/game/AI/CoreAI/PetAI.cpp +++ b/src/game/AI/CoreAI/PetAI.cpp @@ -61,7 +61,7 @@ void PetAI::_stopAttack() { if (!me->IsAlive()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature stoped attacking cuz his dead [guid=%u]", me->GetGUIDLow()); #endif me->GetMotionMaster()->Clear(); @@ -122,7 +122,7 @@ void PetAI::UpdateAI(uint32 diff) if (_needToStop()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Pet AI stopped attacking [guid=%u]", me->GetGUIDLow()); #endif _stopAttack(); diff --git a/src/game/AI/CreatureAI.cpp b/src/game/AI/CreatureAI.cpp index a280e4977..981ff1b5f 100644 --- a/src/game/AI/CreatureAI.cpp +++ b/src/game/AI/CreatureAI.cpp @@ -132,7 +132,7 @@ void CreatureAI::EnterEvadeMode() if (!_EnterEvadeMode()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Creature %u enters evade mode.", me->GetEntry()); #endif diff --git a/src/game/AI/CreatureAISelector.cpp b/src/game/AI/CreatureAISelector.cpp index cde8e0b81..3970ee9e4 100644 --- a/src/game/AI/CreatureAISelector.cpp +++ b/src/game/AI/CreatureAISelector.cpp @@ -86,7 +86,7 @@ namespace FactorySelector // xinef: unused // ainame = (ai_factory == NULL) ? "NullCreatureAI" : ai_factory->key(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "Creature %u used AI is %s.", creature->GetGUIDLow(), ainame.c_str()); #endif return (ai_factory == NULL ? new NullCreatureAI(creature) : ai_factory->Create(creature)); @@ -136,7 +136,7 @@ namespace FactorySelector // xinef: unused std::string ainame = (ai_factory == NULL || go->GetScriptId()) ? "NullGameObjectAI" : ai_factory->key(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "GameObject %u used AI is %s.", go->GetGUIDLow(), ainame.c_str()); #endif diff --git a/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 4fe6d9953..fd2de7217 100644 --- a/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -156,7 +156,7 @@ void npc_escortAI::EnterEvadeMode() { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); #endif } @@ -284,7 +284,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) //Combat start position reached, continue waypoint movement if (pointId == POINT_LAST_POINT) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original position before combat"); #endif @@ -296,7 +296,7 @@ void npc_escortAI::MovementInform(uint32 moveType, uint32 pointId) } else if (pointId == POINT_HOME) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); #endif @@ -386,7 +386,7 @@ void npc_escortAI::SetRun(bool on) if (!m_bIsRunning) me->SetWalk(false); else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set run mode, but is already running."); #endif } @@ -395,7 +395,7 @@ void npc_escortAI::SetRun(bool on) if (m_bIsRunning) me->SetWalk(true); else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI attempt to set walk mode, but is already walking."); #endif } @@ -443,7 +443,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false m_bCanReturnToStart = canLoopPath; //if (m_bCanReturnToStart && m_bCanInstantRespawn) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); #endif @@ -451,7 +451,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false { me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MoveIdle(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); #endif } @@ -464,7 +464,7 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); #endif diff --git a/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index c1ca26c5c..b44ec3ca0 100644 --- a/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -141,7 +141,7 @@ void FollowerAI::EnterEvadeMode() if (HasFollowState(STATE_FOLLOW_INPROGRESS)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI left combat, returning to CombatStartPosition."); #endif @@ -169,7 +169,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is set completed, despawns."); #endif me->DespawnOrUnsummon(); @@ -182,7 +182,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_RETURNING)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI is returning to leader."); #endif @@ -213,7 +213,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff) if (bIsMaxRangeExceeded) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI failed because player/group was to far away or not found"); #endif me->DespawnOrUnsummon(); @@ -258,7 +258,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu { if (me->GetVictim()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI attempt to StartFollow while in combat."); #endif return; @@ -282,7 +282,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu { me->GetMotionMaster()->Clear(); me->GetMotionMaster()->MoveIdle(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); #endif } @@ -293,7 +293,7 @@ void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, const Qu me->GetMotionMaster()->MoveFollow(player, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI start follow %s (GUID " UI64FMTD ")", player->GetName().c_str(), m_uiLeaderGUID); #endif } @@ -314,7 +314,7 @@ Player* FollowerAI::GetLeaderForFollower() if (member && me->IsWithinDistInMap(member, MAX_PLAYER_DISTANCE) && member->IsAlive()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader changed and returned new leader."); #endif m_uiLeaderGUID = member->GetGUID(); @@ -325,7 +325,7 @@ Player* FollowerAI::GetLeaderForFollower() } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: FollowerAI GetLeader can not find suitable leader."); #endif return NULL; diff --git a/src/game/AI/SmartScripts/SmartAI.cpp b/src/game/AI/SmartScripts/SmartAI.cpp index 95b1a5208..f8e6f2624 100644 --- a/src/game/AI/SmartScripts/SmartAI.cpp +++ b/src/game/AI/SmartScripts/SmartAI.cpp @@ -1096,7 +1096,7 @@ void SmartGameObjectAI::Reset() // Called when a player opens a gossip dialog with the gameobject. bool SmartGameObjectAI::GossipHello(Player* player, bool reportUse) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello"); #endif GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, (uint32)reportUse, 0, false, NULL, go); @@ -1179,7 +1179,7 @@ class SmartTrigger : public AreaTriggerScript if (!player->IsAlive()) return false; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_DATABASE_AI, "AreaTrigger %u is using SmartTrigger script", trigger->id); #endif SmartScript script; diff --git a/src/game/AI/SmartScripts/SmartScript.cpp b/src/game/AI/SmartScripts/SmartScript.cpp index c665b2610..7951d39de 100644 --- a/src/game/AI/SmartScripts/SmartScript.cpp +++ b/src/game/AI/SmartScripts/SmartScript.cpp @@ -1,8 +1,8 @@ /* - * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2 - * Copyright (C) 2008-2016 TrinityCore - * Copyright (C) 2005-2009 MaNGOS - */ +* Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license: http://github.com/azerothcore/azerothcore-wotlk/LICENSE-GPL2 +* Copyright (C) 2008-2016 TrinityCore +* Copyright (C) 2005-2009 MaNGOS +*/ #include "Chat.h" #include "Cell.h" @@ -29,23 +29,23 @@ class TrinityStringTextBuilder { - public: - TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target) - : _source(obj), _msgType(msgtype), _textId(id), _language(language), _target(target) - { - } +public: + TrinityStringTextBuilder(WorldObject* obj, ChatMsg msgtype, int32 id, uint32 language, WorldObject* target) + : _source(obj), _msgType(msgtype), _textId(id), _language(language), _target(target) + { + } - size_t operator()(WorldPacket* data, LocaleConstant locale) const - { - std::string text = sObjectMgr->GetTrinityString(_textId, locale); - return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale); - } + size_t operator()(WorldPacket* data, LocaleConstant locale) const + { + std::string text = sObjectMgr->GetTrinityString(_textId, locale); + return ChatHandler::BuildChatPacket(*data, _msgType, Language(_language), _source, _target, text, 0, "", locale); + } - WorldObject* _source; - ChatMsg _msgType; - int32 _textId; - uint32 _language; - WorldObject* _target; + WorldObject* _source; + ChatMsg _msgType; + int32 _textId; + uint32 _language; + WorldObject* _target; }; SmartScript::SmartScript() @@ -144,2659 +144,2691 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (unit) mLastInvoker = unit->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) if (Unit* tempInvoker = GetLastInvoker()) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: Invoker: %s (guidlow: %u)", tempInvoker->GetName().c_str(), tempInvoker->GetGUIDLow()); #endif switch (e.GetActionType()) { - case SMART_ACTION_TALK: + case SMART_ACTION_TALK: + { + ObjectList* targets = GetTargets(e, unit); + Creature* talker = e.target.type == 0 ? me : NULL; // xinef: tc retardness fix + Unit* talkTarget = NULL; + if (targets) { - ObjectList* targets = GetTargets(e, unit); - Creature* talker = e.target.type == 0 ? me : NULL; // xinef: tc retardness fix - Unit* talkTarget = NULL; - if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature((*itr)) && !(*itr)->ToCreature()->IsPet()) // Prevented sending text to pets. { - if (IsCreature((*itr)) && !(*itr)->ToCreature()->IsPet()) // Prevented sending text to pets. + if (e.action.talk.useTalkTarget) { - if (e.action.talk.useTalkTarget) - { - talker = me; - talkTarget = (*itr)->ToCreature(); - } - else - talker = (*itr)->ToCreature(); - break; - } - else if (IsPlayer((*itr))) - { - talker = me; // xinef: added - talkTarget = (*itr)->ToPlayer(); - break; + talker = me; + talkTarget = (*itr)->ToCreature(); } + else + talker = (*itr)->ToCreature(); + break; + } + else if (IsPlayer((*itr))) + { + talker = me; // xinef: added + talkTarget = (*itr)->ToPlayer(); + break; } - - delete targets; } - if (!talkTarget) - talkTarget = GetLastInvoker(); + delete targets; + } - if (!talker) - break; + if (!talkTarget) + talkTarget = GetLastInvoker(); - mTalkerEntry = talker->GetEntry(); - mLastTextID = e.action.talk.textGroupID; - mTextTimer = e.action.talk.duration; - mUseTextTimer = true; - sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textId: %u", talker->GetName().c_str(), talker->GetGUIDLow(), mLastTextID); + if (!talker) + break; + + mTalkerEntry = talker->GetEntry(); + mLastTextID = e.action.talk.textGroupID; + mTextTimer = e.action.talk.duration; + mUseTextTimer = true; + sCreatureTextMgr->SendChat(talker, uint8(e.action.talk.textGroupID), talkTarget); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_TALK: talker: %s (GuidLow: %u), textId: %u", talker->GetName().c_str(), talker->GetGUIDLow(), mLastTextID); #endif - break; } - case SMART_ACTION_SIMPLE_TALK: + break; + } + case SMART_ACTION_SIMPLE_TALK: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) { - ObjectList* targets = GetTargets(e, unit); - if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(GetLastInvoker()) ? GetLastInvoker() : 0); + else if (IsPlayer(*itr) && me) { - if (IsCreature(*itr)) - sCreatureTextMgr->SendChat((*itr)->ToCreature(), uint8(e.action.talk.textGroupID), IsPlayer(GetLastInvoker())? GetLastInvoker() : 0); - else if (IsPlayer(*itr) && me) + Unit* templastInvoker = GetLastInvoker(); + sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker : 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, (*itr)->ToPlayer()); + } +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u", + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID)); +#endif + } + + delete targets; + } + break; + } + case SMART_ACTION_PLAY_EMOTE: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + { + (*itr)->ToUnit()->HandleEmoteCommand(e.action.emote.emote); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: %s (GuidLow: %u), emote: %u", + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.emote.emote); +#endif + } + } + + delete targets; + } + break; + } + case SMART_ACTION_SOUND: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + { + (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u", + (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound); +#endif + } + } + + delete targets; + } + break; + } + case SMART_ACTION_SET_FACTION: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + { + if (e.action.faction.factionID) { - Unit* templastInvoker = GetLastInvoker(); - sCreatureTextMgr->SendChat(me, uint8(e.action.talk.textGroupID), IsPlayer(templastInvoker) ? templastInvoker : 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_NEUTRAL, false, (*itr)->ToPlayer()); + (*itr)->ToCreature()->setFaction(e.action.faction.factionID); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.faction.factionID); +#endif } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SIMPLE_TALK: talker: %s (GuidLow: %u), textGroupId: %u", - (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), uint8(e.action.talk.textGroupID)); -#endif } - - delete targets; - } - break; - } - case SMART_ACTION_PLAY_EMOTE: - { - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) + else { - (*itr)->ToUnit()->HandleEmoteCommand(e.action.emote.emote); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_PLAY_EMOTE: target: %s (GuidLow: %u), emote: %u", - (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.emote.emote); -#endif } - } - - delete targets; - } - break; - } - case SMART_ACTION_SOUND: - { - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - (*itr)->SendPlaySound(e.action.sound.sound, e.action.sound.onlySelf > 0); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SOUND: target: %s (GuidLow: %u), sound: %u, onlyself: %u", - (*itr)->GetName().c_str(), (*itr)->GetGUIDLow(), e.action.sound.sound); -#endif } - } - - delete targets; - } - break; - } - case SMART_ACTION_SET_FACTION: - { - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - { - if (e.action.faction.factionID) + if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry())) { - (*itr)->ToCreature()->setFaction(e.action.faction.factionID); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", - (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.faction.factionID); -#endif } - else - { - if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry())) + if ((*itr)->ToCreature()->getFaction() != ci->faction) { - if ((*itr)->ToCreature()->getFaction() != ci->faction) - { - (*itr)->ToCreature()->setFaction(ci->faction); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", - (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction); -#endif } + (*itr)->ToCreature()->setFaction(ci->faction); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction); +#endif } } } } - - delete targets; } - break; + + delete targets; } - case SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: + break; + } + case SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; + if (!IsCreature(*itr)) + continue; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (e.action.morphOrMount.creature || e.action.morphOrMount.model) { - if (!IsCreature(*itr)) - continue; - - if (e.action.morphOrMount.creature || e.action.morphOrMount.model) + //set model based on entry from creature_template + if (e.action.morphOrMount.creature) { - //set model based on entry from creature_template - if (e.action.morphOrMount.creature) + if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature)) { - if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature)) - { - uint32 displayId = ObjectMgr::ChooseDisplayId(ci); - (*itr)->ToCreature()->SetDisplayId(displayId); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", - (*itr)->GetEntry(), (*itr)->GetGUIDLow(), displayId); -#endif } - } - //if no param1, then use value from param2 (modelId) - else - { - (*itr)->ToCreature()->SetDisplayId(e.action.morphOrMount.model); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + uint32 displayId = ObjectMgr::ChooseDisplayId(ci); + (*itr)->ToCreature()->SetDisplayId(displayId); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", - (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.morphOrMount.model); -#endif } + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), displayId); +#endif + } } + //if no param1, then use value from param2 (modelId) else { - (*itr)->ToCreature()->DeMorph(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u demorphs.", - (*itr)->GetEntry(), (*itr)->GetGUIDLow()); -#endif } + (*itr)->ToCreature()->SetDisplayId(e.action.morphOrMount.model); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u set displayid to %u", + (*itr)->GetEntry(), (*itr)->GetGUIDLow(), e.action.morphOrMount.model); +#endif + } } - - delete targets; - break; - } - case SMART_ACTION_FAIL_QUEST: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + else { - if (IsPlayer(*itr)) + (*itr)->ToCreature()->DeMorph(); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_MORPH_TO_ENTRY_OR_MODEL: Creature entry %u, GuidLow %u demorphs.", + (*itr)->GetEntry(), (*itr)->GetGUIDLow()); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_FAIL_QUEST: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsPlayer(*itr)) + { + (*itr)->ToPlayer()->FailQuest(e.action.quest.quest); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow %u fails quest %u", + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_ADD_QUEST: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsPlayer(*itr)) + { + if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) { - (*itr)->ToPlayer()->FailQuest(e.action.quest.quest); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FAIL_QUEST: Player guidLow %u fails quest %u", + (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", (*itr)->GetGUIDLow(), e.action.quest.quest); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_ADD_QUEST: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsPlayer(*itr)) - { - if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest)) - { - (*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u", - (*itr)->GetGUIDLow(), e.action.quest.quest); -#endif } - } - } - - delete targets; - break; - } - case SMART_ACTION_SET_REACT_STATE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsCreature(*itr)) - continue; - - (*itr)->ToCreature()->SetReactState(ReactStates(e.action.react.state)); - } - - delete targets; - break; - } - case SMART_ACTION_RANDOM_EMOTE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - uint32 emotes[SMART_ACTION_PARAM_COUNT]; - emotes[0] = e.action.randomEmote.emote1; - emotes[1] = e.action.randomEmote.emote2; - emotes[2] = e.action.randomEmote.emote3; - emotes[3] = e.action.randomEmote.emote4; - emotes[4] = e.action.randomEmote.emote5; - emotes[5] = e.action.randomEmote.emote6; - uint32 temp[SMART_ACTION_PARAM_COUNT]; - uint32 count = 0; - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) - { - if (emotes[i]) - { - temp[count] = emotes[i]; - ++count; - } - } - - if (count == 0) - { - delete targets; - break; - } - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - uint32 emote = temp[urand(0, count - 1)]; - (*itr)->ToUnit()->HandleEmoteCommand(emote); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow %u handle random emote %u", - (*itr)->GetGUIDLow(), emote); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_THREAT_ALL_PCT: - { - if (!me) - break; - - ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList(); - for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i) - { - if (Unit* target = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid())) - { - me->getThreatManager().modifyThreatPercent(target, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature guidLow %u modify threat for unit %u, value %i", - me->GetGUIDLow(), target->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); -#endif } - } - break; - } - case SMART_ACTION_THREAT_SINGLE_PCT: - { - if (!me) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - me->getThreatManager().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow %u modify threat for unit %u, value %i", - me->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - // Special handling for vehicles - if (IsUnit(*itr)) - { - if (Vehicle* vehicle = (*itr)->ToUnit()->GetVehicleKit()) - for (SeatMap::iterator it = vehicle->Seats.begin(); it != vehicle->Seats.end(); ++it) - if (Player* player = ObjectAccessor::GetPlayer(*(*itr), it->second.Passenger.Guid)) - player->AreaExploredOrEventHappens(e.action.quest.quest); - - if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) - { - player->GroupEventHappens(e.action.quest.quest, me); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow %u credited quest %u", - (*itr)->GetGUIDLow(), e.action.quest.quest); -#endif } - } - } - - delete targets; - break; - } - case SMART_ACTION_CAST: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - Unit* caster = me; - // Areatrigger Cast! - if (e.GetScriptType() == SMART_SCRIPT_TYPE_AREATRIGGER) - caster = unit->SummonTrigger(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation(), 5000); - - if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit) - Trinity::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit); - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (go) - { - // Xinef: may be NULL! - go->CastSpell((*itr)->ToUnit(), e.action.cast.spell); - } - - if (!IsUnit(*itr)) - continue; - - if (caster && caster != me) // Areatrigger cast - { - caster->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); - } - else if (me && (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell))) - { - if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) - me->InterruptNonMeleeSpells(false); - - // Xinef: flag usable only if caster has max dist set - if ((e.action.cast.flags & SMARTCAST_COMBAT_MOVE) && GetCasterMaxDist() > 0.0f && me->GetMaxPower(GetCasterPowerType()) > 0) - { - // Xinef: check mana case only and operate movement accordingly, LoS and range is checked in targetet movement generator - if (me->GetPowerPct(GetCasterPowerType()) < 15.0f) - { - SetCasterActualDist(0); - CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(0); - } - else if (GetCasterActualDist() == 0.0f && me->GetPowerPct(GetCasterPowerType()) > 30.0f) - { - RestoreCasterMaxDist(); - CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(GetCasterActualDist()); - } - } - - me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); - } - } - - delete targets; - break; - } - case SMART_ACTION_INVOKER_CAST: - { - Unit* tempLastInvoker = GetLastInvoker(unit); // xinef: can be used for area triggers cast - if (!tempLastInvoker) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit) - Trinity::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit); - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsUnit(*itr)) - continue; - - if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell)) - { - if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) - tempLastInvoker->InterruptNonMeleeSpells(false); - - tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); - } - } - - delete targets; - break; - } - case SMART_ACTION_ADD_AURA: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - (*itr)->ToUnit()->AddAura(e.action.cast.spell, (*itr)->ToUnit()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura %u to unit %u", - e.action.cast.spell, (*itr)->GetGUIDLow()); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_ACTIVATE_GOBJECT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsGameObject(*itr)) - { - // Activate - // xinef: wtf is this shit? - (*itr)->ToGameObject()->SetLootState(GO_READY); - (*itr)->ToGameObject()->UseDoorOrButton(0, e.action.activateObject.alternative ? true : false, unit); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", - (*itr)->GetGUIDLow(), (*itr)->GetEntry()); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_RESET_GOBJECT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsGameObject(*itr)) - { - (*itr)->ToGameObject()->ResetDoorOrButton(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject %u (entry: %u) reset", - (*itr)->GetGUIDLow(), (*itr)->GetEntry()); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_SET_EMOTE_STATE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_EMOTESTATE, e.action.emote.emote); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set emotestate to %u", - (*itr)->GetGUIDLow(), e.action.emote.emote); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_SET_UNIT_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - if (!e.action.unitFlag.type) - { - (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); - //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS", - //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); - } - else - { - (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag); - //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS_2", - //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); - } - } - } - - delete targets; - break; - } - case SMART_ACTION_REMOVE_UNIT_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit(*itr)) - { - if (!e.action.unitFlag.type) - { - (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); - //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS", - //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); - } - else - { - (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag); - //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS_2", - //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); - } - } - } - - delete targets; - break; - } - case SMART_ACTION_AUTO_ATTACK: - { - if (!IsSmart()) - break; - - CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", - me->GetGUIDLow(), e.action.autoAttack.attack); -#endif break; - } - case SMART_ACTION_ALLOW_COMBAT_MOVEMENT: - { - if (!IsSmart()) - break; - - // Xinef: Fix Combat Movement - bool move = e.action.combatMove.move; - if (move && GetMaxCombatDist() && e.GetEventType() == SMART_EVENT_MANA_PCT) - { - SetActualCombatDist(0); - CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(0); - } - else - CAST_AI(SmartAI, me->AI())->SetCombatMove(move); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u", - me->GetGUIDLow(), e.action.combatMove.move); -#endif break; - } - case SMART_ACTION_SET_EVENT_PHASE: - { - if (!GetBaseObject()) - break; - - SetPhase(e.action.setEventPhase.phase); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", - GetBaseObject()->GetGUIDLow(), e.action.setEventPhase.phase); -#endif break; - } - case SMART_ACTION_INC_EVENT_PHASE: - { - if (!GetBaseObject()) - break; - - IncPhase(e.action.incEventPhase.inc); - DecPhase(e.action.incEventPhase.dec); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature %u inc event phase by %u, " - "decrease by %u", GetBaseObject()->GetGUIDLow(), e.action.incEventPhase.inc, e.action.incEventPhase.dec); -#endif break; - } - case SMART_ACTION_EVADE: - { - if (!GetBaseObject()) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature((*itr))) - if ((*itr)->ToCreature()->IsAIEnabled) - (*itr)->ToCreature()->AI()->EnterEvadeMode(); - - delete targets; - break; - } - case SMART_ACTION_FLEE_FOR_ASSIST: - { - // Xinef: do not allow to flee without control (stun, fear etc) - if (!me || me->HasUnitState(UNIT_STATE_LOST_CONTROL) || me->GetSpeed(MOVE_RUN) < 0.1f) - break; - - me->DoFleeToGetAssistance(); - if (e.action.flee.withEmote) - { - TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL); - sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); - } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); #endif - break; - } - case SMART_ACTION_COMBAT_STOP: - { - if (!me) - break; - - me->CombatStop(true); - break; - } - case SMART_ACTION_CALL_GROUPEVENTHAPPENS: - { - if (!GetBaseObject()) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit((*itr))) - { - if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) - player->GroupEventHappens(e.action.quest.quest, GetBaseObject()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player %u, group credit for quest %u", - (*itr)->GetGUIDLow(), e.action.quest.quest); -#endif } - } - - delete targets; - break; - } - case SMART_ACTION_REMOVEAURASFROMSPELL: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsUnit((*itr))) - continue; - - if (e.action.removeAura.spell) - { - if (e.action.removeAura.charges) - { - if (Aura* aur = (*itr)->ToUnit()->GetAura(e.action.removeAura.spell)) - aur->ModCharges(-static_cast(e.action.removeAura.charges), AURA_REMOVE_BY_EXPIRE); - } - else - (*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); - } - else - (*itr)->ToUnit()->RemoveAllAuras(); - -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", - (*itr)->GetGUIDLow(), e.action.removeAura.spell); -#endif } - - delete targets; - break; - } - case SMART_ACTION_FOLLOW: - { - if (!IsSmart()) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - { - CAST_AI(SmartAI, me->AI())->StopFollow(false); - break; - } - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsUnit((*itr))) - { - float angle = e.action.follow.angle > 6 ? (e.action.follow.angle * M_PI / 180.0f) : e.action.follow.angle; - CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), float(int32(e.action.follow.dist))+0.1f, angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType, e.action.follow.aliveState); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u", - me->GetGUIDLow(), (*itr)->GetGUIDLow()); -#endif break; } } + } + delete targets; + break; + } + case SMART_ACTION_SET_REACT_STATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsCreature(*itr)) + continue; + + (*itr)->ToCreature()->SetReactState(ReactStates(e.action.react.state)); + } + + delete targets; + break; + } + case SMART_ACTION_RANDOM_EMOTE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + uint32 emotes[SMART_ACTION_PARAM_COUNT]; + emotes[0] = e.action.randomEmote.emote1; + emotes[1] = e.action.randomEmote.emote2; + emotes[2] = e.action.randomEmote.emote3; + emotes[3] = e.action.randomEmote.emote4; + emotes[4] = e.action.randomEmote.emote5; + emotes[5] = e.action.randomEmote.emote6; + uint32 temp[SMART_ACTION_PARAM_COUNT]; + uint32 count = 0; + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + if (emotes[i]) + { + temp[count] = emotes[i]; + ++count; + } + } + + if (count == 0) + { delete targets; break; } - case SMART_ACTION_RANDOM_PHASE: + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (!GetBaseObject()) - break; - - uint32 phases[SMART_ACTION_PARAM_COUNT]; - phases[0] = e.action.randomPhase.phase1; - phases[1] = e.action.randomPhase.phase2; - phases[2] = e.action.randomPhase.phase3; - phases[3] = e.action.randomPhase.phase4; - phases[4] = e.action.randomPhase.phase5; - phases[5] = e.action.randomPhase.phase6; - uint32 temp[SMART_ACTION_PARAM_COUNT]; - uint32 count = 0; - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + if (IsUnit(*itr)) { - if (phases[i] > 0) - { - temp[count] = phases[i]; - ++count; - } - } - - if (count == 0) - break; - - uint32 phase = temp[urand(0, count - 1)]; - SetPhase(phase); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature %u sets event phase to %u", - GetBaseObject()->GetGUIDLow(), phase); -#endif break; - } - case SMART_ACTION_RANDOM_PHASE_RANGE: - { - if (!GetBaseObject()) - break; - - uint32 phase = urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax); - SetPhase(phase); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature %u sets event phase to %u", - GetBaseObject()->GetGUIDLow(), phase); -#endif break; - } - case SMART_ACTION_CALL_KILLEDMONSTER: - { - if (trigger && IsPlayer(unit)) - { - unit->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, unit); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player %u, Killcredit: %u", - unit->GetGUIDLow(), e.action.killedMonster.creature); -#endif } - else if (e.target.type == SMART_TARGET_NONE || e.target.type == SMART_TARGET_SELF) // Loot recipient and his group members - { - if (!me) - break; - - if (Player* player = me->GetLootRecipient()) - { - player->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, player); - //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", - // player->GetGUIDLow(), e.action.killedMonster.creature); - } - } - else // Specific target type - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsUnit(*itr)) - continue; - - Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself(); - if (!player) - continue; - - player->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, player); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", - (*itr)->GetGUIDLow(), e.action.killedMonster.creature); -#endif } - - delete targets; - } - break; - } - case SMART_ACTION_SET_INST_DATA: - { - WorldObject* obj = GetBaseObject(); - if (!obj) - obj = unit; - - if (!obj) - break; - - InstanceScript* instance = obj->GetInstanceScript(); - if (!instance) - { - sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); - break; - } - - instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u", - e.action.setInstanceData.field, e.action.setInstanceData.data); -#endif break; - } - case SMART_ACTION_SET_INST_DATA64: - { - WorldObject* obj = GetBaseObject(); - if (!obj) - obj = unit; - - if (!obj) - break; - - InstanceScript* instance = obj->GetInstanceScript(); - if (!instance) - { - sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); - break; - } - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: "UI64FMTD, - e.action.setInstanceData64.field, targets->front()->GetGUID()); -#endif - delete targets; - break; - } - case SMART_ACTION_UPDATE_TEMPLATE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, NULL, !e.action.updateTemplate.doNotChangeLevel); - - delete targets; - break; - } - case SMART_ACTION_DIE: - { - if (me && !me->isDead()) - { - Unit::Kill(me, me); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature %u", me->GetGUIDLow()); + uint32 emote = temp[urand(0, count - 1)]; + (*itr)->ToUnit()->HandleEmoteCommand(emote); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RANDOM_EMOTE: Creature guidLow %u handle random emote %u", + (*itr)->GetGUIDLow(), emote); #endif } - break; } - case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->SetInCombatWithZone(); - - delete targets; + delete targets; + break; + } + case SMART_ACTION_THREAT_ALL_PCT: + { + if (!me) break; - } - case SMART_ACTION_CALL_FOR_HELP: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) + ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList(); + for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i) + { + if (Unit* target = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid())) + { + me->getThreatManager().modifyThreatPercent(target, e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_ALL_PCT: Creature guidLow %u modify threat for unit %u, value %i", + me->GetGUIDLow(), target->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); +#endif + } + } + break; + } + case SMART_ACTION_THREAT_SINGLE_PCT: + { + if (!me) + break; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + { + me->getThreatManager().modifyThreatPercent((*itr)->ToUnit(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_THREAT_SINGLE_PCT: Creature guidLow %u modify threat for unit %u, value %i", + me->GetGUIDLow(), (*itr)->GetGUIDLow(), e.action.threatPCT.threatINC ? (int32)e.action.threatPCT.threatINC : -(int32)e.action.threatPCT.threatDEC); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + // Special handling for vehicles + if (IsUnit(*itr)) + { + if (Vehicle* vehicle = (*itr)->ToUnit()->GetVehicleKit()) + for (SeatMap::iterator it = vehicle->Seats.begin(); it != vehicle->Seats.end(); ++it) + if (Player* player = ObjectAccessor::GetPlayer(*(*itr), it->second.Passenger.Guid)) + player->AreaExploredOrEventHappens(e.action.quest.quest); + + if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) { - (*itr)->ToCreature()->CallForHelp((float)e.action.callHelp.range); - if (e.action.callHelp.withEmote) + player->GroupEventHappens(e.action.quest.quest, me); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS: Player guidLow %u credited quest %u", + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif + } + } + } + + delete targets; + break; + } + case SMART_ACTION_CAST: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + Unit* caster = me; + // Areatrigger Cast! + if (e.GetScriptType() == SMART_SCRIPT_TYPE_AREATRIGGER) + caster = unit->SummonTrigger(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetOrientation(), 5000); + + if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit) + Trinity::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit); + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (go) + { + // Xinef: may be NULL! + go->CastSpell((*itr)->ToUnit(), e.action.cast.spell); + } + + if (!IsUnit(*itr)) + continue; + + if (caster && caster != me) // Areatrigger cast + { + caster->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); + } + else if (me && (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell))) + { + if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) + me->InterruptNonMeleeSpells(false); + + // Xinef: flag usable only if caster has max dist set + if ((e.action.cast.flags & SMARTCAST_COMBAT_MOVE) && GetCasterMaxDist() > 0.0f && me->GetMaxPower(GetCasterPowerType()) > 0) + { + // Xinef: check mana case only and operate movement accordingly, LoS and range is checked in targetet movement generator + if (me->GetPowerPct(GetCasterPowerType()) < 15.0f) { - TrinityStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL); - sCreatureTextMgr->SendChatPacket(*itr, builder, CHAT_MSG_MONSTER_EMOTE); + SetCasterActualDist(0); + CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(0); + } + else if (GetCasterActualDist() == 0.0f && me->GetPowerPct(GetCasterPowerType()) > 30.0f) + { + RestoreCasterMaxDist(); + CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(GetCasterActualDist()); } } - delete targets; - break; - } - case SMART_ACTION_SET_SHEATH: - { - if (me) - { - me->SetSheath(SheathState(e.action.setSheath.sheath)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature %u, State: %u", - me->GetGUIDLow(), e.action.setSheath.sheath); -#endif } - break; - } - case SMART_ACTION_FORCE_DESPAWN: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - (*itr)->ToCreature()->DespawnOrUnsummon(e.action.forceDespawn.delay + 1); - else if (IsGameObject(*itr)) - (*itr)->ToGameObject()->Delete(); + me->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); } - - delete targets; - break; } - case SMART_ACTION_SET_INGAME_PHASE_MASK: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + delete targets; + break; + } + case SMART_ACTION_INVOKER_CAST: + { + Unit* tempLastInvoker = GetLastInvoker(unit); // xinef: can be used for area triggers cast + if (!tempLastInvoker) + break; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + if (e.action.cast.targetsLimit > 0 && targets->size() > e.action.cast.targetsLimit) + Trinity::Containers::RandomResizeList(*targets, e.action.cast.targetsLimit); + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsUnit(*itr)) + continue; + + if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*itr)->ToUnit()->HasAura(e.action.cast.spell)) { - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetPhaseMask(e.action.ingamePhaseMask.mask, true); - else if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true); + if (e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) + tempLastInvoker->InterruptNonMeleeSpells(false); + + tempLastInvoker->CastSpell((*itr)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); } - - delete targets; - break; } - case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL: + + delete targets; + break; + } + case SMART_ACTION_ADD_AURA: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) { - if (!IsUnit(*itr)) - continue; + (*itr)->ToUnit()->AddAura(e.action.cast.spell, (*itr)->ToUnit()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ADD_AURA: Adding aura %u to unit %u", + e.action.cast.spell, (*itr)->GetGUIDLow()); +#endif + } + } - if (e.action.morphOrMount.creature || e.action.morphOrMount.model) + delete targets; + break; + } + case SMART_ACTION_ACTIVATE_GOBJECT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsGameObject(*itr)) + { + // Activate + // xinef: wtf is this shit? + (*itr)->ToGameObject()->SetLootState(GO_READY); + (*itr)->ToGameObject()->UseDoorOrButton(0, e.action.activateObject.alternative ? true : false, unit); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ACTIVATE_GOBJECT. Gameobject %u (entry: %u) activated", + (*itr)->GetGUIDLow(), (*itr)->GetEntry()); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_RESET_GOBJECT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsGameObject(*itr)) + { + (*itr)->ToGameObject()->ResetDoorOrButton(); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_RESET_GOBJECT. Gameobject %u (entry: %u) reset", + (*itr)->GetGUIDLow(), (*itr)->GetEntry()); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_SET_EMOTE_STATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + { + (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_EMOTESTATE, e.action.emote.emote); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EMOTE_STATE. Unit %u set emotestate to %u", + (*itr)->GetGUIDLow(), e.action.emote.emote); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_SET_UNIT_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + { + if (!e.action.unitFlag.type) { - if (e.action.morphOrMount.creature > 0) - { - if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature)) - (*itr)->ToUnit()->Mount(ObjectMgr::ChooseDisplayId(cInfo)); - } - else - (*itr)->ToUnit()->Mount(e.action.morphOrMount.model); + (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); + //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS", + //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); } else - (*itr)->ToUnit()->Dismount(); - } - - delete targets; - break; - } - case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) { - SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()); - if (!ai) - continue; - - if (e.action.invincHP.percent) - ai->SetInvincibilityHpLevel((*itr)->ToCreature()->CountPctFromMaxHealth(e.action.invincHP.percent)); - else - ai->SetInvincibilityHpLevel(e.action.invincHP.minHP); + (*itr)->ToUnit()->SetFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag); + //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_UNIT_FLAG. Unit %u added flag %u to UNIT_FIELD_FLAGS_2", + //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); } } - - delete targets; - break; } - case SMART_ACTION_SET_DATA: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + delete targets; + break; + } + case SMART_ACTION_REMOVE_UNIT_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) { - if (IsCreature(*itr)) - (*itr)->ToCreature()->AI()->SetData(e.action.setData.field, e.action.setData.data); - else if (IsGameObject(*itr)) - (*itr)->ToGameObject()->AI()->SetData(e.action.setData.field, e.action.setData.data); - } - - delete targets; - break; - } - case SMART_ACTION_MOVE_FORWARD: - { - if (!me) - break; - - float x, y, z; - me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance); - me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, x, y, z); - break; - } - case SMART_ACTION_RISE_UP: - { - if (!me) - break; - - me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + (float)e.action.moveRandom.distance); - break; - } - case SMART_ACTION_SET_VISIBILITY: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetVisible(e.action.visibility.state ? true : false); - - delete targets; - break; - } - case SMART_ACTION_SET_ACTIVE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - (*itr)->setActive(e.action.setActive.state ? true : false); - - delete targets; - break; - } - case SMART_ACTION_ATTACK_START: - { - if (!me) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - // xinef: attack random target - if (Unit* target = Trinity::Containers::SelectRandomContainerElement(*targets)->ToUnit()) - me->AI()->AttackStart(target); - - delete targets; - break; - } - case SMART_ACTION_SUMMON_CREATURE: - { - ObjectList* targets = GetTargets(e, unit); - WorldObject* summoner = GetBaseObject() ? GetBaseObject() : unit; - if (!summoner) - break; - - if (targets) - { - float x, y, z, o; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (!e.action.unitFlag.type) { - (*itr)->GetPosition(x, y, z, o); - x += e.target.x; - y += e.target.y; - z += e.target.z; - o += e.target.o; - if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - { - if (e.action.summonCreature.attackInvoker == 2) // pussywizard: proper attackInvoker implementation, but not spoiling tc shitness - summon->AI()->AttackStart(unit); - else if (e.action.summonCreature.attackInvoker) - summon->AI()->AttackStart((*itr)->ToUnit()); - else if (me && e.action.summonCreature.attackScriptOwner) - summon->AI()->AttackStart(me); - } + (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS, e.action.unitFlag.flag); + //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS", + //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); } - - delete targets; - } - - if (e.GetTargetType() != SMART_TARGET_POSITION) - break; - - if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) - { - if (unit && e.action.summonCreature.attackInvoker) - summon->AI()->AttackStart(unit); - else if (me && e.action.summonCreature.attackScriptOwner) - summon->AI()->AttackStart(me); - } - break; - } - case SMART_ACTION_SUMMON_GO: - { - if (!GetBaseObject()) - break; - - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - float x, y, z, o; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - // xinef: allow gameobjects to summon gameobjects! - //if(!IsUnit((*itr))) - // continue; - - (*itr)->GetPosition(x, y, z, o); - x += e.target.x; - y += e.target.y; - z += e.target.z; - o += e.target.o; - if (!e.action.summonGO.targetsummon) - GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); - else - (*itr)->SummonGameObject(e.action.summonGO.entry, GetBaseObject()->GetPositionX(), GetBaseObject()->GetPositionY(), GetBaseObject()->GetPositionZ(), GetBaseObject()->GetOrientation(), 0, 0, 0, 0, e.action.summonGO.despawnTime); - } - - delete targets; - } - - if (e.GetTargetType() != SMART_TARGET_POSITION) - break; - - GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime); - break; - } - case SMART_ACTION_KILL_UNIT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsUnit(*itr)) - continue; - - Unit::Kill((*itr)->ToUnit(), (*itr)->ToUnit()); - } - - delete targets; - break; - } - case SMART_ACTION_INSTALL_AI_TEMPLATE: - { - InstallTemplate(e); - break; - } - case SMART_ACTION_ADD_ITEM: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsPlayer(*itr)) - continue; - - (*itr)->ToPlayer()->AddItem(e.action.item.entry, e.action.item.count); - } - - delete targets; - break; - } - case SMART_ACTION_REMOVE_ITEM: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsPlayer(*itr)) - continue; - - (*itr)->ToPlayer()->DestroyItemCount(e.action.item.entry, e.action.item.count, true); - } - - delete targets; - break; - } - case SMART_ACTION_STORE_TARGET_LIST: - { - ObjectList* targets = GetTargets(e, unit); - StoreTargetList(targets, e.action.storeTargets.id); - break; - } - case SMART_ACTION_TELEPORT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsPlayer(*itr)) - (*itr)->ToPlayer()->TeleportTo(e.action.teleport.mapID, e.target.x, e.target.y, e.target.z, e.target.o); - else if (IsUnit(*itr)) - (*itr)->ToUnit()->NearTeleportTo(e.target.x, e.target.y, e.target.z, e.target.o); - } - - delete targets; - break; - } - case SMART_ACTION_SET_FLY: - { - if (!IsSmart()) - break; - - CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly); - // Xinef: Set speed if any - if (e.action.setFly.speed) - me->SetSpeed(MOVE_RUN, float(e.action.setFly.speed/100.0f), true); - - // Xinef: this wil be executed only if state is different - me->SetDisableGravity(e.action.setFly.disableGravity); - break; - } - case SMART_ACTION_SET_RUN: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - { - if (IsSmart((*itr)->ToCreature())) - CAST_AI(SmartAI, (*itr)->ToCreature()->AI())->SetRun(e.action.setRun.run); - else - (*itr)->ToCreature()->SetWalk(e.action.setRun.run ? false : true); // Xinef: reversed - } - } - - delete targets; - break; - } - case SMART_ACTION_SET_SWIM: - { - if (!IsSmart()) - break; - - CAST_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim); - break; - } - case SMART_ACTION_SET_COUNTER: - { - if (ObjectList* targets = GetTargets(e, unit)) - { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - { - if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI())) - ai->GetScript()->StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset); - else - sLog->outError("SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping"); - } - else if (IsGameObject(*itr)) - { - if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI())) - ai->GetScript()->StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset); - else - sLog->outError("SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping"); - } - } - - delete targets; - } - else - StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset); - - break; - } - case SMART_ACTION_WP_START: - { - if (!IsSmart()) - break; - - bool run = e.action.wpStart.run; - uint32 entry = e.action.wpStart.pathID; - bool repeat = e.action.wpStart.repeat; - - // Xinef: ensure that SMART_ESCORT_TARGETS contains at least one player reference - bool stored = false; - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsPlayer(*itr)) - { - stored = true; - StoreTargetList(targets, SMART_ESCORT_TARGETS); - break; - } - } - if (!stored) - delete targets; - } - - me->SetReactState((ReactStates)e.action.wpStart.reactState); - CAST_AI(SmartAI, me->AI())->StartPath(run, entry, repeat, unit); - - uint32 quest = e.action.wpStart.quest; - uint32 DespawnTime = e.action.wpStart.despawnTime; - CAST_AI(SmartAI, me->AI())->mEscortQuestID = quest; - CAST_AI(SmartAI, me->AI())->SetDespawnTime(DespawnTime); - break; - } - case SMART_ACTION_WP_PAUSE: - { - if (!IsSmart()) - break; - - uint32 delay = e.action.wpPause.delay; - CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); - break; - } - case SMART_ACTION_WP_STOP: - { - if (!IsSmart()) - break; - - uint32 DespawnTime = e.action.wpStop.despawnTime; - uint32 quest = e.action.wpStop.quest; - bool fail = e.action.wpStop.fail; - CAST_AI(SmartAI, me->AI())->StopPath(DespawnTime, quest, fail); - break; - } - case SMART_ACTION_WP_RESUME: - { - if (!IsSmart()) - break; - - CAST_AI(SmartAI, me->AI())->SetWPPauseTimer(0); - break; - } - case SMART_ACTION_SET_ORIENTATION: - { - if (!me) - break; - - if (e.GetTargetType() == SMART_TARGET_SELF) - { - me->SetFacingTo((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && me->GetTransGUID() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation()); - if (e.action.orientation.quickChange) - me->SetOrientation((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && me->GetTransGUID() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation()); - } - else if (e.GetTargetType() == SMART_TARGET_POSITION) - { - me->SetFacingTo(e.target.o); - if (e.action.orientation.quickChange) - me->SetOrientation(e.target.o); - } - else if (ObjectList* targets = GetTargets(e, unit)) - { - if (!targets->empty()) - { - me->SetFacingToObject(*targets->begin()); - if (e.action.orientation.quickChange) - me->SetInFront(*targets->begin()); - } - - delete targets; - } - - break; - } - case SMART_ACTION_PLAYMOVIE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (!IsPlayer(*itr)) - continue; - - (*itr)->ToPlayer()->SendMovieStart(e.action.movie.entry); - } - - delete targets; - break; - } - case SMART_ACTION_MOVE_TO_POS: - { - if (!IsSmart()) - break; - - WorldObject* target = NULL; - - /*if (e.GetTargetType() == SMART_TARGET_CREATURE_RANGE || e.GetTargetType() == SMART_TARGET_CREATURE_GUID || - e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE || - e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || - e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || - e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER || - e.GetTargetType() == SMART_TARGET_CLOSEST_ENEMY || e.GetTargetType() == SMART_TARGET_CLOSEST_FRIENDLY || - e.GetTargetType() == SMART_TARGET_SELF || e.GetTargetType() == SMART_TARGET_STORED) // Xinef: bieda i rozpierdol TC)*/ - { - if (ObjectList* targets = GetTargets(e, unit)) - { - // xinef: we want to move to random element - target = Trinity::Containers::SelectRandomContainerElement(*targets); - delete targets; - } - } - - if (!target) - { - G3D::Vector3 dest(e.target.x, e.target.y, e.target.z); - if (e.action.MoveToPos.transport) - if (TransportBase* trans = me->GetDirectTransport()) - trans->CalculatePassengerPosition(dest.x, dest.y, dest.z); - - me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); - } - else // Xinef: we can use dest.x, dest.y, dest.z to make offset :) - me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX()+e.target.x, target->GetPositionY()+e.target.y, target->GetPositionZ()+e.target.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); - - break; - } - case SMART_ACTION_MOVE_TO_POS_TARGET: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - return; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - { - Creature* target = (*itr)->ToCreature(); - target->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, e.target.x, e.target.y , e.target.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); - } - } - - delete targets; - break; - } - case SMART_ACTION_RESPAWN_TARGET: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - (*itr)->ToCreature()->Respawn(e.action.RespawnTarget.goRespawnTime); - else if (IsGameObject(*itr)) - { - // Xinef: do not modify respawndelay of already spawned gameobjects QQ - if ((*itr)->ToGameObject()->isSpawnedByDefault()) - (*itr)->ToGameObject()->Respawn(); - else - (*itr)->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.goRespawnTime); - } - } - - delete targets; - break; - } - case SMART_ACTION_CLOSE_GOSSIP: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsPlayer(*itr)) - (*itr)->ToPlayer()->PlayerTalkClass->SendCloseGossip(); - - delete targets; - break; - } - case SMART_ACTION_EQUIP: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (Creature* npc = (*itr)->ToCreature()) - { - uint32 slot[3]; - int8 equipId = (int8)e.action.equip.entry; - if (equipId) - { - EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(npc->GetEntry(), equipId); - if (!einfo) - { - sLog->outError("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u", equipId, npc->GetEntry()); - break; - } - npc->SetCurrentEquipmentId(equipId); - slot[0] = einfo->ItemEntry[0]; - slot[1] = einfo->ItemEntry[1]; - slot[2] = einfo->ItemEntry[2]; - } - else - { - slot[0] = e.action.equip.slot1; - slot[1] = e.action.equip.slot2; - slot[2] = e.action.equip.slot3; - } - if (!e.action.equip.mask || (e.action.equip.mask & 1)) - npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, slot[0]); - if (!e.action.equip.mask || (e.action.equip.mask & 2)) - npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, slot[1]); - if (!e.action.equip.mask || (e.action.equip.mask & 4)) - npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, slot[2]); - } - } - - delete targets; - break; - } - case SMART_ACTION_CREATE_TIMED_EVENT: - { - SmartEvent ne = SmartEvent(); - ne.type = (SMART_EVENT)SMART_EVENT_UPDATE; - ne.event_chance = e.action.timeEvent.chance; - if (!ne.event_chance) ne.event_chance = 100; - - ne.minMaxRepeat.min = e.action.timeEvent.min; - ne.minMaxRepeat.max = e.action.timeEvent.max; - ne.minMaxRepeat.repeatMin = e.action.timeEvent.repeatMin; - ne.minMaxRepeat.repeatMax = e.action.timeEvent.repeatMax; - - ne.event_flags = 0; - if (!ne.minMaxRepeat.repeatMin && !ne.minMaxRepeat.repeatMax) - ne.event_flags |= SMART_EVENT_FLAG_NOT_REPEATABLE; - - SmartAction ac = SmartAction(); - ac.type = (SMART_ACTION)SMART_ACTION_TRIGGER_TIMED_EVENT; - ac.timeEvent.id = e.action.timeEvent.id; - - SmartScriptHolder ev = SmartScriptHolder(); - ev.event = ne; - ev.event_id = e.action.timeEvent.id; - ev.target = e.target; - ev.action = ac; - InitTimer(ev); - mStoredEvents.push_back(ev); - break; - } - case SMART_ACTION_TRIGGER_TIMED_EVENT: - ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, e.action.timeEvent.id); - - // xinef: remove this event if not repeatable - if (e.event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE) - mRemIDs.push_back(e.action.timeEvent.id); - break; - case SMART_ACTION_REMOVE_TIMED_EVENT: - mRemIDs.push_back(e.action.timeEvent.id); - break; - case SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature(*itr)) - { - if (!meOrigGUID) - meOrigGUID = me ? me->GetGUID() : 0; - if (!goOrigGUID) - goOrigGUID = go ? go->GetGUID() : 0; - go = NULL; - me = (*itr)->ToCreature(); - break; - } - else if (IsGameObject(*itr)) - { - if (!meOrigGUID) - meOrigGUID = me ? me->GetGUID() : 0; - if (!goOrigGUID) - goOrigGUID = go ? go->GetGUID() : 0; - go = (*itr)->ToGameObject(); - me = NULL; - break; - } - } - - delete targets; - break; - } - case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT: - ResetBaseObject(); - break; - case SMART_ACTION_CALL_SCRIPT_RESET: - OnReset(); - break; - case SMART_ACTION_SET_RANGED_MOVEMENT: - { - if (!IsSmart()) - break; - - float attackDistance = float(e.action.setRangedMovement.distance); - float attackAngle = float(e.action.setRangedMovement.angle) / 180.0f * M_PI; - - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (Creature* target = (*itr)->ToCreature()) - if (IsSmart(target) && target->GetVictim()) - if (CAST_AI(SmartAI, target->AI())->CanCombatMove()) - target->GetMotionMaster()->MoveChase(target->GetVictim(), attackDistance, attackAngle); - - delete targets; - } - break; - } - case SMART_ACTION_CALL_TIMED_ACTIONLIST: - { - if (e.GetTargetType() == SMART_TARGET_NONE) - { - sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - break; - } - - if (ObjectList* targets = GetTargets(e, unit)) - { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (Creature* target = (*itr)->ToCreature()) - { - if (IsSmart(target)) - CAST_AI(SmartAI, target->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); - } - else if (GameObject* goTarget = (*itr)->ToGameObject()) - { - if (IsSmartGO(goTarget)) - CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); - } - } - - delete targets; - } - break; - } - case SMART_ACTION_SET_NPC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.unitFlag.flag); - - delete targets; - break; - } - case SMART_ACTION_ADD_NPC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); - - delete targets; - break; - } - case SMART_ACTION_REMOVE_NPC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); - - delete targets; - break; - } - case SMART_ACTION_CROSS_CAST: - { - ObjectList* casters = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.crossCast.targetType, e.action.crossCast.targetParam1, e.action.crossCast.targetParam2, e.action.crossCast.targetParam3, 0), unit); - if (!casters) - break; - - ObjectList* targets = GetTargets(e, unit); - if (!targets) - { - delete casters; // casters already validated, delete now - break; - } - - for (ObjectList::const_iterator itr = casters->begin(); itr != casters->end(); ++itr) - { - if (!IsUnit(*itr)) - continue; - - bool interruptedSpell = false; - - for (ObjectList::const_iterator it = targets->begin(); it != targets->end(); ++it) - { - if (!IsUnit(*it)) - continue; - - if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*it)->ToUnit()->HasAura(e.action.cast.spell)) - { - if (!interruptedSpell && e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) - { - (*itr)->ToUnit()->InterruptNonMeleeSpells(false); - interruptedSpell = true; - } - - (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); - } - //else - // TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId())); - } - } - - delete targets; - delete casters; - break; - } - case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST: - { - uint32 actions[SMART_ACTION_PARAM_COUNT]; - actions[0] = e.action.randTimedActionList.entry1; - actions[1] = e.action.randTimedActionList.entry2; - actions[2] = e.action.randTimedActionList.entry3; - actions[3] = e.action.randTimedActionList.entry4; - actions[4] = e.action.randTimedActionList.entry5; - actions[5] = e.action.randTimedActionList.entry6; - uint32 temp[SMART_ACTION_PARAM_COUNT]; - uint32 count = 0; - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) - { - if (actions[i] > 0) - { - temp[count] = actions[i]; - ++count; - } - } - - if (count == 0) - break; - - uint32 id = temp[urand(0, count - 1)]; - if (e.GetTargetType() == SMART_TARGET_NONE) - { - sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - break; - } - - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (Creature* target = (*itr)->ToCreature()) - { - if (IsSmart(target)) - CAST_AI(SmartAI, target->AI())->SetScript9(e, id, GetLastInvoker()); - } - else if (GameObject* goTarget = (*itr)->ToGameObject()) - { - if (IsSmartGO(goTarget)) - CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker()); - } - } - - delete targets; - } - break; - } - case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST: - { - uint32 id = urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2); - if (e.GetTargetType() == SMART_TARGET_NONE) - { - sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); - break; - } - - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (Creature* target = (*itr)->ToCreature()) - { - if (IsSmart(target)) - CAST_AI(SmartAI, target->AI())->SetScript9(e, id, GetLastInvoker()); - } - else if (GameObject* goTarget = (*itr)->ToGameObject()) - { - if (IsSmartGO(goTarget)) - CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker()); - } - } - - delete targets; - } - break; - } - case SMART_ACTION_ACTIVATE_TAXI: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsPlayer(*itr)) - (*itr)->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id); - - delete targets; - break; - } - case SMART_ACTION_RANDOM_MOVE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - bool foundTarget = false; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { - if (IsCreature((*itr))) - { - foundTarget = true; - - if (e.action.moveRandom.distance) - (*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); - else - (*itr)->ToCreature()->GetMotionMaster()->MoveIdle(); - } - } - - if (!foundTarget && me && IsCreature(me)) - { - if (e.action.moveRandom.distance) - me->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); else - me->GetMotionMaster()->MoveIdle(); + { + (*itr)->ToUnit()->RemoveFlag(UNIT_FIELD_FLAGS_2, e.action.unitFlag.flag); + //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_REMOVE_UNIT_FLAG. Unit %u removed flag %u to UNIT_FIELD_FLAGS_2", + //(*itr)->GetGUIDLow(), e.action.unitFlag.flag); + } } - - delete targets; - break; } - case SMART_ACTION_SET_UNIT_FIELD_BYTES_1: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, e.action.setunitByte.type, e.action.setunitByte.byte1); - delete targets; + delete targets; + break; + } + case SMART_ACTION_AUTO_ATTACK: + { + if (!IsSmart()) break; - } - case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, e.action.delunitByte.type, e.action.delunitByte.byte1); - - delete targets; + CAST_AI(SmartAI, me->AI())->SetAutoAttack(e.action.autoAttack.attack); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_AUTO_ATTACK: Creature: %u bool on = %u", + me->GetGUIDLow(), e.action.autoAttack.attack); +#endif + break; + } + case SMART_ACTION_ALLOW_COMBAT_MOVEMENT: + { + if (!IsSmart()) break; - } - case SMART_ACTION_INTERRUPT_SPELL: + + // Xinef: Fix Combat Movement + bool move = e.action.combatMove.move; + if (move && GetMaxCombatDist() && e.GetEventType() == SMART_EVENT_MANA_PCT) { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed, e.action.interruptSpellCasting.spell_id, e.action.interruptSpellCasting.withInstant); - - delete targets; + SetActualCombatDist(0); + CAST_AI(SmartAI, me->AI())->SetForcedCombatMove(0); + } + else + CAST_AI(SmartAI, me->AI())->SetCombatMove(move); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_ALLOW_COMBAT_MOVEMENT: Creature %u bool on = %u", + me->GetGUIDLow(), e.action.combatMove.move); +#endif + break; + } + case SMART_ACTION_SET_EVENT_PHASE: + { + if (!GetBaseObject()) break; - } - case SMART_ACTION_SEND_GO_CUSTOM_ANIM: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim); - - delete targets; + SetPhase(e.action.setEventPhase.phase); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SET_EVENT_PHASE: Creature %u set event phase %u", + GetBaseObject()->GetGUIDLow(), e.action.setEventPhase.phase); +#endif + break; + } + case SMART_ACTION_INC_EVENT_PHASE: + { + if (!GetBaseObject()) break; - } - case SMART_ACTION_SET_DYNAMIC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetUInt32Value(UNIT_DYNAMIC_FLAGS, e.action.unitFlag.flag); - - delete targets; + IncPhase(e.action.incEventPhase.inc); + DecPhase(e.action.incEventPhase.dec); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_INC_EVENT_PHASE: Creature %u inc event phase by %u, " + "decrease by %u", GetBaseObject()->GetGUIDLow(), e.action.incEventPhase.inc, e.action.incEventPhase.dec); +#endif + break; + } + case SMART_ACTION_EVADE: + { + if (!GetBaseObject()) break; - } - case SMART_ACTION_ADD_DYNAMIC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetFlag(UNIT_DYNAMIC_FLAGS, e.action.unitFlag.flag); - - delete targets; + ObjectList* targets = GetTargets(e, unit); + if (!targets) break; - } - case SMART_ACTION_REMOVE_DYNAMIC_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->RemoveFlag(UNIT_DYNAMIC_FLAGS, e.action.unitFlag.flag); + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature((*itr))) + if ((*itr)->ToCreature()->IsAIEnabled) + (*itr)->ToCreature()->AI()->EnterEvadeMode(); - delete targets; + delete targets; + break; + } + case SMART_ACTION_FLEE_FOR_ASSIST: + { + // Xinef: do not allow to flee without control (stun, fear etc) + if (!me || me->HasUnitState(UNIT_STATE_LOST_CONTROL) || me->GetSpeed(MOVE_RUN) < 0.1f) break; - } - case SMART_ACTION_JUMP_TO_POS: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - // xinef: my implementation - if (e.action.jump.selfJump) + me->DoFleeToGetAssistance(); + if (e.action.flee.withEmote) + { + TrinityStringTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, LANG_FLEE, LANG_UNIVERSAL, NULL); + sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE); + } +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: Creature %u DoFleeToGetAssistance", me->GetGUIDLow()); +#endif + break; + } + case SMART_ACTION_COMBAT_STOP: + { + if (!me) + break; + + me->CombatStop(true); + break; + } + case SMART_ACTION_CALL_GROUPEVENTHAPPENS: + { + if (!GetBaseObject()) + break; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit((*itr))) { - if (WorldObject* target = Trinity::Containers::SelectRandomContainerElement(*targets)) - if (me) - me->GetMotionMaster()->MoveJump(target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); + if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) + player->GroupEventHappens(e.action.quest.quest, GetBaseObject()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_GROUPEVENTHAPPENS: Player %u, group credit for quest %u", + (*itr)->GetGUIDLow(), e.action.quest.quest); +#endif + } + } + + delete targets; + break; + } + case SMART_ACTION_REMOVEAURASFROMSPELL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsUnit((*itr))) + continue; + + if (e.action.removeAura.spell) + { + if (e.action.removeAura.charges) + { + if (Aura* aur = (*itr)->ToUnit()->GetAura(e.action.removeAura.spell)) + aur->ModCharges(-static_cast(e.action.removeAura.charges), AURA_REMOVE_BY_EXPIRE); + } + else + (*itr)->ToUnit()->RemoveAurasDueToSpell(e.action.removeAura.spell); } else - { - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (WorldObject* obj = (*itr)) - { - if (Creature* creature = obj->ToCreature()) - creature->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); - } - } + (*itr)->ToUnit()->RemoveAllAuras(); - delete targets; +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_REMOVEAURASFROMSPELL: Unit %u, spell %u", + (*itr)->GetGUIDLow(), e.action.removeAura.spell); +#endif + } + + delete targets; + break; + } + case SMART_ACTION_FOLLOW: + { + if (!IsSmart()) + break; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + { + CAST_AI(SmartAI, me->AI())->StopFollow(false); break; } - case SMART_ACTION_GO_SET_LOOT_STATE: + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit((*itr))) + { + float angle = e.action.follow.angle > 6 ? (e.action.follow.angle * M_PI / 180.0f) : e.action.follow.angle; + CAST_AI(SmartAI, me->AI())->SetFollow((*itr)->ToUnit(), float(int32(e.action.follow.dist)) + 0.1f, angle, e.action.follow.credit, e.action.follow.entry, e.action.follow.creditType, e.action.follow.aliveState); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_FOLLOW: Creature %u following target %u", + me->GetGUIDLow(), (*itr)->GetGUIDLow()); +#endif + break; + } + } + + delete targets; + break; + } + case SMART_ACTION_RANDOM_PHASE: + { + if (!GetBaseObject()) + break; + + uint32 phases[SMART_ACTION_PARAM_COUNT]; + phases[0] = e.action.randomPhase.phase1; + phases[1] = e.action.randomPhase.phase2; + phases[2] = e.action.randomPhase.phase3; + phases[3] = e.action.randomPhase.phase4; + phases[4] = e.action.randomPhase.phase5; + phases[5] = e.action.randomPhase.phase6; + uint32 temp[SMART_ACTION_PARAM_COUNT]; + uint32 count = 0; + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + if (phases[i] > 0) + { + temp[count] = phases[i]; + ++count; + } + } + + if (count == 0) + break; + + uint32 phase = temp[urand(0, count - 1)]; + SetPhase(phase); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE: Creature %u sets event phase to %u", + GetBaseObject()->GetGUIDLow(), phase); +#endif + break; + } + case SMART_ACTION_RANDOM_PHASE_RANGE: + { + if (!GetBaseObject()) + break; + + uint32 phase = urand(e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax); + SetPhase(phase); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_RANDOM_PHASE_RANGE: Creature %u sets event phase to %u", + GetBaseObject()->GetGUIDLow(), phase); +#endif + break; + } + case SMART_ACTION_CALL_KILLEDMONSTER: + { + if (trigger && IsPlayer(unit)) + { + unit->ToPlayer()->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, unit); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: (trigger == true) Player %u, Killcredit: %u", + unit->GetGUIDLow(), e.action.killedMonster.creature); +#endif + } + else if (e.target.type == SMART_TARGET_NONE || e.target.type == SMART_TARGET_SELF) // Loot recipient and his group members + { + if (!me) + break; + + if (Player* player = me->GetLootRecipient()) + { + player->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, player); + //TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", + // player->GetGUIDLow(), e.action.killedMonster.creature); + } + } + else // Specific target type { ObjectList* targets = GetTargets(e, unit); if (!targets) break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SetLootState((LootState)e.action.setGoLootState.state); - - delete targets; - break; - } - case SMART_ACTION_SEND_TARGET_TO_TARGET: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - ObjectList* storedTargets = GetTargetList(e.action.sendTargetToTarget.id); - if (!storedTargets) { - delete targets; - break; + if (!IsUnit(*itr)) + continue; + + Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself(); + if (!player) + continue; + + player->RewardPlayerAndGroupAtEvent(e.action.killedMonster.creature, player); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_CALL_KILLEDMONSTER: Player %u, Killcredit: %u", + (*itr)->GetGUIDLow(), e.action.killedMonster.creature); +#endif } + delete targets; + } + break; + } + case SMART_ACTION_SET_INST_DATA: + { + WorldObject* obj = GetBaseObject(); + if (!obj) + obj = unit; + + if (!obj) + break; + + InstanceScript* instance = obj->GetInstanceScript(); + if (!instance) + { + sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); + break; + } + + instance->SetData(e.action.setInstanceData.field, e.action.setInstanceData.data); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA: Field: %u, data: %u", + e.action.setInstanceData.field, e.action.setInstanceData.data); +#endif + break; + } + case SMART_ACTION_SET_INST_DATA64: + { + WorldObject* obj = GetBaseObject(); + if (!obj) + obj = unit; + + if (!obj) + break; + + InstanceScript* instance = obj->GetInstanceScript(); + if (!instance) + { + sLog->outErrorDb("SmartScript: Event %u attempt to set instance data without instance script. EntryOrGuid %d", e.GetEventType(), e.entryOrGuid); + break; + } + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + instance->SetData64(e.action.setInstanceData64.field, targets->front()->GetGUID()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_INST_DATA64: Field: %u, data: %u", + e.action.setInstanceData64.field, targets->front()->GetGUID()); +#endif + delete targets; + break; + } + case SMART_ACTION_UPDATE_TEMPLATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, NULL, !e.action.updateTemplate.doNotChangeLevel); + + delete targets; + break; + } + case SMART_ACTION_DIE: + { + if (me && !me->isDead()) + { + Unit::Kill(me, me); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature %u", me->GetGUIDLow()); +#endif + } + break; + } + case SMART_ACTION_SET_IN_COMBAT_WITH_ZONE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->SetInCombatWithZone(); + + delete targets; + break; + } + case SMART_ACTION_CALL_FOR_HELP: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + { + (*itr)->ToCreature()->CallForHelp((float)e.action.callHelp.range); + if (e.action.callHelp.withEmote) + { + TrinityStringTextBuilder builder(*itr, CHAT_MSG_MONSTER_EMOTE, LANG_CALL_FOR_HELP, LANG_UNIVERSAL, NULL); + sCreatureTextMgr->SendChatPacket(*itr, builder, CHAT_MSG_MONSTER_EMOTE); + } + } + + delete targets; + break; + } + case SMART_ACTION_SET_SHEATH: + { + if (me) + { + me->SetSheath(SheathState(e.action.setSheath.sheath)); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction: SMART_ACTION_SET_SHEATH: Creature %u, State: %u", + me->GetGUIDLow(), e.action.setSheath.sheath); +#endif + } + break; + } + case SMART_ACTION_FORCE_DESPAWN: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + (*itr)->ToCreature()->DespawnOrUnsummon(e.action.forceDespawn.delay + 1); + else if (IsGameObject(*itr)) + (*itr)->ToGameObject()->Delete(); + } + + delete targets; + break; + } + case SMART_ACTION_SET_INGAME_PHASE_MASK: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetPhaseMask(e.action.ingamePhaseMask.mask, true); + else if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true); + } + + delete targets; + break; + } + case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsUnit(*itr)) + continue; + + if (e.action.morphOrMount.creature || e.action.morphOrMount.model) + { + if (e.action.morphOrMount.creature > 0) + { + if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(e.action.morphOrMount.creature)) + (*itr)->ToUnit()->Mount(ObjectMgr::ChooseDisplayId(cInfo)); + } + else + (*itr)->ToUnit()->Mount(e.action.morphOrMount.model); + } + else + (*itr)->ToUnit()->Dismount(); + } + + delete targets; + break; + } + case SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + { + SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()); + if (!ai) + continue; + + if (e.action.invincHP.percent) + ai->SetInvincibilityHpLevel((*itr)->ToCreature()->CountPctFromMaxHealth(e.action.invincHP.percent)); + else + ai->SetInvincibilityHpLevel(e.action.invincHP.minHP); + } + } + + delete targets; + break; + } + case SMART_ACTION_SET_DATA: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + (*itr)->ToCreature()->AI()->SetData(e.action.setData.field, e.action.setData.data); + else if (IsGameObject(*itr)) + (*itr)->ToGameObject()->AI()->SetData(e.action.setData.field, e.action.setData.data); + } + + delete targets; + break; + } + case SMART_ACTION_MOVE_FORWARD: + { + if (!me) + break; + + float x, y, z; + me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)e.action.moveRandom.distance); + me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, x, y, z); + break; + } + case SMART_ACTION_RISE_UP: + { + if (!me) + break; + + me->GetMotionMaster()->MovePoint(SMART_RANDOM_POINT, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + (float)e.action.moveRandom.distance); + break; + } + case SMART_ACTION_SET_VISIBILITY: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetVisible(e.action.visibility.state ? true : false); + + delete targets; + break; + } + case SMART_ACTION_SET_ACTIVE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + (*itr)->setActive(e.action.setActive.state ? true : false); + + delete targets; + break; + } + case SMART_ACTION_ATTACK_START: + { + if (!me) + break; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + // xinef: attack random target + if (Unit* target = Trinity::Containers::SelectRandomContainerElement(*targets)->ToUnit()) + me->AI()->AttackStart(target); + + delete targets; + break; + } + case SMART_ACTION_SUMMON_CREATURE: + { + ObjectList* targets = GetTargets(e, unit); + WorldObject* summoner = GetBaseObject() ? GetBaseObject() : unit; + if (!summoner) + break; + + if (targets) + { + float x, y, z, o; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + (*itr)->GetPosition(x, y, z, o); + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; + if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, x, y, z, o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) + { + if (e.action.summonCreature.attackInvoker == 2) // pussywizard: proper attackInvoker implementation, but not spoiling tc shitness + summon->AI()->AttackStart(unit); + else if (e.action.summonCreature.attackInvoker) + summon->AI()->AttackStart((*itr)->ToUnit()); + else if (me && e.action.summonCreature.attackScriptOwner) + summon->AI()->AttackStart(me); + } + } + + delete targets; + } + + if (e.GetTargetType() != SMART_TARGET_POSITION) + break; + + if (Creature* summon = summoner->SummonCreature(e.action.summonCreature.creature, e.target.x, e.target.y, e.target.z, e.target.o, (TempSummonType)e.action.summonCreature.type, e.action.summonCreature.duration)) + { + if (unit && e.action.summonCreature.attackInvoker) + summon->AI()->AttackStart(unit); + else if (me && e.action.summonCreature.attackScriptOwner) + summon->AI()->AttackStart(me); + } + break; + } + case SMART_ACTION_SUMMON_GO: + { + if (!GetBaseObject()) + break; + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + float x, y, z, o; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + // xinef: allow gameobjects to summon gameobjects! + //if(!IsUnit((*itr))) + // continue; + + (*itr)->GetPosition(x, y, z, o); + x += e.target.x; + y += e.target.y; + z += e.target.z; + o += e.target.o; + if (!e.action.summonGO.targetsummon) + GetBaseObject()->SummonGameObject(e.action.summonGO.entry, x, y, z, o, 0, 0, 0, 0, e.action.summonGO.despawnTime); + else + (*itr)->SummonGameObject(e.action.summonGO.entry, GetBaseObject()->GetPositionX(), GetBaseObject()->GetPositionY(), GetBaseObject()->GetPositionZ(), GetBaseObject()->GetOrientation(), 0, 0, 0, 0, e.action.summonGO.despawnTime); + } + + delete targets; + } + + if (e.GetTargetType() != SMART_TARGET_POSITION) + break; + + GetBaseObject()->SummonGameObject(e.action.summonGO.entry, e.target.x, e.target.y, e.target.z, e.target.o, 0, 0, 0, 0, e.action.summonGO.despawnTime); + break; + } + case SMART_ACTION_KILL_UNIT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsUnit(*itr)) + continue; + + Unit::Kill((*itr)->ToUnit(), (*itr)->ToUnit()); + } + + delete targets; + break; + } + case SMART_ACTION_INSTALL_AI_TEMPLATE: + { + InstallTemplate(e); + break; + } + case SMART_ACTION_ADD_ITEM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsPlayer(*itr)) + continue; + + (*itr)->ToPlayer()->AddItem(e.action.item.entry, e.action.item.count); + } + + delete targets; + break; + } + case SMART_ACTION_REMOVE_ITEM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (!IsPlayer(*itr)) + continue; + + (*itr)->ToPlayer()->DestroyItemCount(e.action.item.entry, e.action.item.count, true); + } + + delete targets; + break; + } + case SMART_ACTION_STORE_TARGET_LIST: + { + ObjectList* targets = GetTargets(e, unit); + StoreTargetList(targets, e.action.storeTargets.id); + break; + } + case SMART_ACTION_TELEPORT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsPlayer(*itr)) + (*itr)->ToPlayer()->TeleportTo(e.action.teleport.mapID, e.target.x, e.target.y, e.target.z, e.target.o); + else if (IsUnit(*itr)) + (*itr)->ToUnit()->NearTeleportTo(e.target.x, e.target.y, e.target.z, e.target.o); + } + + delete targets; + break; + } + case SMART_ACTION_SET_FLY: + { + if (!IsSmart()) + break; + + CAST_AI(SmartAI, me->AI())->SetFly(e.action.setFly.fly); + // Xinef: Set speed if any + if (e.action.setFly.speed) + me->SetSpeed(MOVE_RUN, float(e.action.setFly.speed / 100.0f), true); + + // Xinef: this wil be executed only if state is different + me->SetDisableGravity(e.action.setFly.disableGravity); + break; + } + case SMART_ACTION_SET_RUN: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + { + if (IsSmart((*itr)->ToCreature())) + CAST_AI(SmartAI, (*itr)->ToCreature()->AI())->SetRun(e.action.setRun.run); + else + (*itr)->ToCreature()->SetWalk(e.action.setRun.run ? false : true); // Xinef: reversed + } + } + + delete targets; + break; + } + case SMART_ACTION_SET_SWIM: + { + if (!IsSmart()) + break; + + CAST_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim); + break; + } + case SMART_ACTION_SET_COUNTER: + { + if (ObjectList* targets = GetTargets(e, unit)) + { for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { if (IsCreature(*itr)) { if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI())) - ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list + ai->GetScript()->StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset); else - sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping"); + sLog->outError("SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartAI, skipping"); } else if (IsGameObject(*itr)) { if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI())) - ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list + ai->GetScript()->StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset); else - sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping"); + sLog->outError("SmartScript: Action target for SMART_ACTION_SET_COUNTER is not using SmartGameObjectAI, skipping"); } } delete targets; - break; } - case SMART_ACTION_SEND_GOSSIP_MENU: + else + StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset); + + break; + } + case SMART_ACTION_WP_START: + { + if (!IsSmart()) + break; + + bool run = e.action.wpStart.run; + uint32 entry = e.action.wpStart.pathID; + bool repeat = e.action.wpStart.repeat; + + // Xinef: ensure that SMART_ESCORT_TARGETS contains at least one player reference + bool stored = false; + ObjectList* targets = GetTargets(e, unit); + if (targets) { - if (!GetBaseObject()) - break; - -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", - e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); -#endif - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (Player* player = (*itr)->ToPlayer()) + { + if (IsPlayer(*itr)) { - if (e.action.sendGossipMenu.gossipMenuId) - player->PrepareGossipMenu(GetBaseObject(), e.action.sendGossipMenu.gossipMenuId, true); - else - player->PlayerTalkClass->ClearMenus(); - - player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipNpcTextId, GetBaseObject()->GetGUID()); + stored = true; + StoreTargetList(targets, SMART_ESCORT_TARGETS); + break; } + } + if (!stored) + delete targets; + } + + me->SetReactState((ReactStates)e.action.wpStart.reactState); + CAST_AI(SmartAI, me->AI())->StartPath(run, entry, repeat, unit); + + uint32 quest = e.action.wpStart.quest; + uint32 DespawnTime = e.action.wpStart.despawnTime; + CAST_AI(SmartAI, me->AI())->mEscortQuestID = quest; + CAST_AI(SmartAI, me->AI())->SetDespawnTime(DespawnTime); + break; + } + case SMART_ACTION_WP_PAUSE: + { + if (!IsSmart()) + break; + + uint32 delay = e.action.wpPause.delay; + CAST_AI(SmartAI, me->AI())->PausePath(delay, e.GetEventType() == SMART_EVENT_WAYPOINT_REACHED ? false : true); + break; + } + case SMART_ACTION_WP_STOP: + { + if (!IsSmart()) + break; + + uint32 DespawnTime = e.action.wpStop.despawnTime; + uint32 quest = e.action.wpStop.quest; + bool fail = e.action.wpStop.fail; + CAST_AI(SmartAI, me->AI())->StopPath(DespawnTime, quest, fail); + break; + } + case SMART_ACTION_WP_RESUME: + { + if (!IsSmart()) + break; + + CAST_AI(SmartAI, me->AI())->SetWPPauseTimer(0); + break; + } + case SMART_ACTION_SET_ORIENTATION: + { + if (!me) + break; + + if (e.GetTargetType() == SMART_TARGET_SELF) + { + me->SetFacingTo((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && me->GetTransGUID() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation()); + if (e.action.orientation.quickChange) + me->SetOrientation((me->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT) && me->GetTransGUID() ? me->GetTransportHomePosition() : me->GetHomePosition()).GetOrientation()); + } + else if (e.GetTargetType() == SMART_TARGET_POSITION) + { + me->SetFacingTo(e.target.o); + if (e.action.orientation.quickChange) + me->SetOrientation(e.target.o); + } + else if (ObjectList* targets = GetTargets(e, unit)) + { + if (!targets->empty()) + { + me->SetFacingToObject(*targets->begin()); + if (e.action.orientation.quickChange) + me->SetInFront(*targets->begin()); + } delete targets; - break; } - case SMART_ACTION_SET_HOME_POS: + + break; + } + case SMART_ACTION_PLAYMOVIE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - ObjectList* targets = GetTargets(e, unit); - if (targets) + if (!IsPlayer(*itr)) + continue; + + (*itr)->ToPlayer()->SendMovieStart(e.action.movie.entry); + } + + delete targets; + break; + } + case SMART_ACTION_MOVE_TO_POS: + { + if (!IsSmart()) + break; + + WorldObject* target = NULL; + + /*if (e.GetTargetType() == SMART_TARGET_CREATURE_RANGE || e.GetTargetType() == SMART_TARGET_CREATURE_GUID || + e.GetTargetType() == SMART_TARGET_CREATURE_DISTANCE || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_RANGE || + e.GetTargetType() == SMART_TARGET_GAMEOBJECT_GUID || e.GetTargetType() == SMART_TARGET_GAMEOBJECT_DISTANCE || + e.GetTargetType() == SMART_TARGET_CLOSEST_CREATURE || e.GetTargetType() == SMART_TARGET_CLOSEST_GAMEOBJECT || + e.GetTargetType() == SMART_TARGET_OWNER_OR_SUMMONER || e.GetTargetType() == SMART_TARGET_ACTION_INVOKER || + e.GetTargetType() == SMART_TARGET_CLOSEST_ENEMY || e.GetTargetType() == SMART_TARGET_CLOSEST_FRIENDLY || + e.GetTargetType() == SMART_TARGET_SELF || e.GetTargetType() == SMART_TARGET_STORED) // Xinef: bieda i rozpierdol TC)*/ + { + if (ObjectList* targets = GetTargets(e, unit)) { - float x, y, z, o; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - { - if (e.action.setHomePos.spawnPos) - { - (*itr)->ToCreature()->GetRespawnPosition(x, y, z, &o); - (*itr)->ToCreature()->SetHomePosition(x, y, z, o); - } - else - (*itr)->ToCreature()->SetHomePosition((*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), (*itr)->GetOrientation()); - - } + // xinef: we want to move to random element + target = Trinity::Containers::SelectRandomContainerElement(*targets); delete targets; } - else if (me && e.GetTargetType() == SMART_TARGET_POSITION) + } + + if (!target) + { + G3D::Vector3 dest(e.target.x, e.target.y, e.target.z); + if (e.action.MoveToPos.transport) + if (TransportBase* trans = me->GetDirectTransport()) + trans->CalculatePassengerPosition(dest.x, dest.y, dest.z); + + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, dest.x, dest.y, dest.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); + } + else // Xinef: we can use dest.x, dest.y, dest.z to make offset :) + me->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); + + break; + } + case SMART_ACTION_MOVE_TO_POS_TARGET: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + return; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) { - if (e.action.setHomePos.spawnPos) + Creature* target = (*itr)->ToCreature(); + target->GetMotionMaster()->MovePoint(e.action.MoveToPos.pointId, e.target.x, e.target.y, e.target.z, true, true, e.action.MoveToPos.controlled ? MOTION_SLOT_CONTROLLED : MOTION_SLOT_ACTIVE); + } + } + + delete targets; + break; + } + case SMART_ACTION_RESPAWN_TARGET: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + (*itr)->ToCreature()->Respawn(e.action.RespawnTarget.goRespawnTime); + else if (IsGameObject(*itr)) + { + // Xinef: do not modify respawndelay of already spawned gameobjects QQ + if ((*itr)->ToGameObject()->isSpawnedByDefault()) + (*itr)->ToGameObject()->Respawn(); + else + (*itr)->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.goRespawnTime); + } + } + + delete targets; + break; + } + case SMART_ACTION_CLOSE_GOSSIP: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsPlayer(*itr)) + (*itr)->ToPlayer()->PlayerTalkClass->SendCloseGossip(); + + delete targets; + break; + } + case SMART_ACTION_EQUIP: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (Creature* npc = (*itr)->ToCreature()) + { + uint32 slot[3]; + int8 equipId = (int8)e.action.equip.entry; + if (equipId) { - float x, y, z, o; - me->GetRespawnPosition(x, y, z, &o); - me->SetHomePosition(x, y, z, o); + EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(npc->GetEntry(), equipId); + if (!einfo) + { + sLog->outError("SmartScript: SMART_ACTION_EQUIP uses non-existent equipment info id %u for creature %u", equipId, npc->GetEntry()); + break; + } + npc->SetCurrentEquipmentId(equipId); + slot[0] = einfo->ItemEntry[0]; + slot[1] = einfo->ItemEntry[1]; + slot[2] = einfo->ItemEntry[2]; } else - me->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o); - } - break; - } - /*{ - ObjectList* movers = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.sethome.targetType, e.action.sethome.targetParam1, e.action.sethome.targetParam2, e.action.sethome.targetParam3, 0), unit); - if (!movers) - break; - - if (e.GetTargetType() == SMART_TARGET_POSITION) - { - for (ObjectList::const_iterator itr = movers->begin(); itr != movers->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o); - } - else if (ObjectList* targets = GetTargets(e, unit)) - { - if (WorldObject* target = targets->front()) - for (ObjectList::const_iterator itr = movers->begin(); itr != movers->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation()); - - delete targets; - } - - delete movers; - break; - }*/ - case SMART_ACTION_SET_HEALTH_REGEN: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->SetRegeneratingHealth(e.action.setHealthRegen.regenHealth); - - delete targets; - break; - } - case SMART_ACTION_SET_ROOT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->SetControlled(e.action.setRoot.root, UNIT_STATE_ROOT); - - delete targets; - break; - } - case SMART_ACTION_SET_GO_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SetUInt32Value(GAMEOBJECT_FLAGS, e.action.goFlag.flag); - - delete targets; - break; - } - case SMART_ACTION_ADD_GO_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SetFlag(GAMEOBJECT_FLAGS, e.action.goFlag.flag); - - delete targets; - break; - } - case SMART_ACTION_REMOVE_GO_FLAG: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsGameObject(*itr)) - (*itr)->ToGameObject()->RemoveFlag(GAMEOBJECT_FLAGS, e.action.goFlag.flag); - - delete targets; - break; - } - case SMART_ACTION_SUMMON_CREATURE_GROUP: - { - std::list summonList; - GetBaseObject()->SummonCreatureGroup(e.action.creatureGroup.group, &summonList); - - for (std::list::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr) - { - if (unit && e.action.creatureGroup.attackInvoker) - (*itr)->AI()->AttackStart(unit); - else if (me && e.action.creatureGroup.attackScriptOwner) - (*itr)->AI()->AttackStart(me); - } - - break; - } - case SMART_ACTION_SET_POWER: - { - ObjectList* targets = GetTargets(e, unit); - - if (targets) - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), e.action.power.newPower); - - delete targets; - break; - } - case SMART_ACTION_ADD_POWER: - { - ObjectList* targets = GetTargets(e, unit); - - if (targets) - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), (*itr)->ToUnit()->GetPower(Powers(e.action.power.powerType)) + e.action.power.newPower); - - delete targets; - break; - } - case SMART_ACTION_REMOVE_POWER: - { - ObjectList* targets = GetTargets(e, unit); - - if (targets) - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), (*itr)->ToUnit()->GetPower(Powers(e.action.power.powerType)) - e.action.power.newPower); - - delete targets; - break; - } - case SMART_ACTION_GAME_EVENT_STOP: - { - uint32 eventId = e.action.gameEventStop.id; - if (!sGameEventMgr->IsActiveEvent(eventId)) - { - sLog->outError("SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: %u)", eventId); - break; - } - sGameEventMgr->StopEvent(eventId, true); - break; - } - case SMART_ACTION_GAME_EVENT_START: - { - uint32 eventId = e.action.gameEventStart.id; - if (sGameEventMgr->IsActiveEvent(eventId)) - { - sLog->outError("SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: %u)", eventId); - break; - } - sGameEventMgr->StartEvent(eventId, true); - break; - } - case SMART_ACTION_START_CLOSEST_WAYPOINT: - { - uint32 waypoints[SMART_ACTION_PARAM_COUNT]; - waypoints[0] = e.action.closestWaypointFromList.wp1; - waypoints[1] = e.action.closestWaypointFromList.wp2; - waypoints[2] = e.action.closestWaypointFromList.wp3; - waypoints[3] = e.action.closestWaypointFromList.wp4; - waypoints[4] = e.action.closestWaypointFromList.wp5; - waypoints[5] = e.action.closestWaypointFromList.wp6; - float distanceToClosest = std::numeric_limits::max(); - WayPoint* closestWp = NULL; - - ObjectList* targets = GetTargets(e, unit); - if (targets) - { - for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) { - if (Creature* target = (*itr)->ToCreature()) + slot[0] = e.action.equip.slot1; + slot[1] = e.action.equip.slot2; + slot[2] = e.action.equip.slot3; + } + if (!e.action.equip.mask || (e.action.equip.mask & 1)) + npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, slot[0]); + if (!e.action.equip.mask || (e.action.equip.mask & 2)) + npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, slot[1]); + if (!e.action.equip.mask || (e.action.equip.mask & 4)) + npc->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, slot[2]); + } + } + + delete targets; + break; + } + case SMART_ACTION_CREATE_TIMED_EVENT: + { + SmartEvent ne = SmartEvent(); + ne.type = (SMART_EVENT)SMART_EVENT_UPDATE; + ne.event_chance = e.action.timeEvent.chance; + if (!ne.event_chance) ne.event_chance = 100; + + ne.minMaxRepeat.min = e.action.timeEvent.min; + ne.minMaxRepeat.max = e.action.timeEvent.max; + ne.minMaxRepeat.repeatMin = e.action.timeEvent.repeatMin; + ne.minMaxRepeat.repeatMax = e.action.timeEvent.repeatMax; + + ne.event_flags = 0; + if (!ne.minMaxRepeat.repeatMin && !ne.minMaxRepeat.repeatMax) + ne.event_flags |= SMART_EVENT_FLAG_NOT_REPEATABLE; + + SmartAction ac = SmartAction(); + ac.type = (SMART_ACTION)SMART_ACTION_TRIGGER_TIMED_EVENT; + ac.timeEvent.id = e.action.timeEvent.id; + + SmartScriptHolder ev = SmartScriptHolder(); + ev.event = ne; + ev.event_id = e.action.timeEvent.id; + ev.target = e.target; + ev.action = ac; + InitTimer(ev); + mStoredEvents.push_back(ev); + break; + } + case SMART_ACTION_TRIGGER_TIMED_EVENT: + ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, e.action.timeEvent.id); + + // xinef: remove this event if not repeatable + if (e.event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE) + mRemIDs.push_back(e.action.timeEvent.id); + break; + case SMART_ACTION_REMOVE_TIMED_EVENT: + mRemIDs.push_back(e.action.timeEvent.id); + break; + case SMART_ACTION_OVERRIDE_SCRIPT_BASE_OBJECT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + { + if (!meOrigGUID) + meOrigGUID = me ? me->GetGUID() : 0; + if (!goOrigGUID) + goOrigGUID = go ? go->GetGUID() : 0; + go = NULL; + me = (*itr)->ToCreature(); + break; + } + else if (IsGameObject(*itr)) + { + if (!meOrigGUID) + meOrigGUID = me ? me->GetGUID() : 0; + if (!goOrigGUID) + goOrigGUID = go ? go->GetGUID() : 0; + go = (*itr)->ToGameObject(); + me = NULL; + break; + } + } + + delete targets; + break; + } + case SMART_ACTION_RESET_SCRIPT_BASE_OBJECT: + ResetBaseObject(); + break; + case SMART_ACTION_CALL_SCRIPT_RESET: + OnReset(); + break; + case SMART_ACTION_SET_RANGED_MOVEMENT: + { + if (!IsSmart()) + break; + + float attackDistance = float(e.action.setRangedMovement.distance); + float attackAngle = float(e.action.setRangedMovement.angle) / 180.0f * M_PI; + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (Creature* target = (*itr)->ToCreature()) + if (IsSmart(target) && target->GetVictim()) + if (CAST_AI(SmartAI, target->AI())->CanCombatMove()) + target->GetMotionMaster()->MoveChase(target->GetVictim(), attackDistance, attackAngle); + + delete targets; + } + break; + } + case SMART_ACTION_CALL_TIMED_ACTIONLIST: + { + if (e.GetTargetType() == SMART_TARGET_NONE) + { + sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); + break; + } + + if (ObjectList* targets = GetTargets(e, unit)) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (Creature* target = (*itr)->ToCreature()) + { + if (IsSmart(target)) + CAST_AI(SmartAI, target->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); + } + else if (GameObject* goTarget = (*itr)->ToGameObject()) + { + if (IsSmartGO(goTarget)) + CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker()); + } + } + + delete targets; + } + break; + } + case SMART_ACTION_SET_NPC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_ADD_NPC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_REMOVE_NPC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_CROSS_CAST: + { + ObjectList* casters = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.crossCast.targetType, e.action.crossCast.targetParam1, e.action.crossCast.targetParam2, e.action.crossCast.targetParam3, 0), unit); + if (!casters) + break; + + ObjectList* targets = GetTargets(e, unit); + if (!targets) + { + delete casters; // casters already validated, delete now + break; + } + + for (ObjectList::const_iterator itr = casters->begin(); itr != casters->end(); ++itr) + { + if (!IsUnit(*itr)) + continue; + + bool interruptedSpell = false; + + for (ObjectList::const_iterator it = targets->begin(); it != targets->end(); ++it) + { + if (!IsUnit(*it)) + continue; + + if (!(e.action.cast.flags & SMARTCAST_AURA_NOT_PRESENT) || !(*it)->ToUnit()->HasAura(e.action.cast.spell)) + { + if (!interruptedSpell && e.action.cast.flags & SMARTCAST_INTERRUPT_PREVIOUS) { - if (IsSmart(target)) + (*itr)->ToUnit()->InterruptNonMeleeSpells(false); + interruptedSpell = true; + } + + (*itr)->ToUnit()->CastSpell((*it)->ToUnit(), e.action.cast.spell, (e.action.cast.flags & SMARTCAST_TRIGGERED)); + } + //else + // TC_LOG_DEBUG(LOG_FILTER_DATABASE_AI, "Spell %u not casted because it has flag SMARTCAST_AURA_NOT_PRESENT and the target (Guid: " UI64FMTD " Entry: %u Type: %u) already has the aura", e.action.cast.spell, (*it)->GetGUID(), (*it)->GetEntry(), uint32((*it)->GetTypeId())); + } + } + + delete targets; + delete casters; + break; + } + case SMART_ACTION_CALL_RANDOM_TIMED_ACTIONLIST: + { + uint32 actions[SMART_ACTION_PARAM_COUNT]; + actions[0] = e.action.randTimedActionList.entry1; + actions[1] = e.action.randTimedActionList.entry2; + actions[2] = e.action.randTimedActionList.entry3; + actions[3] = e.action.randTimedActionList.entry4; + actions[4] = e.action.randTimedActionList.entry5; + actions[5] = e.action.randTimedActionList.entry6; + uint32 temp[SMART_ACTION_PARAM_COUNT]; + uint32 count = 0; + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + { + if (actions[i] > 0) + { + temp[count] = actions[i]; + ++count; + } + } + + if (count == 0) + break; + + uint32 id = temp[urand(0, count - 1)]; + if (e.GetTargetType() == SMART_TARGET_NONE) + { + sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); + break; + } + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (Creature* target = (*itr)->ToCreature()) + { + if (IsSmart(target)) + CAST_AI(SmartAI, target->AI())->SetScript9(e, id, GetLastInvoker()); + } + else if (GameObject* goTarget = (*itr)->ToGameObject()) + { + if (IsSmartGO(goTarget)) + CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker()); + } + } + + delete targets; + } + break; + } + case SMART_ACTION_CALL_RANDOM_RANGE_TIMED_ACTIONLIST: + { + uint32 id = urand(e.action.randTimedActionList.entry1, e.action.randTimedActionList.entry2); + if (e.GetTargetType() == SMART_TARGET_NONE) + { + sLog->outErrorDb("SmartScript: Entry %d SourceType %u Event %u Action %u is using TARGET_NONE(0) for Script9 target. Please correct target_type in database.", e.entryOrGuid, e.GetScriptType(), e.GetEventType(), e.GetActionType()); + break; + } + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (Creature* target = (*itr)->ToCreature()) + { + if (IsSmart(target)) + CAST_AI(SmartAI, target->AI())->SetScript9(e, id, GetLastInvoker()); + } + else if (GameObject* goTarget = (*itr)->ToGameObject()) + { + if (IsSmartGO(goTarget)) + CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker()); + } + } + + delete targets; + } + break; + } + case SMART_ACTION_ACTIVATE_TAXI: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsPlayer(*itr)) + (*itr)->ToPlayer()->ActivateTaxiPathTo(e.action.taxi.id); + + delete targets; + break; + } + case SMART_ACTION_RANDOM_MOVE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + bool foundTarget = false; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature((*itr))) + { + foundTarget = true; + + if (e.action.moveRandom.distance) + (*itr)->ToCreature()->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); + else + (*itr)->ToCreature()->GetMotionMaster()->MoveIdle(); + } + } + + if (!foundTarget && me && IsCreature(me)) + { + if (e.action.moveRandom.distance) + me->GetMotionMaster()->MoveRandom((float)e.action.moveRandom.distance); + else + me->GetMotionMaster()->MoveIdle(); + } + + delete targets; + break; + } + case SMART_ACTION_SET_UNIT_FIELD_BYTES_1: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetByteFlag(UNIT_FIELD_BYTES_1, e.action.setunitByte.type, e.action.setunitByte.byte1); + + delete targets; + break; + } + case SMART_ACTION_REMOVE_UNIT_FIELD_BYTES_1: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->RemoveByteFlag(UNIT_FIELD_BYTES_1, e.action.delunitByte.type, e.action.delunitByte.byte1); + + delete targets; + break; + } + case SMART_ACTION_INTERRUPT_SPELL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->InterruptNonMeleeSpells(e.action.interruptSpellCasting.withDelayed, e.action.interruptSpellCasting.spell_id, e.action.interruptSpellCasting.withInstant); + + delete targets; + break; + } + case SMART_ACTION_SEND_GO_CUSTOM_ANIM: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SendCustomAnim(e.action.sendGoCustomAnim.anim); + + delete targets; + break; + } + case SMART_ACTION_SET_DYNAMIC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetUInt32Value(UNIT_DYNAMIC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_ADD_DYNAMIC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetFlag(UNIT_DYNAMIC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_REMOVE_DYNAMIC_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->RemoveFlag(UNIT_DYNAMIC_FLAGS, e.action.unitFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_JUMP_TO_POS: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + // xinef: my implementation + if (e.action.jump.selfJump) + { + if (WorldObject* target = Trinity::Containers::SelectRandomContainerElement(*targets)) + if (me) + me->GetMotionMaster()->MoveJump(target->GetPositionX() + e.target.x, target->GetPositionY() + e.target.y, target->GetPositionZ() + e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); + } + else + { + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (WorldObject* obj = (*itr)) + { + if (Creature* creature = obj->ToCreature()) + creature->GetMotionMaster()->MoveJump(e.target.x, e.target.y, e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz); + } + } + + delete targets; + break; + } + case SMART_ACTION_GO_SET_LOOT_STATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SetLootState((LootState)e.action.setGoLootState.state); + + delete targets; + break; + } + case SMART_ACTION_SEND_TARGET_TO_TARGET: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + ObjectList* storedTargets = GetTargetList(e.action.sendTargetToTarget.id); + if (!storedTargets) + { + delete targets; + break; + } + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (IsCreature(*itr)) + { + if (SmartAI* ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI())) + ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list + else + sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping"); + } + else if (IsGameObject(*itr)) + { + if (SmartGameObjectAI* ai = CAST_AI(SmartGameObjectAI, (*itr)->ToGameObject()->AI())) + ai->GetScript()->StoreTargetList(new ObjectList(*storedTargets), e.action.sendTargetToTarget.id); // store a copy of target list + else + sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartGameObjectAI, skipping"); + } + } + + delete targets; + break; + } + case SMART_ACTION_SEND_GOSSIP_MENU: + { + if (!GetBaseObject()) + break; + +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::ProcessAction:: SMART_ACTION_SEND_GOSSIP_MENU: gossipMenuId %d, gossipNpcTextId %d", + e.action.sendGossipMenu.gossipMenuId, e.action.sendGossipMenu.gossipNpcTextId); +#endif + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (Player* player = (*itr)->ToPlayer()) + { + if (e.action.sendGossipMenu.gossipMenuId) + player->PrepareGossipMenu(GetBaseObject(), e.action.sendGossipMenu.gossipMenuId, true); + else + player->PlayerTalkClass->ClearMenus(); + + player->SEND_GOSSIP_MENU(e.action.sendGossipMenu.gossipNpcTextId, GetBaseObject()->GetGUID()); + } + + delete targets; + break; + } + case SMART_ACTION_SET_HOME_POS: + { + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + float x, y, z, o; + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + { + if (e.action.setHomePos.spawnPos) + { + (*itr)->ToCreature()->GetRespawnPosition(x, y, z, &o); + (*itr)->ToCreature()->SetHomePosition(x, y, z, o); + } + else + (*itr)->ToCreature()->SetHomePosition((*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), (*itr)->GetOrientation()); + + } + delete targets; + } + else if (me && e.GetTargetType() == SMART_TARGET_POSITION) + { + if (e.action.setHomePos.spawnPos) + { + float x, y, z, o; + me->GetRespawnPosition(x, y, z, &o); + me->SetHomePosition(x, y, z, o); + } + else + me->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o); + } + break; + } + /*{ + ObjectList* movers = GetTargets(CreateEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, 0, 0, SMART_ACTION_NONE, 0, 0, 0, 0, 0, 0, (SMARTAI_TARGETS)e.action.sethome.targetType, e.action.sethome.targetParam1, e.action.sethome.targetParam2, e.action.sethome.targetParam3, 0), unit); + if (!movers) + break; + + if (e.GetTargetType() == SMART_TARGET_POSITION) + { + for (ObjectList::const_iterator itr = movers->begin(); itr != movers->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->SetHomePosition(e.target.x, e.target.y, e.target.z, e.target.o); + } + else if (ObjectList* targets = GetTargets(e, unit)) + { + if (WorldObject* target = targets->front()) + for (ObjectList::const_iterator itr = movers->begin(); itr != movers->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->SetHomePosition(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation()); + + delete targets; + } + + delete movers; + break; + }*/ + case SMART_ACTION_SET_HEALTH_REGEN: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->SetRegeneratingHealth(e.action.setHealthRegen.regenHealth); + + delete targets; + break; + } + case SMART_ACTION_SET_ROOT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->SetControlled(e.action.setRoot.root, UNIT_STATE_ROOT); + + delete targets; + break; + } + case SMART_ACTION_SET_GO_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SetUInt32Value(GAMEOBJECT_FLAGS, e.action.goFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_ADD_GO_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SetFlag(GAMEOBJECT_FLAGS, e.action.goFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_REMOVE_GO_FLAG: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->RemoveFlag(GAMEOBJECT_FLAGS, e.action.goFlag.flag); + + delete targets; + break; + } + case SMART_ACTION_SUMMON_CREATURE_GROUP: + { + std::list summonList; + GetBaseObject()->SummonCreatureGroup(e.action.creatureGroup.group, &summonList); + + for (std::list::const_iterator itr = summonList.begin(); itr != summonList.end(); ++itr) + { + if (unit && e.action.creatureGroup.attackInvoker) + (*itr)->AI()->AttackStart(unit); + else if (me && e.action.creatureGroup.attackScriptOwner) + (*itr)->AI()->AttackStart(me); + } + + break; + } + case SMART_ACTION_SET_POWER: + { + ObjectList* targets = GetTargets(e, unit); + + if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), e.action.power.newPower); + + delete targets; + break; + } + case SMART_ACTION_ADD_POWER: + { + ObjectList* targets = GetTargets(e, unit); + + if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), (*itr)->ToUnit()->GetPower(Powers(e.action.power.powerType)) + e.action.power.newPower); + + delete targets; + break; + } + case SMART_ACTION_REMOVE_POWER: + { + ObjectList* targets = GetTargets(e, unit); + + if (targets) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetPower(Powers(e.action.power.powerType), (*itr)->ToUnit()->GetPower(Powers(e.action.power.powerType)) - e.action.power.newPower); + + delete targets; + break; + } + case SMART_ACTION_GAME_EVENT_STOP: + { + uint32 eventId = e.action.gameEventStop.id; + if (!sGameEventMgr->IsActiveEvent(eventId)) + { + sLog->outError("SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: %u)", eventId); + break; + } + sGameEventMgr->StopEvent(eventId, true); + break; + } + case SMART_ACTION_GAME_EVENT_START: + { + uint32 eventId = e.action.gameEventStart.id; + if (sGameEventMgr->IsActiveEvent(eventId)) + { + sLog->outError("SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: %u)", eventId); + break; + } + sGameEventMgr->StartEvent(eventId, true); + break; + } + case SMART_ACTION_START_CLOSEST_WAYPOINT: + { + uint32 waypoints[SMART_ACTION_PARAM_COUNT]; + waypoints[0] = e.action.closestWaypointFromList.wp1; + waypoints[1] = e.action.closestWaypointFromList.wp2; + waypoints[2] = e.action.closestWaypointFromList.wp3; + waypoints[3] = e.action.closestWaypointFromList.wp4; + waypoints[4] = e.action.closestWaypointFromList.wp5; + waypoints[5] = e.action.closestWaypointFromList.wp6; + float distanceToClosest = std::numeric_limits::max(); + WayPoint* closestWp = NULL; + + ObjectList* targets = GetTargets(e, unit); + if (targets) + { + for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr) + { + if (Creature* target = (*itr)->ToCreature()) + { + if (IsSmart(target)) + { + for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) { - for (uint8 i = 0; i < SMART_ACTION_PARAM_COUNT; i++) + if (!waypoints[i]) + continue; + + WPPath* path = sSmartWaypointMgr->GetPath(waypoints[i]); + + if (!path || path->empty()) + continue; + + WPPath::const_iterator itrWp = path->find(0); + + if (itrWp != path->end()) { - if (!waypoints[i]) - continue; - - WPPath* path = sSmartWaypointMgr->GetPath(waypoints[i]); - - if (!path || path->empty()) - continue; - - WPPath::const_iterator itrWp = path->find(0); - - if (itrWp != path->end()) + if (WayPoint* wp = itrWp->second) { - if (WayPoint* wp = itrWp->second) - { - float distToThisPath = target->GetDistance(wp->x, wp->y, wp->z); + float distToThisPath = target->GetDistance(wp->x, wp->y, wp->z); - if (distToThisPath < distanceToClosest) - { - distanceToClosest = distToThisPath; - closestWp = wp; - } + if (distToThisPath < distanceToClosest) + { + distanceToClosest = distToThisPath; + closestWp = wp; } } } - - if (closestWp) - CAST_AI(SmartAI, target->AI())->StartPath(false, closestWp->id, true); } + + if (closestWp) + CAST_AI(SmartAI, target->AI())->StartPath(false, closestWp->id, true); } } - - delete targets; } - break; - } - case SMART_ACTION_SET_GO_STATE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsGameObject(*itr)) - (*itr)->ToGameObject()->SetGoState((GOState)e.action.goState.state); delete targets; - break; } - case SMART_ACTION_EXIT_VEHICLE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->ExitVehicle(); - - delete targets; + break; + } + case SMART_ACTION_SET_GO_STATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) break; - } - case SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsGameObject(*itr)) + (*itr)->ToGameObject()->SetGoState((GOState)e.action.goState.state); + + delete targets; + break; + } + case SMART_ACTION_EXIT_VEHICLE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->ExitVehicle(); + + delete targets; + break; + } + case SMART_ACTION_SET_UNIT_MOVEMENT_FLAGS: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + { + (*itr)->ToUnit()->SetUnitMovementFlags(e.action.movementFlag.flag); + (*itr)->ToUnit()->SendMovementFlagUpdate(); + } + + delete targets; + break; + } + case SMART_ACTION_SET_COMBAT_DISTANCE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->m_CombatDistance = e.action.combatDistance.dist; + + delete targets; + break; + } + case SMART_ACTION_SET_CASTER_COMBAT_DIST: + { + if (e.action.casterDistance.reset) + RestoreCasterMaxDist(); + else + SetCasterActualDist(e.action.casterDistance.dist); + + if (me->GetVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + me->GetMotionMaster()->MoveChase(me->GetVictim(), GetCasterActualDist()); + break; + } + case SMART_ACTION_SET_SIGHT_DIST: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->m_SightDistance = e.action.sightDistance.dist; + + delete targets; + break; + } + case SMART_ACTION_FLEE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->GetMotionMaster()->MoveFleeing(me, e.action.flee.withEmote); + + delete targets; + break; + } + case SMART_ACTION_ADD_THREAT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + me->AddThreat((*itr)->ToUnit(), (float)e.action.threatPCT.threatINC - (float)e.action.threatPCT.threatDEC); + + delete targets; + break; + } + case SMART_ACTION_LOAD_EQUIPMENT: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsCreature(*itr)) + (*itr)->ToCreature()->LoadEquipment(e.action.loadEquipment.id, e.action.loadEquipment.force); + + delete targets; + break; + } + case SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT: + { + uint32 eventId = urand(e.action.randomTimedEvent.minId, e.action.randomTimedEvent.maxId); + ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, eventId); + break; + } + case SMART_ACTION_SET_HOVER: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->SetHover(e.action.setHover.state); + + delete targets; + break; + } + case SMART_ACTION_ADD_IMMUNITY: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->ApplySpellImmune(e.action.immunity.id, e.action.immunity.type, e.action.immunity.value, true); + + delete targets; + break; + } + case SMART_ACTION_REMOVE_IMMUNITY: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->ApplySpellImmune(e.action.immunity.id, e.action.immunity.type, e.action.immunity.value, false); + + delete targets; + break; + } + case SMART_ACTION_FALL: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->GetMotionMaster()->MoveFall(); + + delete targets; + break; + } + case SMART_ACTION_SET_EVENT_FLAG_RESET: + { + SetPhaseReset(e.action.setActive.state); + break; + } + case SMART_ACTION_REMOVE_ALL_GAMEOBJECTS: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->RemoveAllGameObjects(); + + delete targets; + break; + } + case SMART_ACTION_STOP_MOTION: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + { + if (e.action.stopMotion.stopMovement) + (*itr)->ToUnit()->StopMoving(); + if (e.action.stopMotion.movementExpired) + (*itr)->ToUnit()->GetMotionMaster()->MovementExpired(); + } + + delete targets; + break; + } + case SMART_ACTION_NO_ENVIRONMENT_UPDATE: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + (*itr)->ToUnit()->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); + + delete targets; + break; + } + case SMART_ACTION_ZONE_UNDER_ATTACK: + { + ObjectList* targets = GetTargets(e, unit); + if (!targets) + break; + + for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) + if (IsUnit(*itr)) + if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) { - (*itr)->ToUnit()->SetUnitMovementFlags(e.action.movementFlag.flag); - (*itr)->ToUnit()->SendMovementFlagUpdate(); + me->SendZoneUnderAttackMessage(player); + break; } - delete targets; - break; - } - case SMART_ACTION_SET_COMBAT_DISTANCE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->m_CombatDistance = e.action.combatDistance.dist; - - delete targets; - break; - } - case SMART_ACTION_SET_CASTER_COMBAT_DIST: - { - if (e.action.casterDistance.reset) - RestoreCasterMaxDist(); - else - SetCasterActualDist(e.action.casterDistance.dist); - - if (me->GetVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) - me->GetMotionMaster()->MoveChase(me->GetVictim(), GetCasterActualDist()); - break; - } - case SMART_ACTION_SET_SIGHT_DIST: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->m_SightDistance = e.action.sightDistance.dist; - - delete targets; - break; - } - case SMART_ACTION_FLEE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->GetMotionMaster()->MoveFleeing(me, e.action.flee.withEmote); - - delete targets; - break; - } - case SMART_ACTION_ADD_THREAT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - me->AddThreat((*itr)->ToUnit(), (float)e.action.threatPCT.threatINC - (float)e.action.threatPCT.threatDEC); - - delete targets; - break; - } - case SMART_ACTION_LOAD_EQUIPMENT: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsCreature(*itr)) - (*itr)->ToCreature()->LoadEquipment(e.action.loadEquipment.id, e.action.loadEquipment.force); - - delete targets; - break; - } - case SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT: - { - uint32 eventId = urand(e.action.randomTimedEvent.minId, e.action.randomTimedEvent.maxId); - ProcessEventsFor((SMART_EVENT)SMART_EVENT_TIMED_EVENT_TRIGGERED, NULL, eventId); - break; - } - case SMART_ACTION_SET_HOVER: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->SetHover(e.action.setHover.state); - - delete targets; - break; - } - case SMART_ACTION_ADD_IMMUNITY: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->ApplySpellImmune(e.action.immunity.id, e.action.immunity.type, e.action.immunity.value, true); - - delete targets; - break; - } - case SMART_ACTION_REMOVE_IMMUNITY: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->ApplySpellImmune(e.action.immunity.id, e.action.immunity.type, e.action.immunity.value, false); - - delete targets; - break; - } - case SMART_ACTION_FALL: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->GetMotionMaster()->MoveFall(); - - delete targets; - break; - } - case SMART_ACTION_SET_EVENT_FLAG_RESET: - { - SetPhaseReset(e.action.setActive.state); - break; - } - case SMART_ACTION_REMOVE_ALL_GAMEOBJECTS: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->RemoveAllGameObjects(); - - delete targets; - break; - } - case SMART_ACTION_STOP_MOTION: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - { - if (e.action.stopMotion.stopMovement) - (*itr)->ToUnit()->StopMoving(); - if (e.action.stopMotion.movementExpired) - (*itr)->ToUnit()->GetMotionMaster()->MovementExpired(); - } - - delete targets; - break; - } - case SMART_ACTION_NO_ENVIRONMENT_UPDATE: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - (*itr)->ToUnit()->AddUnitState(UNIT_STATE_NO_ENVIRONMENT_UPD); - - delete targets; - break; - } - case SMART_ACTION_ZONE_UNDER_ATTACK: - { - ObjectList* targets = GetTargets(e, unit); - if (!targets) - break; - - for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - if (IsUnit(*itr)) - if (Player* player = (*itr)->ToUnit()->GetCharmerOrOwnerPlayerOrPlayerItself()) - { - me->SendZoneUnderAttackMessage(player); - break; - } - - delete targets; - break; - } - case SMART_ACTION_LOAD_GRID: - { - if (me && me->FindMap()) - me->FindMap()->LoadGrid(e.target.x, e.target.y); - break; - } - default: - sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); - break; + delete targets; + break; + } + case SMART_ACTION_LOAD_GRID: + { + if (me && me->FindMap()) + me->FindMap()->LoadGrid(e.target.x, e.target.y); + break; + } + default: + sLog->outErrorDb("SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType()); + break; } if (e.link && e.link != e.event_id) @@ -2836,65 +2868,65 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e) mTemplate = (SMARTAI_TEMPLATE)e.action.installTtemplate.id; switch ((SMARTAI_TEMPLATE)e.action.installTtemplate.id) { - case SMARTAI_TEMPLATE_CASTER: - { - AddEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, e.action.installTtemplate.param2, e.action.installTtemplate.param3, SMART_ACTION_CAST, e.action.installTtemplate.param1, e.target.raw.param1, 0, 0, 0, 0, SMART_TARGET_VICTIM, 0, 0, 0, 1); - AddEvent(SMART_EVENT_RANGE, 0, e.action.installTtemplate.param4, 300, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); - AddEvent(SMART_EVENT_RANGE, 0, 0, e.action.installTtemplate.param4>10?e.action.installTtemplate.param4-10:0, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); - AddEvent(SMART_EVENT_MANA_PCT, 0, e.action.installTtemplate.param5-15>100?100:e.action.installTtemplate.param5+15, 100, 1000, 1000, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - AddEvent(SMART_EVENT_MANA_PCT, 0, 0, e.action.installTtemplate.param5, 1000, 1000, SMART_ACTION_SET_EVENT_PHASE, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - AddEvent(SMART_EVENT_MANA_PCT, 0, 0, e.action.installTtemplate.param5, 1000, 1000, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - break; - } - case SMARTAI_TEMPLATE_TURRET: - { - AddEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, e.action.installTtemplate.param2, e.action.installTtemplate.param3, SMART_ACTION_CAST, e.action.installTtemplate.param1, e.target.raw.param1, 0, 0, 0, 0, SMART_TARGET_VICTIM, 0, 0, 0, 0); - AddEvent(SMART_EVENT_JUST_CREATED, 0, 0, 0, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - break; - } - case SMARTAI_TEMPLATE_CAGED_NPC_PART: - { - if (!me) - return; - //store cage as id1 - AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_GAMEOBJECT, e.action.installTtemplate.param1, 10, 0, 0); - - //reset(close) cage on hostage(me) respawn - AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 0, 0, 0, 0, SMART_ACTION_RESET_GOBJECT, 0, 0, 0, 0, 0, 0, SMART_TARGET_GAMEOBJECT_DISTANCE, e.action.installTtemplate.param1, 5, 0, 0); - - AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_RUN, e.action.installTtemplate.param3, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - - AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 1000, 1000, 0, 0, SMART_ACTION_MOVE_FORWARD, e.action.installTtemplate.param4, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); - //phase 1: give quest credit on movepoint reached - AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 1); - //phase 1: despawn after time on movepoint reached - AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_FORCE_DESPAWN, e.action.installTtemplate.param2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); - - if (sCreatureTextMgr->TextExist(me->GetEntry(), (uint8)e.action.installTtemplate.param5)) - AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_TALK, e.action.installTtemplate.param5, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); - break; - } - case SMARTAI_TEMPLATE_CAGED_GO_PART: - { - if (!go) - return; - //store hostage as id1 - AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); - //store invoker as id2 - AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); - //signal hostage - AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0); - //when hostage raeched end point, give credit to invoker - if (e.action.installTtemplate.param2) - AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); - else - AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); - break; - } - case SMARTAI_TEMPLATE_BASIC: - default: + case SMARTAI_TEMPLATE_CASTER: + { + AddEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, e.action.installTtemplate.param2, e.action.installTtemplate.param3, SMART_ACTION_CAST, e.action.installTtemplate.param1, e.target.raw.param1, 0, 0, 0, 0, SMART_TARGET_VICTIM, 0, 0, 0, 1); + AddEvent(SMART_EVENT_RANGE, 0, e.action.installTtemplate.param4, 300, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + AddEvent(SMART_EVENT_RANGE, 0, 0, e.action.installTtemplate.param4>10 ? e.action.installTtemplate.param4 - 10 : 0, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + AddEvent(SMART_EVENT_MANA_PCT, 0, e.action.installTtemplate.param5 - 15>100 ? 100 : e.action.installTtemplate.param5 + 15, 100, 1000, 1000, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_MANA_PCT, 0, 0, e.action.installTtemplate.param5, 1000, 1000, SMART_ACTION_SET_EVENT_PHASE, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_MANA_PCT, 0, 0, e.action.installTtemplate.param5, 1000, 1000, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + break; + } + case SMARTAI_TEMPLATE_TURRET: + { + AddEvent(SMART_EVENT_UPDATE_IC, 0, 0, 0, e.action.installTtemplate.param2, e.action.installTtemplate.param3, SMART_ACTION_CAST, e.action.installTtemplate.param1, e.target.raw.param1, 0, 0, 0, 0, SMART_TARGET_VICTIM, 0, 0, 0, 0); + AddEvent(SMART_EVENT_JUST_CREATED, 0, 0, 0, 0, 0, SMART_ACTION_ALLOW_COMBAT_MOVEMENT, 0, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + break; + } + case SMARTAI_TEMPLATE_CAGED_NPC_PART: + { + if (!me) return; + //store cage as id1 + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_GAMEOBJECT, e.action.installTtemplate.param1, 10, 0, 0); + + //reset(close) cage on hostage(me) respawn + AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 0, 0, 0, 0, SMART_ACTION_RESET_GOBJECT, 0, 0, 0, 0, 0, 0, SMART_TARGET_GAMEOBJECT_DISTANCE, e.action.installTtemplate.param1, 5, 0, 0); + + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_RUN, e.action.installTtemplate.param3, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_SET_EVENT_PHASE, 1, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + + AddEvent(SMART_EVENT_UPDATE, SMART_EVENT_FLAG_NOT_REPEATABLE, 1000, 1000, 0, 0, SMART_ACTION_MOVE_FORWARD, e.action.installTtemplate.param4, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + //phase 1: give quest credit on movepoint reached + AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 1); + //phase 1: despawn after time on movepoint reached + AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_FORCE_DESPAWN, e.action.installTtemplate.param2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + + if (sCreatureTextMgr->TextExist(me->GetEntry(), (uint8)e.action.installTtemplate.param5)) + AddEvent(SMART_EVENT_MOVEMENTINFORM, 0, POINT_MOTION_TYPE, SMART_RANDOM_POINT, 0, 0, SMART_ACTION_TALK, e.action.installTtemplate.param5, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 1); + break; + } + case SMARTAI_TEMPLATE_CAGED_GO_PART: + { + if (!go) + return; + //store hostage as id1 + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0); + //store invoker as id2 + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 2, 0, 0, 0, 0, 0, SMART_TARGET_NONE, 0, 0, 0, 0); + //signal hostage + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_SET_DATA, 0, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 1, 0, 0, 0); + //when hostage raeched end point, give credit to invoker + if (e.action.installTtemplate.param2) + AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); + else + AddEvent(SMART_EVENT_GO_STATE_CHANGED, 0, 2, 0, 0, 0, SMART_ACTION_CALL_KILLEDMONSTER, e.action.installTtemplate.param1, 0, 0, 0, 0, 0, SMART_TARGET_STORED, 2, 0, 0, 0); + break; + } + case SMARTAI_TEMPLATE_BASIC: + default: + return; } } @@ -2946,361 +2978,361 @@ ObjectList* SmartScript::GetTargets(SmartScriptHolder const& e, Unit* invoker /* ObjectList* l = new ObjectList(); switch (e.GetTargetType()) { - case SMART_TARGET_SELF: - if (baseObject) - l->push_back(baseObject); - break; - case SMART_TARGET_VICTIM: - if (me && me->GetVictim()) - l->push_back(me->GetVictim()); - break; - case SMART_TARGET_HOSTILE_SECOND_AGGRO: - if (me) + case SMART_TARGET_SELF: + if (baseObject) + l->push_back(baseObject); + break; + case SMART_TARGET_VICTIM: + if (me && me->GetVictim()) + l->push_back(me->GetVictim()); + break; + case SMART_TARGET_HOSTILE_SECOND_AGGRO: + if (me) + { + if (e.target.hostilRandom.powerType) { - if (e.target.hostilRandom.powerType) - { - if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType-1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) - l->push_back(u); - } - else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) l->push_back(u); } - break; - case SMART_TARGET_HOSTILE_LAST_AGGRO: - if (me) + else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + l->push_back(u); + } + break; + case SMART_TARGET_HOSTILE_LAST_AGGRO: + if (me) + { + if (e.target.hostilRandom.powerType) { - if (e.target.hostilRandom.powerType) - { - if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType-1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) - l->push_back(u); - } - else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) l->push_back(u); } - break; - case SMART_TARGET_HOSTILE_RANDOM: - if (me) + else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + l->push_back(u); + } + break; + case SMART_TARGET_HOSTILE_RANDOM: + if (me) + { + if (e.target.hostilRandom.powerType) { - if (e.target.hostilRandom.powerType) - { - if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType-1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) - l->push_back(u); - } - else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) l->push_back(u); } - break; - case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP: - if (me) + else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 0, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + l->push_back(u); + } + break; + case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP: + if (me) + { + if (e.target.hostilRandom.powerType) { - if (e.target.hostilRandom.powerType) - { - if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType-1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) - l->push_back(u); - } - else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1, PowerUsersSelector(me, Powers(e.target.hostilRandom.powerType - 1), (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly))) l->push_back(u); } - break; - case SMART_TARGET_FARTHEST: - if (me) - { - if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_FARTHEST, 0, FarthestTargetSelector(me, e.target.farthest.maxDist, e.target.farthest.playerOnly, e.target.farthest.isInLos))) - l->push_back(u); - } - break; - case SMART_TARGET_ACTION_INVOKER: - if (scriptTrigger) - l->push_back(scriptTrigger); - break; - case SMART_TARGET_ACTION_INVOKER_VEHICLE: - if (scriptTrigger && scriptTrigger->GetVehicle() && scriptTrigger->GetVehicle()->GetBase()) - l->push_back(scriptTrigger->GetVehicle()->GetBase()); - break; - case SMART_TARGET_INVOKER_PARTY: - if (scriptTrigger) - { - if (Player* player = scriptTrigger->ToPlayer()) - { - if (Group* group = player->GetGroup()) - { - for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) - if (Player* member = groupRef->GetSource()) - if (member->IsInMap(player)) - l->push_back(member); - } - // We still add the player to the list if there is no group. If we do - // this even if there is a group (thus the else-check), it will add the - // same player to the list twice. We don't want that to happen. - else - l->push_back(scriptTrigger); - } - } - break; - case SMART_TARGET_CREATURE_RANGE: + else if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_RANDOM, 1, (float)e.target.hostilRandom.maxDist, e.target.hostilRandom.playerOnly)) + l->push_back(u); + } + break; + case SMART_TARGET_FARTHEST: + if (me) { - // will always return a valid pointer, even if empty list - ObjectList* units = GetWorldObjectsInDist((float)e.target.unitRange.maxDist); - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + if (Unit* u = me->AI()->SelectTarget(SELECT_TARGET_FARTHEST, 0, FarthestTargetSelector(me, e.target.farthest.maxDist, e.target.farthest.playerOnly, e.target.farthest.isInLos))) + l->push_back(u); + } + break; + case SMART_TARGET_ACTION_INVOKER: + if (scriptTrigger) + l->push_back(scriptTrigger); + break; + case SMART_TARGET_ACTION_INVOKER_VEHICLE: + if (scriptTrigger && scriptTrigger->GetVehicle() && scriptTrigger->GetVehicle()->GetBase()) + l->push_back(scriptTrigger->GetVehicle()->GetBase()); + break; + case SMART_TARGET_INVOKER_PARTY: + if (scriptTrigger) + { + if (Player* player = scriptTrigger->ToPlayer()) { - if (!IsCreature(*itr)) - continue; - - if (me && me->GetGUID() == (*itr)->GetGUID()) - continue; - - // check alive state - 1 alive, 2 dead, 0 both - if (uint32 state = e.target.unitRange.livingState) + if (Group* group = player->GetGroup()) { - if ((*itr)->ToCreature()->IsAlive() && state == 2) - continue; - if (!(*itr)->ToCreature()->IsAlive() && state == 1) - continue; + for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) + if (Player* member = groupRef->GetSource()) + if (member->IsInMap(player)) + l->push_back(member); + } + // We still add the player to the list if there is no group. If we do + // this even if there is a group (thus the else-check), it will add the + // same player to the list twice. We don't want that to happen. + else + l->push_back(scriptTrigger); + } + } + break; + case SMART_TARGET_CREATURE_RANGE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.unitRange.maxDist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + { + if (!IsCreature(*itr)) + continue; + + if (me && me->GetGUID() == (*itr)->GetGUID()) + continue; + + // check alive state - 1 alive, 2 dead, 0 both + if (uint32 state = e.target.unitRange.livingState) + { + if ((*itr)->ToCreature()->IsAlive() && state == 2) + continue; + if (!(*itr)->ToCreature()->IsAlive() && state == 1) + continue; + } + + if (((e.target.unitRange.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitRange.creature) || !e.target.unitRange.creature) && baseObject->IsInRange(*itr, (float)e.target.unitRange.minDist, (float)e.target.unitRange.maxDist)) + l->push_back(*itr); + } + + delete units; + break; + } + case SMART_TARGET_CREATURE_DISTANCE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.unitDistance.dist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + { + if (!IsCreature(*itr)) + continue; + + if (me && me->GetGUID() == (*itr)->GetGUID()) + continue; + + // check alive state - 1 alive, 2 dead, 0 both + if (uint32 state = e.target.unitDistance.livingState) + { + if ((*itr)->ToCreature()->IsAlive() && state == 2) + continue; + if (!(*itr)->ToCreature()->IsAlive() && state == 1) + continue; + } + + if ((e.target.unitDistance.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitDistance.creature) || !e.target.unitDistance.creature) + l->push_back(*itr); + } + + delete units; + break; + } + case SMART_TARGET_GAMEOBJECT_DISTANCE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.goDistance.dist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + { + if (!IsGameObject(*itr)) + continue; + + if (go && go->GetGUID() == (*itr)->GetGUID()) + continue; + + if ((e.target.goDistance.entry && (*itr)->ToGameObject()->GetEntry() == e.target.goDistance.entry) || !e.target.goDistance.entry) + l->push_back(*itr); + } + + delete units; + break; + } + case SMART_TARGET_GAMEOBJECT_RANGE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.goRange.maxDist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + { + if (!IsGameObject(*itr)) + continue; + + if (go && go->GetGUID() == (*itr)->GetGUID()) + continue; + + if (((e.target.goRange.entry && IsGameObject(*itr) && (*itr)->ToGameObject()->GetEntry() == e.target.goRange.entry) || !e.target.goRange.entry) && baseObject->IsInRange((*itr), (float)e.target.goRange.minDist, (float)e.target.goRange.maxDist)) + l->push_back(*itr); + } + + delete units; + break; + } + case SMART_TARGET_CREATURE_GUID: + { + Creature* target = NULL; + if (!scriptTrigger && !baseObject) + { + sLog->outError("SMART_TARGET_CREATURE_GUID can not be used without invoker"); + break; + } + + // xinef: my addition + if (e.target.unitGUID.getFromHashMap) + { + if (target = ObjectAccessor::GetCreature(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.unitGUID.dbGuid, e.target.unitGUID.entry, HIGHGUID_UNIT))) + l->push_back(target); + } + else + { + target = FindCreatureNear(scriptTrigger ? scriptTrigger : GetBaseObject(), e.target.unitGUID.dbGuid); + if (target && (!e.target.unitGUID.entry || target->GetEntry() == e.target.unitGUID.entry)) + l->push_back(target); + } + break; + } + case SMART_TARGET_GAMEOBJECT_GUID: + { + GameObject* target = NULL; + if (!scriptTrigger && !GetBaseObject()) + { + sLog->outError("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker"); + break; + } + + // xinef: my addition + if (e.target.goGUID.getFromHashMap) + { + if (target = ObjectAccessor::GetGameObject(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.goGUID.dbGuid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT))) + l->push_back(target); + } + else + { + target = FindGameObjectNear(scriptTrigger ? scriptTrigger : GetBaseObject(), e.target.goGUID.dbGuid); + if (target && (!e.target.goGUID.entry || target->GetEntry() == e.target.goGUID.entry)) + l->push_back(target); + } + break; + } + case SMART_TARGET_PLAYER_RANGE: + { + uint32 count = 0; + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.playerRange.maxDist); + if (!units->empty() && GetBaseObject()) + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + if (IsPlayer(*itr) && GetBaseObject()->IsInRange(*itr, (float)e.target.playerRange.minDist, (float)e.target.playerRange.maxDist)) + { + l->push_back(*itr); + if (e.target.playerRange.maxCount && ++count >= e.target.playerRange.maxCount) + break; } - if (((e.target.unitRange.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitRange.creature) || !e.target.unitRange.creature) && baseObject->IsInRange(*itr, (float)e.target.unitRange.minDist, (float)e.target.unitRange.maxDist)) - l->push_back(*itr); - } + delete units; + break; + } + case SMART_TARGET_PLAYER_DISTANCE: + { + // will always return a valid pointer, even if empty list + ObjectList* units = GetWorldObjectsInDist((float)e.target.playerDistance.dist); + for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) + if (IsPlayer(*itr)) + l->push_back(*itr); - delete units; - break; - } - case SMART_TARGET_CREATURE_DISTANCE: + delete units; + break; + } + case SMART_TARGET_STORED: + { + ObjectListMap::iterator itr = mTargetStorage->find(e.target.stored.id); + if (itr != mTargetStorage->end()) { - // will always return a valid pointer, even if empty list - ObjectList* units = GetWorldObjectsInDist((float)e.target.unitDistance.dist); - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) - { - if (!IsCreature(*itr)) - continue; - - if (me && me->GetGUID() == (*itr)->GetGUID()) - continue; - - // check alive state - 1 alive, 2 dead, 0 both - if (uint32 state = e.target.unitDistance.livingState) - { - if ((*itr)->ToCreature()->IsAlive() && state == 2) - continue; - if (!(*itr)->ToCreature()->IsAlive() && state == 1) - continue; - } - - if ((e.target.unitDistance.creature && (*itr)->ToCreature()->GetEntry() == e.target.unitDistance.creature) || !e.target.unitDistance.creature) - l->push_back(*itr); - } - - delete units; - break; + ObjectList* objectList = itr->second->GetObjectList(); + l->assign(objectList->begin(), objectList->end()); } - case SMART_TARGET_GAMEOBJECT_DISTANCE: + + // xinef: return l, retardness... what if list is empty? will return empty list instead of null pointer + break; + } + case SMART_TARGET_CLOSEST_CREATURE: + { + Creature* target = GetClosestCreatureWithEntry(GetBaseObject(), e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100), !e.target.closest.dead); + if (target) + l->push_back(target); + break; + } + case SMART_TARGET_CLOSEST_GAMEOBJECT: + { + GameObject* target = GetClosestGameObjectWithEntry(GetBaseObject(), e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100)); + if (target) + l->push_back(target); + break; + } + case SMART_TARGET_CLOSEST_PLAYER: + { + if (WorldObject* obj = GetBaseObject()) { - // will always return a valid pointer, even if empty list - ObjectList* units = GetWorldObjectsInDist((float)e.target.goDistance.dist); - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) - { - if (!IsGameObject(*itr)) - continue; - - if (go && go->GetGUID() == (*itr)->GetGUID()) - continue; - - if ((e.target.goDistance.entry && (*itr)->ToGameObject()->GetEntry() == e.target.goDistance.entry) || !e.target.goDistance.entry) - l->push_back(*itr); - } - - delete units; - break; - } - case SMART_TARGET_GAMEOBJECT_RANGE: - { - // will always return a valid pointer, even if empty list - ObjectList* units = GetWorldObjectsInDist((float)e.target.goRange.maxDist); - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) - { - if (!IsGameObject(*itr)) - continue; - - if (go && go->GetGUID() == (*itr)->GetGUID()) - continue; - - if (((e.target.goRange.entry && IsGameObject(*itr) && (*itr)->ToGameObject()->GetEntry() == e.target.goRange.entry) || !e.target.goRange.entry) && baseObject->IsInRange((*itr), (float)e.target.goRange.minDist, (float)e.target.goRange.maxDist)) - l->push_back(*itr); - } - - delete units; - break; - } - case SMART_TARGET_CREATURE_GUID: - { - Creature* target = NULL; - if (!scriptTrigger && !baseObject) - { - sLog->outError("SMART_TARGET_CREATURE_GUID can not be used without invoker"); - break; - } - - // xinef: my addition - if (e.target.unitGUID.getFromHashMap) - { - if (target = ObjectAccessor::GetCreature(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.unitGUID.dbGuid, e.target.unitGUID.entry, HIGHGUID_UNIT))) - l->push_back(target); - } - else - { - target = FindCreatureNear(scriptTrigger ? scriptTrigger : GetBaseObject(), e.target.unitGUID.dbGuid); - if (target && (!e.target.unitGUID.entry || target->GetEntry() == e.target.unitGUID.entry)) - l->push_back(target); - } - break; - } - case SMART_TARGET_GAMEOBJECT_GUID: - { - GameObject* target = NULL; - if (!scriptTrigger && !GetBaseObject()) - { - sLog->outError("SMART_TARGET_GAMEOBJECT_GUID can not be used without invoker"); - break; - } - - // xinef: my addition - if (e.target.goGUID.getFromHashMap) - { - if (target = ObjectAccessor::GetGameObject(scriptTrigger ? *scriptTrigger : *GetBaseObject(), MAKE_NEW_GUID(e.target.goGUID.dbGuid, e.target.goGUID.entry, HIGHGUID_GAMEOBJECT))) - l->push_back(target); - } - else - { - target = FindGameObjectNear(scriptTrigger ? scriptTrigger : GetBaseObject(), e.target.goGUID.dbGuid); - if (target && (!e.target.goGUID.entry || target->GetEntry() == e.target.goGUID.entry)) - l->push_back(target); - } - break; - } - case SMART_TARGET_PLAYER_RANGE: - { - uint32 count = 0; - // will always return a valid pointer, even if empty list - ObjectList* units = GetWorldObjectsInDist((float)e.target.playerRange.maxDist); - if (!units->empty() && GetBaseObject()) - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) - if (IsPlayer(*itr) && GetBaseObject()->IsInRange(*itr, (float)e.target.playerRange.minDist, (float)e.target.playerRange.maxDist)) - { - l->push_back(*itr); - if (e.target.playerRange.maxCount && ++count >= e.target.playerRange.maxCount) - break; - } - - delete units; - break; - } - case SMART_TARGET_PLAYER_DISTANCE: - { - // will always return a valid pointer, even if empty list - ObjectList* units = GetWorldObjectsInDist((float)e.target.playerDistance.dist); - for (ObjectList::const_iterator itr = units->begin(); itr != units->end(); ++itr) - if (IsPlayer(*itr)) - l->push_back(*itr); - - delete units; - break; - } - case SMART_TARGET_STORED: - { - ObjectListMap::iterator itr = mTargetStorage->find(e.target.stored.id); - if (itr != mTargetStorage->end()) - { - ObjectList* objectList = itr->second->GetObjectList(); - l->assign(objectList->begin(), objectList->end()); - } - - // xinef: return l, retardness... what if list is empty? will return empty list instead of null pointer - break; - } - case SMART_TARGET_CLOSEST_CREATURE: - { - Creature* target = GetClosestCreatureWithEntry(GetBaseObject(), e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100), !e.target.closest.dead); + Player* target = obj->SelectNearestPlayer((float)e.target.playerDistance.dist); if (target) l->push_back(target); - break; } - case SMART_TARGET_CLOSEST_GAMEOBJECT: + break; + } + case SMART_TARGET_OWNER_OR_SUMMONER: + { + if (me) { - GameObject* target = GetClosestGameObjectWithEntry(GetBaseObject(), e.target.closest.entry, (float)(e.target.closest.dist ? e.target.closest.dist : 100)); - if (target) + if (Unit* owner = ObjectAccessor::GetUnit(*me, me->GetCharmerOrOwnerGUID())) + l->push_back(owner); + // Xinef: dont add same unit twice + else if (me->IsSummon() && me->ToTempSummon()->GetSummoner()) + l->push_back(me->ToTempSummon()->GetSummoner()); + } + else if (go) + { + if (Unit* owner = ObjectAccessor::GetUnit(*go, go->GetOwnerGUID())) + l->push_back(owner); + } + + // xinef: Get owner of owner + if (e.target.owner.useCharmerOrOwner && !l->empty()) + { + Unit* owner = l->front()->ToUnit(); + l->clear(); + + if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->GetCharmerOrOwnerGUID())) + l->push_back(base); + } + break; + } + case SMART_TARGET_THREAT_LIST: + { + if (me) + { + ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList(); + for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i) + if (Unit* temp = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid())) + // Xinef: added distance check + if (e.target.hostilRandom.maxDist == 0 || me->IsWithinCombatRange(temp, (float)e.target.hostilRandom.maxDist)) + l->push_back(temp); + } + break; + } + case SMART_TARGET_CLOSEST_ENEMY: + { + if (me) + if (Unit* target = me->SelectNearestTarget(e.target.closestAttackable.maxDist, e.target.closestAttackable.playerOnly)) l->push_back(target); - break; - } - case SMART_TARGET_CLOSEST_PLAYER: - { - if (WorldObject* obj = GetBaseObject()) - { - Player* target = obj->SelectNearestPlayer((float)e.target.playerDistance.dist); - if (target) - l->push_back(target); - } - break; - } - case SMART_TARGET_OWNER_OR_SUMMONER: - { - if (me) - { - if (Unit* owner = ObjectAccessor::GetUnit(*me, me->GetCharmerOrOwnerGUID())) - l->push_back(owner); - // Xinef: dont add same unit twice - else if (me->IsSummon() && me->ToTempSummon()->GetSummoner()) - l->push_back(me->ToTempSummon()->GetSummoner()); - } - else if (go) - { - if (Unit* owner = ObjectAccessor::GetUnit(*go, go->GetOwnerGUID())) - l->push_back(owner); - } - // xinef: Get owner of owner - if (e.target.owner.useCharmerOrOwner && !l->empty()) - { - Unit* owner = l->front()->ToUnit(); - l->clear(); + break; + } + case SMART_TARGET_CLOSEST_FRIENDLY: + { + if (me) + if (Unit* target = DoFindClosestFriendlyInRange(e.target.closestFriendly.maxDist, e.target.closestFriendly.playerOnly)) + l->push_back(target); - if (Unit* base = ObjectAccessor::GetUnit(*owner, owner->GetCharmerOrOwnerGUID())) - l->push_back(base); - } - break; - } - case SMART_TARGET_THREAT_LIST: - { - if (me) - { - ThreatContainer::StorageType threatList = me->getThreatManager().getThreatList(); - for (ThreatContainer::StorageType::const_iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* temp = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid())) - // Xinef: added distance check - if (e.target.hostilRandom.maxDist == 0 || me->IsWithinCombatRange(temp, (float)e.target.hostilRandom.maxDist)) - l->push_back(temp); - } - break; - } - case SMART_TARGET_CLOSEST_ENEMY: - { - if (me) - if (Unit* target = me->SelectNearestTarget(e.target.closestAttackable.maxDist, e.target.closestAttackable.playerOnly)) - l->push_back(target); - - break; - } - case SMART_TARGET_CLOSEST_FRIENDLY: - { - if (me) - if (Unit* target = DoFindClosestFriendlyInRange(e.target.closestFriendly.maxDist, e.target.closestFriendly.playerOnly)) - l->push_back(target); - - break; - } - case SMART_TARGET_NONE: - case SMART_TARGET_POSITION: - default: - break; + break; + } + case SMART_TARGET_NONE: + case SMART_TARGET_POSITION: + default: + break; } if (l->empty()) @@ -3335,550 +3367,550 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui switch (e.GetEventType()) { - case SMART_EVENT_LINK://special handling - ProcessAction(e, unit, var0, var1, bvar, spell, gob); - break; + case SMART_EVENT_LINK://special handling + ProcessAction(e, unit, var0, var1, bvar, spell, gob); + break; //called from Update tick - case SMART_EVENT_UPDATE: - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - break; - case SMART_EVENT_UPDATE_OOC: - if (me && me->IsInCombat()) - return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - break; - case SMART_EVENT_UPDATE_IC: - if (!me || !me->IsInCombat()) - return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - break; - case SMART_EVENT_HEALTH_PCT: - { - if (!me || !me->IsInCombat() || !me->GetMaxHealth()) - return; - uint32 perc = (uint32)me->GetHealthPct(); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - break; - } - case SMART_EVENT_TARGET_HEALTH_PCT: - { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth()) - return; - uint32 perc = (uint32)me->GetVictim()->GetHealthPct(); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; + case SMART_EVENT_UPDATE: + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + break; + case SMART_EVENT_UPDATE_OOC: + if (me && me->IsInCombat()) + return; + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + break; + case SMART_EVENT_UPDATE_IC: + if (!me || !me->IsInCombat()) + return; + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + break; + case SMART_EVENT_HEALTH_PCT: + { + if (!me || !me->IsInCombat() || !me->GetMaxHealth()) + return; + uint32 perc = (uint32)me->GetHealthPct(); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + break; + } + case SMART_EVENT_TARGET_HEALTH_PCT: + { + if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxHealth()) + return; + uint32 perc = (uint32)me->GetVictim()->GetHealthPct(); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); + break; + } + case SMART_EVENT_MANA_PCT: + { + if (!me || !me->IsInCombat() || !me->GetMaxPower(POWER_MANA)) + return; + uint32 perc = uint32(me->GetPowerPct(POWER_MANA)); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + break; + } + case SMART_EVENT_TARGET_MANA_PCT: + { + if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA)) + return; + uint32 perc = uint32(me->GetVictim()->GetPowerPct(POWER_MANA)); + if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) + return; + ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); + break; + } + case SMART_EVENT_RANGE: + { + if (!me || !me->IsInCombat() || !me->GetVictim()) + return; + + if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max)) ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); - break; - } - case SMART_EVENT_MANA_PCT: - { - if (!me || !me->IsInCombat() || !me->GetMaxPower(POWER_MANA)) - return; - uint32 perc = uint32(me->GetPowerPct(POWER_MANA)); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - break; - } - case SMART_EVENT_TARGET_MANA_PCT: - { - if (!me || !me->IsInCombat() || !me->GetVictim() || !me->GetVictim()->GetMaxPower(POWER_MANA)) - return; - uint32 perc = uint32(me->GetVictim()->GetPowerPct(POWER_MANA)); - if (perc > e.event.minMaxRepeat.max || perc < e.event.minMaxRepeat.min) - return; - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); - break; - } - case SMART_EVENT_RANGE: - { - if (!me || !me->IsInCombat() || !me->GetVictim()) - return; + else // xinef: make it predictable + RecalcTimer(e, 500, 500); + break; + } + case SMART_EVENT_VICTIM_CASTING: + { + if (!me || !me->IsInCombat()) + return; - if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max)) - ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); - else // xinef: make it predictable - RecalcTimer(e, 500, 500); - break; - } - case SMART_EVENT_VICTIM_CASTING: + Unit* victim = me->GetVictim(); + + if (!victim || !victim->IsNonMeleeSpellCast(false, false, true)) + return; + + if (e.event.targetCasting.spellId > 0) + if (Spell* currSpell = victim->GetCurrentSpell(CURRENT_GENERIC_SPELL)) + if (currSpell->m_spellInfo->Id != e.event.targetCasting.spellId) + return; + + ProcessTimedAction(e, e.event.targetCasting.repeatMin, e.event.targetCasting.repeatMax, me->GetVictim()); + break; + } + case SMART_EVENT_FRIENDLY_HEALTH: + { + if (!me || !me->IsInCombat()) + return; + + Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealth.radius, e.event.friendlyHealth.hpDeficit); + if (!target || !target->IsInCombat()) { - if (!me || !me->IsInCombat()) - return; - - Unit* victim = me->GetVictim(); - - if (!victim || !victim->IsNonMeleeSpellCast(false, false, true)) - return; - - if (e.event.targetCasting.spellId > 0) - if (Spell* currSpell = victim->GetCurrentSpell(CURRENT_GENERIC_SPELL)) - if (currSpell->m_spellInfo->Id != e.event.targetCasting.spellId) - return; - - ProcessTimedAction(e, e.event.targetCasting.repeatMin, e.event.targetCasting.repeatMax, me->GetVictim()); - break; + // Xinef: if there are at least two same npcs, they will perform the same action immediately even if this is useless... + RecalcTimer(e, 1000, 3000); + return; } - case SMART_EVENT_FRIENDLY_HEALTH: - { - if (!me || !me->IsInCombat()) - return; + ProcessTimedAction(e, e.event.friendlyHealth.repeatMin, e.event.friendlyHealth.repeatMax, target); + break; + } + case SMART_EVENT_FRIENDLY_IS_CC: + { + if (!me || !me->IsInCombat()) + return; - Unit* target = DoSelectLowestHpFriendly((float)e.event.friendlyHealth.radius, e.event.friendlyHealth.hpDeficit); - if (!target || !target->IsInCombat()) - { - // Xinef: if there are at least two same npcs, they will perform the same action immediately even if this is useless... - RecalcTimer(e, 1000, 3000); - return; - } - ProcessTimedAction(e, e.event.friendlyHealth.repeatMin, e.event.friendlyHealth.repeatMax, target); - break; - } - case SMART_EVENT_FRIENDLY_IS_CC: + std::list pList; + DoFindFriendlyCC(pList, (float)e.event.friendlyCC.radius); + if (pList.empty()) { - if (!me || !me->IsInCombat()) - return; + // Xinef: if there are at least two same npcs, they will perform the same action immediately even if this is useless... + RecalcTimer(e, 1000, 3000); + return; + } + ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, Trinity::Containers::SelectRandomContainerElement(pList)); + break; + } + case SMART_EVENT_FRIENDLY_MISSING_BUFF: + { + std::list pList; + DoFindFriendlyMissingBuff(pList, (float)e.event.missingBuff.radius, e.event.missingBuff.spell); - std::list pList; - DoFindFriendlyCC(pList, (float)e.event.friendlyCC.radius); - if (pList.empty()) - { - // Xinef: if there are at least two same npcs, they will perform the same action immediately even if this is useless... - RecalcTimer(e, 1000, 3000); - return; - } - ProcessTimedAction(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax, Trinity::Containers::SelectRandomContainerElement(pList)); - break; - } - case SMART_EVENT_FRIENDLY_MISSING_BUFF: - { - std::list pList; - DoFindFriendlyMissingBuff(pList, (float)e.event.missingBuff.radius, e.event.missingBuff.spell); + if (pList.empty()) + return; - if (pList.empty()) - return; - - ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Trinity::Containers::SelectRandomContainerElement(pList)); - break; - } - case SMART_EVENT_HAS_AURA: - { - if (!me) - return; - uint32 count = me->GetAuraCount(e.event.aura.spell); - if ((!e.event.aura.count && !count) || (e.event.aura.count && count >= e.event.aura.count)) - ProcessTimedAction(e, e.event.aura.repeatMin, e.event.aura.repeatMax); - break; - } - case SMART_EVENT_TARGET_BUFFED: - { - if (!me || !me->GetVictim()) - return; - uint32 count = me->GetVictim()->GetAuraCount(e.event.aura.spell); - if (count < e.event.aura.count) - return; + ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Trinity::Containers::SelectRandomContainerElement(pList)); + break; + } + case SMART_EVENT_HAS_AURA: + { + if (!me) + return; + uint32 count = me->GetAuraCount(e.event.aura.spell); + if ((!e.event.aura.count && !count) || (e.event.aura.count && count >= e.event.aura.count)) ProcessTimedAction(e, e.event.aura.repeatMin, e.event.aura.repeatMax); - break; - } - //no params - case SMART_EVENT_AGGRO: - case SMART_EVENT_DEATH: - case SMART_EVENT_EVADE: - case SMART_EVENT_REACHED_HOME: - case SMART_EVENT_CHARMED: - case SMART_EVENT_CHARMED_TARGET: - case SMART_EVENT_CORPSE_REMOVED: - case SMART_EVENT_AI_INIT: - case SMART_EVENT_TRANSPORT_ADDPLAYER: - case SMART_EVENT_TRANSPORT_REMOVE_PLAYER: - case SMART_EVENT_QUEST_ACCEPTED: - case SMART_EVENT_QUEST_OBJ_COPLETETION: - case SMART_EVENT_QUEST_COMPLETION: - case SMART_EVENT_QUEST_REWARDED: - case SMART_EVENT_QUEST_FAIL: - case SMART_EVENT_JUST_SUMMONED: - case SMART_EVENT_RESET: - case SMART_EVENT_JUST_CREATED: - case SMART_EVENT_FOLLOW_COMPLETED: - case SMART_EVENT_ON_SPELLCLICK: - ProcessAction(e, unit, var0, var1, bvar, spell, gob); - break; + break; + } + case SMART_EVENT_TARGET_BUFFED: + { + if (!me || !me->GetVictim()) + return; + uint32 count = me->GetVictim()->GetAuraCount(e.event.aura.spell); + if (count < e.event.aura.count) + return; + ProcessTimedAction(e, e.event.aura.repeatMin, e.event.aura.repeatMax); + break; + } + //no params + case SMART_EVENT_AGGRO: + case SMART_EVENT_DEATH: + case SMART_EVENT_EVADE: + case SMART_EVENT_REACHED_HOME: + case SMART_EVENT_CHARMED: + case SMART_EVENT_CHARMED_TARGET: + case SMART_EVENT_CORPSE_REMOVED: + case SMART_EVENT_AI_INIT: + case SMART_EVENT_TRANSPORT_ADDPLAYER: + case SMART_EVENT_TRANSPORT_REMOVE_PLAYER: + case SMART_EVENT_QUEST_ACCEPTED: + case SMART_EVENT_QUEST_OBJ_COPLETETION: + case SMART_EVENT_QUEST_COMPLETION: + case SMART_EVENT_QUEST_REWARDED: + case SMART_EVENT_QUEST_FAIL: + case SMART_EVENT_JUST_SUMMONED: + case SMART_EVENT_RESET: + case SMART_EVENT_JUST_CREATED: + case SMART_EVENT_FOLLOW_COMPLETED: + case SMART_EVENT_ON_SPELLCLICK: + ProcessAction(e, unit, var0, var1, bvar, spell, gob); + break; // Xinef: added no report use distinction for gameobjects - case SMART_EVENT_GOSSIP_HELLO: - if (e.event.gossipHello.noReportUse && var0) - return; - ProcessAction(e, unit, var0, var1, bvar, spell, gob); - break; - case SMART_EVENT_IS_BEHIND_TARGET: - { - if (!me) - return; + case SMART_EVENT_GOSSIP_HELLO: + if (e.event.gossipHello.noReportUse && var0) + return; + ProcessAction(e, unit, var0, var1, bvar, spell, gob); + break; + case SMART_EVENT_IS_BEHIND_TARGET: + { + if (!me) + return; - if (Unit* victim = me->GetVictim()) - { - if (!victim->HasInArc(static_cast(M_PI), me)) - ProcessTimedAction(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax, victim); - } - break; - } - case SMART_EVENT_RECEIVE_EMOTE: - if (e.event.emote.emote == var0) + if (Unit* victim = me->GetVictim()) + { + if (!victim->HasInArc(static_cast(M_PI), me)) + ProcessTimedAction(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax, victim); + } + break; + } + case SMART_EVENT_RECEIVE_EMOTE: + if (e.event.emote.emote == var0) + { + ProcessAction(e, unit); + RecalcTimer(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax); + } + break; + case SMART_EVENT_KILL: + { + if (!me || !unit) + return; + if (e.event.kill.playerOnly && unit->GetTypeId() != TYPEID_PLAYER) + return; + if (e.event.kill.creature && unit->GetEntry() != e.event.kill.creature) + return; + RecalcTimer(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax); + ProcessAction(e, unit); + break; + } + case SMART_EVENT_SPELLHIT_TARGET: + case SMART_EVENT_SPELLHIT: + { + if (!spell) + return; + if ((!e.event.spellHit.spell || spell->Id == e.event.spellHit.spell) && + (!e.event.spellHit.school || (spell->SchoolMask & e.event.spellHit.school))) + { + RecalcTimer(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax); + ProcessAction(e, unit, 0, 0, bvar, spell); + } + break; + } + case SMART_EVENT_OOC_LOS: + { + if (!me || me->IsInCombat()) + return; + //can trigger if closer than fMaxAllowedRange + float range = (float)e.event.los.maxDist; + + //if range is ok and we are actually in LOS + if (me->IsWithinDistInMap(unit, range) && me->IsWithinLOSInMap(unit)) + { + //if friendly event&&who is not hostile OR hostile event&&who is hostile + if ((e.event.los.noHostile && !me->IsHostileTo(unit)) || + (!e.event.los.noHostile && me->IsHostileTo(unit))) { + RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax); ProcessAction(e, unit); - RecalcTimer(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax); } - break; - case SMART_EVENT_KILL: - { - if (!me || !unit) - return; - if (e.event.kill.playerOnly && unit->GetTypeId() != TYPEID_PLAYER) - return; - if (e.event.kill.creature && unit->GetEntry() != e.event.kill.creature) - return; - RecalcTimer(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax); - ProcessAction(e, unit); - break; } - case SMART_EVENT_SPELLHIT_TARGET: - case SMART_EVENT_SPELLHIT: - { - if (!spell) - return; - if ((!e.event.spellHit.spell || spell->Id == e.event.spellHit.spell) && - (!e.event.spellHit.school || (spell->SchoolMask & e.event.spellHit.school))) - { - RecalcTimer(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax); - ProcessAction(e, unit, 0, 0, bvar, spell); - } - break; - } - case SMART_EVENT_OOC_LOS: - { - if (!me || me->IsInCombat()) - return; - //can trigger if closer than fMaxAllowedRange - float range = (float)e.event.los.maxDist; + break; + } + case SMART_EVENT_IC_LOS: + { + if (!me || !me->IsInCombat()) + return; + //can trigger if closer than fMaxAllowedRange + float range = (float)e.event.los.maxDist; - //if range is ok and we are actually in LOS - if (me->IsWithinDistInMap(unit, range) && me->IsWithinLOSInMap(unit)) + //if range is ok and we are actually in LOS + if (me->IsWithinDistInMap(unit, range) && me->IsWithinLOSInMap(unit)) + { + //if friendly event&&who is not hostile OR hostile event&&who is hostile + if ((e.event.los.noHostile && !me->IsHostileTo(unit)) || + (!e.event.los.noHostile && me->IsHostileTo(unit))) { - //if friendly event&&who is not hostile OR hostile event&&who is hostile - if ((e.event.los.noHostile && !me->IsHostileTo(unit)) || - (!e.event.los.noHostile && me->IsHostileTo(unit))) - { - RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax); - ProcessAction(e, unit); - } - } - break; - } - case SMART_EVENT_IC_LOS: - { - if (!me || !me->IsInCombat()) - return; - //can trigger if closer than fMaxAllowedRange - float range = (float)e.event.los.maxDist; - - //if range is ok and we are actually in LOS - if (me->IsWithinDistInMap(unit, range) && me->IsWithinLOSInMap(unit)) - { - //if friendly event&&who is not hostile OR hostile event&&who is hostile - if ((e.event.los.noHostile && !me->IsHostileTo(unit)) || - (!e.event.los.noHostile && me->IsHostileTo(unit))) - { - RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax); - ProcessAction(e, unit); - } - } - break; - } - case SMART_EVENT_RESPAWN: - { - if (!GetBaseObject()) - return; - if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && GetBaseObject()->GetMapId() != e.event.respawn.map) - return; - if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_AREA && GetBaseObject()->GetZoneId() != e.event.respawn.area) - return; - ProcessAction(e); - break; - } - case SMART_EVENT_SUMMONED_UNIT: - { - if (!IsCreature(unit)) - return; - if (e.event.summoned.creature && unit->GetEntry() != e.event.summoned.creature) - return; - RecalcTimer(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax); - ProcessAction(e, unit); - break; - } - case SMART_EVENT_RECEIVE_HEAL: - case SMART_EVENT_DAMAGED: - case SMART_EVENT_DAMAGED_TARGET: - { - if (var0 > e.event.minMaxRepeat.max || var0 < e.event.minMaxRepeat.min) - return; - RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); - ProcessAction(e, unit); - break; - } - case SMART_EVENT_MOVEMENTINFORM: - { - if ((e.event.movementInform.type && var0 != e.event.movementInform.type) || (e.event.movementInform.id && var1 != e.event.movementInform.id)) - return; - ProcessAction(e, unit, var0, var1); - break; - } - case SMART_EVENT_TRANSPORT_RELOCATE: - case SMART_EVENT_WAYPOINT_START: - { - if (e.event.waypoint.pathID && var0 != e.event.waypoint.pathID) - return; - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_WAYPOINT_REACHED: - case SMART_EVENT_WAYPOINT_RESUMED: - case SMART_EVENT_WAYPOINT_PAUSED: - case SMART_EVENT_WAYPOINT_STOPPED: - case SMART_EVENT_WAYPOINT_ENDED: - { - if (!me || (e.event.waypoint.pointID && var0 != e.event.waypoint.pointID) || (e.event.waypoint.pathID && GetPathId() != e.event.waypoint.pathID)) - return; - ProcessAction(e, unit); - break; - } - case SMART_EVENT_SUMMON_DESPAWNED: - { - if (e.event.summoned.creature && e.event.summoned.creature != var0) - return; - RecalcTimer(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax); - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_INSTANCE_PLAYER_ENTER: - { - if (e.event.instancePlayerEnter.team && var0 != e.event.instancePlayerEnter.team) - return; - RecalcTimer(e, e.event.instancePlayerEnter.cooldownMin, e.event.instancePlayerEnter.cooldownMax); - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_ACCEPTED_QUEST: - case SMART_EVENT_REWARD_QUEST: - { - if (e.event.quest.quest && var0 != e.event.quest.quest) - return; - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_TRANSPORT_ADDCREATURE: - { - if (e.event.transportAddCreature.creature && var0 != e.event.transportAddCreature.creature) - return; - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_AREATRIGGER_ONTRIGGER: - { - if (e.event.areatrigger.id && var0 != e.event.areatrigger.id) - return; - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_TEXT_OVER: - { - if (var0 != e.event.textOver.textGroupID || (e.event.textOver.creatureEntry && e.event.textOver.creatureEntry != var1)) - return; - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_DATA_SET: - { - if (e.event.dataSet.id != var0 || e.event.dataSet.value != var1) - return; - RecalcTimer(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax); - ProcessAction(e, unit, var0, var1); - break; - } - case SMART_EVENT_PASSENGER_REMOVED: - case SMART_EVENT_PASSENGER_BOARDED: - { - if (!unit) - return; - RecalcTimer(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax); - ProcessAction(e, unit); - break; - } - case SMART_EVENT_TIMED_EVENT_TRIGGERED: - { - if (e.event.timedEvent.id == var0) + RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax); ProcessAction(e, unit); - break; + } } - case SMART_EVENT_GOSSIP_SELECT: - { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: Gossip Select: menu %u action %u", var0, var1);//little help for scripters + break; + } + case SMART_EVENT_RESPAWN: + { + if (!GetBaseObject()) + return; + if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && GetBaseObject()->GetMapId() != e.event.respawn.map) + return; + if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_AREA && GetBaseObject()->GetZoneId() != e.event.respawn.area) + return; + ProcessAction(e); + break; + } + case SMART_EVENT_SUMMONED_UNIT: + { + if (!IsCreature(unit)) + return; + if (e.event.summoned.creature && unit->GetEntry() != e.event.summoned.creature) + return; + RecalcTimer(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax); + ProcessAction(e, unit); + break; + } + case SMART_EVENT_RECEIVE_HEAL: + case SMART_EVENT_DAMAGED: + case SMART_EVENT_DAMAGED_TARGET: + { + if (var0 > e.event.minMaxRepeat.max || var0 < e.event.minMaxRepeat.min) + return; + RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); + ProcessAction(e, unit); + break; + } + case SMART_EVENT_MOVEMENTINFORM: + { + if ((e.event.movementInform.type && var0 != e.event.movementInform.type) || (e.event.movementInform.id && var1 != e.event.movementInform.id)) + return; + ProcessAction(e, unit, var0, var1); + break; + } + case SMART_EVENT_TRANSPORT_RELOCATE: + case SMART_EVENT_WAYPOINT_START: + { + if (e.event.waypoint.pathID && var0 != e.event.waypoint.pathID) + return; + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_WAYPOINT_REACHED: + case SMART_EVENT_WAYPOINT_RESUMED: + case SMART_EVENT_WAYPOINT_PAUSED: + case SMART_EVENT_WAYPOINT_STOPPED: + case SMART_EVENT_WAYPOINT_ENDED: + { + if (!me || (e.event.waypoint.pointID && var0 != e.event.waypoint.pointID) || (e.event.waypoint.pathID && GetPathId() != e.event.waypoint.pathID)) + return; + ProcessAction(e, unit); + break; + } + case SMART_EVENT_SUMMON_DESPAWNED: + { + if (e.event.summoned.creature && e.event.summoned.creature != var0) + return; + RecalcTimer(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax); + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_INSTANCE_PLAYER_ENTER: + { + if (e.event.instancePlayerEnter.team && var0 != e.event.instancePlayerEnter.team) + return; + RecalcTimer(e, e.event.instancePlayerEnter.cooldownMin, e.event.instancePlayerEnter.cooldownMax); + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_ACCEPTED_QUEST: + case SMART_EVENT_REWARD_QUEST: + { + if (e.event.quest.quest && var0 != e.event.quest.quest) + return; + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_TRANSPORT_ADDCREATURE: + { + if (e.event.transportAddCreature.creature && var0 != e.event.transportAddCreature.creature) + return; + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_AREATRIGGER_ONTRIGGER: + { + if (e.event.areatrigger.id && var0 != e.event.areatrigger.id) + return; + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_TEXT_OVER: + { + if (var0 != e.event.textOver.textGroupID || (e.event.textOver.creatureEntry && e.event.textOver.creatureEntry != var1)) + return; + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_DATA_SET: + { + if (e.event.dataSet.id != var0 || e.event.dataSet.value != var1) + return; + RecalcTimer(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax); + ProcessAction(e, unit, var0, var1); + break; + } + case SMART_EVENT_PASSENGER_REMOVED: + case SMART_EVENT_PASSENGER_BOARDED: + { + if (!unit) + return; + RecalcTimer(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax); + ProcessAction(e, unit); + break; + } + case SMART_EVENT_TIMED_EVENT_TRIGGERED: + { + if (e.event.timedEvent.id == var0) + ProcessAction(e, unit); + break; + } + case SMART_EVENT_GOSSIP_SELECT: + { +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: Gossip Select: menu %u action %u", var0, var1); //little help for scripters #endif - if (e.event.gossip.sender != var0 || e.event.gossip.action != var1) - return; - ProcessAction(e, unit, var0, var1); - break; - } - case SMART_EVENT_GAME_EVENT_START: - case SMART_EVENT_GAME_EVENT_END: + if (e.event.gossip.sender != var0 || e.event.gossip.action != var1) + return; + ProcessAction(e, unit, var0, var1); + break; + } + case SMART_EVENT_GAME_EVENT_START: + case SMART_EVENT_GAME_EVENT_END: + { + if (e.event.gameEvent.gameEventId != var0) + return; + ProcessAction(e, NULL, var0); + break; + } + case SMART_EVENT_GO_STATE_CHANGED: + { + if (e.event.goStateChanged.state != var0) + return; + ProcessAction(e, unit, var0, var1); + break; + } + case SMART_EVENT_GO_EVENT_INFORM: + { + if (e.event.eventInform.eventId != var0) + return; + ProcessAction(e, NULL, var0); + break; + } + case SMART_EVENT_ACTION_DONE: + { + if (e.event.doAction.eventId != var0) + return; + ProcessAction(e, unit, var0); + break; + } + case SMART_EVENT_FRIENDLY_HEALTH_PCT: + { + if (!me || !me->IsInCombat()) + return; + + ObjectList* _targets = NULL; + + switch (e.GetTargetType()) { - if (e.event.gameEvent.gameEventId != var0) - return; - ProcessAction(e, NULL, var0); - break; - } - case SMART_EVENT_GO_STATE_CHANGED: - { - if (e.event.goStateChanged.state != var0) - return; - ProcessAction(e, unit, var0, var1); - break; - } - case SMART_EVENT_GO_EVENT_INFORM: - { - if (e.event.eventInform.eventId != var0) - return; - ProcessAction(e, NULL, var0); - break; - } - case SMART_EVENT_ACTION_DONE: - { - if (e.event.doAction.eventId != var0) - return; - ProcessAction(e, unit, var0); - break; - } - case SMART_EVENT_FRIENDLY_HEALTH_PCT: - { - if (!me || !me->IsInCombat()) - return; - - ObjectList* _targets = NULL; - - switch (e.GetTargetType()) - { - case SMART_TARGET_CREATURE_RANGE: - case SMART_TARGET_CREATURE_GUID: - case SMART_TARGET_CREATURE_DISTANCE: - case SMART_TARGET_CLOSEST_CREATURE: - case SMART_TARGET_CLOSEST_PLAYER: - case SMART_TARGET_PLAYER_RANGE: - case SMART_TARGET_PLAYER_DISTANCE: - _targets = GetTargets(e); - break; - default: - return; - } - - if (!_targets) - return; - - Unit* target = NULL; - - for (ObjectList::const_iterator itr = _targets->begin(); itr != _targets->end(); ++itr) - { - if (IsUnit(*itr) && me->IsFriendlyTo((*itr)->ToUnit()) && (*itr)->ToUnit()->IsAlive() && (*itr)->ToUnit()->IsInCombat()) - { - uint32 healthPct = uint32((*itr)->ToUnit()->GetHealthPct()); - - if (healthPct > e.event.friendlyHealthPct.maxHpPct || healthPct < e.event.friendlyHealthPct.minHpPct) - continue; - - target = (*itr)->ToUnit(); - break; - } - } - - delete _targets; - - if (!target) - return; - - ProcessTimedAction(e, e.event.friendlyHealthPct.repeatMin, e.event.friendlyHealthPct.repeatMax, target); - break; - } - case SMART_EVENT_DISTANCE_CREATURE: - { - if (!me) - return; - - WorldObject* creature = NULL; - - if (e.event.distance.guid != 0) - { - creature = FindCreatureNear(me, e.event.distance.guid); - - if (!creature) - return; - - if (!me->IsInRange(creature, 0, (float)e.event.distance.dist)) - return; - } - else if (e.event.distance.entry != 0) - { - std::list list; - me->GetCreatureListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist); - - if (!list.empty()) - creature = list.front(); - } - - if (creature) - ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat); - - break; - } - case SMART_EVENT_DISTANCE_GAMEOBJECT: - { - if (!me) - return; - - WorldObject* gameobject = NULL; - - if (e.event.distance.guid != 0) - { - gameobject = FindGameObjectNear(me, e.event.distance.guid); - - if (!gameobject) - return; - - if (!me->IsInRange(gameobject, 0, (float)e.event.distance.dist)) - return; - } - else if (e.event.distance.entry != 0) - { - std::list list; - me->GetGameObjectListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist); - - if (!list.empty()) - gameobject = list.front(); - } - - if (gameobject) - ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat); - - break; - } - case SMART_EVENT_COUNTER_SET: - if (e.event.counter.id != var0 || GetCounterValue(e.event.counter.id) != e.event.counter.value) - return; - - ProcessTimedAction(e, e.event.counter.cooldownMin, e.event.counter.cooldownMax); + case SMART_TARGET_CREATURE_RANGE: + case SMART_TARGET_CREATURE_GUID: + case SMART_TARGET_CREATURE_DISTANCE: + case SMART_TARGET_CLOSEST_CREATURE: + case SMART_TARGET_CLOSEST_PLAYER: + case SMART_TARGET_PLAYER_RANGE: + case SMART_TARGET_PLAYER_DISTANCE: + _targets = GetTargets(e); break; default: - sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); - break; + return; + } + + if (!_targets) + return; + + Unit* target = NULL; + + for (ObjectList::const_iterator itr = _targets->begin(); itr != _targets->end(); ++itr) + { + if (IsUnit(*itr) && me->IsFriendlyTo((*itr)->ToUnit()) && (*itr)->ToUnit()->IsAlive() && (*itr)->ToUnit()->IsInCombat()) + { + uint32 healthPct = uint32((*itr)->ToUnit()->GetHealthPct()); + + if (healthPct > e.event.friendlyHealthPct.maxHpPct || healthPct < e.event.friendlyHealthPct.minHpPct) + continue; + + target = (*itr)->ToUnit(); + break; + } + } + + delete _targets; + + if (!target) + return; + + ProcessTimedAction(e, e.event.friendlyHealthPct.repeatMin, e.event.friendlyHealthPct.repeatMax, target); + break; + } + case SMART_EVENT_DISTANCE_CREATURE: + { + if (!me) + return; + + WorldObject* creature = NULL; + + if (e.event.distance.guid != 0) + { + creature = FindCreatureNear(me, e.event.distance.guid); + + if (!creature) + return; + + if (!me->IsInRange(creature, 0, (float)e.event.distance.dist)) + return; + } + else if (e.event.distance.entry != 0) + { + std::list list; + me->GetCreatureListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist); + + if (!list.empty()) + creature = list.front(); + } + + if (creature) + ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat); + + break; + } + case SMART_EVENT_DISTANCE_GAMEOBJECT: + { + if (!me) + return; + + WorldObject* gameobject = NULL; + + if (e.event.distance.guid != 0) + { + gameobject = FindGameObjectNear(me, e.event.distance.guid); + + if (!gameobject) + return; + + if (!me->IsInRange(gameobject, 0, (float)e.event.distance.dist)) + return; + } + else if (e.event.distance.entry != 0) + { + std::list list; + me->GetGameObjectListWithEntryInGrid(list, e.event.distance.entry, (float)e.event.distance.dist); + + if (!list.empty()) + gameobject = list.front(); + } + + if (gameobject) + ProcessTimedAction(e, e.event.distance.repeat, e.event.distance.repeat); + + break; + } + case SMART_EVENT_COUNTER_SET: + if (e.event.counter.id != var0 || GetCounterValue(e.event.counter.id) != e.event.counter.value) + return; + + ProcessTimedAction(e, e.event.counter.cooldownMin, e.event.counter.cooldownMax); + break; + default: + sLog->outErrorDb("SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType()); + break; } } @@ -3887,23 +3919,23 @@ void SmartScript::InitTimer(SmartScriptHolder& e) switch (e.GetEventType()) { //set only events which have initial timers - case SMART_EVENT_UPDATE: - case SMART_EVENT_UPDATE_IC: - case SMART_EVENT_UPDATE_OOC: - RecalcTimer(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max); - break; - case SMART_EVENT_OOC_LOS: - case SMART_EVENT_IC_LOS: - // Xinef: wtf is this bullshit? cooldown should be processed AFTER action is done, not before... - //RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax); - //break; - case SMART_EVENT_DISTANCE_CREATURE: - case SMART_EVENT_DISTANCE_GAMEOBJECT: - RecalcTimer(e, e.event.distance.repeat, e.event.distance.repeat); - break; - default: - e.active = true; - break; + case SMART_EVENT_UPDATE: + case SMART_EVENT_UPDATE_IC: + case SMART_EVENT_UPDATE_OOC: + RecalcTimer(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max); + break; + case SMART_EVENT_OOC_LOS: + case SMART_EVENT_IC_LOS: + // Xinef: wtf is this bullshit? cooldown should be processed AFTER action is done, not before... + //RecalcTimer(e, e.event.los.cooldownMin, e.event.los.cooldownMax); + //break; + case SMART_EVENT_DISTANCE_CREATURE: + case SMART_EVENT_DISTANCE_GAMEOBJECT: + RecalcTimer(e, e.event.distance.repeat, e.event.distance.repeat); + break; + default: + e.active = true; + break; } } void SmartScript::RecalcTimer(SmartScriptHolder& e, uint32 min, uint32 max) @@ -3945,41 +3977,41 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff) e.active = true;//activate events with cooldown switch (e.GetEventType())//process ONLY timed events { - case SMART_EVENT_UPDATE: - case SMART_EVENT_UPDATE_OOC: - case SMART_EVENT_UPDATE_IC: - case SMART_EVENT_HEALTH_PCT: - case SMART_EVENT_TARGET_HEALTH_PCT: - case SMART_EVENT_MANA_PCT: - case SMART_EVENT_TARGET_MANA_PCT: - case SMART_EVENT_RANGE: - case SMART_EVENT_VICTIM_CASTING: - case SMART_EVENT_FRIENDLY_HEALTH: - case SMART_EVENT_FRIENDLY_IS_CC: - case SMART_EVENT_FRIENDLY_MISSING_BUFF: - case SMART_EVENT_HAS_AURA: - case SMART_EVENT_TARGET_BUFFED: - case SMART_EVENT_IS_BEHIND_TARGET: - case SMART_EVENT_FRIENDLY_HEALTH_PCT: - case SMART_EVENT_DISTANCE_CREATURE: - case SMART_EVENT_DISTANCE_GAMEOBJECT: + case SMART_EVENT_UPDATE: + case SMART_EVENT_UPDATE_OOC: + case SMART_EVENT_UPDATE_IC: + case SMART_EVENT_HEALTH_PCT: + case SMART_EVENT_TARGET_HEALTH_PCT: + case SMART_EVENT_MANA_PCT: + case SMART_EVENT_TARGET_MANA_PCT: + case SMART_EVENT_RANGE: + case SMART_EVENT_VICTIM_CASTING: + case SMART_EVENT_FRIENDLY_HEALTH: + case SMART_EVENT_FRIENDLY_IS_CC: + case SMART_EVENT_FRIENDLY_MISSING_BUFF: + case SMART_EVENT_HAS_AURA: + case SMART_EVENT_TARGET_BUFFED: + case SMART_EVENT_IS_BEHIND_TARGET: + case SMART_EVENT_FRIENDLY_HEALTH_PCT: + case SMART_EVENT_DISTANCE_CREATURE: + case SMART_EVENT_DISTANCE_GAMEOBJECT: + { + ProcessEvent(e); + if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) { - ProcessEvent(e); - if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST) + e.enableTimed = false;//disable event if it is in an ActionList and was processed once + for (SmartAIEventList::iterator i = mTimedActionList.begin(); i != mTimedActionList.end(); ++i) { - e.enableTimed = false;//disable event if it is in an ActionList and was processed once - for (SmartAIEventList::iterator i = mTimedActionList.begin(); i != mTimedActionList.end(); ++i) + //find the first event which is not the current one and enable it + if (i->event_id > e.event_id) { - //find the first event which is not the current one and enable it - if (i->event_id > e.event_id) - { - i->enableTimed = true; - break; - } + i->enableTimed = true; + break; } } - break; } + break; + } } } else @@ -4043,7 +4075,7 @@ void SmartScript::OnUpdate(uint32 const diff) if (!mRemIDs.empty()) { for (std::list::const_iterator i = mRemIDs.begin(); i != mRemIDs.end(); ++i) - RemoveStoredEvent(*i); + RemoveStoredEvent(*i); // xinef: clear list after cleaning... mRemIDs.clear(); @@ -4059,7 +4091,8 @@ void SmartScript::OnUpdate(uint32 const diff) mTextTimer = 0; mUseTextTimer = false; ProcessEventsFor(SMART_EVENT_TEXT_OVER, NULL, textID, entry); - } else mTextTimer -= diff; + } + else mTextTimer -= diff; } } @@ -4067,28 +4100,29 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn { if (e.empty()) { - //if (obj) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + if (obj) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for Entry %u is empty but is using SmartScript.", obj->GetEntry()); #endif - //if (at) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + if (at) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript: EventMap for AreaTrigger %u is empty but is using SmartScript.", at->id); #endif return; } for (SmartAIEventList::iterator i = e.begin(); i != e.end(); ++i) { - #ifndef TRINITY_DEBUG - if ((*i).event.event_flags & SMART_EVENT_FLAG_DEBUG_ONLY) - continue; - #endif +#ifndef TRINITY_DEBUG + if ((*i).event.event_flags & SMART_EVENT_FLAG_DEBUG_ONLY) + continue; +#endif if ((*i).event.event_flags & SMART_EVENT_FLAG_DIFFICULTY_ALL)//if has instance flag add only if in it { if (obj && obj->GetMap()->IsDungeon()) { - if ((1 << (obj->GetMap()->GetSpawnMode()+1)) & (*i).event.event_flags) + if ((1 << (obj->GetMap()->GetSpawnMode() + 1)) & (*i).event.event_flags) { mEvents.push_back((*i)); } @@ -4133,29 +4167,30 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTriggerEntry const* at) { switch (obj->GetTypeId()) { - case TYPEID_UNIT: - mScriptType = SMART_SCRIPT_TYPE_CREATURE; - me = obj->ToCreature(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); + case TYPEID_UNIT: + mScriptType = SMART_SCRIPT_TYPE_CREATURE; + me = obj->ToCreature(); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is Creature %u", me->GetEntry()); #endif - break; - case TYPEID_GAMEOBJECT: - mScriptType = SMART_SCRIPT_TYPE_GAMEOBJECT; - go = obj->ToGameObject(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); + break; + case TYPEID_GAMEOBJECT: + mScriptType = SMART_SCRIPT_TYPE_GAMEOBJECT; + go = obj->ToGameObject(); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is GameObject %u", go->GetEntry()); #endif - break; - default: - sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!"); - return; + break; + default: + sLog->outError("SmartScript::OnInitialize: Unhandled TypeID !WARNING!"); + return; } - } else if (at) + } + else if (at) { mScriptType = SMART_SCRIPT_TYPE_AREATRIGGER; trigger = at; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartScript::OnInitialize: source is AreaTrigger %u", trigger->id); #endif } @@ -4224,7 +4259,7 @@ void SmartScript::DoAction(int32 param) uint32 SmartScript::GetData(uint32 id) { - return 0; +return 0; } void SmartScript::SetData(uint32 id, uint32 value) @@ -4237,7 +4272,7 @@ void SmartScript::SetGUID(uint64 guid, int32 id) uint64 SmartScript::GetGUID(int32 id) { - return 0; +return 0; } void SmartScript::MovepointStart(uint32 id) @@ -4254,7 +4289,7 @@ void SmartScript::SetMovePathEndAction(SMART_ACTION action) uint32 SmartScript::DoChat(int8 id, uint64 whisperGuid) { - return 0; +return 0; }*/ // SmartScript end diff --git a/src/game/AI/SmartScripts/SmartScriptMgr.h b/src/game/AI/SmartScripts/SmartScriptMgr.h index 5a72e3666..ecacd1b21 100644 --- a/src/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/game/AI/SmartScripts/SmartScriptMgr.h @@ -1635,7 +1635,7 @@ class SmartAIMgr else { //if (entry > 0)//first search is for guid (negative), do not drop error if not found -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartAIMgr::GetScript: Could not load Script for Entry %d ScriptType %u.", entry, uint32(type)); #endif return temp; diff --git a/src/game/Achievements/AchievementMgr.cpp b/src/game/Achievements/AchievementMgr.cpp index ef514d635..7d009b352 100644 --- a/src/game/Achievements/AchievementMgr.cpp +++ b/src/game/Achievements/AchievementMgr.cpp @@ -649,7 +649,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) if (achievement->flags & ACHIEVEMENT_FLAG_HIDDEN) return; - #ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS && TRINITY_DEBUG + #if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(TRINITY_DEBUG) sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SendAchievementEarned(%u)", achievement->ID); #endif @@ -739,7 +739,7 @@ static const uint32 achievIdForDungeon[][4] = */ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 /*= 0*/, uint32 miscValue2 /*= 0*/, Unit* unit /*= NULL*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2); #endif @@ -1975,7 +1975,7 @@ void AchievementMgr::SetCriteriaProgress(AchievementCriteriaEntry const* entry, if (entry->timeLimit && timedIter == m_timedAchievements.end()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::SetCriteriaProgress(%u, %u) for (GUID:%u)", entry->ID, changeValue, m_player->GetGUIDLow()); #endif @@ -2122,7 +2122,7 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type, void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID); #endif diff --git a/src/game/AuctionHouse/AuctionHouseMgr.cpp b/src/game/AuctionHouse/AuctionHouseMgr.cpp index 379030dc5..f9b4a9049 100644 --- a/src/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouse/AuctionHouseMgr.cpp @@ -65,16 +65,16 @@ uint32 AuctionHouseMgr::GetAuctionDeposit(AuctionHouseEntry const* entry, uint32 uint32 timeHr = (((time / 60) / 60) / 12); uint32 deposit = uint32(((multiplier * MSV * count / 3) * timeHr * 3) * sWorld->getRate(RATE_AUCTION_DEPOSIT)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "MSV: %u", MSV); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Items: %u", count); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Multiplier: %f", multiplier); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "Deposit: %u", deposit); #endif diff --git a/src/game/Battlefield/Battlefield.cpp b/src/game/Battlefield/Battlefield.cpp index 9dfa45d03..b457743c0 100644 --- a/src/game/Battlefield/Battlefield.cpp +++ b/src/game/Battlefield/Battlefield.cpp @@ -899,7 +899,7 @@ bool BfCapturePoint::SetCapturePointData(GameObject* capturePoint) { ASSERT(capturePoint); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Creating capture point %u", capturePoint->GetEntry()); #endif diff --git a/src/game/Battlefield/BattlefieldMgr.cpp b/src/game/Battlefield/BattlefieldMgr.cpp index 537fda701..32a452a62 100644 --- a/src/game/Battlefield/BattlefieldMgr.cpp +++ b/src/game/Battlefield/BattlefieldMgr.cpp @@ -44,7 +44,7 @@ void BattlefieldMgr::InitBattlefield() // respawn, init variables if(!pBf->SetupBattlefield()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad init failed."); #endif delete pBf; @@ -52,7 +52,7 @@ void BattlefieldMgr::InitBattlefield() else { m_BattlefieldSet.push_back(pBf); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Battlefield : Tol Barad successfully initiated."); #endif } */ @@ -73,7 +73,7 @@ void BattlefieldMgr::HandlePlayerEnterZone(Player * player, uint32 zoneid) return; itr->second->HandlePlayerEnterZone(player, zoneid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); #endif } @@ -88,7 +88,7 @@ void BattlefieldMgr::HandlePlayerLeaveZone(Player * player, uint32 zoneid) if (!itr->second->HasPlayer(player)) return; itr->second->HandlePlayerLeaveZone(player, zoneid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEFIELD, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); #endif } diff --git a/src/game/Battlegrounds/ArenaTeam.cpp b/src/game/Battlegrounds/ArenaTeam.cpp index 6548c294b..1a5370b49 100644 --- a/src/game/Battlegrounds/ArenaTeam.cpp +++ b/src/game/Battlegrounds/ArenaTeam.cpp @@ -256,7 +256,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result) if (Empty() || !captainPresentInTeam) { // Arena team is empty or captain is not in team, delete from db -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", TeamId); #endif return false; @@ -391,7 +391,7 @@ void ArenaTeam::Roster(WorldSession* session) } session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_ROSTER"); #endif } @@ -408,7 +408,7 @@ void ArenaTeam::Query(WorldSession* session) data << uint32(BorderStyle); // border style data << uint32(BorderColor); // border color session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_QUERY_RESPONSE"); #endif } @@ -520,7 +520,7 @@ void ArenaTeam::BroadcastEvent(ArenaTeamEvents event, uint64 guid, uint8 strCoun BroadcastPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_EVENT"); #endif } diff --git a/src/game/Battlegrounds/Battleground.cpp b/src/game/Battlegrounds/Battleground.cpp index f178f0304..92ea2721e 100644 --- a/src/game/Battlegrounds/Battleground.cpp +++ b/src/game/Battlegrounds/Battleground.cpp @@ -297,8 +297,8 @@ inline void Battleground::_CheckSafePositions(uint32 diff) GetTeamStartLoc(itr->second->GetBgTeamId(), x, y, z, o); if (pos.GetExactDistSq(x, y, z) > maxDist) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", player->GetName().c_str(), GetMapId()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BATTLEGROUND: Sending %s back to start location (map: %u) (possible exploit)", itr->second->GetName().c_str(), GetMapId()); #endif itr->second->TeleportTo(GetMapId(), x, y, z, o); } @@ -1239,7 +1239,7 @@ void Battleground::AddPlayer(Player* player) AddOrSetPlayerToCorrectBgGroup(player, teamId); // Log -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("BATTLEGROUND: Player %s joined the battle.", player->GetName().c_str()); #endif } diff --git a/src/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/game/Battlegrounds/Zones/BattlegroundAV.cpp index e800b84ce..f035bd5dc 100644 --- a/src/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -59,7 +59,7 @@ void BattlegroundAV::HandleKillPlayer(Player* player, Player* killer) void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry()); #endif if (GetStatus() != STATUS_IN_PROGRESS) @@ -142,7 +142,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) return;//maybe we should log this, cause this must be a cheater or a big bug TeamId teamId = player->GetTeamId(); //TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed", questid); #endif switch (questid) @@ -154,7 +154,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][0]+=20; if (m_Team_QuestStatus[teamId][0] == 500 || m_Team_QuestStatus[teamId][0] == 1000 || m_Team_QuestStatus[teamId][0] == 1500) //25, 50, 75 turn ins { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..", questid); #endif for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) @@ -171,7 +171,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][1]++; RewardReputationToTeam(teamId, 1, teamId); //if (m_Team_QuestStatus[team][1] == 30) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif break; @@ -180,7 +180,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][2]++; RewardReputationToTeam(teamId, 1, teamId); //if (m_Team_QuestStatus[team][2] == 60) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif break; @@ -189,7 +189,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][3]++; RewardReputationToTeam(teamId, 1, teamId); //if (m_Team_QuestStatus[team][3] == 120) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif break; @@ -200,7 +200,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) case AV_QUEST_H_BOSS2: m_Team_QuestStatus[teamId][4]++; //if (m_Team_QuestStatus[team][4] >= 200) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif break; @@ -209,11 +209,11 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][5]++; if (m_Team_QuestStatus[teamId][5] == 28) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif //if (m_Team_QuestStatus[team][6] == 7) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); #endif } @@ -223,11 +223,11 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][6]++; if (m_Team_QuestStatus[teamId][6] == 7) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif //if (m_Team_QuestStatus[team][5] == 20) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); #endif } @@ -237,11 +237,11 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][7]++; if (m_Team_QuestStatus[teamId][7] == 25) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif //if (m_Team_QuestStatus[team][8] == 25) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); #endif } @@ -251,17 +251,17 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player* player) m_Team_QuestStatus[teamId][8]++; if (m_Team_QuestStatus[teamId][8] == 25) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); #endif //if (m_Team_QuestStatus[team][7] == 25) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); #endif } break; default: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all", questid); #endif return; //was no interesting quest at all @@ -446,7 +446,7 @@ void BattlegroundAV::StartingEventCloseDoors() void BattlegroundAV::StartingEventOpenDoors() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff"); #endif for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++) @@ -595,7 +595,7 @@ void BattlegroundAV::UpdatePlayerScore(Player* player, uint32 type, uint32 value void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) { uint32 object = GetObjectThroughNode(node); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i", node, object); #endif @@ -670,7 +670,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial) if (!initial) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north, 1=south)", mine); #endif if (mine == AV_SOUTH_MINE) @@ -683,7 +683,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial) } SendMineWorldStates(mine); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north, 1=south)", mine); #endif uint16 miner; @@ -707,7 +707,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, TeamId teamId, bool initial) else miner = AV_NPC_S_MINE_N_1; //vermin -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "spawning vermin"); #endif if (teamId == TEAM_ALLIANCE) @@ -827,7 +827,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node) BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i", object); #endif if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER) @@ -851,7 +851,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node) { //this function is the counterpart to GetNodeThroughObject() -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i", node); #endif if (m_Nodes[node].OwnerId == TEAM_ALLIANCE) @@ -934,7 +934,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) EventPlayerAssaultsPoint(player, object); return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node); #endif if (m_Nodes[node].PrevOwnerId != teamId) @@ -998,7 +998,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) BG_AV_Nodes node = GetNodeThroughObject(object); TeamId prevOwnerId = m_Nodes[node].OwnerId; TeamId teamId = player->GetTeamId(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i", object, node); #endif if (prevOwnerId == teamId || teamId == m_Nodes[node].TotalOwnerId) @@ -1354,7 +1354,7 @@ bool BattlegroundAV::SetupBattleground() } uint16 i; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Alterac Valley: entering state STATUS_WAIT_JOIN ..."); #endif // Initial Nodes @@ -1405,7 +1405,7 @@ bool BattlegroundAV::SetupBattleground() SpawnBGObject(BG_AV_OBJECT_STORMPIKE_BANNER, RESPAWN_IMMEDIATELY); //creatures -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes"); #endif for (i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i) @@ -1414,19 +1414,19 @@ bool BattlegroundAV::SetupBattleground() PopulateNode(BG_AV_Nodes(i)); } //all creatures which don't get despawned through the script are static -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures"); #endif for (i = 0; i < AV_STATICCPLACE_MAX; i++) AddAVCreature(0, i + AV_CPLACE_MAX); //mainspiritguides: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures"); #endif AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], TEAM_ALLIANCE); AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], TEAM_HORDE); //spawn the marshals (those who get deleted, if a tower gets destroyed) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures"); #endif for (i = AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++) diff --git a/src/game/Calendar/CalendarMgr.cpp b/src/game/Calendar/CalendarMgr.cpp index fbfa67941..a0031fdc7 100644 --- a/src/game/Calendar/CalendarMgr.cpp +++ b/src/game/Calendar/CalendarMgr.cpp @@ -306,8 +306,8 @@ CalendarInvite* CalendarMgr::GetInvite(uint64 inviteId) const if ((*itr2)->GetInviteId() == inviteId) return *itr2; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_CALENDAR, "CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_UNITS, "CalendarMgr::GetInvite: [" UI64FMTD "] not found!", inviteId); #endif return NULL; } diff --git a/src/game/Chat/Channels/Channel.cpp b/src/game/Chat/Channels/Channel.cpp index ff1615da9..f4f634c2b 100644 --- a/src/game/Chat/Channels/Channel.cpp +++ b/src/game/Chat/Channels/Channel.cpp @@ -96,7 +96,7 @@ void Channel::UpdateChannelInDB() const stmt->setUInt32(2, _channelDBId); CharacterDatabase.Execute(stmt); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) updated in database", _name.c_str()); #endif } @@ -684,7 +684,7 @@ void Channel::List(Player const* player) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "SMSG_CHANNEL_LIST %s Channel: %s", player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str()); #endif WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+playersStore.size()*(8+1)); diff --git a/src/game/Chat/ChatLink.cpp b/src/game/Chat/ChatLink.cpp index f01ff341b..b82fc1af9 100644 --- a/src/game/Chat/ChatLink.cpp +++ b/src/game/Chat/ChatLink.cpp @@ -64,7 +64,7 @@ inline bool CheckDelimiter(std::istringstream& iss, char delimiter, const char* char c = iss.peek(); if (c != delimiter) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid %s link structure ('%c' expected, '%c' found)", iss.str().c_str(), context, delimiter, c); #endif return false; @@ -100,7 +100,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) uint32 itemEntry = 0; if (!ReadUInt32(iss, itemEntry)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading item entry", iss.str().c_str()); #endif return false; @@ -109,7 +109,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) _item = sObjectMgr->GetItemTemplate(itemEntry); if (!_item) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid itemEntry %u in |item command", iss.str().c_str(), itemEntry); #endif return false; @@ -117,7 +117,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) // Validate item's color if (_color != ItemQualityColors[_item->Quality]) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked item has color %u, but user claims %u", iss.str().c_str(), ItemQualityColors[_item->Quality], _color); #endif return false; @@ -133,7 +133,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) int32 id = 0; if (!ReadInt32(iss, id)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading item property (%u)", iss.str().c_str(), index); #endif return false; @@ -146,7 +146,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) _property = sItemRandomPropertiesStore.LookupEntry(id); if (!_property) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid item property id %u in |item command", iss.str().c_str(), id); #endif return false; @@ -157,7 +157,7 @@ bool ItemChatLink::Initialize(std::istringstream& iss) _suffix = sItemRandomSuffixStore.LookupEntry(-id); if (!_suffix) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid item suffix id %u in |item command", iss.str().c_str(), -id); #endif return false; @@ -202,7 +202,7 @@ bool ItemChatLink::ValidateName(char* buffer, const char* context) } } //if (!res) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked item (id: %u) name wasn't found in any localization", context, _item->ItemId); #endif return res; @@ -216,7 +216,7 @@ bool QuestChatLink::Initialize(std::istringstream& iss) uint32 questId = 0; if (!ReadUInt32(iss, questId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest entry", iss.str().c_str()); #endif return false; @@ -225,7 +225,7 @@ bool QuestChatLink::Initialize(std::istringstream& iss) _quest = sObjectMgr->GetQuestTemplate(questId); if (!_quest) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): quest template %u not found", iss.str().c_str(), questId); #endif return false; @@ -236,7 +236,7 @@ bool QuestChatLink::Initialize(std::istringstream& iss) // Read quest level if (!ReadInt32(iss, _questLevel)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading quest level", iss.str().c_str()); #endif return false; @@ -244,7 +244,7 @@ bool QuestChatLink::Initialize(std::istringstream& iss) // Validate quest level if (_questLevel >= STRONG_MAX_LEVEL) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): quest level %d is too big", iss.str().c_str(), _questLevel); #endif return false; @@ -259,7 +259,7 @@ bool QuestChatLink::ValidateName(char* buffer, const char* context) bool res = (_quest->GetTitle() == buffer); //if (!res) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked quest (id: %u) title wasn't found in any localization", context, _quest->GetQuestId()); #endif return res; @@ -275,7 +275,7 @@ bool SpellChatLink::Initialize(std::istringstream& iss) uint32 spellId = 0; if (!ReadUInt32(iss, spellId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading spell entry", iss.str().c_str()); #endif return false; @@ -284,7 +284,7 @@ bool SpellChatLink::Initialize(std::istringstream& iss) _spell = sSpellMgr->GetSpellInfo(spellId); if (!_spell) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |spell command", iss.str().c_str(), spellId); #endif return false; @@ -302,7 +302,7 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) SkillLineAbilityMapBounds bounds = sSpellMgr->GetSkillLineAbilityMapBounds(_spell->Id); if (bounds.first == bounds.second) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for spell %u", context, _spell->Id); #endif return false; @@ -310,7 +310,7 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) SkillLineAbilityEntry const* skillInfo = bounds.first->second; if (!skillInfo) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line ability not found for spell %u", context, _spell->Id); #endif return false; @@ -318,7 +318,7 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId); if (!skillLine) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): skill line not found for skill %u", context, skillInfo->skillId); #endif return false; @@ -347,7 +347,7 @@ bool SpellChatLink::ValidateName(char* buffer, const char* context) } //if (!res) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked spell (id: %u) name wasn't found in any localization", context, _spell->Id); #endif return res; @@ -363,7 +363,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) uint32 achievementId = 0; if (!ReadUInt32(iss, achievementId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str()); #endif return false; @@ -372,7 +372,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) _achievement = sAchievementStore.LookupEntry(achievementId); if (!_achievement) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid achivement id %u in |achievement command", iss.str().c_str(), achievementId); #endif return false; @@ -383,7 +383,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) // Read HEX if (!ReadHex(iss, _guid, 0)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid hexadecimal number while reading char's guid", iss.str().c_str()); #endif return false; @@ -397,7 +397,7 @@ bool AchievementChatLink::Initialize(std::istringstream& iss) if (!ReadUInt32(iss, _data[index])) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement property (%u)", iss.str().c_str(), index); #endif return false; @@ -419,7 +419,7 @@ bool AchievementChatLink::ValidateName(char* buffer, const char* context) } //if (!res) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): linked achievement (id: %u) name wasn't found in any localization", context, _achievement->ID); #endif return res; @@ -435,7 +435,7 @@ bool TradeChatLink::Initialize(std::istringstream& iss) uint32 spellId = 0; if (!ReadUInt32(iss, spellId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement entry", iss.str().c_str()); #endif return false; @@ -444,7 +444,7 @@ bool TradeChatLink::Initialize(std::istringstream& iss) _spell = sSpellMgr->GetSpellInfo(spellId); if (!_spell) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), spellId); #endif return false; @@ -455,7 +455,7 @@ bool TradeChatLink::Initialize(std::istringstream& iss) // Minimum talent level if (!ReadInt32(iss, _minSkillLevel)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading minimum talent level", iss.str().c_str()); #endif return false; @@ -466,7 +466,7 @@ bool TradeChatLink::Initialize(std::istringstream& iss) // Maximum talent level if (!ReadInt32(iss, _maxSkillLevel)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading maximum talent level", iss.str().c_str()); #endif return false; @@ -477,7 +477,7 @@ bool TradeChatLink::Initialize(std::istringstream& iss) // Something hexadecimal if (!ReadHex(iss, _guid, 0)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading achievement's owner guid", iss.str().c_str()); #endif return false; @@ -496,7 +496,7 @@ bool TalentChatLink::Initialize(std::istringstream& iss) // Read talent entry if (!ReadUInt32(iss, _talentId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent entry", iss.str().c_str()); #endif return false; @@ -505,7 +505,7 @@ bool TalentChatLink::Initialize(std::istringstream& iss) TalentEntry const* talentInfo = sTalentStore.LookupEntry(_talentId); if (!talentInfo) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid talent id %u in |talent command", iss.str().c_str(), _talentId); #endif return false; @@ -514,7 +514,7 @@ bool TalentChatLink::Initialize(std::istringstream& iss) _spell = sSpellMgr->GetSpellInfo(talentInfo->RankID[0]); if (!_spell) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |trade command", iss.str().c_str(), talentInfo->RankID[0]); #endif return false; @@ -525,7 +525,7 @@ bool TalentChatLink::Initialize(std::istringstream& iss) // Rank if (!ReadInt32(iss, _rankId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading talent rank", iss.str().c_str()); #endif return false; @@ -543,7 +543,7 @@ bool EnchantmentChatLink::Initialize(std::istringstream& iss) uint32 spellId = 0; if (!ReadUInt32(iss, spellId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading enchantment spell entry", iss.str().c_str()); #endif return false; @@ -552,7 +552,7 @@ bool EnchantmentChatLink::Initialize(std::istringstream& iss) _spell = sSpellMgr->GetSpellInfo(spellId); if (!_spell) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |enchant command", iss.str().c_str(), spellId); #endif return false; @@ -569,7 +569,7 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) // Slot if (!ReadUInt32(iss, _slotId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading slot id", iss.str().c_str()); #endif return false; @@ -581,7 +581,7 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) uint32 glyphId = 0; if (!ReadUInt32(iss, glyphId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly while reading glyph entry", iss.str().c_str()); #endif return false; @@ -590,7 +590,7 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) _glyph = sGlyphPropertiesStore.LookupEntry(glyphId); if (!_glyph) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid glyph id %u in |glyph command", iss.str().c_str(), glyphId); #endif return false; @@ -599,7 +599,7 @@ bool GlyphChatLink::Initialize(std::istringstream& iss) _spell = sSpellMgr->GetSpellInfo(_glyph->SpellId); if (!_spell) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid spell id %u in |glyph command", iss.str().c_str(), _glyph->SpellId); #endif return false; @@ -639,7 +639,7 @@ bool LinkExtractor::IsValidMessage() } else if (_iss.get() != PIPE_CHAR) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence aborted unexpectedly", _iss.str().c_str()); #endif return false; @@ -648,7 +648,7 @@ bool LinkExtractor::IsValidMessage() // pipe has always to be followed by at least one char if (_iss.peek() == '\0') { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): pipe followed by '\\0'", _iss.str().c_str()); #endif return false; @@ -673,7 +673,7 @@ bool LinkExtractor::IsValidMessage() } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid sequence, expected '%c' but got '%c'", _iss.str().c_str(), *validSequenceIterator, commandChar); #endif return false; @@ -682,7 +682,7 @@ bool LinkExtractor::IsValidMessage() else if (validSequence != validSequenceIterator) { // no escaped pipes in sequences -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got escaped pipe in sequence", _iss.str().c_str()); #endif return false; @@ -693,7 +693,7 @@ bool LinkExtractor::IsValidMessage() case 'c': if (!ReadHex(_iss, color, 8)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): invalid hexadecimal number while reading color", _iss.str().c_str()); #endif return false; @@ -704,7 +704,7 @@ bool LinkExtractor::IsValidMessage() _iss.getline(buffer, 256, DELIMITER); if (_iss.eof()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly", _iss.str().c_str()); #endif return false; @@ -728,7 +728,7 @@ bool LinkExtractor::IsValidMessage() link = new GlyphChatLink(); else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): user sent unsupported link type '%s'", _iss.str().c_str(), buffer); #endif return false; @@ -745,7 +745,7 @@ bool LinkExtractor::IsValidMessage() // links start with '[' if (_iss.get() != '[') { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): link caption doesn't start with '['", _iss.str().c_str()); #endif return false; @@ -753,7 +753,7 @@ bool LinkExtractor::IsValidMessage() _iss.getline(buffer, 256, ']'); if (_iss.eof()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): sequence finished unexpectedly", _iss.str().c_str()); #endif return false; @@ -773,7 +773,7 @@ bool LinkExtractor::IsValidMessage() // no further payload break; default: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): got invalid command |%c", _iss.str().c_str(), commandChar); #endif return false; @@ -783,7 +783,7 @@ bool LinkExtractor::IsValidMessage() // check if every opened sequence was also closed properly if (validSequence != validSequenceIterator) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "ChatHandler::isValidChatMessage('%s'): EOF in active sequence", _iss.str().c_str()); #endif return false; diff --git a/src/game/Conditions/ConditionMgr.cpp b/src/game/Conditions/ConditionMgr.cpp index ba2ded825..9b50e65c5 100644 --- a/src/game/Conditions/ConditionMgr.cpp +++ b/src/game/Conditions/ConditionMgr.cpp @@ -26,7 +26,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) // object not present, return false if (!object) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Condition object not found for condition (Entry: %u Type: %u Group: %u)", SourceEntry, SourceType, SourceGroup); #endif return false; @@ -634,7 +634,7 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, std::map ElseGroupStore; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1); #endif if ((*i)->isLoaded()) @@ -657,9 +657,10 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo, } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->ReferenceId); -#endif } +#endif + } } else //handle normal condition @@ -693,7 +694,7 @@ bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, Con if (conditions.empty()) return true; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsObjectMeetToConditions"); #endif return IsObjectMeetToConditionList(sourceInfo, conditions); @@ -739,7 +740,7 @@ ConditionList ConditionMgr::GetConditionsForNotGroupedEntry(ConditionSourceType if (i != (*itr).second.end()) { spellCond = (*i).second; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForNotGroupedEntry: found conditions for type %u and entry %u", uint32(sourceType), entry); #endif } @@ -758,7 +759,7 @@ ConditionList ConditionMgr::GetConditionsForSpellClickEvent(uint32 creatureId, u if (i != (*itr).second.end()) { cond = (*i).second; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSpellClickEvent: found conditions for Vehicle entry %u spell %u", creatureId, spellId); #endif } @@ -776,7 +777,7 @@ ConditionList ConditionMgr::GetConditionsForVehicleSpell(uint32 creatureId, uint if (i != (*itr).second.end()) { cond = (*i).second; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForVehicleSpell: found conditions for Vehicle entry %u spell %u", creatureId, spellId); #endif } @@ -794,7 +795,7 @@ ConditionList ConditionMgr::GetConditionsForSmartEvent(int32 entryOrGuid, uint32 if (i != (*itr).second.end()) { cond = (*i).second; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "GetConditionsForSmartEvent: found conditions for Smart Event entry or guid %d event_id %u", entryOrGuid, eventId); #endif } diff --git a/src/game/DungeonFinding/LFGMgr.cpp b/src/game/DungeonFinding/LFGMgr.cpp index a7fb602bc..836cac77e 100644 --- a/src/game/DungeonFinding/LFGMgr.cpp +++ b/src/game/DungeonFinding/LFGMgr.cpp @@ -616,7 +616,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const // Can't join. Send result if (joinData.result != LFG_JOIN_OK) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Join: [" UI64FMTD "] joining with %u members. result: %u", guid, grp ? grp->GetMembersCount() : 1, joinData.result); #endif if (!dungeons.empty()) // Only should show lockmap when have no dungeons available @@ -709,7 +709,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const std::ostringstream o; o << "LFGMgr::Join: [" << guid << "] joined (" << (grp ? "group" : "player") << ") Members: " << debugNames.c_str() << ". Dungeons (" << uint32(dungeons.size()) << "): " << ConcatenateDungeons(dungeons); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug((LOG_FILTER_LFG, "%s", o.str().c_str()); #endif }*/ @@ -1604,7 +1604,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) LfgProposalPlayer& player = itProposalPlayer->second; player.accept = LfgAnswer(accept); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); #endif if (!accept) @@ -1697,7 +1697,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate LfgProposal& proposal = itProposal->second; proposal.state = LFG_PROPOSAL_FAILED; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); #endif // Mark all people that didn't answered as no accept @@ -1743,14 +1743,14 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate if (it->second.accept == LFG_ANSWER_DENY) { updateData.updateType = type; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); #endif } else { updateData.updateType = LFG_UPDATETYPE_REMOVED_FROM_QUEUE; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); #endif } @@ -1766,7 +1766,7 @@ void LFGMgr::RemoveProposal(LfgProposalContainer::iterator itProposal, LfgUpdate } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); #endif SetState(guid, LFG_STATE_QUEUED); @@ -2144,7 +2144,7 @@ LfgState LFGMgr::GetState(uint64 guid) else state = PlayersStore[guid].GetState(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state); #endif return state; @@ -2158,7 +2158,7 @@ LfgState LFGMgr::GetOldState(uint64 guid) else state = PlayersStore[guid].GetOldState(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetOldState: [" UI64FMTD "] = %u", guid, state); #endif return state; @@ -2167,7 +2167,7 @@ LfgState LFGMgr::GetOldState(uint64 guid) uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */) { uint32 dungeon = GroupsStore[guid].GetDungeon(asId); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon); #endif return dungeon; @@ -2181,7 +2181,7 @@ uint32 LFGMgr::GetDungeonMapId(uint64 guid) if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId)) mapId = dungeon->map; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeonMapId: [" UI64FMTD "] = %u (DungeonId = %u)", guid, mapId, dungeonId); #endif return mapId; @@ -2190,7 +2190,7 @@ uint32 LFGMgr::GetDungeonMapId(uint64 guid) uint8 LFGMgr::GetRoles(uint64 guid) { uint8 roles = PlayersStore[guid].GetRoles(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles); #endif return roles; @@ -2198,7 +2198,7 @@ uint8 LFGMgr::GetRoles(uint64 guid) const std::string& LFGMgr::GetComment(uint64 guid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, PlayersStore[guid].GetComment().c_str()); #endif return PlayersStore[guid].GetComment(); @@ -2206,7 +2206,7 @@ const std::string& LFGMgr::GetComment(uint64 guid) LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); #endif return PlayersStore[guid].GetSelectedDungeons(); @@ -2214,7 +2214,7 @@ LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid); #endif return PlayersStore[guid].GetLockedDungeons(); @@ -2223,7 +2223,7 @@ LfgLockMap const& LFGMgr::GetLockedDungeons(uint64 guid) uint8 LFGMgr::GetKicksLeft(uint64 guid) { uint8 kicks = GroupsStore[guid].GetKicksLeft(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "] = %u", guid, kicks); #endif return kicks; @@ -2287,7 +2287,7 @@ void LFGMgr::SetCanOverrideRBState(uint64 guid, bool val) void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon); #endif GroupsStore[guid].SetDungeon(dungeon); @@ -2295,7 +2295,7 @@ void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon) void LFGMgr::SetRoles(uint64 guid, uint8 roles) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles); #endif PlayersStore[guid].SetRoles(roles); @@ -2303,7 +2303,7 @@ void LFGMgr::SetRoles(uint64 guid, uint8 roles) void LFGMgr::SetComment(uint64 guid, std::string const& comment) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str()); #endif PlayersStore[guid].SetComment(comment); @@ -2324,7 +2324,7 @@ void LFGMgr::LfrSetComment(Player* p, std::string comment) void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); #endif PlayersStore[guid].SetSelectedDungeons(dungeons); @@ -2332,7 +2332,7 @@ void LFGMgr::SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons) void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid); #endif PlayersStore[guid].SetLockedDungeons(lock); @@ -2340,7 +2340,7 @@ void LFGMgr::SetLockedDungeons(uint64 guid, LfgLockMap const& lock) void LFGMgr::DecreaseKicksLeft(uint64 guid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid); #endif GroupsStore[guid].DecreaseKicksLeft(); @@ -2348,7 +2348,7 @@ void LFGMgr::DecreaseKicksLeft(uint64 guid) void LFGMgr::RemoveGroupData(uint64 guid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid); #endif LfgGroupDataContainer::iterator it = GroupsStore.find(guid); diff --git a/src/game/DungeonFinding/LFGScripts.cpp b/src/game/DungeonFinding/LFGScripts.cpp index abb0710df..e6153d9b8 100644 --- a/src/game/DungeonFinding/LFGScripts.cpp +++ b/src/game/DungeonFinding/LFGScripts.cpp @@ -102,9 +102,10 @@ void LFGPlayerScript::OnMapChanged(Player* player) sLFGMgr->LeaveAllLfgQueues(player->GetGUID(), true); player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, 0.0f); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGPlayerScript::OnMapChanged, Player %s (%u) is in LFG dungeon map but does not have a valid group! Teleporting to homebind.", player->GetName().c_str(), player->GetGUIDLow()); -#endif return; +#endif + return; } for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) @@ -139,7 +140,7 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid) if (leader == guid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "]", gguid, guid, leader); #endif sLFGMgr->SetLeader(gguid, guid); @@ -148,7 +149,7 @@ void LFGGroupScript::OnAddMember(Group* group, uint64 guid) { LfgState gstate = sLFGMgr->GetState(gguid); LfgState state = sLFGMgr->GetState(guid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state); #endif @@ -179,7 +180,7 @@ void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod meth return; uint64 gguid = group->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); #endif @@ -240,7 +241,7 @@ void LFGGroupScript::OnDisband(Group* group) return; uint64 gguid = group->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnDisband [" UI64FMTD "]", gguid); #endif @@ -258,7 +259,7 @@ void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 o uint64 gguid = group->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); #endif sLFGMgr->SetLeader(gguid, newLeaderGuid); @@ -275,7 +276,7 @@ void LFGGroupScript::OnInviteMember(Group* group, uint64 guid) uint64 gguid = group->GetGUID(); uint64 leader = group->GetLeaderGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, leader); #endif // No gguid == new group being formed diff --git a/src/game/Entities/Creature/Creature.cpp b/src/game/Entities/Creature/Creature.cpp index d8451bb9e..cd3beff0e 100644 --- a/src/game/Entities/Creature/Creature.cpp +++ b/src/game/Entities/Creature/Creature.cpp @@ -542,7 +542,7 @@ void Creature::Update(uint32 diff) else if (m_corpseRemoveTime <= time(NULL)) { RemoveCorpse(false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Removing corpse... %u ", GetUInt32Value(OBJECT_FIELD_ENTRY)); #endif } @@ -770,7 +770,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai) // make sure nothing can change the AI during AI update if (m_AI_locked) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "AIM_Initialize: failed to init, locked."); #endif return false; @@ -1608,7 +1608,7 @@ void Creature::Respawn(bool force) if (m_DBTableGuid) GetMap()->RemoveCreatureRespawnTime(m_DBTableGuid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Respawning creature %s (GuidLow: %u, Full GUID: " UI64FMTD " Entry: %u)", GetName().c_str(), GetGUIDLow(), GetGUID(), GetEntry()); #endif m_respawnTime = 0; @@ -1888,7 +1888,7 @@ void Creature::SendAIReaction(AiReaction reactionType) ((WorldObject*)this)->SendMessageToSet(&data, true); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_AI_REACTION, type %u.", reactionType); #endif } @@ -2218,7 +2218,7 @@ bool Creature::LoadCreaturesAddon(bool reload) } AddAura(*itr, this); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Spell: %u added to creature (GUID: %u Entry: %u)", *itr, GetGUIDLow(), GetEntry()); #endif } diff --git a/src/game/Entities/Creature/CreatureGroups.cpp b/src/game/Entities/Creature/CreatureGroups.cpp index 7bd69d66e..90527ca7f 100644 --- a/src/game/Entities/Creature/CreatureGroups.cpp +++ b/src/game/Entities/Creature/CreatureGroups.cpp @@ -28,7 +28,7 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) //Add member to an existing group if (itr != map->CreatureGroupHolder.end()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Group found: %u, inserting creature GUID: %u, Group InstanceID %u", groupId, member->GetGUIDLow(), member->GetInstanceId()); #endif itr->second->AddMember(member); @@ -36,7 +36,7 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) //Create new group else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Group not found: %u. Creating new group.", groupId); #endif CreatureGroup* group = new CreatureGroup(groupId); @@ -47,7 +47,7 @@ void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member) void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* member) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Deleting member pointer to GUID: %u from group %u", group->GetId(), member->GetDBTableGUIDLow()); #endif group->RemoveMember(member); @@ -58,7 +58,7 @@ void FormationMgr::RemoveCreatureFromGroup(CreatureGroup* group, Creature* membe if (!map) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Deleting group with InstanceID %u", member->GetInstanceId()); #endif map->CreatureGroupHolder.erase(group->GetId()); @@ -139,14 +139,14 @@ void FormationMgr::LoadCreatureFormations() void CreatureGroup::AddMember(Creature* member) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "CreatureGroup::AddMember: Adding unit GUID: %u.", member->GetGUIDLow()); #endif //Check if it is a leader if (member->GetDBTableGUIDLow() == m_groupID) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Unit GUID: %u is formation leader. Adding group.", member->GetGUIDLow()); #endif m_leader = member; @@ -177,7 +177,7 @@ void CreatureGroup::MemberAttackStart(Creature* member, Unit* target) for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr) { //if (m_leader) // avoid crash if leader was killed and reset. -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId()); #endif @@ -209,7 +209,7 @@ void CreatureGroup::FormationReset(bool dismiss) itr->first->GetMotionMaster()->Initialize(); else itr->first->GetMotionMaster()->MoveIdle(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Set %s movement for member GUID: %u", dismiss ? "default" : "idle", itr->first->GetGUIDLow()); #endif } diff --git a/src/game/Entities/Creature/GossipDef.cpp b/src/game/Entities/Creature/GossipDef.cpp index d944ddaf5..b685e2654 100644 --- a/src/game/Entities/Creature/GossipDef.cpp +++ b/src/game/Entities/Creature/GossipDef.cpp @@ -326,7 +326,7 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote const& eEmote, const std::string data.put(count_pos, count); _session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_LIST NPC Guid=%u", GUID_LOPART(npcGUID)); #endif } @@ -338,7 +338,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const data << uint8(questStatus); _session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus); #endif } @@ -445,7 +445,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, } _session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_DETAILS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); #endif } @@ -581,7 +581,7 @@ void PlayerMenu::SendQuestQueryResponse(Quest const* quest) const data << questObjectiveText[i]; _session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_QUERY_RESPONSE questid=%u", quest->GetQuestId()); #endif } @@ -674,7 +674,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b data << uint32(quest->RewardFactionValueIdOverride[i]); _session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); #endif } @@ -770,7 +770,7 @@ void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, data << uint32(0x10); _session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_REQUEST_ITEMS NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId()); #endif } diff --git a/src/game/Entities/GameObject/GameObject.cpp b/src/game/Entities/GameObject/GameObject.cpp index 8f40adfe2..9628a7f10 100644 --- a/src/game/Entities/GameObject/GameObject.cpp +++ b/src/game/Entities/GameObject/GameObject.cpp @@ -1389,7 +1389,7 @@ void GameObject::Use(Unit* user) if (info->goober.eventId) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow()); #endif GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this); @@ -1491,7 +1491,7 @@ void GameObject::Use(Unit* user) int32 roll = irand(1, 100); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll); #endif @@ -1775,7 +1775,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this)) sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType()); else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); #endif return; diff --git a/src/game/Entities/Item/Item.cpp b/src/game/Entities/Item/Item.cpp index d5ab1310e..9a5e5531b 100644 --- a/src/game/Entities/Item/Item.cpp +++ b/src/game/Entities/Item/Item.cpp @@ -283,7 +283,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff) if (!GetUInt32Value(ITEM_FIELD_DURATION)) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); #endif @@ -678,7 +678,7 @@ void Item::AddToUpdateQueueOf(Player* player) if (player->GetGUID() != GetOwnerGUID()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::AddToUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); #endif return; @@ -700,7 +700,7 @@ void Item::RemoveFromUpdateQueueOf(Player* player) if (player->GetGUID() != GetOwnerGUID()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::RemoveFromUpdateQueueOf - Owner's guid (%u) and player's guid (%u) don't match!", GUID_LOPART(GetOwnerGUID()), player->GetGUIDLow()); #endif return; diff --git a/src/game/Entities/Pet/Pet.cpp b/src/game/Entities/Pet/Pet.cpp index 60f4aa324..1e89b1905 100644 --- a/src/game/Entities/Pet/Pet.cpp +++ b/src/game/Entities/Pet/Pet.cpp @@ -625,7 +625,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner) bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PETS, "Pet::CreateBaseForTamed"); #endif uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET); @@ -1082,7 +1082,7 @@ void Pet::_LoadSpellCooldowns(PreparedQueryResult result) cooldowns[spell_id] = cooldown; _AddCreatureSpellCooldown(spell_id, cooldown); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PETS, "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); #endif } @@ -1191,7 +1191,7 @@ void Pet::_SaveSpells(SQLTransaction& trans) void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow()); #endif @@ -1263,7 +1263,7 @@ void Pet::_LoadAuras(PreparedQueryResult result, uint32 timediff) } aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]); aura->ApplyForTargets(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask); #endif } diff --git a/src/game/Entities/Player/Player.cpp b/src/game/Entities/Player/Player.cpp index f947eb860..3b972158b 100644 --- a/src/game/Entities/Player/Player.cpp +++ b/src/game/Entities/Player/Player.cpp @@ -1251,7 +1251,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo) bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Creating initial item, itemId = %u, count = %u", titem_id, titem_amount); #endif @@ -1349,7 +1349,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) { if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("We are fall to death, loosing 10 percents durability"); #endif DurabilityLossAll(0.10f, false); @@ -2221,7 +2221,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati // client without expansion support if (GetSession()->Expansion() < mEntry->Expansion()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Player %s using client without required expansion tried teleport to non accessible map %u", GetName().c_str(), mapid); #endif @@ -2239,7 +2239,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati return false; // normal client can't teleport to this map... } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Player %s is being teleported to map %u", GetName().c_str(), mapid); #endif @@ -2916,9 +2916,10 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes if (go->IsWithinDistInMap(this, go->GetInteractionDistance())) return go; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "IsGameObjectOfTypeInRange: GameObject '%s' [GUID: %u] is too far away from player %s [GUID: %u] to be used by him (distance=%f, maximal 10 is allowed)", go->GetGOInfo()->name.c_str(), go->GetGUIDLow(), GetName().c_str(), GetGUIDLow(), go->GetDistance(this)); -#endif } +#endif + } } return NULL; } @@ -4349,7 +4350,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) AddSpellCooldown(spell_id, item_id, (db_time-curTime)*IN_MILLISECONDS, needSend); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player (GUID: %u) spell %u, item %u cooldown loaded (%u secs).", GetGUIDLow(), spell_id, item_id, uint32(db_time-curTime)); #endif } @@ -5533,7 +5534,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g { if (GetGuildId() == 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("You are not member of a guild"); #endif return TotalCost; @@ -5550,7 +5551,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g } else if (!HasEnoughMoney(costs)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("You do not have enough money"); #endif return TotalCost; @@ -6174,7 +6175,7 @@ inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLeve bool Player::UpdateCraftSkill(uint32 spellid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateCraftSkill spellid %d", spellid); #endif @@ -6208,7 +6209,7 @@ bool Player::UpdateCraftSkill(uint32 spellid) bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLevel, uint32 Multiplicator) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel); #endif @@ -6238,7 +6239,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve bool Player::UpdateFishingSkill() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateFishingSkill"); #endif @@ -6259,7 +6260,7 @@ static const size_t bonusSkillLevelsSize = sizeof(bonusSkillLevels) / sizeof(uin bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "UpdateSkillPro(SkillId %d, Chance %3.1f%%)", SkillId, Chance / 10.0f); #endif if (!SkillId) @@ -6267,7 +6268,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) if (Chance <= 0) // speedup in 0 chance case { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); #endif return false; @@ -6309,13 +6310,13 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) } UpdateSkillEnchantments(SkillId, SkillValue, new_value); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance / 10.0f); #endif return true; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% missed", Chance / 10.0f); #endif return false; @@ -6696,7 +6697,7 @@ int16 Player::GetSkillTempBonusValue(uint32 skill) const void Player::SendActionButtons(uint32 state) const { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Sending Action Buttons for '%u' spec '%u'", GetGUIDLow(), m_activeSpec); #endif @@ -6721,7 +6722,7 @@ void Player::SendActionButtons(uint32 state) const } GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Action Buttons for '%u' spec '%u' Sent", GetGUIDLow(), m_activeSpec); #endif } @@ -6751,7 +6752,7 @@ bool Player::IsActionButtonDataValid(uint8 button, uint32 action, uint8 type) if (!HasSpell(action)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::IsActionButtonDataValid Spell action %u not added into button %u for player %s: player don't known this spell", action, button, GetName().c_str()); #endif return false; @@ -6782,7 +6783,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type) // set data and update to CHANGED if not NEW ab.SetActionAndType(action, ActionButtonType(type)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button); #endif return &ab; @@ -6799,7 +6800,7 @@ void Player::removeActionButton(uint8 button) else buttonItr->second.uState = ACTIONBUTTON_DELETED; // saved, will deleted at next save -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Action Button '%u' Removed from Player '%u'", button, GetGUIDLow()); #endif } @@ -6900,7 +6901,7 @@ void Player::CheckAreaExploreAndOutdoor() if (offset >= PLAYER_EXPLORED_ZONES_SIZE) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE); #endif return; @@ -6955,7 +6956,7 @@ void Player::CheckAreaExploreAndOutdoor() GiveXP(XP, NULL); SendExplorationExperience(area, XP); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Player %u discovered a new area: %u", GetGUIDLow(), area); #endif } @@ -7758,7 +7759,7 @@ void Player::DuelComplete(DuelCompleteType type) if (!duel) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Duel Complete %s %s", GetName().c_str(), duel->opponent->GetName().c_str()); #endif @@ -7883,7 +7884,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) if (item->IsBroken()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("applying mods for item %u ", item->GetGUIDLow()); #endif @@ -7903,7 +7904,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply) ApplyItemEquipSpell(item, apply); ApplyEnchantment(item, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyItemMods complete."); #endif } @@ -8384,7 +8385,7 @@ void Player::ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); #endif @@ -8737,7 +8738,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 void Player::_RemoveAllItemMods() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods start."); #endif @@ -8782,14 +8783,14 @@ void Player::_RemoveAllItemMods() } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_RemoveAllItemMods complete."); #endif } void Player::_ApplyAllItemMods() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods start."); #endif @@ -8835,7 +8836,7 @@ void Player::_ApplyAllItemMods() } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyAllItemMods complete."); #endif } @@ -8962,12 +8963,12 @@ void Player::SendLoot(uint64 guid, LootType loot_type) Loot* loot = 0; PermissionTypes permission = ALL_PERMISSION; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LOOT, "Player::SendLoot"); #endif if (IS_GAMEOBJECT_GUID(guid)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LOOT, "IS_GAMEOBJECT_GUID(guid)"); #endif GameObject* go = GetMap()->GetGameObject(guid); @@ -9362,7 +9363,7 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) InstanceScript* instance = GetInstanceScript(); Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(zoneid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Sending SMSG_INIT_WORLD_STATES to Map: %u, Zone: %u", mapid, zoneid); #endif @@ -10029,7 +10030,7 @@ uint32 Player::GetXPRestBonus(uint32 xp) SetRestBonus(GetRestBonus() - rested_bonus); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus()); #endif return rested_bonus; @@ -11102,7 +11103,7 @@ InventoryResult Player::CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 sl InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, uint32 entry, uint32 count, Item* pItem, bool swap, uint32* no_space_count) const { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, entry, count); #endif @@ -11594,7 +11595,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const if (!pItem) continue; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanStoreItems %i. item = %u, count = %u", k + 1, pItem->GetEntry(), pItem->GetCount()); #endif ItemTemplate const* pProto = pItem->GetTemplate(); @@ -11813,7 +11814,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item* pItem, bool dest = 0; if (pItem) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanEquipItem slot = %u, item = %u, count = %u", slot, pItem->GetEntry(), pItem->GetCount()); #endif ItemTemplate const* pProto = pItem->GetTemplate(); @@ -11990,7 +11991,7 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const if (!pItem) return EQUIP_ERR_OK; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUnequipItem slot = %u, item = %u, count = %u", pos, pItem->GetEntry(), pItem->GetCount()); #endif @@ -12032,7 +12033,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest uint32 count = pItem->GetCount(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanBankItem bag = %u, slot = %u, item = %u, count = %u", bag, slot, pItem->GetEntry(), pItem->GetCount()); #endif ItemTemplate const* pProto = pItem->GetTemplate(); @@ -12218,7 +12219,7 @@ InventoryResult Player::CanUseItem(Item* pItem, bool not_loading) const { if (pItem) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseItem item = %u", pItem->GetEntry()); #endif @@ -12393,7 +12394,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje InventoryResult Player::CanUseAmmo(uint32 item) const { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: CanUseAmmo item = %u", item); #endif if (!IsAlive()) @@ -12552,7 +12553,7 @@ Item* Player::_StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool uint8 bag = pos >> 8; uint8 slot = pos & 255; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: StoreItem bag = %u, slot = %u, item = %u, count = %u, guid = %u", bag, slot, pItem->GetEntry(), count, pItem->GetGUIDLow()); #endif @@ -12815,7 +12816,7 @@ void Player::VisualizeItem(uint8 slot, Item* pItem) if (pItem->GetTemplate()->Bonding == BIND_WHEN_EQUIPED || pItem->GetTemplate()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetTemplate()->Bonding == BIND_QUEST_ITEM) pItem->SetBinding(true); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: EquipItem slot = %u, item = %u", slot, pItem->GetEntry()); #endif @@ -12842,7 +12843,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update, bool swap) Item* pItem = GetItemByPos(bag, slot); if (pItem) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); #endif @@ -12968,7 +12969,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) Item* pItem = GetItemByPos(bag, slot); if (pItem) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItem bag = %u, slot = %u, item = %u", bag, slot, pItem->GetEntry()); #endif // Also remove all contained items if the item is a bag. @@ -13065,7 +13066,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool unequip_check) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item = %u, count = %u", itemEntry, count); #endif uint32 remcount = 0; @@ -13258,7 +13259,7 @@ void Player::DestroyItemCount(uint32 itemEntry, uint32 count, bool update, bool void Player::DestroyZoneLimitedItem(bool update, uint32 new_zone) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyZoneLimitedItem in map %u and area %u", GetMapId(), new_zone); #endif @@ -13292,7 +13293,7 @@ void Player::DestroyConjuredItems(bool update) { // used when entering arena // destroys all conjured items -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyConjuredItems"); #endif @@ -13350,7 +13351,7 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); #endif @@ -13415,7 +13416,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count); #endif Item* pNewItem = pSrcItem->CloneItem(count, this); @@ -13502,7 +13503,7 @@ void Player::SwapItem(uint16 src, uint16 dst) if (!pSrcItem) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); #endif @@ -13895,7 +13896,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem) } RemoveItemFromBuyBackSlot(slot, true); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: AddItemToBuyBackSlot item = %u, slot = %u", pItem->GetEntry(), slot); #endif @@ -13919,7 +13920,7 @@ void Player::AddItemToBuyBackSlot(Item* pItem) Item* Player::GetItemFromBuyBackSlot(uint32 slot) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: GetItemFromBuyBackSlot slot = %u", slot); #endif if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) @@ -13929,7 +13930,7 @@ Item* Player::GetItemFromBuyBackSlot(uint32 slot) void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: RemoveItemFromBuyBackSlot slot = %u", slot); #endif if (slot >= BUYBACK_SLOT_START && slot < BUYBACK_SLOT_END) @@ -13957,7 +13958,7 @@ void Player::RemoveItemFromBuyBackSlot(uint32 slot, bool del) void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint32 itemid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_INVENTORY_CHANGE_FAILURE (%u)", msg); #endif WorldPacket data(SMSG_INVENTORY_CHANGE_FAILURE, (msg == EQUIP_ERR_CANT_EQUIP_LEVEL_I ? 22 : 18)); @@ -14002,7 +14003,7 @@ void Player::SendEquipError(InventoryResult msg, Item* pItem, Item* pItem2, uint void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 param) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_BUY_FAILED"); #endif WorldPacket data(SMSG_BUY_FAILED, (8+4+4+1)); @@ -14016,7 +14017,7 @@ void Player::SendBuyError(BuyResult msg, Creature* creature, uint32 item, uint32 void Player::SendSellError(SellResult msg, Creature* creature, uint64 guid, uint32 param) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); #endif WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10 @@ -14090,7 +14091,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) if (m_itemDuration.empty()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Player::UpdateItemDuration(%u, %u)", time, realtimeonly); #endif @@ -14375,53 +14376,53 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Adding %u to stat nb %u", enchant_amount, enchant_spell_id); #endif switch (enchant_spell_id) { case ITEM_MOD_MANA: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA", enchant_amount); #endif HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_HEALTH: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH", enchant_amount); #endif HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_AGILITY: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u AGILITY", enchant_amount); #endif HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_AGILITY, (float)enchant_amount, apply); break; case ITEM_MOD_STRENGTH: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STRENGTH", enchant_amount); #endif HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STRENGTH, (float)enchant_amount, apply); break; case ITEM_MOD_INTELLECT: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u INTELLECT", enchant_amount); #endif HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_INTELLECT, (float)enchant_amount, apply); break; case ITEM_MOD_SPIRIT: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPIRIT", enchant_amount); #endif HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_SPIRIT, (float)enchant_amount, apply); break; case ITEM_MOD_STAMINA: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STAMINA", enchant_amount); #endif HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply); @@ -14429,61 +14430,61 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool break; case ITEM_MOD_DEFENSE_SKILL_RATING: ApplyRatingMod(CR_DEFENSE_SKILL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DEFENCE", enchant_amount); #endif break; case ITEM_MOD_DODGE_RATING: ApplyRatingMod(CR_DODGE, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u DODGE", enchant_amount); #endif break; case ITEM_MOD_PARRY_RATING: ApplyRatingMod(CR_PARRY, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u PARRY", enchant_amount); #endif break; case ITEM_MOD_BLOCK_RATING: ApplyRatingMod(CR_BLOCK, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SHIELD_BLOCK", enchant_amount); #endif break; case ITEM_MOD_HIT_MELEE_RATING: ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_HIT", enchant_amount); #endif break; case ITEM_MOD_HIT_RANGED_RATING: ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_HIT", enchant_amount); #endif break; case ITEM_MOD_HIT_SPELL_RATING: ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_HIT", enchant_amount); #endif break; case ITEM_MOD_CRIT_MELEE_RATING: ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MELEE_CRIT", enchant_amount); #endif break; case ITEM_MOD_CRIT_RANGED_RATING: ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_CRIT", enchant_amount); #endif break; case ITEM_MOD_CRIT_SPELL_RATING: ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_CRIT", enchant_amount); #endif break; @@ -14520,7 +14521,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_HIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HIT_SPELL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HIT", enchant_amount); #endif break; @@ -14528,7 +14529,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_SPELL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u CRITICAL", enchant_amount); #endif break; @@ -14547,7 +14548,7 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_CRIT_TAKEN_MELEE, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_RANGED, enchant_amount, apply); ApplyRatingMod(CR_CRIT_TAKEN_SPELL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RESILIENCE", enchant_amount); #endif break; @@ -14555,68 +14556,68 @@ void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool ApplyRatingMod(CR_HASTE_MELEE, enchant_amount, apply); ApplyRatingMod(CR_HASTE_RANGED, enchant_amount, apply); ApplyRatingMod(CR_HASTE_SPELL, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HASTE", enchant_amount); #endif break; case ITEM_MOD_EXPERTISE_RATING: ApplyRatingMod(CR_EXPERTISE, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u EXPERTISE", enchant_amount); #endif break; case ITEM_MOD_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_VALUE, float(enchant_amount), apply); HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ATTACK_POWER", enchant_amount); #endif break; case ITEM_MOD_RANGED_ATTACK_POWER: HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(enchant_amount), apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u RANGED_ATTACK_POWER", enchant_amount); #endif break; // case ITEM_MOD_FERAL_ATTACK_POWER: // ApplyFeralAPBonus(enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) // sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u FERAL_ATTACK_POWER", enchant_amount); #endif // break; case ITEM_MOD_MANA_REGENERATION: ApplyManaRegenBonus(enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA_REGENERATION", enchant_amount); #endif break; case ITEM_MOD_ARMOR_PENETRATION_RATING: ApplyRatingMod(CR_ARMOR_PENETRATION, enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u ARMOR PENETRATION", enchant_amount); #endif break; case ITEM_MOD_SPELL_POWER: ApplySpellPowerBonus(enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_POWER", enchant_amount); #endif break; case ITEM_MOD_HEALTH_REGEN: ApplyHealthRegenBonus(enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH_REGENERATION", enchant_amount); #endif break; case ITEM_MOD_SPELL_PENETRATION: ApplySpellPenetrationBonus(enchant_amount, apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPELL_PENETRATION", enchant_amount); #endif break; case ITEM_MOD_BLOCK_VALUE: HandleBaseModValue(SHIELD_BLOCK_VALUE, FLAT_MOD, float(enchant_amount), apply); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u BLOCK_VALUE", enchant_amount); #endif break; @@ -16000,7 +16001,7 @@ bool Player::SatisfyQuestLog(bool msg) { WorldPacket data(SMSG_QUESTLOG_FULL, 0); GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTLOG_FULL"); #endif } @@ -16174,7 +16175,7 @@ bool Player::SatisfyQuestConditions(Quest const* qInfo, bool msg) { if (msg) SendCanTakeQuestResponse(INVALIDREASON_DONT_HAVE_REQ); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "Player::SatisfyQuestConditions: conditions not met for quest %u", qInfo->GetQuestId()); #endif return false; @@ -17238,7 +17239,7 @@ void Player::SendQuestComplete(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_COMPLETE, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_COMPLETE quest = %u", quest_id); #endif } @@ -17247,7 +17248,7 @@ void Player::SendQuestComplete(uint32 quest_id) void Player::SendQuestReward(Quest const* quest, uint32 XP) { uint32 questid = quest->GetQuestId(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); #endif sGameEventMgr->HandleQuestComplete(questid); @@ -17279,7 +17280,7 @@ void Player::SendQuestFailed(uint32 questId, InventoryResult reason) data << uint32(questId); data << uint32(reason); // failed reason (valid reasons: 4, 16, 50, 17, 74, other values show default message) GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_FAILED"); #endif } @@ -17292,7 +17293,7 @@ void Player::SendQuestTimerFailed(uint32 quest_id) WorldPacket data(SMSG_QUESTUPDATE_FAILEDTIMER, 4); data << uint32(quest_id); GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_FAILEDTIMER"); #endif } @@ -17303,7 +17304,7 @@ void Player::SendCanTakeQuestResponse(uint32 msg) const WorldPacket data(SMSG_QUESTGIVER_QUEST_INVALID, 4); data << uint32(msg); GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_INVALID"); #endif } @@ -17326,7 +17327,7 @@ void Player::SendQuestConfirmAccept(const Quest* quest, Player* pReceiver) data << uint64(GetGUID()); pReceiver->GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUEST_CONFIRM_ACCEPT"); #endif } @@ -17340,7 +17341,7 @@ void Player::SendPushToPartyResponse(Player* player, uint8 msg) data << uint64(player->GetGUID()); data << uint8(msg); // valid values: 0-8 GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_QUEST_PUSH_RESULT"); #endif } @@ -17349,7 +17350,7 @@ void Player::SendPushToPartyResponse(Player* player, uint8 msg) void Player::SendQuestUpdateAddItem(Quest const* /*quest*/, uint32 /*item_idx*/, uint16 /*count*/) { WorldPacket data(SMSG_QUESTUPDATE_ADD_ITEM, 0); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_ITEM"); #endif //data << quest->RequiredItemId[item_idx]; @@ -17367,7 +17368,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* quest, uint64 guid, uin entry = (-entry) | 0x80000000; WorldPacket data(SMSG_QUESTUPDATE_ADD_KILL, (4*4+8)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_KILL"); #endif data << uint32(quest->GetQuestId()); @@ -17387,7 +17388,7 @@ void Player::SendQuestUpdateAddPlayer(Quest const* quest, uint16 old_count, uint ASSERT(old_count + add_count < 65536 && "player count store in 16 bits"); WorldPacket data(SMSG_QUESTUPDATE_ADD_PVP_KILL, (3*4)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTUPDATE_ADD_PVP_KILL"); #endif data << uint32(quest->GetQuestId()); @@ -17701,7 +17702,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_items[slot] = NULL; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Load Basic value of player %s is: ", m_name.c_str()); #endif outDebugValues(); @@ -17884,7 +17885,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { if (GetSession()->Expansion() < mapEntry->Expansion()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player %s using client without required expansion tried login at non accessible map %u", GetName().c_str(), mapId); #endif RelocateToHomebind(); @@ -18142,7 +18143,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); #endif outDebugValues(); @@ -18309,7 +18310,7 @@ void Player::_LoadActions(PreparedQueryResult result) ab->uState = ACTIONBUTTON_UNCHANGED; else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outError("ActionButton loading problem, will be deleted from db..."); #endif @@ -18322,7 +18323,7 @@ void Player::_LoadActions(PreparedQueryResult result) void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Loading auras for player %u", GetGUIDLow()); #endif @@ -18398,7 +18399,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]); aura->ApplyForTargets(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Added aura spellid %u, effectmask %u", spellInfo->Id, effmask); #endif } @@ -18600,24 +18601,26 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F // Do not allow to have item limited to another map/zone in alive state if (IsAlive() && item->IsLimitedToAnotherMapOrZone(GetMapId(), zoneId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', map: %u) has item (GUID: %u, entry: %u) limited to another map (%u). Deleting item.", GetGUIDLow(), GetName().c_str(), GetMapId(), item->GetGUIDLow(), item->GetEntry(), zoneId); -#endif remove = true; +#endif + remove = true; } // "Conjured items disappear if you are logged out for more than 15 minutes" else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.", GetGUIDLow(), GetName().c_str(), timeDiff, item->GetGUIDLow(), item->GetEntry()); -#endif remove = true; +#endif + remove = true; } else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { if (item->GetPlayedTime() > (2 * HOUR)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with expired refund time (%u). Deleting refund data and removing refundable flag.", GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry(), item->GetPlayedTime()); #endif @@ -18642,10 +18645,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.", - // GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); -#endif item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); + GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); +#endif + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); } } } @@ -18671,10 +18675,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.", GetGUIDLow(), GetName().c_str(), item->GetGUIDLow(), item->GetEntry()); -#endif item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); +#endif + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); } } else if (proto->HolidayId) @@ -19019,7 +19024,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) ++slot; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Quest status is {%u} for quest {%u} for player (GUID: %u)", questStatusData.Status, quest_id, GetGUIDLow()); #endif } @@ -19112,7 +19117,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id); ++quest_daily_idx; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Daily quest (%u) cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); #endif } @@ -19137,7 +19142,7 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result) continue; m_weeklyquests.insert(quest_id); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Weekly quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); #endif } @@ -19163,7 +19168,7 @@ void Player::_LoadSeasonalQuestStatus(PreparedQueryResult result) continue; m_seasonalquests[event_id].insert(quest_id); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Seasonal quest {%u} cooldown for player (GUID: %u)", quest_id, GetGUIDLow()); #endif } @@ -19481,7 +19486,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) CharacterDatabase.Execute(stmt); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Setting player home position - mapid: %u, areaid: %u, X: %f, Y: %f, Z: %f", m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ); #endif @@ -19508,7 +19513,7 @@ void Player::SaveToDB(bool create, bool logout) // first save/honor gain after midnight will also update the player's honor fields UpdateHonorFields(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "The value of player %s at save: ", m_name.c_str()); #endif outDebugValues(); @@ -20219,40 +20224,18 @@ void Player::outDebugValues() const if (!sLog->IsOutDebug()) // optimize disabled debug output return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u", GetMaxHealth(), GetMaxPower(POWER_MANA)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f", GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f", GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "STAMINA is: \t\t%f", GetStat(STAT_STAMINA)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "Armor is: \t\t%u\t\tBlock is: \t\t%f", GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "HolyRes is: \t\t%u\t\tFireRes is: \t\t%u", GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u", GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u", GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f", GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_UNITS, "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u", GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); #endif } @@ -20652,7 +20635,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if (!pet->IsAlive() && mode == PET_SAVE_AS_CURRENT && pet->getPetType() == HUNTER_PET) mode = PET_SAVE_NOT_IN_SLOT; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PETS, "RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); #endif if (pet->m_removed) @@ -20817,7 +20800,7 @@ void Player::PetSpellInitialize() if (!pet) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PETS, "Pet Spells Groups"); #endif @@ -20931,7 +20914,7 @@ void Player::VehicleSpellInitialize() ConditionList conditions = sConditionMgr->GetConditionsForVehicleSpell(vehicle->GetEntry(), spellId); if (!sConditionMgr->IsObjectMeetToConditions(this, vehicle, conditions)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CONDITIONSYS, "VehicleSpellInitialize: conditions not met for Vehicle entry %u spell %u", vehicle->ToCreature()->GetEntry(), spellId); #endif data << uint16(0) << uint8(0) << uint8(i+8); @@ -21081,7 +21064,7 @@ class MageSpellModPred void Player::AddSpellMod(SpellModifier* mod, bool apply) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Player::AddSpellMod %d", mod->spellId); #endif uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER; @@ -21644,7 +21627,7 @@ void Player::ContinueTaxiFlight() if (!sourceNode) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Restart character %u taxi flight", GetGUIDLow()); #endif @@ -21901,7 +21884,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 Creature* creature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); #endif SendBuyError(BUY_ERR_DISTANCE_TOO_FAR, NULL, item, 0); @@ -22095,7 +22078,7 @@ void Player::UpdateHomebindTime(uint32 time) data << uint32(m_HomebindTimer); data << uint32(1); GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName().c_str(), GetGUIDLow()); #endif } @@ -22412,7 +22395,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot) } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Checking Condition %u, there are %u Meta Gems, %u Red Gems, %u Yellow Gems and %u Blue Gems, Activate:%s", enchantmentcondition, curcount[0], curcount[1], curcount[2], curcount[3], activate ? "yes" : "no"); #endif @@ -24500,7 +24483,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply) if (!IsInWorld() || IsDuringRemoveFromWorld()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s create seer %u (TypeId: %u).", GetName().c_str(), target->GetEntry(), target->GetTypeId()); #endif @@ -24521,7 +24504,7 @@ void Player::SetViewpoint(WorldObject* target, bool apply) //must immediately set seer back otherwise may crash m_seer = this; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Player::CreateViewpoint: Player %s remove seer", GetName().c_str()); #endif @@ -25360,7 +25343,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) } //Z given by moveinfo, LastZ, FallTime, WaterZ, MapZ, Damage, Safefall reduction -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("FALLDAMAGE z=%f sz=%f pZ=%f FallTime=%d mZ=%f damage=%d SF=%d", movementInfo.pos.GetPositionZ(), GetPositionZ(), movementInfo.fallTime, damage, safe_fall); #endif } @@ -25660,7 +25643,7 @@ void Player::LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank) // learn! (other talent ranks will unlearned at learning) pet->learnSpell(spellid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PetTalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid); #endif @@ -26940,7 +26923,7 @@ void Player::SendRefundInfo(Item* item) if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); #endif return; @@ -26948,7 +26931,7 @@ void Player::SendRefundInfo(Item* item) if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); #endif item->SetNotRefundable(this); @@ -26958,7 +26941,7 @@ void Player::SendRefundInfo(Item* item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); #endif return; @@ -27006,7 +26989,7 @@ void Player::RefundItem(Item* item) { if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item not refundable!"); #endif return; @@ -27024,7 +27007,7 @@ void Player::RefundItem(Item* item) if (GetGUIDLow() != item->GetRefundRecipient()) // Formerly refundable item got traded { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: item was traded!"); #endif item->SetNotRefundable(this); @@ -27034,7 +27017,7 @@ void Player::RefundItem(Item* item) ItemExtendedCostEntry const* iece = sItemExtendedCostStore.LookupEntry(item->GetPaidExtendedCost()); if (!iece) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item refund: cannot find extendedcost data."); #endif return; diff --git a/src/game/Entities/Player/SocialMgr.cpp b/src/game/Entities/Player/SocialMgr.cpp index 0b8e03cfa..7319dbcac 100644 --- a/src/game/Entities/Player/SocialMgr.cpp +++ b/src/game/Entities/Player/SocialMgr.cpp @@ -167,7 +167,7 @@ void PlayerSocial::SendSocialList(Player* player) } player->GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CONTACT_LIST"); #endif } diff --git a/src/game/Entities/Unit/Unit.cpp b/src/game/Entities/Unit/Unit.cpp index a6004c12f..06c5e75c9 100644 --- a/src/game/Entities/Unit/Unit.cpp +++ b/src/game/Entities/Unit/Unit.cpp @@ -789,12 +789,12 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage return 0; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("DealDamageStart"); #endif uint32 health = victim->GetHealth(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("deal dmg:%d to health:%d ", damage, health); #endif @@ -860,7 +860,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage if (health <= damage) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("DealDamage: victim just died"); #endif @@ -871,7 +871,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("DealDamageAlive"); #endif @@ -964,7 +964,7 @@ uint32 Unit::DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("DealDamageEnd returned %d damage", damage); #endif @@ -1226,7 +1226,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss) SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(damageInfo->SpellID); if (spellProto == NULL) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "Unit::DealSpellDamage has wrong damageInfo->SpellID: %u", damageInfo->SpellID); #endif return; @@ -2161,12 +2161,12 @@ void Unit::AttackerStateUpdate (Unit* victim, WeaponAttackType attType, bool ext ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType); /*if (GetTypeId() == TYPEID_PLAYER) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", #endif GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist); else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("AttackerStateUpdate: (NPC) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", #endif GetGUIDLow(), victim->GetGUIDLow(), victim->GetTypeId(), damageInfo.damage, damageInfo.absorb, damageInfo.blocked_amount, damageInfo.resist);*/ @@ -2239,7 +2239,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // always crit against a sitting target (except 0 crit chance) if (victim->GetTypeId() == TYPEID_PLAYER && crit_chance > 0 && !victim->IsStandState()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT (sitting victim)"); #endif return MELEE_HIT_CRIT; @@ -2275,7 +2275,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && ((tmp -= skillBonus) > 0) && roll < (sum += tmp)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: DODGE <%d, %d)", sum-tmp, sum); #endif return MELEE_HIT_DODGE; @@ -2286,7 +2286,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy // check if attack comes from behind, nobody can parry or block if attacker is behind if (!victim->HasInArc(M_PI, this) && !victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind."); #endif else @@ -2309,7 +2309,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && (tmp -= skillBonus) > 0 && roll < (sum += tmp)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: PARRY <%d, %d)", sum-tmp, sum); #endif return MELEE_HIT_PARRY; @@ -2328,7 +2328,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy && (tmp -= skillBonus) > 0 && roll < (sum += tmp)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: BLOCK <%d, %d)", sum-tmp, sum); #endif return MELEE_HIT_BLOCK; @@ -2351,7 +2351,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy tmp = tmp > 4000 ? 4000 : tmp; if (roll < (sum += tmp)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: GLANCING <%d, %d)", sum-4000, sum); #endif return MELEE_HIT_GLANCING; @@ -2377,7 +2377,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy tmp = tmp * 200 - 1500; if (roll < (sum += tmp)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRUSHING <%d, %d)", sum-tmp, sum); #endif return MELEE_HIT_CRUSHING; @@ -2390,18 +2390,18 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit* victim, WeaponAttackTy if (tmp > 0 && roll < (sum += tmp)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT <%d, %d)", sum-tmp, sum); #endif if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_CRIT)) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: CRIT DISABLED)"); #endif else return MELEE_HIT_CRIT; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("RollMeleeOutcomeAgainst: NORMAL"); #endif return MELEE_HIT_NORMAL; @@ -2475,7 +2475,7 @@ void Unit::SendMeleeAttackStart(Unit* victim, Player* sendTo) sendTo->SendDirectMessage(&data); else SendMessageToSet(&data, true); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART"); #endif } @@ -2491,18 +2491,19 @@ void Unit::SendMeleeAttackStop(Unit* victim) data.append(victim ? victim->GetPackGUID() : 0); data << uint32(0); //! Can also take the value 0x01, which seems related to updating rotation SendMessageToSet(&data, true); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP"); #endif /*if (victim) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow()); #endif else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow());*/ +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDetail("%s %u stopped attacking", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow()); #endif +*/ } bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType) @@ -2661,7 +2662,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spell) case MELEE_HIT_BLOCK: canBlock = false; break; case MELEE_HIT_PARRY: canParry = false; break; default: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Spell %u SPELL_AURA_IGNORE_COMBAT_RESULT has unhandled state %d", (*i)->GetId(), (*i)->GetMiscValue()); #endif break; @@ -3945,7 +3946,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo aurApp->SetRemoveMode(removeMode); Aura* aura = aurApp->GetBase(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u now is remove mode %d", aura->GetId(), removeMode); #endif @@ -4782,7 +4783,7 @@ void Unit::DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime) // update for out of range group members (on 1 slot use) aura->SetNeedClientUpdateForTargets(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u partially interrupted on unit %u, new duration: %u ms", aura->GetId(), GetGUIDLow(), aura->GetDuration()); #endif } @@ -5692,7 +5693,7 @@ void Unit::SendSpellDamageImmune(Unit* target, uint32 spellId) void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); #endif @@ -9738,7 +9739,7 @@ Unit* Unit::GetCharm() const void Unit::SetMinion(Minion *minion, bool apply) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "SetMinion %u for %u, apply %u", minion->GetEntry(), GetEntry(), apply); #endif @@ -15080,7 +15081,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u // "handled" is needed as long as proc can be handled in multiple places if (!handled && HandleAuraProc(target, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); #endif takeCharges = true; @@ -15106,7 +15107,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u { case SPELL_AURA_PROC_TRIGGER_SPELL: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif // Don`t drop charge or add cooldown for not started trigger @@ -15127,7 +15128,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_MANA_SHIELD: case SPELL_AURA_DUMMY: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif if (HandleDummyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) @@ -15143,7 +15144,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u break; case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif if (HandleOverrideClassScriptAuraProc(target, damage, triggeredByAura, procSpell, cooldown)) @@ -15152,7 +15153,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif @@ -15165,7 +15166,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } case SPELL_AURA_RAID_PROC_FROM_CHARGE: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif @@ -15175,7 +15176,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u } case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); #endif @@ -16151,7 +16152,7 @@ bool Unit::HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura) // Currently only Prayer of Mending if (!(spellProto->SpellFamilyName == SPELLFAMILY_PRIEST && spellProto->SpellFamilyFlags[1] & 0x20)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Unit::HandleAuraRaidProcFromChargeWithValue, received not handled spell: %u", spellProto->Id); #endif return false; @@ -16457,7 +16458,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp if (!spiritOfRedemption) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("SET JUST_DIED"); #endif victim->setDeathState(JUST_DIED); @@ -16484,7 +16485,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp // only if not player and not controlled by player pet. And not at BG if ((durabilityLoss && !player && !plrVictim->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); #endif plrVictim->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); @@ -16506,7 +16507,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp } else // creature died { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("DealDamageNotPlayer"); #endif @@ -16909,7 +16910,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au throw 1; ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type)); #endif @@ -18119,7 +18120,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a { if (seatId >= 0 && seatId != GetTransSeat()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u leave vehicle %u seat %d and enter %d.", GetEntry(), m_vehicle->GetBase()->GetEntry(), GetTransSeat(), seatId); #endif ChangeSeat(seatId); @@ -18129,7 +18130,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "EnterVehicle: %u exit %u and enter %u.", GetEntry(), m_vehicle->GetBase()->GetEntry(), vehicle->GetBase()->GetEntry()); #endif ExitVehicle(); @@ -18501,7 +18502,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) { uint32 count = getThreatManager().getThreatList().size(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message"); #endif WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8); @@ -18520,7 +18521,7 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) void Unit::SendClearThreatListOpcode() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_CLEAR Message"); #endif WorldPacket data(SMSG_THREAT_CLEAR, 8); @@ -18530,7 +18531,7 @@ void Unit::SendClearThreatListOpcode() void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_REMOVE Message"); #endif WorldPacket data(SMSG_THREAT_REMOVE, 8 + 8); diff --git a/src/game/Entities/Vehicle/Vehicle.cpp b/src/game/Entities/Vehicle/Vehicle.cpp index b1975b91a..ef16117b2 100644 --- a/src/game/Entities/Vehicle/Vehicle.cpp +++ b/src/game/Entities/Vehicle/Vehicle.cpp @@ -100,7 +100,7 @@ void Vehicle::Uninstall() return; } _status = STATUS_UNINSTALLING; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Uninstall Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); #endif RemoveAllPassengers(); @@ -111,7 +111,7 @@ void Vehicle::Uninstall() void Vehicle::Reset(bool evading /*= false*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Reset Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); #endif if (_me->GetTypeId() == TYPEID_PLAYER) @@ -197,7 +197,7 @@ void Vehicle::ApplyAllImmunities() void Vehicle::RemoveAllPassengers() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::RemoveAllPassengers. Entry: %u, GuidLow: %u", _creatureEntry, _me->GetGUIDLow()); #endif @@ -268,7 +268,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion, uint8 typ return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle: Installing accessory entry %u on vehicle entry %u (seat:%i)", entry, GetCreatureEntry(), seatId); #endif if (Unit* passenger = GetPassenger(seatId)) @@ -309,7 +309,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) /// @Prevent adding passengers when vehicle is uninstalling. (Bad script in OnUninstall/OnRemovePassenger/PassengerBoarded hook.) if (_status == STATUS_UNINSTALLING) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Passenger GuidLow: %u, Entry: %u, attempting to board vehicle GuidLow: %u, Entry: %u during uninstall! SeatId: %i", unit->GetGUIDLow(), unit->GetEntry(), _me->GetGUIDLow(), _me->GetEntry(), (int32)seatId); return false; #endif @@ -345,7 +345,7 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId) ASSERT(seat->second.IsEmpty()); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUIDLow(), (int32)seat->first); #endif @@ -456,7 +456,7 @@ void Vehicle::RemovePassenger(Unit* unit) if (seat == Seats.end()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName().c_str(), _me->GetEntry(), _vehicleInfo->m_ID, _me->GetGUIDLow(), (int32)seat->first); #endif @@ -518,7 +518,7 @@ void Vehicle::Dismiss() if (GetBase()->GetTypeId() != TYPEID_UNIT) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_VEHICLES, "Vehicle::Dismiss Entry: %u, GuidLow %u", _creatureEntry, _me->GetGUIDLow()); #endif Uninstall(); diff --git a/src/game/Events/GameEventMgr.cpp b/src/game/Events/GameEventMgr.cpp index aef25c391..5092fa32c 100644 --- a/src/game/Events/GameEventMgr.cpp +++ b/src/game/Events/GameEventMgr.cpp @@ -1096,7 +1096,7 @@ uint32 GameEventMgr::Update() // return the next e nextEventDelay = 0; for (std::set::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr) StopEvent(*itr); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Next game event check in %u seconds.", nextEventDelay + 1); #endif return (nextEventDelay + 1) * IN_MILLISECONDS; // Add 1 second to be sure event has started/stopped at next call @@ -1104,7 +1104,7 @@ uint32 GameEventMgr::Update() // return the next e void GameEventMgr::UnApplyEvent(uint16 event_id) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("GameEvent %u \"%s\" removed.", event_id, mGameEvent[event_id].description.c_str()); #endif //! Run SAI scripts with SMART_EVENT_GAME_EVENT_END @@ -1140,7 +1140,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id) break; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("GameEvent %u \"%s\" started.", event_id, mGameEvent[event_id].description.c_str()); #endif diff --git a/src/game/Globals/ObjectAccessor.cpp b/src/game/Globals/ObjectAccessor.cpp index 1199c6b32..904448bc6 100644 --- a/src/game/Globals/ObjectAccessor.cpp +++ b/src/game/Globals/ObjectAccessor.cpp @@ -313,7 +313,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia return NULL; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Deleting Corpse and spawned bones."); #endif diff --git a/src/game/Globals/ObjectMgr.cpp b/src/game/Globals/ObjectMgr.cpp index c044413d4..f0e0b4a6c 100644 --- a/src/game/Globals/ObjectMgr.cpp +++ b/src/game/Globals/ObjectMgr.cpp @@ -1865,7 +1865,7 @@ uint32 ObjectMgr::AddGOData(uint32 entry, uint32 mapId, float x, float y, float } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "AddGOData: dbguid %u entry %u map %u x %f y %f z %f o %f", guid, entry, mapId, x, y, z, o); #endif @@ -3110,7 +3110,7 @@ void ObjectMgr::LoadPetLevelInfo() sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level); #endif ++count; // make result loading percent "expected" correct in case disabled detail mode for example. @@ -3613,7 +3613,7 @@ void ObjectMgr::LoadPlayerInfo() sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level); #endif ++count; // make result loading percent "expected" correct in case disabled detail mode for example. @@ -3717,7 +3717,7 @@ void ObjectMgr::LoadPlayerInfo() sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level); #endif ++count; // make result loading percent "expected" correct in case disabled detail mode for example. diff --git a/src/game/Grids/ObjectGridLoader.cpp b/src/game/Grids/ObjectGridLoader.cpp index 0670203e8..ca9748a84 100644 --- a/src/game/Grids/ObjectGridLoader.cpp +++ b/src/game/Grids/ObjectGridLoader.cpp @@ -204,7 +204,7 @@ void ObjectGridLoader::LoadN(void) } } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses, i_grid.GetGridId(), i_map->GetId()); #endif } diff --git a/src/game/Groups/Group.cpp b/src/game/Groups/Group.cpp index 32ca11095..1f1a16edd 100644 --- a/src/game/Groups/Group.cpp +++ b/src/game/Groups/Group.cpp @@ -65,7 +65,7 @@ Group::~Group() { if (m_bgGroup) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Group::~Group: battleground group being deleted."); #endif if (m_bgGroup->GetBgRaid(TEAM_ALLIANCE) == this) m_bgGroup->SetBgRaid(TEAM_ALLIANCE, NULL); @@ -1217,7 +1217,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Group::MasterLoot (SMSG_LOOT_MASTER_LIST, 330)"); #endif @@ -2013,7 +2013,7 @@ void Group::BroadcastGroupUpdate(void) { pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2); pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("-- Forced group value update for '%s'", pp->GetName().c_str()); #endif } diff --git a/src/game/Guilds/Guild.cpp b/src/game/Guilds/Guild.cpp index bbbb78ed9..9c3a093e2 100644 --- a/src/game/Guilds/Guild.cpp +++ b/src/game/Guilds/Guild.cpp @@ -92,9 +92,10 @@ void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, Guil data << uint32(errCode); session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_COMMAND_RESULT [%s]: Type: %u, code: %u, param: %s", session->GetPlayerInfo().c_str(), type, errCode, param.c_str()); -#endif} +#endif +} void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode) { @@ -102,7 +103,7 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode data << uint32(errCode); session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s] Code: %u", session->GetPlayerInfo().c_str(), errCode); #endif } @@ -563,14 +564,15 @@ void Guild::BankTab::SendText(Guild const* guild, WorldSession* session) const if (session) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: Tabid: %u, Text: %s" , session->GetPlayerInfo().c_str(), m_tabId, m_text.c_str()); -#endif session->SendPacket(&data); +#endif + session->SendPacket(&data); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [Broadcast]: Tabid: %u, Text: %s", m_tabId, m_text.c_str()); #endif guild->BroadcastPacket(&data); @@ -958,10 +960,11 @@ Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem) ItemPosCount pos(*itr); ++itr; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: StoreItem tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); -#endif pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); +#endif + pLastItem = _StoreItem(trans, pTab, pItem, pos, itr != m_vec.end()); } return pLastItem; } @@ -1062,7 +1065,7 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, b InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "GUILD STORAGE: CanStore() tab = %u, slot = %u, item = %u, count = %u", m_container, m_slotId, pItem->GetEntry(), pItem->GetCount()); #endif @@ -1161,7 +1164,7 @@ bool Guild::Create(Player* pLeader, std::string const& name) m_createdDate = ::time(NULL); _CreateLogHolders(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "GUILD: creating guild [%s] for leader %s (%u)", name.c_str(), pLeader->GetName().c_str(), GUID_LOPART(m_leaderGuid)); #endif @@ -1294,7 +1297,7 @@ void Guild::HandleRoster(WorldSession* session) itr->second->WritePacket(data, _HasRankRight(session->GetPlayer(), GR_RIGHT_VIEWOFFNOTE)); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_ROSTER [%s]", session->GetPlayerInfo().c_str()); #endif session->SendPacket(&data); @@ -1319,7 +1322,7 @@ void Guild::HandleQuery(WorldSession* session) data << uint32(_GetRanksSize()); // Number of ranks used session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_QUERY_RESPONSE [%s]", session->GetPlayerInfo().c_str()); #endif } @@ -1445,7 +1448,7 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string c SendCommandResult(session, GUILD_COMMAND_CHANGE_RANK, ERR_GUILD_PERMISSIONS); else if (RankInfo* rankInfo = GetRankInfo(rankId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "Changed RankName to '%s', rights to 0x%08X", name.c_str(), rights); #endif @@ -1533,7 +1536,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name) SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_COMMAND_SUCCESS, name); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "Player %s invited %s to join his Guild", player->GetName().c_str(), name.c_str()); #endif @@ -1544,7 +1547,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name) data << player->GetName(); data << m_name; pInvitee->GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_INVITE [%s]", pInvitee->GetName().c_str()); #endif } @@ -1805,7 +1808,7 @@ void Guild::HandleDisband(WorldSession* session) if (_IsLeader(session->GetPlayer())) { Disband(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "Guild Successfully Disbanded"); #endif delete this; @@ -1822,7 +1825,7 @@ void Guild::SendInfo(WorldSession* session) const data << m_accountsNumber; // Number of accounts session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_INFO [%s]", session->GetPlayerInfo().c_str()); #endif } @@ -1832,7 +1835,7 @@ void Guild::SendEventLog(WorldSession* session) const WorldPacket data(MSG_GUILD_EVENT_LOG_QUERY, 1 + m_eventLog->GetSize() * (1 + 8 + 4)); m_eventLog->WritePacket(data); session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", session->GetPlayerInfo().c_str()); #endif } @@ -1847,7 +1850,7 @@ void Guild::SendBankLog(WorldSession* session, uint8 tabId) const data << uint8(tabId); pLog->WritePacket(data); session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]", session->GetPlayerInfo().c_str()); #endif } @@ -1890,7 +1893,7 @@ void Guild::SendPermissions(WorldSession* session) const } session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s] Rank: %u", session->GetPlayerInfo().c_str(), rankId); #endif } @@ -1905,7 +1908,7 @@ void Guild::SendMoneyInfo(WorldSession* session) const WorldPacket data(MSG_GUILD_BANK_MONEY_WITHDRAWN, 4); data << int32(amount); session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s] Money: %u", session->GetPlayerInfo().c_str(), amount); #endif } @@ -1918,7 +1921,7 @@ void Guild::SendLoginInfo(WorldSession* session) data << m_motd; session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [%s] MOTD", session->GetPlayerInfo().c_str()); #endif @@ -2857,7 +2860,7 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* par data << uint64(guid); BroadcastPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_EVENT [Broadcast] Event: %u", guildEvent); #endif } @@ -2899,10 +2902,11 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/ numSlots = _GetMemberRemainingSlots(member, tabId); data.put(rempos, numSlots); session->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %d", session->GetPlayerInfo().c_str(), tabId, sendAllSlots, numSlots); -#endif } +#endif + } else // TODO - Probably this is just sent to session + those that have sent CMSG_GUILD_BANKER_ACTIVATE { for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr) @@ -2916,10 +2920,11 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/ uint32 numSlots = _GetMemberRemainingSlots(itr->second, tabId); data.put(rempos, numSlots); player->GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "SMSG_GUILD_BANK_LIST [%s]: TabId: %u, FullSlots: %u, slots: %u" , player->GetName().c_str(), tabId, sendAllSlots, numSlots); -#endif } +#endif + } } } diff --git a/src/game/Handlers/AddonHandler.cpp b/src/game/Handlers/AddonHandler.cpp index 1f60031e7..452609d1b 100644 --- a/src/game/Handlers/AddonHandler.cpp +++ b/src/game/Handlers/AddonHandler.cpp @@ -66,7 +66,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target) AddOnPacked >> enabled >> crc >> unk2; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk2); #endif @@ -122,7 +122,7 @@ bool AddonHandler::BuildAddonPacket(WorldPacket* Source, WorldPacket* Target) *Target << uint32(count); //if (AddOnPacked.rpos() != AddOnPacked.size()) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under read!"); #endif } diff --git a/src/game/Handlers/ArenaTeamHandler.cpp b/src/game/Handlers/ArenaTeamHandler.cpp index 3172fded1..1095ff194 100644 --- a/src/game/Handlers/ArenaTeamHandler.cpp +++ b/src/game/Handlers/ArenaTeamHandler.cpp @@ -19,13 +19,13 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_ARENA_TEAMS"); #endif uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); #endif @@ -44,7 +44,7 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_QUERY"); #endif @@ -60,7 +60,7 @@ void WorldSession::HandleArenaTeamQueryOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ARENA_TEAM_ROSTER"); #endif @@ -73,7 +73,7 @@ void WorldSession::HandleArenaTeamRosterOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_INVITE"); #endif @@ -145,7 +145,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Player %s Invited %s to Join his ArenaTeam", GetPlayer()->GetName().c_str(), invitedName.c_str()); #endif @@ -156,14 +156,14 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket & recvData) data << arenaTeam->GetName(); player->GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ARENA_TEAM_INVITE"); #endif } void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_ACCEPT"); // empty opcode #endif @@ -198,7 +198,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DECLINE"); // empty opcode #endif @@ -208,7 +208,7 @@ void WorldSession::HandleArenaTeamDeclineOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEAVE"); #endif @@ -252,7 +252,7 @@ void WorldSession::HandleArenaTeamLeaveOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_DISBAND"); #endif @@ -276,7 +276,7 @@ void WorldSession::HandleArenaTeamDisbandOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_REMOVE"); #endif @@ -328,7 +328,7 @@ void WorldSession::HandleArenaTeamRemoveOpcode(WorldPacket & recvData) void WorldSession::HandleArenaTeamLeaderOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ARENA_TEAM_LEADER"); #endif diff --git a/src/game/Handlers/AuctionHouseHandler.cpp b/src/game/Handlers/AuctionHouseHandler.cpp index c85c74209..d3d6a7446 100644 --- a/src/game/Handlers/AuctionHouseHandler.cpp +++ b/src/game/Handlers/AuctionHouseHandler.cpp @@ -29,7 +29,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -143,7 +143,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) if (bid > MAX_MONEY_AMOUNT || buyout > MAX_MONEY_AMOUNT) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Player %s (GUID %u) attempted to sell item with higher price than max gold amount.", _player->GetName().c_str(), _player->GetGUIDLow()); #endif SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); @@ -153,7 +153,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(auctioneer)); #endif return; @@ -162,7 +162,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AuctionHouseEntry const* auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(creature->getFaction()); if (!auctionHouseEntry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", GUID_LOPART(auctioneer)); #endif return; @@ -282,7 +282,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetGUIDLow(), AH->auctioneer, item->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); #endif sAuctionMgr->AddAItem(item); @@ -324,7 +324,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) AH->deposit = deposit; AH->auctionHouseEntry = auctionHouseEntry; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("CMSG_AUCTION_SELL_ITEM: Player %s (guid %d) is selling item %s entry %u (guid %d) to auctioneer %u with count %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", _player->GetName().c_str(), _player->GetGUIDLow(), newItem->GetTemplate()->Name1.c_str(), newItem->GetEntry(), newItem->GetGUIDLow(), AH->auctioneer, newItem->GetCount(), bid, buyout, auctionTime, AH->GetHouseId()); #endif sAuctionMgr->AddAItem(newItem); @@ -375,7 +375,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recvData) //this function is called when client bids or buys out auction void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_PLACE_BID"); #endif @@ -391,7 +391,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); #endif return; @@ -505,7 +505,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recvData) //this void is called when auction_owner cancels his auction void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_REMOVE_ITEM"); #endif @@ -518,7 +518,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); #endif return; @@ -586,7 +586,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recvData) //called when player lists his bids void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_BIDDER_ITEMS"); #endif @@ -606,7 +606,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif recvData.rfinish(); @@ -662,7 +662,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recvData) void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_OWNER_ITEMS"); #endif @@ -677,7 +677,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -705,7 +705,7 @@ void WorldSession::HandleAuctionListOwnerItemsEvent(WorldPacket & recvData) //this void is called when player clicks on search button void WorldSession::HandleAuctionListItems(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_ITEMS"); #endif @@ -752,7 +752,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recvData) void WorldSession::HandleAuctionListPendingSales(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_AUCTION_LIST_PENDING_SALES"); #endif diff --git a/src/game/Handlers/BattleGroundHandler.cpp b/src/game/Handlers/BattleGroundHandler.cpp index 112b07354..c1b10240c 100644 --- a/src/game/Handlers/BattleGroundHandler.cpp +++ b/src/game/Handlers/BattleGroundHandler.cpp @@ -28,7 +28,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recvData) { uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); #endif @@ -258,7 +258,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recvData) void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_BATTLEGROUND_PLAYER_POSITIONS Message"); #endif @@ -311,7 +311,7 @@ void WorldSession::HandleBattlegroundPlayerPositionsOpcode(WorldPacket& /*recvDa void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd MSG_PVP_LOG_DATA Message"); #endif @@ -327,14 +327,14 @@ void WorldSession::HandlePVPLogDataOpcode(WorldPacket & /*recvData*/) sBattlegroundMgr->BuildPvpLogDataPacket(&data, bg); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent MSG_PVP_LOG_DATA Message"); #endif } void WorldSession::HandleBattlefieldListOpcode(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEFIELD_LIST Message"); #endif @@ -479,7 +479,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recvData) void WorldSession::HandleBattlefieldLeaveOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LEAVE_BATTLEFIELD Message"); #endif @@ -784,13 +784,13 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recvData) if (!reportedPlayer) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: player not found"); #endif return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName().c_str(), reportedPlayer->GetName().c_str()); #endif diff --git a/src/game/Handlers/ChannelHandler.cpp b/src/game/Handlers/ChannelHandler.cpp index 36a252dd7..9b0cddccf 100644 --- a/src/game/Handlers/ChannelHandler.cpp +++ b/src/game/Handlers/ChannelHandler.cpp @@ -18,7 +18,7 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) recvPacket >> channelId >> unknown1 >> unknown2 >> channelName >> password; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", GetPlayerInfo().c_str(), channelId, unknown1, unknown2, channelName.c_str(), password.c_str()); #endif if (channelId) @@ -56,7 +56,7 @@ void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) std::string channelName; recvPacket >> unk >> channelName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_LEAVE_CHANNEL %s Channel: %s, unk1: %u", GetPlayerInfo().c_str(), channelName.c_str(), unk); #endif @@ -75,7 +75,7 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) std::string channelName; recvPacket >> channelName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "%s %s Channel: %s", recvPacket.GetOpcode() == CMSG_CHANNEL_DISPLAY_LIST ? "CMSG_CHANNEL_DISPLAY_LIST" : "CMSG_CHANNEL_LIST", GetPlayerInfo().c_str(), channelName.c_str()); @@ -90,7 +90,7 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) std::string channelName, password; recvPacket >> channelName >> password; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_PASSWORD %s Channel: %s, Password: %s", GetPlayerInfo().c_str(), channelName.c_str(), password.c_str()); #endif @@ -107,9 +107,9 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_SET_OWNER %s Channel: %s, Target: %s", - // GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); + GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif if (!normalizePlayerName(targetName)) return; @@ -124,7 +124,7 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) std::string channelName; recvPacket >> channelName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_OWNER %s Channel: %s", GetPlayerInfo().c_str(), channelName.c_str()); #endif @@ -138,7 +138,7 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MODERATOR %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -155,7 +155,7 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMODERATOR %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -172,7 +172,7 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_MUTE %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -189,7 +189,7 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNMUTE %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -206,7 +206,7 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_INVITE %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -223,7 +223,7 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_KICK %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -240,7 +240,7 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_BAN %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -257,7 +257,7 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) std::string channelName, targetName; recvPacket >> channelName >> targetName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_UNBAN %s Channel: %s, Target: %s", GetPlayerInfo().c_str(), channelName.c_str(), targetName.c_str()); #endif @@ -274,7 +274,7 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) std::string channelName; recvPacket >> channelName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s", GetPlayerInfo().c_str(), channelName.c_str()); #endif @@ -294,7 +294,7 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) std::string channelName; recvPacket >> channelName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_CHATSYS, "CMSG_GET_CHANNEL_MEMBER_COUNT %s Channel: %s", GetPlayerInfo().c_str(), channelName.c_str()); #endif diff --git a/src/game/Handlers/CharacterHandler.cpp b/src/game/Handlers/CharacterHandler.cpp index f5a1237dc..fb84c48af 100644 --- a/src/game/Handlers/CharacterHandler.cpp +++ b/src/game/Handlers/CharacterHandler.cpp @@ -204,7 +204,7 @@ void WorldSession::HandleCharEnum(PreparedQueryResult result) do { uint32 guidlow = (*result)[0].GetUInt32(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Loading char guid %u from account %u.", guidlow, GetAccountId()); #endif if (Player::BuildEnumData(result, &data)) @@ -595,7 +595,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte { uint8 unk; createInfo->Data >> unk; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Character creation %s (account %u) has unhandled tail data: [%u]", createInfo->Name.c_str(), GetAccountId(), unk); #endif } @@ -655,7 +655,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte SendPacket(&data); std::string IP_str = GetRemoteAddress(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); #endif sLog->outChar("Account: %d (IP: %s) Create Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), createInfo->Name.c_str(), newChar.GetGUIDLow()); @@ -716,7 +716,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData) return; std::string IP_str = GetRemoteAddress(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); #endif sLog->outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); @@ -924,7 +924,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder) data.put(0, linecount); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); #endif @@ -932,7 +932,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder* holder) if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Sent server info"); #endif } @@ -1226,7 +1226,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar) data.put(0, linecount); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Sent motd (SMSG_MOTD)"); #endif @@ -1234,7 +1234,7 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar) if (sWorld->getIntConfig(CONFIG_ENABLE_SINFO_LOGIN) == 1) chH.PSendSysMessage(_FULLVERSION); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Sent server info"); #endif } @@ -1335,7 +1335,7 @@ void WorldSession::HandlePlayerLoginToCharOutOfWorld(Player* pCurrChar) void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_ATWAR"); #endif @@ -1385,7 +1385,7 @@ void WorldSession::HandleTutorialReset(WorldPacket & /*recvData*/) void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Received CMSG_SET_WATCHED_FACTION"); #endif uint32 fact; @@ -1395,7 +1395,7 @@ void WorldSession::HandleSetWatchedFactionOpcode(WorldPacket& recvData) void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WORLD: Received CMSG_SET_FACTION_INACTIVE"); #endif uint32 replistid; @@ -1407,7 +1407,7 @@ void WorldSession::HandleSetFactionInactiveOpcode(WorldPacket & recvData) void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("CMSG_SHOWING_HELM for %s", _player->GetName().c_str()); #endif recvData.read_skip(); // unknown, bool? @@ -1416,7 +1416,7 @@ void WorldSession::HandleShowingHelmOpcode(WorldPacket& recvData) void WorldSession::HandleShowingCloakOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("CMSG_SHOWING_CLOAK for %s", _player->GetName().c_str()); #endif recvData.read_skip(); // unknown, bool? @@ -1636,7 +1636,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recvData) void WorldSession::HandleAlterAppearance(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ALTER_APPEARANCE"); #endif @@ -1715,7 +1715,7 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData) if (slot >= MAX_GLYPH_SLOT_INDEX) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); #endif return; @@ -1877,7 +1877,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recvData) void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_SAVE"); #endif @@ -1938,7 +1938,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recvData) void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_DELETE"); #endif @@ -1950,7 +1950,7 @@ void WorldSession::HandleEquipmentSetDelete(WorldPacket &recvData) void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_EQUIPMENT_SET_USE"); #endif @@ -1962,7 +1962,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recvData) uint8 srcbag, srcslot; recvData >> srcbag >> srcslot; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item " UI64FMTD ": srcbag %u, srcslot %u", itemGuid, srcbag, srcslot); #endif diff --git a/src/game/Handlers/ChatHandler.cpp b/src/game/Handlers/ChatHandler.cpp index 2a02158b8..c0f9c2659 100644 --- a/src/game/Handlers/ChatHandler.cpp +++ b/src/game/Handlers/ChatHandler.cpp @@ -699,7 +699,7 @@ void WorldSession::HandleChatIgnoredOpcode(WorldPacket& recvData) void WorldSession::HandleChannelDeclineInvite(WorldPacket &recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Opcode %u", recvPacket.GetOpcode()); #endif } diff --git a/src/game/Handlers/CombatHandler.cpp b/src/game/Handlers/CombatHandler.cpp index a6d68d189..c59d10bdb 100644 --- a/src/game/Handlers/CombatHandler.cpp +++ b/src/game/Handlers/CombatHandler.cpp @@ -21,7 +21,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket& recvData) uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_ATTACKSWING Message guidlow:%u guidhigh:%u", GUID_LOPART(guid), GUID_HIPART(guid)); #endif diff --git a/src/game/Handlers/DuelHandler.cpp b/src/game/Handlers/DuelHandler.cpp index 01287009e..4dbdf494b 100644 --- a/src/game/Handlers/DuelHandler.cpp +++ b/src/game/Handlers/DuelHandler.cpp @@ -30,10 +30,10 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) return; //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_ACCEPTED"); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player 1 is: %u (%s)", player->GetGUIDLow(), player->GetName().c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName().c_str()); #endif @@ -47,7 +47,7 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) void WorldSession::HandleDuelCancelledOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DUEL_CANCELLED"); #endif uint64 guid; diff --git a/src/game/Handlers/GroupHandler.cpp b/src/game/Handlers/GroupHandler.cpp index 3d2d52ee6..99bbfef0c 100644 --- a/src/game/Handlers/GroupHandler.cpp +++ b/src/game/Handlers/GroupHandler.cpp @@ -47,7 +47,7 @@ void WorldSession::SendPartyResult(PartyOperation operation, const std::string& void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_INVITE"); #endif @@ -198,7 +198,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData) void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ACCEPT"); #endif @@ -258,7 +258,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket& recvData) void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE"); #endif @@ -283,7 +283,7 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE_GUID"); #endif @@ -343,7 +343,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket& recvData) void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_UNINVITE"); #endif @@ -389,7 +389,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket& recvData) void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_SET_LEADER"); #endif @@ -412,7 +412,7 @@ void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket& recvData) void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DISBAND"); #endif @@ -437,7 +437,7 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleLootMethodOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_LOOT_METHOD"); #endif @@ -500,7 +500,7 @@ void WorldSession::HandleLootRoll(WorldPacket& recvData) void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_MINIMAP_PING"); #endif @@ -526,7 +526,7 @@ void WorldSession::HandleMinimapPingOpcode(WorldPacket& recvData) void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RANDOM_ROLL"); #endif @@ -557,7 +557,7 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recvData) void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_TARGET_UPDATE"); #endif @@ -598,7 +598,7 @@ void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recvData) void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_RAID_CONVERT"); #endif @@ -621,7 +621,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_CHANGE_SUB_GROUP"); #endif @@ -662,7 +662,7 @@ void WorldSession::HandleGroupChangeSubGroupOpcode(WorldPacket& recvData) void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_ASSISTANT_LEADER"); #endif @@ -685,7 +685,7 @@ void WorldSession::HandleGroupAssistantLeaderOpcode(WorldPacket& recvData) void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_PARTY_ASSIGNMENT"); #endif @@ -721,7 +721,7 @@ void WorldSession::HandlePartyAssignmentOpcode(WorldPacket& recvData) void WorldSession::HandleRaidReadyCheckOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_RAID_READY_CHECK"); #endif @@ -1097,14 +1097,14 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recvData) /*void WorldSession::HandleGroupCancelOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug("WORLD: got CMSG_GROUP_CANCEL."); #endif }*/ void WorldSession::HandleOptOutOfLootOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_OPT_OUT_OF_LOOT"); #endif diff --git a/src/game/Handlers/GuildHandler.cpp b/src/game/Handlers/GuildHandler.cpp index 0cbbc2929..c76126ff0 100644 --- a/src/game/Handlers/GuildHandler.cpp +++ b/src/game/Handlers/GuildHandler.cpp @@ -21,7 +21,7 @@ void WorldSession::HandleGuildQueryOpcode(WorldPacket& recvPacket) uint32 guildId; recvPacket >> guildId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_QUERY [%s]: Guild: %u", GetPlayerInfo().c_str(), guildId); #endif if (!guildId) @@ -44,7 +44,7 @@ void WorldSession::HandleGuildInviteOpcode(WorldPacket& recvPacket) std::string invitedName; recvPacket >> invitedName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INVITE [%s]: Invited: %s", GetPlayerInfo().c_str(), invitedName.c_str()); #endif if (normalizePlayerName(invitedName)) @@ -57,7 +57,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) std::string playerName; recvPacket >> playerName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_REMOVE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); #endif @@ -68,7 +68,7 @@ void WorldSession::HandleGuildRemoveOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ACCEPT [%s]", GetPlayer()->GetName().c_str()); #endif @@ -79,7 +79,7 @@ void WorldSession::HandleGuildAcceptOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DECLINE [%s]", GetPlayerInfo().c_str()); #endif @@ -89,7 +89,7 @@ void WorldSession::HandleGuildDeclineOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO [%s]", GetPlayerInfo().c_str()); #endif @@ -99,7 +99,7 @@ void WorldSession::HandleGuildInfoOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildRosterOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ROSTER [%s]", GetPlayerInfo().c_str()); #endif @@ -114,7 +114,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket) std::string playerName; recvPacket >> playerName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_PROMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); #endif @@ -128,7 +128,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) std::string playerName; recvPacket >> playerName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEMOTE [%s]: Target: %s", GetPlayerInfo().c_str(), playerName.c_str()); #endif @@ -139,7 +139,7 @@ void WorldSession::HandleGuildDemoteOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEAVE [%s]", GetPlayerInfo().c_str()); #endif @@ -149,7 +149,7 @@ void WorldSession::HandleGuildLeaveOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleGuildDisbandOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DISBAND [%s]", GetPlayerInfo().c_str()); #endif @@ -162,7 +162,7 @@ void WorldSession::HandleGuildLeaderOpcode(WorldPacket& recvPacket) std::string name; recvPacket >> name; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_LEADER [%s]: Target: %s", GetPlayerInfo().c_str(), name.c_str()); #endif @@ -176,7 +176,7 @@ void WorldSession::HandleGuildMOTDOpcode(WorldPacket& recvPacket) std::string motd; recvPacket >> motd; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_MOTD [%s]: MOTD: %s", GetPlayerInfo().c_str(), motd.c_str()); #endif @@ -190,7 +190,7 @@ void WorldSession::HandleGuildSetPublicNoteOpcode(WorldPacket& recvPacket) std::string note; recvPacket >> playerName >> note; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_PUBLIC_NOTE [%s]: Target: %s, Note: %s", GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); #endif if (normalizePlayerName(playerName)) @@ -204,7 +204,7 @@ void WorldSession::HandleGuildSetOfficerNoteOpcode(WorldPacket& recvPacket) std::string note; recvPacket >> playerName >> note; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_SET_OFFICER_NOTE [%s]: Target: %s, Note: %s", GetPlayerInfo().c_str(), playerName.c_str(), note.c_str()); #endif @@ -227,7 +227,7 @@ void WorldSession::HandleGuildRankOpcode(WorldPacket& recvPacket) uint32 money; recvPacket >> money; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_RANK [%s]: Rank: %s (%u)", GetPlayerInfo().c_str(), rankName.c_str(), rankId); #endif @@ -259,7 +259,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) std::string rankName; recvPacket >> rankName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_ADD_RANK [%s]: Rank: %s", GetPlayerInfo().c_str(), rankName.c_str()); #endif @@ -269,7 +269,7 @@ void WorldSession::HandleGuildAddRankOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildDelRankOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_DEL_RANK [%s]", GetPlayerInfo().c_str()); #endif @@ -282,7 +282,7 @@ void WorldSession::HandleGuildChangeInfoTextOpcode(WorldPacket& recvPacket) std::string info; recvPacket >> info; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_INFO_TEXT [%s]: %s", GetPlayerInfo().c_str(), info.c_str()); #endif @@ -298,7 +298,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) EmblemInfo emblemInfo; emblemInfo.ReadPacket(recvPacket); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_SAVE_GUILD_EMBLEM [%s]: Guid: [" UI64FMTD "] Style: %d, Color: %d, BorderStyle: %d, BorderColor: %d, BackgroundColor: %d" , GetPlayerInfo().c_str(), vendorGuid, emblemInfo.GetStyle() @@ -322,7 +322,7 @@ void WorldSession::HandleSaveGuildEmblemOpcode(WorldPacket& recvPacket) void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_EVENT_LOG_QUERY [%s]", GetPlayerInfo().c_str()); #endif @@ -332,7 +332,7 @@ void WorldSession::HandleGuildEventLogQueryOpcode(WorldPacket& /* recvPacket */) void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_MONEY_WITHDRAWN [%s]", GetPlayerInfo().c_str()); #endif @@ -342,7 +342,7 @@ void WorldSession::HandleGuildBankMoneyWithdrawn(WorldPacket & /* recvData */) void WorldSession::HandleGuildPermissions(WorldPacket& /* recvData */) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_PERMISSIONS [%s]", GetPlayerInfo().c_str()); #endif @@ -357,7 +357,7 @@ void WorldSession::HandleGuildBankerActivate(WorldPacket& recvData) bool sendAllSlots; recvData >> guid >> sendAllSlots; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANKER_ACTIVATE [%s]: Go: [" UI64FMTD "] AllSlots: %u" , GetPlayerInfo().c_str(), guid, sendAllSlots); #endif @@ -380,7 +380,7 @@ void WorldSession::HandleGuildBankQueryTab(WorldPacket& recvData) recvData >> guid >> tabId >> full; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_QUERY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, ShowTabs: %u" , GetPlayerInfo().c_str(), guid, tabId, full); #endif @@ -395,7 +395,7 @@ void WorldSession::HandleGuildBankDepositMoney(WorldPacket& recvData) uint32 money; recvData >> guid >> money; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_DEPOSIT_MONEY [%s]: Go: [" UI64FMTD "], money: %u", GetPlayerInfo().c_str(), guid, money); #endif @@ -411,7 +411,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) uint32 money; recvData >> guid >> money; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_WITHDRAW_MONEY [%s]: Go: [" UI64FMTD "], money: %u", GetPlayerInfo().c_str(), guid, money); #endif @@ -422,7 +422,7 @@ void WorldSession::HandleGuildBankWithdrawMoney(WorldPacket& recvData) void WorldSession::HandleGuildBankSwapItems(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_SWAP_ITEMS [%s]", GetPlayerInfo().c_str()); #endif @@ -510,7 +510,7 @@ void WorldSession::HandleGuildBankBuyTab(WorldPacket& recvData) recvData >> guid >> tabId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_BUY_TAB [%s]: Go: [" UI64FMTD "], TabId: %u", GetPlayerInfo().c_str(), guid, tabId); #endif @@ -528,7 +528,7 @@ void WorldSession::HandleGuildBankUpdateTab(WorldPacket& recvData) recvData >> guid >> tabId >> name >> icon; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_GUILD_BANK_UPDATE_TAB [%s]: Go: [" UI64FMTD "], TabId: %u, Name: %s, Icon: %s" , GetPlayerInfo().c_str(), guid, tabId, name.c_str(), icon.c_str()); #endif @@ -543,7 +543,7 @@ void WorldSession::HandleGuildBankLogQuery(WorldPacket& recvData) uint8 tabId; recvData >> tabId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_GUILD_BANK_LOG_QUERY [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); #endif @@ -556,7 +556,7 @@ void WorldSession::HandleQueryGuildBankTabText(WorldPacket &recvData) uint8 tabId; recvData >> tabId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "MSG_QUERY_GUILD_BANK_TEXT [%s]: TabId: %u", GetPlayerInfo().c_str(), tabId); #endif @@ -570,7 +570,7 @@ void WorldSession::HandleSetGuildBankTabText(WorldPacket &recvData) std::string text; recvData >> tabId >> text; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_GUILD, "CMSG_SET_GUILD_BANK_TEXT [%s]: TabId: %u, Text: %s", GetPlayerInfo().c_str(), tabId, text.c_str()); #endif diff --git a/src/game/Handlers/ItemHandler.cpp b/src/game/Handlers/ItemHandler.cpp index 1df88e43b..b4aa9ef81 100644 --- a/src/game/Handlers/ItemHandler.cpp +++ b/src/game/Handlers/ItemHandler.cpp @@ -428,7 +428,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recvData) uint32 item; recvData >> item; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("STORAGE: Item Query = %u", item); #endif @@ -576,7 +576,7 @@ void WorldSession::HandleItemQuerySingleOpcode(WorldPacket & recvData) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_QUERY_SINGLE - NO item INFO! (ENTRY: %u)", item); #endif WorldPacket queryData(SMSG_ITEM_QUERY_SINGLE_RESPONSE, 4); @@ -603,14 +603,14 @@ void WorldSession::HandleReadItem(WorldPacket & recvData) if (msg == EQUIP_ERR_OK) { data.Initialize (SMSG_READ_ITEM_OK, 8); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("STORAGE: Item page sent"); #endif } else { data.Initialize(SMSG_READ_ITEM_FAILED, 8); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("STORAGE: Unable to read item"); #endif _player->SendEquipError(msg, pItem, NULL); @@ -624,7 +624,7 @@ void WorldSession::HandleReadItem(WorldPacket & recvData) void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SELL_ITEM"); #endif uint64 vendorguid, itemguid; @@ -638,7 +638,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); #endif _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0); @@ -743,7 +743,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recvData) void WorldSession::HandleBuybackItem(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUYBACK_ITEM"); #endif uint64 vendorguid; @@ -754,7 +754,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); #endif _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); @@ -795,7 +795,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recvData) void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM_IN_SLOT"); #endif uint64 vendorguid, bagguid; @@ -839,7 +839,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recvData) void WorldSession::HandleBuyItemOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUY_ITEM"); #endif uint64 vendorguid; @@ -866,7 +866,7 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData) if (!GetPlayer()->IsAlive()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LIST_INVENTORY"); #endif @@ -875,14 +875,14 @@ void WorldSession::HandleListInventoryOpcode(WorldPacket & recvData) void WorldSession::SendListInventory(uint64 vendorGuid) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); #endif Creature* vendor = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR); if (!vendor) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorGuid))); #endif _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0); @@ -1027,7 +1027,7 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPacket & recvData) void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_BUY_BANK_SLOT"); #endif @@ -1045,7 +1045,7 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) // next slot ++slot; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PLAYER: Buy bank bag slot, slot number = %u", slot); #endif @@ -1080,13 +1080,13 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOBANK_ITEM"); #endif uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); #endif @@ -1122,13 +1122,13 @@ void WorldSession::HandleAutoBankItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleAutoStoreBankItemOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_BANK_ITEM"); #endif uint8 srcbag, srcslot; recvPacket >> srcbag >> srcslot; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE: receive srcbag = %u, srcslot = %u", srcbag, srcslot); #endif @@ -1180,7 +1180,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket & recvData) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_AMMO"); #endif uint32 item; @@ -1228,7 +1228,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recvData) recvData >> itemid; recvData.read_skip(); // guid -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_NAME_QUERY %u", itemid); #endif ItemSetNameEntry const* pName = sObjectMgr->GetItemSetNameEntry(itemid); @@ -1250,7 +1250,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket & recvData) void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WRAP_ITEM"); #endif @@ -1259,7 +1259,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) recvData >> gift_bag >> gift_slot; // paper recvData >> item_bag >> item_slot; // item -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WRAP: receive gift_bag = %u, gift_slot = %u, item_bag = %u, item_slot = %u", gift_bag, gift_slot, item_bag, item_slot); #endif @@ -1369,7 +1369,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) void WorldSession::HandleSocketOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SOCKET_GEMS"); #endif @@ -1569,7 +1569,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_TEMP_ENCHANTMENT"); #endif @@ -1595,7 +1595,7 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recvData) void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND_INFO"); #endif @@ -1605,7 +1605,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) Item* item = _player->GetItemByGuid(guid); if (!item) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); #endif return; @@ -1616,7 +1616,7 @@ void WorldSession::HandleItemRefundInfoRequest(WorldPacket& recvData) void WorldSession::HandleItemRefund(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ITEM_REFUND"); #endif uint64 guid; @@ -1625,7 +1625,7 @@ void WorldSession::HandleItemRefund(WorldPacket &recvData) Item* item = _player->GetItemByGuid(guid); if (!item) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Item refund: item not found!"); #endif return; @@ -1648,7 +1648,7 @@ void WorldSession::HandleItemTextQuery(WorldPacket & recvData ) uint64 itemGuid; recvData >> itemGuid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_ITEM_TEXT_QUERY item guid: %u", GUID_LOPART(itemGuid)); #endif diff --git a/src/game/Handlers/LFGHandler.cpp b/src/game/Handlers/LFGHandler.cpp index 114260223..0673e0b01 100644 --- a/src/game/Handlers/LFGHandler.cpp +++ b/src/game/Handlers/LFGHandler.cpp @@ -56,7 +56,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) recvData >> numDungeons; if (!numDungeons) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] no dungeons selected", GetPlayer()->GetGUID()); #endif recvData.rfinish(); @@ -77,7 +77,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recvData) std::string comment; recvData >> comment; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_JOIN [" UI64FMTD "] roles: %u, Dungeons: %u, Comment: %s", GetPlayer()->GetGUID(), roles, uint8(newDungeons.size()), comment.c_str()); #endif @@ -90,7 +90,7 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recvData*/) uint64 guid = GetPlayer()->GetGUID(); uint64 gguid = group ? group->GetGUID() : guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", guid, group ? 1 : 0); #endif @@ -109,7 +109,7 @@ void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recvData) recvData >> proposalID; recvData >> accept; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PROPOSAL_RESULT [" UI64FMTD "] proposal: %u accept: %u", GetPlayer()->GetGUID(), proposalID, accept ? 1 : 0); #endif sLFGMgr->UpdateProposal(proposalID, GetPlayer()->GetGUID(), accept); @@ -123,13 +123,13 @@ void WorldSession::HandleLfgSetRolesOpcode(WorldPacket& recvData) Group* group = GetPlayer()->GetGroup(); if (!group) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES [" UI64FMTD "] Not in group", guid); #endif return; } uint64 gguid = group->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_ROLES: Group [" UI64FMTD "], Player [" UI64FMTD "], Roles: %u", gguid, guid, roles); #endif sLFGMgr->UpdateRoleCheck(gguid, guid, roles); @@ -140,7 +140,7 @@ void WorldSession::HandleLfgSetCommentOpcode(WorldPacket& recvData) uint64 guid = GetPlayer()->GetGUID(); std::string comment; recvData >> comment; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_COMMENT [" UI64FMTD "] comment: %s", guid, comment.c_str()); #endif @@ -154,7 +154,7 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recvData) recvData >> agree; uint64 guid = GetPlayer()->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", guid, agree ? 1 : 0); #endif sLFGMgr->UpdateBoot(guid, agree); @@ -165,7 +165,7 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData) bool out; recvData >> out; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_TELEPORT [" UI64FMTD "] out: %u", GetPlayer()->GetGUID(), out ? 1 : 0); #endif sLFGMgr->TeleportPlayer(GetPlayer(), out, true); @@ -174,7 +174,7 @@ void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recvData) void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*/) { uint64 guid = GetPlayer()->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); #endif @@ -189,7 +189,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* uint32 rsize = uint32(randomDungeons.size()); uint32 lsize = uint32(lock.size()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PLAYER_INFO [" UI64FMTD "]", guid); #endif WorldPacket data(SMSG_LFG_PLAYER_INFO, 1 + rsize * (4 + 1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4) + 4 + lsize * (1 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4)); @@ -249,7 +249,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData* void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*/) { uint64 guid = GetPlayer()->GetGUID(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_PARTY_LOCK_INFO_REQUEST [" UI64FMTD "]", guid); #endif @@ -277,7 +277,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData* for (lfg::LfgLockPartyMap::const_iterator it = lockMap.begin(); it != lockMap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PARTY_INFO [" UI64FMTD "]", guid); #endif WorldPacket data(SMSG_LFG_PARTY_INFO, 1 + size); @@ -303,7 +303,7 @@ void WorldSession::HandleLfrSearchLeaveOpcode(WorldPacket& recvData) void WorldSession::HandleLfgGetStatus(WorldPacket& /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "CMSG_LFG_GET_STATUS %s", GetPlayerInfo().c_str()); #endif @@ -342,10 +342,11 @@ void WorldSession::SendLfgUpdatePlayer(lfg::LfgUpdateData const& updateData) break; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PLAYER %s updatetype: %u", GetPlayerInfo().c_str(), updateData.updateType); -#endif WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); +#endif + WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(size > 0); // Extra info if (size) @@ -384,10 +385,11 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData) break; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LFG, "SMSG_LFG_UPDATE_PARTY %s updatetype: %u", GetPlayerInfo().c_str(), updateData.updateType); -#endif WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); +#endif + WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (size > 0 ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type data << uint8(size > 0); // Extra info if (size) @@ -409,7 +411,7 @@ void WorldSession::SendLfgUpdateParty(lfg::LfgUpdateData const& updateData) void WorldSession::SendLfgRoleChosen(uint64 guid, uint8 roles) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHOSEN [" UI64FMTD "] guid: [" UI64FMTD "] roles: %u", GetPlayer()->GetGUID(), guid, roles); #endif @@ -428,7 +430,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck) else dungeons = roleCheck.dungeons; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_ROLE_CHECK_UPDATE [" UI64FMTD "]", GetPlayer()->GetGUID()); #endif WorldPacket data(SMSG_LFG_ROLE_CHECK_UPDATE, 4 + 1 + 1 + dungeons.size() * 4 + 1 + roleCheck.roles.size() * (8 + 1 + 4 + 1)); @@ -475,7 +477,7 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData) for (lfg::LfgLockPartyMap::const_iterator it = joinData.lockmap.begin(); it != joinData.lockmap.end(); ++it) size += 8 + 4 + uint32(it->second.size()) * (4 + 4); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_JOIN_RESULT [" UI64FMTD "] checkResult: %u checkValue: %u", GetPlayer()->GetGUID(), joinData.result, joinData.state); #endif WorldPacket data(SMSG_LFG_JOIN_RESULT, 4 + 4 + size); @@ -488,7 +490,7 @@ void WorldSession::SendLfgJoinResult(lfg::LfgJoinResultData const& joinData) void WorldSession::SendLfgQueueStatus(lfg::LfgQueueStatusData const& queueData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_QUEUE_STATUS [" UI64FMTD "] dungeon: %u - waitTime: %d - avgWaitTime: %d - waitTimeTanks: %d - waitTimeHealer: %d - waitTimeDps: %d - queuedTime: %u - tanks: %u - healers: %u - dps: %u", GetPlayer()->GetGUID(), queueData.dungeonId, queueData.waitTime, queueData.waitTimeAvg, queueData.waitTimeTank, queueData.waitTimeHealer, queueData.waitTimeDps, queueData.queuedTime, queueData.tanks, queueData.healers, queueData.dps); #endif @@ -556,10 +558,11 @@ void WorldSession::SendLfgBootProposalUpdate(lfg::LfgPlayerBoot const& boot) ++agreeNum; } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", guid, uint8(boot.inProgress), uint8(playerVote != lfg::LFG_ANSWER_PENDING), uint8(playerVote == lfg::LFG_ANSWER_AGREE), boot.victim, votesNum, agreeNum, secsleft, lfg::LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str()); -#endif WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length()); +#endif + WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length()); data << uint8(boot.inProgress); // Vote in progress data << uint8(playerVote != lfg::LFG_ANSWER_PENDING); // Did Vote data << uint8(playerVote == lfg::LFG_ANSWER_AGREE); // Agree @@ -579,7 +582,7 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal) bool silent = !proposal.isNew && gguid == proposal.group; uint32 dungeonEntry = proposal.dungeonId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", guid, proposal.state); #endif @@ -624,7 +627,7 @@ void WorldSession::SendLfgUpdateProposal(lfg::LfgProposal const& proposal) void WorldSession::SendLfgLfrList(bool update) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_LFR_LIST [" UI64FMTD "] update: %u", GetPlayer()->GetGUID(), update ? 1 : 0); #endif WorldPacket data(SMSG_LFG_UPDATE_SEARCH, 1); @@ -634,7 +637,7 @@ void WorldSession::SendLfgLfrList(bool update) void WorldSession::SendLfgDisabled() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_DISABLED [" UI64FMTD "]", GetPlayer()->GetGUID()); #endif WorldPacket data(SMSG_LFG_DISABLED, 0); @@ -643,7 +646,7 @@ void WorldSession::SendLfgDisabled() void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_OFFER_CONTINUE [" UI64FMTD "] dungeon entry: %u", GetPlayer()->GetGUID(), dungeonEntry); #endif WorldPacket data(SMSG_LFG_OFFER_CONTINUE, 4); @@ -653,7 +656,7 @@ void WorldSession::SendLfgOfferContinue(uint32 dungeonEntry) void WorldSession::SendLfgTeleportError(uint8 err) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_TELEPORT_DENIED [" UI64FMTD "] reason: %u", GetPlayer()->GetGUID(), err); #endif WorldPacket data(SMSG_LFG_TELEPORT_DENIED, 4); diff --git a/src/game/Handlers/LootHandler.cpp b/src/game/Handlers/LootHandler.cpp index e18f6127e..1299042b0 100644 --- a/src/game/Handlers/LootHandler.cpp +++ b/src/game/Handlers/LootHandler.cpp @@ -23,7 +23,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AUTOSTORE_LOOT_ITEM"); #endif Player* player = GetPlayer(); @@ -95,7 +95,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData) void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_MONEY"); #endif @@ -215,7 +215,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recvData*/) void WorldSession::HandleLootOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT"); #endif @@ -235,7 +235,7 @@ void WorldSession::HandleLootOpcode(WorldPacket& recvData) void WorldSession::HandleLootReleaseOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_LOOT_RELEASE"); #endif @@ -296,8 +296,8 @@ void WorldSession::DoLootRelease(uint64 lguid) // Xinef: prevents exploits with just opening GO and spawning bilions of npcs, which can crash core if you know what you're doin ;) if (go->GetGoType() == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.eventId) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", go->getLevelForTarget->GetGOInfo()->chest.eventId, go->getLevelForTarget->GetDBTableGUIDLow()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", go->GetGOInfo()->chest.eventId, go->GetDBTableGUIDLow()); #endif player->GetMap()->ScriptsStart(sEventScripts, go->GetGOInfo()->chest.eventId, player, go); } @@ -419,7 +419,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = [%s].", target->GetName().c_str()); #endif @@ -460,7 +460,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recvData) if (slotid >= loot->items.size() + loot->quest_items.size()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName().c_str(), slotid, (unsigned long)loot->items.size()); #endif return; diff --git a/src/game/Handlers/MailHandler.cpp b/src/game/Handlers/MailHandler.cpp index 3e6792ea5..24b213472 100644 --- a/src/game/Handlers/MailHandler.cpp +++ b/src/game/Handlers/MailHandler.cpp @@ -101,13 +101,14 @@ void WorldSession::HandleSendMail(WorldPacket & recvData) if (!rc) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Player %u is sending mail to %s (GUID: not existed!) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); -#endif player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); +#endif + player->SendMailResult(0, MAIL_SEND, MAIL_ERR_RECIPIENT_NOT_FOUND); return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Player %u is sending mail to %s (GUID: %u) with subject %s and body %s includes %u items, %u copper and %u COD copper with unk1 = %u, unk2 = %u", player->GetGUIDLow(), receiver.c_str(), GUID_LOPART(rc), subject.c_str(), body.c_str(), items_count, money, COD, unk1, unk2); #endif @@ -720,7 +721,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recvData) bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("HandleMailCreateTextItem mailid=%u", mailId); #endif diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index 494832dea..1c7c30546 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -46,7 +46,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REPOP_REQUEST Message"); #endif @@ -65,7 +65,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) // release spirit after he's killed but before he is updated if (GetPlayer()->getDeathState() == JUST_DIED) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleRepopRequestOpcode: got request after player %s(%d) was killed and before he was updated", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); #endif GetPlayer()->KillPlayer(); @@ -79,7 +79,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); #endif @@ -101,7 +101,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -112,7 +112,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) go = _player->GetMap()->GetGameObject(guid); if (!go) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - GameObject (GUID: %u) not found.", uint32(GUID_LOPART(guid))); #endif return; @@ -137,7 +137,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid))); #endif return; @@ -149,7 +149,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data) if ((unit && unit->GetCreatureTemplate()->ScriptID != unit->LastUsedScriptID) || (go && go->GetGOInfo()->ScriptId != go->LastUsedScriptID)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id"); #endif if (unit) @@ -407,7 +407,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket& recvData) void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity()); #endif @@ -463,7 +463,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandlePlayerLogoutOpcode(WorldPacket & /*recv_data*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_PLAYER_LOGOUT Message"); #endif } @@ -514,7 +514,7 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) uint32 newZone; recv_data >> newZone; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd ZONE_UPDATE: %u", newZone); #endif @@ -535,7 +535,7 @@ void WorldSession::HandleSetSelectionOpcode(WorldPacket & recv_data) void WorldSession::HandleStandStateChangeOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) // sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_STANDSTATECHANGE"); -- too many spam in log at lags/debug stop #endif uint32 animstate; @@ -548,7 +548,7 @@ void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) { uint32 unk; recv_data >> unk; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_CONTACT_LIST - Unk: %d", unk); #endif _player->GetSocial()->SendSocialList(_player); @@ -556,7 +556,7 @@ void WorldSession::HandleContactListOpcode(WorldPacket & recv_data) void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_FRIEND"); #endif @@ -570,7 +570,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) if (!normalizePlayerName(friendName)) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to add friend : '%s'", GetPlayer()->GetName().c_str(), friendName.c_str()); #endif @@ -608,7 +608,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) if (!GetPlayer()->GetSocial()->AddToSocialList(guidLow, false)) { friendResult = FRIEND_LIST_FULL; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s's friend list is full.", GetPlayer()->GetName().c_str()); #endif } @@ -619,7 +619,7 @@ void WorldSession::HandleAddFriendOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, guidLow, false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); #endif } @@ -628,7 +628,7 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) { uint64 FriendGUID; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_FRIEND"); #endif @@ -638,14 +638,14 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, GUID_LOPART(FriendGUID), false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); #endif } void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ADD_IGNORE"); #endif @@ -656,7 +656,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) if (!normalizePlayerName(ignoreName)) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: %s asked to Ignore: '%s'", GetPlayer()->GetName().c_str(), ignoreName.c_str()); #endif uint32 lowGuid = sWorld->GetGlobalPlayerGUID(ignoreName); @@ -681,7 +681,7 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, lowGuid, false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent (SMSG_FRIEND_STATUS)"); #endif } @@ -728,7 +728,7 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) { uint64 IgnoreGUID; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DEL_IGNORE"); #endif @@ -738,14 +738,14 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket & recv_data) sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, GUID_LOPART(IgnoreGUID), false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent motd (SMSG_FRIEND_STATUS)"); #endif } void WorldSession::HandleSetContactNotesOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_CONTACT_NOTES"); #endif uint64 guid; @@ -763,19 +763,14 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) recv_data >> typelen >> type; - if (suggestion == 0) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); -#endif - else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Suggestion]"); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + if (suggestion == 0) + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Bug Report]"); + else + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BUG [Suggestion]"); + sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", type.c_str()); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_NETWORKIO, "%s", content.c_str()); #endif @@ -789,7 +784,7 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RECLAIM_CORPSE"); #endif @@ -828,7 +823,7 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_RESURRECT_RESPONSE"); #endif @@ -875,34 +870,37 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) uint32 triggerId; recv_data >> triggerId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_AREATRIGGER. Trigger ID: %u", triggerId); #endif Player* player = GetPlayer(); if (player->IsInFlight()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", player->GetName().c_str(), player->GetGUIDLow(), triggerId); -#endif return; +#endif + return; } AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(triggerId); if (!atEntry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", player->GetName().c_str(), player->GetGUIDLow(), triggerId); -#endif return; +#endif + return; } if (!player->IsInAreaTriggerRadius(atEntry)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleAreaTriggerOpcode: Player '%s' (GUID: %u) too far (trigger map: %u player map: %u), ignore Area Trigger ID: %u", player->GetName().c_str(), atEntry->mapid, player->GetMapId(), player->GetGUIDLow(), triggerId); -#endif return; +#endif + return; } if (player->isDebugAreaTriggers) @@ -959,14 +957,14 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_UPDATE_ACCOUNT_DATA"); #endif uint32 type, timestamp, decompressedSize; recv_data >> type >> timestamp >> decompressedSize; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "UAD: type %u, time %u, decompressedSize %u", type, timestamp, decompressedSize); #endif @@ -1018,14 +1016,14 @@ void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_REQUEST_ACCOUNT_DATA"); #endif uint32 type; recv_data >> type; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: type %u", type); #endif @@ -1043,7 +1041,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) if (size && compress(dest.contents(), &destSize, (uint8 const*)adata->Data.c_str(), size) != Z_OK) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "RAD: Failed to compress account data"); #endif return; @@ -1062,7 +1060,7 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_SET_ACTION_BUTTON"); #endif uint8 button; @@ -1072,12 +1070,12 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) uint32 action = ACTION_BUTTON_ACTION(packetData); uint8 type = ACTION_BUTTON_TYPE(packetData); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("BUTTON: %u ACTION: %u TYPE: %u", button, action, type); #endif if (!packetData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MISC: Remove action from button %u", button); #endif GetPlayer()->removeActionButton(button); @@ -1088,22 +1086,22 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) { case ACTION_BUTTON_MACRO: case ACTION_BUTTON_CMACRO: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MISC: Added Macro %u into button %u", action, button); #endif break; case ACTION_BUTTON_EQSET: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MISC: Added EquipmentSet %u into button %u", action, button); #endif break; case ACTION_BUTTON_SPELL: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MISC: Added Spell %u into button %u", action, button); #endif break; case ACTION_BUTTON_ITEM: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MISC: Added Item %u into button %u", action, button); #endif break; @@ -1117,14 +1115,14 @@ void WorldSession::HandleSetActionButtonOpcode(WorldPacket& recv_data) void WorldSession::HandleCompleteCinematic(WorldPacket & /*recv_data*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_COMPLETE_CINEMATIC"); #endif } void WorldSession::HandleNextCinematicCamera(WorldPacket & /*recv_data*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_NEXT_CINEMATIC_CAMERA"); #endif } @@ -1139,7 +1137,7 @@ void WorldSession::HandleMoveTimeSkippedOpcode(WorldPacket & recv_data) void WorldSession::HandleFeatherFallAck(WorldPacket &recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_FEATHER_FALL_ACK"); #endif @@ -1162,7 +1160,7 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recv_data) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_UNROOT_ACK"); #endif @@ -1190,7 +1188,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recv_data) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_FORCE_MOVE_ROOT_ACK"); #endif @@ -1234,14 +1232,14 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data) uint64 guid; recv_data >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_INSPECT"); #endif Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_INSPECT: No player found from GUID: " UI64FMTD, guid); #endif return; @@ -1275,7 +1273,7 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data) Player* player = ObjectAccessor::GetPlayer(*_player, guid); if (!player) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_INSPECT_HONOR_STATS: No player found from GUID: " UI64FMTD, guid); #endif return; @@ -1307,19 +1305,19 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) recv_data >> PositionZ; recv_data >> Orientation; // o (3.141593 = 180 degrees) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_WORLD_TELEPORT"); #endif if (GetPlayer()->IsInFlight()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.", GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow()); #endif return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_WORLD_TELEPORT: Player = %s, Time = %u, map = %u, x = %f, y = %f, z = %f, o = %f", GetPlayer()->GetName().c_str(), time, mapid, PositionX, PositionY, PositionZ, Orientation); #endif @@ -1331,7 +1329,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_WHOIS"); #endif std::string charname; @@ -1388,14 +1386,14 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) data << msg; SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received whois command from player %s for character %s", GetPlayer()->GetName().c_str(), charname.c_str()); #endif } void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_COMPLAIN"); #endif @@ -1432,14 +1430,14 @@ void WorldSession::HandleComplainOpcode(WorldPacket & recv_data) data << uint8(0); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "REPORT SPAM: type %u, guid %u, unk1 %u, unk2 %u, unk3 %u, unk4 %u, message %s", spam_type, GUID_LOPART(spammer_guid), unk1, unk2, unk3, unk4, description.c_str()); #endif } void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_REALM_SPLIT"); #endif @@ -1461,7 +1459,7 @@ void WorldSession::HandleRealmSplitOpcode(WorldPacket & recv_data) void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_FAR_SIGHT"); #endif @@ -1470,20 +1468,20 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) if (apply) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug("Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_NETWORKIO, "Added FarSight " UI64FMTD " to player %u", _player->GetUInt64Value(PLAYER_FARSIGHT), _player->GetGUIDLow()); #endif if (WorldObject* target = _player->GetViewpoint()) _player->SetSeer(target); else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outError("Player %s requests non-existing seer " UI64FMTD, _player->GetName().c_str(), _player->GetUInt64Value(PLAYER_FARSIGHT)); #endif } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug("Player %u set vision to self", _player->GetGUIDLow()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player %u set vision to self", _player->GetGUIDLow()); #endif _player->SetSeer(_player); } @@ -1493,7 +1491,7 @@ void WorldSession::HandleFarSightOpcode(WorldPacket& recvData) void WorldSession::HandleSetTitleOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_SET_TITLE"); #endif @@ -1522,7 +1520,7 @@ void WorldSession::HandleTimeSyncResp(WorldPacket & recv_data) void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_RESET_INSTANCES"); #endif @@ -1537,7 +1535,7 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_DUNGEON_DIFFICULTY"); #endif @@ -1592,7 +1590,7 @@ void WorldSession::HandleSetDungeonDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_SET_RAID_DIFFICULTY"); #endif @@ -1751,7 +1749,7 @@ void WorldSession::HandleSetRaidDifficultyOpcode(WorldPacket & recv_data) void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CANCEL_MOUNT_AURA"); #endif @@ -1775,7 +1773,7 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) { // fly mode on/off -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); #endif @@ -1803,7 +1801,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket & recv_data) void WorldSession::HandleRequestPetInfoOpcode(WorldPacket & /*recv_data */) { /* -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_REQUEST_PET_INFO"); #endif recv_data.hexlike(); @@ -1817,7 +1815,7 @@ void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket & recv_data) mode ? _player->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK) : _player->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_TAXI_BENCHMARK); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Client used \"/timetest %d\" command", mode); #endif } @@ -1837,7 +1835,7 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket & recv_data) void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) { // empty opcode -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_WORLD_STATE_UI_TIMER_UPDATE"); #endif @@ -1849,7 +1847,7 @@ void WorldSession::HandleWorldStateUITimerUpdate(WorldPacket& /*recv_data*/) void WorldSession::HandleReadyForAccountDataTimes(WorldPacket& /*recv_data*/) { // empty opcode -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES"); #endif @@ -1866,7 +1864,7 @@ void WorldSession::SendSetPhaseShift(uint32 PhaseShift) //Battlefield and Battleground void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); #endif @@ -1891,7 +1889,7 @@ void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); #endif @@ -1942,7 +1940,7 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) if (!_player->HasPendingBind() || _player->GetPendingBind() != _player->GetInstanceId() || (_player->GetGroup() && _player->GetGroup()->isLFGGroup() && _player->GetGroup()->IsLfgRandomInstance())) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("InstanceLockResponse: Player %s (guid %u) tried to bind himself/teleport to graveyard without a pending bind!", _player->GetName().c_str(), _player->GetGUIDLow()); #endif return; @@ -1958,7 +1956,7 @@ void WorldSession::HandleInstanceLockResponse(WorldPacket& recvPacket) void WorldSession::HandleUpdateMissileTrajectory(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY"); #endif diff --git a/src/game/Handlers/MovementHandler.cpp b/src/game/Handlers/MovementHandler.cpp index c8f321780..1feb9ac65 100644 --- a/src/game/Handlers/MovementHandler.cpp +++ b/src/game/Handlers/MovementHandler.cpp @@ -29,7 +29,7 @@ void WorldSession::HandleMoveWorldportAckOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got MSG_MOVE_WORLDPORT_ACK."); #endif HandleMoveWorldportAckOpcode(); @@ -224,7 +224,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_MOVE_TELEPORT_ACK"); #endif uint64 guid; @@ -233,10 +233,10 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recvData) uint32 flags, time; recvData >> flags >> time; // unused -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Guid " UI64FMTD, guid); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Flags %u, time %u", flags, time/IN_MILLISECONDS); #endif @@ -492,7 +492,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData) void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) { uint32 opcode = recvData.GetOpcode(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(opcode), opcode, opcode); #endif @@ -572,7 +572,7 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recvData) void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); #endif @@ -588,7 +588,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recvData) void WorldSession::HandleMoveNotActiveMover(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); #endif @@ -619,7 +619,7 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/) void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_KNOCK_BACK_ACK"); #endif @@ -656,7 +656,7 @@ void WorldSession::HandleMoveKnockBackAck(WorldPacket & recvData) void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_HOVER_ACK"); #endif @@ -674,7 +674,7 @@ void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_MOVE_WATER_WALK_ACK"); #endif diff --git a/src/game/Handlers/NPCHandler.cpp b/src/game/Handlers/NPCHandler.cpp index 18d055657..3458895bc 100644 --- a/src/game/Handlers/NPCHandler.cpp +++ b/src/game/Handlers/NPCHandler.cpp @@ -44,7 +44,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -68,7 +68,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recvData) { uint64 guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_BANKER_ACTIVATE"); #endif @@ -77,7 +77,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -121,14 +121,14 @@ void WorldSession::SendTrainerList(uint64 guid) void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList"); #endif Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -142,7 +142,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) if (!ci) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!", GUID_LOPART(guid)); #endif return; @@ -151,9 +151,10 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) TrainerSpellData const* trainer_spells = unit->GetTrainerSpells(); if (!trainer_spells) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Training spells not found for creature (GUID: %u Entry: %u)", GUID_LOPART(guid), unit->GetEntry()); -#endif return; +#endif + return; } WorldPacket data(SMSG_TRAINER_LIST, 8+4+4+trainer_spells->spellList.size()*38 + strTitle.size()+1); @@ -245,14 +246,14 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) uint32 spellId = 0; recvData >> guid >> spellId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); #endif Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTrainerBuySpellOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -302,7 +303,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recvData) void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GOSSIP_HELLO"); #endif @@ -312,7 +313,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipHelloOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -365,7 +366,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) /*void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_GOSSIP_SELECT_OPTION"); #endif @@ -378,11 +379,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) if (_player->PlayerTalkClass->GossipOptionCoded(option)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "reading string"); #endif recvData >> code; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "string read: %s", code.c_str()); #endif } @@ -390,7 +391,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: HandleGossipSelectOptionOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -414,7 +415,7 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket & recvData) void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SPIRIT_HEALER_ACTIVATE"); #endif @@ -425,7 +426,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_SPIRITHEALER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSpiritHealerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -480,7 +481,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); #endif return; @@ -514,7 +515,7 @@ void WorldSession::SendBindPoint(Creature* npc) void WorldSession::HandleListStabledPetsOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS"); #endif uint64 npcGUID; @@ -552,7 +553,7 @@ void WorldSession::SendStablePetCallback(PreparedQueryResult result, uint64 guid if (!GetPlayer()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv MSG_LIST_STABLED_PETS Send."); #endif @@ -611,7 +612,7 @@ void WorldSession::SendStableResult(uint8 res) void WorldSession::HandleStablePet(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_PET"); #endif uint64 npcGUID; @@ -688,7 +689,7 @@ void WorldSession::HandleStablePetCallback(PreparedQueryResult result) void WorldSession::HandleUnstablePet(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_UNSTABLE_PET."); #endif uint64 npcGUID; @@ -766,7 +767,7 @@ void WorldSession::HandleUnstablePetCallback(PreparedQueryResult result, uint32 void WorldSession::HandleBuyStableSlot(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_BUY_STABLE_SLOT."); #endif uint64 npcGUID; @@ -801,14 +802,14 @@ void WorldSession::HandleBuyStableSlot(WorldPacket & recvData) void WorldSession::HandleStableRevivePet(WorldPacket &/* recvData */) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "HandleStableRevivePet: Not implemented"); #endif } void WorldSession::HandleStableSwapPet(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_STABLE_SWAP_PET."); #endif uint64 npcGUID; @@ -900,7 +901,7 @@ void WorldSession::HandleStableSwapPetCallback(PreparedQueryResult result, uint3 void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_REPAIR_ITEM"); #endif @@ -912,7 +913,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_REPAIR); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleRepairItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); #endif return; @@ -927,7 +928,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) if (itemGUID) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair item, itemGUID = %u, npcGUID = %u", GUID_LOPART(itemGUID), GUID_LOPART(npcGUID)); #endif @@ -937,7 +938,7 @@ void WorldSession::HandleRepairItemOpcode(WorldPacket & recvData) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "ITEM: Repair all items, npcGUID = %u", GUID_LOPART(npcGUID)); #endif _player->DurabilityRepairAll(true, discountMod, guildBank); diff --git a/src/game/Handlers/PetHandler.cpp b/src/game/Handlers/PetHandler.cpp index bbd9fcbd7..09d278a58 100644 --- a/src/game/Handlers/PetHandler.cpp +++ b/src/game/Handlers/PetHandler.cpp @@ -354,7 +354,7 @@ void WorldSession::HandleDismissCritter(WorldPacket &recvData) uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_DISMISS_CRITTER for GUID " UI64FMTD, guid); #endif @@ -362,9 +362,10 @@ void WorldSession::HandleDismissCritter(WorldPacket &recvData) if (!pet) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Vanitypet (guid: %u) does not exist - player '%s' (guid: %u / account: %u) attempted to dismiss it (possibly lagged out)", uint32(GUID_LOPART(guid)), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow(), GetAccountId()); -#endif return; +#endif + return; } if (_player->GetCritterGUID() == pet->GetGUID()) @@ -388,7 +389,7 @@ void WorldSession::HandlePetAction(WorldPacket & recvData) // used also for charmed creature Unit* pet= ObjectAccessor::GetUnit(*_player, guid1); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("HandlePetAction: Pet %u - flag: %u, spellid: %u, target: %u.", uint32(GUID_LOPART(guid1)), uint32(flag), spellid, uint32(GUID_LOPART(guid2))); #endif @@ -444,7 +445,7 @@ void WorldSession::HandlePetStopAttack(WorldPacket &recvData) uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PET_STOP_ATTACK for GUID " UI64FMTD "", guid); #endif @@ -900,7 +901,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, uint64 guid1, uint16 spellid void WorldSession::HandlePetNameQuery(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("HandlePetNameQuery. CMSG_PET_NAME_QUERY"); #endif @@ -953,7 +954,7 @@ bool WorldSession::CheckStableMaster(uint64 guid) { if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID:%u) attempt open stable in cheating way.", GUID_LOPART(guid)); #endif return false; @@ -964,7 +965,7 @@ bool WorldSession::CheckStableMaster(uint64 guid) { if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Stablemaster (GUID:%u) not found or you can't interact with him.", GUID_LOPART(guid)); #endif return false; @@ -975,7 +976,7 @@ bool WorldSession::CheckStableMaster(uint64 guid) void WorldSession::HandlePetSetAction(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("HandlePetSetAction. CMSG_PET_SET_ACTION"); #endif @@ -1104,7 +1105,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recvData) void WorldSession::HandlePetRename(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("HandlePetRename. CMSG_PET_RENAME"); #endif @@ -1196,7 +1197,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recvData) { uint64 guid; recvData >> guid; //pet guid -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("HandlePetAbandon. CMSG_PET_ABANDON pet guid is %u", GUID_LOPART(guid)); #endif @@ -1224,7 +1225,7 @@ void WorldSession::HandlePetAbandon(WorldPacket & recvData) void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("CMSG_PET_SPELL_AUTOCAST"); #endif uint64 guid; @@ -1284,7 +1285,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL"); #endif @@ -1295,7 +1296,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> guid >> castCount >> spellId >> castFlags; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_CAST_SPELL, guid: " UI64FMTD ", castCount: %u, spellId %u, castFlags %u", guid, castCount, spellId, castFlags); #endif @@ -1405,7 +1406,7 @@ void WorldSession::SendPetNameInvalid(uint32 error, const std::string& name, Dec void WorldSession::HandlePetLearnTalent(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_PET_LEARN_TALENT"); #endif @@ -1419,7 +1420,7 @@ void WorldSession::HandlePetLearnTalent(WorldPacket & recvData) void WorldSession::HandleLearnPreviewTalentsPet(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS_PET"); #endif diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index 8a9b6e8b1..60adfb791 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -41,7 +41,7 @@ enum CharterCosts void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_BUY"); #endif @@ -72,7 +72,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) recvData >> clientIndex; // index recvData.read_skip(); // 0 -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); #endif @@ -80,7 +80,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); #endif return; @@ -131,7 +131,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) type = ARENA_TEAM_CHARTER_5v5_TYPE; break; default: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "unknown selection at buy arena petition: %u", clientIndex); #endif return; @@ -214,8 +214,8 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) if (petition) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %s", petition.str().c_str()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_NETWORKIO, "Invalid petition GUIDs: %u", petition->petitionGuid); #endif trans->PAppend("DELETE FROM petition WHERE petitionguid = %u", petition->petitionGuid); @@ -241,7 +241,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SHOW_SIGNATURES"); #endif @@ -264,7 +264,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) Signatures const* signatures = sPetitionMgr->GetSignature(petitionGuidLow); uint8 signs = signatures ? signatures->signatureMap.size() : 0; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_SHOW_SIGNATURES petition entry: '%u'", petitionGuidLow); #endif @@ -286,7 +286,7 @@ void WorldSession::HandlePetitionShowSignOpcode(WorldPacket& recvData) void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_QUERY"); // ok #endif @@ -294,7 +294,7 @@ void WorldSession::HandlePetitionQueryOpcode(WorldPacket & recvData) uint64 petitionguid; recvData >> guildguid; // in Trinity always same as GUID_LOPART(petitionguid) recvData >> petitionguid; // petition guid -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY Petition GUID %u Guild GUID %u", GUID_LOPART(petitionguid), guildguid); #endif @@ -306,7 +306,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) Petition const* petition = sPetitionMgr->GetPetition(GUID_LOPART(petitionguid)); if (!petition) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionguid)); #endif return; @@ -352,7 +352,7 @@ void WorldSession::SendPetitionQueryOpcode(uint64 petitionguid) void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_RENAME"); // ok #endif @@ -369,7 +369,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) Petition const* petition = sPetitionMgr->GetPetition(GUID_LOPART(petitionGuid)); if (!petition) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_PETITION_QUERY failed for petition (GUID: %u)", GUID_LOPART(petitionGuid)); #endif return; @@ -412,7 +412,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) // xinef: update petition container const_cast(petition)->petitionName = newName; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition (GUID: %u) renamed to '%s'", GUID_LOPART(petitionGuid), newName.c_str()); #endif WorldPacket data(MSG_PETITION_RENAME, (8+newName.size()+1)); @@ -423,7 +423,7 @@ void WorldSession::HandlePetitionRenameOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_PETITION_SIGN"); // ok #endif @@ -543,7 +543,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) // xinef: fill petition store sPetitionMgr->AddSignature(GUID_LOPART(petitionGuid), GetAccountId(), playerGuid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionGuid), _player->GetName().c_str(), playerGuid, GetAccountId()); #endif @@ -567,14 +567,14 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode MSG_PETITION_DECLINE"); // ok #endif uint64 petitionguid; uint64 ownerguid; recvData >> petitionguid; // petition guid -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u declined by %u", GUID_LOPART(petitionguid), _player->GetGUIDLow()); #endif @@ -593,7 +593,7 @@ void WorldSession::HandlePetitionDeclineOpcode(WorldPacket & recvData) void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_OFFER_PETITION"); // ok #endif @@ -683,7 +683,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket & recvData) void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received opcode CMSG_TURN_IN_PETITION"); #endif @@ -698,7 +698,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) if (!item) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Petition %u turned in by %u", GUID_LOPART(petitionGuid), _player->GetGUIDLow()); #endif @@ -823,7 +823,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) // Register arena team sArenaTeamMgr->AddArenaTeam(arenaTeam); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitonsHandler: Arena team (guid: %u) added to ObjectMgr", arenaTeam->GetId()); #endif @@ -831,7 +831,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) if (signs) for (SignatureMap::const_iterator itr = signatureCopy.begin(); itr != signatureCopy.end(); ++itr) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "PetitionsHandler: Adding arena team (guid: %u) member %u", arenaTeam->GetId()); #endif arenaTeam->AddMember(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)); @@ -854,7 +854,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) sPetitionMgr->RemovePetition(GUID_LOPART(petitionGuid)); // created -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TURN IN PETITION GUID %u", GUID_LOPART(petitionGuid)); #endif @@ -865,7 +865,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recvData) void WorldSession::HandlePetitionShowListOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Received CMSG_PETITION_SHOWLIST"); #endif @@ -880,7 +880,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_PETITIONER); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionShowListOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -926,7 +926,7 @@ void WorldSession::SendPetitionShowList(uint64 guid) } SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Sent SMSG_PETITION_SHOWLIST"); #endif } diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 962ebdc94..99ae11029 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -135,12 +135,13 @@ void WorldSession::HandleCreatureQueryOpcode(WorldPacket & recvData) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CREATURE_QUERY - NO CREATURE INFO! (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entry); -#endif WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); +#endif + WorldPacket data(SMSG_CREATURE_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_CREATURE_QUERY_RESPONSE"); #endif } @@ -173,7 +174,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) ObjectMgr::GetLocaleString(gameObjectLocale->CastBarCaption, localeConstant, CastBarCaption); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY '%s' - Entry: %u. ", info->name.c_str(), entry); #endif WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 150); @@ -197,19 +198,20 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) data << uint32(0); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); #endif } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GAMEOBJECT_QUERY - Missing gameobject info for (GUID: %u, ENTRY: %u)", GUID_LOPART(guid), entry); -#endif WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); +#endif + WorldPacket data (SMSG_GAMEOBJECT_QUERY_RESPONSE, 4); data << uint32(entry | 0x80000000); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_GAMEOBJECT_QUERY_RESPONSE"); #endif } @@ -217,7 +219,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket & recvData) void WorldSession::HandleCorpseQueryOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_CORPSE_QUERY"); #endif @@ -274,7 +276,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) uint64 guid; recvData >> textID; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID); #endif @@ -353,7 +355,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_NPC_TEXT_UPDATE"); #endif } @@ -361,7 +363,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData) /// Only _static_ data is sent in this packet !!! void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PAGE_TEXT_QUERY"); #endif @@ -397,7 +399,7 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) } SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_PAGE_TEXT_QUERY_RESPONSE"); #endif } @@ -405,7 +407,7 @@ void WorldSession::HandlePageTextQueryOpcode(WorldPacket & recvData) void WorldSession::HandleCorpseMapPositionQuery(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recv CMSG_CORPSE_MAP_POSITION_QUERY"); #endif diff --git a/src/game/Handlers/QuestHandler.cpp b/src/game/Handlers/QuestHandler.cpp index 4b783e3db..8650e309c 100644 --- a/src/game/Handlers/QuestHandler.cpp +++ b/src/game/Handlers/QuestHandler.cpp @@ -30,7 +30,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) Object* questGiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT); if (!questGiver) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid)); #endif return; @@ -40,7 +40,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) { case TYPEID_UNIT: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); #endif if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies @@ -49,7 +49,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recvData) } case TYPEID_GAMEOBJECT: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", uint32(GUID_LOPART(guid))); #endif questStatus = _player->GetQuestDialogStatus(questGiver); @@ -69,16 +69,17 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); #endif Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!creature) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guid)); -#endif return; +#endif + return; } // remove fake death @@ -104,7 +105,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recvData) uint32 unk1; recvData >> guid >> questId >> unk1; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); #endif @@ -195,7 +196,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recvData) uint32 questId; uint8 unk1; recvData >> guid >> questId >> unk1; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), questId, unk1); #endif @@ -232,7 +233,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recvData) uint32 questId; recvData >> questId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", questId); #endif @@ -252,7 +253,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recvData) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u", uint32(GUID_LOPART(guid)), questId, reward); #endif @@ -334,7 +335,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid >> questId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); #endif @@ -358,7 +359,7 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recvData) void WorldSession::HandleQuestgiverCancel(WorldPacket& /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CANCEL"); #endif @@ -373,7 +374,7 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recvData) if (slot1 == slot2 || slot1 >= MAX_QUEST_LOG_SIZE || slot2 >= MAX_QUEST_LOG_SIZE) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); #endif @@ -385,7 +386,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) uint8 slot; recvData >> slot; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot); #endif @@ -412,7 +413,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recvData) _player->RemoveActiveQuest(questId); _player->RemoveTimedAchievement(ACHIEVEMENT_TIMED_TYPE_QUEST, questId); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Player %u abandoned quest %u", _player->GetGUIDLow(), questId); #endif } @@ -428,7 +429,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) uint32 questId; recvData >> questId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_CONFIRM_ACCEPT quest = %u", questId); #endif @@ -467,7 +468,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) recvData >> guid >> questId; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), questId); #endif @@ -511,7 +512,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recvData) void WorldSession::HandleQuestgiverQuestAutoLaunch(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUEST_AUTOLAUNCH"); #endif } @@ -524,7 +525,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket) if (!_player->CanShareQuest(questId)) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_PUSHQUESTTOPARTY quest = %u", questId); #endif @@ -593,7 +594,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) uint8 msg; recvPacket >> guid >> questId >> msg; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received MSG_QUEST_PUSH_RESULT"); #endif @@ -612,7 +613,7 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket) void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_MULTIPLE_QUERY"); #endif diff --git a/src/game/Handlers/ReferAFriendHandler.cpp b/src/game/Handlers/ReferAFriendHandler.cpp index 0cdfaf78b..ecf654952 100644 --- a/src/game/Handlers/ReferAFriendHandler.cpp +++ b/src/game/Handlers/ReferAFriendHandler.cpp @@ -12,7 +12,7 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GRANT_LEVEL"); #endif @@ -56,7 +56,7 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_ACCEPT_LEVEL_GRANT"); #endif diff --git a/src/game/Handlers/SkillHandler.cpp b/src/game/Handlers/SkillHandler.cpp index 757907d02..ab6884b13 100644 --- a/src/game/Handlers/SkillHandler.cpp +++ b/src/game/Handlers/SkillHandler.cpp @@ -26,7 +26,7 @@ void WorldSession::HandleLearnTalentOpcode(WorldPacket & recvData) void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LEARN_PREVIEW_TALENTS"); #endif @@ -52,7 +52,7 @@ void WorldSession::HandleLearnPreviewTalents(WorldPacket& recvPacket) void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "MSG_TALENT_WIPE_CONFIRM"); #endif uint64 guid; @@ -61,7 +61,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; diff --git a/src/game/Handlers/SpellHandler.cpp b/src/game/Handlers/SpellHandler.cpp index 7bc5f1803..b87646b14 100644 --- a/src/game/Handlers/SpellHandler.cpp +++ b/src/game/Handlers/SpellHandler.cpp @@ -82,7 +82,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); #endif @@ -161,7 +161,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); #endif @@ -182,7 +182,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) recvPacket >> bagIndex >> slot; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("bagIndex: %u, slot: %u", bagIndex, slot); #endif @@ -291,7 +291,7 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid)); #endif @@ -314,7 +314,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) uint64 guid; recvPacket >> guid; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [in game guid: %u]", GUID_LOPART(guid)); #endif @@ -341,7 +341,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) uint8 castCount, castFlags; recvPacket >> castCount >> spellId >> castFlags; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); #endif @@ -571,7 +571,7 @@ void WorldSession::HandleTotemDestroyed(WorldPacket& recvPacket) void WorldSession::HandleSelfResOpcode(WorldPacket & /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SELF_RES"); // empty opcode #endif @@ -611,7 +611,7 @@ void WorldSession::HandleSpellClick(WorldPacket& recvData) void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_GET_MIRRORIMAGE_DATA"); #endif uint64 guid; @@ -706,7 +706,7 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPacket & recvData) void WorldSession::HandleUpdateProjectilePosition(WorldPacket& recvPacket) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_UPDATE_PROJECTILE_POSITION"); #endif diff --git a/src/game/Handlers/TaxiHandler.cpp b/src/game/Handlers/TaxiHandler.cpp index d87e98839..92bcddc72 100644 --- a/src/game/Handlers/TaxiHandler.cpp +++ b/src/game/Handlers/TaxiHandler.cpp @@ -17,7 +17,7 @@ void WorldSession::HandleTaxiNodeStatusQueryOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXINODE_STATUS_QUERY"); #endif @@ -33,7 +33,7 @@ void WorldSession::SendTaxiStatus(uint64 guid) Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSession::SendTaxiStatus - Unit (GUID: %u) not found.", uint32(GUID_LOPART(guid))); #endif return; @@ -45,7 +45,7 @@ void WorldSession::SendTaxiStatus(uint64 guid) if (curloc == 0) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: current location %u ", curloc); #endif @@ -53,14 +53,14 @@ void WorldSession::SendTaxiStatus(uint64 guid) data << guid; data << uint8(GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) ? 1 : 0); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_TAXINODE_STATUS"); #endif } void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TAXIQUERYAVAILABLENODES"); #endif @@ -71,7 +71,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recvData) Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!unit) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTaxiQueryAvailableNodes - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); #endif return; @@ -100,7 +100,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater(); if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); #endif @@ -111,7 +111,7 @@ void WorldSession::SendTaxiMenu(Creature* unit) GetPlayer()->m_taxi.AppendTaximaskTo(data, GetPlayer()->isTaxiCheater()); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SHOWTAXINODES"); #endif @@ -168,7 +168,7 @@ void WorldSession::SendDiscoverNewTaxiNode(uint32 nodeid) void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS"); #endif @@ -180,7 +180,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiExpressOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); #endif return; @@ -205,7 +205,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) if (nodes.empty()) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d", nodes.front(), nodes.back()); #endif @@ -214,7 +214,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recvData) void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_MOVE_SPLINE_DONE"); #endif @@ -230,7 +230,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI"); #endif @@ -239,13 +239,13 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recvData) nodes.resize(2); recvData >> guid >> nodes[0] >> nodes[1]; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d", nodes[0], nodes[1]); #endif Creature* npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleActivateTaxiOpcode - Unit (GUID: %u) not found or you can't interact with it.", uint32(GUID_LOPART(guid))); #endif return; @@ -269,7 +269,7 @@ void WorldSession::SendActivateTaxiReply(ActivateTaxiReply reply) data << uint32(reply); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_ACTIVATETAXIREPLY"); #endif } diff --git a/src/game/Handlers/TradeHandler.cpp b/src/game/Handlers/TradeHandler.cpp index 936f5bf4b..0b5732479 100644 --- a/src/game/Handlers/TradeHandler.cpp +++ b/src/game/Handlers/TradeHandler.cpp @@ -58,7 +58,7 @@ void WorldSession::SendTradeStatus(TradeStatus status) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u", _player->GetGUIDLow()); #endif // recvPacket.print_storage(); @@ -66,7 +66,7 @@ void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u", _player->GetGUIDLow()); #endif // recvPacket.print_storage(); @@ -143,7 +143,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { // logging -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow()); #endif @@ -156,7 +156,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (hisItems[i]) { // logging -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow()); #endif @@ -206,7 +206,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m { if (Item* item = myTrade->GetItem(TradeSlots(i))) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("player trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); #endif //Can return NULL @@ -216,7 +216,7 @@ static void setAcceptTradeMode(TradeData* myTrade, TradeData* hisTrade, Item* *m if (Item* item = hisTrade->GetItem(TradeSlots(i))) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("partner trade item %u bag: %u slot: %u", item->GetGUIDLow(), item->GetBagSlot(), item->GetSlot()); #endif hisItems[i] = item; diff --git a/src/game/Handlers/VehicleHandler.cpp b/src/game/Handlers/VehicleHandler.cpp index 7dafed7af..f0b211f59 100644 --- a/src/game/Handlers/VehicleHandler.cpp +++ b/src/game/Handlers/VehicleHandler.cpp @@ -14,7 +14,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_DISMISS_CONTROLLED_VEHICLE"); #endif @@ -49,7 +49,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_CHANGE_SEATS_ON_CONTROLLED_VEHICLE"); #endif @@ -220,7 +220,7 @@ void WorldSession::HandleEjectPassenger(WorldPacket &data) void WorldSession::HandleRequestVehicleExit(WorldPacket& /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_REQUEST_VEHICLE_EXIT"); #endif diff --git a/src/game/Handlers/VoiceChatHandler.cpp b/src/game/Handlers/VoiceChatHandler.cpp index 7103bf1da..2bef11537 100644 --- a/src/game/Handlers/VoiceChatHandler.cpp +++ b/src/game/Handlers/VoiceChatHandler.cpp @@ -12,7 +12,7 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_VOICE_SESSION_ENABLE"); #endif // uint8 isVoiceEnabled, uint8 isMicrophoneEnabled @@ -22,7 +22,7 @@ void WorldSession::HandleVoiceSessionEnableOpcode(WorldPacket& recvData) void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_CHANNEL_VOICE_ON"); #endif // Enable Voice button in channel context menu @@ -30,7 +30,7 @@ void WorldSession::HandleChannelVoiceOnOpcode(WorldPacket& /*recvData*/) void WorldSession::HandleSetActiveVoiceChannel(WorldPacket& recvData) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_SET_ACTIVE_VOICE_CHANNEL"); #endif recvData.read_skip(); diff --git a/src/game/Instances/InstanceScript.cpp b/src/game/Instances/InstanceScript.cpp index 4b5c17977..e2e5e49d5 100644 --- a/src/game/Instances/InstanceScript.cpp +++ b/src/game/Instances/InstanceScript.cpp @@ -43,7 +43,7 @@ void InstanceScript::HandleGameObject(uint64 GUID, bool open, GameObject* go) if (go) go->SetGoState(open ? GO_STATE_ACTIVE : GO_STATE_READY); else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: InstanceScript: HandleGameObject failed"); #endif } @@ -66,7 +66,7 @@ void InstanceScript::LoadMinionData(const MinionData* data) ++data; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadMinionData: " UI64FMTD " minions loaded.", uint64(minions.size())); #endif } @@ -80,7 +80,7 @@ void InstanceScript::LoadDoorData(const DoorData* data) ++data; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "InstanceScript::LoadDoorData: " UI64FMTD " doors loaded.", uint64(doors.size())); #endif } @@ -301,7 +301,7 @@ void InstanceScript::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) player->SendUpdateWorldState(uiStateId, uiStateData); } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: DoUpdateWorldState attempt send data but no players in map."); #endif } diff --git a/src/game/Instances/InstanceScript.h b/src/game/Instances/InstanceScript.h index 4f3604bd9..e4f3ef396 100644 --- a/src/game/Instances/InstanceScript.h +++ b/src/game/Instances/InstanceScript.h @@ -13,16 +13,16 @@ //#include "GameObject.h" //#include "Map.h" -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) #define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) #define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) #define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) #define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #endif #define OUT_LOAD_INST_DATA_FAIL sLog->outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp index 308b71e1b..ffae01742 100644 --- a/src/game/Maps/Map.cpp +++ b/src/game/Maps/Map.cpp @@ -114,17 +114,17 @@ void Map::LoadMMap(int gx, int gy) switch (mmapLoadResult) { case MMAP::MMAP_LOAD_RESULT_OK: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); #endif break; case MMAP::MMAP_LOAD_RESULT_ERROR: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Could not load MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); #endif break; case MMAP::MMAP_LOAD_RESULT_IGNORED: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Ignored MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); #endif break; @@ -138,17 +138,17 @@ void Map::LoadVMap(int gx, int gy) switch (vmapLoadResult) { case VMAP::VMAP_LOAD_RESULT_OK: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); #endif break; case VMAP::VMAP_LOAD_RESULT_ERROR: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); #endif break; case VMAP::VMAP_LOAD_RESULT_IGNORED: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); #endif break; @@ -175,7 +175,7 @@ void Map::LoadMap(int gx, int gy, bool reload) //map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?) if (GridMaps[gx][gy]) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId()); #endif sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy); @@ -189,7 +189,7 @@ void Map::LoadMap(int gx, int gy, bool reload) int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; tmp = new char[len]; snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Loading map %s", tmp); #endif // loading data @@ -316,7 +316,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on) if (!IsGridLoaded(GridCoord(cell.data.Part.grid_x, cell.data.Part.grid_y))) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on); #endif NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); @@ -442,7 +442,7 @@ bool Map::EnsureGridLoaded(const Cell &cell) { //if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) //{ -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); #endif @@ -1140,7 +1140,7 @@ bool Map::UnloadGrid(NGridType& ngrid) GridMaps[gx][gy] = NULL; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId()); #endif return true; @@ -1884,7 +1884,7 @@ bool Map::IsOutdoors(float x, float y, float z) const WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId); if (wmoEntry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId); #endif atEntry = GetAreaEntryByAreaID(wmoEntry->areaId); @@ -1967,7 +1967,7 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp uint32 liquid_type = 0; if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type); #endif // Check water level and ground level @@ -2128,7 +2128,7 @@ char const* Map::GetMapName() const void Map::SendInitSelf(Player* player) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow()); #endif @@ -2463,7 +2463,7 @@ bool InstanceMap::CanEnter(Player* player, bool loginCheck) uint32 maxPlayers = GetMaxPlayers(); if (GetPlayersCountExceptGMs() >= (loginCheck ? maxPlayers+1 : maxPlayers)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName().c_str()); #endif player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS); diff --git a/src/game/Maps/MapInstanced.cpp b/src/game/Maps/MapInstanced.cpp index 79ea5e19f..31c139e2e 100644 --- a/src/game/Maps/MapInstanced.cpp +++ b/src/game/Maps/MapInstanced.cpp @@ -190,7 +190,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, // some instances only have one difficulty GetDownscaledMapDifficultyData(GetId(), difficulty); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); #endif @@ -216,7 +216,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun // load/create a map TRINITY_GUARD(ACE_Thread_Mutex, Lock); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); #endif diff --git a/src/game/Maps/MapManager.cpp b/src/game/Maps/MapManager.cpp index 760745078..f36fd2403 100644 --- a/src/game/Maps/MapManager.cpp +++ b/src/game/Maps/MapManager.cpp @@ -151,7 +151,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) // probably there must be special opcode, because client has this string constant in GlobalStrings.lua // TODO: this is not a good place to send the message player->GetSession()->SendAreaTriggerMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_RAID_GROUP_ONLY), mapName); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' must be in a raid group to enter instance '%s'", player->GetName().c_str(), mapName); #endif return false; @@ -186,19 +186,19 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) { WorldPacket data(SMSG_CORPSE_NOT_IN_INSTANCE, 0); player->GetSession()->SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' does not have a corpse in instance '%s' and cannot enter.", player->GetName().c_str(), mapName); #endif return false; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "MAP: Player '%s' has corpse in instance '%s' and can enter.", player->GetName().c_str(), mapName); #endif player->ResurrectPlayer(0.5f, false); player->SpawnCorpseBones(); } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPS, "Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName().c_str()); #endif } diff --git a/src/game/Movement/MotionMaster.cpp b/src/game/Movement/MotionMaster.cpp index 67909a66a..068537018 100644 --- a/src/game/Movement/MotionMaster.cpp +++ b/src/game/Movement/MotionMaster.cpp @@ -225,7 +225,7 @@ void MotionMaster::MoveRandom(float spawndist) if (_owner->GetTypeId() == TYPEID_UNIT) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (GUID: %u) start moving random", _owner->GetGUIDLow()); #endif Mutate(new RandomMovementGenerator(spawndist), MOTION_SLOT_IDLE); @@ -238,7 +238,7 @@ void MotionMaster::MoveTargetedHome() if (_owner->GetTypeId() == TYPEID_UNIT && !_owner->ToCreature()->GetCharmerOrOwnerGUID()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted home", _owner->GetEntry(), _owner->GetGUIDLow()); #endif Mutate(new HomeMovementGenerator(), MOTION_SLOT_ACTIVE); @@ -250,13 +250,13 @@ void MotionMaster::MoveTargetedHome() if (_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Pet or controlled creature (Entry: %u GUID: %u) targeting home", _owner->GetEntry(), _owner->GetGUIDLow()); #endif Unit* target = _owner->ToCreature()->GetCharmerOrOwner(); if (target) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Following %s (GUID: %u)", target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow()); #endif Mutate(new FollowMovementGenerator(target, PET_FOLLOW_DIST, _owner->GetFollowAngle()), MOTION_SLOT_ACTIVE); @@ -276,16 +276,17 @@ void MotionMaster::MoveConfused() if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) move confused", _owner->GetGUIDLow()); #endif Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) move confused", _owner->GetEntry(), _owner->GetGUIDLow()); -#endif Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); +#endif + Mutate(new ConfusedMovementGenerator(), MOTION_SLOT_CONTROLLED); } } @@ -299,21 +300,23 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) //_owner->ClearUnitState(UNIT_STATE_FOLLOW); if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) chase to %s (GUID: %u)", _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); -#endif Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); +#endif + Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)", _owner->GetEntry(), _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); -#endif Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); +#endif + Mutate(new ChaseMovementGenerator(target, dist, angle), MOTION_SLOT_ACTIVE); } } @@ -327,20 +330,22 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlo //_owner->AddUnitState(UNIT_STATE_FOLLOW); if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); -#endif Mutate(new FollowMovementGenerator(target, dist, angle), slot); +#endif + Mutate(new FollowMovementGenerator(target, dist, angle), slot); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)", _owner->GetEntry(), _owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); -#endif Mutate(new FollowMovementGenerator(target, dist, angle), slot); +#endif + Mutate(new FollowMovementGenerator(target, dist, angle), slot); } } @@ -352,24 +357,25 @@ void MotionMaster::MovePoint(uint32 id, float x, float y, float z, bool generate if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); #endif Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); -#endif Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); +#endif + Mutate(new PointMovementGenerator(id, x, y, z, 0.0f, NULL, generatePath, forceDestination), slot); } } void MotionMaster::MoveSplinePath(Movement::PointsArray* path) { - uint32 id; - float x, y, z; + //uint32 id; + //float x, y, z; // Xinef: do not allow to move with UNIT_FLAG_DISABLE_MOVE if (_owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE)) @@ -377,17 +383,18 @@ void MotionMaster::MoveSplinePath(Movement::PointsArray* path) if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + //sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), id, x, y, z); #endif Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", - _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z); -#endif Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + /*sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", + _owner->GetEntry(), _owner->GetGUIDLow(), id, x, y, z);*/ +#endif + Mutate(new EscortMovementGenerator(path), MOTION_SLOT_ACTIVE); } } @@ -400,7 +407,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed) float x, y, z; pos.GetPosition(x, y, z); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); #endif @@ -427,7 +434,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed) float x, y, z; pos.GetPosition(x, y, z); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u) landing point (ID: %u X: %f Y: %f Z: %f)", _owner->GetEntry(), id, x, y, z); #endif @@ -493,7 +500,7 @@ void MotionMaster::MoveJumpTo(float angle, float speedXY, float speedZ) void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id, Unit const* target) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Unit (GUID: %u) jump to point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); #endif @@ -523,10 +530,11 @@ void MotionMaster::MoveFall(uint32 id /*=0*/, bool addFlagForNPC) float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE); if (tz <= INVALID_HEIGHT) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).", _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ()); -#endif return; +#endif + return; } // Abort too if the ground is very near @@ -566,17 +574,18 @@ void MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id, if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetGUIDLow(), x, y, z); #endif Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); -#endif Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); +#endif + Mutate(new PointMovementGenerator(id, x, y, z, speed, path, generatePath, generatePath), MOTION_SLOT_CONTROLLED); } } @@ -592,10 +601,11 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", _owner->GetEntry(), _owner->GetGUIDLow(), x, y, z); -#endif _owner->AttackStop(); +#endif + _owner->AttackStop(); _owner->CastStop(0, false); _owner->ToCreature()->SetReactState(REACT_PASSIVE); Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE); @@ -614,10 +624,11 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", _owner->GetEntry(), _owner->GetGUIDLow(), time); -#endif Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); +#endif + Mutate(new AssistanceDistractMovementGenerator(time), MOTION_SLOT_ACTIVE); } } @@ -632,21 +643,23 @@ void MotionMaster::MoveFleeing(Unit* enemy, uint32 time) if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) flee from %s (GUID: %u)", _owner->GetGUIDLow(), enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow()); -#endif Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); +#endif + Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s", _owner->GetEntry(), _owner->GetGUIDLow(), enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUIDLow() : enemy->ToCreature()->GetDBTableGUIDLow(), time ? " for a limited time" : ""); -#endif if (time) +#endif + if (time) Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time), MOTION_SLOT_CONTROLLED); else Mutate(new FleeingMovementGenerator(enemy->GetGUID()), MOTION_SLOT_CONTROLLED); @@ -659,7 +672,7 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode) { if (path < sTaxiPathNodesByPath.size()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("%s taxi to (Path %u node %u)", _owner->GetName().c_str(), path, pathnode); #endif FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(pathnode); @@ -690,13 +703,13 @@ void MotionMaster::MoveDistract(uint32 timer) /*if (_owner->GetTypeId() == TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Player (GUID: %u) distracted (timer: %u)", _owner->GetGUIDLow(), timer); #endif } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Creature (Entry: %u GUID: %u) (timer: %u)", #endif _owner->GetEntry(), _owner->GetGUIDLow(), timer); @@ -760,11 +773,12 @@ void MotionMaster::MovePath(uint32 path_id, bool repeatable) //Mutate(new WaypointMovementGenerator(path_id, repeatable)): Mutate(new WaypointMovementGenerator(path_id, repeatable), MOTION_SLOT_IDLE); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("%s (GUID: %u) start moving over path(Id:%u, repeatable: %s)", _owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature", _owner->GetGUIDLow(), path_id, repeatable ? "YES" : "NO"); -#endif} +#endif +} void MotionMaster::MoveRotate(uint32 time, RotateDirection direction) { diff --git a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index ffa91d291..a3fcfb64d 100644 --- a/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -68,7 +68,7 @@ void WaypointMovementGenerator::OnArrived(Creature* creature) if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for " UI64FMTD ".", i_path->at(i_currentNode)->event_id, i_currentNode, creature->GetGUID()); #endif creature->ClearUnitState(UNIT_STATE_ROAMING_MOVE); @@ -441,7 +441,7 @@ void FlightPathMovementGenerator::DoEventIfAny(Player* player, TaxiPathNodeEntry { if (uint32 eventid = departure ? node->departureEventID : node->arrivalEventID) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Taxi %s event %u of node %u of path %u for player %s", departure ? "departure" : "arrival", eventid, node->index, node->path, player->GetName().c_str()); #endif player->GetMap()->ScriptsStart(sEventScripts, eventid, player, player); @@ -479,13 +479,13 @@ void FlightPathMovementGenerator::PreloadEndGrid() // Load the grid if (endMap) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path->size()-1)); -#endi +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDetail("Preloading rid (%f, %f) for map %u at node index %u/%u", _endGridX, _endGridY, _endMapId, _preloadTargetNode, (uint32)(i_path.size()-1)); +#endif endMap->LoadGrid(_endGridX, _endGridY); } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Unable to determine map to preload flightmaster grid"); #endif } diff --git a/src/game/OutdoorPvP/OutdoorPvP.cpp b/src/game/OutdoorPvP/OutdoorPvP.cpp index 892bf33c3..b2a150265 100644 --- a/src/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP/OutdoorPvP.cpp @@ -105,7 +105,7 @@ bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 map, float bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Creating capture point %u", entry); #endif @@ -134,7 +134,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) { if (!m_Creatures[type]) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted", type); #endif return false; @@ -147,7 +147,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) m_Creatures[type] = 0; return false; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u", type); #endif uint32 guid = cr->GetDBTableGUIDLow(); @@ -247,7 +247,7 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player* player, uint32 /*zone*/) if (!player->GetSession()->PlayerLogout()) SendRemoveWorldStates(player); m_players[player->GetTeamId()].erase(player->GetGUID()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %s left an outdoorpvp zone", player->GetName().c_str()); #endif } diff --git a/src/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/game/OutdoorPvP/OutdoorPvPMgr.cpp index f2260c76c..315c5055f 100644 --- a/src/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -116,7 +116,7 @@ void OutdoorPvPMgr::HandlePlayerEnterZone(Player* player, uint32 zoneid) return; itr->second->HandlePlayerEnterZone(player, zoneid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u entered outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); #endif } @@ -134,7 +134,7 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player* player, uint32 zoneid) return; itr->second->HandlePlayerLeaveZone(player, zoneid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u", player->GetGUIDLow(), itr->second->GetTypeId()); #endif } diff --git a/src/game/Pools/PoolMgr.cpp b/src/game/Pools/PoolMgr.cpp index 5ebb8c112..2d2277785 100644 --- a/src/game/Pools/PoolMgr.cpp +++ b/src/game/Pools/PoolMgr.cpp @@ -409,7 +409,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) PooledQuestRelationBoundsNC qr = sPoolMgr->mQuestCreatureRelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to creature %u", itr->first, itr->second); #endif questMap->insert(QuestRelations::value_type(itr->second, itr->first)); @@ -420,7 +420,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) qr = sPoolMgr->mQuestGORelation.equal_range(obj->guid); for (PooledQuestRelation::iterator itr = qr.first; itr != qr.second; ++itr) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Adding quest %u to GO %u", itr->first, itr->second); #endif questMap->insert(QuestRelations::value_type(itr->second, itr->first)); @@ -430,7 +430,7 @@ void PoolGroup::Spawn1Object(PoolObject* obj) template <> void PoolGroup::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32 triggerFrom) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_POOLSYS, "PoolGroup: Spawning pool %u", poolId); #endif // load state from db diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index 64f555415..9619abcfb 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -168,7 +168,7 @@ void WorldSession::SendPacket(WorldPacket const* packet) if (!m_Socket) return; -#ifdef TRINITY_DEBUG +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) && defined(TRINITY_DEBUG) // Code for network use statistic static uint64 sendPacketCount = 0; static uint64 sendPacketBytes = 0; @@ -193,12 +193,10 @@ void WorldSession::SendPacket(WorldPacket const* packet) { uint64 minTime = uint64(cur_time - lastTime); uint64 fullTime = uint64(lastTime - firstTime); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime)); -#endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS + sLog->outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime); -#endif lastTime = cur_time; sendLastPacketCount = 1; @@ -547,7 +545,7 @@ void WorldSession::LogoutPlayer(bool save) //! Client will respond by sending 3x CMSG_CANCEL_TRADE, which we currently dont handle WorldPacket data(SMSG_LOGOUT_COMPLETE, 0); SendPacket(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "SESSION: Sent SMSG_LOGOUT_COMPLETE Message"); #endif @@ -975,7 +973,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) addonInfo >> enabled >> crc >> unk1; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("ADDON: Name: %s, Enabled: 0x%x, CRC: 0x%x, Unknown2: 0x%x", addonName.c_str(), enabled, crc, unk1); #endif @@ -989,12 +987,11 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) if (addon.CRC != savedAddon->CRC) match = false; + +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) if (!match) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("ADDON: %s was known, but didn't match known CRC (0x%x)!", addon.Name.c_str(), savedAddon->CRC); -#endif else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDetail("ADDON: %s was known, CRC is correct (0x%x)", addon.Name.c_str(), savedAddon->CRC); #endif } @@ -1002,7 +999,7 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) { AddonMgr::SaveAddon(addon); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("ADDON: %s (0x%x) was not known, saving...", addon.Name.c_str(), addon.CRC); #endif } @@ -1013,12 +1010,12 @@ void WorldSession::ReadAddonsInfo(WorldPacket &data) uint32 currentTime; addonInfo >> currentTime; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "ADDON: CurrentTime: %u", currentTime); #endif - //if (addonInfo.rpos() != addonInfo.size()) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + if (addonInfo.rpos() != addonInfo.size()) sLog->outDebug(LOG_FILTER_NETWORKIO, "packet under-read!"); #endif } @@ -1062,7 +1059,7 @@ void WorldSession::SendAddonsInfo() data << uint8(usepk); if (usepk) // if CRC is wrong, add public key (client need it) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("ADDON: CRC (0x%x) for addon %s is wrong (does not match expected 0x%x), sending pubkey", itr->CRC, itr->Name.c_str(), STANDARD_ADDON_CRC); #endif data.append(addonPublicKey, sizeof(addonPublicKey)); diff --git a/src/game/Server/WorldSocket.cpp b/src/game/Server/WorldSocket.cpp index 928f8b5b5..f0ebcb90e 100644 --- a/src/game/Server/WorldSocket.cpp +++ b/src/game/Server/WorldSocket.cpp @@ -282,7 +282,7 @@ int WorldSocket::handle_input (ACE_HANDLE) return Update(); // interesting line, isn't it ? } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); #endif @@ -291,7 +291,7 @@ int WorldSocket::handle_input (ACE_HANDLE) } case 0: { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WorldSocket::handle_input: Peer has closed connection"); #endif @@ -756,7 +756,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) recvPacket >> unk4; recvPacket.read(digest, 20); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("WorldSocket::HandleAuthSession: client %u, unk2 %u, account %s, unk3 %u, clientseed %u", BuiltNumberClient, unk2, account.c_str(), unk3, clientSeed); #endif // Get the account information from the realmd database @@ -878,7 +878,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // Check locked state for server AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security)); #endif if (AccountTypes(security) < allowedAccountType) @@ -888,7 +888,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) SendPacket(packet); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("WorldSocket::HandleAuthSession: User tries to login but his security level is not enough"); #endif return -1; @@ -918,7 +918,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) return -1; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("WorldSocket::HandleAuthSession: Client '%s' authenticated successfully from %s.", account.c_str(), address.c_str()); diff --git a/src/game/Server/WorldSocketMgr.cpp b/src/game/Server/WorldSocketMgr.cpp index 317d89295..89367ee4a 100644 --- a/src/game/Server/WorldSocketMgr.cpp +++ b/src/game/Server/WorldSocketMgr.cpp @@ -143,7 +143,7 @@ class ReactorRunnable : protected ACE_Task_Base virtual int svc() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("Network Thread Starting"); #endif @@ -182,7 +182,7 @@ class ReactorRunnable : protected ACE_Task_Base } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug ("Network Thread exits"); #endif diff --git a/src/game/Spells/Auras/SpellAuraEffects.cpp b/src/game/Spells/Auras/SpellAuraEffects.cpp index 070b15574..2ca4559db 100644 --- a/src/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/game/Spells/Auras/SpellAuraEffects.cpp @@ -5991,7 +5991,7 @@ void AuraEffect::HandlePeriodicTriggerSpellAuraTick(Unit* target, Unit* caster) triggerFlags = TriggerCastFlags(TRIGGERED_FULL_MASK&~TRIGGERED_IGNORE_POWER_AND_REAGENT_COST); triggerCaster->CastSpell(targets, triggeredSpellInfo, NULL, triggerFlags, NULL, this); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); #endif } @@ -6017,13 +6017,13 @@ void AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick(Unit* target, Unit* values.AddSpellMod(SPELLVALUE_BASE_POINT0, GetAmount()); triggerCaster->CastSpell(targets, triggeredSpellInfo, &values, TRIGGERED_FULL_MASK, NULL, this); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id); #endif } } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandlePeriodicTriggerSpellWithValueAuraTick: Spell %u has non-existent spell %u in EffectTriggered[%d] and is therefor not triggered.", GetId(), triggerSpellId, GetEffIndex()); #endif } @@ -6138,7 +6138,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const Unit::CalcAbsorbResist(caster, target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); #endif @@ -6234,7 +6234,7 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c if (target->GetHealth() < damage) damage = target->GetHealth(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); #endif @@ -6279,7 +6279,7 @@ void AuraEffect::HandlePeriodicHealthFunnelAuraTick(Unit* target, Unit* caster) return; caster->ModifyHealth(-(int32)damage); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "PeriodicTick: donator %u target %u damage %u.", caster->GetEntry(), target->GetEntry(), damage); #endif @@ -6382,7 +6382,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const if (crit = roll_chance_f(GetCritChance())) damage = Unit::SpellCriticalHealingBonus(caster, GetSpellInfo(), damage, target); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId()); #endif @@ -6462,7 +6462,7 @@ void AuraEffect::HandlePeriodicManaLeechAuraTick(Unit* target, Unit* caster) con drainAmount = maxmana; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PeriodicTick: %u (TypeId: %u) power leech of %u (TypeId: %u) for %u dmg inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), drainAmount, GetId()); #endif @@ -6529,7 +6529,7 @@ void AuraEffect::HandleObsModPowerAuraTick(Unit* target, Unit* caster) const // ignore negative values (can be result apply spellmods to aura damage uint32 amount = std::max(m_amount, 0) * target->GetMaxPower(powerType) /100; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); #endif @@ -6568,7 +6568,7 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false); target->SendPeriodicAuraLog(&pInfo); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); #endif @@ -6631,13 +6631,13 @@ void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEve uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellAuraProc: Triggering spell %u from aura %u proc", triggeredSpellInfo->Id, GetId()); #endif triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this); } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); #endif } @@ -6651,13 +6651,13 @@ void AuraEffect::HandleProcTriggerSpellWithValueAuraProc(AuraApplication* aurApp if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) { int32 basepoints0 = GetAmount(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Triggering spell %u with value %d from aura %u proc", triggeredSpellInfo->Id, basepoints0, GetId()); #endif triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, NULL, NULL, true, NULL, this); } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"AuraEffect::HandleProcTriggerSpellWithValueAuraProc: Could not trigger spell %u from aura %u proc, because the spell does not have an entry in Spell.dbc.", triggerSpellId, GetId()); #endif } @@ -6672,7 +6672,7 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv target->CalculateSpellDamageTaken(&damageInfo, damage, GetSpellInfo()); Unit::DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); target->SendSpellNonMeleeDamageLog(&damageInfo); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleProcTriggerDamageAuraProc: Triggering %u spell damage from aura %u proc", damage, GetId()); #endif target->DealSpellDamage(&damageInfo, true); @@ -6696,7 +6696,7 @@ void AuraEffect::HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcE triggerSpellId = 43594; break; default: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeAuraProc: received not handled spell: %u", GetId()); #endif return; @@ -6724,7 +6724,7 @@ void AuraEffect::HandleRaidProcFromChargeAuraProc(AuraApplication* aurApp, ProcE } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); #endif target->CastSpell(target, triggerSpellId, true, NULL, this, GetCasterGUID()); @@ -6738,7 +6738,7 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA // Currently only Prayer of Mending if (!(GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && GetSpellInfo()->SpellFamilyFlags[1] & 0x20)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: received not handled spell: %u", GetId()); #endif return; @@ -6769,7 +6769,7 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA } } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "AuraEffect::HandleRaidProcFromChargeWithValueAuraProc: Triggering spell %u from aura %u proc", triggerSpellId, GetId()); #endif target->CastCustomSpell(target, triggerSpellId, &value, NULL, NULL, true, NULL, this, GetCasterGUID()); diff --git a/src/game/Spells/Auras/SpellAuras.cpp b/src/game/Spells/Auras/SpellAuras.cpp index 1d3c145d0..d63ea0451 100644 --- a/src/game/Spells/Auras/SpellAuras.cpp +++ b/src/game/Spells/Auras/SpellAuras.cpp @@ -62,12 +62,12 @@ _flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false), _disable _slot = slot; GetTarget()->SetVisibleAura(slot, this); SetNeedClientUpdate(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d put to unit visible auras slot: %u", GetBase()->GetId(), GetEffectMask(), slot); #endif } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura: %u Effect: %d could not find empty unit visible slot", GetBase()->GetId(), GetEffectMask()); #endif } @@ -148,7 +148,7 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) ASSERT(aurEff); ASSERT(HasEffect(effIndex) == (!apply)); ASSERT((1<outDebug(LOG_FILTER_SPELLS_AURAS, "AuraApplication::_HandleEffect: %u, apply: %u: amount: %u", aurEff->GetAuraType(), apply, aurEff->GetAmount()); #endif @@ -2178,7 +2178,7 @@ void Aura::LoadScripts() m_loadedScripts.erase(bitr); continue; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); #endif (*itr)->Register(); diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index 226500785..01f08b88e 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -959,7 +959,7 @@ void Spell::SelectEffectImplicitTargets(SpellEffIndex effIndex, SpellImplicitTar } break; case TARGET_SELECT_CATEGORY_NYI: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: target type %u, found in spellID %u, effect %u is not implemented yet!", m_spellInfo->Id, effIndex, targetType.GetTarget()); #endif break; @@ -991,7 +991,7 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa AddUnitTarget(target->ToUnit(), 1 << effIndex); } else -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); #endif break; @@ -1006,7 +1006,7 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa m_targets.SetDst(*target); } else //if (!m_targets.HasDst()) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: cannot find channel spell destination for spell ID %u, effect %u", m_spellInfo->Id, effIndex); #endif break; @@ -1054,7 +1054,7 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar // handle emergency case - try to use other provided targets if no conditions provided if (targetType.GetCheckType() == TARGET_CHECK_ENTRY && (!condList || condList->empty())) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: no conditions entry for target with TARGET_CHECK_ENTRY of spell ID %u, effect %u - selecting default targets", m_spellInfo->Id, effIndex); #endif switch (targetType.GetObjectType()) @@ -1083,7 +1083,7 @@ void Spell::SelectImplicitNearbyTargets(SpellEffIndex effIndex, SpellImplicitTar WorldObject* target = SearchNearbyTarget(range, targetType.GetObjectType(), targetType.GetCheckType(), condList); if (!target) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::SelectImplicitNearbyTargets: cannot find nearby target for spell ID %u, effect %u", m_spellInfo->Id, effIndex); #endif return; @@ -1288,7 +1288,7 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SPELL: unknown target coordinates for spell ID %u", m_spellInfo->Id); #endif if (WorldObject* target = m_targets.GetObjectTarget()) @@ -3109,7 +3109,7 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask) if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance)) { m_caster->CastSpell(unit, i->triggeredSpell, true); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %d triggered spell %d by SPELL_AURA_ADD_TARGET_TRIGGER aura", m_spellInfo->Id, i->triggeredSpell->Id); #endif @@ -3411,7 +3411,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // set timer base at cast time ReSetTimer(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::prepare: spell id %u source %u caster %d customCastFlags %u mask %u", m_spellInfo->Id, m_caster->GetEntry(), m_originalCaster ? m_originalCaster->GetEntry() : -1, _triggeredCastFlags, m_targets.GetTargetMask()); #endif @@ -4006,7 +4006,7 @@ void Spell::update(uint32 difftime) if (m_targets.GetUnitTargetGUID() && !m_targets.GetUnitTarget()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u is cancelled due to removal of target.", m_spellInfo->Id); #endif cancel(); @@ -4066,7 +4066,7 @@ void Spell::update(uint32 difftime) // Xinef: so the aura can be removed in different updates for all units else if ((m_timer < 0 || m_timer > 300) && !UpdateChanneledTargetList()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); #endif SendChannelUpdate(0); @@ -4132,7 +4132,7 @@ void Spell::finish(bool ok) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell); if (spellInfo && spellInfo->SpellIconID == 2056) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Statue %d is unsummoned in spell %d finish", m_caster->GetGUIDLow(), m_spellInfo->Id); #endif m_caster->setDeathState(JUST_DIED); @@ -5170,7 +5170,7 @@ void Spell::HandleThreatSpells() else if (!m_spellInfo->_IsPositiveSpell() && !IsFriendly && target->CanHaveThreatList()) target->AddThreat(m_caster, threatToAdd, m_spellInfo->GetSchoolMask(), m_spellInfo); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); #endif } @@ -5185,7 +5185,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT uint8 eff = m_spellInfo->Effects[i].Effect; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: %u Effect : %u", m_spellInfo->Id, eff); #endif @@ -7187,7 +7187,7 @@ void Spell::Delayed() // only called in DealDamage() else m_timer += delaytime; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Spell %u partially interrupted for (%d) ms at damage", m_spellInfo->Id, delaytime); #endif @@ -7227,7 +7227,7 @@ void Spell::DelayedChannel() else m_timer -= delaytime; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell %u partially interrupted for %i ms, new duration: %u ms", m_spellInfo->Id, delaytime, m_timer); #endif @@ -7886,7 +7886,7 @@ void Spell::LoadScripts() m_loadedScripts.erase(bitr); continue; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::LoadScripts: Script `%s` for spell `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id); #endif (*itr)->Register(); diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 3136acb94..a6e97b712 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -229,7 +229,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= void Spell::EffectNULL(SpellEffIndex /*effIndex*/) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Spell Effect DUMMY"); #endif } @@ -769,7 +769,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } // normal DB scripted effect -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectDummy(%u)", m_spellInfo->Id, effIndex); #endif m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); @@ -905,7 +905,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); #endif return; @@ -963,7 +963,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(triggered_spell_id); if (!spellInfo) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTriggerMissileSpell spell %u tried to trigger unknown spell %u", m_spellInfo->Id, triggered_spell_id); #endif return; @@ -1188,7 +1188,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) destTarget->GetPosition(x, y, z, orientation); if (!orientation && m_targets.GetUnitTarget()) orientation = m_targets.GetUnitTarget()->GetOrientation(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation); #endif @@ -1343,7 +1343,7 @@ void Spell::EffectUnlearnSpecialization(SpellEffIndex effIndex) uint32 spellToUnlearn = m_spellInfo->Effects[effIndex].TriggerSpell; player->removeSpell(spellToUnlearn, SPEC_MASK_ALL, false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has unlearned spell %u from NpcGUID: %u", player->GetGUIDLow(), spellToUnlearn, m_caster->GetGUIDLow()); #endif } @@ -1417,7 +1417,7 @@ void Spell::EffectSendEvent(SpellEffIndex effIndex) // TODO: there should be a possibility to pass dest target to event script } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->Effects[effIndex].MiscValue, m_spellInfo->Id); #endif @@ -1624,7 +1624,7 @@ void Spell::EffectHealthLeech(SpellEffIndex effIndex) damage = m_caster->SpellDamageBonusDone(unitTarget, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); damage = unitTarget->SpellDamageBonusTaken(m_caster, m_spellInfo, uint32(damage), SPELL_DIRECT_DAMAGE); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "HealthLeech :%i", damage); #endif @@ -1992,9 +1992,10 @@ void Spell::SendLoot(uint64 guid, LootType loottype) // Players shouldn't be able to loot gameobjects that are currently despawned if (!gameObjTarget->isSpawned() && !player->IsGameMaster()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outError("Possible hacking attempt: Player %s [guid: %u] tried to loot a gameobject [entry: %u id: %u] which is on respawn time without being in GM mode!", player->GetName().c_str(), player->GetGUIDLow(), gameObjTarget->GetEntry(), gameObjTarget->GetGUIDLow()); -#endif return; +#endif + return; } // special case, already has GossipHello inside so return and avoid calling twice if (gameObjTarget->GetGoType() == GAMEOBJECT_TYPE_GOOBER) @@ -2054,7 +2055,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) if (m_caster->GetTypeId() != TYPEID_PLAYER) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No Player Caster!"); #endif return; @@ -2114,7 +2115,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: Open Lock - No GameObject/Item Target!"); #endif return; @@ -2518,7 +2519,7 @@ void Spell::EffectLearnSpell(SpellEffIndex effIndex) uint32 spellToLearn = (m_spellInfo->Id == 483 || m_spellInfo->Id == 55884) ? damage : m_spellInfo->Effects[effIndex].TriggerSpell; player->learnSpell(spellToLearn); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell: Player %u has learned spell %u from NpcGUID=%u", player->GetGUIDLow(), spellToLearn, m_caster->GetGUIDLow()); #endif } @@ -2768,7 +2769,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) if (m_CastItem) { unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10, false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow()); #endif return; @@ -2779,7 +2780,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) { uint32 honor_reward = Trinity::Honor::hk_honor_at_level(unitTarget->getLevel(), float(damage)); unitTarget->ToPlayer()->RewardHonor(NULL, 1, honor_reward, false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (scale) to player: %u", m_spellInfo->Id, honor_reward, unitTarget->ToPlayer()->GetGUIDLow()); #endif } @@ -2787,7 +2788,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) { //maybe we have correct honor_gain in damage already unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage, false); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %u honor points (non scale) for player: %u", m_spellInfo->Id, damage, unitTarget->ToPlayer()->GetGUIDLow()); #endif } @@ -4128,7 +4129,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } // normal DB scripted effect -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell ScriptStart spellid %u in EffectScriptEffect(%u)", m_spellInfo->Id, effIndex); #endif m_caster->GetMap()->ScriptsStart(sSpellScripts, uint32(m_spellInfo->Id | (effIndex << 24)), m_caster, unitTarget); @@ -5410,7 +5411,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) ExecuteLogEffectSummonObject(effIndex, pGameObj); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("AddObject at SpellEfects.cpp EffectTransmitted"); #endif //m_caster->AddGameObject(pGameObj); @@ -5496,7 +5497,7 @@ void Spell::EffectSkill(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "WORLD: SkillEFFECT"); #endif } @@ -5529,7 +5530,7 @@ void Spell::EffectSkinPlayerCorpse(SpellEffIndex /*effIndex*/) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: SkinPlayerCorpse"); #endif if ((m_caster->GetTypeId() != TYPEID_PLAYER) || (unitTarget->GetTypeId() != TYPEID_PLAYER) || (unitTarget->IsAlive())) @@ -5543,7 +5544,7 @@ void Spell::EffectStealBeneficialBuff(SpellEffIndex effIndex) if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET) return; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Effect: StealBeneficialBuff"); #endif @@ -6195,7 +6196,7 @@ void Spell::EffectBind(SpellEffIndex effIndex) data << uint32(areaId); player->SendDirectMessage(&data); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "EffectBind: New homebind X: %f, Y: %f, Z: %f, MapId: %u, AreaId: %u", homeLoc.GetPositionX(), homeLoc.GetPositionY(), homeLoc.GetPositionZ(), homeLoc.GetMapId(), areaId); #endif diff --git a/src/game/Spells/SpellInfo.cpp b/src/game/Spells/SpellInfo.cpp index 0dca3e572..c61e9463b 100644 --- a/src/game/Spells/SpellInfo.cpp +++ b/src/game/Spells/SpellInfo.cpp @@ -2365,7 +2365,7 @@ int32 SpellInfo::CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask, S break; case POWER_RUNE: case POWER_RUNIC_POWER: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "CalculateManaCost: Not implemented yet!"); #endif break; diff --git a/src/game/Spells/SpellMgr.cpp b/src/game/Spells/SpellMgr.cpp index 6e0dafc7f..26e669351 100644 --- a/src/game/Spells/SpellMgr.cpp +++ b/src/game/Spells/SpellMgr.cpp @@ -490,7 +490,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con SpellDifficultyEntry const* difficultyEntry = sSpellDifficultyStore.LookupEntry(difficultyId); if (!difficultyEntry) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: SpellDifficultyEntry not found for spell %u. This should never happen.", spellId); #endif return spellId; //return source spell @@ -498,7 +498,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con if (difficultyEntry->SpellID[mode] <= 0 && mode > DUNGEON_DIFFICULTY_HEROIC) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: spell %u mode %u spell is NULL, using mode %u", spellId, mode, mode - 2); #endif mode -= 2; @@ -510,7 +510,7 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con return spellId; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellIdForDifficulty: spellid for spell %u in mode %u is %d", spellId, mode, difficultyEntry->SpellID[mode]); #endif return uint32(difficultyEntry->SpellID[mode]); @@ -522,13 +522,13 @@ SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell SpellInfo const* newSpell = GetSpellInfo(newSpellId); if (!newSpell) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellForDifficultyFromSpell: spell %u not found. Check spelldifficulty_dbc!", newSpellId); #endif return spell; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellMgr::GetSpellForDifficultyFromSpell: Spell id for instance mode is %u (original %u)", newSpell->Id, spell->Id); #endif return newSpell; @@ -1556,7 +1556,7 @@ void SpellMgr::LoadSpellTargetPositions() if (found) { if (!sSpellMgr->GetSpellTargetPosition(i)) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Spell (ID: %u) does not have record in `spell_target_position`", i); #endif } diff --git a/src/game/Texts/CreatureTextMgr.cpp b/src/game/Texts/CreatureTextMgr.cpp index c1f475f35..f9d792228 100644 --- a/src/game/Texts/CreatureTextMgr.cpp +++ b/src/game/Texts/CreatureTextMgr.cpp @@ -429,7 +429,7 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextMap::const_iterator sList = mTextMap.find(sourceEntry); if (sList == mTextMap.end()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find Text for Creature (entry %u) in 'creature_text' table.", sourceEntry); #endif return false; @@ -439,7 +439,7 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextHolder::const_iterator itr = textHolder.find(textGroup); if (itr == textHolder.end()) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry); #endif return false; diff --git a/src/game/Warden/Warden.cpp b/src/game/Warden/Warden.cpp index 0676b03c2..5771a8a22 100644 --- a/src/game/Warden/Warden.cpp +++ b/src/game/Warden/Warden.cpp @@ -36,7 +36,7 @@ Warden::~Warden() void Warden::SendModuleToClient() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Send module to client"); #endif @@ -64,7 +64,7 @@ void Warden::SendModuleToClient() void Warden::RequestModule() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request module"); #endif @@ -129,14 +129,14 @@ bool Warden::IsValidCheckSum(uint32 checksum, const uint8* data, const uint16 le if (checksum != newChecksum) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS NOT VALID"); #endif return false; } else { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM IS VALID"); #endif return true; @@ -245,7 +245,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->DecryptData(recvData.contents(), recvData.size()); uint8 opcode; recvData >> opcode; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Got packet, opcode %02X, size %u", opcode, uint32(recvData.size())); #endif recvData.hexlike(); @@ -262,7 +262,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->HandleData(recvData); break; case WARDEN_CMSG_MEM_CHECKS_RESULT: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MEM_CHECKS_RESULT received!"); #endif break; @@ -271,12 +271,12 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recvData) _warden->InitializeModule(); break; case WARDEN_CMSG_MODULE_FAILED: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "NYI WARDEN_CMSG_MODULE_FAILED received!"); #endif break; default: -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Got unknown warden opcode %02X of size %u.", opcode, uint32(recvData.size() - 1)); #endif break; diff --git a/src/game/Warden/WardenMac.cpp b/src/game/Warden/WardenMac.cpp index a733ce38d..e2c97f6d6 100644 --- a/src/game/Warden/WardenMac.cpp +++ b/src/game/Warden/WardenMac.cpp @@ -46,28 +46,28 @@ void WardenMac::Init(WorldSession *pClient, BigNumber *K) _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", pClient->GetAccountId()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); #endif _module = GetModuleForClient(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); #endif RequestModule(); @@ -96,14 +96,14 @@ ClientWardenModule* WardenMac::GetModuleForClient() void WardenMac::InitializeModule() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); #endif } void WardenMac::RequestHash() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); #endif @@ -173,14 +173,14 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, sha1.GetDigest(), 20) != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); #endif Penalty(); return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); #endif @@ -204,7 +204,7 @@ void WardenMac::HandleHashResult(ByteBuffer &buff) void WardenMac::RequestData() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); #endif @@ -230,7 +230,7 @@ void WardenMac::RequestData() void WardenMac::HandleData(ByteBuffer &buff) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); #endif @@ -265,7 +265,7 @@ void WardenMac::HandleData(ByteBuffer &buff) if (memcmp(sha1Hash, sha1.GetDigest(), 20)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: SHA1 hash is wrong!"); #endif //found = true; @@ -282,7 +282,7 @@ void WardenMac::HandleData(ByteBuffer &buff) if (memcmp(ourMD5Hash, theirsMD5Hash, 16)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Handle data failed: MD5 hash is wrong!"); #endif //found = true; diff --git a/src/game/Warden/WardenWin.cpp b/src/game/Warden/WardenWin.cpp index 288804272..0d8037e93 100644 --- a/src/game/Warden/WardenWin.cpp +++ b/src/game/Warden/WardenWin.cpp @@ -53,28 +53,28 @@ void WardenWin::Init(WorldSession* session, BigNumber *k) _inputCrypto.Init(_inputKey); _outputCrypto.Init(_outputKey); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Server side warden for client %u initializing...", session->GetAccountId()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "C->S Key: %s", ByteArrayToHexStr(_inputKey, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "S->C Key: %s", ByteArrayToHexStr(_outputKey, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, " Seed: %s", ByteArrayToHexStr(_seed, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Loading Module..."); #endif _module = GetModuleForClient(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Module Key: %s", ByteArrayToHexStr(_module->Key, 16).c_str()); #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Module ID: %s", ByteArrayToHexStr(_module->Id, 16).c_str()); #endif RequestModule(); @@ -103,7 +103,7 @@ ClientWardenModule* WardenWin::GetModuleForClient() void WardenWin::InitializeModule() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Initialize module"); #endif @@ -149,7 +149,7 @@ void WardenWin::InitializeModule() void WardenWin::RequestHash() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash"); #endif @@ -173,14 +173,14 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) // Verify key if (memcmp(buff.contents() + 1, Module.ClientKeySeedHash, 20) != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: failed"); #endif Penalty(); return; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request hash reply: succeed"); #endif @@ -198,7 +198,7 @@ void WardenWin::HandleHashResult(ByteBuffer &buff) void WardenWin::RequestData() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Request data"); #endif @@ -350,14 +350,14 @@ void WardenWin::RequestData() for (std::list::iterator itr = _currentChecks.begin(); itr != _currentChecks.end(); ++itr) stream << *itr << " "; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "%s", stream.str().c_str()); #endif } void WardenWin::HandleData(ByteBuffer &buff) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Handle data"); #endif @@ -372,7 +372,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (!IsValidCheckSum(Checksum, buff.contents() + buff.rpos(), Length)) { buff.rpos(buff.wpos()); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "CHECKSUM FAIL"); #endif Penalty(); @@ -386,7 +386,7 @@ void WardenWin::HandleData(ByteBuffer &buff) // TODO: test it. if (result == 0x00) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "TIMING CHECK FAIL result 0x00"); #endif Penalty(); @@ -399,16 +399,16 @@ void WardenWin::HandleData(ByteBuffer &buff) uint32 ticksNow = World::GetGameTimeMS(); uint32 ourTicks = newClientTicks + (ticksNow - _serverTicks); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "ServerTicks %u", ticksNow); // Now #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RequestTicks %u", _serverTicks); // At request #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Ticks %u", newClientTicks); // At response #endif -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Ticks diff %u", ourTicks - newClientTicks); #endif } @@ -435,7 +435,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (Mem_Result != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK not 0x00, CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif checkFailed = *itr; @@ -444,7 +444,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (memcmp(buff.contents() + buff.rpos(), rs->Result.AsByteArray(0, false).get(), rd->Length) != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK fail CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif checkFailed = *itr; @@ -453,7 +453,7 @@ void WardenWin::HandleData(ByteBuffer &buff) } buff.rpos(buff.rpos() + rd->Length); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MEM_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif break; @@ -466,17 +466,15 @@ void WardenWin::HandleData(ByteBuffer &buff) const uint8 byte = 0xE9; if (memcmp(buff.contents() + buff.rpos(), &byte, sizeof(uint8)) != 0) { - /*if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); -#endif + if (type == MODULE_CHECK) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); -#endif + if (type == DRIVER_CHECK) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId());*/ + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif checkFailed = *itr; buff.rpos(buff.rpos() + 1); @@ -484,17 +482,14 @@ void WardenWin::HandleData(ByteBuffer &buff) } buff.rpos(buff.rpos() + 1); - /*if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); -#endif - else if (type == MODULE_CHECK) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); -#endif - else if (type == DRIVER_CHECK) -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId());*/ + +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + if (type == PAGE_CHECK_A || type == PAGE_CHECK_B) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT PAGE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); + else if (type == MODULE_CHECK) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MODULE_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); + else if (type == DRIVER_CHECK) + sLog->outDebug(LOG_FILTER_WARDEN, "RESULT DRIVER_CHECK passed CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif break; } @@ -505,7 +500,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (Lua_Result != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif checkFailed = *itr; @@ -520,13 +515,13 @@ void WardenWin::HandleData(ByteBuffer &buff) char *str = new char[luaStrLen + 1]; memcpy(str, buff.contents() + buff.rpos(), luaStrLen); str[luaStrLen] = '\0'; // null terminator -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "Lua string: %s", str); #endif delete[] str; } buff.rpos(buff.rpos() + luaStrLen); // Skip string -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT LUA_STR_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif break; @@ -538,7 +533,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (Mpq_Result != 0) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK not 0x00 account id %u", _session->GetAccountId()); #endif checkFailed = *itr; @@ -547,7 +542,7 @@ void WardenWin::HandleData(ByteBuffer &buff) if (memcmp(buff.contents() + buff.rpos(), rs->Result.AsByteArray(0, false).get(), 20) != 0) // SHA1 { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK fail, CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif checkFailed = *itr; @@ -556,7 +551,7 @@ void WardenWin::HandleData(ByteBuffer &buff) } buff.rpos(buff.rpos() + 20); // 20 bytes SHA1 -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_WARDEN, "RESULT MPQ_CHECK passed, CheckId %u account Id %u", *itr, _session->GetAccountId()); #endif break; diff --git a/src/game/Weather/Weather.cpp b/src/game/Weather/Weather.cpp index d8f945a91..af5101593 100644 --- a/src/game/Weather/Weather.cpp +++ b/src/game/Weather/Weather.cpp @@ -26,7 +26,7 @@ Weather::Weather(uint32 zone, WeatherData const* weatherChances) m_type = WEATHER_TYPE_FINE; m_grade = 0; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS))); #endif } @@ -89,7 +89,7 @@ bool Weather::ReGenerate() static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" }; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Generating a change in %s weather for zone %u.", seasonName[season], m_zone); #endif @@ -256,7 +256,7 @@ bool Weather::UpdateWeather() wthstr = "fine"; break; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Change the weather of zone %u to %s.", m_zone, wthstr); #endif sScriptMgr->OnWeatherChange(this, state, m_grade); diff --git a/src/game/World/World.cpp b/src/game/World/World.cpp index 204056ba5..684f9af76 100644 --- a/src/game/World/World.cpp +++ b/src/game/World/World.cpp @@ -2097,7 +2097,7 @@ void World::Update(uint32 diff) if (m_timers[WUPDATE_PINGDB].Passed()) { m_timers[WUPDATE_PINGDB].Reset(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Ping MySQL to keep connection alive"); #endif CharacterDatabase.KeepAlive(); @@ -2569,7 +2569,7 @@ void World::ShutdownMsg(bool show, Player* player) ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME; SendServerMessage(msgid, str.c_str(), player); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str()); #endif } @@ -2589,7 +2589,7 @@ void World::ShutdownCancel() m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value SendServerMessage(msgid); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); #endif @@ -2685,7 +2685,7 @@ void World::ProcessCliCommands() CliCommandHolder* command = NULL; while (cliCmdQueue.next(command)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("CLI command under processing..."); #endif zprint = command->m_print; @@ -2755,7 +2755,7 @@ void World::SendAutoBroadcast() sWorld->SendGlobalMessage(&data); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("AutoBroadcast: '%s'", msg.c_str()); #endif } @@ -2957,7 +2957,7 @@ void World::ResetEventSeasonalQuests(uint16 event_id) void World::ResetRandomBG() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail("Random BG status reset for all characters."); #endif diff --git a/src/scripts/Commands/cs_misc.cpp b/src/scripts/Commands/cs_misc.cpp index 715acec47..3ad187cac 100644 --- a/src/scripts/Commands/cs_misc.cpp +++ b/src/scripts/Commands/cs_misc.cpp @@ -1510,7 +1510,7 @@ public: if (!playerTarget) playerTarget = player; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail(handler->GetTrinityString(LANG_ADDITEM), itemId, count); #endif @@ -1599,7 +1599,7 @@ public: if (!playerTarget) playerTarget = player; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail(handler->GetTrinityString(LANG_ADDITEMSET), itemSetId); #endif diff --git a/src/scripts/Commands/cs_modify.cpp b/src/scripts/Commands/cs_modify.cpp index ee4d499c4..f1cdea983 100644 --- a/src/scripts/Commands/cs_modify.cpp +++ b/src/scripts/Commands/cs_modify.cpp @@ -190,7 +190,7 @@ public: target->SetMaxPower(POWER_ENERGY, energym); target->SetPower(POWER_ENERGY, energy); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDetail(handler->GetTrinityString(LANG_CURRENT_ENERGY), target->GetMaxPower(POWER_ENERGY)); #endif @@ -1018,8 +1018,8 @@ public: { int32 newmoney = int32(targetMoney) + moneyToAdd; -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_CHATSYS, handler->GetTrinityString(LANG_CURRENT_MONEY), targetMoney, moneyToAdd, newmoney); #endif if (newmoney <= 0) { @@ -1055,8 +1055,8 @@ public: target->ModifyMoney(moneyToAdd); } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS - sLog->outDebug(LOG_FILTER_GENERAL, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney()); +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) + sLog->outDebug(LOG_FILTER_CHATSYS, handler->GetTrinityString(LANG_NEW_MONEY), targetMoney, moneyToAdd, target->GetMoney()); #endif return true; diff --git a/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp b/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp index 0eedf609b..53757fdcc 100644 --- a/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp +++ b/src/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/instance_blackrock_depths.cpp @@ -206,7 +206,7 @@ public: void SetData64(uint32 type, uint64 data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data); #endif @@ -224,7 +224,7 @@ public: void SetData(uint32 type, uint32 data) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); #endif diff --git a/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 6548faecf..c707be074 100644 --- a/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -228,7 +228,7 @@ public: void PrepareEncounter() { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); #endif uint8 index = 0; diff --git a/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index 4b27e4c72..950fca072 100644 --- a/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -240,7 +240,7 @@ public: { AddEscortState(STATE_ESCORT_RETURNING); ReturnToLastPoint(); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI has left combat and is now returning to last point"); #endif } diff --git a/src/scripts/Outland/zone_netherstorm.cpp b/src/scripts/Outland/zone_netherstorm.cpp index 45574e3a3..55a402b2e 100644 --- a/src/scripts/Outland/zone_netherstorm.cpp +++ b/src/scripts/Outland/zone_netherstorm.cpp @@ -416,7 +416,7 @@ public: return true; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait."); #endif return false; diff --git a/src/scripts/World/npc_professions.cpp b/src/scripts/World/npc_professions.cpp index 28757c505..c088aae94 100644 --- a/src/scripts/World/npc_professions.cpp +++ b/src/scripts/World/npc_professions.cpp @@ -227,7 +227,7 @@ bool EquippedOk(Player* player, uint32 spellId) if (item && item->GetTemplate()->RequiredSpell == reqSpell) { //player has item equipped that require specialty. Not allow to unlearn, player has to unequip first -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: player attempt to unlearn spell %u, but item %u is equipped.", reqSpell, item->GetEntry()); #endif return false; diff --git a/src/worldserver/RemoteAccess/RARunnable.cpp b/src/worldserver/RemoteAccess/RARunnable.cpp index 220384b10..4099574a5 100644 --- a/src/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/worldserver/RemoteAccess/RARunnable.cpp @@ -69,7 +69,7 @@ void RARunnable::run() break; } -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outStaticDebug("Trinity RA thread exiting"); #endif } diff --git a/src/worldserver/TCSoap/TCSoap.cpp b/src/worldserver/TCSoap/TCSoap.cpp index c0a554a1d..6d2ce72d8 100644 --- a/src/worldserver/TCSoap/TCSoap.cpp +++ b/src/worldserver/TCSoap/TCSoap.cpp @@ -34,7 +34,7 @@ void TCSoapRunnable::run() if (!soap_valid_socket(soap_accept(&soap))) continue; // ran into an accept timeout -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF); #endif struct soap* thread_soap = soap_copy(&soap);// make a safe copy @@ -71,7 +71,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) // security check if (!soap->userid || !soap->passwd) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client didn't provide login information"); #endif return 401; @@ -80,7 +80,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) uint32 accountId = AccountMgr::GetId(soap->userid); if (!accountId) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: Client used invalid username '%s'", soap->userid); #endif return 401; @@ -88,7 +88,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) if (!AccountMgr::CheckPassword(accountId, soap->passwd)) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: invalid password for account '%s'", soap->userid); #endif return 401; @@ -96,7 +96,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR) { -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: %s's gmlevel is too low", soap->userid); #endif return 403; @@ -105,7 +105,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result) if (!command || !*command) return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string"); -#ifdef ENABLE_EXTRAS && ENABLE_EXTRA_LOGS +#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS) sLog->outDebug(LOG_FILTER_NETWORKIO, "TCSoap: got command '%s'", command); #endif SOAPCommand connection;