mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-11-10 21:04:26 +08:00
Merge branch 'master' into ovv/systemd-socket-activation
This commit is contained in:
commit
9dbaf9e03e
28
data/sql/updates/db_world/2025_08_06_04.sql
Normal file
28
data/sql/updates/db_world/2025_08_06_04.sql
Normal file
@ -0,0 +1,28 @@
|
||||
-- DB update 2025_08_06_03 -> 2025_08_06_04
|
||||
|
||||
-- Edit creature_text tables (Anok'ra, Sinrok, Tivax)
|
||||
DELETE FROM `creature_text` WHERE (`CreatureID` IN (26769, 26770, 26771));
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(26769, 0, 0, 'I gladly die for the master...', 12, 0, 100, 0, 0, 0, 25937, 0, ''),
|
||||
(26769, 0, 1, 'Your victory is meaningless.', 12, 0, 100, 0, 0, 0, 25938, 0, ''),
|
||||
(26769, 0, 3, 'Anub\'et\'kan will... end you.', 12, 0, 100, 0, 0, 0, 25936, 0, ''),
|
||||
(26769, 0, 4, 'I will rise again, more powerful... much... more...', 12, 0, 100, 0, 0, 0, 25939, 0, ''),
|
||||
(26770, 0, 0, 'I gladly die for the master...', 12, 0, 100, 0, 0, 0, 25937, 0, ''),
|
||||
(26770, 0, 1, 'Your victory is meaningless.', 12, 0, 100, 0, 0, 0, 25938, 0, ''),
|
||||
(26770, 0, 3, 'Anub\'et\'kan will... end you.', 12, 0, 100, 0, 0, 0, 25936, 0, ''),
|
||||
(26770, 0, 4, 'I will rise again, more powerful... much... more...', 12, 0, 100, 0, 0, 0, 25939, 0, ''),
|
||||
(26771, 0, 0, 'I gladly die for the master...', 12, 0, 100, 0, 0, 0, 25937, 0, ''),
|
||||
(26771, 0, 1, 'Your victory is meaningless.', 12, 0, 100, 0, 0, 0, 25938, 0, ''),
|
||||
(26771, 0, 3, 'Anub\'et\'kan will... end you.', 12, 0, 100, 0, 0, 0, 25936, 0, ''),
|
||||
(26771, 0, 4, 'I will rise again, more powerful... much... more...', 12, 0, 100, 0, 0, 0, 25939, 0, '');
|
||||
|
||||
-- Add dialogue lines on Death (Anok'ra, Sinrok, Tivax)
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE (`entry` IN (26769, 26770, 26771));
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 26769) AND (`source_type` = 0) AND (`id` IN (12));
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 26770) AND (`source_type` = 0) AND (`id` IN (11));
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 26771) AND (`source_type` = 0) AND (`id` IN (2));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(26769, 0, 12, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Anok\'ra the Manipulator - On Just Died - Say Line 0'),
|
||||
(26770, 0, 11, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Tivax the Breaker - On Just Died - Say Line 0'),
|
||||
(26771, 0, 2, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Sinok the Shadowrager - On Just Died - Say Line 0');
|
||||
6
data/sql/updates/db_world/2025_08_07_00.sql
Normal file
6
data/sql/updates/db_world/2025_08_07_00.sql
Normal file
@ -0,0 +1,6 @@
|
||||
-- DB update 2025_08_06_04 -> 2025_08_07_00
|
||||
|
||||
-- Init creature_template_addon (Wastes Scavenger)
|
||||
DELETE FROM `creature_template_addon` WHERE (`entry` = 28005);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
|
||||
(28005, 0, 0, 0, 0, 438, 0, '');
|
||||
11
data/sql/updates/db_world/2025_08_08_00.sql
Normal file
11
data/sql/updates/db_world/2025_08_08_00.sql
Normal file
@ -0,0 +1,11 @@
|
||||
-- DB update 2025_08_07_00 -> 2025_08_08_00
|
||||
|
||||
-- Edit SmartAI
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 26769;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 26769);
|
||||
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(26769, 0, 0, 0, 9, 0, 100, 0, 3500, 5000, 3500, 5000, 0, 30, 11, 13860, 64, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Anok\'ra the Manipulator - Within 0-30 Range - Cast \'Mind Blast\''),
|
||||
(26769, 0, 1, 0, 9, 0, 100, 0, 1500, 3000, 8000, 11000, 0, 20, 11, 16568, 64, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Anok\'ra the Manipulator - Within 0-20 Range - Cast \'Mind Flay\''),
|
||||
(26769, 0, 2, 0, 0, 0, 100, 0, 6000, 9000, 17000, 20000, 0, 0, 11, 51676, 1, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 'Anok\'ra the Manipulator - In Combat - Cast \'Wavering Will\''),
|
||||
(26769, 0, 3, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Anok\'ra the Manipulator - On Just Died - Say Line 0');
|
||||
383
data/sql/updates/db_world/2025_08_08_01.sql
Normal file
383
data/sql/updates/db_world/2025_08_08_01.sql
Normal file
@ -0,0 +1,383 @@
|
||||
-- DB update 2025_08_08_00 -> 2025_08_08_01
|
||||
-- fix low level scourge invasion quests
|
||||
-- queststarters / questenders
|
||||
UPDATE `creature_template` SET `npcflag` = `npcflag` | 2 WHERE (`entry` IN (16484, 16490, 16493, 16495, 29441));
|
||||
|
||||
DELETE FROM `creature_queststarter` WHERE (`quest` IN (9261, 9262, 9263, 9264, 12816)) AND (`id` IN (16484, 16490, 16493, 16495, 29441));
|
||||
INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES
|
||||
(16484, 9261), -- Lieutenant Nevell
|
||||
(16490, 9264), -- Lieutenant Lisande
|
||||
(16495, 9262), -- Lieutenant Beitha
|
||||
(16493, 9263), -- Lieutenant Dagel
|
||||
(29441, 12816); -- Lieutenant Julek
|
||||
|
||||
DELETE FROM `creature_questender` WHERE (`quest` IN (9261, 9262, 9263, 9264, 12816)) AND (`id` IN (16484, 16490, 16493, 16495, 29441));
|
||||
INSERT INTO `creature_questender` (`id`, `quest`) VALUES
|
||||
(16484, 9261), -- Lieutenant Nevell
|
||||
(16490, 9264), -- Lieutenant Lisande
|
||||
(16495, 9262), -- Lieutenant Beitha
|
||||
(16493, 9263), -- Lieutenant Dagel
|
||||
(29441, 12816); -- Lieutenant Julek
|
||||
|
||||
-- areatrigger
|
||||
DELETE FROM `areatrigger_involvedrelation` WHERE `id` IN (4092, 4094, 4095, 4096, 4098, 4099, 4100, 4101, 4103, 4104, 4105, 5151, 5152, 5153, 5154, 5158, 5159, 5160, 5161);
|
||||
INSERT INTO `areatrigger_involvedrelation` (`id`, `quest`) VALUES
|
||||
(4092, 9260), -- guid 83048
|
||||
(4094, 9260), -- guid 83044
|
||||
(4095, 9260), -- guid 83049
|
||||
(4096, 9260), -- guid 83046
|
||||
(4098, 9261), -- guid 83047
|
||||
(4099, 9261), -- guid 83045
|
||||
(4100, 9265), -- guid 83041
|
||||
-- (4102, 9263), -- guid 83043 -- too far away from circle somehow
|
||||
-- apparently blizzlike bug according to wowhead comments, only 1 circle outside orgrimmar giving quest progress correctly
|
||||
(4101, 9263), -- guid 83042
|
||||
(4103, 9264), -- guid 83040
|
||||
(4104, 9262), -- guid 83039
|
||||
(4105, 9262), -- guid 83038
|
||||
(5151, 12817), -- guid 684
|
||||
(5152, 12817), -- guid 685
|
||||
(5153, 12817), -- guid 687
|
||||
(5154, 12817), -- guid 686
|
||||
(5158, 12816), -- guid 691
|
||||
(5159, 12816), -- guid 690
|
||||
(5160, 12816), -- guid 689
|
||||
(5161, 12816); -- guid 688
|
||||
|
||||
-- Update gameobject 'Circle' with sniffed values
|
||||
-- updated spawns
|
||||
DELETE FROM `gameobject` WHERE (`id` IN (181227)) AND (`guid` BETWEEN 83038 AND 83049);
|
||||
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES
|
||||
(83038, 181227, 1, 0, 0, 1, 1, 9948.0205078125, 1932.390625, 1328.691162109375, 3.682650327682495117, 0, 0, -0.96362972259521484, 0.26724100112915039, 120, 255, 1, "", 46248, NULL),
|
||||
(83039, 181227, 1, 0, 0, 1, 1, 9914.181640625, 1864.6636962890625, 1321.25927734375, 2.914689540863037109, 0, 0, 0.993571281433105468, 0.113208353519439697, 120, 255, 1, "", 46248, NULL),
|
||||
(83040, 181227, 1, 0, 0, 1, 1, -1545.46875, 51.28591537475585937, 5.394122123718261718, 0.628316879272460937, 0, 0, 0.309016227722167968, 0.95105677843093872, 120, 255, 1, "", 45572, NULL),
|
||||
(83041, 181227, 0, 0, 0, 1, 1, 1980.00830078125, 305.231231689453125, 41.1893310546875, 0.436331570148468017, 0, 0, 0.216439247131347656, 0.976296067237854003, 120, 255, 1, "", 45572, NULL),
|
||||
(83042, 181227, 1, 0, 0, 1, 1, 1179.3914794921875, -4564.47509765625, 21.45466232299804687, 0.575957298278808593, 0, 0, 0.284014701843261718, 0.958819925785064697, 120, 255, 1, "", 45572, NULL),
|
||||
(83043, 181227, 1, 0, 0, 1, 1, 1148.54345703125, -4488.125, 19.8805694580078125, 4.014260292053222656, 0, 0, -0.90630722045898437, 0.422619491815567016, 120, 255, 1, "", 45613, NULL),
|
||||
(83044, 181227, 0, 0, 0, 1, 1, -9240.787109375, 238.191192626953125, 72.8129730224609375, 4.572763919830322265, 0, 0, -0.75470924377441406, 0.656059443950653076, 120, 255, 1, "", 46158, NULL),
|
||||
(83045, 181227, 0, 0, 0, 1, 1, -5375.5400390625, -735.15399169921875, 396.021240234375, 0.052358884364366531, 0, 0, 0.02617645263671875, 0.999657332897186279, 120, 255, 1, "", 46158, NULL),
|
||||
(83046, 181227, 0, 0, 0, 1, 1, -9218.103515625, 318.78509521484375, 73.86499786376953125, 3.019413232803344726, 0, 0, 0.998134613037109375, 0.061051756143569946, 120, 255, 1, "", 45613, NULL),
|
||||
(83047, 181227, 0, 0, 0, 1, 1, -5273.17236328125, -739.599853515625, 391.00933837890625, 2.513273954391479492, 0, 0, 0.951056480407714843, 0.309017121791839599, 120, 255, 1, "", 45613, NULL),
|
||||
(83048, 181227, 0, 0, 0, 1, 1, -9244.455078125, 418.84027099609375, 87.46126556396484375, 3.001946926116943359, 0, 0, 0.997563362121582031, 0.069766148924827575, 120, 255, 1, "", 45613, NULL),
|
||||
(83049, 181227, 0, 0, 0, 1, 1, -9183.8310546875, 416.188262939453125, 89.9123077392578125, 0.401424884796142578, 0, 0, 0.199367523193359375, 0.979924798011779785, 120, 255, 1, "", 45613, NULL);
|
||||
|
||||
-- new spawns
|
||||
DELETE FROM `gameobject` WHERE (`id` IN (181227)) AND (`guid` BETWEEN 684 AND 691);
|
||||
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`, `Comment`) VALUES
|
||||
(684, 181227, 530, 0, 0, 1, 1, -4018.017333984375, -12150.943359375, 2.146352052688598632, 0.401424884796142578, 0, 0, 0.199367523193359375, 0.979924798011779785, 120, 255, 1, "", 45942, NULL),
|
||||
(685, 181227, 530, 0, 0, 1, 1, -4105.47412109375, -12068.884765625, 3.33672499656677246, 4.572763919830322265, 0, 0, -0.75470924377441406, 0.656059443950653076, 120, 255, 1, "", 45435, NULL),
|
||||
(686, 181227, 530, 0, 0, 1, 1, -4156.29150390625, -12123.388671875, 0.412930011749267578, 3.001946926116943359, 0, 0, 0.997563362121582031, 0.069766148924827575, 120, 255, 1, "", 45435, NULL),
|
||||
(687, 181227, 530, 0, 0, 1, 1, -4183.55712890625, -12084.744140625, 2.419261932373046875, 3.019413232803344726, 0, 0, 0.998134613037109375, 0.061051756143569946, 120, 255, 1, "", 45435, NULL),
|
||||
(688, 181227, 530, 0, 0, 1, 1, 9218.56640625, -7347.048828125, 39.06943511962890625, 3.001946926116943359, 0, 0, 0.997563362121582031, 0.069766148924827575, 120, 255, 1, "", 45942, NULL),
|
||||
(689, 181227, 530, 0, 0, 1, 1, 9252.6943359375, -7315.2275390625, 26.01463890075683593, 3.019413232803344726, 0, 0, 0.998134613037109375, 0.061051756143569946, 120, 255, 1, "", 45942, NULL),
|
||||
(690, 181227, 530, 0, 0, 1, 1, 9290.8349609375, -7356.06689453125, 24.00287437438964843, 0.401424884796142578, 0, 0, 0.199367523193359375, 0.979924798011779785, 120, 255, 1, "", 45942, NULL),
|
||||
(691, 181227, 530, 0, 0, 1, 1, 9348.1875, -7351.76904296875, 12.69027996063232421, 4.572763919830322265, 0, 0, -0.75470924377441406, 0.656059443950653076, 120, 255, 1, "", 45572, NULL);
|
||||
|
||||
-- enable all spawns for eventEntry 17
|
||||
DELETE FROM `game_event_gameobject` WHERE (`eventEntry` = 17) AND (`guid` IN (SELECT `guid` FROM `gameobject` WHERE `id` IN (181227)));
|
||||
INSERT INTO `game_event_gameobject` (SELECT 17, `guid` FROM `gameobject` WHERE `id` IN (181227));
|
||||
|
||||
-- Update creature 'Spectral Spirit' with sniffed values
|
||||
-- updated spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16437)) AND (`guid` IN (153416, 153417, 153418, 153419, 153420, 153421, 153422, 153423, 153424, 153425, 153426, 153427, 153428, 153429, 153447, 153454, 153459, 153461, 153462, 153463, 153464, 153465, 153466, 153467, 153468, 153469, 153470, 153471, 153472, 153473, 153480, 153486, 153492));
|
||||
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
|
||||
(153416, 16437, 0, 1, 1, 0, -5271.24609375, -754.01171875, 391.332427978515625, 3.622705936431884765, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153417, 16437, 0, 1, 1, 0, -5276.23095703125, -699.53021240234375, 390.29425048828125, 3.061814069747924804, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153418, 16437, 0, 1, 1, 0, -5292.99169921875, -733.9814453125, 388.457427978515625, 4.743587017059326171, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153419, 16437, 0, 1, 1, 0, -5300.16748046875, -679.5177001953125, 388.429656982421875, 4.675374507904052734, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153420, 16437, 0, 1, 1, 0, -5307.5185546875, -765.8560791015625, 389.279205322265625, 1.850542306900024414, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153421, 16437, 0, 1, 1, 0, -5310.208984375, -704.794921875, 392.332427978515625, 2.057999610900878906, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153422, 16437, 0, 1, 1, 0, -5334.5673828125, -793.8668212890625, 389.619476318359375, 5.25991058349609375, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153423, 16437, 0, 1, 1, 0, -5342.58837890625, -697.68975830078125, 393.2384033203125, 2.010777950286865234, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153424, 16437, 0, 1, 1, 0, -5361.099609375, -739.6923828125, 396.003814697265625, 4.679796218872070312, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153425, 16437, 0, 1, 1, 0, -5369.26171875, -794.86529541015625, 398.446075439453125, 2.031130790710449218, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153426, 16437, 0, 1, 1, 0, -5376.01904296875, -766.24688720703125, 396.991363525390625, 4.509352684020996093, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153427, 16437, 0, 1, 1, 0, -5369.435546875, -704.484375, 396.188812255859375, 2.210784673690795898, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153428, 16437, 0, 1, 1, 0, -5394.58544921875, -735.02130126953125, 396.274078369140625, 2.538081645965576171, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153429, 16437, 0, 1, 1, 0, -5403.60791015625, -769.998046875, 395.008575439453125, 4.333511829376220703, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153447, 16437, 1, 1, 1, 0, -1576.1729736328125, 77.21936798095703125, -7.34216499328613281, 5.083232402801513671, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153454, 16437, 1, 1, 1, 0, -1523.54443359375, 54.8382720947265625, 6.090775489807128906, 2.415332794189453125, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153459, 16437, 1, 1, 1, 0, -1489.212158203125, 90.4298553466796875, 6.546192169189453125, 2.594491004943847656, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153461, 16437, 1, 1, 1, 0, 1139.164794921875, -4506.48388671875, 19.40609169006347656, 1.072573661804199218, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153462, 16437, 1, 1, 1, 0, 1142.3961181640625, -4543.2646484375, 18.10861778259277343, 2.071631431579589843, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153463, 16437, 1, 1, 1, 0, 1160.7200927734375, -4495.1259765625, 20.68977546691894531, 3.212122917175292968, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153464, 16437, 1, 1, 1, 0, 1158.5277099609375, -4526.83154296875, 20.63541221618652343, 1.537212610244750976, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153465, 16437, 1, 1, 1, 0, 1156.3204345703125, -4560.56103515625, 18.83359336853027343, 4.258000850677490234, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153466, 16437, 1, 1, 1, 0, 1175.227294921875, -4525.54931640625, 21.00127792358398437, 4.397952556610107421, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153467, 16437, 1, 1, 1, 0, 1175.0177001953125, -4578.10107421875, 18.66058158874511718, 5.339640140533447265, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153468, 16437, 1, 1, 1, 0, 1185.41650390625, -4508.57470703125, 21.56365585327148437, 2.907642841339111328, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153469, 16437, 1, 1, 1, 0, 1188.638671875, -4543.736328125, 19.42718124389648437, 3.609257936477661132, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153470, 16437, 1, 1, 1, 0, 1187.5106201171875, -4589.75830078125, 18.03423881530761718, 4.280419826507568359, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153471, 16437, 1, 1, 1, 0, 1206.37158203125, -4525.85205078125, 19.13112831115722656, 4.001062393188476562, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153472, 16437, 1, 1, 1, 0, 1221.065185546875, -4518.12060546875, 20.97634315490722656, 4.477022171020507812, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153473, 16437, 1, 1, 1, 0, 1225.3250732421875, -4577.95654296875, 18.35081100463867187, 4.778232097625732421, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153480, 16437, 1, 1, 1, 0, 9894.51171875, 1875.1895751953125, 1320.7158203125, 6.033982276916503906, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153486, 16437, 1, 1, 1, 0, 9926.826171875, 1858.5548095703125, 1321.956787109375, 4.788326263427734375, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153492, 16437, 1, 1, 1, 0, 9957.712890625, 1925.7977294921875, 1327.6348876953125, 1.655751347541809082, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL);
|
||||
|
||||
-- remove duplicate spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16437)) AND (`guid` IN (153415, 153474, 153475, 153476, 153477));
|
||||
DELETE FROM `creature_addon` WHERE (`guid` IN (153415, 153474, 153475, 153476, 153477));
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (153415, 153474, 153475, 153476, 153477));
|
||||
|
||||
-- remaining spawns (no sniffed values available)
|
||||
-- (`guid` IN (153460, 153458, 153457, 153456, 153455, 153453, 153452, 153451, 153450, 153449, 153448, 153446, 153478, 153479, 153481, 153482, 153483, 153484, 153485, 153487, 153488, 153489, 153490, 153491))
|
||||
|
||||
-- enable all spawns for eventEntry 17
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (SELECT `guid` FROM `creature` WHERE `id1` IN (16437)));
|
||||
INSERT INTO `game_event_creature` (SELECT 17, `guid` FROM `creature` WHERE `id1` IN (16437));
|
||||
|
||||
-- Update creature 'Skeletal Trooper' with sniffed values
|
||||
-- updated spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16438)) AND (`guid` IN (153431, 153432, 153433, 153434, 153435, 153436, 153437, 153438, 153439, 153440, 153441, 153442, 153443, 153444, 153445, 153498, 153505, 153506, 153508, 153509, 153510, 153511, 153512, 153513, 153514, 153515, 153516, 153517, 153532, 153534, 153537));
|
||||
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
|
||||
(153431, 16438, 0, 1, 1, 0, -5382.41162109375, -715.45452880859375, 397.328704833984375, 1.100316286087036132, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153432, 16438, 0, 1, 1, 0, -5382.099609375, -752.40228271484375, 395.663482666015625, 4.741677761077880859, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153433, 16438, 0, 1, 1, 0, -5381.8671875, -782.654296875, 396.946075439453125, 3.819078445434570312, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153434, 16438, 0, 1, 1, 0, -5355.923828125, -787.218994140625, 399.272552490234375, 3.545246601104736328, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153435, 16438, 0, 1, 1, 0, -5353.26904296875, -719.4815673828125, 394.972686767578125, 5.079165458679199218, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153436, 16438, 0, 1, 1, 0, -5350.18505859375, -745.7607421875, 395.622711181640625, 2.022890567779541015, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153437, 16438, 0, 1, 1, 0, -5348.99267578125, -685.48614501953125, 395.1361083984375, 5.318337440490722656, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153438, 16438, 0, 1, 1, 0, -5320.833984375, -783.333984375, 388.457427978515625, 2.853058099746704101, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153439, 16438, 0, 1, 1, 0, -5319.60107421875, -751.9918212890625, 388.78204345703125, 3.773599624633789062, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153440, 16438, 0, 1, 1, 0, -5318.32666015625, -681.00750732421875, 390.144989013671875, 2.138490200042724609, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153441, 16438, 0, 1, 1, 0, -5313.802734375, -722.18060302734375, 398.17633056640625, 5.613928794860839843, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153442, 16438, 0, 1, 1, 0, -5289.3701171875, -753.124755859375, 390.409332275390625, 0.379460006952285766, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153443, 16438, 0, 1, 1, 0, -5285.24609375, -713.91693115234375, 388.457427978515625, 2.612617969512939453, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153444, 16438, 0, 1, 1, 0, -5284.4951171875, -684.23687744140625, 389.09796142578125, 3.77411055564880371, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153445, 16438, 0, 1, 1, 0, -5252.35107421875, -748.0787353515625, 389.218963623046875, 2.098472118377685546, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153498, 16438, 1, 1, 1, 0, -1556.821044921875, 56.743499755859375, 2.502153635025024414, 1.776832938194274902, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153505, 16438, 1, 1, 1, 0, -1511.2213134765625, 44.35062789916992187, 10.7245645523071289, 2.546346664428710937, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153506, 16438, 1, 1, 1, 0, -1509.090576171875, 57.731536865234375, 8.605790138244628906, 3.639331579208374023, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153508, 16438, 1, 1, 1, 0, 1154.4462890625, -4544.39794921875, 18.92966270446777343, 3.784672260284423828, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153509, 16438, 1, 1, 1, 0, 1157.2734375, -4506.515625, 19.97481727600097656, 2.663441419601440429, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153510, 16438, 1, 1, 1, 0, 1158.9012451171875, -4523.70556640625, 20.76461219787597656, 0.148554578423500061, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153511, 16438, 1, 1, 1, 0, 1173.6923828125, -4509.30908203125, 20.87627792358398437, 5.503856658935546875, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153512, 16438, 1, 1, 1, 0, 1175.8726806640625, -4555.99462890625, 20.79351425170898437, 3.928357362747192382, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153513, 16438, 1, 1, 1, 0, 1181.3785400390625, -4524.08984375, 21.00127792358398437, 2.717643499374389648, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153514, 16438, 1, 1, 1, 0, 1188.724853515625, -4575.77490234375, 19.90936088562011718, 2.593951940536499023, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153515, 16438, 1, 1, 1, 0, 1205.813232421875, -4509.623046875, 21.92503929138183593, 2.342383384704589843, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153516, 16438, 1, 1, 1, 0, 1208.6318359375, -4574.208984375, 19.65232467651367187, 2.4570465087890625, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153517, 16438, 1, 1, 1, 0, 1219.2769775390625, -4559.42724609375, 20.63112831115722656, 1.831341266632080078, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153532, 16438, 1, 1, 1, 0, 9925.498046875, 1842.229248046875, 1322.57568359375, 5.836470603942871093, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153534, 16438, 1, 1, 1, 0, 9943.72265625, 1858.222900390625, 1324.330322265625, 4.746068000793457031, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153537, 16438, 1, 1, 1, 0, 9973.90625, 1928.2470703125, 1326.6082763671875, 1.315697550773620605, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL);
|
||||
|
||||
-- remove duplicate spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16438)) AND (`guid` IN (153430, 153518, 153519, 153520, 153521, 153522, 153523, 153539, 153540));
|
||||
DELETE FROM `creature_addon` WHERE (`guid` IN (153430, 153518, 153519, 153520, 153521, 153522, 153523, 153539, 153540));
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (153430, 153518, 153519, 153520, 153521, 153522, 153523, 153539, 153540));
|
||||
|
||||
-- remaining spawns (no sniffed values available)
|
||||
-- (`guid` IN (153507, 153504, 153503, 153502, 153501, 153500, 153499, 153497, 153496, 153495, 153494, 153493, 153524, 153525, 153526, 153527, 153528, 153529, 153530, 153531, 153533, 153535, 153536, 153538))
|
||||
|
||||
-- enable all spawns for eventEntry 17
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (SELECT `guid` FROM `creature` WHERE `id1` IN (16438)));
|
||||
INSERT INTO `game_event_creature` (SELECT 17, `guid` FROM `creature` WHERE `id1` IN (16438));
|
||||
|
||||
-- Update creature 'Skeletal Soldier' with sniffed values
|
||||
-- updated spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16422)) AND (`guid` IN (153349, 153351, 153352, 153354, 153355, 153356, 153357, 153358, 153359, 153368, 153369, 153370, 153371, 153372, 153373, 153374, 153375, 153376, 153377, 153378, 153379, 153380, 153381));
|
||||
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
|
||||
(153349, 16422, 0, 1, 1, 0, -9227.77734375, 354.659149169921875, 73.9923553466796875, 5.283609390258789062, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153351, 16422, 0, 1, 1, 0, -9223.0419921875, 321.6729736328125, 73.57967376708984375, 0.428912669420242309, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153352, 16422, 0, 1, 1, 0, -9209.0693359375, 354.169952392578125, 73.71912384033203125, 3.206082582473754882, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153354, 16422, 0, 1, 1, 0, -9211.619140625, 321.243743896484375, 74.00618743896484375, 3.877586841583251953, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153355, 16422, 0, 1, 1, 0, -9210.2607421875, 254.4482879638671875, 73.1851348876953125, 3.378531694412231445, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153356, 16422, 0, 1, 1, 0, -9208.173828125, 424.242279052734375, 89.11493682861328125, 3.987549304962158203, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153357, 16422, 0, 1, 1, 0, -9192.796875, 426.34765625, 91.48415374755859375, 3.484354019165039062, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153358, 16422, 0, 1, 1, 0, -9175.388671875, 409.830078125, 89.23415374755859375, 1.323921084403991699, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153359, 16422, 0, 1, 1, 0, -9155.3857421875, 405.8936767578125, 92.2745819091796875, 4.102082252502441406, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153368, 16422, 0, 1, 1, 0, -9240.1806640625, 422.218292236328125, 87.1437225341796875, 4.537019729614257812, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153369, 16422, 0, 1, 1, 0, -9238.1455078125, 347.664276123046875, 75.24341583251953125, 3.638414859771728515, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153370, 16422, 0, 1, 1, 0, -9225.58984375, 257.480926513671875, 72.3277740478515625, 2.698247909545898437, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153371, 16422, 0, 1, 1, 0, -9195.048828125, 447.27301025390625, 94.96816253662109375, 1.801104903221130371, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153372, 16422, 0, 1, 1, 0, 1957.801513671875, 308.541656494140625, 40.69472122192382812, 0.476643085479736328, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153373, 16422, 0, 1, 1, 0, 1976.1650390625, 343.7855224609375, 41.38097000122070312, 2.58756256103515625, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153374, 16422, 0, 1, 1, 0, 1976.436767578125, 322.785552978515625, 39.84408187866210937, 4.528051376342773437, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153375, 16422, 0, 1, 1, 0, 1991.150390625, 291.5693359375, 45.52114486694335937, 3.391375303268432617, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153376, 16422, 0, 1, 1, 0, 2010.0194091796875, 308.076904296875, 44.9585418701171875, 0.921246230602264404, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153377, 16422, 0, 1, 1, 0, 2008.574951171875, 278.080352783203125, 47.68598556518554687, 0.35378536581993103, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153378, 16422, 0, 1, 1, 0, 2008.77685546875, 322.716156005859375, 42.60588836669921875, 2.881101131439208984, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153379, 16422, 0, 1, 1, 0, 2012.899658203125, 345.282318115234375, 41.5042266845703125, 0.589477062225341796, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153380, 16422, 0, 1, 1, 0, 2026.650390625, 307.222808837890625, 50.1859588623046875, 5.55606698989868164, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153381, 16422, 0, 1, 1, 0, 2024.681396484375, 292.09100341796875, 54.22370529174804687, 4.488111019134521484, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL);
|
||||
|
||||
-- new spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16422)) AND (`guid` BETWEEN 12784 AND 12803);
|
||||
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
|
||||
(12784, 16422, 530, 1, 1, 0, -3987.02001953125, -12187.4384765625, 3.878748893737792968, 3.051640033721923828, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(12785, 16422, 530, 1, 1, 0, -4017.5859375, -12151.3154296875, 2.306606769561767578, 3.561514616012573242, 120, 3, 1, 0, 0, 0, "", 46368, 1, NULL),
|
||||
(12786, 16422, 530, 1, 1, 0, -4024.658203125, -12193.5908203125, 2.70371246337890625, 3.894593000411987304, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(12787, 16422, 530, 1, 1, 0, -4049.052978515625, -12153.30078125, -0.26638364791870117, 3.57096099853515625, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(12788, 16422, 530, 1, 1, 0, -4110.37353515625, -12058.7744140625, 2.933060646057128906, 3.836806058883666992, 120, 3, 1, 0, 0, 0, "", 45435, 1, NULL),
|
||||
(12789, 16422, 530, 1, 1, 0, -4154.078125, -12119.6025390625, 0.145328998565673828, 4.681807518005371093, 120, 3, 1, 0, 0, 0, "", 46368, 1, NULL),
|
||||
(12790, 16422, 530, 1, 1, 0, -4186.130859375, -12082.74609375, 2.173234462738037109, 2.55629730224609375, 120, 3, 1, 0, 0, 0, "", 45435, 1, NULL),
|
||||
(12791, 16422, 530, 1, 1, 0, -4213.90478515625, -12120.9091796875, 5.133166790008544921, 2.558339595794677734, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(12792, 16422, 530, 1, 1, 0, -4217.95263671875, -12082.91015625, 4.94405221939086914, 3.296390056610107421, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(12793, 16422, 530, 1, 1, 0, -4220.13427734375, -12054.630859375, 3.073923110961914062, 3.968017578125, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(12794, 16422, 530, 1, 1, 0, 9199.9677734375, -7368.166015625, 47.7635650634765625, 1.76130068302154541, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(12795, 16422, 530, 1, 1, 0, 9203.3173828125, -7324.0244140625, 43.59265518188476562, 4.338305473327636718, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(12796, 16422, 530, 1, 1, 0, 9216.2099609375, -7345.93115234375, 39.97610092163085937, 1.99372565746307373, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(12797, 16422, 530, 1, 1, 0, 9237.513671875, -7373.54833984375, 33.035400390625, 2.940837860107421875, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(12798, 16422, 530, 1, 1, 0, 9252.6591796875, -7315.8203125, 26.08294105529785156, 0.96994096040725708, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(12799, 16422, 530, 1, 1, 0, 9281.7998046875, -7384.4833984375, 29.56457138061523437, 5.861535549163818359, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(12800, 16422, 530, 1, 1, 0, 9290.408203125, -7355.77783203125, 24.0960845947265625, 1.718405842781066894, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(12801, 16422, 530, 1, 1, 0, 9322.36328125, -7392.435546875, 22.27577972412109375, 3.82608652114868164, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(12802, 16422, 530, 1, 1, 0, 9323.8515625, -7329.416015625, 15.66892337799072265, 1.820181488990783691, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(12803, 16422, 530, 1, 1, 0, 9347.9052734375, -7350.78564453125, 12.64682197570800781, 3.595394134521484375, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL);
|
||||
|
||||
-- remove duplicate spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16422)) AND (`guid` IN (153367, 153366, 153365, 153364, 153363, 153362, 153361, 153360, 153353, 153350));
|
||||
DELETE FROM `creature_addon` WHERE (`guid` IN (153367, 153366, 153365, 153364, 153363, 153362, 153361, 153360, 153353, 153350));
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (153367, 153366, 153365, 153364, 153363, 153362, 153361, 153360, 153353, 153350));
|
||||
|
||||
-- enable all spawns for eventEntry 17
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (SELECT `guid` FROM `creature` WHERE `id1` IN (16422)));
|
||||
INSERT INTO `game_event_creature` (SELECT 17, `guid` FROM `creature` WHERE `id1` IN (16422));
|
||||
|
||||
-- Update creature 'Spectral Apparition' with sniffed values
|
||||
-- updated spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16423)) AND (`guid` IN (153382, 153383, 153384, 153385, 153386, 153387, 153388, 153389, 153390, 153391, 153392, 153393, 153403, 153404, 153405, 153406, 153407, 153408, 153409, 153412, 153413, 153414));
|
||||
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
|
||||
(153382, 16423, 0, 1, 1, 0, -9223.8759765625, 310.105804443359375, 74.29573822021484375, 0.752543032169342041, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153383, 16423, 0, 1, 1, 0, -9223.4912109375, 237.855621337890625, 73.1125030517578125, 0.772088050842285156, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153384, 16423, 0, 1, 1, 0, -9223.064453125, 338.404449462890625, 73.72052764892578125, 2.754076242446899414, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153385, 16423, 0, 1, 1, 0, -9222.2236328125, 425.065093994140625, 89.40253448486328125, 4.21000528335571289, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153386, 16423, 0, 1, 1, 0, -9217.2490234375, 247.587432861328125, 72.9916534423828125, 2.169522762298583984, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153387, 16423, 0, 1, 1, 0, -9208.9775390625, 340.364990234375, 72.71918487548828125, 2.965076923370361328, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153388, 16423, 0, 1, 1, 0, -9208.640625, 306.975799560546875, 74.731964111328125, 1.8322373628616333, 120, 3, 1, 0, 0, 0, "", 46248, 2, NULL),
|
||||
(153389, 16423, 0, 1, 1, 0, -9201.259765625, 469.72265625, 99.94416046142578125, 5.42893075942993164, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153390, 16423, 0, 1, 1, 0, -9193.814453125, 359.40643310546875, 74.78105926513671875, 6.008391857147216796, 120, 3, 1, 0, 0, 0, "", 46902, 1, NULL),
|
||||
(153391, 16423, 0, 1, 1, 0, -9192.1513671875, 375.42987060546875, 74.4331512451171875, 2.856729030609130859, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153392, 16423, 0, 1, 1, 0, -9172.521484375, 417.263641357421875, 91.61232757568359375, 4.649480819702148437, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153393, 16423, 0, 1, 1, 0, -9160.40625, 427.1048583984375, 94.5470428466796875, 1.970723748207092285, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(153403, 16423, 0, 1, 1, 0, 1958.769287109375, 340.36090087890625, 39.36849594116210937, 6.189987659454345703, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153404, 16423, 0, 1, 1, 0, 1958.9923095703125, 323.62640380859375, 39.19264602661132812, 1.676352977752685546, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153405, 16423, 0, 1, 1, 0, 1975.210693359375, 310.11907958984375, 41.05484771728515625, 1.630221486091613769, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(153406, 16423, 0, 1, 1, 0, 1980.0306396484375, 291.380218505859375, 41.99367523193359375, 1.982121467590332031, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153407, 16423, 0, 1, 1, 0, 1989.93603515625, 277.658660888671875, 46.57041549682617187, 3.440085411071777343, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(153408, 16423, 0, 1, 1, 0, 1988.3173828125, 347.412353515625, 39.97032546997070312, 2.259385108947753906, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153409, 16423, 0, 1, 1, 0, 1992.690185546875, 308.994354248046875, 41.66744613647460937, 2.179238796234130859, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(153412, 16423, 0, 1, 1, 0, 2011.6260986328125, 289.991973876953125, 48.30659103393554687, 3.967081069946289062, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153413, 16423, 0, 1, 1, 0, 2025.2703857421875, 324.331451416015625, 46.63629531860351562, 2.588274002075195312, 120, 3, 1, 0, 0, 0, "", 45613, 1, NULL),
|
||||
(153414, 16423, 0, 1, 1, 0, 2041.4583740234375, 326.857635498046875, 51.917633056640625, 5.846852779388427734, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL);
|
||||
|
||||
-- new spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16423)) AND (`guid` BETWEEN 67101 AND 67141);
|
||||
INSERT INTO `creature` (`guid`, `id1`, `map`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `ScriptName`, `VerifiedBuild`, `CreateObject`, `Comment`) VALUES
|
||||
(67101, 16423, 530, 1, 1, 0, -3981.50732421875, -12122.4833984375, 0.266236782073974609, 3.610132932662963867, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67102, 16423, 530, 1, 1, 0, -4006.31982421875, -12140.263671875, 2.153530597686767578, 4.359241485595703125, 120, 3, 1, 0, 0, 0, "", 46368, 1, NULL),
|
||||
(67103, 16423, 530, 1, 1, 0, -4009.034912109375, -12160.513671875, 2.655972003936767578, 3.10298323631286621, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67104, 16423, 530, 1, 1, 0, -4018.1826171875, -12179.408203125, 3.53061676025390625, 5.723670005798339843, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67105, 16423, 530, 1, 1, 0, -4032.319580078125, -12165.6865234375, 3.138149738311767578, 3.856069564819335937, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67106, 16423, 530, 1, 1, 0, -4034.622314453125, -12135.9091796875, -0.70778989791870117, 4.385163307189941406, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67107, 16423, 530, 1, 1, 0, -4050.735595703125, -12178.7216796875, 1.657215356826782226, 3.238692283630371093, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67108, 16423, 530, 1, 1, 0, -4092.2333984375, -12047.4140625, -0.2069401741027832, 2.262966156005859375, 120, 3, 1, 0, 0, 0, "", 45435, 1, NULL),
|
||||
(67109, 16423, 530, 1, 1, 0, -4095.952880859375, -12083.576171875, 2.125942707061767578, 2.308555126190185546, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67110, 16423, 530, 1, 1, 0, -4110.82421875, -12072.595703125, 2.403693675994873046, 3.149405241012573242, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67111, 16423, 530, 1, 1, 0, -4119.63232421875, -12048.5732421875, 0.722367286682128906, 4.37493896484375, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67112, 16423, 530, 1, 1, 0, -4135.54931640625, -12131.6669921875, -0.04412412643432617, 2.346959352493286132, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67113, 16423, 530, 1, 1, 0, -4150.41552734375, -12107.521484375, -0.43157526850700378, 3.03648686408996582, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67114, 16423, 530, 1, 1, 0, -4152.009765625, -12147.85546875, 0.860852062702178955, 2.601891517639160156, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67115, 16423, 530, 1, 1, 0, -4168.0048828125, -12065.8681640625, -0.1713104248046875, 2.314781665802001953, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67116, 16423, 530, 1, 1, 0, -4168.2197265625, -12131.82421875, 2.31150364875793457, 1.768809795379638671, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67117, 16423, 530, 1, 1, 0, -4170.451171875, -12100.341796875, 0.95408177375793457, 3.363884925842285156, 120, 3, 1, 0, 0, 0, "", 45435, 1, NULL),
|
||||
(67118, 16423, 530, 1, 1, 0, -4185.89306640625, -12144.6484375, 3.922057628631591796, 2.116046667098999023, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67119, 16423, 530, 1, 1, 0, -4188.291015625, -12119.142578125, 3.46995091438293457, 2.881513357162475585, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67120, 16423, 530, 1, 1, 0, -4202.4287109375, -12097.7998046875, 3.84053659439086914, 2.464958906173706054, 120, 3, 1, 0, 0, 0, "", 46158, 1, NULL),
|
||||
(67121, 16423, 530, 1, 1, 0, -4203.16357421875, -12066.1533203125, 3.575876235961914062, 2.821455240249633789, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67122, 16423, 530, 1, 1, 0, 9205.4384765625, -7353.77392578125, 43.99428939819335937, 1.863339424133300781, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67123, 16423, 530, 1, 1, 0, 9208.0732421875, -7342.18701171875, 42.93673324584960937, 3.190436601638793945, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67124, 16423, 530, 1, 1, 0, 9222.3857421875, -7376.8095703125, 39.94235992431640625, 1.618519306182861328, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67125, 16423, 530, 1, 1, 0, 9223.47265625, -7321.06201171875, 36.04755020141601562, 4.819352149963378906, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67126, 16423, 530, 1, 1, 0, 9227.3720703125, -7338.21044921875, 35.36068344116210937, 0.281941771507263183, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67127, 16423, 530, 1, 1, 0, 9227.5693359375, -7356.2939453125, 35.95882797241210937, 2.819842100143432617, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67128, 16423, 530, 1, 1, 0, 9240.865234375, -7310.32958984375, 28.03185462951660156, 5.564355373382568359, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67129, 16423, 530, 1, 1, 0, 9243.12890625, -7322.7734375, 28.40892982482910156, 0.555259287357330322, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(67130, 16423, 530, 1, 1, 0, 9254.853515625, -7325.79736328125, 25.29967689514160156, 4.691057205200195312, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67131, 16423, 530, 1, 1, 0, 9256.6171875, -7308.18701171875, 25.77788734436035156, 0.287500232458114624, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(67132, 16423, 530, 1, 1, 0, 9258.732421875, -7293.9423828125, 24.65468597412109375, 4.834720134735107421, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67133, 16423, 530, 1, 1, 0, 9277.396484375, -7361.08203125, 25.7863922119140625, 5.194993972778320312, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(67134, 16423, 530, 1, 1, 0, 9282.830078125, -7337.35546875, 21.4691925048828125, 2.886626720428466796, 120, 3, 1, 0, 0, 0, "", 45572, 1, NULL),
|
||||
(67135, 16423, 530, 1, 1, 0, 9294.521484375, -7370.701171875, 25.46319198608398437, 4.484422206878662109, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(67136, 16423, 530, 1, 1, 0, 9307.947265625, -7357.56005859375, 21.58169937133789062, 0.820058345794677734, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(67137, 16423, 530, 1, 1, 0, 9316.853515625, -7377.103515625, 21.64589691162109375, 5.952449321746826171, 120, 3, 1, 0, 0, 0, "", 46248, 1, NULL),
|
||||
(67138, 16423, 530, 1, 1, 0, 9339.4091796875, -7340.38720703125, 12.40863990783691406, 5.510135173797607421, 120, 3, 1, 0, 0, 0, "", 46248, 2, NULL),
|
||||
(67139, 16423, 530, 1, 1, 0, 9340.080078125, -7361.341796875, 14.49008369445800781, 4.575189590454101562, 120, 3, 1, 0, 0, 0, "", 49345, 1, NULL),
|
||||
(67140, 16423, 530, 1, 1, 0, 9342.84375, -7376.10400390625, 15.9468994140625, 0.528074502944946289, 120, 3, 1, 0, 0, 0, "", 45942, 1, NULL),
|
||||
(67141, 16423, 530, 1, 1, 0, 9358.73828125, -7340.4365234375, 11.64703845977783203, 0.223065331578254699, 120, 3, 1, 0, 0, 0, "", 46248, 2, NULL);
|
||||
|
||||
-- remove duplicate spawns
|
||||
DELETE FROM `creature` WHERE (`id1` IN (16423)) AND (`guid` IN (153402, 153401, 153400, 153399, 153398, 153397, 153396, 153395, 153394, 153410, 153411));
|
||||
DELETE FROM `creature_addon` WHERE (`guid` IN (153402, 153401, 153400, 153399, 153398, 153397, 153396, 153395, 153394, 153410, 153411));
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (153402, 153401, 153400, 153399, 153398, 153397, 153396, 153395, 153394, 153410, 153411));
|
||||
|
||||
-- enable all spawns for eventEntry 17
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = 17) AND (`guid` IN (SELECT `guid` FROM `creature` WHERE `id1` IN (16423)));
|
||||
INSERT INTO `game_event_creature` (SELECT 17, `guid` FROM `creature` WHERE `id1` IN (16423));
|
||||
|
||||
-- clean areas of default creature spawns
|
||||
DELETE FROM `game_event_creature` WHERE (`eventEntry` = -17) AND (`guid` IN (12128, 12370, 4779, 12933, 49925, 47452, 47920, 1738, 1740, 4070, 4071, 4074, 4075, 4076, 79867, 79868, 79869, 79871, 79873, 79874, 79876, 79877, 79878, 79879, 79880, 79882, 79883, 80282, 80284, 80285, 80286, 80287, 80382, 45008, 45022, 45078, 45169, 61032, 61034, 61319, 61469, 61576, 61579, 62743, 55746, 55784, 55786, 55937, 55938, 55939));
|
||||
INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES
|
||||
-- Orgrimmar
|
||||
(-17, 12128), -- Elder Mottled boar
|
||||
(-17, 12370), -- Venomtail Scorpid
|
||||
(-17, 4779), -- Bloodtalon Taillasher
|
||||
(-17, 12933), -- Dustwind Pillager
|
||||
-- Darnassus
|
||||
(-17, 49925), -- Nightsaber Stalker
|
||||
(-17, 47452), -- Strigid Screecher
|
||||
(-17, 47920), -- Rabbit
|
||||
-- Ironforge
|
||||
(-17, 1738), -- Large Crag Boar
|
||||
(-17, 1740), -- Rabbit
|
||||
(-17, 4070), -- Winter Wolf
|
||||
(-17, 4071), -- Ice Claw Bear
|
||||
(-17, 4074), -- Snow Tracker Wolf
|
||||
(-17, 4075), -- Snow Tracker Wolf
|
||||
(-17, 4076), -- Winter Wolf
|
||||
-- Stormwind
|
||||
(-17, 79867), -- Rabbit
|
||||
(-17, 79868), -- Fawn
|
||||
(-17, 79869), -- Deer
|
||||
(-17, 79871), -- Cow
|
||||
(-17, 79873), -- Rabbit
|
||||
(-17, 79874), -- Deer
|
||||
(-17, 79876), -- Mangy Wolf
|
||||
(-17, 79877), -- Defias Cutpurse
|
||||
(-17, 79878), -- Deer
|
||||
(-17, 79879), -- Fawn
|
||||
(-17, 79880), -- Cow
|
||||
(-17, 79882), -- Rabbit
|
||||
(-17, 79883), -- Forest Spider
|
||||
(-17, 80282), -- Defias Cutpurse
|
||||
(-17, 80284), -- Sheep
|
||||
(-17, 80285), -- Cow
|
||||
(-17, 80286), -- Deer
|
||||
(-17, 80287), -- Fawn
|
||||
(-17, 80382), -- Mangy Wolf
|
||||
-- Undercity
|
||||
(-17, 45008), -- Cursed Duskbat
|
||||
(-17, 45022), -- Cursed Darkhound
|
||||
(-17, 45078), -- Greater Duskbat
|
||||
(-17, 45169), -- Cursed Darkhound
|
||||
-- Exodar
|
||||
(-17, 61032), -- Root Trapper
|
||||
(-17, 61034), -- Root Trapper
|
||||
(-17, 61319), -- Moongraze Stag
|
||||
(-17, 61469), -- Moongraze Buck
|
||||
(-17, 61576), -- Infected Nightstalker Runt
|
||||
(-17, 61579), -- Infected Nightstalker Runt
|
||||
(-17, 62743), -- Timberstrider Fledgling
|
||||
-- Silvermoon
|
||||
(-17, 55746), -- Feral Dragonhawk Hatchling
|
||||
(-17, 55784), -- Feral Dragonhawk Hatchling
|
||||
(-17, 55786), -- Feral Dragonhawk Hatchling
|
||||
(-17, 55937), -- Springpaw Stalker
|
||||
(-17, 55938), -- Springpaw Stalker
|
||||
(-17, 55939); -- Springpaw Stalker
|
||||
|
||||
-- current DB quest pois already match a 51832 brute
|
||||
-- therefore mark them as sniffed
|
||||
UPDATE `quest_poi_points` SET `VerifiedBuild` = 51831 WHERE `QuestID` IN (9260, 9261, 9262, 9263, 9264, 9265, 12816, 12817) AND (`Idx1` BETWEEN 0 and 9) AND (`Idx2` BETWEEN 0 AND 8);
|
||||
4
data/sql/updates/db_world/2025_08_10_00.sql
Normal file
4
data/sql/updates/db_world/2025_08_10_00.sql
Normal file
@ -0,0 +1,4 @@
|
||||
-- DB update 2025_08_08_01 -> 2025_08_10_00
|
||||
|
||||
-- Remove Creature_addon tables from some Gargoyles.
|
||||
DELETE FROM `creature_addon` WHERE (`guid` IN (100016, 100017, 100018, 100032, 100033, 100034, 100035, 100056, 100057, 100058, 100059, 100060, 100061));
|
||||
5
data/sql/updates/db_world/2025_08_10_01.sql
Normal file
5
data/sql/updates/db_world/2025_08_10_01.sql
Normal file
@ -0,0 +1,5 @@
|
||||
-- DB update 2025_08_10_00 -> 2025_08_10_01
|
||||
-- Delete Nerubian Chitin, Borean Leather, and Arctic Fur from loot table from various creatures in WotLK
|
||||
DELETE from `creature_loot_template` WHERE `item` = 33568;
|
||||
DELETE from `creature_loot_template` WHERE `item` = 44128;
|
||||
DELETE from `creature_loot_template` WHERE `item` = 38558;
|
||||
42
data/sql/updates/db_world/2025_08_12_00.sql
Normal file
42
data/sql/updates/db_world/2025_08_12_00.sql
Normal file
@ -0,0 +1,42 @@
|
||||
-- DB update 2025_08_10_01 -> 2025_08_12_00
|
||||
|
||||
-- Set SmartAI (Wreckage A, B, C)
|
||||
UPDATE `gameobject_template` SET `AIName` = 'SmartGameObjectAI' WHERE (`entry`IN (188087, 188088, 188089));
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 1) AND (`entryorguid` IN (188087, 188088, 188089));
|
||||
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(188087, 1, 0, 0, 38, 0, 100, 0, 0, 1, 0, 0, 0, 0, 41, 0, 60, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Wreckage A - On Data Set 0 1 - Despawn Instant'),
|
||||
(188088, 1, 0, 0, 38, 0, 100, 0, 0, 1, 0, 0, 0, 0, 41, 0, 60, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Wreckage B - On Data Set 0 1 - Despawn Instant'),
|
||||
(188089, 1, 0, 0, 38, 0, 100, 0, 0, 1, 0, 0, 0, 0, 41, 0, 60, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Wreckage C - On Data Set 0 1 - Despawn Instant');
|
||||
|
||||
-- Set SmartAI (Fezzix Geartwist)
|
||||
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 25849;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 25849);
|
||||
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(25849, 0, 0, 0, 25, 0, 100, 512, 0, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - On Reset - Set Event Phase 1'),
|
||||
(25849, 0, 1, 2, 20, 1, 100, 0, 11894, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - On Quest \'Patching Up\' Finished - Say Line 0 (Phase 1)'),
|
||||
(25849, 0, 2, 0, 61, 1, 100, 512, 0, 0, 0, 0, 0, 0, 80, 2584900, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - On Quest \'Patching Up\' Finished - Run Script (Phase 1)'),
|
||||
(25849, 0, 3, 0, 40, 2, 100, 512, 11, 25849, 0, 0, 0, 0, 80, 2584901, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - On Point 11 of Path 25849 Reached - Run Script (Phase 2)'),
|
||||
(25849, 0, 4, 5, 40, 2, 100, 512, 12, 25849, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - On Point 12 of Path 25849 Reached - Set Event Phase 1 (Phase 2)'),
|
||||
(25849, 0, 5, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 4.06662, 'Fezzix Geartwist - On Point 12 of Path 25849 Reached - Set Orientation 4.06662 (Phase 2)');
|
||||
|
||||
-- Set Timed Actionlist (Fezzix Geartwist)
|
||||
DELETE FROM `smart_scripts` WHERE (`source_type` = 9) AND (`entryorguid` IN (2584900, 2584901));
|
||||
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(2584900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Set Event Phase 2'),
|
||||
(2584900, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 12, 26040, 1, 13000, 0, 0, 0, 8, 0, 0, 0, 0, 3481.33, 4099.85, 17.839, 3.35103, 'Fezzix Geartwist - Actionlist - Summon Creature \'Fezzix\'s Flying Machine\''),
|
||||
(2584900, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 14, 60069, 188087, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Set Data 0 1'),
|
||||
(2584900, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 14, 60080, 188088, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Set Data 0 1'),
|
||||
(2584900, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 14, 60095, 188089, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Set Data 0 1'),
|
||||
(2584900, 9, 5, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Say Line 1'),
|
||||
(2584900, 9, 6, 0, 0, 0, 100, 0, 9000, 9000, 0, 0, 0, 0, 43, 0, 22719, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Mount To Model 22719'),
|
||||
(2584900, 9, 7, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Say Line 2'),
|
||||
(2584900, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 60, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Set Fly On'),
|
||||
(2584900, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 53, 0, 25849, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Start Waypoint Path 25849'),
|
||||
(2584901, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 46419, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Cast \'Cosmetic - Explosion\''),
|
||||
(2584901, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 43, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Dismount'),
|
||||
(2584901, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Set Fly Off'),
|
||||
(2584901, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 42963, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Cast \'Cosmetic - Combat Knockdown Self\''),
|
||||
(2584901, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Say Line 3'),
|
||||
(2584901, 9, 5, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Fezzix Geartwist - Actionlist - Say Line 4');
|
||||
6
data/sql/updates/db_world/2025_08_12_01.sql
Normal file
6
data/sql/updates/db_world/2025_08_12_01.sql
Normal file
@ -0,0 +1,6 @@
|
||||
-- DB update 2025_08_12_00 -> 2025_08_12_01
|
||||
-- Anub'ar Guardian - Sunder Armor, Sunder Armor(H)
|
||||
DELETE FROM `spell_custom_attr` WHERE `spell_id` IN (53618, 59350);
|
||||
INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES
|
||||
(53618, 4194304),
|
||||
(59350, 4194304);
|
||||
8
data/sql/updates/db_world/2025_08_13_00.sql
Normal file
8
data/sql/updates/db_world/2025_08_13_00.sql
Normal file
@ -0,0 +1,8 @@
|
||||
-- DB update 2025_08_12_01 -> 2025_08_13_00
|
||||
-- Anub'ar Venomancer - Poison Bolt
|
||||
DELETE FROM `spell_custom_attr` WHERE `spell_id` = 53617;
|
||||
INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (53617, 4194304);
|
||||
|
||||
-- Anub'ar Venomancer - Poison Bolt(H)
|
||||
DELETE FROM `spell_custom_attr` WHERE `spell_id` = 59359;
|
||||
INSERT INTO `spell_custom_attr` (`spell_id`, `attributes`) VALUES (59359, 4194304);
|
||||
@ -35,7 +35,6 @@
|
||||
template<class OBJECT>
|
||||
struct ContainerMapList
|
||||
{
|
||||
//std::map<OBJECT_HANDLE, OBJECT *> _element;
|
||||
GridRefMgr<OBJECT> _element;
|
||||
};
|
||||
|
||||
|
||||
@ -656,7 +656,7 @@ Allow.IP.Based.Action.Logging = 0
|
||||
Appender.Console=1,4,0,"1 9 3 6 5 8"
|
||||
Appender.Server=2,5,0,Server.log,w
|
||||
# Appender.GM=2,5,15,gm_%s.log
|
||||
Appender.Errors=2,5,0,Errors.log,w
|
||||
Appender.Errors=2,2,0,Errors.log,w
|
||||
# Appender.DB=3,5,0
|
||||
|
||||
# Logger config values: Given a logger "name"
|
||||
@ -685,6 +685,7 @@ Logger.mmaps=4,Server
|
||||
Logger.scripts.hotswap=4,Console Server
|
||||
Logger.server=4,Console Server
|
||||
Logger.sql.sql=2,Console Errors
|
||||
Logger.sql.updates=4,Console Server Errors
|
||||
Logger.sql=4,Console Server
|
||||
Logger.time.update=4,Console Server
|
||||
Logger.module=4,Console Server
|
||||
@ -783,7 +784,6 @@ Logger.spells.scripts=2,Console Errors
|
||||
#Logger.spells=4,Console Server
|
||||
#Logger.sql.dev=4,Console Server
|
||||
#Logger.sql.driver=4,Console Server
|
||||
#Logger.sql.updates=4,Console Server
|
||||
#Logger.vehicles=4,Console Server
|
||||
#Logger.warden=4,Console Server
|
||||
#Logger.weather=4,Console Server
|
||||
|
||||
@ -104,7 +104,7 @@ void TotemAI::UpdateAI(uint32 /*diff*/)
|
||||
victim = nullptr;
|
||||
Acore::NearestAttackableUnitInObjectRangeCheck u_check(me, me, max_range);
|
||||
Acore::UnitLastSearcher<Acore::NearestAttackableUnitInObjectRangeCheck> checker(me, victim, u_check);
|
||||
Cell::VisitAllObjects(me, checker, max_range);
|
||||
Cell::VisitObjects(me, checker, max_range);
|
||||
}
|
||||
|
||||
if (!victim && me->GetCharmerOrOwnerOrSelf()->IsInCombat())
|
||||
|
||||
@ -491,7 +491,7 @@ Unit* ScriptedAI::DoSelectLowestHpFriendly(float range, uint32 minHPDiff)
|
||||
Unit* unit = nullptr;
|
||||
Acore::MostHPMissingInRange u_check(me, range, minHPDiff);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
Cell::VisitAllObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
|
||||
return unit;
|
||||
}
|
||||
@ -501,7 +501,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyCC(float range)
|
||||
std::list<Creature*> list;
|
||||
Acore::FriendlyCCedInRange u_check(me, range);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, list, u_check);
|
||||
Cell::VisitAllObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -510,7 +510,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 u
|
||||
std::list<Creature*> list;
|
||||
Acore::FriendlyMissingBuffInRange u_check(me, range, uiSpellid);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, list, u_check);
|
||||
Cell::VisitAllObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -521,7 +521,7 @@ Player* ScriptedAI::GetPlayerAtMinimumRange(float minimumRange)
|
||||
Acore::PlayerAtMinimumRangeAway check(me, minimumRange);
|
||||
Acore::PlayerSearcher<Acore::PlayerAtMinimumRangeAway> searcher(me, player, check);
|
||||
|
||||
Cell::VisitWorldObjects(me, searcher, minimumRange);
|
||||
Cell::VisitObjects(me, searcher, minimumRange);
|
||||
|
||||
return player;
|
||||
}
|
||||
|
||||
@ -72,6 +72,8 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
|
||||
|
||||
mcanSpawn = true;
|
||||
|
||||
_chaseOnInterrupt = false;
|
||||
|
||||
// Xinef: Vehicle conditions
|
||||
m_ConditionsTimer = 0;
|
||||
if (me->GetVehicleKit())
|
||||
|
||||
@ -212,6 +212,9 @@ public:
|
||||
// Xinef
|
||||
void SetWPPauseTimer(uint32 time) { mWPPauseTimer = time; }
|
||||
|
||||
void SetChaseOnInterrupt(bool apply) { _chaseOnInterrupt = apply; }
|
||||
[[nodiscard]] bool CanChaseOnInterrupt() const { return _chaseOnInterrupt; }
|
||||
|
||||
private:
|
||||
bool mIsCharmed;
|
||||
uint32 mFollowCreditType;
|
||||
@ -257,6 +260,8 @@ private:
|
||||
void CheckConditions(const uint32 diff);
|
||||
ConditionList conditions;
|
||||
uint32 m_ConditionsTimer;
|
||||
|
||||
bool _chaseOnInterrupt;
|
||||
};
|
||||
|
||||
class SmartGameObjectAI : public GameObjectAI
|
||||
|
||||
@ -742,6 +742,8 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
if (e.action.cast.castFlags & SMARTCAST_COMBAT_MOVE)
|
||||
{
|
||||
CAST_AI(SmartAI, me->AI())->SetChaseOnInterrupt(true);
|
||||
|
||||
if (!me->isMoving()) // Don't try to reposition while we are moving
|
||||
{
|
||||
// If cast flag SMARTCAST_COMBAT_MOVE is set combat movement will not be allowed unless target is outside spell range, out of mana, or LOS.
|
||||
@ -4030,7 +4032,7 @@ void SmartScript::GetWorldObjectsInDist(ObjectVector& targets, float dist) const
|
||||
|
||||
Acore::AllWorldObjectsInRange u_check(obj, dist);
|
||||
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(obj, targets, u_check);
|
||||
Cell::VisitAllObjects(obj, searcher, dist);
|
||||
Cell::VisitObjects(obj, searcher, dist);
|
||||
}
|
||||
|
||||
void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, uint32 var1, bool bvar, SpellInfo const* spell, GameObject* gob)
|
||||
@ -5252,7 +5254,7 @@ Unit* SmartScript::DoSelectLowestHpFriendly(float range, uint32 MinHPDiff) const
|
||||
|
||||
Acore::MostHPMissingInRange u_check(me, range, MinHPDiff);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
return unit;
|
||||
}
|
||||
|
||||
@ -5266,7 +5268,7 @@ Unit* SmartScript::DoSelectLowestHpPercentFriendly(float range, uint32 minHpPct,
|
||||
Unit* unit = nullptr;
|
||||
Acore::MostHPPercentMissingInRange u_check(me, range, minHpPct, maxHpPct);
|
||||
Acore::UnitLastSearcher<Acore::MostHPPercentMissingInRange> searcher(me, unit, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
return unit;
|
||||
}
|
||||
|
||||
@ -5277,7 +5279,7 @@ void SmartScript::DoFindFriendlyCC(std::vector<Creature*>& creatures, float rang
|
||||
|
||||
Acore::FriendlyCCedInRange u_check(me, range);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyCCedInRange> searcher(me, creatures, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
}
|
||||
|
||||
void SmartScript::DoFindFriendlyMissingBuff(std::vector<Creature*>& creatures, float range, uint32 spellid) const
|
||||
@ -5287,7 +5289,7 @@ void SmartScript::DoFindFriendlyMissingBuff(std::vector<Creature*>& creatures, f
|
||||
|
||||
Acore::FriendlyMissingBuffInRange u_check(me, range, spellid);
|
||||
Acore::CreatureListSearcher<Acore::FriendlyMissingBuffInRange> searcher(me, creatures, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
}
|
||||
|
||||
Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly) const
|
||||
@ -5298,7 +5300,7 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly) co
|
||||
Unit* unit = nullptr;
|
||||
Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck u_check(me, me, range, playerOnly);
|
||||
Acore::UnitLastSearcher<Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck> searcher(me, unit, u_check);
|
||||
Cell::VisitAllObjects(me, searcher, range);
|
||||
Cell::VisitObjects(me, searcher, range);
|
||||
return unit;
|
||||
}
|
||||
|
||||
|
||||
@ -754,8 +754,7 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement)
|
||||
Acore::BroadcastTextBuilder _builder(GetPlayer(), CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, GetPlayer()->getGender(), GetPlayer(), achievement->ID);
|
||||
Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> _localizer(_builder);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder>> _worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer);
|
||||
TypeContainerVisitor<Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> >, WorldTypeMapContainer > message(_worker);
|
||||
Cell::VisitWorldObjects(GetPlayer(), _worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
Cell::VisitObjects(GetPlayer(), _worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_EARNED, 8 + 4 + 8);
|
||||
|
||||
@ -805,7 +805,7 @@ Creature* Battlefield::SpawnCreature(uint32 entry, float x, float y, float z, fl
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Creature* creature = new Creature(true);
|
||||
Creature* creature = new Creature();
|
||||
if (!creature->Create(map->GenerateLowGuid<HighGuid::Unit>(), map, PHASEMASK_NORMAL, entry, 0, x, y, z, o))
|
||||
{
|
||||
LOG_ERROR("bg.battlefield", "Battlefield::SpawnCreature: Can't create creature entry: {}", entry);
|
||||
@ -1019,7 +1019,7 @@ bool BfCapturePoint::Update(uint32 diff)
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(capturePoint, radius);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(capturePoint, players, checker);
|
||||
Cell::VisitWorldObjects(capturePoint, searcher, radius);
|
||||
Cell::VisitObjects(capturePoint, searcher, radius);
|
||||
|
||||
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if ((*itr)->IsOutdoorPvPActive())
|
||||
|
||||
@ -571,7 +571,7 @@ GameObject* ChatHandler::GetNearbyGameObject() const
|
||||
GameObject* obj = nullptr;
|
||||
Acore::NearestGameObjectCheck check(*pl);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectCheck> searcher(pl, obj, check);
|
||||
Cell::VisitGridObjects(pl, searcher, SIZE_OF_GRIDS);
|
||||
Cell::VisitObjects(pl, searcher, SIZE_OF_GRIDS);
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@
|
||||
#include "UpdateMask.h"
|
||||
#include "World.h"
|
||||
|
||||
Corpse::Corpse(CorpseType type) : WorldObject(type != CORPSE_BONES), m_type(type)
|
||||
Corpse::Corpse(CorpseType type) : WorldObject(), m_type(type)
|
||||
{
|
||||
m_objectType |= TYPEMASK_CORPSE;
|
||||
m_objectTypeId = TYPEID_CORPSE;
|
||||
|
||||
@ -269,7 +269,7 @@ bool TemporaryThreatModifierEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/)
|
||||
return true;
|
||||
}
|
||||
|
||||
Creature::Creature(bool isWorldObject): Unit(isWorldObject), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_lootRecipientGroup(0),
|
||||
Creature::Creature(): Unit(), MovableMapObject(), m_groupLootTimer(0), lootingGroupLowGUID(0), m_lootRecipientGroup(0),
|
||||
m_corpseRemoveTime(0), m_respawnTime(0), m_respawnDelay(300), m_corpseDelay(60), m_wanderDistance(0.0f), m_boundaryCheckTime(2500),
|
||||
m_transportCheckTimer(1000), lootPickPocketRestoreTime(0), m_combatPulseTime(0), m_combatPulseDelay(0), m_reactState(REACT_AGGRESSIVE), m_defaultMovementType(IDLE_MOTION_TYPE),
|
||||
m_spawnId(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
|
||||
@ -371,7 +371,7 @@ void Creature::RemoveFromWorld()
|
||||
|
||||
void Creature::DisappearAndDie()
|
||||
{
|
||||
DestroyForNearbyPlayers();
|
||||
DestroyForVisiblePlayers();
|
||||
//SetVisibility(VISIBILITY_OFF);
|
||||
//ObjectAccessor::UpdateObjectVisibility(this);
|
||||
if (IsAlive())
|
||||
@ -408,7 +408,7 @@ void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility)
|
||||
setDeathState(DeathState::Dead);
|
||||
RemoveAllAuras();
|
||||
if (!skipVisibility) // pussywizard
|
||||
DestroyForNearbyPlayers(); // pussywizard: previous UpdateObjectVisibility()
|
||||
DestroyForVisiblePlayers(); // pussywizard: previous UpdateObjectVisibility()
|
||||
loot.clear();
|
||||
uint32 respawnDelay = m_respawnDelay;
|
||||
if (IsAIEnabled)
|
||||
@ -1079,7 +1079,7 @@ void Creature::DoFleeToGetAssistance()
|
||||
Acore::NearestAssistCreatureInCreatureRangeCheck u_check(this, GetVictim(), radius);
|
||||
Acore::CreatureLastSearcher<Acore::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
|
||||
|
||||
Cell::VisitGridObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
|
||||
SetNoSearchAssistance(true);
|
||||
UpdateSpeed(MOVE_RUN, false);
|
||||
@ -2400,7 +2400,7 @@ Unit* Creature::SelectNearestTarget(float dist, bool playerOnly /* = false */) c
|
||||
|
||||
Acore::NearestHostileUnitCheck u_check(this, dist, playerOnly);
|
||||
Acore::UnitLastSearcher<Acore::NearestHostileUnitCheck> searcher(this, target, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, dist);
|
||||
Cell::VisitObjects(this, searcher, dist);
|
||||
return target;
|
||||
}
|
||||
|
||||
@ -2417,7 +2417,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
|
||||
Unit* target = nullptr;
|
||||
Acore::NearestHostileUnitInAttackDistanceCheck u_check(this, dist);
|
||||
Acore::UnitLastSearcher<Acore::NearestHostileUnitInAttackDistanceCheck> searcher(this, target, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, std::max(dist, ATTACK_DISTANCE));
|
||||
Cell::VisitObjects(this, searcher, std::max(dist, ATTACK_DISTANCE));
|
||||
|
||||
return target;
|
||||
}
|
||||
@ -2453,7 +2453,7 @@ void Creature::CallAssistance(Unit* target /*= nullptr*/)
|
||||
|
||||
Acore::AnyAssistCreatureInRangeCheck u_check(this, target, radius);
|
||||
Acore::CreatureListSearcher<Acore::AnyAssistCreatureInRangeCheck> searcher(this, assistList, u_check);
|
||||
Cell::VisitGridObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
|
||||
if (!assistList.empty())
|
||||
{
|
||||
@ -2489,7 +2489,7 @@ void Creature::CallForHelp(float radius, Unit* target /*= nullptr*/)
|
||||
|
||||
Acore::CallOfHelpCreatureInRangeDo u_do(this, target, radius);
|
||||
Acore::CreatureWorker<Acore::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
Cell::VisitGridObjects(this, worker, radius);
|
||||
Cell::VisitObjects(this, worker, radius);
|
||||
}
|
||||
|
||||
bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction /*= true*/) const
|
||||
@ -3903,7 +3903,7 @@ bool Creature::IsUpdateNeeded()
|
||||
if (IsInCombat())
|
||||
return true;
|
||||
|
||||
if (IsVisibilityOverridden())
|
||||
if (!GetObjectVisibilityContainer().GetVisiblePlayersMap().empty())
|
||||
return true;
|
||||
|
||||
if (ToTempSummon())
|
||||
|
||||
@ -42,7 +42,7 @@ class CreatureGroup;
|
||||
class Creature : public Unit, public GridObject<Creature>, public MovableMapObject, public UpdatableMapObject
|
||||
{
|
||||
public:
|
||||
explicit Creature(bool isWorldObject = false);
|
||||
explicit Creature();
|
||||
~Creature() override;
|
||||
|
||||
void AddToWorld() override;
|
||||
|
||||
@ -24,8 +24,8 @@
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
TempSummon::TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) :
|
||||
Creature(isWorldObject), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
|
||||
TempSummon::TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner) :
|
||||
Creature(), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
|
||||
m_timer(0), m_lifetime(0), _visibleBySummonerOnly(false)
|
||||
{
|
||||
if (owner)
|
||||
@ -350,7 +350,7 @@ std::string TempSummon::GetDebugInfo() const
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
Minion::Minion(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : TempSummon(properties, owner, isWorldObject)
|
||||
Minion::Minion(SummonPropertiesEntry const* properties, ObjectGuid owner) : TempSummon(properties, owner)
|
||||
, m_owner(owner)
|
||||
{
|
||||
ASSERT(m_owner);
|
||||
@ -417,7 +417,7 @@ std::string Minion::GetDebugInfo() const
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
Guardian::Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject) : Minion(properties, owner, isWorldObject)
|
||||
Guardian::Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner)
|
||||
{
|
||||
m_unitTypeMask |= UNIT_MASK_GUARDIAN;
|
||||
if (properties && (properties->Type == SUMMON_TYPE_PET || properties->Category == SUMMON_CATEGORY_PET))
|
||||
@ -462,7 +462,7 @@ std::string Guardian::GetDebugInfo() const
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
Puppet::Puppet(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner, false), m_owner(owner) //maybe true?
|
||||
Puppet::Puppet(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner), m_owner(owner)
|
||||
{
|
||||
ASSERT(owner.IsPlayer());
|
||||
m_unitTypeMask |= UNIT_MASK_PUPPET;
|
||||
|
||||
@ -39,7 +39,7 @@ struct TempSummonData
|
||||
class TempSummon : public Creature
|
||||
{
|
||||
public:
|
||||
explicit TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject);
|
||||
explicit TempSummon(SummonPropertiesEntry const* properties, ObjectGuid owner);
|
||||
~TempSummon() override = default;
|
||||
void Update(uint32 time) override;
|
||||
virtual void InitStats(uint32 lifetime);
|
||||
@ -76,7 +76,7 @@ private:
|
||||
class Minion : public TempSummon
|
||||
{
|
||||
public:
|
||||
Minion(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject);
|
||||
Minion(SummonPropertiesEntry const* properties, ObjectGuid owner);
|
||||
void InitStats(uint32 duration) override;
|
||||
void RemoveFromWorld() override;
|
||||
[[nodiscard]] Unit* GetOwner() const;
|
||||
@ -95,7 +95,7 @@ protected:
|
||||
class Guardian : public Minion
|
||||
{
|
||||
public:
|
||||
Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner, bool isWorldObject);
|
||||
Guardian(SummonPropertiesEntry const* properties, ObjectGuid owner);
|
||||
void InitStats(uint32 duration) override;
|
||||
bool InitStatsForLevel(uint8 level);
|
||||
void InitSummon() override;
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "Transport.h"
|
||||
|
||||
DynamicObject::DynamicObject(bool isWorldObject) : WorldObject(isWorldObject), MovableMapObject(),
|
||||
DynamicObject::DynamicObject() : WorldObject(), MovableMapObject(),
|
||||
_aura(nullptr), _removedAura(nullptr), _caster(nullptr), _duration(0), _isViewpoint(false), _updateViewerVisibilityTimer(0)
|
||||
{
|
||||
m_objectType |= TYPEMASK_DYNAMICOBJECT;
|
||||
@ -128,11 +128,6 @@ bool DynamicObject::CreateDynamicObject(ObjectGuid::LowType guidlow, Unit* caste
|
||||
return false;
|
||||
}
|
||||
|
||||
if (IsWorldObject())
|
||||
{
|
||||
setActive(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ enum DynamicObjectType
|
||||
class DynamicObject : public WorldObject, public GridObject<DynamicObject>, public MovableMapObject, public UpdatableMapObject
|
||||
{
|
||||
public:
|
||||
DynamicObject(bool isWorldObject);
|
||||
DynamicObject();
|
||||
~DynamicObject() override;
|
||||
|
||||
void AddToWorld() override;
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include <G3D/CoordinateFrame.h>
|
||||
#include <G3D/Quat.h>
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), MovableMapObject(),
|
||||
GameObject::GameObject() : WorldObject(), MovableMapObject(),
|
||||
m_model(nullptr), m_goValue(), m_AI(nullptr)
|
||||
{
|
||||
m_objectType |= TYPEMASK_GAMEOBJECT;
|
||||
@ -721,7 +721,7 @@ void GameObject::Update(uint32 diff)
|
||||
{
|
||||
Acore::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
|
||||
Acore::UnitSearcher<Acore::NearestAttackableNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
|
||||
Cell::VisitAllObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
}
|
||||
else // environmental trap
|
||||
{
|
||||
@ -730,7 +730,7 @@ void GameObject::Update(uint32 diff)
|
||||
Player* player = nullptr;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(this, radius, true, true);
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, player, checker);
|
||||
Cell::VisitWorldObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
target = player;
|
||||
}
|
||||
|
||||
@ -893,7 +893,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (!m_spawnedByDefault)
|
||||
{
|
||||
m_respawnTime = 0;
|
||||
DestroyForNearbyPlayers(); // xinef: old UpdateObjectVisibility();
|
||||
DestroyForVisiblePlayers(); // xinef: old UpdateObjectVisibility();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -904,7 +904,7 @@ void GameObject::Update(uint32 diff)
|
||||
if (GetMap()->IsDungeon())
|
||||
SaveRespawnTime();
|
||||
|
||||
DestroyForNearbyPlayers(); // xinef: old UpdateObjectVisibility();
|
||||
DestroyForVisiblePlayers(); // xinef: old UpdateObjectVisibility();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1397,7 +1397,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range)
|
||||
Acore::NearestGameObjectFishingHole u_check(*this, range);
|
||||
Acore::GameObjectSearcher<Acore::NearestGameObjectFishingHole> checker(this, ok, u_check);
|
||||
|
||||
Cell::VisitGridObjects(this, checker, range);
|
||||
Cell::VisitObjects(this, checker, range);
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -3086,7 +3086,7 @@ bool GameObject::IsUpdateNeeded()
|
||||
if (GetMap()->isCellMarked(GetCurrentCell().GetCellCoord().GetId()))
|
||||
return true;
|
||||
|
||||
if (IsVisibilityOverridden())
|
||||
if (!GetObjectVisibilityContainer().GetVisiblePlayersMap().empty())
|
||||
return true;
|
||||
|
||||
if (IsTransport())
|
||||
|
||||
@ -156,8 +156,8 @@ public:
|
||||
|
||||
void SaveToDB(bool saveAddon = false);
|
||||
void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask, bool saveAddon = false);
|
||||
bool LoadFromDB(ObjectGuid::LowType guid, Map* map) { return LoadGameObjectFromDB(guid, map, false); }
|
||||
bool LoadGameObjectFromDB(ObjectGuid::LowType guid, Map* map, bool addToMap = true);
|
||||
virtual bool LoadFromDB(ObjectGuid::LowType guid, Map* map) { return LoadGameObjectFromDB(guid, map, false); }
|
||||
virtual bool LoadGameObjectFromDB(ObjectGuid::LowType guid, Map* map, bool addToMap = true);
|
||||
void DeleteFromDB();
|
||||
|
||||
void SetOwnerGUID(ObjectGuid owner)
|
||||
|
||||
@ -1150,7 +1150,7 @@ bool Item::IsBindedNotWith(Player const* player) const
|
||||
return true;
|
||||
}
|
||||
|
||||
void Item::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&)
|
||||
void Item::BuildUpdate(UpdateDataMapType& data_map)
|
||||
{
|
||||
if (Player* owner = GetOwner())
|
||||
BuildFieldsUpdate(owner, data_map);
|
||||
|
||||
@ -357,7 +357,7 @@ public:
|
||||
void ClearSoulboundTradeable(Player* currentOwner);
|
||||
bool CheckSoulboundTradeExpire();
|
||||
|
||||
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&) override;
|
||||
void BuildUpdate(UpdateDataMapType& data_map) override;
|
||||
void AddToObjectUpdate() override;
|
||||
void RemoveFromObjectUpdate() override;
|
||||
|
||||
|
||||
@ -86,17 +86,6 @@ Object::Object() : m_PackGUID(sizeof(uint64) + 1)
|
||||
WorldObject::~WorldObject()
|
||||
{
|
||||
sScriptMgr->OnWorldObjectDestroy(this);
|
||||
|
||||
// this may happen because there are many !create/delete
|
||||
if (IsWorldObject() && m_currMap)
|
||||
{
|
||||
if (IsCorpse())
|
||||
{
|
||||
LOG_FATAL("entities.object", "Object::~Object Corpse {}, type={} deleted but still in map!!", GetGUID().ToString(), ((Corpse*)this)->GetType());
|
||||
ABORT();
|
||||
}
|
||||
ResetMap();
|
||||
}
|
||||
}
|
||||
|
||||
Object::~Object()
|
||||
@ -1047,10 +1036,11 @@ void MovementInfo::OutDebug()
|
||||
LOG_INFO("movement", "splineElevation: {}", splineElevation);
|
||||
}
|
||||
|
||||
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(),
|
||||
LastUsedScriptID(0), m_name(""), m_isActive(false), m_visibilityDistanceOverride(), m_isWorldObject(isWorldObject), m_zoneScript(nullptr),
|
||||
WorldObject::WorldObject() : WorldLocation(),
|
||||
LastUsedScriptID(0), m_name(""), m_isActive(false), m_visibilityDistanceOverride(), m_zoneScript(nullptr),
|
||||
_zoneId(0), _areaId(0), _floorZ(INVALID_HEIGHT), _outdoors(false), _liquidData(), _updatePositionData(false), m_transport(nullptr),
|
||||
m_currMap(nullptr), _heartbeatTimer(HEARTBEAT_INTERVAL), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL), m_useCombinedPhases(true), m_notifyflags(0), m_executed_notifies(0)
|
||||
m_currMap(nullptr), _heartbeatTimer(HEARTBEAT_INTERVAL), m_InstanceId(0), m_phaseMask(PHASEMASK_NORMAL), m_useCombinedPhases(true),
|
||||
m_notifyflags(0), m_executed_notifies(0), _objectVisibilityContainer(this)
|
||||
{
|
||||
m_serverSideVisibility.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE | GHOST_VISIBILITY_GHOST);
|
||||
m_serverSideVisibilityDetect.SetValue(SERVERSIDE_VISIBILITY_GHOST, GHOST_VISIBILITY_ALIVE);
|
||||
@ -1082,31 +1072,14 @@ void WorldObject::setActive(bool on)
|
||||
|
||||
m_isActive = on;
|
||||
|
||||
if (on && !IsInWorld())
|
||||
if (!on || !IsInWorld())
|
||||
return;
|
||||
|
||||
Map* map = FindMap();
|
||||
if (!map)
|
||||
return;
|
||||
|
||||
if (on)
|
||||
{
|
||||
if (IsCreature())
|
||||
map->AddToActive(this->ToCreature());
|
||||
else if (IsDynamicObject())
|
||||
map->AddToActive((DynamicObject*)this);
|
||||
else if (IsGameObject())
|
||||
map->AddToActive((GameObject*)this);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsCreature())
|
||||
map->RemoveFromActive(this->ToCreature());
|
||||
else if (IsDynamicObject())
|
||||
map->RemoveFromActive((DynamicObject*)this);
|
||||
else if (IsGameObject())
|
||||
map->RemoveFromActive((GameObject*)this);
|
||||
}
|
||||
map->AddObjectToPendingUpdateList(this);
|
||||
}
|
||||
|
||||
void WorldObject::SetVisibilityDistanceOverride(VisibilityDistanceType type)
|
||||
@ -1177,7 +1150,9 @@ void WorldObject::RemoveFromWorld()
|
||||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
DestroyForNearbyPlayers();
|
||||
DestroyForVisiblePlayers();
|
||||
|
||||
GetObjectVisibilityContainer().CleanVisibilityReferences();
|
||||
|
||||
Object::RemoveFromWorld();
|
||||
}
|
||||
@ -2073,19 +2048,19 @@ void Unit::BuildHeartBeatMsg(WorldPacket* data) const
|
||||
void WorldObject::SendMessageToSet(WorldPacket const* data, bool self) const
|
||||
{
|
||||
if (IsInWorld())
|
||||
SendMessageToSetInRange(data, GetVisibilityRange(), self);
|
||||
SendMessageToSetInRange(data, 0.0f, self);
|
||||
}
|
||||
|
||||
void WorldObject::SendMessageToSetInRange(WorldPacket const* data, float dist, bool /*self*/) const
|
||||
{
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist);
|
||||
Cell::VisitWorldObjects(this, notifier, dist);
|
||||
notifier.Visit(GetObjectVisibilityContainer().GetVisiblePlayersMap());
|
||||
}
|
||||
|
||||
void WorldObject::SendMessageToSet(WorldPacket const* data, Player const* skipped_rcvr) const
|
||||
{
|
||||
Acore::MessageDistDeliverer notifier(this, data, GetVisibilityRange(), false, skipped_rcvr);
|
||||
Cell::VisitWorldObjects(this, notifier, GetVisibilityRange());
|
||||
Acore::MessageDistDeliverer notifier(this, data, 0.0f, false, skipped_rcvr);
|
||||
notifier.Visit(GetObjectVisibilityContainer().GetVisiblePlayersMap());
|
||||
}
|
||||
|
||||
void WorldObject::SendObjectDeSpawnAnim(ObjectGuid guid)
|
||||
@ -2116,9 +2091,6 @@ void WorldObject::SetMap(Map* map)
|
||||
m_InstanceId = map->GetInstanceId();
|
||||
|
||||
sScriptMgr->OnWorldObjectSetMap(this, map);
|
||||
|
||||
if (IsWorldObject())
|
||||
m_currMap->AddWorldObject(this);
|
||||
}
|
||||
|
||||
void WorldObject::ResetMap()
|
||||
@ -2126,11 +2098,6 @@ void WorldObject::ResetMap()
|
||||
ASSERT(m_currMap);
|
||||
ASSERT(!IsInWorld());
|
||||
|
||||
if (IsWorldObject())
|
||||
{
|
||||
m_currMap->RemoveWorldObject(this);
|
||||
}
|
||||
|
||||
sScriptMgr->OnWorldObjectResetMap(this);
|
||||
|
||||
m_currMap = nullptr;
|
||||
@ -2212,10 +2179,10 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
switch (mask)
|
||||
{
|
||||
case UNIT_MASK_SUMMON:
|
||||
summon = new TempSummon(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty, false);
|
||||
summon = new TempSummon(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
|
||||
break;
|
||||
case UNIT_MASK_GUARDIAN:
|
||||
summon = new Guardian(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty, false);
|
||||
summon = new Guardian(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
|
||||
break;
|
||||
case UNIT_MASK_PUPPET:
|
||||
summon = new Puppet(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
|
||||
@ -2224,7 +2191,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
summon = new Totem(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
|
||||
break;
|
||||
case UNIT_MASK_MINION:
|
||||
summon = new Minion(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty, false);
|
||||
summon = new Minion(properties, summoner ? summoner->GetGUID() : ObjectGuid::Empty);
|
||||
break;
|
||||
default:
|
||||
return nullptr;
|
||||
@ -2258,7 +2225,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
|
||||
|
||||
// call MoveInLineOfSight for nearby creatures
|
||||
Acore::AIRelocationNotifier notifier(*summon);
|
||||
Cell::VisitAllObjects(summon, notifier, GetVisibilityRange());
|
||||
Cell::VisitObjects(summon, notifier, GetVisibilityRange());
|
||||
|
||||
return summon;
|
||||
}
|
||||
@ -2443,7 +2410,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
|
||||
Creature* creature = nullptr;
|
||||
Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
|
||||
Acore::CreatureLastSearcher<Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
|
||||
Cell::VisitAllObjects(this, searcher, range);
|
||||
Cell::VisitObjects(this, searcher, range);
|
||||
return creature;
|
||||
}
|
||||
|
||||
@ -2452,7 +2419,7 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range, bool o
|
||||
GameObject* go = nullptr;
|
||||
Acore::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range, onlySpawned);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
|
||||
Cell::VisitGridObjects(this, searcher, range);
|
||||
Cell::VisitObjects(this, searcher, range);
|
||||
return go;
|
||||
}
|
||||
|
||||
@ -2461,7 +2428,7 @@ GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float
|
||||
GameObject* go = nullptr;
|
||||
Acore::NearestGameObjectTypeInObjectRangeCheck checker(*this, type, range);
|
||||
Acore::GameObjectLastSearcher<Acore::NearestGameObjectTypeInObjectRangeCheck> searcher(this, go, checker);
|
||||
Cell::VisitGridObjects(this, searcher, range);
|
||||
Cell::VisitObjects(this, searcher, range);
|
||||
return go;
|
||||
}
|
||||
|
||||
@ -2471,7 +2438,7 @@ Player* WorldObject::SelectNearestPlayer(float distance) const
|
||||
|
||||
Acore::NearestPlayerInObjectRangeCheck checker(this, distance);
|
||||
Acore::PlayerLastSearcher<Acore::NearestPlayerInObjectRangeCheck> searcher(this, target, checker);
|
||||
Cell::VisitWorldObjects(this, searcher, distance);
|
||||
Cell::VisitObjects(this, searcher, distance);
|
||||
|
||||
return target;
|
||||
}
|
||||
@ -2489,35 +2456,35 @@ void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameo
|
||||
{
|
||||
Acore::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange);
|
||||
Acore::GameObjectListSearcher<Acore::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check);
|
||||
Cell::VisitGridObjects(this, searcher, maxSearchRange);
|
||||
Cell::VisitObjects(this, searcher, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, std::vector<uint32> const& entries, float maxSearchRange) const
|
||||
{
|
||||
Acore::AllGameObjectsMatchingOneEntryInRange check(this, entries, maxSearchRange);
|
||||
Acore::GameObjectListSearcher searcher(this, gameobjectList, check);
|
||||
Cell::VisitGridObjects(this, searcher, maxSearchRange);
|
||||
Cell::VisitObjects(this, searcher, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const
|
||||
{
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
Cell::VisitGridObjects(this, searcher, maxSearchRange);
|
||||
Cell::VisitObjects(this, searcher, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, std::vector<uint32> const& entries, float maxSearchRange) const
|
||||
{
|
||||
Acore::AllCreaturesMatchingOneEntryInRange check(this, entries, maxSearchRange);
|
||||
Acore::CreatureListSearcher searcher(this, creatureList, check);
|
||||
Cell::VisitGridObjects(this, searcher, maxSearchRange);
|
||||
Cell::VisitObjects(this, searcher, maxSearchRange);
|
||||
}
|
||||
|
||||
void WorldObject::GetDeadCreatureListInGrid(std::list<Creature*>& creaturedeadList, float maxSearchRange, bool alive /*= false*/) const
|
||||
{
|
||||
Acore::AllDeadCreaturesInRange check(this, maxSearchRange, alive);
|
||||
Acore::CreatureListSearcher<Acore::AllDeadCreaturesInRange> searcher(this, creaturedeadList, check);
|
||||
Cell::VisitGridObjects(this, searcher, maxSearchRange);
|
||||
Cell::VisitObjects(this, searcher, maxSearchRange);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2906,72 +2873,49 @@ void WorldObject::PlayDirectSound(uint32 sound_id, Player* target /*= nullptr*/)
|
||||
|
||||
void WorldObject::PlayRadiusSound(uint32 sound_id, float radius)
|
||||
{
|
||||
std::list<Player*> targets;
|
||||
std::vector<Player*> targets;
|
||||
Acore::AnyPlayerInObjectRangeCheck check(this, radius, false);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
Cell::VisitWorldObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
|
||||
for (Player* player : targets)
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
player->SendDirectMessage(WorldPackets::Misc::Playsound(sound_id).Write());
|
||||
}
|
||||
}
|
||||
player->SendDirectMessage(WorldPackets::Misc::Playsound(sound_id).Write());
|
||||
}
|
||||
|
||||
void WorldObject::PlayDirectMusic(uint32 music_id, Player* target /*= nullptr*/)
|
||||
{
|
||||
if (target)
|
||||
{
|
||||
target->SendDirectMessage(WorldPackets::Misc::PlayMusic(music_id).Write());
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageToSet(WorldPackets::Misc::PlayMusic(music_id).Write(), true);
|
||||
}
|
||||
}
|
||||
|
||||
void WorldObject::PlayRadiusMusic(uint32 music_id, float radius)
|
||||
{
|
||||
std::list<Player*> targets;
|
||||
std::vector<Player*> targets;
|
||||
Acore::AnyPlayerInObjectRangeCheck check(this, radius, false);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
Cell::VisitWorldObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
|
||||
for (Player* player : targets)
|
||||
{
|
||||
if (player)
|
||||
{
|
||||
player->SendDirectMessage(WorldPackets::Misc::PlayMusic(music_id).Write());
|
||||
}
|
||||
}
|
||||
player->SendDirectMessage(WorldPackets::Misc::PlayMusic(music_id).Write());
|
||||
}
|
||||
|
||||
void WorldObject::DestroyForNearbyPlayers()
|
||||
// Removes us from visibility for all players who are currently able to see us
|
||||
void WorldObject::DestroyForVisiblePlayers()
|
||||
{
|
||||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
std::list<Player*> targets;
|
||||
Acore::AnyPlayerInObjectRangeCheck check(this, GetVisibilityRange() + VISIBILITY_COMPENSATION, false);
|
||||
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(this, targets, check);
|
||||
Cell::VisitWorldObjects(this, searcher, GetVisibilityRange());
|
||||
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
VisiblePlayersMap& visiblePlayerMap = GetObjectVisibilityContainer().GetVisiblePlayersMap();
|
||||
for (VisiblePlayersMap::iterator itr = visiblePlayerMap.begin(); itr != visiblePlayerMap.end();)
|
||||
{
|
||||
Player* player = (*iter);
|
||||
|
||||
if (player == this)
|
||||
continue;
|
||||
|
||||
if (!player->HaveAtClient(this))
|
||||
continue;
|
||||
|
||||
if (IsUnit() && ((Unit*)this)->GetCharmerGUID() == player->GetGUID()) /// @todo: this is for puppet
|
||||
continue;
|
||||
Player* player = itr->second;
|
||||
|
||||
DestroyForPlayer(player);
|
||||
player->m_clientGUIDs.erase(GetGUID());
|
||||
|
||||
// Clean up visibility references now
|
||||
itr = GetObjectVisibilityContainer().UnlinkVisibilityFromWorldObject(player, itr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2979,7 +2923,7 @@ void WorldObject::UpdateObjectVisibility(bool /*forced*/, bool /*fromUpdate*/)
|
||||
{
|
||||
//updates object's visibility for nearby players
|
||||
Acore::VisibleChangesNotifier notifier(*this);
|
||||
Cell::VisitWorldObjects(this, notifier, GetVisibilityRange());
|
||||
Cell::VisitObjects(this, notifier, GetVisibilityRange());
|
||||
}
|
||||
|
||||
void WorldObject::AddToNotify(uint16 f)
|
||||
@ -3008,84 +2952,17 @@ void WorldObject::AddToNotify(uint16 f)
|
||||
}
|
||||
}
|
||||
|
||||
struct WorldObjectChangeAccumulator
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map)
|
||||
{
|
||||
UpdateDataMapType& i_updateDatas;
|
||||
UpdatePlayerSet& i_playerSet;
|
||||
WorldObject& i_object;
|
||||
WorldObjectChangeAccumulator(WorldObject& obj, UpdateDataMapType& d, UpdatePlayerSet& p) : i_updateDatas(d), i_playerSet(p), i_object(obj)
|
||||
// Build update for self
|
||||
if (IsPlayer())
|
||||
BuildFieldsUpdate(ToPlayer(), data_map);
|
||||
|
||||
// Build update for visible players
|
||||
DoForAllVisiblePlayers([this, &data_map](Player* player)
|
||||
{
|
||||
i_playerSet.clear();
|
||||
}
|
||||
void Visit(PlayerMapType& m)
|
||||
{
|
||||
Player* source = nullptr;
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->GetSource();
|
||||
|
||||
BuildPacket(source);
|
||||
|
||||
if (source->HasSharedVision())
|
||||
{
|
||||
SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
|
||||
for (; it != source->GetSharedVisionList().end(); ++it)
|
||||
BuildPacket(*it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Visit(CreatureMapType& m)
|
||||
{
|
||||
Creature* source = nullptr;
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->GetSource();
|
||||
if (source->HasSharedVision())
|
||||
{
|
||||
SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
|
||||
for (; it != source->GetSharedVisionList().end(); ++it)
|
||||
BuildPacket(*it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Visit(DynamicObjectMapType& m)
|
||||
{
|
||||
DynamicObject* source = nullptr;
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
source = iter->GetSource();
|
||||
ObjectGuid guid = source->GetCasterGUID();
|
||||
|
||||
if (guid)
|
||||
{
|
||||
//Caster may be nullptr if DynObj is in removelist
|
||||
if (Player* caster = ObjectAccessor::FindPlayer(guid))
|
||||
if (caster->GetGuidValue(PLAYER_FARSIGHT) == source->GetGUID())
|
||||
BuildPacket(caster);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void BuildPacket(Player* player)
|
||||
{
|
||||
// Only send update once to a player
|
||||
if (i_playerSet.find(player->GetGUID()) == i_playerSet.end() && player->HaveAtClient(&i_object))
|
||||
{
|
||||
i_object.BuildFieldsUpdate(player, i_updateDatas);
|
||||
i_playerSet.insert(player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
template<class SKIP> void Visit(GridRefMgr<SKIP>&) {}
|
||||
};
|
||||
|
||||
void WorldObject::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set)
|
||||
{
|
||||
WorldObjectChangeAccumulator notifier(*this, data_map, player_set);
|
||||
//we must build packets for all visible players
|
||||
Cell::VisitWorldObjects(this, notifier, GetVisibilityRange());
|
||||
BuildFieldsUpdate(player, data_map);
|
||||
});
|
||||
|
||||
ClearUpdateMask(false);
|
||||
}
|
||||
@ -3094,7 +2971,7 @@ void WorldObject::GetCreaturesWithEntryInRange(std::list<Creature*>& creatureLis
|
||||
{
|
||||
Acore::AllCreaturesOfEntryInRange check(this, entry, radius);
|
||||
Acore::CreatureListSearcher<Acore::AllCreaturesOfEntryInRange> searcher(this, creatureList, check);
|
||||
Cell::VisitAllObjects(this, searcher, radius);
|
||||
Cell::VisitObjects(this, searcher, radius);
|
||||
}
|
||||
|
||||
void WorldObject::AddToObjectUpdate()
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include "Position.h"
|
||||
#include "UpdateData.h"
|
||||
#include "UpdateMask.h"
|
||||
#include "ObjectVisibilityContainer.h"
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
@ -96,7 +97,6 @@ class MotionTransport;
|
||||
struct PositionFullTerrainStatus;
|
||||
|
||||
typedef std::unordered_map<Player*, UpdateData> UpdateDataMapType;
|
||||
typedef GuidUnorderedSet UpdatePlayerSet;
|
||||
|
||||
static constexpr Milliseconds HEARTBEAT_INTERVAL = 5s + 200ms;
|
||||
|
||||
@ -189,7 +189,7 @@ public:
|
||||
|
||||
[[nodiscard]] virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
|
||||
[[nodiscard]] virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
|
||||
virtual void BuildUpdate(UpdateDataMapType&, UpdatePlayerSet&) {}
|
||||
virtual void BuildUpdate(UpdateDataMapType&) {}
|
||||
void BuildFieldsUpdate(Player*, UpdateDataMapType&);
|
||||
|
||||
void SetFieldNotifyFlag(uint16 flag) { _fieldNotifyFlags |= flag; }
|
||||
@ -460,7 +460,7 @@ private:
|
||||
class WorldObject : public Object, public WorldLocation
|
||||
{
|
||||
protected:
|
||||
explicit WorldObject(bool isWorldObject); //note: here it means if it is in grid object list or world object list
|
||||
explicit WorldObject();
|
||||
public:
|
||||
~WorldObject() override;
|
||||
|
||||
@ -559,6 +559,29 @@ public:
|
||||
void PlayDirectMusic(uint32 music_id, Player* target = nullptr);
|
||||
void PlayRadiusMusic(uint32 music_id, float radius);
|
||||
|
||||
// Warning: Possible iterator invalidation in uses that may modify visibility map
|
||||
template<typename Worker>
|
||||
void DoForAllVisiblePlayers(Worker&& worker)
|
||||
{
|
||||
for (auto const& kvPair : GetObjectVisibilityContainer().GetVisiblePlayersMap())
|
||||
worker(kvPair.second);
|
||||
}
|
||||
|
||||
// Warning: Possible iterator invalidation in uses that may modify visibility map
|
||||
template<typename Worker>
|
||||
void DoForAllVisibleWorldObjects(Worker&& worker)
|
||||
{
|
||||
// Not a player, no access to this map
|
||||
VisibleWorldObjectsMap const* visibleWorldObjectsMap = GetObjectVisibilityContainer().GetVisibleWorldObjectsMap();
|
||||
if (!visibleWorldObjectsMap)
|
||||
return;
|
||||
|
||||
for (auto const& kvPair : *visibleWorldObjectsMap)
|
||||
worker(kvPair.second);
|
||||
}
|
||||
|
||||
void DestroyForVisiblePlayers();
|
||||
|
||||
void SendObjectDeSpawnAnim(ObjectGuid guid);
|
||||
|
||||
virtual void SaveRespawnTime() {}
|
||||
@ -609,10 +632,9 @@ public:
|
||||
void GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, std::vector<uint32> const& entries, float maxSearchRange) const;
|
||||
void GetDeadCreatureListInGrid(std::list<Creature*>& lList, float maxSearchRange, bool alive = false) const;
|
||||
|
||||
void DestroyForNearbyPlayers();
|
||||
virtual void UpdateObjectVisibility(bool forced = true, bool fromUpdate = false);
|
||||
virtual void UpdateObjectVisibilityOnCreate() { UpdateObjectVisibility(true); }
|
||||
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet& player_set) override;
|
||||
void BuildUpdate(UpdateDataMapType& data_map) override;
|
||||
void GetCreaturesWithEntryInRange(std::list<Creature*>& creatureList, float radius, uint32 entry);
|
||||
|
||||
void SetPositionDataUpdate();
|
||||
@ -635,7 +657,6 @@ public:
|
||||
[[nodiscard]] bool IsFarVisible() const { return m_isFarVisible; }
|
||||
[[nodiscard]] bool IsVisibilityOverridden() const { return m_visibilityDistanceOverride.has_value(); }
|
||||
void SetVisibilityDistanceOverride(VisibilityDistanceType type);
|
||||
[[nodiscard]] bool IsWorldObject() const { return m_isWorldObject; }
|
||||
|
||||
[[nodiscard]] bool IsInWintergrasp() const
|
||||
{
|
||||
@ -688,6 +709,9 @@ public:
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
ObjectVisibilityContainer& GetObjectVisibilityContainer() { return _objectVisibilityContainer; }
|
||||
ObjectVisibilityContainer const& GetObjectVisibilityContainer() const { return _objectVisibilityContainer; }
|
||||
|
||||
// Event handler
|
||||
ElunaEventProcessor* elunaEvents;
|
||||
EventProcessor m_Events;
|
||||
@ -697,7 +721,6 @@ protected:
|
||||
bool m_isActive;
|
||||
bool m_isFarVisible;
|
||||
Optional<float> m_visibilityDistanceOverride;
|
||||
const bool m_isWorldObject;
|
||||
ZoneScript* m_zoneScript;
|
||||
|
||||
virtual void ProcessPositionDataChanged(PositionFullTerrainStatus const& data);
|
||||
@ -745,6 +768,8 @@ private:
|
||||
bool CanDetectStealthOf(WorldObject const* obj, bool checkAlert = false) const;
|
||||
|
||||
GuidUnorderedSet _allowedLooters;
|
||||
|
||||
ObjectVisibilityContainer _objectVisibilityContainer;
|
||||
};
|
||||
|
||||
namespace Acore
|
||||
|
||||
118
src/server/game/Entities/Object/ObjectVisibilityContainer.cpp
Normal file
118
src/server/game/Entities/Object/ObjectVisibilityContainer.cpp
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectVisibilityContainer.h"
|
||||
#include "Object.h"
|
||||
#include "Player.h"
|
||||
|
||||
/*
|
||||
* Some implementation notes:
|
||||
* Non-player worldobjects do not have any concept of 'visibility', thus,
|
||||
* the most important and mainly used map is 'VisibleWorldObjectsMap'
|
||||
* which is only accessible for player objects. The 'VisiblePlayersMap'
|
||||
* map is simply for managing the references so we can use direct pointers.
|
||||
*/
|
||||
|
||||
ObjectVisibilityContainer::ObjectVisibilityContainer(WorldObject* selfObject) :
|
||||
_selfObject(selfObject)
|
||||
{
|
||||
}
|
||||
|
||||
ObjectVisibilityContainer::~ObjectVisibilityContainer()
|
||||
{
|
||||
ASSERT(_visiblePlayersMap.empty());
|
||||
if (_visibleWorldObjectsMap)
|
||||
ASSERT((*_visibleWorldObjectsMap).empty());
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::InitForPlayer()
|
||||
{
|
||||
_visibleWorldObjectsMap = std::make_unique<VisibleWorldObjectsMap>();
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::CleanVisibilityReferences()
|
||||
{
|
||||
for (auto const& kvPair : _visiblePlayersMap)
|
||||
kvPair.second->GetObjectVisibilityContainer().DirectRemoveVisibilityReference(_selfObject->GetGUID());
|
||||
|
||||
if (_visibleWorldObjectsMap)
|
||||
{
|
||||
for (auto const& kvPair : *_visibleWorldObjectsMap)
|
||||
kvPair.second->GetObjectVisibilityContainer().DirectRemoveVisiblePlayerReference(_selfObject->GetGUID());
|
||||
|
||||
(*_visibleWorldObjectsMap).clear();
|
||||
}
|
||||
|
||||
_visiblePlayersMap.clear();
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::LinkWorldObjectVisibility(WorldObject* worldObject)
|
||||
{
|
||||
// Do not link self
|
||||
if (worldObject == _selfObject)
|
||||
return;
|
||||
|
||||
// Transports are special and should not be added to our visibility map
|
||||
if (worldObject->IsGameObject() && worldObject->ToGameObject()->IsTransport())
|
||||
return;
|
||||
|
||||
// Only players can link visibility
|
||||
if (!_visibleWorldObjectsMap)
|
||||
return;
|
||||
|
||||
(*_visibleWorldObjectsMap).insert(std::make_pair(worldObject->GetGUID(), worldObject));
|
||||
worldObject->GetObjectVisibilityContainer().DirectInsertVisiblePlayerReference(_selfObject->ToPlayer());
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::UnlinkWorldObjectVisibility(WorldObject* worldObject)
|
||||
{
|
||||
// Only players can unlink visibility
|
||||
if (!_visibleWorldObjectsMap)
|
||||
return;
|
||||
|
||||
worldObject->GetObjectVisibilityContainer().DirectRemoveVisiblePlayerReference(_selfObject->GetGUID());
|
||||
(*_visibleWorldObjectsMap).erase(worldObject->GetGUID());
|
||||
}
|
||||
|
||||
VisibleWorldObjectsMap::iterator ObjectVisibilityContainer::UnlinkVisibilityFromPlayer(WorldObject* worldObject, VisibleWorldObjectsMap::iterator itr)
|
||||
{
|
||||
ASSERT(_visibleWorldObjectsMap); // Ensure we aren't for some reason calling this as a non-player object
|
||||
worldObject->GetObjectVisibilityContainer().DirectRemoveVisiblePlayerReference(_selfObject->GetGUID());
|
||||
return (*_visibleWorldObjectsMap).erase(itr);
|
||||
}
|
||||
|
||||
VisiblePlayersMap::iterator ObjectVisibilityContainer::UnlinkVisibilityFromWorldObject(Player* player, VisiblePlayersMap::iterator itr)
|
||||
{
|
||||
player->GetObjectVisibilityContainer().DirectRemoveVisibilityReference(_selfObject->GetGUID());
|
||||
return _visiblePlayersMap.erase(itr);
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::DirectRemoveVisibilityReference(ObjectGuid guid)
|
||||
{
|
||||
ASSERT(_visibleWorldObjectsMap);
|
||||
(*_visibleWorldObjectsMap).erase(guid);
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::DirectInsertVisiblePlayerReference(Player* player)
|
||||
{
|
||||
_visiblePlayersMap.insert(std::make_pair(player->GetGUID(), player));
|
||||
}
|
||||
|
||||
void ObjectVisibilityContainer::DirectRemoveVisiblePlayerReference(ObjectGuid guid)
|
||||
{
|
||||
_visiblePlayersMap.erase(guid);
|
||||
}
|
||||
101
src/server/game/Entities/Object/ObjectVisibilityContainer.h
Normal file
101
src/server/game/Entities/Object/ObjectVisibilityContainer.h
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Affero General Public License as published by the
|
||||
* Free Software Foundation; either version 3 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _OBJECTVISIBILITYCONTAINER_H
|
||||
#define _OBJECTVISIBILITYCONTAINER_H
|
||||
|
||||
#include "Common.h"
|
||||
#include "ObjectGuid.h"
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
class Player;
|
||||
class WorldObject;
|
||||
|
||||
typedef std::unordered_map<ObjectGuid, WorldObject*> VisibleWorldObjectsMap;
|
||||
typedef std::unordered_map<ObjectGuid, Player*> VisiblePlayersMap;
|
||||
|
||||
// Class that manages the visibility containers of a worldobject
|
||||
class ObjectVisibilityContainer
|
||||
{
|
||||
public:
|
||||
ObjectVisibilityContainer(WorldObject* selfObject);
|
||||
~ObjectVisibilityContainer();
|
||||
|
||||
// Creates the _visibleWorldObjectsMap map if we are a player
|
||||
void InitForPlayer();
|
||||
|
||||
// Cleans up all visibility references from other worldobjects,
|
||||
// this is used before a worldobject is deleted to prevent any dangling references
|
||||
void CleanVisibilityReferences();
|
||||
|
||||
void LinkWorldObjectVisibility(WorldObject* worldObject);
|
||||
void UnlinkWorldObjectVisibility(WorldObject* worldObject);
|
||||
|
||||
// These helpers aren't ideal, but needed in a few spots for cleaning up references
|
||||
VisibleWorldObjectsMap::iterator UnlinkVisibilityFromPlayer(WorldObject* worldObject, VisibleWorldObjectsMap::iterator itr);
|
||||
VisiblePlayersMap::iterator UnlinkVisibilityFromWorldObject(Player* player, VisiblePlayersMap::iterator itr);
|
||||
|
||||
// Returns a list of all players who can see us
|
||||
VisiblePlayersMap& GetVisiblePlayersMap() { return _visiblePlayersMap; }
|
||||
VisiblePlayersMap const& GetVisiblePlayersMap() const { return _visiblePlayersMap; }
|
||||
|
||||
// Returns a list of all worldobjects who we can see
|
||||
// Warning: This is for player objects only, all other objects will return a nullptr
|
||||
VisibleWorldObjectsMap* GetVisibleWorldObjectsMap()
|
||||
{
|
||||
if (!_visibleWorldObjectsMap)
|
||||
return nullptr;
|
||||
|
||||
return _visibleWorldObjectsMap.get();
|
||||
}
|
||||
|
||||
VisibleWorldObjectsMap const* GetVisibleWorldObjectsMap() const
|
||||
{
|
||||
if (!_visibleWorldObjectsMap)
|
||||
return nullptr;
|
||||
|
||||
return _visibleWorldObjectsMap.get();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// Directly removes visibility reference. This is to be ONLY used as
|
||||
// a more efficient method for cleaning up visibility references.
|
||||
// Warning: Improper use will leave dangling references and result in crashes.
|
||||
void DirectRemoveVisibilityReference(ObjectGuid guid);
|
||||
|
||||
// Directly inserts player visibility reference.
|
||||
// Warning: Improper use will leave dangling references and result in crashes.
|
||||
void DirectInsertVisiblePlayerReference(Player* player);
|
||||
|
||||
// Directly removes player visibility reference.
|
||||
// Warning: Improper use will leave dangling references and result in crashes.
|
||||
void DirectRemoveVisiblePlayerReference(ObjectGuid guid);
|
||||
|
||||
WorldObject* _selfObject;
|
||||
|
||||
// List of all worldobjects that are visible to us (including other players)
|
||||
// Only players contain this map, thus we will only allocate it as needed.
|
||||
std::unique_ptr<VisibleWorldObjectsMap> _visibleWorldObjectsMap;
|
||||
|
||||
// List of players who are currently able to see this worldobject.
|
||||
// All worldobjects will contain this map
|
||||
VisiblePlayersMap _visiblePlayersMap;
|
||||
};
|
||||
|
||||
#endif
|
||||
@ -38,7 +38,7 @@
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : ObjectGuid::Empty, true),
|
||||
Pet::Pet(Player* owner, PetType type) : Guardian(nullptr, owner ? owner->GetGUID() : ObjectGuid::Empty),
|
||||
m_usedTalentCount(0),
|
||||
m_removed(false),
|
||||
m_owner(owner),
|
||||
@ -75,7 +75,7 @@ void Pet::AddToWorld()
|
||||
if (!IsInWorld())
|
||||
{
|
||||
///- Register the pet for guid lookup
|
||||
GetMap()->GetObjectsStore().Insert<Pet>(GetGUID(), this);
|
||||
GetMap()->GetObjectsStore().Insert<Creature>(GetGUID(), this);
|
||||
Unit::AddToWorld();
|
||||
Motion_Initialize();
|
||||
AIM_Initialize();
|
||||
@ -126,7 +126,7 @@ void Pet::RemoveFromWorld()
|
||||
{
|
||||
///- Don't call the function for Creature, normal mobs + totems go in a different storage
|
||||
Unit::RemoveFromWorld();
|
||||
GetMap()->GetObjectsStore().Remove<Pet>(GetGUID());
|
||||
GetMap()->GetObjectsStore().Remove<Creature>(GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4355)
|
||||
#endif
|
||||
Player::Player(WorldSession* session): Unit(true), m_mover(this)
|
||||
Player::Player(WorldSession* session): Unit(), m_mover(this)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default:4355)
|
||||
@ -412,6 +412,9 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
|
||||
m_isInstantFlightOn = true;
|
||||
|
||||
_wasOutdoor = true;
|
||||
|
||||
GetObjectVisibilityContainer().InitForPlayer();
|
||||
|
||||
sScriptMgr->OnConstructPlayer(this);
|
||||
}
|
||||
|
||||
@ -5707,20 +5710,7 @@ void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool s
|
||||
SendDirectMessage(data);
|
||||
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist);
|
||||
Cell::VisitWorldObjects(this, notifier, dist);
|
||||
}
|
||||
|
||||
void Player::SendMessageToSetInRange(WorldPacket const* data, float dist, bool self, bool includeMargin, bool ownTeamOnly, bool required3dDist) const
|
||||
{
|
||||
if (self)
|
||||
SendDirectMessage(data);
|
||||
|
||||
dist += GetObjectSize();
|
||||
if (includeMargin)
|
||||
dist += VISIBILITY_COMPENSATION; // pussywizard: to ensure everyone receives all important packets
|
||||
|
||||
Acore::MessageDistDeliverer notifier(this, data, dist, ownTeamOnly, nullptr, required3dDist);
|
||||
Cell::VisitWorldObjects(this, notifier, dist);
|
||||
notifier.Visit(GetObjectVisibilityContainer().GetVisiblePlayersMap());
|
||||
}
|
||||
|
||||
void Player::SendMessageToSet(WorldPacket const* data, Player const* skipped_rcvr) const
|
||||
@ -5728,8 +5718,8 @@ void Player::SendMessageToSet(WorldPacket const* data, Player const* skipped_rcv
|
||||
if (skipped_rcvr != this)
|
||||
SendDirectMessage(data);
|
||||
|
||||
Acore::MessageDistDeliverer notifier(this, data, GetVisibilityRange(), false, skipped_rcvr);
|
||||
Cell::VisitWorldObjects(this, notifier, GetVisibilityRange());
|
||||
Acore::MessageDistDeliverer notifier(this, data, 0.0f, false, skipped_rcvr);
|
||||
notifier.Visit(GetObjectVisibilityContainer().GetVisiblePlayersMap());
|
||||
}
|
||||
|
||||
void Player::SendDirectMessage(WorldPacket const* data) const
|
||||
@ -7711,23 +7701,26 @@ bool Player::CheckAmmoCompatibility(ItemTemplate const* ammo_proto) const
|
||||
|
||||
void Player::SendQuestGiverStatusMultiple()
|
||||
{
|
||||
if (GetObjectVisibilityContainer().GetVisibleWorldObjectsMap()->empty())
|
||||
return;
|
||||
|
||||
uint32 count = 0;
|
||||
|
||||
WorldPacket data(SMSG_QUESTGIVER_STATUS_MULTIPLE, 4);
|
||||
data << uint32(count); // placeholder
|
||||
|
||||
for (GuidUnorderedSet::const_iterator itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr)
|
||||
DoForAllVisibleWorldObjects([this, &data, &count](WorldObject* worldObject)
|
||||
{
|
||||
uint32 questStatus = DIALOG_STATUS_NONE;
|
||||
|
||||
if ((*itr).IsAnyTypeCreature())
|
||||
if (worldObject->IsCreature())
|
||||
{
|
||||
// need also pet quests case support
|
||||
Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, *itr);
|
||||
Creature* questgiver = worldObject->ToCreature();
|
||||
if (!questgiver || questgiver->IsHostileTo(this))
|
||||
continue;
|
||||
return;
|
||||
if (!questgiver->HasNpcFlag(UNIT_NPC_FLAG_QUESTGIVER))
|
||||
continue;
|
||||
return;
|
||||
|
||||
questStatus = GetQuestDialogStatus(questgiver);
|
||||
|
||||
@ -7735,11 +7728,11 @@ void Player::SendQuestGiverStatusMultiple()
|
||||
data << uint8(questStatus);
|
||||
++count;
|
||||
}
|
||||
else if ((*itr).IsGameObject())
|
||||
else if (worldObject->IsGameObject())
|
||||
{
|
||||
GameObject* questgiver = GetMap()->GetGameObject(*itr);
|
||||
GameObject* questgiver = worldObject->ToGameObject();
|
||||
if (!questgiver || questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
|
||||
continue;
|
||||
return;
|
||||
|
||||
questStatus = GetQuestDialogStatus(questgiver);
|
||||
|
||||
@ -7747,7 +7740,7 @@ void Player::SendQuestGiverStatusMultiple()
|
||||
data << uint8(questStatus);
|
||||
++count;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
data.put<uint32>(0, count); // write real count
|
||||
GetSession()->SendPacket(&data);
|
||||
@ -9383,7 +9376,12 @@ void Player::Say(std::string_view text, Language language, WorldObject const* /*
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_SAY, language, this, this, _text);
|
||||
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true, false, false, true);
|
||||
|
||||
SendDirectMessage(&data);
|
||||
|
||||
// Special handling for messages, do not use visibility map for stealthed units
|
||||
Acore::MessageDistDeliverer notifier(this, &data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), false, nullptr, true);
|
||||
Cell::VisitObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
}
|
||||
|
||||
void Player::Say(uint32 textId, WorldObject const* target /*= nullptr*/)
|
||||
@ -9404,7 +9402,12 @@ void Player::Yell(std::string_view text, Language language, WorldObject const* /
|
||||
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_YELL, language, this, this, _text);
|
||||
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true, false, false, true);
|
||||
|
||||
SendDirectMessage(&data);
|
||||
|
||||
// Special handling for messages, do not use visibility map for stealthed units
|
||||
Acore::MessageDistDeliverer notifier(this, &data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), false, nullptr, true);
|
||||
Cell::VisitObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL));
|
||||
}
|
||||
|
||||
void Player::Yell(uint32 textId, WorldObject const* target /*= nullptr*/)
|
||||
@ -9426,7 +9429,11 @@ void Player::TextEmote(std::string_view text, WorldObject const* /*= nullptr*/,
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_EMOTE, LANG_UNIVERSAL, this, this, _text);
|
||||
|
||||
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, false, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE), true);
|
||||
SendDirectMessage(&data);
|
||||
|
||||
// Special handling for messages, do not use visibility map for stealthed units
|
||||
Acore::MessageDistDeliverer notifier(this, &data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE), nullptr, true);
|
||||
Cell::VisitObjects(this, notifier, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
}
|
||||
|
||||
void Player::TextEmote(uint32 textId, WorldObject const* target /*= nullptr*/, bool /*isBossEmote = false*/)
|
||||
@ -10487,35 +10494,24 @@ void Player::ContinueTaxiFlight()
|
||||
|
||||
void Player::SendTaxiNodeStatusMultiple()
|
||||
{
|
||||
for (auto itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr)
|
||||
DoForAllVisibleWorldObjects([this](WorldObject* worldObject)
|
||||
{
|
||||
if (!itr->IsCreature())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Creature* creature = ObjectAccessor::GetCreature(*this, *itr);
|
||||
Creature* creature = worldObject->ToCreature();
|
||||
if (!creature || creature->IsHostileTo(this))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
|
||||
if (!creature->HasNpcFlag(UNIT_NPC_FLAG_FLIGHTMASTER))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
|
||||
uint32 nearestNode = sObjectMgr->GetNearestTaxiNode(creature->GetPositionX(), creature->GetPositionY(), creature->GetPositionZ(), creature->GetMapId(), GetTeamId());
|
||||
if (!nearestNode)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
|
||||
WorldPacket data(SMSG_TAXINODE_STATUS, 9);
|
||||
data << *itr;
|
||||
data << creature->GetGUID();
|
||||
data << uint8(m_taxi.IsTaximaskNodeKnown(nearestNode) ? 1 : 0);
|
||||
SendDirectMessage(&data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Player::ProhibitSpellSchool(SpellSchoolMask idSchoolMask, uint32 unTimeMs)
|
||||
@ -11393,31 +11389,22 @@ WorldLocation Player::GetStartPosition() const
|
||||
|
||||
bool Player::HaveAtClient(WorldObject const* u) const
|
||||
{
|
||||
if (u == this)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// Motion Transports are always present in player's client
|
||||
if (GameObject const* gameobject = u->ToGameObject())
|
||||
{
|
||||
if (gameobject->IsMotionTransport())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return m_clientGUIDs.find(u->GetGUID()) != m_clientGUIDs.end();
|
||||
return HaveAtClient(u->GetGUID());
|
||||
}
|
||||
|
||||
bool Player::HaveAtClient(ObjectGuid guid) const
|
||||
{
|
||||
if (guid == GetGUID())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return m_clientGUIDs.find(guid) != m_clientGUIDs.end();
|
||||
return GetObjectVisibilityContainer().GetVisibleWorldObjectsMap()->find(guid) != GetObjectVisibilityContainer().GetVisibleWorldObjectsMap()->end();
|
||||
}
|
||||
|
||||
bool Player::IsNeverVisible() const
|
||||
|
||||
@ -2043,7 +2043,6 @@ public:
|
||||
|
||||
void SendMessageToSet(WorldPacket const* data, bool self) const override;
|
||||
void SendMessageToSetInRange(WorldPacket const* data, float dist, bool self) const override;
|
||||
void SendMessageToSetInRange(WorldPacket const* data, float dist, bool self, bool includeMargin, bool ownTeamOnly, bool required3dDist = false) const;
|
||||
void SendMessageToSet(WorldPacket const* data, Player const* skipped_rcvr) const override;
|
||||
void SendTeleportAckPacket();
|
||||
|
||||
@ -2397,7 +2396,6 @@ public:
|
||||
void SetEntryPoint();
|
||||
|
||||
// currently visible objects at player client
|
||||
GuidUnorderedSet m_clientGUIDs;
|
||||
std::vector<Unit*> m_newVisible; // pussywizard
|
||||
|
||||
[[nodiscard]] bool HaveAtClient(WorldObject const* u) const;
|
||||
|
||||
@ -1601,13 +1601,13 @@ void Player::UpdateVisibilityForPlayer(bool mapChange)
|
||||
Acore::VisibleNotifier notifierNoLarge(
|
||||
*this, mapChange,
|
||||
false); // visit only objects which are not large; default distance
|
||||
Cell::VisitAllObjects(m_seer, notifierNoLarge,
|
||||
Cell::VisitObjects(m_seer, notifierNoLarge,
|
||||
GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
|
||||
notifierNoLarge.SendToSelf();
|
||||
|
||||
Acore::VisibleNotifier notifierLarge(
|
||||
*this, mapChange, true); // visit only large objects; maximum distance
|
||||
Cell::VisitAllObjects(m_seer, notifierLarge, GetSightRange());
|
||||
Cell::VisitObjects(m_seer, notifierLarge, GetSightRange());
|
||||
notifierLarge.SendToSelf();
|
||||
|
||||
if (mapChange)
|
||||
@ -1635,35 +1635,32 @@ void Player::UpdateObjectVisibility(bool forced, bool fromUpdate)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void UpdateVisibilityOf_helper(GuidUnorderedSet& s64, T* target,
|
||||
inline void UpdateVisibilityOf_helper(Player* player, T* target,
|
||||
std::vector<Unit*>& /*v*/)
|
||||
{
|
||||
s64.insert(target->GetGUID());
|
||||
player->GetObjectVisibilityContainer().LinkWorldObjectVisibility(target);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void UpdateVisibilityOf_helper(GuidUnorderedSet& s64, GameObject* target,
|
||||
inline void UpdateVisibilityOf_helper(Player* player, GameObject* target,
|
||||
std::vector<Unit*>& /*v*/)
|
||||
{
|
||||
// @HACK: This is to prevent objects like deeprun tram from disappearing
|
||||
// when player moves far from its spawn point while riding it
|
||||
if ((target->GetGOInfo()->type != GAMEOBJECT_TYPE_TRANSPORT))
|
||||
s64.insert(target->GetGUID());
|
||||
player->GetObjectVisibilityContainer().LinkWorldObjectVisibility(target);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void UpdateVisibilityOf_helper(GuidUnorderedSet& s64, Creature* target,
|
||||
inline void UpdateVisibilityOf_helper(Player* player, Creature* target,
|
||||
std::vector<Unit*>& v)
|
||||
{
|
||||
s64.insert(target->GetGUID());
|
||||
player->GetObjectVisibilityContainer().LinkWorldObjectVisibility(target);
|
||||
v.push_back(target);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline void UpdateVisibilityOf_helper(GuidUnorderedSet& s64, Player* target,
|
||||
inline void UpdateVisibilityOf_helper(Player* player, Player* target,
|
||||
std::vector<Unit*>& v)
|
||||
{
|
||||
s64.insert(target->GetGUID());
|
||||
player->GetObjectVisibilityContainer().LinkWorldObjectVisibility(target);
|
||||
v.push_back(target);
|
||||
}
|
||||
|
||||
@ -1692,7 +1689,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data,
|
||||
BeforeVisibilityDestroy<T>(target, this);
|
||||
|
||||
target->BuildOutOfRangeUpdateBlock(&data);
|
||||
m_clientGUIDs.erase(target->GetGUID());
|
||||
GetObjectVisibilityContainer().UnlinkWorldObjectVisibility(target);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1700,7 +1697,7 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data,
|
||||
if (CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
target->BuildCreateUpdateBlockForPlayer(&data, this);
|
||||
UpdateVisibilityOf_helper(m_clientGUIDs, target, visibleNow);
|
||||
UpdateVisibilityOf_helper(this, target, visibleNow);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1726,7 +1723,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
BeforeVisibilityDestroy<Creature>(target->ToCreature(), this);
|
||||
|
||||
target->DestroyForPlayer(this);
|
||||
m_clientGUIDs.erase(target->GetGUID());
|
||||
GetObjectVisibilityContainer().UnlinkWorldObjectVisibility(target);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1734,7 +1731,7 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
if (CanSeeOrDetect(target, false, true))
|
||||
{
|
||||
target->SendUpdateToPlayer(this);
|
||||
m_clientGUIDs.insert(target->GetGUID());
|
||||
GetObjectVisibilityContainer().LinkWorldObjectVisibility(target);
|
||||
|
||||
// target aura duration for caster show only if target exist at
|
||||
// caster client send data at target visibility change (adding to
|
||||
@ -1747,69 +1744,67 @@ void Player::UpdateVisibilityOf(WorldObject* target)
|
||||
|
||||
void Player::UpdateTriggerVisibility()
|
||||
{
|
||||
if (m_clientGUIDs.empty())
|
||||
return;
|
||||
|
||||
if (!IsInWorld())
|
||||
return;
|
||||
|
||||
UpdateData udata;
|
||||
WorldPacket packet;
|
||||
for (GuidUnorderedSet::iterator itr = m_clientGUIDs.begin();
|
||||
itr != m_clientGUIDs.end(); ++itr)
|
||||
if (GetObjectVisibilityContainer().GetVisibleWorldObjectsMap()->empty())
|
||||
return;
|
||||
|
||||
UpdateData udata;
|
||||
DoForAllVisibleWorldObjects([this, &udata](WorldObject* worldObject)
|
||||
{
|
||||
if ((*itr).IsCreatureOrVehicle())
|
||||
if (worldObject->IsCreature())
|
||||
{
|
||||
Creature* creature = GetMap()->GetCreature(*itr);
|
||||
Creature* creature = worldObject->ToCreature();
|
||||
// Update fields of triggers, transformed units or unselectable
|
||||
// units (values dependent on GM state)
|
||||
if (!creature || (!creature->IsTrigger() &&
|
||||
!creature->HasTransformAura() &&
|
||||
!creature->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)))
|
||||
continue;
|
||||
!creature->HasTransformAura() &&
|
||||
!creature->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE)))
|
||||
return;
|
||||
|
||||
creature->SetFieldNotifyFlag(UF_FLAG_PUBLIC);
|
||||
creature->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
creature->RemoveFieldNotifyFlag(UF_FLAG_PUBLIC);
|
||||
}
|
||||
else if ((*itr).IsGameObject())
|
||||
else if (worldObject->IsGameObject())
|
||||
{
|
||||
GameObject* go = GetMap()->GetGameObject(*itr);
|
||||
GameObject* go = worldObject->ToGameObject();
|
||||
if (!go)
|
||||
continue;
|
||||
return;
|
||||
|
||||
go->SetFieldNotifyFlag(UF_FLAG_PUBLIC);
|
||||
go->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
go->RemoveFieldNotifyFlag(UF_FLAG_PUBLIC);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!udata.HasData())
|
||||
return;
|
||||
|
||||
WorldPacket packet;
|
||||
udata.BuildPacket(packet);
|
||||
GetSession()->SendPacket(&packet);
|
||||
}
|
||||
|
||||
void Player::UpdateForQuestWorldObjects()
|
||||
{
|
||||
if (m_clientGUIDs.empty())
|
||||
if (GetObjectVisibilityContainer().GetVisibleWorldObjectsMap()->empty())
|
||||
return;
|
||||
|
||||
UpdateData udata;
|
||||
WorldPacket packet;
|
||||
for (GuidUnorderedSet::iterator itr = m_clientGUIDs.begin(); itr != m_clientGUIDs.end(); ++itr)
|
||||
UpdateData udata;
|
||||
DoForAllVisibleWorldObjects([this, &udata](WorldObject* worldObject)
|
||||
{
|
||||
if ((*itr).IsGameObject())
|
||||
if (worldObject->IsGameObject())
|
||||
{
|
||||
if (GameObject* obj = ObjectAccessor::GetGameObject(*this, *itr))
|
||||
if (GameObject* obj = worldObject->ToGameObject())
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
}
|
||||
else if ((*itr).IsCreatureOrVehicle())
|
||||
else if (worldObject->IsCreature())
|
||||
{
|
||||
Creature* obj = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, *itr);
|
||||
Creature* obj = worldObject->ToCreature();
|
||||
if (!obj)
|
||||
continue;
|
||||
return;
|
||||
|
||||
// check if this unit requires quest specific flags
|
||||
if (obj->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
|
||||
@ -1833,12 +1828,14 @@ void Player::UpdateForQuestWorldObjects()
|
||||
}
|
||||
}
|
||||
else if (obj->HasNpcFlag(UNIT_NPC_FLAG_VENDOR_MASK | UNIT_NPC_FLAG_TRAINER))
|
||||
{
|
||||
obj->BuildValuesUpdateBlockForPlayer(&udata, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!udata.HasData())
|
||||
return;
|
||||
|
||||
WorldPacket packet;
|
||||
udata.BuildPacket(packet);
|
||||
GetSession()->SendPacket(&packet);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
#include "SpellMgr.h"
|
||||
#include "TotemPackets.h"
|
||||
|
||||
Totem::Totem(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner, false)
|
||||
Totem::Totem(SummonPropertiesEntry const* properties, ObjectGuid owner) : Minion(properties, owner)
|
||||
{
|
||||
m_unitTypeMask |= UNIT_MASK_TOTEM;
|
||||
m_duration = 0;
|
||||
|
||||
@ -123,7 +123,7 @@ void MotionTransport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
||||
GameObject::CleanupsBeforeDelete(finalCleanup);
|
||||
}
|
||||
|
||||
void MotionTransport::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&)
|
||||
void MotionTransport::BuildUpdate(UpdateDataMapType& data_map)
|
||||
{
|
||||
Map::PlayerList const& players = GetMap()->GetPlayers();
|
||||
if (players.IsEmpty())
|
||||
@ -607,12 +607,12 @@ void MotionTransport::DelayedTeleportTransport()
|
||||
}
|
||||
|
||||
Map* newMap = sMapMgr->CreateBaseMap(newMapId);
|
||||
GetMap()->RemoveFromMap<MotionTransport>(this, false);
|
||||
GetMap()->RemoveFromMap<Transport>(this, false);
|
||||
newMap->LoadGrid(x, y); // xinef: load before adding passengers to new map
|
||||
SetMap(newMap);
|
||||
|
||||
Relocate(x, y, z, o);
|
||||
GetMap()->AddToMap<MotionTransport>(this);
|
||||
GetMap()->AddToMap<Transport>(this);
|
||||
|
||||
LoadStaticPassengers();
|
||||
}
|
||||
@ -690,6 +690,40 @@ StaticTransport::~StaticTransport()
|
||||
ASSERT(_passengers.empty());
|
||||
}
|
||||
|
||||
bool StaticTransport::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap)
|
||||
{
|
||||
GameObjectData const* data = sObjectMgr->GetGameObjectData(spawnId);
|
||||
|
||||
if (!data)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Gameobject (GUID: {}) not found in table `gameobject`, can't load. ", spawnId);
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 entry = data->id;
|
||||
//uint32 map_id = data->mapid; // already used before call
|
||||
uint32 phaseMask = data->phaseMask;
|
||||
float x = data->posX;
|
||||
float y = data->posY;
|
||||
float z = data->posZ;
|
||||
float ang = data->orientation;
|
||||
|
||||
uint32 animprogress = data->animprogress;
|
||||
GOState go_state = data->go_state;
|
||||
uint32 artKit = data->artKit;
|
||||
|
||||
m_goData = data;
|
||||
m_spawnId = spawnId;
|
||||
|
||||
if (!Create(map->GenerateLowGuid<HighGuid::Transport>(), entry, map, phaseMask, x, y, z, ang, data->rotation, animprogress, go_state, artKit))
|
||||
return false;
|
||||
|
||||
if (addToMap && !GetMap()->AddToMap<Transport>(this))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StaticTransport::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const& rotation, uint32 animprogress, GOState go_state, uint32 artKit)
|
||||
{
|
||||
ASSERT(map);
|
||||
@ -794,7 +828,6 @@ bool StaticTransport::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* m
|
||||
LastUsedScriptID = GetGOInfo()->ScriptId;
|
||||
AIM_Initialize();
|
||||
|
||||
this->setActive(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -812,7 +845,7 @@ void StaticTransport::CleanupsBeforeDelete(bool finalCleanup /*= true*/)
|
||||
GameObject::CleanupsBeforeDelete(finalCleanup);
|
||||
}
|
||||
|
||||
void StaticTransport::BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&)
|
||||
void StaticTransport::BuildUpdate(UpdateDataMapType& data_map)
|
||||
{
|
||||
Map::PlayerList const& players = GetMap()->GetPlayers();
|
||||
if (players.IsEmpty())
|
||||
@ -929,7 +962,9 @@ void StaticTransport::UpdatePosition(float x, float y, float z, float o)
|
||||
if (!GetMap()->IsGridLoaded(x, y)) // pussywizard: should not happen, but just in case
|
||||
GetMap()->LoadGrid(x, y);
|
||||
|
||||
GetMap()->GameObjectRelocation(this, x, y, z, o); // this also relocates the model
|
||||
Relocate(x, y, z, o);
|
||||
UpdateModelPosition();
|
||||
|
||||
UpdatePassengerPositions();
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@ public:
|
||||
virtual void RemovePassenger(WorldObject* passenger, bool withAll = false) = 0;
|
||||
PassengerSet const& GetPassengers() const { return _passengers; }
|
||||
|
||||
virtual void DelayedUpdate(uint32 /*diff*/) {}
|
||||
|
||||
uint32 GetPathProgress() const { return GetGOValue()->Transport.PathProgress; }
|
||||
void SetPathProgress(uint32 val) { m_goValue.Transport.PathProgress = val; }
|
||||
|
||||
@ -54,10 +56,10 @@ public:
|
||||
|
||||
bool CreateMoTrans(ObjectGuid::LowType guidlow, uint32 entry, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress);
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true) override;
|
||||
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&) override;
|
||||
void BuildUpdate(UpdateDataMapType& data_map) override;
|
||||
|
||||
void Update(uint32 diff) override;
|
||||
void DelayedUpdate(uint32 diff);
|
||||
void DelayedUpdate(uint32 diff) override;
|
||||
void UpdatePosition(float x, float y, float z, float o);
|
||||
|
||||
void AddPassenger(WorldObject* passenger, bool withAll = false) override;
|
||||
@ -115,9 +117,11 @@ public:
|
||||
StaticTransport();
|
||||
~StaticTransport() override;
|
||||
|
||||
bool LoadFromDB(ObjectGuid::LowType guid, Map* map) override { return LoadGameObjectFromDB(guid, map, false); }
|
||||
bool LoadGameObjectFromDB(ObjectGuid::LowType guid, Map* map, bool addToMap = true) override;
|
||||
bool Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, G3D::Quat const& rotation, uint32 animprogress, GOState go_state, uint32 artKit = 0) override;
|
||||
void CleanupsBeforeDelete(bool finalCleanup = true) override;
|
||||
void BuildUpdate(UpdateDataMapType& data_map, UpdatePlayerSet&) override;
|
||||
void BuildUpdate(UpdateDataMapType& data_map) override;
|
||||
|
||||
void Update(uint32 diff) override;
|
||||
void RelocateToProgress(uint32 progress);
|
||||
|
||||
@ -53,6 +53,7 @@
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SmartAI.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellAuras.h"
|
||||
@ -201,7 +202,7 @@ SpellInfo const* ProcEventInfo::GetSpellInfo() const
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4355)
|
||||
#endif
|
||||
Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject),
|
||||
Unit::Unit() : WorldObject(),
|
||||
m_movedByPlayer(nullptr),
|
||||
m_lastSanctuaryTime(0),
|
||||
IsAIEnabled(false),
|
||||
@ -4109,8 +4110,8 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
|
||||
//LOG_DEBUG("entities.unit", "Interrupt spell for unit {}.", GetEntry());
|
||||
Spell* spell = m_currentSpells[spellType];
|
||||
if (spell
|
||||
&& (withDelayed || spell->getState() != SPELL_STATE_DELAYED)
|
||||
&& (withInstant || spell->GetCastTime() > 0 || spell->getState() == SPELL_STATE_CASTING)) // xinef: or spell is in casting state (channeled spells only)
|
||||
&& (withDelayed || spell->getState() != SPELL_STATE_DELAYED)
|
||||
&& (withInstant || spell->GetCastTime() > 0 || spell->getState() == SPELL_STATE_CASTING)) // xinef: or spell is in casting state (channeled spells only)
|
||||
{
|
||||
// for example, do not let self-stun aura interrupt itself
|
||||
if (!spell->IsInterruptable())
|
||||
@ -4128,6 +4129,15 @@ void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool wi
|
||||
m_currentSpells[spellType] = nullptr;
|
||||
spell->SetReferencedFromCurrent(false);
|
||||
}
|
||||
|
||||
// SAI creatures only
|
||||
// Start chasing victim if they are spell casters (at least one SMC spell) if interrupted/silenced.
|
||||
if (IsCreature())
|
||||
{
|
||||
if (SmartAI* ai = dynamic_cast<SmartAI*>(ToCreature()->AI()))
|
||||
if (ai->CanChaseOnInterrupt())
|
||||
ai->SetCombatMove(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17060,7 +17070,7 @@ Unit* Unit::SelectNearbyTarget(Unit* exclude, float dist) const
|
||||
std::list<Unit*> targets;
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, dist);
|
||||
Cell::VisitObjects(this, searcher, dist);
|
||||
|
||||
// remove current target
|
||||
if (GetVictim())
|
||||
@ -17095,7 +17105,7 @@ Unit* Unit::SelectNearbyNoTotemTarget(Unit* exclude, float dist) const
|
||||
std::list<Unit*> targets;
|
||||
Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck u_check(this, this, dist);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, targets, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, dist);
|
||||
Cell::VisitObjects(this, searcher, dist);
|
||||
|
||||
// remove current target
|
||||
if (GetVictim())
|
||||
@ -17332,7 +17342,7 @@ void Unit::SetContestedPvP(Player* attackedPlayer, bool lookForNearContestedGuar
|
||||
std::list<Unit*> targets;
|
||||
Acore::NearestVisibleDetectableContestedGuardUnitCheck u_check(this);
|
||||
Acore::UnitListSearcher<Acore::NearestVisibleDetectableContestedGuardUnitCheck> searcher(this, targets, u_check);
|
||||
Cell::VisitAllObjects(this, searcher, MAX_AGGRO_RADIUS);
|
||||
Cell::VisitObjects(this, searcher, MAX_AGGRO_RADIUS);
|
||||
|
||||
// return if there are no contested guards found
|
||||
if (!targets.size())
|
||||
@ -19224,7 +19234,7 @@ void Unit::UpdateObjectVisibility(bool forced, bool /*fromUpdate*/)
|
||||
WorldObject::UpdateObjectVisibility(true);
|
||||
Acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
Cell::VisitAllObjects(this, notifier, radius);
|
||||
Cell::VisitObjects(this, notifier, radius);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20275,10 +20285,10 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
}
|
||||
|
||||
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
Cell::VisitAllObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
|
||||
Cell::VisitObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
|
||||
relocateNoLarge.SendToSelf();
|
||||
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
Cell::VisitAllObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
|
||||
Cell::VisitObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
|
||||
@ -20314,13 +20324,13 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
GetMap()->LoadGridsInRange(*player, MAX_VISIBILITY_DISTANCE);
|
||||
|
||||
Acore::PlayerRelocationNotifier relocateNoLarge(*player, false); // visit only objects which are not large; default distance
|
||||
Cell::VisitAllObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
|
||||
Cell::VisitObjects(viewPoint, relocateNoLarge, player->GetSightRange() + VISIBILITY_INC_FOR_GOBJECTS);
|
||||
relocateNoLarge.SendToSelf();
|
||||
|
||||
if (!player->GetFarSightDistance())
|
||||
{
|
||||
Acore::PlayerRelocationNotifier relocateLarge(*player, true); // visit only large objects; maximum distance
|
||||
Cell::VisitAllObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
|
||||
Cell::VisitObjects(viewPoint, relocateLarge, MAX_VISIBILITY_DISTANCE);
|
||||
relocateLarge.SendToSelf();
|
||||
}
|
||||
|
||||
@ -20342,7 +20352,7 @@ void Unit::ExecuteDelayedUnitRelocationEvent()
|
||||
unit->m_last_notify_position.Relocate(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());
|
||||
|
||||
Acore::CreatureRelocationNotifier relocate(*unit);
|
||||
Cell::VisitAllObjects(unit, relocate, unit->GetVisibilityRange() + VISIBILITY_COMPENSATION);
|
||||
Cell::VisitObjects(unit, relocate, unit->GetVisibilityRange() + VISIBILITY_COMPENSATION);
|
||||
|
||||
this->AddToNotify(NOTIFY_AI_RELOCATION);
|
||||
}
|
||||
@ -20356,7 +20366,7 @@ void Unit::ExecuteDelayedUnitAINotifyEvent()
|
||||
|
||||
Acore::AIRelocationNotifier notifier(*this);
|
||||
float radius = 60.0f;
|
||||
Cell::VisitAllObjects(this, notifier, radius);
|
||||
Cell::VisitObjects(this, notifier, radius);
|
||||
}
|
||||
|
||||
void Unit::SetInFront(WorldObject const* target)
|
||||
@ -20992,7 +21002,7 @@ void Unit::Talk(std::string_view text, ChatMsg msgType, Language language, float
|
||||
Acore::CustomChatTextBuilder builder(this, msgType, text, language, target);
|
||||
Acore::LocalizedPacketDo<Acore::CustomChatTextBuilder> localizer(builder);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::CustomChatTextBuilder> > worker(this, textRange, localizer);
|
||||
Cell::VisitWorldObjects(this, worker, textRange);
|
||||
Cell::VisitObjects(this, worker, textRange);
|
||||
}
|
||||
|
||||
void Unit::Say(std::string_view text, Language language, WorldObject const* target /*= nullptr*/)
|
||||
@ -21050,7 +21060,7 @@ void Unit::Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject con
|
||||
Acore::BroadcastTextBuilder builder(this, msgType, textId, getGender(), target);
|
||||
Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> localizer(builder);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::BroadcastTextBuilder> > worker(this, textRange, localizer);
|
||||
Cell::VisitWorldObjects(this, worker, textRange);
|
||||
Cell::VisitObjects(this, worker, textRange);
|
||||
}
|
||||
|
||||
void Unit::Say(uint32 textId, WorldObject const* target /*= nullptr*/)
|
||||
|
||||
@ -2029,7 +2029,7 @@ public:
|
||||
Movement::MoveSpline* movespline;
|
||||
|
||||
protected:
|
||||
explicit Unit (bool isWorldObject);
|
||||
explicit Unit();
|
||||
|
||||
void BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) override;
|
||||
|
||||
|
||||
@ -103,13 +103,8 @@ struct Cell
|
||||
|
||||
static CellArea CalculateCellArea(float x, float y, float radius);
|
||||
|
||||
template<class T> static void VisitGridObjects(WorldObject const* obj, T& visitor, float radius);
|
||||
template<class T> static void VisitWorldObjects(WorldObject const* obj, T& visitor, float radius);
|
||||
template<class T> static void VisitAllObjects(WorldObject const* obj, T& visitor, float radius);
|
||||
|
||||
template<class T> static void VisitGridObjects(float x, float y, Map* map, T& visitor, float radius);
|
||||
template<class T> static void VisitWorldObjects(float x, float y, Map* map, T& visitor, float radius);
|
||||
template<class T> static void VisitAllObjects(float x, float y, Map* map, T& visitor, float radius);
|
||||
template<class T> static void VisitObjects(WorldObject const* obj, T& visitor, float radius);
|
||||
template<class T> static void VisitObjects(float x, float y, Map* map, T& visitor, float radius);
|
||||
|
||||
private:
|
||||
template<class T, class CONTAINER> void VisitCircle(TypeContainerVisitor<T, CONTAINER>&, Map&, CellCoord const&, CellCoord const&) const;
|
||||
|
||||
@ -162,7 +162,7 @@ inline void Cell::VisitCircle(TypeContainerVisitor<T, CONTAINER>& visitor, Map&
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void Cell::VisitGridObjects(WorldObject const* center_obj, T& visitor, float radius)
|
||||
inline void Cell::VisitObjects(WorldObject const* center_obj, T& visitor, float radius)
|
||||
{
|
||||
CellCoord p(Acore::ComputeCellCoord(center_obj->GetPositionX(), center_obj->GetPositionY()));
|
||||
Cell cell(p);
|
||||
@ -172,29 +172,7 @@ inline void Cell::VisitGridObjects(WorldObject const* center_obj, T& visitor, fl
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void Cell::VisitWorldObjects(WorldObject const* center_obj, T& visitor, float radius)
|
||||
{
|
||||
CellCoord p(Acore::ComputeCellCoord(center_obj->GetPositionX(), center_obj->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
TypeContainerVisitor<T, WorldTypeMapContainer> wnotifier(visitor);
|
||||
cell.Visit(p, wnotifier, *center_obj->GetMap(), *center_obj, radius);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void Cell::VisitAllObjects(WorldObject const* center_obj, T& visitor, float radius)
|
||||
{
|
||||
CellCoord p(Acore::ComputeCellCoord(center_obj->GetPositionX(), center_obj->GetPositionY()));
|
||||
Cell cell(p);
|
||||
|
||||
TypeContainerVisitor<T, WorldTypeMapContainer> wnotifier(visitor);
|
||||
cell.Visit(p, wnotifier, *center_obj->GetMap(), *center_obj, radius);
|
||||
TypeContainerVisitor<T, GridTypeMapContainer> gnotifier(visitor);
|
||||
cell.Visit(p, gnotifier, *center_obj->GetMap(), *center_obj, radius);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void Cell::VisitGridObjects(float x, float y, Map* map, T& visitor, float radius)
|
||||
inline void Cell::VisitObjects(float x, float y, Map* map, T& visitor, float radius)
|
||||
{
|
||||
CellCoord p(Acore::ComputeCellCoord(x, y));
|
||||
Cell cell(p);
|
||||
@ -203,26 +181,4 @@ inline void Cell::VisitGridObjects(float x, float y, Map* map, T& visitor, float
|
||||
cell.Visit(p, gnotifier, *map, x, y, radius);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void Cell::VisitWorldObjects(float x, float y, Map* map, T& visitor, float radius)
|
||||
{
|
||||
CellCoord p(Acore::ComputeCellCoord(x, y));
|
||||
Cell cell(p);
|
||||
|
||||
TypeContainerVisitor<T, WorldTypeMapContainer> wnotifier(visitor);
|
||||
cell.Visit(p, wnotifier, *map, x, y, radius);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline void Cell::VisitAllObjects(float x, float y, Map* map, T& visitor, float radius)
|
||||
{
|
||||
CellCoord p(Acore::ComputeCellCoord(x, y));
|
||||
Cell cell(p);
|
||||
|
||||
TypeContainerVisitor<T, WorldTypeMapContainer> wnotifier(visitor);
|
||||
cell.Visit(p, wnotifier, *map, x, y, radius);
|
||||
TypeContainerVisitor<T, GridTypeMapContainer> gnotifier(visitor);
|
||||
cell.Visit(p, gnotifier, *map, x, y, radius);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -35,7 +35,6 @@
|
||||
|
||||
template
|
||||
<
|
||||
class WORLD_OBJECT_TYPES,
|
||||
class GRID_OBJECT_TYPES
|
||||
>
|
||||
class GridCell
|
||||
@ -43,12 +42,6 @@ class GridCell
|
||||
public:
|
||||
~GridCell() = default;
|
||||
|
||||
template<class SPECIFIC_OBJECT> void AddWorldObject(SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
_worldObjects.template insert<SPECIFIC_OBJECT>(obj);
|
||||
ASSERT(obj->IsInGrid());
|
||||
}
|
||||
|
||||
template<class SPECIFIC_OBJECT> void AddGridObject(SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
_gridObjects.template insert<SPECIFIC_OBJECT>(obj);
|
||||
@ -62,14 +55,7 @@ public:
|
||||
visitor.Visit(_gridObjects);
|
||||
}
|
||||
|
||||
// Visit world objects
|
||||
template<class T>
|
||||
void Visit(TypeContainerVisitor<T, TypeMapContainer<WORLD_OBJECT_TYPES> >& visitor)
|
||||
{
|
||||
visitor.Visit(_worldObjects);
|
||||
}
|
||||
private:
|
||||
TypeMapContainer<GRID_OBJECT_TYPES> _gridObjects;
|
||||
TypeMapContainer<WORLD_OBJECT_TYPES> _worldObjects;
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -51,10 +51,11 @@ class ObjectGuid;
|
||||
#define MAP_SIZE (SIZE_OF_GRIDS*MAX_NUMBER_OF_GRIDS)
|
||||
#define MAP_HALFSIZE (MAP_SIZE/2)
|
||||
|
||||
// Creature used instead pet to simplify *::Visit templates (not required duplicate code for Creature->Pet case)
|
||||
typedef TYPELIST_4(GameObject, Player, Creature/*pets*/, Corpse/*resurrectable*/) AllWorldObjectTypes;
|
||||
typedef TYPELIST_4(GameObject, Creature/*except pets*/, DynamicObject, Corpse/*Bones*/) AllGridObjectTypes;
|
||||
typedef TYPELIST_5(Creature, GameObject, DynamicObject, Pet, Corpse) AllMapStoredObjectTypes;
|
||||
// List of object types stored in a map grid
|
||||
typedef TYPELIST_5(GameObject, Player, Creature, Corpse, DynamicObject) AllMapGridStoredObjectTypes;
|
||||
|
||||
// List of object types stored on map level
|
||||
typedef TYPELIST_4(Creature, GameObject, DynamicObject, Corpse) AllMapStoredObjectTypes;
|
||||
|
||||
typedef GridRefMgr<Corpse> CorpseMapType;
|
||||
typedef GridRefMgr<Creature> CreatureMapType;
|
||||
@ -72,11 +73,10 @@ enum GridMapTypeMask
|
||||
GRID_MAP_TYPE_MASK_ALL = 0x1F
|
||||
};
|
||||
|
||||
typedef GridCell<AllWorldObjectTypes, AllGridObjectTypes> GridCellType;
|
||||
typedef MapGrid<AllWorldObjectTypes, AllGridObjectTypes> MapGridType;
|
||||
typedef GridCell<AllMapGridStoredObjectTypes> GridCellType;
|
||||
typedef MapGrid<AllMapGridStoredObjectTypes> MapGridType;
|
||||
|
||||
typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer;
|
||||
typedef TypeMapContainer<AllWorldObjectTypes> WorldTypeMapContainer;
|
||||
typedef TypeMapContainer<AllMapGridStoredObjectTypes> GridTypeMapContainer;
|
||||
typedef TypeUnorderedMapContainer<AllMapStoredObjectTypes, ObjectGuid> MapStoredObjectTypesContainer;
|
||||
|
||||
template<uint32 LIMIT>
|
||||
|
||||
@ -30,10 +30,8 @@ void GridObjectLoader::AddObjectHelper(Map* map, T* obj)
|
||||
CellCoord cellCoord = Acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
|
||||
Cell cell(cellCoord);
|
||||
|
||||
map->AddToGrid(obj, cell);
|
||||
map->AddToGrid<T>(obj, cell);
|
||||
obj->AddToWorld();
|
||||
if (obj->isActiveObject())
|
||||
map->AddToActive(obj);
|
||||
}
|
||||
|
||||
void GridObjectLoader::LoadCreatures(CellGuidSet const& guid_set, Map* map)
|
||||
@ -55,7 +53,7 @@ void GridObjectLoader::LoadCreatures(CellGuidSet const& guid_set, Map* map)
|
||||
{
|
||||
// call MoveInLineOfSight for nearby grid creatures
|
||||
Acore::AIRelocationNotifier notifier(*obj);
|
||||
Cell::VisitGridObjects(obj, notifier, 60.f);
|
||||
Cell::VisitObjects(obj, notifier, 60.f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -66,15 +64,28 @@ void GridObjectLoader::LoadGameObjects(CellGuidSet const& guid_set, Map* map)
|
||||
for (ObjectGuid::LowType const& guid : guid_set)
|
||||
{
|
||||
GameObjectData const* data = sObjectMgr->GetGameObjectData(guid);
|
||||
GameObject* obj = data && sObjectMgr->IsGameObjectStaticTransport(data->id) ? new StaticTransport() : new GameObject();
|
||||
|
||||
if (!obj->LoadFromDB(guid, map))
|
||||
if (data && sObjectMgr->IsGameObjectStaticTransport(data->id))
|
||||
{
|
||||
delete obj;
|
||||
continue;
|
||||
}
|
||||
StaticTransport* transport = new StaticTransport();
|
||||
|
||||
AddObjectHelper<GameObject>(map, obj);
|
||||
// Special case for static transports - we are loaded via grids
|
||||
// but we do not want to actually be stored in the grid
|
||||
if (!transport->LoadGameObjectFromDB(guid, map, true))
|
||||
delete transport;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameObject* obj = new GameObject();
|
||||
|
||||
if (!obj->LoadFromDB(guid, map))
|
||||
{
|
||||
delete obj;
|
||||
continue;
|
||||
}
|
||||
|
||||
AddObjectHelper<GameObject>(map, obj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ class GridObjectCleaner
|
||||
{
|
||||
public:
|
||||
template<class T> void Visit(GridRefMgr<T>&);
|
||||
void Visit(PlayerMapType&) { }
|
||||
};
|
||||
|
||||
// Delete objects before deleting NGrid
|
||||
@ -54,6 +55,7 @@ class GridObjectUnloader
|
||||
{
|
||||
public:
|
||||
void Visit(CorpseMapType&) { } // corpses are deleted with Map
|
||||
void Visit(PlayerMapType&) { }
|
||||
template<class T> void Visit(GridRefMgr<T>& m);
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -25,13 +25,12 @@ class GridTerrainData;
|
||||
|
||||
template
|
||||
<
|
||||
class WORLD_OBJECT_TYPES,
|
||||
class GRID_OBJECT_TYPES
|
||||
>
|
||||
class MapGrid
|
||||
{
|
||||
public:
|
||||
typedef GridCell<WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> GridCellType;
|
||||
typedef GridCell<GRID_OBJECT_TYPES> GridCellType;
|
||||
|
||||
MapGrid(uint16 const x, uint16 const y)
|
||||
: _x(x), _y(y), _objectDataLoaded(false), _terrainData(nullptr) { }
|
||||
@ -45,16 +44,6 @@ public:
|
||||
bool IsObjectDataLoaded() const { return _objectDataLoaded; }
|
||||
void SetObjectDataLoaded() { _objectDataLoaded = true; }
|
||||
|
||||
template<class SPECIFIC_OBJECT> void AddWorldObject(uint16 const x, uint16 const y, SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
GetOrCreateCell(x, y).AddWorldObject(obj);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_OBJECT> void RemoveWorldObject(uint16 const x, uint16 const y, SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
GetOrCreateCell(x, y).RemoveWorldObject(obj);
|
||||
}
|
||||
|
||||
template<class SPECIFIC_OBJECT> void AddGridObject(uint16 const x, uint16 const y, SPECIFIC_OBJECT* obj)
|
||||
{
|
||||
GetOrCreateCell(x, y).AddGridObject(obj);
|
||||
@ -92,7 +81,7 @@ public:
|
||||
gridCell->Visit(visitor);
|
||||
}
|
||||
|
||||
void link(GridRefMgr<MapGrid<WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>>* pTo)
|
||||
void link(GridRefMgr<MapGrid<GRID_OBJECT_TYPES>>* pTo)
|
||||
{
|
||||
_gridReference.link(pTo, this);
|
||||
}
|
||||
@ -145,7 +134,7 @@ private:
|
||||
|
||||
bool _objectDataLoaded;
|
||||
std::array<std::array<std::unique_ptr<GridCellType>, MAX_NUMBER_OF_CELLS>, MAX_NUMBER_OF_CELLS> _cells; // N * N array
|
||||
GridReference<MapGrid<WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES>> _gridReference;
|
||||
GridReference<MapGrid<GRID_OBJECT_TYPES>> _gridReference;
|
||||
|
||||
// Instances will share a copy of the parent maps terrainData
|
||||
std::shared_ptr<GridTerrainData> _terrainData;
|
||||
|
||||
@ -32,7 +32,6 @@ void VisibleNotifier::Visit(GameObjectMapType& m)
|
||||
if (i_largeOnly != go->IsVisibilityOverridden())
|
||||
continue;
|
||||
|
||||
vis_guids.erase(go->GetGUID());
|
||||
i_player.UpdateVisibilityOf(go, i_data, i_visibleNow);
|
||||
}
|
||||
}
|
||||
@ -42,56 +41,66 @@ void VisibleNotifier::SendToSelf()
|
||||
// at this moment i_clientGUIDs have guids that not iterate at grid level checks
|
||||
// but exist one case when this possible and object not out of range: transports
|
||||
if (Transport* transport = i_player.GetTransport())
|
||||
{
|
||||
for (Transport::PassengerSet::const_iterator itr = transport->GetPassengers().begin(); itr != transport->GetPassengers().end(); ++itr)
|
||||
{
|
||||
if (i_largeOnly != (*itr)->IsVisibilityOverridden())
|
||||
continue;
|
||||
|
||||
if (vis_guids.find((*itr)->GetGUID()) != vis_guids.end())
|
||||
switch ((*itr)->GetTypeId())
|
||||
{
|
||||
vis_guids.erase((*itr)->GetGUID());
|
||||
case TYPEID_GAMEOBJECT:
|
||||
i_player.UpdateVisibilityOf((*itr)->ToGameObject(), i_data, i_visibleNow);
|
||||
break;
|
||||
case TYPEID_PLAYER:
|
||||
i_player.UpdateVisibilityOf((*itr)->ToPlayer(), i_data, i_visibleNow);
|
||||
(*itr)->ToPlayer()->UpdateVisibilityOf(&i_player);
|
||||
break;
|
||||
case TYPEID_UNIT:
|
||||
i_player.UpdateVisibilityOf((*itr)->ToCreature(), i_data, i_visibleNow);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch ((*itr)->GetTypeId())
|
||||
VisibleWorldObjectsMap* visibleWorldObjects = i_player.GetObjectVisibilityContainer().GetVisibleWorldObjectsMap();
|
||||
for (VisibleWorldObjectsMap::iterator itr = visibleWorldObjects->begin(); itr != visibleWorldObjects->end();)
|
||||
{
|
||||
WorldObject* obj = itr->second;
|
||||
if (i_largeOnly != obj->IsVisibilityOverridden())
|
||||
{
|
||||
++itr;
|
||||
continue;
|
||||
}
|
||||
|
||||
// pussywizard: static transports are removed only in RemovePlayerFromMap and here if can no longer detect (eg. phase changed)
|
||||
if (itr->first.IsTransport())
|
||||
{
|
||||
if (GameObject* staticTrans = obj->ToGameObject())
|
||||
{
|
||||
if (i_player.CanSeeOrDetect(staticTrans, false, true))
|
||||
{
|
||||
case TYPEID_GAMEOBJECT:
|
||||
i_player.UpdateVisibilityOf((*itr)->ToGameObject(), i_data, i_visibleNow);
|
||||
break;
|
||||
case TYPEID_PLAYER:
|
||||
i_player.UpdateVisibilityOf((*itr)->ToPlayer(), i_data, i_visibleNow);
|
||||
(*itr)->ToPlayer()->UpdateVisibilityOf(&i_player);
|
||||
break;
|
||||
case TYPEID_UNIT:
|
||||
i_player.UpdateVisibilityOf((*itr)->ToCreature(), i_data, i_visibleNow);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
++itr;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (GuidUnorderedSet::const_iterator it = vis_guids.begin(); it != vis_guids.end(); ++it)
|
||||
{
|
||||
if (WorldObject* obj = ObjectAccessor::GetWorldObject(i_player, *it))
|
||||
if (i_player.m_seer->IsWithinDist(obj, i_player.GetSightRange(obj), true))
|
||||
{
|
||||
if (i_largeOnly != obj->IsVisibilityOverridden())
|
||||
continue;
|
||||
++itr;
|
||||
continue;
|
||||
}
|
||||
|
||||
// pussywizard: static transports are removed only in RemovePlayerFromMap and here if can no longer detect (eg. phase changed)
|
||||
if ((*it).IsTransport())
|
||||
if (GameObject* staticTrans = i_player.GetMap()->GetGameObject(*it))
|
||||
if (i_player.CanSeeOrDetect(staticTrans, false, true))
|
||||
continue;
|
||||
i_data.AddOutOfRangeGUID(obj->GetGUID());
|
||||
|
||||
i_player.m_clientGUIDs.erase(*it);
|
||||
i_data.AddOutOfRangeGUID(*it);
|
||||
if (Player* objPlayer = obj->ToPlayer())
|
||||
objPlayer->UpdateVisibilityOf(&i_player);
|
||||
|
||||
if ((*it).IsPlayer())
|
||||
{
|
||||
Player* player = ObjectAccessor::FindPlayer(*it);
|
||||
if (player && player->IsInMap(&i_player))
|
||||
player->UpdateVisibilityOf(&i_player);
|
||||
}
|
||||
// Clean up references
|
||||
itr = i_player.GetObjectVisibilityContainer().UnlinkVisibilityFromPlayer(obj, itr);
|
||||
}
|
||||
|
||||
if (!i_data.HasData())
|
||||
@ -170,7 +179,6 @@ void PlayerRelocationNotifier::Visit(PlayerMapType& m)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
Player* player = iter->GetSource();
|
||||
vis_guids.erase(player->GetGUID());
|
||||
i_player.UpdateVisibilityOf(player, i_data, i_visibleNow);
|
||||
player->UpdateVisibilityOf(&i_player); // this notifier with different Visit(PlayerMapType&) than VisibleNotifier is needed to update visibility of self for other players when we move (eg. stealth detection changes)
|
||||
}
|
||||
@ -208,6 +216,23 @@ void AIRelocationNotifier::Visit(CreatureMapType& m)
|
||||
}
|
||||
}
|
||||
|
||||
// Uses visibility map
|
||||
void MessageDistDeliverer::Visit(VisiblePlayersMap const& m)
|
||||
{
|
||||
for (auto const& kvPair : m)
|
||||
{
|
||||
Player const* target = kvPair.second;
|
||||
if (i_distSq != 0.0f && target->m_seer->GetExactDist2dSq(i_source) > i_distSq)
|
||||
continue;
|
||||
|
||||
// @todo: Might not need this check anymore
|
||||
if (skipped_receiver == target)
|
||||
continue;
|
||||
|
||||
target->SendDirectMessage(i_message);
|
||||
}
|
||||
}
|
||||
|
||||
void MessageDistDeliverer::Visit(PlayerMapType& m)
|
||||
{
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
|
||||
@ -43,14 +43,13 @@ namespace Acore
|
||||
struct VisibleNotifier
|
||||
{
|
||||
Player& i_player;
|
||||
GuidUnorderedSet vis_guids;
|
||||
std::vector<Unit*>& i_visibleNow;
|
||||
bool i_gobjOnly;
|
||||
bool i_largeOnly;
|
||||
UpdateData i_data;
|
||||
|
||||
VisibleNotifier(Player& player, bool gobjOnly, bool largeOnly) :
|
||||
i_player(player), vis_guids(player.m_clientGUIDs), i_visibleNow(player.m_newVisible), i_gobjOnly(gobjOnly), i_largeOnly(largeOnly)
|
||||
i_player(player), i_visibleNow(player.m_newVisible), i_gobjOnly(gobjOnly), i_largeOnly(largeOnly)
|
||||
{
|
||||
i_visibleNow.clear();
|
||||
}
|
||||
@ -111,6 +110,7 @@ namespace Acore
|
||||
, skipped_receiver(skipped), required3dDist(req3dDist)
|
||||
{
|
||||
}
|
||||
void Visit(VisiblePlayersMap const& m);
|
||||
void Visit(PlayerMapType& m);
|
||||
void Visit(CreatureMapType& m);
|
||||
void Visit(DynamicObjectMapType& m);
|
||||
|
||||
@ -37,7 +37,6 @@ inline void Acore::VisibleNotifier::Visit(GridRefMgr<T>& m)
|
||||
if (i_largeOnly != iter->GetSource()->IsVisibilityOverridden())
|
||||
continue;
|
||||
|
||||
vis_guids.erase(iter->GetSource()->GetGUID());
|
||||
i_player.UpdateVisibilityOf(iter->GetSource(), i_data, i_visibleNow);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1180,7 +1180,10 @@ void WorldSession::HandlePlayerLoginToCharInWorld(Player* pCurrChar)
|
||||
pCurrChar->GetMap()->SendInitTransports(pCurrChar);
|
||||
pCurrChar->GetMap()->SendInitSelf(pCurrChar);
|
||||
pCurrChar->GetMap()->SendZoneDynamicInfo(pCurrChar);
|
||||
pCurrChar->m_clientGUIDs.clear();
|
||||
|
||||
// If we are logging into an existing player, simply clear visibility references
|
||||
// so player will receive a fresh list of new objects on the next vis update.
|
||||
pCurrChar->GetObjectVisibilityContainer().CleanVisibilityReferences();
|
||||
pCurrChar->UpdateObjectVisibility(false);
|
||||
|
||||
pCurrChar->CleanupChannels();
|
||||
|
||||
@ -780,7 +780,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
|
||||
Acore::EmoteChatBuilder emote_builder(*GetPlayer(), text_emote, emoteNum, unit);
|
||||
Acore::LocalizedPacketDo<Acore::EmoteChatBuilder > emote_do(emote_builder);
|
||||
Acore::PlayerDistWorker<Acore::LocalizedPacketDo<Acore::EmoteChatBuilder > > emote_worker(GetPlayer(), sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), emote_do);
|
||||
Cell::VisitWorldObjects(GetPlayer(), emote_worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
Cell::VisitObjects(GetPlayer(), emote_worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE));
|
||||
|
||||
GetPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, text_emote, 0, unit);
|
||||
|
||||
|
||||
@ -55,16 +55,6 @@ Map::~Map()
|
||||
|
||||
sScriptMgr->OnDestroyMap(this);
|
||||
|
||||
while (!i_worldObjects.empty())
|
||||
{
|
||||
WorldObject* obj = *i_worldObjects.begin();
|
||||
ASSERT(obj->IsWorldObject());
|
||||
LOG_DEBUG("maps", "Map::~Map: WorldObject TypeId is not a corpse! ({})", static_cast<uint8>(obj->GetTypeId()));
|
||||
//ASSERT(obj->IsCorpse());
|
||||
obj->RemoveFromWorld();
|
||||
obj->ResetMap();
|
||||
}
|
||||
|
||||
if (!m_scriptSchedule.empty())
|
||||
sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
|
||||
@ -73,8 +63,7 @@ Map::~Map()
|
||||
|
||||
Map::Map(uint32 id, uint32 InstanceId, uint8 SpawnMode, Map* _parent) :
|
||||
_mapGridManager(this), i_mapEntry(sMapStore.LookupEntry(id)), i_spawnMode(SpawnMode), i_InstanceId(InstanceId),
|
||||
m_unloadTimer(0), m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE),
|
||||
_instanceResetPeriod(0), m_activeNonPlayersIter(m_activeNonPlayers.end()),
|
||||
m_unloadTimer(0), m_VisibleDistance(DEFAULT_VISIBILITY_DISTANCE), _instanceResetPeriod(0),
|
||||
_transportsUpdateIter(_transports.end()), i_scriptLock(false), _defaultLight(GetDefaultMapLight(id))
|
||||
{
|
||||
m_parentMap = (_parent ? _parent : this);
|
||||
@ -117,20 +106,16 @@ template<class T>
|
||||
void Map::AddToGrid(T* obj, Cell const& cell)
|
||||
{
|
||||
MapGridType* grid = GetMapGrid(cell.GridX(), cell.GridY());
|
||||
if (obj->IsWorldObject())
|
||||
grid->AddWorldObject<T>(cell.CellX(), cell.CellY(), obj);
|
||||
else
|
||||
grid->AddGridObject<T>(cell.CellX(), cell.CellY(), obj);
|
||||
grid->AddGridObject<T>(cell.CellX(), cell.CellY(), obj);
|
||||
|
||||
obj->SetCurrentCell(cell);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::AddToGrid(Creature* obj, Cell const& cell)
|
||||
{
|
||||
MapGridType* grid = GetMapGrid(cell.GridX(), cell.GridY());
|
||||
if (obj->IsWorldObject())
|
||||
grid->AddWorldObject(cell.CellX(), cell.CellY(), obj);
|
||||
else
|
||||
grid->AddGridObject(cell.CellX(), cell.CellY(), obj);
|
||||
grid->AddGridObject(cell.CellX(), cell.CellY(), obj);
|
||||
|
||||
obj->SetCurrentCell(cell);
|
||||
}
|
||||
@ -145,15 +130,10 @@ void Map::AddToGrid(GameObject* obj, Cell const& cell)
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::AddToGrid(DynamicObject* obj, Cell const& cell)
|
||||
void Map::AddToGrid(Player* obj, Cell const& cell)
|
||||
{
|
||||
MapGridType* grid = GetMapGrid(cell.GridX(), cell.GridY());
|
||||
if (obj->IsWorldObject())
|
||||
grid->AddWorldObject(cell.CellX(), cell.CellY(), obj);
|
||||
else
|
||||
grid->AddGridObject(cell.CellX(), cell.CellY(), obj);
|
||||
|
||||
obj->SetCurrentCell(cell);
|
||||
grid->AddGridObject(cell.CellX(), cell.CellY(), obj);
|
||||
}
|
||||
|
||||
template<>
|
||||
@ -167,12 +147,7 @@ void Map::AddToGrid(Corpse* obj, Cell const& cell)
|
||||
// so we need to explicitly check it here (Map::AddToGrid is only called from Player::BuildPlayerRepop, not from ObjectGridLoader)
|
||||
// to avoid failing an assertion in GridObject::AddToGrid
|
||||
if (grid->IsObjectDataLoaded())
|
||||
{
|
||||
if (obj->IsWorldObject())
|
||||
grid->AddWorldObject(cell.CellX(), cell.CellY(), obj);
|
||||
else
|
||||
grid->AddGridObject(cell.CellX(), cell.CellY(), obj);
|
||||
}
|
||||
grid->AddGridObject(cell.CellX(), cell.CellY(), obj);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@ -289,7 +264,6 @@ bool Map::AddPlayerToMap(Player* player)
|
||||
SendInitSelf(player);
|
||||
SendZoneDynamicInfo(player);
|
||||
|
||||
player->m_clientGUIDs.clear();
|
||||
player->UpdateObjectVisibility(false);
|
||||
|
||||
if (player->IsAlive())
|
||||
@ -358,9 +332,6 @@ bool Map::AddToMap(T* obj, bool checkTransport)
|
||||
|
||||
InitializeObject(obj);
|
||||
|
||||
if (obj->isActiveObject())
|
||||
AddToActive(obj);
|
||||
|
||||
//something, such as vehicle, needs to be update immediately
|
||||
//also, trigger needs to cast spell, if not update, cannot see visual
|
||||
obj->UpdateObjectVisibility(true);
|
||||
@ -374,7 +345,7 @@ bool Map::AddToMap(T* obj, bool checkTransport)
|
||||
}
|
||||
|
||||
template<>
|
||||
bool Map::AddToMap(MotionTransport* obj, bool /*checkTransport*/)
|
||||
bool Map::AddToMap(Transport* obj, bool /*checkTransport*/)
|
||||
{
|
||||
//TODO: Needs clean up. An object should not be added to map twice.
|
||||
if (obj->IsInWorld())
|
||||
@ -389,29 +360,22 @@ bool Map::AddToMap(MotionTransport* obj, bool /*checkTransport*/)
|
||||
}
|
||||
|
||||
Cell cell(cellCoord);
|
||||
if (obj->isActiveObject())
|
||||
EnsureGridLoaded(cell);
|
||||
EnsureGridLoaded(cell);
|
||||
|
||||
obj->AddToWorld();
|
||||
|
||||
if (obj->isActiveObject())
|
||||
AddToActive(obj);
|
||||
|
||||
_transports.insert(obj);
|
||||
|
||||
// Broadcast creation to players
|
||||
if (!GetPlayers().IsEmpty())
|
||||
for (Map::PlayerList::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
{
|
||||
for (Map::PlayerList::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (itr->GetSource()->GetTransport() != obj)
|
||||
{
|
||||
if (itr->GetSource()->GetTransport() != obj)
|
||||
{
|
||||
UpdateData data;
|
||||
obj->BuildCreateUpdateBlockForPlayer(&data, itr->GetSource());
|
||||
WorldPacket packet;
|
||||
data.BuildPacket(packet);
|
||||
itr->GetSource()->SendDirectMessage(&packet);
|
||||
}
|
||||
UpdateData data;
|
||||
obj->BuildCreateUpdateBlockForPlayer(&data, itr->GetSource());
|
||||
WorldPacket packet;
|
||||
data.BuildPacket(packet);
|
||||
itr->GetSource()->SendDirectMessage(&packet);
|
||||
}
|
||||
}
|
||||
|
||||
@ -512,19 +476,6 @@ void Map::Update(const uint32 t_diff, const uint32 s_diff, bool /*thread*/)
|
||||
}
|
||||
}
|
||||
|
||||
if (_updatableObjectListRecheckTimer.Passed())
|
||||
{
|
||||
// Mark all cells near active objects
|
||||
for (m_activeNonPlayersIter = m_activeNonPlayers.begin(); m_activeNonPlayersIter != m_activeNonPlayers.end(); ++m_activeNonPlayersIter)
|
||||
{
|
||||
WorldObject* obj = *m_activeNonPlayersIter;
|
||||
if (!obj || !obj->IsInWorld())
|
||||
continue;
|
||||
|
||||
MarkNearbyCellsOf(obj);
|
||||
}
|
||||
}
|
||||
|
||||
UpdateNonPlayerObjects(t_diff);
|
||||
|
||||
SendObjectUpdates();
|
||||
@ -676,13 +627,9 @@ void Map::RemovePlayerFromMap(Player* player, bool remove)
|
||||
player->UpdateZone(MAP_INVALID_ZONE, 0);
|
||||
player->getHostileRefMgr().deleteReferences(true); // pussywizard: multithreading crashfix
|
||||
|
||||
bool inWorld = player->IsInWorld();
|
||||
player->RemoveFromWorld();
|
||||
SendRemoveTransports(player);
|
||||
|
||||
if (!inWorld) // pussywizard: if was in world, RemoveFromWorld() called DestroyForNearbyPlayers()
|
||||
player->DestroyForNearbyPlayers(); // pussywizard: previous player->UpdateObjectVisibility(true)
|
||||
|
||||
if (player->IsInGrid())
|
||||
player->RemoveFromGrid();
|
||||
else
|
||||
@ -702,15 +649,8 @@ void Map::AfterPlayerUnlinkFromMap()
|
||||
template<class T>
|
||||
void Map::RemoveFromMap(T* obj, bool remove)
|
||||
{
|
||||
bool inWorld = obj->IsInWorld() && obj->GetTypeId() >= TYPEID_UNIT && obj->GetTypeId() <= TYPEID_GAMEOBJECT;
|
||||
obj->RemoveFromWorld();
|
||||
|
||||
if (obj->isActiveObject())
|
||||
RemoveFromActive(obj);
|
||||
|
||||
if (!inWorld) // pussywizard: if was in world, RemoveFromWorld() called DestroyForNearbyPlayers()
|
||||
obj->DestroyForNearbyPlayers(); // pussywizard: previous player->UpdateObjectVisibility()
|
||||
|
||||
obj->RemoveFromGrid();
|
||||
|
||||
obj->ResetMap();
|
||||
@ -723,11 +663,9 @@ void Map::RemoveFromMap(T* obj, bool remove)
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::RemoveFromMap(MotionTransport* obj, bool remove)
|
||||
void Map::RemoveFromMap(Transport* obj, bool remove)
|
||||
{
|
||||
obj->RemoveFromWorld();
|
||||
if (obj->isActiveObject())
|
||||
RemoveFromActive(obj);
|
||||
|
||||
Map::PlayerList const& players = GetPlayers();
|
||||
if (!players.IsEmpty())
|
||||
@ -755,8 +693,6 @@ void Map::RemoveFromMap(MotionTransport* obj, bool remove)
|
||||
|
||||
obj->ResetMap();
|
||||
|
||||
// Transports are never actually deleted, but it *should* be safe to clear
|
||||
// from update list when removing from world
|
||||
RemoveObjectFromMapUpdateList(obj);
|
||||
|
||||
if (remove)
|
||||
@ -1024,11 +960,10 @@ void Map::UnloadAll()
|
||||
|
||||
for (TransportsContainer::iterator itr = _transports.begin(); itr != _transports.end();)
|
||||
{
|
||||
MotionTransport* transport = *itr;
|
||||
Transport* transport = *itr;
|
||||
++itr;
|
||||
|
||||
transport->RemoveFromWorld();
|
||||
delete transport;
|
||||
RemoveFromMap<Transport>(transport, true);
|
||||
}
|
||||
|
||||
_transports.clear();
|
||||
@ -1647,12 +1582,18 @@ void Map::SendInitSelf(Player* player)
|
||||
|
||||
void Map::SendInitTransports(Player* player)
|
||||
{
|
||||
if (_transports.empty())
|
||||
return;
|
||||
|
||||
// Hack to send out transports
|
||||
UpdateData transData;
|
||||
for (TransportsContainer::const_iterator itr = _transports.begin(); itr != _transports.end(); ++itr)
|
||||
if (*itr != player->GetTransport())
|
||||
(*itr)->BuildCreateUpdateBlockForPlayer(&transData, player);
|
||||
|
||||
if (!transData.HasData())
|
||||
return;
|
||||
|
||||
WorldPacket packet;
|
||||
transData.BuildPacket(packet);
|
||||
player->GetSession()->SendPacket(&packet);
|
||||
@ -1660,23 +1601,17 @@ void Map::SendInitTransports(Player* player)
|
||||
|
||||
void Map::SendRemoveTransports(Player* player)
|
||||
{
|
||||
if (_transports.empty())
|
||||
return;
|
||||
|
||||
// Hack to send out transports
|
||||
UpdateData transData;
|
||||
for (TransportsContainer::const_iterator itr = _transports.begin(); itr != _transports.end(); ++itr)
|
||||
if (*itr != player->GetTransport())
|
||||
(*itr)->BuildOutOfRangeUpdateBlock(&transData);
|
||||
|
||||
// pussywizard: remove static transports from client
|
||||
for (GuidUnorderedSet::const_iterator it = player->m_clientGUIDs.begin(); it != player->m_clientGUIDs.end(); )
|
||||
{
|
||||
if ((*it).IsTransport())
|
||||
{
|
||||
transData.AddOutOfRangeGUID(*it);
|
||||
it = player->m_clientGUIDs.erase(it);
|
||||
}
|
||||
else
|
||||
++it;
|
||||
}
|
||||
if (!transData.HasData())
|
||||
return;
|
||||
|
||||
WorldPacket packet;
|
||||
transData.BuildPacket(packet);
|
||||
@ -1686,7 +1621,6 @@ void Map::SendRemoveTransports(Player* player)
|
||||
void Map::SendObjectUpdates()
|
||||
{
|
||||
UpdateDataMapType update_players;
|
||||
UpdatePlayerSet player_set;
|
||||
|
||||
while (!_updateObjects.empty())
|
||||
{
|
||||
@ -1694,7 +1628,7 @@ void Map::SendObjectUpdates()
|
||||
ASSERT(obj->IsInWorld());
|
||||
|
||||
_updateObjects.erase(_updateObjects.begin());
|
||||
obj->BuildUpdate(update_players, player_set);
|
||||
obj->BuildUpdate(update_players);
|
||||
}
|
||||
|
||||
WorldPacket packet; // here we allocate a std::vector with a size of 0x10000
|
||||
@ -1746,7 +1680,7 @@ void Map::DelayedUpdate(const uint32 t_diff)
|
||||
{
|
||||
for (_transportsUpdateIter = _transports.begin(); _transportsUpdateIter != _transports.end();)
|
||||
{
|
||||
MotionTransport* transport = *_transportsUpdateIter;
|
||||
Transport* transport = *_transportsUpdateIter;
|
||||
++_transportsUpdateIter;
|
||||
|
||||
if (!transport->IsInWorld())
|
||||
@ -1791,7 +1725,7 @@ void Map::RemoveAllObjectsInRemoveList()
|
||||
RemoveFromMap((DynamicObject*)obj, true);
|
||||
break;
|
||||
case TYPEID_GAMEOBJECT:
|
||||
if (MotionTransport* transport = obj->ToGameObject()->ToMotionTransport())
|
||||
if (Transport* transport = obj->ToGameObject()->ToTransport())
|
||||
RemoveFromMap(transport, true);
|
||||
else
|
||||
RemoveFromMap(obj->ToGameObject(), true);
|
||||
@ -1824,60 +1758,6 @@ void Map::SendToPlayers(WorldPacket const* data) const
|
||||
itr->GetSource()->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Map::AddToActive(T* obj)
|
||||
{
|
||||
AddToActiveHelper(obj);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Map::AddToActive(Creature* c)
|
||||
{
|
||||
AddToActiveHelper(c);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::AddToActive(DynamicObject* d)
|
||||
{
|
||||
AddToActiveHelper(d);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::AddToActive(GameObject* d)
|
||||
{
|
||||
AddToActiveHelper(d);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::AddToActive(Corpse* /*c*/)
|
||||
{
|
||||
// do nothing for corpses
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void Map::RemoveFromActive(T* obj)
|
||||
{
|
||||
RemoveFromActiveHelper(obj);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Map::RemoveFromActive(Creature* c)
|
||||
{
|
||||
RemoveFromActiveHelper(c);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::RemoveFromActive(DynamicObject* obj)
|
||||
{
|
||||
RemoveFromActiveHelper(obj);
|
||||
}
|
||||
|
||||
template<>
|
||||
void Map::RemoveFromActive(GameObject* obj)
|
||||
{
|
||||
RemoveFromActiveHelper(obj);
|
||||
}
|
||||
|
||||
template bool Map::AddToMap(Corpse*, bool);
|
||||
template bool Map::AddToMap(Creature*, bool);
|
||||
template bool Map::AddToMap(GameObject*, bool);
|
||||
@ -2398,7 +2278,7 @@ GameObject* Map::GetGameObject(ObjectGuid const guid)
|
||||
|
||||
Pet* Map::GetPet(ObjectGuid const guid)
|
||||
{
|
||||
return _objectsStore.Find<Pet>(guid);
|
||||
return dynamic_cast<Pet*>(_objectsStore.Find<Creature>(guid));
|
||||
}
|
||||
|
||||
Transport* Map::GetTransport(ObjectGuid guid)
|
||||
@ -2686,7 +2566,7 @@ void Map::RemoveCorpse(Corpse* corpse)
|
||||
ASSERT(corpse);
|
||||
GridCoord const gridCoord = Acore::ComputeGridCoord(corpse->GetPositionX(), corpse->GetPositionY());
|
||||
|
||||
corpse->DestroyForNearbyPlayers();
|
||||
corpse->DestroyForVisiblePlayers();
|
||||
if (corpse->IsInGrid())
|
||||
RemoveFromMap(corpse, false);
|
||||
else
|
||||
|
||||
@ -146,7 +146,7 @@ struct ZoneDynamicInfo
|
||||
|
||||
typedef std::map<uint32/*leaderDBGUID*/, CreatureGroup*> CreatureGroupHolderType;
|
||||
typedef std::unordered_map<uint32 /*zoneId*/, ZoneDynamicInfo> ZoneDynamicInfoMap;
|
||||
typedef std::set<MotionTransport*> TransportsContainer;
|
||||
typedef std::unordered_set<Transport*> TransportsContainer;
|
||||
|
||||
enum EncounterCreditType : uint8
|
||||
{
|
||||
@ -315,9 +315,6 @@ public:
|
||||
[[nodiscard]] bool HavePlayers() const { return !m_mapRefMgr.IsEmpty(); }
|
||||
[[nodiscard]] uint32 GetPlayersCountExceptGMs() const;
|
||||
|
||||
void AddWorldObject(WorldObject* obj) { i_worldObjects.insert(obj); }
|
||||
void RemoveWorldObject(WorldObject* obj) { i_worldObjects.erase(obj); }
|
||||
|
||||
void SendToPlayers(WorldPacket const* data) const;
|
||||
|
||||
typedef MapRefMgr PlayerList;
|
||||
@ -327,14 +324,6 @@ public:
|
||||
void ScriptsStart(std::map<uint32, std::multimap<uint32, ScriptInfo> > const& scripts, uint32 id, Object* source, Object* target);
|
||||
void ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* source, Object* target);
|
||||
|
||||
// must called with AddToWorld
|
||||
template<class T>
|
||||
void AddToActive(T* obj);
|
||||
|
||||
// must called with RemoveFromWorld
|
||||
template<class T>
|
||||
void RemoveFromActive(T* obj);
|
||||
|
||||
CreatureGroupHolderType CreatureGroupHolder;
|
||||
|
||||
void UpdateIteratorBack(Player* player);
|
||||
@ -490,10 +479,7 @@ public:
|
||||
_updateObjects.erase(obj);
|
||||
}
|
||||
|
||||
std::size_t GetActiveNonPlayersCount() const
|
||||
{
|
||||
return m_activeNonPlayers.size();
|
||||
}
|
||||
size_t GetUpdatableObjectsCount() const { return _updatableObjectList.size(); }
|
||||
|
||||
virtual std::string GetDebugInfo() const;
|
||||
|
||||
@ -549,11 +535,6 @@ protected:
|
||||
MapRefMgr m_mapRefMgr;
|
||||
MapRefMgr::iterator m_mapRefIter;
|
||||
|
||||
typedef std::set<WorldObject*> ActiveNonPlayers;
|
||||
ActiveNonPlayers m_activeNonPlayers;
|
||||
ActiveNonPlayers::iterator m_activeNonPlayersIter;
|
||||
|
||||
// Objects that must update even in inactive grids without activating them
|
||||
TransportsContainer _transports;
|
||||
TransportsContainer::iterator _transportsUpdateIter;
|
||||
|
||||
@ -575,7 +556,6 @@ private:
|
||||
|
||||
bool i_scriptLock;
|
||||
std::unordered_set<WorldObject*> i_objectsToRemove;
|
||||
std::unordered_set<WorldObject*> i_worldObjects;
|
||||
|
||||
typedef std::multimap<time_t, ScriptAction> ScriptScheduleMap;
|
||||
ScriptScheduleMap m_scriptSchedule;
|
||||
@ -583,27 +563,6 @@ private:
|
||||
template<class T>
|
||||
void DeleteFromWorld(T*);
|
||||
|
||||
void AddToActiveHelper(WorldObject* obj)
|
||||
{
|
||||
m_activeNonPlayers.insert(obj);
|
||||
}
|
||||
|
||||
void RemoveFromActiveHelper(WorldObject* obj)
|
||||
{
|
||||
// Map::Update for active object in proccess
|
||||
if (m_activeNonPlayersIter != m_activeNonPlayers.end())
|
||||
{
|
||||
ActiveNonPlayers::iterator itr = m_activeNonPlayers.find(obj);
|
||||
if (itr == m_activeNonPlayers.end())
|
||||
return;
|
||||
if (itr == m_activeNonPlayersIter)
|
||||
++m_activeNonPlayersIter;
|
||||
m_activeNonPlayers.erase(itr);
|
||||
}
|
||||
else
|
||||
m_activeNonPlayers.erase(obj);
|
||||
}
|
||||
|
||||
void UpdateNonPlayerObjects(uint32 const diff);
|
||||
|
||||
void _AddObjectToUpdateList(WorldObject* obj);
|
||||
|
||||
@ -412,10 +412,8 @@ MotionTransport* TransportMgr::CreateTransport(uint32 entry, ObjectGuid::LowType
|
||||
if (map && map->IsDungeon())
|
||||
trans->m_zoneScript = map->ToInstanceMap()->GetInstanceScript();
|
||||
|
||||
// xinef: transports are active so passengers can be relocated (grids must be loaded)
|
||||
trans->setActive(true);
|
||||
HashMapHolder<MotionTransport>::Insert(trans);
|
||||
trans->GetMap()->AddToMap<MotionTransport>(trans);
|
||||
trans->GetMap()->AddToMap<Transport>(trans);
|
||||
return trans;
|
||||
}
|
||||
|
||||
|
||||
@ -336,7 +336,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(_capturePoint, radius);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(_capturePoint, players, checker);
|
||||
Cell::VisitWorldObjects(_capturePoint, searcher, radius);
|
||||
Cell::VisitObjects(_capturePoint, searcher, radius);
|
||||
|
||||
for (auto& itr : players)
|
||||
{
|
||||
|
||||
@ -2838,7 +2838,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo
|
||||
UnitList targets;
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(target, target, target->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(target, targets, u_check);
|
||||
Cell::VisitAllObjects(target, searcher, target->GetMap()->GetVisibilityRange());
|
||||
Cell::VisitObjects(target, searcher, target->GetMap()->GetVisibilityRange());
|
||||
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
|
||||
@ -5631,7 +5631,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
Player* player = nullptr;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(target, 10.0f);
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, player, checker);
|
||||
Cell::VisitWorldObjects(target, searcher, 10.0f);
|
||||
Cell::VisitObjects(target, searcher, 10.0f);
|
||||
|
||||
if (player && player->GetGUID() != target->GetGUID())
|
||||
target->CastSpell(player, 52921, true);
|
||||
@ -7365,7 +7365,7 @@ void AuraEffect::HandleRaidProcFromChargeWithValueAuraProc(AuraApplication* aurA
|
||||
Unit* triggerTarget = nullptr;
|
||||
Acore::MostHPMissingGroupInRange u_check(target, radius, 0);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingGroupInRange> searcher(target, triggerTarget, u_check);
|
||||
Cell::VisitAllObjects(target, searcher, radius);
|
||||
Cell::VisitObjects(target, searcher, radius);
|
||||
|
||||
if (triggerTarget)
|
||||
{
|
||||
|
||||
@ -2823,7 +2823,7 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster)
|
||||
targetList.push_back(GetUnitOwner());
|
||||
Acore::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID);
|
||||
Acore::UnitListSearcher<Acore::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
Cell::VisitAllObjects(GetUnitOwner(), searcher, radius);
|
||||
Cell::VisitObjects(GetUnitOwner(), searcher, radius);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND:
|
||||
@ -2831,14 +2831,14 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* caster)
|
||||
targetList.push_back(GetUnitOwner());
|
||||
Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius);
|
||||
Acore::UnitListSearcher<Acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
Cell::VisitAllObjects(GetUnitOwner(), searcher, radius);
|
||||
Cell::VisitObjects(GetUnitOwner(), searcher, radius);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
||||
{
|
||||
Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher
|
||||
Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check);
|
||||
Cell::VisitAllObjects(GetUnitOwner(), searcher, radius);
|
||||
Cell::VisitObjects(GetUnitOwner(), searcher, radius);
|
||||
break;
|
||||
}
|
||||
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
|
||||
@ -2900,7 +2900,7 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* /*caster*/
|
||||
{
|
||||
Acore::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Acore::UnitListSearcher<Acore::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
Cell::VisitAllObjects(GetDynobjOwner(), searcher, radius);
|
||||
Cell::VisitObjects(GetDynobjOwner(), searcher, radius);
|
||||
}
|
||||
// pussywizard: TARGET_DEST_DYNOBJ_NONE is supposed to search for both friendly and unfriendly targets, so for any unit
|
||||
// what about EffectImplicitTargetA?
|
||||
@ -2908,13 +2908,13 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8>& targets, Unit* /*caster*/
|
||||
{
|
||||
Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Acore::UnitListSearcher<Acore::AnyAttackableUnitExceptForOriginalCasterInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
Cell::VisitAllObjects(GetDynobjOwner(), searcher, radius);
|
||||
Cell::VisitObjects(GetDynobjOwner(), searcher, radius);
|
||||
}
|
||||
else
|
||||
{
|
||||
Acore::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius);
|
||||
Acore::UnitListSearcher<Acore::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check);
|
||||
Cell::VisitAllObjects(GetDynobjOwner(), searcher, radius);
|
||||
Cell::VisitObjects(GetDynobjOwner(), searcher, radius);
|
||||
}
|
||||
|
||||
for (UnitList::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
|
||||
|
||||
@ -2161,24 +2161,7 @@ void Spell::SearchTargets(SEARCHER& searcher, uint32 containerMask, Unit* refere
|
||||
if (!containerMask)
|
||||
return;
|
||||
|
||||
// search world and grid for possible targets
|
||||
bool searchInGrid = containerMask & (GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_GAMEOBJECT);
|
||||
bool searchInWorld = containerMask & (GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_PLAYER | GRID_MAP_TYPE_MASK_CORPSE);
|
||||
|
||||
if (searchInGrid || searchInWorld)
|
||||
{
|
||||
float x, y;
|
||||
x = pos->GetPositionX();
|
||||
y = pos->GetPositionY();
|
||||
|
||||
Map* map = referer->GetMap();
|
||||
|
||||
if (searchInWorld)
|
||||
Cell::VisitWorldObjects(x, y, map, searcher, radius);
|
||||
|
||||
if (searchInGrid)
|
||||
Cell::VisitGridObjects(x, y, map, searcher, radius);
|
||||
}
|
||||
Cell::VisitObjects(pos->GetPositionX(), pos->GetPositionY(), referer->GetMap(), searcher, radius);
|
||||
}
|
||||
|
||||
WorldObject* Spell::SearchNearbyTarget(float range, SpellTargetObjectTypes objectType, SpellTargetCheckTypes selectionType, ConditionList* condList)
|
||||
|
||||
@ -1854,7 +1854,7 @@ void Spell::EffectPersistentAA(SpellEffIndex effIndex)
|
||||
// Caster not in world, might be spell triggered from aura removal
|
||||
if (!caster->IsInWorld() || !caster->FindMap() || !ObjectAccessor::GetUnit(*caster, caster->GetGUID())) // pussywizard: temporary crash fix (FindMap and GetUnit are mine)
|
||||
return;
|
||||
DynamicObject* dynObj = new DynamicObject(false);
|
||||
DynamicObject* dynObj = new DynamicObject();
|
||||
if (!dynObj->CreateDynamicObject(caster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_AREA_SPELL))
|
||||
{
|
||||
delete dynObj;
|
||||
@ -2731,7 +2731,7 @@ void Spell::EffectAddFarsight(SpellEffIndex effIndex)
|
||||
// Remove old farsight if exist
|
||||
bool updateViewerVisibility = m_caster->RemoveDynObject(m_spellInfo->Id);
|
||||
|
||||
DynamicObject* dynObj = new DynamicObject(false);
|
||||
DynamicObject* dynObj = new DynamicObject();
|
||||
if (!dynObj->CreateDynamicObject(m_caster->GetMap()->GenerateLowGuid<HighGuid::DynamicObject>(), m_caster, m_spellInfo->Id, *destTarget, radius, DYNAMIC_OBJECT_FARSIGHT_FOCUS))
|
||||
{
|
||||
delete dynObj;
|
||||
@ -4043,7 +4043,7 @@ void Spell::EffectSanctuary(SpellEffIndex /*effIndex*/)
|
||||
UnitList targets;
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(unitTarget, unitTarget, unitTarget->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(unitTarget, targets, u_check);
|
||||
Cell::VisitAllObjects(unitTarget, searcher, unitTarget->GetVisibilityRange());
|
||||
Cell::VisitObjects(unitTarget, searcher, unitTarget->GetVisibilityRange());
|
||||
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
|
||||
@ -4778,7 +4778,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
|
||||
|
||||
float dist = m_caster->GetVisibilityRange() + VISIBILITY_COMPENSATION;
|
||||
Acore::MessageDistDelivererToHostile notifier(m_caster, &data, dist);
|
||||
Cell::VisitWorldObjects(m_caster, notifier, dist);
|
||||
Cell::VisitObjects(m_caster, notifier, dist);
|
||||
|
||||
// xinef: we should also force pets to remove us from current target
|
||||
Unit::AttackerSet attackerSet;
|
||||
@ -4803,7 +4803,7 @@ void Spell::EffectForceDeselect(SpellEffIndex /*effIndex*/)
|
||||
UnitList targets;
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(m_caster, m_caster, m_caster->GetVisibilityRange()); // no VISIBILITY_COMPENSATION, distance is enough
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(m_caster, targets, u_check);
|
||||
Cell::VisitAllObjects(m_caster, searcher, m_caster->GetVisibilityRange());
|
||||
Cell::VisitObjects(m_caster, searcher, m_caster->GetVisibilityRange());
|
||||
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
if (!(*iter)->HasUnitState(UNIT_STATE_CASTING))
|
||||
|
||||
@ -251,7 +251,7 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder
|
||||
dist = 250.0f;
|
||||
|
||||
Acore::PlayerDistWorker<CreatureTextLocalizer<Builder> > worker(source, dist, localizer);
|
||||
Cell::VisitWorldObjects(source, worker, dist);
|
||||
Cell::VisitObjects(source, worker, dist);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -911,7 +911,7 @@ public:
|
||||
Creature* passenger = nullptr;
|
||||
Acore::AllCreaturesOfEntryInRange check(handler->GetPlayer(), entry, 20.0f);
|
||||
Acore::CreatureSearcher<Acore::AllCreaturesOfEntryInRange> searcher(handler->GetPlayer(), passenger, check);
|
||||
Cell::VisitAllObjects(handler->GetPlayer(), searcher, 30.0f);
|
||||
Cell::VisitObjects(handler->GetPlayer(), searcher, 30.0f);
|
||||
|
||||
if (!passenger || passenger == target)
|
||||
return false;
|
||||
@ -1347,11 +1347,11 @@ public:
|
||||
|
||||
static void HandleDebugObjectCountMap(ChatHandler* handler, Map* map)
|
||||
{
|
||||
handler->PSendSysMessage("Map Id: {} Name: '{}' Instance Id: {} Creatures: {} GameObjects: {} SetActive Objects: {}",
|
||||
handler->PSendSysMessage("Map Id: {} Name: '{}' Instance Id: {} Creatures: {} GameObjects: {} Update Objects: {}",
|
||||
map->GetId(), map->GetMapName(), map->GetInstanceId(),
|
||||
uint64(map->GetObjectsStore().Size<Creature>()),
|
||||
uint64(map->GetObjectsStore().Size<GameObject>()),
|
||||
uint64(map->GetActiveNonPlayersCount()));
|
||||
uint64(map->GetUpdatableObjectsCount()));
|
||||
|
||||
CreatureCountWorker worker;
|
||||
TypeContainerVisitor<CreatureCountWorker, MapStoredObjectTypesContainer> visitor(worker);
|
||||
|
||||
@ -2451,7 +2451,7 @@ public:
|
||||
|
||||
Acore::RespawnDo u_do;
|
||||
Acore::WorldObjectWorker<Acore::RespawnDo> worker(player, u_do);
|
||||
Cell::VisitGridObjects(player, worker, player->GetGridActivationRange());
|
||||
Cell::VisitObjects(player, worker, player->GetGridActivationRange());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -268,7 +268,7 @@ public:
|
||||
std::list<Creature*> creatureList;
|
||||
Acore::AnyUnitInObjectRangeCheck go_check(object, radius);
|
||||
Acore::CreatureListSearcher<Acore::AnyUnitInObjectRangeCheck> go_search(object, creatureList, go_check);
|
||||
Cell::VisitGridObjects(object, go_search, radius);
|
||||
Cell::VisitObjects(object, go_search, radius);
|
||||
|
||||
if (!creatureList.empty())
|
||||
{
|
||||
|
||||
@ -793,7 +793,7 @@ struct npc_brewfest_super_brew_trigger : public ScriptedAI
|
||||
Player* player = nullptr;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(me, 2.0f);
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(me, player, checker);
|
||||
Cell::VisitWorldObjects(me, searcher, 2.0f);
|
||||
Cell::VisitObjects(me, searcher, 2.0f);
|
||||
if (player)
|
||||
{
|
||||
player->CastSpell(player, SPELL_DRUNKEN_MASTER, true);
|
||||
|
||||
@ -807,7 +807,7 @@ struct npc_hallows_end_soh : public ScriptedAI
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(me, 60.f);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
|
||||
Cell::VisitWorldObjects(me, searcher, 60.f);
|
||||
Cell::VisitObjects(me, searcher, 60.f);
|
||||
if (players.empty())
|
||||
{
|
||||
return;
|
||||
@ -887,7 +887,7 @@ struct npc_hallows_end_soh : public ScriptedAI
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(me, radius);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(me, players, checker);
|
||||
Cell::VisitWorldObjects(me, searcher, radius);
|
||||
Cell::VisitObjects(me, searcher, radius);
|
||||
|
||||
for (Player* player : players)
|
||||
{
|
||||
|
||||
@ -407,7 +407,7 @@ class spell_love_is_in_the_air_romantic_picnic : public AuraScript
|
||||
std::list<Player*> playerList;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(target, INTERACTION_DISTANCE * 2);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(target, playerList, checker);
|
||||
Cell::VisitWorldObjects(target, searcher, INTERACTION_DISTANCE * 2);
|
||||
Cell::VisitObjects(target, searcher, INTERACTION_DISTANCE * 2);
|
||||
for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
|
||||
{
|
||||
if ((*itr) != target && (*itr)->HasAura(GetId())) // && (*itr)->getStandState() == UNIT_STAND_STATE_SIT)
|
||||
|
||||
@ -198,7 +198,7 @@ public:
|
||||
std::list<WorldObject*> ClusterList;
|
||||
Acore::AllWorldObjectsInRange objects(me, 50.0f);
|
||||
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(me, ClusterList, objects);
|
||||
Cell::VisitAllObjects(me, searcher, 50.0f);
|
||||
Cell::VisitObjects(me, searcher, 50.0f);
|
||||
for (std::list<WorldObject*>::const_iterator itr = ClusterList.begin(); itr != ClusterList.end(); ++itr)
|
||||
{
|
||||
if (Player* player = (*itr)->ToPlayer())
|
||||
|
||||
@ -178,7 +178,7 @@ struct boss_ouro : public BossAI
|
||||
std::list<WorldObject*> targets;
|
||||
Acore::AllWorldObjectsInRange checker(me, 10.0f);
|
||||
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(me, targets, checker);
|
||||
Cell::VisitAllObjects(me, searcher, 10.0f);
|
||||
Cell::VisitObjects(me, searcher, 10.0f);
|
||||
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
|
||||
@ -498,7 +498,7 @@ class spell_zulfarrak_unlocking : public SpellScript
|
||||
std::list<WorldObject*> cagesList;
|
||||
Acore::AllWorldObjectsInRange objects(GetCaster(), 15.0f);
|
||||
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(GetCaster(), cagesList, objects);
|
||||
Cell::VisitAllObjects(GetCaster(), searcher, 15.0f);
|
||||
Cell::VisitObjects(GetCaster(), searcher, 15.0f);
|
||||
for (std::list<WorldObject*>::const_iterator itr = cagesList.begin(); itr != cagesList.end(); ++itr)
|
||||
{
|
||||
if (GameObject* go = (*itr)->ToGameObject())
|
||||
|
||||
@ -653,7 +653,7 @@ public:
|
||||
Unit* unit = nullptr;
|
||||
Acore::MostHPMissingInRange u_check(me, 40.f, 1500);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, 40.f);
|
||||
Cell::VisitObjects(me, searcher, 40.f);
|
||||
if (unit)
|
||||
{
|
||||
DoCast(unit, SPELL_HEAL);
|
||||
@ -671,7 +671,7 @@ public:
|
||||
Unit* unit = nullptr;
|
||||
Acore::MostHPMissingInRange u_check(me, 40.f, 700);
|
||||
Acore::UnitLastSearcher<Acore::MostHPMissingInRange> searcher(me, unit, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, 40.f);
|
||||
Cell::VisitObjects(me, searcher, 40.f);
|
||||
if (unit)
|
||||
{
|
||||
DoCast(unit, SPELL_RENEW);
|
||||
|
||||
@ -333,7 +333,7 @@ public:
|
||||
std::list<Player*> playerOnQuestList;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(me, 5.0f);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(me, playerOnQuestList, checker);
|
||||
Cell::VisitWorldObjects(me, searcher, 5.0f);
|
||||
Cell::VisitObjects(me, searcher, 5.0f);
|
||||
for (std::list<Player*>::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr)
|
||||
{
|
||||
// Check if found player target has active quest
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
c->UpdatePosition(630.88f, 131.39f, 140.8f, 3.02f, true);
|
||||
|
||||
c->StopMovingOnCurrentPos();
|
||||
c->DestroyForNearbyPlayers();
|
||||
c->DestroyForVisiblePlayers();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -792,7 +792,7 @@ public:
|
||||
{
|
||||
icehowl->UpdatePosition(513.19f, 139.48f, 395.22f, 3 * M_PI / 2, true);
|
||||
icehowl->StopMovingOnCurrentPos();
|
||||
icehowl->DestroyForNearbyPlayers();
|
||||
icehowl->DestroyForVisiblePlayers();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -959,7 +959,7 @@ public:
|
||||
{
|
||||
jaraxxus->UpdatePosition(613.83f, 139.5f, 395.22f, 3 * M_PI / 2, true);
|
||||
jaraxxus->StopMovingOnCurrentPos();
|
||||
jaraxxus->DestroyForNearbyPlayers();
|
||||
jaraxxus->DestroyForVisiblePlayers();
|
||||
}
|
||||
|
||||
if (Creature* c = instance->GetCreature(NPC_TirionGUID))
|
||||
|
||||
@ -673,7 +673,7 @@ public:
|
||||
// Reset The Frozen Throne gameobjects
|
||||
FrozenThroneResetWorker reset;
|
||||
Acore::GameObjectWorker<FrozenThroneResetWorker> worker(me, reset);
|
||||
Cell::VisitGridObjects(me, worker, 333.0f);
|
||||
Cell::VisitObjects(me, worker, 333.0f);
|
||||
|
||||
me->AddAura(SPELL_EMOTE_SIT_NO_SHEATH, me);
|
||||
me->SetImmuneToPC(true);
|
||||
|
||||
@ -224,7 +224,7 @@ public:
|
||||
bool Execute(uint64 /*currTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
Acore::CreatureWorker<ValithriaDespawner> worker(_creature, *this);
|
||||
Cell::VisitGridObjects(_creature, worker, 333.0f);
|
||||
Cell::VisitObjects(_creature, worker, 333.0f);
|
||||
_creature->AI()->Reset();
|
||||
_creature->setActive(false);
|
||||
return true;
|
||||
@ -545,7 +545,7 @@ public:
|
||||
std::list<Creature*> archmages;
|
||||
RisenArchmageCheck check;
|
||||
Acore::CreatureListSearcher<RisenArchmageCheck> searcher(me, archmages, check);
|
||||
Cell::VisitGridObjects(me, searcher, 100.0f);
|
||||
Cell::VisitObjects(me, searcher, 100.0f);
|
||||
for (std::list<Creature*>::iterator itr = archmages.begin(); itr != archmages.end(); ++itr)
|
||||
(*itr)->AI()->DoAction(ACTION_ENTER_COMBAT);
|
||||
}
|
||||
|
||||
@ -856,7 +856,7 @@ public:
|
||||
std::list<Creature*> temp;
|
||||
FrostwingVrykulSearcher check(me, 150.0f);
|
||||
Acore::CreatureListSearcher<FrostwingVrykulSearcher> searcher(me, temp, check);
|
||||
Cell::VisitGridObjects(me, searcher, 150.0f);
|
||||
Cell::VisitObjects(me, searcher, 150.0f);
|
||||
|
||||
_aliveTrash.clear();
|
||||
for (std::list<Creature*>::iterator itr = temp.begin(); itr != temp.end(); ++itr)
|
||||
@ -901,14 +901,14 @@ public:
|
||||
Player* player = nullptr;
|
||||
Acore::AnyPlayerInObjectRangeCheck check(me, 140.0f);
|
||||
Acore::PlayerSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(me, player, check);
|
||||
Cell::VisitWorldObjects(me, searcher, 140.0f);
|
||||
Cell::VisitObjects(me, searcher, 140.0f);
|
||||
// wipe
|
||||
if (!player || me->GetExactDist(4357.0f, 2606.0f, 350.0f) > 125.0f)
|
||||
{
|
||||
//Talk(SAY_CROK_DEATH);
|
||||
FrostwingGauntletRespawner respawner;
|
||||
Acore::CreatureWorker<FrostwingGauntletRespawner> worker(me, respawner);
|
||||
Cell::VisitGridObjects(me, worker, 333.0f);
|
||||
Cell::VisitObjects(me, worker, 333.0f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1365,7 +1365,7 @@ public:
|
||||
Creature* target = nullptr;
|
||||
Acore::MostHPMissingInRange u_check(me, 60.0f, 0);
|
||||
Acore::CreatureLastSearcher<Acore::MostHPMissingInRange> searcher(me, target, u_check);
|
||||
Cell::VisitGridObjects(me, searcher, 60.0f);
|
||||
Cell::VisitObjects(me, searcher, 60.0f);
|
||||
return target;
|
||||
}
|
||||
};
|
||||
@ -2261,7 +2261,7 @@ public:
|
||||
{
|
||||
FrostwingGauntletRespawner respawner;
|
||||
Acore::CreatureWorker<FrostwingGauntletRespawner> worker(crok, respawner);
|
||||
Cell::VisitGridObjects(crok, worker, 333.0f);
|
||||
Cell::VisitObjects(crok, worker, 333.0f);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
||||
@ -252,7 +252,7 @@ public:
|
||||
me->SummonCreature(summons[0][i], cords[0][0] + ((i % 2) ? 4.0f : -4.0f), cords[0][1] + (i < 2 ? 4.0f : -4.0f), cords[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
|
||||
uint8 phase = GetPhaseByCurrentPosition();
|
||||
me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
|
||||
me->DestroyForNearbyPlayers();
|
||||
me->DestroyForVisiblePlayers();
|
||||
LeaveCombat();
|
||||
me->CastSpell(me, SPELL_EVOCATION, true);
|
||||
releaseLockTimer = 1;
|
||||
@ -264,7 +264,7 @@ public:
|
||||
me->SummonCreature(summons[1][i], cords[1][0] + ((i % 2) ? 4.0f : -4.0f), cords[1][1] + (i < 2 ? 4.0f : -4.0f), cords[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
|
||||
uint8 phase = GetPhaseByCurrentPosition();
|
||||
me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
|
||||
me->DestroyForNearbyPlayers();
|
||||
me->DestroyForVisiblePlayers();
|
||||
LeaveCombat();
|
||||
me->CastSpell(me, SPELL_EVOCATION, true);
|
||||
releaseLockTimer = 1;
|
||||
@ -276,7 +276,7 @@ public:
|
||||
me->SummonCreature(summons[2][i], cords[2][0] + ((i % 2) ? 4.0f : -4.0f), cords[2][1] + (i < 2 ? 4.0f : -4.0f), cords[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000);
|
||||
uint8 phase = GetPhaseByCurrentPosition();
|
||||
me->SetHomePosition(cords[phase + 1][0], cords[phase + 1][1], cords[phase + 1][2], cords[phase + 1][3]);
|
||||
me->DestroyForNearbyPlayers();
|
||||
me->DestroyForVisiblePlayers();
|
||||
LeaveCombat();
|
||||
me->CastSpell(me, SPELL_EVOCATION, true);
|
||||
releaseLockTimer = 1;
|
||||
|
||||
@ -1665,7 +1665,7 @@ class spell_vehicle_throw_passenger : public SpellScript
|
||||
std::list<WorldObject*> targetList;
|
||||
Acore::WorldObjectSpellAreaTargetCheck check(99, GetExplTargetDest(), GetCaster(), GetCaster(), GetSpellInfo(), TARGET_CHECK_DEFAULT, nullptr);
|
||||
Acore::WorldObjectListSearcher<Acore::WorldObjectSpellAreaTargetCheck> searcher(GetCaster(), targetList, check);
|
||||
Cell::VisitAllObjects(GetCaster(), searcher, 99.0f);
|
||||
Cell::VisitObjects(GetCaster(), searcher, 99.0f);
|
||||
float minDist = 99 * 99;
|
||||
Unit* target = nullptr;
|
||||
for (std::list<WorldObject*>::iterator itr = targetList.begin(); itr != targetList.end(); ++itr)
|
||||
|
||||
@ -366,7 +366,7 @@ struct boss_ingvar_the_plunderer : public ScriptedAI
|
||||
case EVENT_AXE_PICKUP:
|
||||
if (Creature* c = ObjectAccessor::GetCreature(*me, ThrowGUID))
|
||||
{
|
||||
c->DestroyForNearbyPlayers();
|
||||
c->DestroyForVisiblePlayers();
|
||||
c->DespawnOrUnsummon();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ public:
|
||||
c->loot.FillLoot(lootid, LootTemplates_Creature, c->GetLootRecipient(), false, false, c->GetLootMode(), c);
|
||||
if (c->GetLootMode())
|
||||
c->loot.generateMoneyLoot(c->GetCreatureTemplate()->mingold, c->GetCreatureTemplate()->maxgold);
|
||||
c->DestroyForNearbyPlayers();
|
||||
c->DestroyForVisiblePlayers();
|
||||
c->SetVisible(true);
|
||||
}
|
||||
break;
|
||||
@ -244,7 +244,7 @@ public:
|
||||
c->loot.FillLoot(lootid, LootTemplates_Creature, c->GetLootRecipient(), false, false, c->GetLootMode(), c);
|
||||
if (c->GetLootMode())
|
||||
c->loot.generateMoneyLoot(c->GetCreatureTemplate()->mingold, c->GetCreatureTemplate()->maxgold);
|
||||
c->DestroyForNearbyPlayers();
|
||||
c->DestroyForVisiblePlayers();
|
||||
c->SetVisible(true);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -159,7 +159,7 @@ public:
|
||||
{
|
||||
me->UpdatePosition(me->GetPositionX(), me->GetPositionY(), h, me->GetOrientation(), true); // move to ground
|
||||
me->StopMovingOnCurrentPos();
|
||||
me->DestroyForNearbyPlayers();
|
||||
me->DestroyForVisiblePlayers();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1067,7 +1067,7 @@ public:
|
||||
go->Delete();
|
||||
WretchedGhoulCleaner cleaner;
|
||||
Acore::CreatureWorker<WretchedGhoulCleaner> worker(me, cleaner);
|
||||
Cell::VisitGridObjects(me, worker, 150.0f);
|
||||
Cell::VisitObjects(me, worker, 150.0f);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
@ -1281,7 +1281,7 @@ public:
|
||||
{
|
||||
WretchedGhoulCleaner cleaner;
|
||||
Acore::CreatureWorker<WretchedGhoulCleaner> worker(me, cleaner);
|
||||
Cell::VisitGridObjects(me, worker, 150.0f);
|
||||
Cell::VisitObjects(me, worker, 150.0f);
|
||||
|
||||
if (Creature* c = me->FindNearestCreature(NPC_SAC_LIGHTS_VENGEANCE, 150.0f, true))
|
||||
if (Creature* v = me->FindNearestCreature(NPC_SAC_VEGARD_1, 50.0f, true))
|
||||
|
||||
@ -615,7 +615,7 @@ bool OPvPCapturePointNA::Update(uint32 diff)
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(_capturePoint, radius);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(_capturePoint, players, checker);
|
||||
Cell::VisitWorldObjects(_capturePoint, searcher, radius);
|
||||
Cell::VisitObjects(_capturePoint, searcher, radius);
|
||||
|
||||
for (Player* player : players)
|
||||
{
|
||||
|
||||
@ -110,10 +110,11 @@ public:
|
||||
{
|
||||
if (Player* target = ObjectAccessor::GetPlayer(_owner, _targetGUID))
|
||||
{
|
||||
target->m_clientGUIDs.insert(_owner.GetGUID());
|
||||
// @todo: wtf? this is wrong but I cba looking into it.
|
||||
target->GetObjectVisibilityContainer().LinkWorldObjectVisibility(&_owner);
|
||||
_owner.CastSpell(target, SPELL_ENVENOM, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_DEADLY_POISON);
|
||||
target->m_clientGUIDs.erase(_owner.GetGUID());
|
||||
target->GetObjectVisibilityContainer().UnlinkWorldObjectVisibility(&_owner);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -699,7 +699,7 @@ public:
|
||||
std::list<WorldObject*> ClusterList;
|
||||
Acore::AllWorldObjectsInRange objects(me, searchDistance);
|
||||
Acore::WorldObjectListSearcher<Acore::AllWorldObjectsInRange> searcher(me, ClusterList, objects);
|
||||
Cell::VisitAllObjects(me, searcher, searchDistance);
|
||||
Cell::VisitObjects(me, searcher, searchDistance);
|
||||
|
||||
for (std::list<WorldObject*>::const_iterator i = ClusterList.begin(); i != ClusterList.end(); ++i)
|
||||
{
|
||||
|
||||
@ -174,7 +174,7 @@ struct npc_pet_dk_ebon_gargoyle : ScriptedAI
|
||||
std::list<Unit*> targets;
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 50.0f);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(me, targets, u_check);
|
||||
Cell::VisitAllObjects(me, searcher, 50.0f);
|
||||
Cell::VisitObjects(me, searcher, 50.0f);
|
||||
for (auto const& target : targets)
|
||||
if (target->GetAura(SPELL_DK_SUMMON_GARGOYLE_1, me->GetOwnerGUID()))
|
||||
{
|
||||
@ -245,6 +245,20 @@ struct npc_pet_dk_ghoul : public CombatAI
|
||||
{
|
||||
npc_pet_dk_ghoul(Creature* c) : CombatAI(c) { }
|
||||
|
||||
void IsSummonedBy(WorldObject* summoner) override
|
||||
{
|
||||
if (!summoner || !summoner->IsPlayer())
|
||||
return;
|
||||
|
||||
Player* player = summoner->ToPlayer();
|
||||
|
||||
if (Unit* victim = player->GetVictim())
|
||||
{
|
||||
me->Attack(victim, true);
|
||||
me->GetMotionMaster()->MoveChase(victim);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*who*/) override
|
||||
{
|
||||
if (me->IsGuardian() || me->IsSummon())
|
||||
@ -278,6 +292,28 @@ struct npc_pet_dk_army_of_the_dead : public CombatAI
|
||||
CombatAI::InitializeAI();
|
||||
((Minion*)me)->SetFollowAngle(rand_norm() * 2 * M_PI);
|
||||
}
|
||||
|
||||
void IsSummonedBy(WorldObject* summoner) override
|
||||
{
|
||||
if (Unit* owner = summoner->ToUnit())
|
||||
{
|
||||
Unit* victim = owner->GetVictim();
|
||||
|
||||
if (victim && me->IsValidAttackTarget(victim))
|
||||
{
|
||||
AttackStart(victim);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If there is no valid target, attack the nearest enemy within 30m
|
||||
if (Unit* nearest = me->SelectNearbyTarget(nullptr, 30.0f))
|
||||
{
|
||||
if (me->IsValidAttackTarget(nearest))
|
||||
AttackStart(nearest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_pet_dk_dancing_rune_weapon : public NullCreatureAI
|
||||
|
||||
@ -1358,11 +1358,7 @@ class spell_gen_cannibalize : public SpellScript
|
||||
// search for nearby enemy corpse in range
|
||||
Acore::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_CORPSE);
|
||||
Acore::WorldObjectSearcher<Acore::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
|
||||
Cell::VisitWorldObjects(caster, searcher, max_range);
|
||||
if (!result)
|
||||
{
|
||||
Cell::VisitGridObjects(caster, searcher, max_range);
|
||||
}
|
||||
Cell::VisitObjects(caster, searcher, max_range);
|
||||
if (!result)
|
||||
{
|
||||
return SPELL_FAILED_NO_EDIBLE_CORPSES;
|
||||
@ -5363,7 +5359,7 @@ class spell_pet_intellect_spirit_resilience_scaling : public AuraScript
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateSpiritAmount, EFFECT_1,SPELL_AURA_MOD_STAT);
|
||||
// The resilience scaling is not used. The owner's resilience is used directly
|
||||
// DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateResilienceAmount, EFFECT_2, SPELL_AURA_MOD_RATING);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_pet_intellect_spirit_resilience_scaling::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_pet_intellect_spirit_resilience_scaling::HandleEffectApply, EFFECT_2, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_pet_intellect_spirit_resilience_scaling::CalcPeriodic, EFFECT_ALL, SPELL_AURA_ANY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pet_intellect_spirit_resilience_scaling::HandlePeriodic, EFFECT_ALL, SPELL_AURA_ANY);
|
||||
}
|
||||
|
||||
@ -843,11 +843,7 @@ class spell_hun_pet_carrion_feeder : public SpellScript
|
||||
// search for nearby enemy corpse in range
|
||||
Acore::AnyDeadUnitSpellTargetInRangeCheck check(caster, max_range, GetSpellInfo(), TARGET_CHECK_ENEMY);
|
||||
Acore::WorldObjectSearcher<Acore::AnyDeadUnitSpellTargetInRangeCheck> searcher(caster, result, check);
|
||||
Cell::VisitWorldObjects(caster, searcher, max_range);
|
||||
if (!result)
|
||||
{
|
||||
Cell::VisitGridObjects(caster, searcher, max_range);
|
||||
}
|
||||
Cell::VisitObjects(caster, searcher, max_range);
|
||||
if (!result)
|
||||
{
|
||||
return SPELL_FAILED_NO_EDIBLE_CORPSES;
|
||||
|
||||
@ -1876,7 +1876,7 @@ class spell_q11010_q11102_q11023_choose_loc : public SpellScript
|
||||
std::list<Player*> playerList;
|
||||
Acore::AnyPlayerInObjectRangeCheck checker(caster, 65.0f);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker);
|
||||
Cell::VisitWorldObjects(caster, searcher, 65.0f);
|
||||
Cell::VisitObjects(caster, searcher, 65.0f);
|
||||
for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr)
|
||||
// Check if found player target is on fly mount or using flying form
|
||||
if ((*itr)->HasFlyAura() || (*itr)->HasIncreaseMountedFlightSpeedAura())
|
||||
|
||||
@ -80,7 +80,7 @@ public:
|
||||
if (_timer > 5000)
|
||||
{
|
||||
me->CastSpell(nullptr, 9056);
|
||||
me->DestroyForNearbyPlayers();
|
||||
me->DestroyForVisiblePlayers();
|
||||
_timer = 0;
|
||||
}
|
||||
}
|
||||
@ -322,7 +322,7 @@ public:
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerExactPositionInGameObjectRangeCheck checker(me, 0.3f);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerExactPositionInGameObjectRangeCheck> searcher(me, players, checker);
|
||||
Cell::VisitWorldObjects(me, searcher, 0.3f);
|
||||
Cell::VisitObjects(me, searcher, 0.3f);
|
||||
|
||||
if (players.size() > 0)
|
||||
{
|
||||
@ -369,7 +369,7 @@ public:
|
||||
std::list<Player*> players;
|
||||
Acore::AnyPlayerExactPositionInGameObjectRangeCheck checker(me, 0.3f);
|
||||
Acore::PlayerListSearcher<Acore::AnyPlayerExactPositionInGameObjectRangeCheck> searcher(me, players, checker);
|
||||
Cell::VisitWorldObjects(me, searcher, 0.3f);
|
||||
Cell::VisitObjects(me, searcher, 0.3f);
|
||||
|
||||
if (players.size() > 0)
|
||||
{
|
||||
@ -823,7 +823,7 @@ public:
|
||||
std::list<Player*> targets;
|
||||
Acore::AnyPlayerInObjectRangeCheck check(me, me->GetVisibilityRange(), false);
|
||||
Acore::PlayerListSearcherWithSharedVision<Acore::AnyPlayerInObjectRangeCheck> searcher(me, targets, check);
|
||||
Cell::VisitWorldObjects(me, searcher, me->GetVisibilityRange());
|
||||
Cell::VisitObjects(me, searcher, me->GetVisibilityRange());
|
||||
for (Player* player : targets)
|
||||
{
|
||||
if (player->GetTeamId() == TEAM_HORDE)
|
||||
|
||||
@ -931,7 +931,7 @@ struct npc_pallid_horror : public ScriptedAI
|
||||
std::list<Creature*> targets;
|
||||
FlameshockerCheck check;
|
||||
Acore::CreatureListSearcher<FlameshockerCheck> searcher(me, targets, check);
|
||||
Cell::VisitGridObjects(me, searcher, VISIBILITY_DISTANCE_NORMAL);
|
||||
Cell::VisitObjects(me, searcher, VISIBILITY_DISTANCE_NORMAL);
|
||||
|
||||
if (!targets.empty())
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user