diff options
23 files changed, 1162 insertions, 198 deletions
diff --git a/sql/updates/world/master/2025_10_02_00_world.sql b/sql/updates/world/master/2025_10_02_00_world.sql new file mode 100644 index 00000000000..ee564fa63e8 --- /dev/null +++ b/sql/updates/world/master/2025_10_02_00_world.sql @@ -0,0 +1,24 @@ +-- Quest: Its Alive! +UPDATE `creature_template` SET `VehicleId`= 907, `ScriptName`= 'npc_westfall_overloaded_harvest_golem' WHERE `entry`= 42601; + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`= 42601; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(42601, 46598, 1, 0); + +DELETE FROM `creature_template_spell` WHERE (`CreatureID`=42601 AND `Index` IN (1,0)); +INSERT INTO `creature_template_spell` (`CreatureID`, `Index`, `Spell`, `VerifiedBuild`) VALUES +(42601, 1, 79430, 63305), -- Overloaded Harvest Golem +(42601, 0, 79425, 63305); -- Overloaded Harvest Golem + +DELETE FROM `conditions` WHERE `SourceEntry`= 79436 AND `SourceTypeOrReferenceId`= 13; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES +(13, 2, 79436, 0, 0, 31, 0, 3, 42381, 0, 0, 0, '', 'Wake Harvest Golem - Target Overloaded Harvest Golem'); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_westfall_reaping_blows', 'spell_westfall_wake_harvest_golem'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(79425, 'spell_westfall_reaping_blows'), +(79436, 'spell_westfall_wake_harvest_golem'); + +DELETE FROM `creature_text` WHERE `CreatureID`= 42601; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `Comment`) VALUES +(42601, 0, 0, 'You may only ride the Overloaded Harvest Golem at the Molsen Farm.', 42, 0, 100, 0, 0, 0, 42475, ''); diff --git a/sql/updates/world/master/2025_10_02_01_world.sql b/sql/updates/world/master/2025_10_02_01_world.sql new file mode 100644 index 00000000000..b8afeedea3a --- /dev/null +++ b/sql/updates/world/master/2025_10_02_01_world.sql @@ -0,0 +1,27 @@ +-- Template +DELETE FROM `smart_scripts` WHERE `entryorguid`= 34981; +UPDATE `creature_template` SET `AIName`= '', `ScriptName`= 'npc_frightened_citizen' WHERE `entry` IN (34981, 35836); + +-- Rampaging Worgen fixups +UPDATE `creature_template` SET `flags_extra` = `flags_extra` | 2 WHERE `entry`= 34884; + +-- SpellScriptName +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gilneas_knocking'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(67869, 'spell_gilneas_knocking'); + +-- Creature Text +DELETE FROM `creature_text` WHERE `CreatureID` IN (34981, 35836); +INSERT INTO `creature_text` (`CreatureID`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +(34981, 0, 0, 'What in the world? Let''s get out of here!', 12, 0, 100, 1, 0, 0, 35235, 'Frightened Citizen to Player'), +(34981, 0, 1, 'Let''s go!', 12, 0, 100, 1, 0, 0, 35236, 'Frightened Citizen to Player'), +(34981, 0, 2, 'No time to waste!', 12, 0, 100, 1, 0, 0, 35237, 'Frightened Citizen to Player'), +(34981, 0, 3, 'Worgen! Worgen everywhere!', 12, 0, 100, 1, 0, 0, 35238, 'Frightened Citizen to Player'), +(34981, 0, 4, 'Flee! They''re everywhere!', 12, 0, 100, 1, 0, 0, 35240, 'Frightened Citizen to Player'), +(34981, 0, 5, 'This place isn''t safe. Let''s leave!', 12, 0, 100, 1, 0, 0, 35239, 'Frightened Citizen to Player'), +(34981, 0, 6, 'Protect me, please!', 12, 0, 100, 1, 0, 0, 35234, 'Frightened Citizen to Player'), +(35836, 0, 0, 'It''s coming right for me!!', 12, 0, 100, 1, 0, 0, 36037, 'Frightened Citizen to Player'), +(35836, 0, 1, 'Help me, please!', 12, 0, 100, 1, 0, 0, 36038, 'Frightened Citizen to Player'), +(35836, 0, 2, 'There''s one after me!', 12, 0, 100, 1, 0, 0, 36039, 'Frightened Citizen to Player'), +(35836, 0, 3, 'Help!', 12, 0, 100, 1, 0, 0, 36040, 'Frightened Citizen to Player'), +(35836, 0, 4, 'I don''t want to die!', 12, 0, 100, 1, 0, 0, 36041, 'Frightened Citizen to Player'); diff --git a/sql/updates/world/master/2025_10_02_02_world.sql b/sql/updates/world/master/2025_10_02_02_world.sql new file mode 100644 index 00000000000..6e62341ce9d --- /dev/null +++ b/sql/updates/world/master/2025_10_02_02_world.sql @@ -0,0 +1,178 @@ +SET @CGUID := 7003691; +SET @OGUID := 7000697; +SET @SPAWN_GROUP := 1271; +SET @AT_ID := 168; +SET @AT_PROP_ID := 162; +SET @AT_SPAWN_ID = 265; + +SET @AT_RADIUS := 53; +SET @AT_HEIGHT := 25; + +DELETE FROM `areatrigger_template` WHERE `Id` = @AT_ID AND `IsCustom` = 1; +INSERT INTO `areatrigger_template` (`Id`, `IsCustom`) VALUES +(@AT_ID, 1); + +DELETE FROM `areatrigger_create_properties` WHERE `Id` = @AT_PROP_ID AND `IsCustom` = 1; +INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`) VALUES +(@AT_PROP_ID, 1, @AT_ID, 1, 4, @AT_RADIUS, @AT_RADIUS, @AT_HEIGHT, @AT_HEIGHT, 0 /*LocationZOffset*/, 0 /*LocationZOffsetTarget*/, 0, 0); + +DELETE FROM `areatrigger_template_actions` WHERE `AreaTriggerId` = @AT_ID AND `IsCustom` = 1; +INSERT INTO `areatrigger_template_actions` (`AreaTriggerId`, `IsCustom`, `ActionType`, `ActionParam`, `TargetType`) VALUES +(@AT_ID, 1, 0, 307005, 0); -- Arena Inbounds Area Marker + +DELETE FROM `areatrigger` WHERE `SpawnId` BETWEEN @AT_SPAWN_ID+0 AND @AT_SPAWN_ID+1; +INSERT INTO `areatrigger` (`SpawnId`, `AreaTriggerCreatePropertiesId`, `IsCustom`, `MapId`, `PosX`, `PosY`, `PosZ`, `Orientation`, `Comment`) VALUES +(@AT_SPAWN_ID+0, @AT_PROP_ID, 1, 2167, -281.619598, -278.841583, 70.442131, 0, 'The Robodrome Inbounds'); + +DELETE FROM `battleground_scripts` WHERE `MapId` = 2167 AND `BattlemasterListId` = 0; +INSERT INTO `battleground_scripts` (`MapId`, `BattlemasterListId`, `ScriptName`) VALUES +(2167, 0, 'arena_the_robodrome'); -- The Robodrome + +DELETE FROM `battleground_template` WHERE `ID` = 1025; +INSERT INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `Comment`) VALUES +(1025, 7208, 7209, 0, 1, 'The Robodrome'); + +DELETE FROM `gameobject_template_addon` WHERE `entry` IN (329743 /*Doodad_8XP_MECHAGONARENA_PVPDOOR002*/, 329742 /*Doodad_8XP_MECHAGONARENA_PVPDOOR001*/); +INSERT INTO `gameobject_template_addon` (`entry`, `faction`, `flags`, `WorldEffectID`, `AIAnimKitID`) VALUES +(329743, 1375, 0x20, 0, 0), -- Doodad_8XP_MECHAGONARENA_PVPDOOR002 +(329742, 1375, 0x20, 0, 0); -- Doodad_8XP_MECHAGONARENA_PVPDOOR001 + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+3; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0, 329742, 2167, 10497, 10497, '0', '0', 0, -206.134368896484375, -279.045745849609375, 90.6704559326171875, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Doodad_8XP_MECHAGONARENA_PVPDOOR001 (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@OGUID+1, 329743, 2167, 10497, 10497, '0', '0', 0, -356.5426025390625, -279.0457763671875, 90.6704559326171875, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Doodad_8XP_MECHAGONARENA_PVPDOOR002 (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@OGUID+2, 184664, 2167, 10497, 10497, '0', '0', 0, -274.296875, -229.8125, 70.89987945556640625, 3.316144466400146484, 0, 0, -0.99619388580322265, 0.087165042757987976, 360, 255, 1, 63305), -- Shadow Sight (Area: The Robodrome - Difficulty: 0) CreateObject2 +(@OGUID+3, 184663, 2167, 10497, 10497, '0', '0', 0, -303.149322509765625, -322.75, 70.8999176025390625, 2.460912704467773437, 0, 0, 0.942641258239746093, 0.333807557821273803, 360, 255, 1, 63305); -- Shadow Sight (Area: The Robodrome - Difficulty: 0) CreateObject2 + +DELETE FROM `gameobject_addon` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+3; +INSERT INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`, `WorldEffectID`, `AIAnimKitID`) VALUES +(@OGUID+0, 0, 0, 1, -0.00000004371138828, 0, 0), -- Doodad_8XP_MECHAGONARENA_PVPDOOR001 +(@OGUID+1, 0, 0, 1, -0.00000004371138828, 0, 0); -- Doodad_8XP_MECHAGONARENA_PVPDOOR002 + +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+23; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `MovementType`, `npcflag`, `unit_flags`, `unit_flags2`, `unit_flags3`, `VerifiedBuild`) VALUES +(@CGUID+0, 154584, 2167, 10497, 10497, '0', '0', 0, 0, 0, -279.16064453125, -285.21630859375, 70.90320587158203125, 1.714475393295288085, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Mechagon - Critters (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+1, 151328, 2167, 10497, 10497, '0', '0', 0, 0, 0, -202.092010498046875, -275.758697509765625, 87.35225677490234375, 6.244936943054199218, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Alarm-o-Bot (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+2, 154573, 2167, 10497, 10497, '0', '0', 0, 0, 0, -275.10882568359375, -280.9892578125, 70.91278839111328125, 4.349936485290527343, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Rustbolt Spraybot (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+3, 154591, 2167, 10497, 10497, '0', '0', 0, 0, 0, -276.982635498046875, -222.970489501953125, 74.18817901611328125, 4.494670391082763671, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Tussle Tonks Fanatic (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+4, 151328, 2167, 10497, 10497, '0', '0', 0, 0, 0, -362.87847900390625, -284.111114501953125, 87.442413330078125, 2.975072622299194335, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Alarm-o-Bot (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+5, 154584, 2167, 10497, 10497, '0', '0', 0, 0, 0, -190.091873168945312, -271.7298583984375, 90.784027099609375, 4.562215328216552734, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Mechagon - Critters (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+6, 154591, 2167, 10497, 10497, '0', '0', 0, 0, 0, -269.03125, -334.00347900390625, 74.168731689453125, 1.862302780151367187, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Tussle Tonks Fanatic (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+7, 154573, 2167, 10497, 10497, '0', '0', 0, 0, 0, -318.529510498046875, -277.732635498046875, 70.96363067626953125, 0.66805046796798706, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Rustbolt Spraybot (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+8, 154584, 2167, 10497, 10497, '0', '0', 0, 0, 0, -285.705780029296875, -318.30328369140625, 70.95305633544921875, 0.141363665461540222, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Mechagon - Critters (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+9, 154588, 2167, 10497, 10497, '0', '0', 0, 0, 0, -257.2725830078125, -357.494781494140625, 73.93599700927734375, 1.66351318359375, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Rustbolt Enforcer (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+10, 154589, 2167, 10497, 10497, '0', '0', 0, 0, 0, -278.923614501953125, -194.838546752929687, 75.69069671630859375, 4.549063682556152343, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Anodized Coilbearer (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+11, 154591, 2167, 10497, 10497, '0', '0', 0, 0, 0, -267.19097900390625, -332.907989501953125, 74.25550079345703125, 2.054608106613159179, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Tussle Tonks Fanatic (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+12, 154584, 2167, 10497, 10497, '0', '0', 0, 0, 0, -260.35589599609375, -273.05902099609375, 70.95305633544921875, 4.912654876708984375, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Mechagon - Critters (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+13, 154577, 2167, 10497, 10497, '0', '0', 0, 0, 0, -303.650848388671875, -268.24676513671875, 96.34787750244140625, 4.066770553588867187, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Flying Claw (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+14, 154588, 2167, 10497, 10497, '0', '0', 0, 0, 0, -284.211822509765625, -361.923614501953125, 75.19763946533203125, 1.437150359153747558, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Rustbolt Enforcer (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+15, 154589, 2167, 10497, 10497, '0', '0', 0, 0, 0, -307.013885498046875, -200.819442749023437, 72.72412109375, 4.55579996109008789, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Anodized Coilbearer (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+16, 154591, 2167, 10497, 10497, '0', '0', 0, 0, 0, -323.314239501953125, -319.861114501953125, 79.107696533203125, 0.718692898750305175, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Tussle Tonks Fanatic (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+17, 154593, 2167, 10497, 10497, '0', '0', 0, 0, 0, -190.355911254882812, -271.848968505859375, 89.967559814453125, 0, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Power Coil (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+18, 154584, 2167, 10497, 10497, '0', '0', 0, 0, 0, -371.203125, -278.057281494140625, 89.25567626953125, 0.988933026790618896, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Mechagon - Critters (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+19, 154591, 2167, 10497, 10497, '0', '0', 0, 0, 0, -321.545135498046875, -321.77777099609375, 79.05933380126953125, 0.856421470642089843, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Tussle Tonks Fanatic (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+20, 154584, 2167, 10497, 10497, '0', '0', 0, 0, 0, -317.527862548828125, -255.51348876953125, 70.95305633544921875, 0.34594881534576416, 7200, 10, 0, 1, NULL, NULL, NULL, NULL, 63305), -- Mechagon - Critters (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+21, 154577, 2167, 10497, 10497, '0', '0', 0, 0, 0, -281.0594482421875, -296.726165771484375, 95.95363616943359375, 0.924684226512908935, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Flying Claw (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+22, 154593, 2167, 10497, 10497, '0', '0', 0, 0, 0, -372.34375, -285.48785400390625, 89.76513671875, 0.578076422214508056, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Power Coil (Area: The Robodrome - Difficulty: 0) CreateObject1 +(@CGUID+23, 154591, 2167, 10497, 10497, '0', '0', 0, 0, 0, -340.82464599609375, -253.720489501953125, 76.2044219970703125, 5.556685447692871093, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305); -- Tussle Tonks Fanatic (Area: The Robodrome - Difficulty: 0) CreateObject1 + +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+23; +INSERT INTO `creature_addon` (`guid`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES +(@CGUID+3, 0, 0, 0, 3, 0, 1, 0, 0, 18059, 0, 0, 0, ''), -- Tussle Tonks Fanatic +(@CGUID+6, 0, 0, 0, 3, 0, 1, 0, 0, 18059, 0, 0, 0, ''), -- Tussle Tonks Fanatic +(@CGUID+9, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Rustbolt Enforcer +(@CGUID+10, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Anodized Coilbearer +(@CGUID+11, 0, 0, 0, 3, 0, 1, 0, 0, 18059, 0, 0, 0, ''), -- Tussle Tonks Fanatic +(@CGUID+13, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Flying Claw +(@CGUID+14, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Rustbolt Enforcer +(@CGUID+15, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Anodized Coilbearer +(@CGUID+16, 0, 0, 0, 3, 0, 1, 0, 0, 18059, 0, 0, 0, ''), -- Tussle Tonks Fanatic +(@CGUID+19, 0, 0, 0, 3, 0, 1, 0, 0, 835, 0, 0, 0, ''), -- Tussle Tonks Fanatic +(@CGUID+21, 0, 0, 0, 3, 0, 1, 0, 0, 0, 0, 0, 0, ''), -- Flying Claw +(@CGUID+23, 0, 0, 0, 3, 0, 1, 0, 0, 18059, 0, 0, 0, ''); -- Tussle Tonks Fanatic + +DELETE FROM `spawn_group_template` WHERE `groupId` = @SPAWN_GROUP; +INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES +(@SPAWN_GROUP, 'The Robodrome - Shadow sight', 0x20); + +DELETE FROM `spawn_group` WHERE `groupId` = @SPAWN_GROUP; +INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES +(@SPAWN_GROUP, 1, @OGUID+2), +(@SPAWN_GROUP, 1, @OGUID+3); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 33 AND `SourceEntry` = @SPAWN_GROUP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `SourceGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ScriptName`) VALUES +(33, @SPAWN_GROUP, 0, 0, 0, 'condition_is_shadow_sight_enabled'); + +DELETE FROM `vehicle_template_accessory` WHERE (`entry`=154577 AND `seat_id`=0); +INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES +(154577, 150520, 0, 0, 'Flying Claw - Cubed Clutter', 5, 0); -- Flying Claw - Cubed Clutter + +UPDATE `creature_template` SET `unit_flags`=0x300, `unit_flags3`=0x41000000 WHERE `entry`=154593; -- Power Coil +UPDATE `creature_template` SET `unit_flags`=0x2000100, `unit_flags3`=0x1000000 WHERE `entry`=154577; -- Flying Claw +UPDATE `creature_template` SET `unit_flags`=0x2000040, `unit_flags3`=0x1000000 WHERE `entry`=154589; -- Anodized Coilbearer +UPDATE `creature_template` SET `unit_flags`=0x2000000, `unit_flags3`=0x1800000 WHERE `entry`=154588; -- Rustbolt Enforcer +UPDATE `creature_template` SET `unit_flags`=0x2000000 WHERE `entry`=150520; -- Cubed Clutter +UPDATE `creature_template` SET `unit_flags`=0x2000300, `unit_flags3`=0x1000000 WHERE `entry`=154591; -- Tussle Tonks Fanatic +UPDATE `creature_template` SET `unit_flags`=0x2000300, `unit_flags3`=0x1000000 WHERE `entry`=154573; -- Rustbolt Spraybot +UPDATE `creature_template` SET `unit_flags`=0x2000000, `unit_flags3`=0x1000000 WHERE `entry`=151328; -- Alarm-o-Bot +UPDATE `creature_template` SET `unit_flags`=0x2000300, `unit_flags3`=0x1000000 WHERE `entry`=154584; -- Mechagon - Critters + +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x20000100, `VerifiedBuild`=63305 WHERE (`Entry`=154593 AND `DifficultyID`=0); -- 154593 (Power Coil) - Sessile, Floating +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x30000000, `VerifiedBuild`=63305 WHERE (`Entry`=154577 AND `DifficultyID`=0); -- 154577 (Flying Claw) - CanSwim, Floating +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x20000000, `VerifiedBuild`=63305 WHERE (`Entry`=154589 AND `DifficultyID`=0); -- 154589 (Anodized Coilbearer) - Floating +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x30000000, `VerifiedBuild`=63305 WHERE (`Entry`=154588 AND `DifficultyID`=0); -- 154588 (Rustbolt Enforcer) - CanSwim, Floating +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x30000000, `VerifiedBuild`=63305 WHERE (`Entry`=154591 AND `DifficultyID`=0); -- 154591 (Tussle Tonks Fanatic) - CanSwim, Floating +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=63305 WHERE (`Entry`=154573 AND `DifficultyID`=0); -- 154573 (Rustbolt Spraybot) - CanSwim + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_the_robodrome_zap_damage'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(300642, 'spell_the_robodrome_zap_damage'); + +SET @MOVERGUID := @CGUID+13; +SET @ENTRY := 154577; +SET @PATHOFFSET := 0; +SET @PATH := @ENTRY * 100 + @PATHOFFSET; +DELETE FROM `waypoint_path` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Velocity`, `Comment`) VALUES +(@PATH, 0, 0x2, 2.2946, 'Flying Claw - Idle'); + +DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES +(@PATH, 0, -303.28534, -267.82578, 96.34789, NULL, 0), +(@PATH, 1, -297.62848, -265.48264, 96.34789, NULL, 0), +(@PATH, 2, -291.97162, -267.82578, 96.34789, NULL, 0), +(@PATH, 3, -289.62848, -273.48264, 96.34789, NULL, 0), +(@PATH, 4, -291.97162, -279.1395, 96.34789, NULL, 0), +(@PATH, 5, -297.62848, -281.48264, 96.34789, NULL, 0), +(@PATH, 6, -303.28534, -279.1395, 96.34789, NULL, 0), +(@PATH, 7, -305.62848, -273.48264, 96.34789, NULL, 0); + +UPDATE `creature` SET `position_x`=-303.28534, `position_y`=-267.82578, `position_z`=96.34789, `orientation`=0, `wander_distance`=0, `MovementType`=2 WHERE `guid`=@MOVERGUID; +DELETE FROM `creature_addon` WHERE `guid`=@MOVERGUID; +INSERT INTO `creature_addon` (`guid`, `PathId`, `SheathState`) VALUES +(@MOVERGUID, @PATH, 1); + +SET @MOVERGUID := @CGUID+21; +SET @ENTRY := 154577; +SET @PATHOFFSET := 1; +SET @PATH := @ENTRY * 100 + @PATHOFFSET; +DELETE FROM `waypoint_path` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path` (`PathId`, `MoveType`, `Flags`, `Velocity`, `Comment`) VALUES +(@PATH, 0, 0x2, 2.2946, 'Flying Claw - Idle'); + +DELETE FROM `waypoint_path_node` WHERE `PathId`= @PATH; +INSERT INTO `waypoint_path_node` (`PathId`, `NodeId`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`, `Delay`) VALUES +(@PATH, 0, -280.69507, -296.30667, 95.95362, NULL, 0), +(@PATH, 1, -275.0382, -293.96353, 95.95362, NULL, 0), +(@PATH, 2, -269.38135, -296.30667, 95.95362, NULL, 0), +(@PATH, 3, -267.0382, -301.96353, 95.95362, NULL, 0), +(@PATH, 4, -269.38135, -307.6204, 95.95362, NULL, 0), +(@PATH, 5, -275.0382, -309.96353, 95.95362, NULL, 0), +(@PATH, 6, -280.69507, -307.6204, 95.95362, NULL, 0), +(@PATH, 7, -283.0382, -301.96353, 95.95362, NULL, 0); + +UPDATE `creature` SET `position_x`=-280.69507, `position_y`=-296.30667, `position_z`=95.95362, `orientation`=0, `wander_distance`=0, `MovementType`=2 WHERE `guid`=@MOVERGUID; +DELETE FROM `creature_addon` WHERE `guid`=@MOVERGUID; +INSERT INTO `creature_addon` (`guid`, `PathId`, `SheathState`) VALUES +(@MOVERGUID, @PATH, 1); diff --git a/sql/updates/world/master/2025_10_02_03_world.sql b/sql/updates/world/master/2025_10_02_03_world.sql new file mode 100644 index 00000000000..dc702e1d2ee --- /dev/null +++ b/sql/updates/world/master/2025_10_02_03_world.sql @@ -0,0 +1,183 @@ +SET @CGUID := 8000828; +SET @OGUID := 8000104; +SET @WORLD_SAFE_LOC_ID := 100099; +SET @SPAWN_GROUP := 1272; + +DELETE FROM `world_safe_locs` WHERE `ID` BETWEEN @WORLD_SAFE_LOC_ID + 0 AND @WORLD_SAFE_LOC_ID + 1; +INSERT INTO `world_safe_locs` (`ID`, `MapID`, `LocX`, `LocY`, `LocZ`, `Facing`, `Comment`) VALUES +(@WORLD_SAFE_LOC_ID+0, 2509, 2856.63, 2329.15, 3259.74, DEGREES(4.4575706), 'Maldraxxus Coliseum - Purple Team'), +(@WORLD_SAFE_LOC_ID+1, 2509, 2854.23, 2182.54, 3259.96, DEGREES(1.860521), 'Maldraxxus Coliseum - Gold Team'); + +DELETE FROM `battleground_scripts` WHERE `MapId` = 2509 AND `BattlemasterListId` = 0; +INSERT INTO `battleground_scripts` (`MapId`, `BattlemasterListId`, `ScriptName`) VALUES +(2509, 0, 'arena_maldraxxus_coliseum'); -- Maldraxxus Coliseum + +DELETE FROM `battleground_template` WHERE `ID` = 1066; +INSERT INTO `battleground_template` (`ID`, `AllianceStartLoc`, `HordeStartLoc`, `StartMaxDist`, `Weight`, `Comment`) VALUES +(1066, @WORLD_SAFE_LOC_ID+0, @WORLD_SAFE_LOC_ID+1, 0, 1, 'Maldraxxus Coliseum'); + +DELETE FROM `gameobject_template_addon` WHERE `entry` IN (358872 /*Anima Reservoir*/, 364865 /*Spike Door*/, 364864 /*Spire Door*/, 358871 /*Anima Reservoir*/, 353391 /*Cell Door*/, 353390 /*Cell Door*/, 353389 /*Cell Door*/, 352110 /*Tower Door*/, 353633 /*Sanctum Door*/, 364863 /*Tower Door*/, 353392 /*Cell Door*/, 357089 /*9NC_Necro_Covenant_PrimusArmorStand04*/, 375890 /*Maldraxxus Coliseum - Door*/, 355424 /*Door*/, 358873 /*Anima Reservoir*/); +INSERT INTO `gameobject_template_addon` (`entry`, `faction`, `flags`, `WorldEffectID`, `AIAnimKitID`) VALUES +(358872, 0, 0x2000, 0, 0), -- Anima Reservoir +(364865, 0, 0x20, 0, 0), -- Spike Door +(364864, 0, 0x20, 0, 0), -- Spire Door +(358871, 0, 0x2000, 0, 0), -- Anima Reservoir +(353391, 0, 0x20, 0, 0), -- Cell Door +(353390, 0, 0x20, 0, 0), -- Cell Door +(353389, 0, 0x20, 0, 0), -- Cell Door +(352110, 0, 0x20, 0, 0), -- Tower Door +(353633, 0, 0x30, 0, 0), -- Sanctum Door +(364863, 0, 0x20, 0, 0), -- Tower Door +(353392, 0, 0x20, 0, 0), -- Cell Door +(357089, 0, 0x20, 0, 0), -- 9NC_Necro_Covenant_PrimusArmorStand04 +(375890, 114, 0x1, 0, 0), -- Maldraxxus Coliseum - Door +(355424, 0, 0x30, 0, 0), -- Door +(358873, 0, 0x2000, 0, 0); -- Anima Reservoir + +DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+28; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES +(@OGUID+0, 358873, 2509, 13972, 13972, '0', '0', 0, 1835.9671630859375, 2231.16552734375, 3389.037841796875, 5.751413822174072265, 0, 0, -0.26276397705078125, 0.964860141277313232, 7200, 255, 1, 63305), -- Anima Reservoir (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+1, 355424, 2509, 13972, 13972, '0', '0', 0, 1029.6214599609375, 1130.5401611328125, 3066.897705078125, 1.570795774459838867, 0, 0, 0.707106590270996093, 0.707106947898864746, 7200, 255, 1, 63305), -- Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+2, 375890, 2509, 13972, 13972, '0', '0', 0, 2849.8759765625, 2199.532958984375, 3260.152099609375, 4.976324081420898437, 0, 0, -0.60791397094726562, 0.794002890586853027, 7200, 255, 1, 63305), -- Maldraxxus Coliseum - Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+3, 357089, 2509, 13972, 13972, '0', '0', 0, 1724.50537109375, 2252.2763671875, 3386.95947265625, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- 9NC_Necro_Covenant_PrimusArmorStand04 (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+4, 353392, 2509, 13972, 13972, '0', '0', 0, 1604.9605712890625, 2940.898681640625, 3414.51123046875, 1.064649581909179687, 0, 0, 0.507537841796875, 0.861629426479339599, 7200, 255, 1, 63305), -- Cell Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+5, 364863, 2509, 13972, 13972, '0', '0', 0, 3794.086669921875, 3672.78125, 3192.216796875, 0.785396754741668701, 0, 0, 0.38268280029296875, 0.923879802227020263, 7200, 255, 1, 63305), -- Tower Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+6, 375890, 2509, 13972, 13972, '0', '0', 0, 2850.56591796875, 2307.1875, 3259.84326171875, 1.274271011352539062, 0, 0, 0.594895362854003906, 0.803803145885467529, 7200, 255, 1, 63305), -- Maldraxxus Coliseum - Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+7, 353633, 2509, 13972, 13972, '0', '0', 0, 1056.7315673828125, 1111.6566162109375, 3078.095458984375, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 0, 63305), -- Sanctum Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+8, 352110, 2509, 13972, 13972, '0', '0', 0, 3799.587158203125, 2760.26416015625, 3291.91357421875, 0.383971005678176879, 0, 0, 0.190808296203613281, 0.981627285480499267, 7200, 255, 1, 63305), -- Tower Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+9, 353389, 2509, 13972, 13972, '0', '0', 0, 1521.06640625, 2985.52587890625, 3414.6806640625, 1.064649581909179687, 0, 0, 0.507537841796875, 0.861629426479339599, 7200, 255, 1, 63305), -- Cell Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+10, 353390, 2509, 13972, 13972, '0', '0', 0, 1534.571044921875, 2978.62841796875, 3414.485595703125, 1.064649581909179687, 0, 0, 0.507537841796875, 0.861629426479339599, 7200, 255, 1, 63305), -- Cell Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+11, 353391, 2509, 13972, 13972, '0', '0', 0, 1610.3929443359375, 2919.251953125, 3414.51123046875, 1.064649581909179687, 0, 0, 0.507537841796875, 0.861629426479339599, 7200, 255, 1, 63305), -- Cell Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+12, 365674, 2509, 13972, 13972, '0', '0', 0, 1901.07421875, 2317.32958984375, 3398.3408203125, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Runeforge (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+13, 358871, 2509, 13972, 13972, '0', '0', 0, 1833.8687744140625, 2227.190673828125, 3390.80419921875, 2.240999937057495117, 0, 0, 0.900318145751953125, 0.435232430696487426, 7200, 255, 1, 63305), -- Anima Reservoir (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+14, 357961, 2509, 13972, 13972, '0', '0', 0, 3153.01806640625, 2657.427978515625, 3270.885986328125, 3.700104713439941406, 0, 0, -0.96126079559326171, 0.275640487670898437, 7200, 255, 1, 63305), -- Forge (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+15, 357962, 2509, 13972, 13972, '0', '0', 0, 3152.65869140625, 2648.534423828125, 3270.934326171875, 1.422442793846130371, 0, 0, 0.652759552001953125, 0.757565200328826904, 7200, 255, 1, 63305), -- Anvil (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+16, 364864, 2509, 13972, 13972, '0', '0', 0, 1433.345703125, 3309.82470703125, 3474.117919921875, 2.792518377304077148, 0, 0, 0.984807014465332031, 0.173652306199073791, 7200, 255, 1, 63305), -- Spire Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+17, 364865, 2509, 13972, 13972, '0', '0', 0, 2422.298828125, 1226.5006103515625, 3313.175048828125, 3.143882274627685546, 0, 0.02617645263671875, -0.99965667724609375, 0.001145121059380471, 7200, 255, 1, 63305), -- Spike Door (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+18, 358872, 2509, 13972, 13972, '0', '0', 0, 1829.6005859375, 2225.300537109375, 3389.037841796875, 1.692405223846435546, 0, 0, 0.748768806457519531, 0.662831246852874755, 7200, 255, 1, 63305), -- Anima Reservoir (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+19, 355451, 2509, 13972, 13972, '0', '0', 0, 1876.8681640625, 2261.7119140625, 3388.03857421875, 3.22885894775390625, 0, 0, -0.99904823303222656, 0.043619260191917419, 7200, 255, 1, 63305), -- Mailbox (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+20, 365672, 2509, 13972, 13972, '0', '0', 0, 1863.0126953125, 2302.8603515625, 3394.88671875, 3.010666131973266601, 0, 0, 0.997858047485351562, 0.065416477620601654, 7200, 255, 1, 63305), -- Forge (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+21, 365673, 2509, 13972, 13972, '0', '0', 0, 1860.6962890625, 2304.6025390625, 3395.022216796875, 2.521998405456542968, 0, 0, 0.952395439147949218, 0.304865479469299316, 7200, 255, 1, 63305), -- Anvil (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+22, 355452, 2509, 13972, 13972, '0', '0', 0, 1862.0068359375, 2279.3017578125, 3388.03857421875, 5.593780994415283203, 0, 0, -0.33791637420654296, 0.941176116466522216, 7200, 255, 1, 63305), -- Cauldron (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+23, 358875, 2509, 13972, 13972, '0', '0', 0, 1837.387939453125, 2232.581787109375, 3387.25927734375, 2.055546998977661132, 0, 0, 0.856150627136230468, 0.516726315021514892, 7200, 255, 1, 63305), -- Anima Crystal (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+24, 358874, 2509, 13972, 13972, '0', '0', 0, 1826.52099609375, 2225.56591796875, 3387.630126953125, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Anima Crystal (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+25, 358876, 2509, 13972, 13972, '0', '0', 0, 1824.5372314453125, 2224.138427734375, 3388.286376953125, 3.141592741012573242, 0, 0, -1, 0, 7200, 255, 1, 63305), -- Anima Crystal (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+26, 358877, 2509, 13972, 13972, '0', '0', 0, 1824.9727783203125, 2226.773193359375, 3386.77294921875, 1.099337220191955566, 0, 0, 0.522404670715332031, 0.852697670459747314, 7200, 255, 1, 63305), -- Anima Crystal (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@OGUID+27, 184663, 2509, 13972, 13972, '0', '0', 0, 2786.130126953125, 2253.369873046875, 3260.39990234375, 3.040358543395996093, 0, 0, 0.998719215393066406, 0.050595458596944808, 7200, 255, 1, 63305), -- Shadow Sight (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject2 +(@OGUID+28, 184663, 2509, 13972, 13972, '0', '0', 0, 2881.690185546875, 2253.890625, 3260.489990234375, 1.710418701171875, 0, 0, 0.754708290100097656, 0.656060516834259033, 7200, 255, 1, 63305); -- Shadow Sight (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject2 + +DELETE FROM `gameobject_addon` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+28; +INSERT INTO `gameobject_addon` (`guid`, `parent_rotation0`, `parent_rotation1`, `parent_rotation2`, `parent_rotation3`, `WorldEffectID`, `AIAnimKitID`) VALUES +(@OGUID+0, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anima Reservoir +(@OGUID+1, 0, 0, 1, -0.00000004371138828, 0, 0), -- Door +(@OGUID+3, 0, 0, 1, -0.00000004371138828, 0, 0), -- 9NC_Necro_Covenant_PrimusArmorStand04 +(@OGUID+4, 0, 0, -0.24192185699939727, 0.970295727252960205, 0, 0), -- Cell Door +(@OGUID+5, 0, 0, 0.382683455944061279, 0.923879563808441162, 0, 0), -- Tower Door +(@OGUID+7, 0, 0, 1, -0.00000004371138828, 0, 0), -- Sanctum Door +(@OGUID+8, 0, 0, 0.190808489918708801, 0.981627285480499267, 0, 0), -- Tower Door +(@OGUID+9, 0, 0, -0.24192185699939727, 0.970295727252960205, 0, 0), -- Cell Door +(@OGUID+10, 0, 0, -0.24192185699939727, 0.970295727252960205, 0, 0), -- Cell Door +(@OGUID+11, 0, 0, -0.24192185699939727, 0.970295727252960205, 0, 0), -- Cell Door +(@OGUID+12, 0, 0, 1, -0.00000004371138828, 0, 0), -- Runeforge +(@OGUID+13, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anima Reservoir +(@OGUID+14, 0, 0, 0.275637507438659667, 0.961261689662933349, 0, 0), -- Forge +(@OGUID+15, 0, 0, 0.275637507438659667, 0.961261689662933349, 0, 0), -- Anvil +(@OGUID+16, 0, 0, 0.984807789325714111, 0.17364811897277832, 0, 0), -- Spire Door +(@OGUID+17, 0.000000001144233374, -0.02617700770497322, 0.999657332897186279, -0.00000004369640649, 0, 0), -- Spike Door +(@OGUID+18, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anima Reservoir +(@OGUID+19, 0, 0, 1, -0.00000004371138828, 0, 0), -- Mailbox +(@OGUID+20, 0, 0, 1, -0.00000004371138828, 0, 0), -- Forge +(@OGUID+21, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anvil +(@OGUID+22, 0, 0, 1, -0.00000004371138828, 0, 0), -- Cauldron +(@OGUID+23, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anima Crystal +(@OGUID+24, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anima Crystal +(@OGUID+25, 0, 0, 1, -0.00000004371138828, 0, 0), -- Anima Crystal +(@OGUID+26, 0, 0, 1, -0.00000004371138828, 0, 0); -- Anima Crystal + +UPDATE `creature_template` SET `faction`=3171, `BaseAttackTime`=2000, `unit_flags`=0x2000000, `unit_flags2`=0x4000800, `unit_flags3`=0x8001 WHERE `entry`=185764; -- Maldraxxian Gladiator +UPDATE `creature_template` SET `faction`=3171, `BaseAttackTime`=2000, `unit_flags`=0x300, `unit_flags2`=0x4000800 WHERE `entry`=185765; -- Arena Prospect +UPDATE `creature_template` SET `faction`=16, `BaseAttackTime`=2000, `unit_flags`=0x2000040, `unit_flags2`=0x4000800, `unit_flags3`=0x8001 WHERE `entry`=185763; -- Maldraxxian Honor Guard +UPDATE `creature_template` SET `faction`=35, `BaseAttackTime`=2000, `unit_flags`=0x2000000, `unit_flags2`=0x800, `unit_flags3`=0x1000000 WHERE `entry`=185659; -- Guard + +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+40; +INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `MovementType`, `npcflag`, `unit_flags`, `unit_flags2`, `unit_flags3`, `VerifiedBuild`) VALUES +(@CGUID+0, 185764, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2844.864501953125, 2303.0244140625, 3260.145751953125, 1.222661018371582031, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Gladiator (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+1, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2980.21435546875, 2327.197998046875, 3325.080322265625, 3.528119087219238281, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+2, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2949.127685546875, 2136.689208984375, 3325.735107421875, 2.204537630081176757, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+3, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2778.190185546875, 2418.1875, 3327.48583984375, 5.271474838256835937, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+4, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2765.09375, 2259.40625, 3260.34765625, 6.067912578582763671, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+5, 185763, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2859.92626953125, 2159.255126953125, 3260.470703125, 1.864421486854553222, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Honor Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+6, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2820.4619140625, 2092.319580078125, 3324.997802734375, 2.026699781417846679, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+7, 185764, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2853.896728515625, 2300.286376953125, 3260.112548828125, 1.631254911422729492, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Gladiator (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+8, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2950.63623046875, 2368.473876953125, 3325.936767578125, 4.388659000396728515, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+9, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2919.843017578125, 2127.63720703125, 3326.36572265625, 2.026699781417846679, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+10, 166568, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2645.6484375, 2253.796875, 3305.206298828125, 0, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Hellinka (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+11, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2972.132080078125, 2353.76904296875, 3327.41015625, 4.038762569427490234, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+12, 185763, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2865.01123046875, 2161.02783203125, 3260.455810546875, 1.911551356315612792, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Honor Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+13, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2746.282958984375, 2389.32470703125, 3324.740966796875, 5.535057544708251953, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+14, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2955.510498046875, 2254.17529296875, 3273.11962890625, 2.973686695098876953, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+15, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2759.442626953125, 2095.82470703125, 3325.92236328125, 1.012931227684020996, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+16, 185764, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2853.069580078125, 2207.116455078125, 3260.44677734375, 5.022103309631347656, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Gladiator (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+17, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2981.626708984375, 2209.78125, 3324.50390625, 2.95849919319152832, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+18, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2833.592041015625, 2096.46533203125, 3325.74072265625, 2.026699781417846679, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+19, 163041, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2832.405517578125, 2408.53466796875, 3324.990966796875, 4.695466041564941406, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+20, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2730.55908203125, 2180.513916015625, 3273.12060546875, 0.573603332042694091, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+21, 185763, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2865.243896484375, 2347.835205078125, 3260.531005859375, 4.423168659210205078, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Honor Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+22, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2981.583251953125, 2182.548583984375, 3324.583740234375, 2.95849919319152832, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+23, 185764, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2843.692626953125, 2204.4775390625, 3260.367919921875, 5.16705179214477539, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Gladiator (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+24, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2805.757080078125, 2087.572998046875, 3325.739990234375, 2.026699781417846679, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+25, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2807.591064453125, 2415.717041015625, 3325.822509765625, 4.695466041564941406, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+26, 185763, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2860.25341796875, 2349.276123046875, 3260.49609375, 4.473968982696533203, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Maldraxxian Honor Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+27, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2973.21875, 2153.032958984375, 3327.529052734375, 2.51962900161743164, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+28, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2755.7431640625, 2403.335205078125, 3325.030029296875, 5.536399364471435546, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+29, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2673.8056640625, 2279.963623046875, 3326.58251953125, 0.19043731689453125, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+30, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2975.866455078125, 2307.161376953125, 3329.46337890625, 3.528119087219238281, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+31, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2752.91064453125, 2106.0712890625, 3325.53466796875, 0.892840743064880371, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+32, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2921.960205078125, 2378.98779296875, 3325.133056640625, 4.388659000396728515, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+33, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2730.6650390625, 2327.583251953125, 3273.122802734375, 5.533953666687011718, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+34, 110854, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2650.5703125, 2248.2431640625, 3305.274169921875, 0.434818565845489501, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Jared V. Hellstrike (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+35, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2683.346435546875, 2306.178955078125, 3324.8291015625, 5.737512111663818359, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+36, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2980.94189453125, 2170.44970703125, 3325.765869140625, 2.95849919319152832, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+37, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2777.158935546875, 2086.420166015625, 3327.418212890625, 1.262829422950744628, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+38, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2681.18310546875, 2200.842041015625, 3324.626220703125, 0.745742619037628173, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+39, 185659, 2509, 13972, 13972, '0', '0', 0, 0, 0, 2765.09375, 2251.748291015625, 3260.34765625, 0.461662709712982177, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305), -- Guard (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 +(@CGUID+40, 185765, 2509, 13972, 13972, '0', '0', 0, 0, 1, 2935.385498046875, 2375.986083984375, 3323.709716796875, 4.388659000396728515, 7200, 0, 0, 0, NULL, NULL, NULL, NULL, 63305); -- Arena Prospect (Area: Maldraxxus Coliseum - Difficulty: 0) CreateObject1 + +DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+40; +INSERT INTO `creature_addon` (`guid`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES +(@CGUID+0, 0, 0, 0, 0, 0, 1, 0, 716, 0, 0, 0, 0, ''), -- Maldraxxian Gladiator +(@CGUID+7, 0, 0, 0, 0, 0, 1, 0, 716, 0, 0, 0, 0, ''), -- Maldraxxian Gladiator +(@CGUID+16, 0, 0, 0, 0, 0, 1, 0, 716, 0, 0, 0, 0, ''), -- Maldraxxian Gladiator +(@CGUID+23, 0, 0, 0, 0, 0, 1, 0, 716, 0, 0, 0, 0, ''), -- Maldraxxian Gladiator +(@CGUID+34, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 3, ''); -- Jared V. Hellstrike + +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=63305 WHERE (`Entry`=163041 AND `DifficultyID`=0); -- 163041 (Arena Prospect) - CanSwim +UPDATE `creature_template_difficulty` SET `ContentTuningID`=347, `VerifiedBuild`=63305 WHERE (`Entry`=110854 AND `DifficultyID`=0); -- 110854 (Jared V. Hellstrike) +UPDATE `creature_template_difficulty` SET `StaticFlags1`=0x10000000, `VerifiedBuild`=63305 WHERE (`Entry`=166568 AND `DifficultyID`=0); -- 166568 (Hellinka) - CanSwim +UPDATE `creature_template_difficulty` SET `ContentTuningID`=969, `StaticFlags1`=0x10000000, `VerifiedBuild`=63305 WHERE (`Entry`=185659 AND `DifficultyID`=0); -- 185659 (Guard) - CanSwim +UPDATE `creature_template_difficulty` SET `ContentTuningID`=837, `StaticFlags1`=0x10000000, `VerifiedBuild`=63305 WHERE (`Entry`=185764 AND `DifficultyID`=0); -- 185764 (Maldraxxian Gladiator) - CanSwim +UPDATE `creature_template_difficulty` SET `ContentTuningID`=837, `StaticFlags1`=0x10000000, `VerifiedBuild`=63305 WHERE (`Entry`=185765 AND `DifficultyID`=0); -- 185765 (Arena Prospect) - CanSwim + +UPDATE `creature` SET `StringId` = 'arena_maldraxxus_coliseum_2' WHERE `guid` = @CGUID+0; +UPDATE `creature` SET `StringId` = 'arena_maldraxxus_coliseum_1' WHERE `guid` = @CGUID+7; +UPDATE `creature` SET `StringId` = 'arena_maldraxxus_coliseum_3' WHERE `guid` = @CGUID+16; +UPDATE `creature` SET `StringId` = 'arena_maldraxxus_coliseum_4' WHERE `guid` = @CGUID+23; + +DELETE FROM `creature_equip_template` WHERE (`ID`=1 AND `CreatureID` IN (185763,185765,185764)); +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `AppearanceModID1`, `ItemVisual1`, `ItemID2`, `AppearanceModID2`, `ItemVisual2`, `ItemID3`, `AppearanceModID3`, `ItemVisual3`, `VerifiedBuild`) VALUES +(185763, 1, 177264, 0, 0, 176718, 0, 0, 0, 0, 0, 63305), -- Maldraxxian Honor Guard +(185765, 1, 106203, 0, 0, 0, 0, 0, 155772, 0, 0, 63305), -- Arena Prospect +(185764, 1, 177260, 0, 0, 176716, 0, 0, 0, 0, 0, 63305); -- Maldraxxian Gladiator + +DELETE FROM `spawn_group_template` WHERE `groupId` = @SPAWN_GROUP; +INSERT INTO `spawn_group_template` (`groupId`, `groupName`, `groupFlags`) VALUES +(@SPAWN_GROUP, 'Maldraxxus Coliseum - Shadow sight', 0x20); + +DELETE FROM `spawn_group` WHERE `groupId` = @SPAWN_GROUP; +INSERT INTO `spawn_group` (`groupId`, `spawnType`, `spawnId`) VALUES +(@SPAWN_GROUP, 1, @OGUID+27), +(@SPAWN_GROUP, 1, @OGUID+28); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 33 AND `SourceEntry` = @SPAWN_GROUP; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `SourceGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ScriptName`) VALUES +(33, @SPAWN_GROUP, 0, 0, 0, 'condition_is_shadow_sight_enabled'); diff --git a/src/common/Collision/Management/MMapFactory.cpp b/src/common/Collision/Management/MMapFactory.cpp deleted file mode 100644 index c50bc69cb91..00000000000 --- a/src/common/Collision/Management/MMapFactory.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of the TrinityCore 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 General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "MMapFactory.h" - -namespace MMAP -{ - // ######################## MMapFactory ######################## - // our global singleton copy - MMapManager* g_MMapManager = nullptr; - - MMapManager* MMapFactory::createOrGetMMapManager() - { - if (g_MMapManager == nullptr) - g_MMapManager = new MMapManager(); - - return g_MMapManager; - } - - void MMapFactory::clear() - { - if (g_MMapManager) - { - delete g_MMapManager; - g_MMapManager = nullptr; - } - } -} diff --git a/src/common/Collision/Management/MMapFactory.h b/src/common/Collision/Management/MMapFactory.h deleted file mode 100644 index d586eadbbcb..00000000000 --- a/src/common/Collision/Management/MMapFactory.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of the TrinityCore 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 General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef _MMAP_FACTORY_H -#define _MMAP_FACTORY_H - -#include "Define.h" -#include "MMapManager.h" - -namespace MMAP -{ - enum MMAP_LOAD_RESULT - { - MMAP_LOAD_RESULT_ERROR, - MMAP_LOAD_RESULT_OK, - MMAP_LOAD_RESULT_IGNORED - }; - - // static class - // holds all mmap global data - // access point to MMapManager singleton - class TC_COMMON_API MMapFactory - { - public: - static MMapManager* createOrGetMMapManager(); - static void clear(); - }; -} - -#endif diff --git a/src/common/Collision/Management/MMapManager.cpp b/src/common/Collision/Management/MMapManager.cpp index 3b5431e1cc7..8c926d79a6e 100644 --- a/src/common/Collision/Management/MMapManager.cpp +++ b/src/common/Collision/Management/MMapManager.cpp @@ -17,6 +17,7 @@ #include "MMapManager.h" #include "Errors.h" +#include "Hash.h" #include "Log.h" #include "MMapDefines.h" #include "Memory.h" @@ -26,24 +27,42 @@ namespace MMAP constexpr char MAP_FILE_NAME_FORMAT[] = "{}mmaps/{:04}.mmap"; constexpr char TILE_FILE_NAME_FORMAT[] = "{}mmaps/{:04}{:02}{:02}.mmtile"; - // ######################## MMapManager ######################## - MMapManager::~MMapManager() + using NavMeshPtr = std::unique_ptr<dtNavMesh, decltype(Trinity::unique_ptr_deleter<dtNavMesh*, &::dtFreeNavMesh>())>; + using NavMeshQueryPtr = std::unique_ptr<dtNavMeshQuery, decltype(Trinity::unique_ptr_deleter<dtNavMeshQuery*, &::dtFreeNavMeshQuery>())>; + + typedef std::unordered_map<std::pair<uint32, uint32>, NavMeshQueryPtr> NavMeshQuerySet; + typedef std::unordered_map<uint32, dtTileRef> MMapTileSet; + + // dummy struct to hold map's mmap data + struct MMapData { - for (std::pair<uint32 const, MMapData*>& loadedMMap : loadedMMaps) - delete loadedMMap.second; + explicit MMapData(NavMeshPtr&& mesh) : navMesh(std::move(mesh)) { } + + // we have to use single dtNavMeshQuery for every instance, since those are not thread safe + NavMeshQuerySet navMeshQueries; // instanceId to query + + NavMeshPtr navMesh; + MMapTileSet loadedTileRefs; // maps [map grid coords] to [dtTile] + }; - // by now we should not have maps loaded - // if we had, tiles in MMapData->mmapLoadedTiles, their actual data is lost! + // ######################## MMapManager ######################## + MMapManager::MMapManager() = default; + MMapManager::~MMapManager() = default; + + MMapManager* MMapManager::instance() + { + static MMapManager instance; + return &instance; } void MMapManager::InitializeThreadUnsafe(std::unordered_map<uint32, std::vector<uint32>> const& mapData) { - // the caller must pass the list of all mapIds that will be used in the VMapManager2 lifetime - for (std::pair<uint32 const, std::vector<uint32>> const& mapId : mapData) + // the caller must pass the list of all mapIds that will be used in the MMapManager lifetime + for (auto const& [mapId, childMapIds] : mapData) { - loadedMMaps.insert(MMapDataSet::value_type(mapId.first, nullptr)); - for (uint32 childMapId : mapId.second) - parentMapData[childMapId] = mapId.first; + loadedMMaps.insert(MMapDataSet::value_type(mapId, nullptr)); + for (uint32 childMapId : childMapIds) + parentMapData[childMapId] = mapId; } thread_safe_environment = false; @@ -59,7 +78,7 @@ namespace MMAP return itr; } - LoadResult MMapManager::loadMapData(std::string const& basePath, uint32 mapId) + LoadResult MMapManager::loadMapData(std::string_view basePath, uint32 mapId) { // we already have this map loaded? MMapDataSet::iterator itr = loadedMMaps.find(mapId); @@ -93,11 +112,10 @@ namespace MMAP return LoadResult::ReadFromFileFailed; } - dtNavMesh* mesh = dtAllocNavMesh(); + NavMeshPtr mesh(dtAllocNavMesh()); ASSERT(mesh); if (dtStatusFailed(mesh->init(¶ms))) { - dtFreeNavMesh(mesh); TC_LOG_ERROR("maps", "MMAP:loadMapData: Failed to initialize dtNavMesh for mmap {:04} from file {}", mapId, fileName); return LoadResult::LibraryError; } @@ -105,9 +123,7 @@ namespace MMAP TC_LOG_DEBUG("maps", "MMAP:loadMapData: Loaded {:04}.mmap", mapId); // store inside our map list - MMapData* mmap_data = new MMapData(mesh); - - itr->second = mmap_data; + itr->second.reset(new MMapData(std::move(mesh))); return LoadResult::Success; } @@ -116,7 +132,7 @@ namespace MMAP return uint32(x << 16 | y); } - LoadResult MMapManager::loadMap(std::string const& basePath, uint32 mapId, int32 x, int32 y) + LoadResult MMapManager::loadMap(std::string_view basePath, uint32 mapId, int32 x, int32 y) { // make sure the mmap is loaded and ready to load tiles switch (LoadResult mapResult = loadMapData(basePath, mapId)) @@ -129,12 +145,12 @@ namespace MMAP } // get this mmap data - MMapData* mmap = loadedMMaps[mapId]; + MMapData* mmap = loadedMMaps[mapId].get(); ASSERT(mmap->navMesh); // check if we already have this tile loaded uint32 packedGridPos = packTileID(x, y); - if (mmap->loadedTileRefs.find(packedGridPos) != mmap->loadedTileRefs.end()) + if (mmap->loadedTileRefs.contains(packedGridPos)) return LoadResult::AlreadyLoaded; // load this tile :: mmaps/MMMMXXYY.mmtile @@ -187,21 +203,21 @@ namespace MMAP fseek(file.get(), pos, SEEK_SET); - unsigned char* data = (unsigned char*)dtAlloc(fileHeader.size, DT_ALLOC_PERM); + auto data = Trinity::make_unique_ptr_with_deleter<&::dtFree>(dtAlloc(fileHeader.size, DT_ALLOC_PERM)); ASSERT(data); - size_t result = fread(data, fileHeader.size, 1, file.get()); + size_t result = fread(data.get(), fileHeader.size, 1, file.get()); if (!result) { TC_LOG_ERROR("maps", "MMAP:loadMap: Bad header or data in mmap {:04}{:02}{:02}.mmtile", mapId, x, y); return LoadResult::ReadFromFileFailed; } - dtMeshHeader* header = (dtMeshHeader*)data; + dtMeshHeader* header = static_cast<dtMeshHeader*>(data.get()); dtTileRef tileRef = 0; // memory allocated for data is now managed by detour, and will be deallocated when the tile is removed - if (dtStatusSucceed(mmap->navMesh->addTile(data, fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef))) + if (dtStatusSucceed(mmap->navMesh->addTile(static_cast<unsigned char*>(data.release()), fileHeader.size, DT_TILE_FREE_DATA, 0, &tileRef))) { mmap->loadedTileRefs.insert(std::pair<uint32, dtTileRef>(packedGridPos, tileRef)); ++loadedTiles; @@ -211,12 +227,11 @@ namespace MMAP else { TC_LOG_ERROR("maps", "MMAP:loadMap: Could not load {:04}{:02}{:02}.mmtile into navmesh", mapId, x, y); - dtFree(data); return LoadResult::LibraryError; } } - bool MMapManager::loadMapInstance(std::string const& basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId) + bool MMapManager::loadMapInstance(std::string_view basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId) { switch (loadMapData(basePath, meshMapId)) { @@ -227,24 +242,23 @@ namespace MMAP return false; } - MMapData* mmap = loadedMMaps[meshMapId]; + MMapData* mmap = loadedMMaps[meshMapId].get(); auto [queryItr, inserted] = mmap->navMeshQueries.try_emplace({ instanceMapId, instanceId }, nullptr); if (!inserted) return true; // allocate mesh query - dtNavMeshQuery* query = dtAllocNavMeshQuery(); + NavMeshQueryPtr query(dtAllocNavMeshQuery()); ASSERT(query); - if (dtStatusFailed(query->init(mmap->navMesh, 1024))) + if (dtStatusFailed(query->init(mmap->navMesh.get(), 1024))) { - dtFreeNavMeshQuery(query); mmap->navMeshQueries.erase(queryItr); TC_LOG_ERROR("maps", "MMAP:GetNavMeshQuery: Failed to initialize dtNavMeshQuery for mapId {:04} instanceId {}", instanceMapId, instanceId); return false; } TC_LOG_DEBUG("maps", "MMAP:GetNavMeshQuery: created dtNavMeshQuery for mapId {:04} instanceId {}", instanceMapId, instanceId); - queryItr->second = query; + queryItr->second = std::move(query); return true; } @@ -259,12 +273,12 @@ namespace MMAP return false; } - MMapData* mmap = itr->second; + MMapData* mmap = itr->second.get(); // check if we have this tile loaded uint32 packedGridPos = packTileID(x, y); - auto tileRefItr = mmap->loadedTileRefs.find(packedGridPos); - if (tileRefItr == mmap->loadedTileRefs.end()) + auto tileRef = mmap->loadedTileRefs.extract(packedGridPos); + if (!tileRef) { // file may not exist, therefore not loaded TC_LOG_DEBUG("maps", "MMAP:unloadMap: Asked to unload not loaded navmesh tile. {:04}{:02}{:02}.mmtile", mapId, x, y); @@ -272,7 +286,7 @@ namespace MMAP } // unload, and mark as non loaded - if (dtStatusFailed(mmap->navMesh->removeTile(tileRefItr->second, nullptr, nullptr))) + if (dtStatusFailed(mmap->navMesh->removeTile(tileRef.mapped(), nullptr, nullptr))) { // this is technically a memory leak // if the grid is later reloaded, dtNavMesh::addTile will return error but no extra memory is used @@ -282,7 +296,6 @@ namespace MMAP } else { - mmap->loadedTileRefs.erase(tileRefItr); --loadedTiles; TC_LOG_DEBUG("maps", "MMAP:unloadMap: Unloaded mmtile {:04}[{:02}, {:02}] from {:03}", mapId, x, y, mapId); return true; @@ -302,12 +315,12 @@ namespace MMAP } // unload all tiles from given map - MMapData* mmap = itr->second; - for (MMapTileSet::iterator i = mmap->loadedTileRefs.begin(); i != mmap->loadedTileRefs.end(); ++i) + MMapData* mmap = itr->second.get(); + for (auto const& [tileId, tileRef] : mmap->loadedTileRefs) { - uint32 x = (i->first >> 16); - uint32 y = (i->first & 0x0000FFFF); - if (dtStatusFailed(mmap->navMesh->removeTile(i->second, nullptr, nullptr))) + uint32 x = (tileId >> 16); + uint32 y = (tileId & 0x0000FFFF); + if (dtStatusFailed(mmap->navMesh->removeTile(tileRef, nullptr, nullptr))) TC_LOG_ERROR("maps", "MMAP:unloadMap: Could not unload {:04}{:02}{:02}.mmtile from navmesh", mapId, x, y); else { @@ -316,7 +329,6 @@ namespace MMAP } } - delete mmap; itr->second = nullptr; TC_LOG_DEBUG("maps", "MMAP:unloadMap: Unloaded {:04}.mmap", mapId); @@ -334,16 +346,14 @@ namespace MMAP return false; } - MMapData* mmap = itr->second; - auto queryItr = mmap->navMeshQueries.find({ instanceMapId, instanceId }); - if (queryItr == mmap->navMeshQueries.end()) + MMapData* mmap = itr->second.get(); + std::size_t erased = mmap->navMeshQueries.erase({ instanceMapId, instanceId }); + if (!erased) { TC_LOG_DEBUG("maps", "MMAP:unloadMapInstance: Asked to unload not loaded dtNavMeshQuery mapId {:04} instanceId {}", instanceMapId, instanceId); return false; } - dtFreeNavMeshQuery(queryItr->second); - mmap->navMeshQueries.erase(queryItr); TC_LOG_DEBUG("maps", "MMAP:unloadMapInstance: Unloaded mapId {:04} instanceId {}", instanceMapId, instanceId); return true; @@ -355,7 +365,7 @@ namespace MMAP if (itr == loadedMMaps.end()) return nullptr; - return itr->second->navMesh; + return itr->second->navMesh.get(); } dtNavMeshQuery const* MMapManager::GetNavMeshQuery(uint32 meshMapId, uint32 instanceMapId, uint32 instanceId) @@ -368,6 +378,6 @@ namespace MMAP if (queryItr == itr->second->navMeshQueries.end()) return nullptr; - return queryItr->second; + return queryItr->second.get(); } } diff --git a/src/common/Collision/Management/MMapManager.h b/src/common/Collision/Management/MMapManager.h index 45c0466e687..9973f37d51c 100644 --- a/src/common/Collision/Management/MMapManager.h +++ b/src/common/Collision/Management/MMapManager.h @@ -19,40 +19,19 @@ #define _MMAP_MANAGER_H #include "Define.h" -#include "DetourNavMesh.h" -#include "DetourNavMeshQuery.h" -#include "Hash.h" -#include <string> +#include <DetourNavMesh.h> +#include <DetourNavMeshQuery.h> +#include <memory> +#include <string_view> #include <unordered_map> #include <vector> // move map related classes namespace MMAP { - typedef std::unordered_map<uint32, dtTileRef> MMapTileSet; - typedef std::unordered_map<std::pair<uint32, uint32>, dtNavMeshQuery*> NavMeshQuerySet; + struct MMapData; - // dummy struct to hold map's mmap data - struct TC_COMMON_API MMapData - { - MMapData(dtNavMesh* mesh) : navMesh(mesh) { } - ~MMapData() - { - for (NavMeshQuerySet::iterator i = navMeshQueries.begin(); i != navMeshQueries.end(); ++i) - dtFreeNavMeshQuery(i->second); - - if (navMesh) - dtFreeNavMesh(navMesh); - } - - // we have to use single dtNavMeshQuery for every instance, since those are not thread safe - NavMeshQuerySet navMeshQueries; // instanceId to query - - dtNavMesh* navMesh; - MMapTileSet loadedTileRefs; // maps [map grid coords] to [dtTile] - }; - - typedef std::unordered_map<uint32, MMapData*> MMapDataSet; + typedef std::unordered_map<uint32, std::unique_ptr<MMapData>> MMapDataSet; enum class LoadResult : uint8 { @@ -69,12 +48,18 @@ namespace MMAP class TC_COMMON_API MMapManager { public: - MMapManager() : loadedTiles(0), thread_safe_environment(true) {} + MMapManager(); + MMapManager(MMapManager const& other) = delete; + MMapManager(MMapManager&& other) noexcept = delete; + MMapManager& operator=(MMapManager const& other) = delete; + MMapManager& operator=(MMapManager&& other) noexcept = delete; ~MMapManager(); + static MMapManager* instance(); + void InitializeThreadUnsafe(std::unordered_map<uint32, std::vector<uint32>> const& mapData); - LoadResult loadMap(std::string const& basePath, uint32 mapId, int32 x, int32 y); - bool loadMapInstance(std::string const& basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId); + LoadResult loadMap(std::string_view basePath, uint32 mapId, int32 x, int32 y); + bool loadMapInstance(std::string_view basePath, uint32 meshMapId, uint32 instanceMapId, uint32 instanceId); bool unloadMap(uint32 mapId, int32 x, int32 y); bool unloadMap(uint32 mapId); bool unloadMapInstance(uint32 meshMapId, uint32 instanceMapId, uint32 instanceId); @@ -86,13 +71,13 @@ namespace MMAP uint32 getLoadedTilesCount() const { return loadedTiles; } uint32 getLoadedMapsCount() const { return uint32(loadedMMaps.size()); } private: - LoadResult loadMapData(std::string const& basePath, uint32 mapId); + LoadResult loadMapData(std::string_view basePath, uint32 mapId); uint32 packTileID(int32 x, int32 y); MMapDataSet::const_iterator GetMMapData(uint32 mapId) const; MMapDataSet loadedMMaps; - uint32 loadedTiles; - bool thread_safe_environment; + uint32 loadedTiles = 0; + bool thread_safe_environment = true; std::unordered_map<uint32, uint32> parentMapData; }; diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 2739854926b..b6716c248ae 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -32,6 +32,7 @@ #include "Player.h" #include "SharedDefines.h" #include "World.h" +#include "WorldSession.h" bool BattlegroundTemplate::IsArena() const { @@ -64,7 +65,7 @@ uint8 BattlegroundTemplate::GetMaxLevel() const BattlegroundMgr::BattlegroundMgr() : m_NextRatedArenaUpdate(sWorld->getIntConfig(CONFIG_ARENA_RATED_UPDATE_TIMER)), - m_UpdateTimer(0), m_ArenaTesting(false), m_Testing(false) + m_UpdateTimer(0), m_ArenaTesting(0), m_Testing(false) { } BattlegroundMgr::~BattlegroundMgr() @@ -300,6 +301,15 @@ BattlegroundScriptTemplate const* BattlegroundMgr::FindBattlegroundScriptTemplat return Trinity::Containers::MapGetValuePtr(_battlegroundScriptTemplates, { mapId, BATTLEGROUND_TYPE_NONE }); } +void BattlegroundMgr::QueuePlayerForArena(Player const* player, uint8 teamSize, uint8 roles) +{ + WorldPackets::Battleground::BattlemasterJoinArena packet((WorldPacket(CMSG_BATTLEMASTER_JOIN_ARENA))); + packet.TeamSizeIndex = teamSize; + packet.Roles = roles; + + player->GetSession()->HandleBattlemasterJoinArena(packet); +} + uint32 BattlegroundMgr::CreateClientVisibleInstanceId(BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id) { if (IsArenaType(bgTypeId)) @@ -507,10 +517,23 @@ void BattlegroundMgr::ToggleTesting() sWorld->SendWorldText(m_Testing ? LANG_DEBUG_BG_ON : LANG_DEBUG_BG_OFF); } -void BattlegroundMgr::ToggleArenaTesting() +bool BattlegroundMgr::ToggleArenaTesting(uint32 battlemasterListId) { - m_ArenaTesting = !m_ArenaTesting; - sWorld->SendWorldText(m_ArenaTesting ? LANG_DEBUG_ARENA_ON : LANG_DEBUG_ARENA_OFF); + if (battlemasterListId != 0) + { + BattlegroundTemplate const* bgTemplate = GetBattlegroundTemplateByTypeId(static_cast<BattlegroundTypeId>(battlemasterListId)); + if (!bgTemplate) + return false; + + if (!bgTemplate->IsArena()) + return false; + } + + if (m_ArenaTesting != battlemasterListId) + sWorld->SendWorldText((battlemasterListId != 0) ? LANG_DEBUG_ARENA_ON : LANG_DEBUG_ARENA_OFF); + + m_ArenaTesting = battlemasterListId; + return true; } bool BattlegroundMgr::IsValidQueueId(BattlegroundQueueTypeId bgQueueTypeId) @@ -686,6 +709,9 @@ BattlegroundTypeId BattlegroundMgr::GetRandomBG(BattlegroundTypeId bgTypeId) { if (BattlegroundTemplate const* bgTemplate = GetBattlegroundTemplateByTypeId(bgTypeId)) { + if (bgTemplate->IsArena() && isArenaTesting()) + return static_cast<BattlegroundTypeId>(m_ArenaTesting); + std::vector<BattlegroundTemplate const*> ids; ids.reserve(bgTemplate->MapIDs.size()); for (int32 mapId : bgTemplate->MapIDs) diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.h b/src/server/game/Battlegrounds/BattlegroundMgr.h index b31b0193af0..8aa341cbca8 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.h +++ b/src/server/game/Battlegrounds/BattlegroundMgr.h @@ -126,10 +126,11 @@ class TC_GAME_API BattlegroundMgr void ScheduleQueueUpdate(uint32 arenaMatchmakerRating, BattlegroundQueueTypeId bgQueueTypeId, BattlegroundBracketId bracket_id); uint32 GetPrematureFinishTime() const; - void ToggleArenaTesting(); + // Return whether toggling was successful. In case of a non-existing battlemasterListId, or this battlemasterListId is not an arena, this would return false. + bool ToggleArenaTesting(uint32 battlemasterListId); void ToggleTesting(); - bool isArenaTesting() const { return m_ArenaTesting; } + bool isArenaTesting() const { return m_ArenaTesting != 0; } bool isTesting() const { return m_Testing; } static bool IsRandomBattleground(uint32 battlemasterListId); @@ -162,6 +163,8 @@ class TC_GAME_API BattlegroundMgr void LoadBattlegroundScriptTemplate(); BattlegroundScriptTemplate const* FindBattlegroundScriptTemplate(uint32 mapId, BattlegroundTypeId bgTypeId) const; + static void QueuePlayerForArena(Player const* player, uint8 teamSize, uint8 roles); + private: uint32 CreateClientVisibleInstanceId(BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id); static bool IsArenaType(BattlegroundTypeId bgTypeId); @@ -185,7 +188,7 @@ class TC_GAME_API BattlegroundMgr std::vector<ScheduledQueueUpdate> m_QueueUpdateScheduler; uint32 m_NextRatedArenaUpdate; uint32 m_UpdateTimer; - bool m_ArenaTesting; + uint32 m_ArenaTesting; bool m_Testing; BattleMastersMap mBattleMastersMap; diff --git a/src/server/game/Handlers/BattleGroundHandler.cpp b/src/server/game/Handlers/BattleGroundHandler.cpp index 8fb5a150793..e78a52042b9 100644 --- a/src/server/game/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Handlers/BattleGroundHandler.cpp @@ -540,9 +540,16 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPackets::Battleground::Battl return; Group* grp = _player->GetGroup(); + if (!grp) + { + grp = new Group(); + grp->Create(_player); + } + // no group found, error if (!grp) return; + if (grp->GetLeaderGUID() != _player->GetGUID()) return; @@ -559,7 +566,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPackets::Battleground::Battl GroupQueueInfo* ginfo = nullptr; ObjectGuid errorGuid; - GroupJoinBattlegroundResult err = grp->CanJoinBattlegroundQueue(bgTemplate, bgQueueTypeId, arenatype, arenatype, true, packet.TeamSizeIndex, errorGuid); + GroupJoinBattlegroundResult err = ERR_BATTLEGROUND_NONE; + if (!sBattlegroundMgr->isArenaTesting()) + err = grp->CanJoinBattlegroundQueue(bgTemplate, bgQueueTypeId, arenatype, arenatype, true, packet.TeamSizeIndex, errorGuid); + if (!err) { TC_LOG_DEBUG("bg.battleground", "Battleground: arena team id {}, leader {} queued with matchmaker rating {} for type {}", _player->GetArenaTeamId(packet.TeamSizeIndex), _player->GetName(), matchmakerRating, arenatype); diff --git a/src/server/game/Maps/TerrainMgr.cpp b/src/server/game/Maps/TerrainMgr.cpp index 2e6d8e184b9..65655e6e84b 100644 --- a/src/server/game/Maps/TerrainMgr.cpp +++ b/src/server/game/Maps/TerrainMgr.cpp @@ -22,7 +22,7 @@ #include "GridMap.h" #include "Log.h" #include "Memory.h" -#include "MMapFactory.h" +#include "MMapManager.h" #include "PhasingHandler.h" #include "Random.h" #include "ScriptMgr.h" @@ -39,7 +39,7 @@ TerrainInfo::TerrainInfo(uint32 mapId) : _mapId(mapId), _parentTerrain(nullptr), TerrainInfo::~TerrainInfo() { VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId()); - MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(GetId()); + MMAP::MMapManager::instance()->unloadMap(GetId()); } char const* TerrainInfo::GetMapName() const @@ -185,7 +185,7 @@ void TerrainInfo::LoadMapAndVMapImpl(int32 gx, int32 gy) void TerrainInfo::LoadMMapInstanceImpl(uint32 mapId, uint32 instanceId) { - MMAP::MMapFactory::createOrGetMMapManager()->loadMapInstance(sWorld->GetDataPath(), _mapId, mapId, instanceId); + MMAP::MMapManager::instance()->loadMapInstance(sWorld->GetDataPath(), _mapId, mapId, instanceId); } void TerrainInfo::LoadMap(int32 gx, int32 gy) @@ -239,7 +239,7 @@ void TerrainInfo::LoadMMap(int32 gx, int32 gy) if (!DisableMgr::IsPathfindingEnabled(GetId())) return; - switch (MMAP::LoadResult mmapLoadResult = MMAP::MMapFactory::createOrGetMMapManager()->loadMap(sWorld->GetDataPath(), GetId(), gx, gy)) + switch (MMAP::LoadResult mmapLoadResult = MMAP::MMapManager::instance()->loadMap(sWorld->GetDataPath(), GetId(), gx, gy)) { case MMAP::LoadResult::Success: TC_LOG_DEBUG("mmaps.tiles", "MMAP loaded name:{}, id:{}, x:{}, y:{} (mmap rep.: x:{}, y:{})", GetMapName(), GetId(), gx, gy, gx, gy); @@ -274,7 +274,7 @@ void TerrainInfo::UnloadMapImpl(int32 gx, int32 gy) { _gridMap[gx][gy] = nullptr; VMAP::VMapFactory::createOrGetVMapManager()->unloadMap(GetId(), gx, gy); - MMAP::MMapFactory::createOrGetMMapManager()->unloadMap(GetId(), gx, gy); + MMAP::MMapManager::instance()->unloadMap(GetId(), gx, gy); for (std::shared_ptr<TerrainInfo> const& childTerrain : _childTerrain) childTerrain->UnloadMapImpl(gx, gy); @@ -284,7 +284,7 @@ void TerrainInfo::UnloadMapImpl(int32 gx, int32 gy) void TerrainInfo::UnloadMMapInstanceImpl(uint32 mapId, uint32 instanceId) { - MMAP::MMapFactory::createOrGetMMapManager()->unloadMapInstance(_mapId, mapId, instanceId); + MMAP::MMapManager::instance()->unloadMapInstance(_mapId, mapId, instanceId); } GridMap* TerrainInfo::GetGrid(uint32 mapId, float x, float y, bool loadIfMissing /*= true*/) diff --git a/src/server/game/Movement/PathGenerator.cpp b/src/server/game/Movement/PathGenerator.cpp index 1d8285822ec..49f2f0150fa 100644 --- a/src/server/game/Movement/PathGenerator.cpp +++ b/src/server/game/Movement/PathGenerator.cpp @@ -22,7 +22,6 @@ #include "DisableMgr.h" #include "G3DPosition.hpp" #include "Log.h" -#include "MMapFactory.h" #include "MMapManager.h" #include "Map.h" #include "Metric.h" @@ -42,7 +41,7 @@ PathGenerator::PathGenerator(WorldObject const* owner) : uint32 mapId = PhasingHandler::GetTerrainMapId(_source->GetPhaseShift(), _source->GetMapId(), _source->GetMap()->GetTerrain(), _startPosition.x, _startPosition.y); if (DisableMgr::IsPathfindingEnabled(_source->GetMapId())) { - MMAP::MMapManager* mmap = MMAP::MMapFactory::createOrGetMMapManager(); + MMAP::MMapManager* mmap = MMAP::MMapManager::instance(); _navMeshQuery = mmap->GetNavMeshQuery(mapId, _source->GetMapId(), _source->GetInstanceId()); _navMesh = _navMeshQuery ? _navMeshQuery->getAttachedNavMesh() : mmap->GetNavMesh(mapId); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 2776b10628e..d4436a76e96 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -69,7 +69,7 @@ #include "LootItemStorage.h" #include "LootMgr.h" #include "M2Stores.h" -#include "MMapFactory.h" +#include "MMapManager.h" #include "Map.h" #include "MapManager.h" #include "MapUtils.h" @@ -188,7 +188,6 @@ World::~World() delete command; VMAP::VMapFactory::clear(); - MMAP::MMapFactory::clear(); /// @todo free addSessQueue } @@ -1356,7 +1355,7 @@ bool World::SetInitialWorldSettings() vmmgr2->InitializeThreadUnsafe(mapData); - MMAP::MMapManager* mmmgr = MMAP::MMapFactory::createOrGetMMapManager(); + MMAP::MMapManager* mmmgr = MMAP::MMapManager::instance(); mmmgr->InitializeThreadUnsafe(mapData); ///- Initialize static helper structures diff --git a/src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp b/src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp new file mode 100644 index 00000000000..643f582e3fa --- /dev/null +++ b/src/server/scripts/Battlegrounds/MaldraxxusColiseum/arena_maldraxxus_coliseum.cpp @@ -0,0 +1,125 @@ +/* + * This file is part of the TrinityCore 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 General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Battleground.h" +#include "BattlegroundScript.h" +#include "Creature.h" +#include "GameObject.h" +#include "Map.h" +#include "MotionMaster.h" +#include "ScriptMgr.h" + +namespace MaldraxxusColiseum +{ + namespace MapIds + { + static constexpr uint32 MaldraxxusColiseum = 2509; + } + + namespace Creatures + { + static constexpr uint32 MaldraxxianGladiator = 185764; + } + + namespace GameObjects + { + static constexpr uint32 Door = 375890; + } + + namespace Destinations + { + static constexpr Position Guard1 = { 2875.89f, 2285.57f, 3260.1755f }; + static constexpr Position Guard2 = { 2816.69f, 2300.51f, 3260.1885f }; + static constexpr Position Guard3 = { 2873.62f, 2219.39f, 3260.7085f }; + static constexpr Position Guard4 = { 2823.31f, 2204.30f, 3260.0960f }; + } + + namespace StringIds + { + static constexpr std::string_view Guard1 = "arena_maldraxxus_coliseum_1"; + static constexpr std::string_view Guard2 = "arena_maldraxxus_coliseum_2"; + static constexpr std::string_view Guard3 = "arena_maldraxxus_coliseum_3"; + static constexpr std::string_view Guard4 = "arena_maldraxxus_coliseum_4"; + } +} + +struct arena_maldraxxus_coliseum : ArenaScript +{ + explicit arena_maldraxxus_coliseum(BattlegroundMap* map) : ArenaScript(map) { } + + void OnStart() override + { + for (ObjectGuid const& guid : _doorGUIDs) + { + if (GameObject* door = battlegroundMap->GetGameObject(guid)) + { + door->UseDoorOrButton(); + door->DespawnOrUnsummon(5s); + } + } + + for (ObjectGuid const& guid : _gladiatorGUIDs) + { + if (Creature* creature = battlegroundMap->GetCreature(guid)) + { + if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard1)) + creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard1); + else if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard2)) + creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard2); + else if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard3)) + creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard3); + else if (creature->HasStringId(MaldraxxusColiseum::StringIds::Guard4)) + creature->GetMotionMaster()->MovePoint(1, MaldraxxusColiseum::Destinations::Guard4); + + creature->DespawnOrUnsummon(2s); + } + } + } + + void OnCreatureCreate(Creature* creature) override + { + switch (creature->GetEntry()) + { + case MaldraxxusColiseum::Creatures::MaldraxxianGladiator: + _gladiatorGUIDs.emplace_back(creature->GetGUID()); + break; + default: + break; + } + } + + void OnGameObjectCreate(GameObject* gameobject) override + { + switch (gameobject->GetEntry()) + { + case MaldraxxusColiseum::GameObjects::Door: + _doorGUIDs.emplace_back(gameobject->GetGUID()); + break; + default: + break; + } + } + +private: + GuidVector _doorGUIDs; + GuidVector _gladiatorGUIDs; +}; + +void AddSC_arena_maldraxxus_coliseum() +{ + RegisterBattlegroundMapScript(arena_maldraxxus_coliseum, MaldraxxusColiseum::MapIds::MaldraxxusColiseum); +} diff --git a/src/server/scripts/Battlegrounds/TheRobodrome/arena_the_robodrome.cpp b/src/server/scripts/Battlegrounds/TheRobodrome/arena_the_robodrome.cpp new file mode 100644 index 00000000000..b7e00b73969 --- /dev/null +++ b/src/server/scripts/Battlegrounds/TheRobodrome/arena_the_robodrome.cpp @@ -0,0 +1,136 @@ +/* + * This file is part of the TrinityCore 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 General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "Battleground.h" +#include "BattlegroundScript.h" +#include "Creature.h" +#include "CreatureAI.h" +#include "GameObject.h" +#include "Map.h" +#include "Player.h" +#include "ScriptMgr.h" +#include "SpellScript.h" +#include "TaskScheduler.h" + +namespace TheRobodrome +{ + namespace MapIds + { + static constexpr uint32 TheRobodrome = 2167; + } + + namespace Creatures + { + static constexpr uint32 PowerCoil = 154593; + } + + namespace GameObjects + { + static constexpr uint32 Door01 = 329742; + static constexpr uint32 Door02 = 329743; + } + + namespace Spells + { + static constexpr uint32 Zap = 300642; + } +} + +struct arena_the_robodrome : ArenaScript +{ + explicit arena_the_robodrome(BattlegroundMap* map) : ArenaScript(map) { } + + void OnUpdate(uint32 diff) override + { + _scheduler.Update(diff); + } + + void OnStart() override + { + for (ObjectGuid const& guid : _doorGUIDs) + { + if (GameObject* door = battlegroundMap->GetGameObject(guid)) + { + door->UseDoorOrButton(); + door->DespawnOrUnsummon(5s); + } + } + + _scheduler.Schedule(5s, [&](TaskContext context) + { + for (ObjectGuid const& guid : _powerCoilGUIDs) + if (Creature* coil = battlegroundMap->GetCreature(guid)) + coil->CastSpell(nullptr, TheRobodrome::Spells::Zap); + + context.Repeat(); + }); + } + + void OnGameObjectCreate(GameObject* gameobject) override + { + switch (gameobject->GetEntry()) + { + case TheRobodrome::GameObjects::Door01: + case TheRobodrome::GameObjects::Door02: + _doorGUIDs.emplace_back(gameobject->GetGUID()); + break; + default: + break; + } + } + + void OnCreatureCreate(Creature* creature) override + { + switch (creature->GetEntry()) + { + case TheRobodrome::Creatures::PowerCoil: + _powerCoilGUIDs.emplace_back(creature->GetGUID()); + break; + default: + break; + } + } + +private: + GuidVector _doorGUIDs; + GuidVector _powerCoilGUIDs; + + TaskScheduler _scheduler; +}; + +// 300642 - Zap (Damage mod) +class spell_the_robodrome_zap_damage : public SpellScript +{ + void HandleHitTarget(SpellEffIndex /*effIndex*/) + { + uint32 basePct = 16; + uint32 stackCount = GetHitUnit()->GetAuraCount(TheRobodrome::Spells::Zap); + + SetEffectValue(basePct + basePct * stackCount); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_the_robodrome_zap_damage::HandleHitTarget, EFFECT_2, SPELL_EFFECT_DAMAGE_FROM_MAX_HEALTH_PCT); + } +}; + +void AddSC_arena_the_robodrome() +{ + RegisterBattlegroundMapScript(arena_the_robodrome, TheRobodrome::MapIds::TheRobodrome); + RegisterSpellScript(spell_the_robodrome_zap_damage); +} diff --git a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp index 65f831fae9e..5bf00c0a80a 100644 --- a/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp +++ b/src/server/scripts/Battlegrounds/battlegrounds_script_loader.cpp @@ -66,6 +66,9 @@ void AddSC_battleground_deephaul_ravine(); void AddSC_arena_blades_edge_legion(); void AddSC_arena_mugambala(); +void AddSC_arena_the_robodrome(); + +void AddSC_arena_maldraxxus_coliseum(); // The name of this function should match: // void Add${NameOfDirectory}Scripts() @@ -118,4 +121,7 @@ void AddBattlegroundsScripts() AddSC_arena_blades_edge_legion(); AddSC_arena_mugambala(); + AddSC_arena_the_robodrome(); + + AddSC_arena_maldraxxus_coliseum(); } diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index 68020eb435d..3785f81f70a 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -39,6 +39,7 @@ EndScriptData */ #include "GridNotifiersImpl.h" #include "InstanceScript.h" #include "Language.h" +#include "LFG.h" #include "Log.h" #include "M2Stores.h" #include "MapManager.h" @@ -856,9 +857,20 @@ public: return true; } - static bool HandleDebugArenaCommand(ChatHandler* /*handler*/) + static bool HandleDebugArenaCommand(ChatHandler* handler, uint32 battlemasterListId) { - sBattlegroundMgr->ToggleArenaTesting(); + bool successful = sBattlegroundMgr->ToggleArenaTesting(battlemasterListId); + if (!successful) + { + handler->PSendSysMessage("BattlemasterListId %u does not exist or is not an arena.", battlemasterListId); + handler->SetSentErrorMessage(true); + return true; + } + + if (!battlemasterListId || !handler || !handler->GetSession()) + return true; + + BattlegroundMgr::QueuePlayerForArena(handler->GetSession()->GetPlayer(), 0, lfg::PLAYER_ROLE_DAMAGE); return true; } diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 3e5fe709ee0..5e87cf376fb 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -32,7 +32,7 @@ #include "ItemBonusMgr.h" #include "Language.h" #include "MiscPackets.h" -#include "MMapFactory.h" +#include "MMapManager.h" #include "MotionMaster.h" #include "MovementDefines.h" #include "ObjectAccessor.h" @@ -258,7 +258,7 @@ public: uint32 haveMap = TerrainInfo::ExistMap(mapId, gridX, gridY) ? 1 : 0; uint32 haveVMap = TerrainInfo::ExistVMap(mapId, gridX, gridY) ? 1 : 0; - uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0; + uint32 haveMMap = (DisableMgr::IsPathfindingEnabled(mapId) && MMAP::MMapManager::instance()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) ? 1 : 0; if (haveVMap) { diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 2b4fc01675e..d30bfcdc746 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -29,7 +29,7 @@ #include "ChatCommand.h" #include "DisableMgr.h" #include "GridNotifiersImpl.h" -#include "MMapFactory.h" +#include "MMapManager.h" #include "PathGenerator.h" #include "PhasingHandler.h" #include "Player.h" @@ -66,7 +66,7 @@ public: static bool HandleMmapPathCommand(ChatHandler* handler, char const* args) { - if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) + if (!MMAP::MMapManager::instance()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) { handler->PSendSysMessage("NavMesh not loaded for current map."); return true; @@ -144,8 +144,8 @@ public: handler->PSendSysMessage("%04u%02i%02i.mmtile", terrainMapId, gx, gy); handler->PSendSysMessage("tileloc [%i, %i]", gy, gx); - dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(terrainMapId); - dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(terrainMapId, player->GetMapId(), player->GetInstanceId()); + dtNavMesh const* navmesh = MMAP::MMapManager::instance()->GetNavMesh(terrainMapId); + dtNavMeshQuery const* navmeshquery = MMAP::MMapManager::instance()->GetNavMeshQuery(terrainMapId, player->GetMapId(), player->GetInstanceId()); if (!navmesh || !navmeshquery) { handler->PSendSysMessage("NavMesh not loaded for current map."); @@ -195,8 +195,8 @@ public: { Player* player = handler->GetSession()->GetPlayer(); uint32 terrainMapId = PhasingHandler::GetTerrainMapId(player->GetPhaseShift(), player->GetMapId(), player->GetMap()->GetTerrain(), player->GetPositionX(), player->GetPositionY()); - dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(terrainMapId); - dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(terrainMapId, player->GetMapId(), player->GetInstanceId()); + dtNavMesh const* navmesh = MMAP::MMapManager::instance()->GetNavMesh(terrainMapId); + dtNavMeshQuery const* navmeshquery = MMAP::MMapManager::instance()->GetNavMeshQuery(terrainMapId, player->GetMapId(), player->GetInstanceId()); if (!navmesh || !navmeshquery) { handler->PSendSysMessage("NavMesh not loaded for current map."); @@ -224,7 +224,7 @@ public: handler->PSendSysMessage("mmap stats:"); handler->PSendSysMessage(" global mmap pathfinding is %sabled", DisableMgr::IsPathfindingEnabled(player->GetMapId()) ? "en" : "dis"); - MMAP::MMapManager* manager = MMAP::MMapFactory::createOrGetMMapManager(); + MMAP::MMapManager* manager = MMAP::MMapManager::instance(); handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount()); dtNavMesh const* navmesh = manager->GetNavMesh(terrainMapId); diff --git a/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp b/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp new file mode 100644 index 00000000000..915c48f09f6 --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Gilneas/gilneas_chapter_1.cpp @@ -0,0 +1,177 @@ +/* +* This file is part of the TrinityCore 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 General Public License as published by the +* Free Software Foundation; either version 2 of the License, or (at your +* option) any later version. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along +* with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "ScriptMgr.h" +#include "CreatureAIImpl.h" +#include "MotionMaster.h" +#include "ObjectAccessor.h" +#include "Player.h" +#include "PhasingHandler.h" +#include "ScriptedCreature.h" +#include "SpellInfo.h" +#include "SpellScript.h" +#include "TemporarySummon.h" + +namespace Scripts::EasternKingdoms::Gilneas::Chapter1 +{ + namespace Creatures + { + static constexpr uint32 EvacuationStalkerFirst = 35830; + static constexpr uint32 EvacuationStalkerNear = 35010; + static constexpr uint32 EvacuationStalkerFar = 35011; + } + + namespace Events + { + namespace EvacuateTheMerchantSquare + { + static constexpr uint32 TalkFrightened = 1; + static constexpr uint32 MoveToNearStalker = 2; + static constexpr uint32 MoveToFarStalker = 3; + static constexpr uint32 FrightenedDespawn = 4; + } + } + + namespace Texts + { + namespace FrightenedCitizen + { + static constexpr uint32 SayFrightenedCitizenRescue = 0; + } + } + + namespace Points + { + static constexpr uint32 PointStalkerFirst = 1; + static constexpr uint32 PointStalkerNear = 2; + static constexpr uint32 PointStalkerFar = 3; + } + +// 34981 - Frightened Citizen +// 35836 - Frightened Citizen +struct npc_frightened_citizen : public ScriptedAI +{ + npc_frightened_citizen(Creature* creature) : ScriptedAI(creature) {} + + void IsSummonedBy(WorldObject* /*summoner*/) override + { + me->SetReactState(REACT_PASSIVE); + + if (Creature* stalkerNear = me->FindNearestCreature(Creatures::EvacuationStalkerFirst, 20.0f)) + me->GetMotionMaster()->MovePoint(Points::PointStalkerFirst, stalkerNear->GetPosition(), true); + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE) + return; + + switch (id) + { + case Points::PointStalkerFirst: + _events.ScheduleEvent(Events::EvacuateTheMerchantSquare::TalkFrightened, 1s); + break; + case Points::PointStalkerNear: + _events.ScheduleEvent(Events::EvacuateTheMerchantSquare::MoveToFarStalker, 1ms); + break; + case Points::PointStalkerFar: + _events.ScheduleEvent(Events::EvacuateTheMerchantSquare::FrightenedDespawn, 1ms); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case Events::EvacuateTheMerchantSquare::TalkFrightened: + if (TempSummon* summon = me->ToTempSummon()) + { + if (Unit* summoner = summon->GetSummonerUnit()) + { + if (Player* player = summoner->ToPlayer()) + { + player->KilledMonsterCredit(Creatures::EvacuationStalkerFirst); + Talk(Texts::FrightenedCitizen::SayFrightenedCitizenRescue, summoner); + } + } + } + _events.ScheduleEvent(Events::EvacuateTheMerchantSquare::MoveToNearStalker, 2s); + break; + case Events::EvacuateTheMerchantSquare::MoveToNearStalker: + if (Creature* stalker = me->FindNearestCreature(Creatures::EvacuationStalkerFar, 50.0f)) + me->GetMotionMaster()->MovePoint(Points::PointStalkerFar, stalker->GetPosition(), true); + else if (Creature* stalker = me->FindNearestCreature(Creatures::EvacuationStalkerNear, 100.0f)) + me->GetMotionMaster()->MovePoint(Points::PointStalkerNear, stalker->GetPosition(), true); + break; + case Events::EvacuateTheMerchantSquare::MoveToFarStalker: + if (Creature* stalker = me->FindNearestCreature(Creatures::EvacuationStalkerFar, 500.0f)) + me->GetMotionMaster()->MovePoint(Points::PointStalkerFar, stalker->GetPosition(), true); + break; + case Events::EvacuateTheMerchantSquare::FrightenedDespawn: + me->DespawnOrUnsummon(); + break; + default: + break; + } + } + } +private: + EventMap _events; +}; + +// 67869 - Knocking +class spell_gilneas_knocking : public SpellScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( + { + uint32(spellInfo->GetEffect(EFFECT_1).CalcValue()), + uint32(spellInfo->GetEffect(EFFECT_2).CalcValue()) + }); + } + + void HandleEffect() + { + if (SpellInfo const* spellInfo = GetSpellInfo()) + GetCaster()->CastSpell(GetCaster(), spellInfo->GetEffect(RAND(EFFECT_1, EFFECT_2)).CalcValue(), true); + } + + void Register() override + { + OnCast += SpellCastFn(spell_gilneas_knocking::HandleEffect); + } +}; +} + +void AddSC_gilneas_chapter_1() +{ + using namespace Scripts::EasternKingdoms::Gilneas::Chapter1; + + // Creatures + RegisterCreatureAI(npc_frightened_citizen); + + // Spells + RegisterSpellScript(spell_gilneas_knocking); +} diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index 283eed704a0..13f41362243 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -65,6 +65,7 @@ void AddSC_boss_chromaggus(); void AddSC_boss_nefarian(); void AddSC_instance_blackwing_lair(); void AddSC_instance_deadmines(); //Deadmines +void AddSC_gilneas_chapter_1(); //Gilneas void AddSC_gnomeregan(); //Gnomeregan void AddSC_instance_gnomeregan(); void AddSC_instance_grim_batol(); //Grim Batol @@ -264,6 +265,7 @@ void AddEasternKingdomsScripts() AddSC_boss_nefarian(); AddSC_instance_blackwing_lair(); AddSC_instance_deadmines(); //Deadmines + AddSC_gilneas_chapter_1(); //Gilneas AddSC_gnomeregan(); //Gnomeregan AddSC_instance_gnomeregan(); AddSC_instance_grim_batol(); //Grim Batol diff --git a/src/server/scripts/EasternKingdoms/zone_westfall.cpp b/src/server/scripts/EasternKingdoms/zone_westfall.cpp index 17b5a2de406..60162630e80 100644 --- a/src/server/scripts/EasternKingdoms/zone_westfall.cpp +++ b/src/server/scripts/EasternKingdoms/zone_westfall.cpp @@ -15,11 +15,45 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "CombatAI.h" #include "Containers.h" +#include "CreatureAIImpl.h" +#include "Player.h" #include "ScriptedCreature.h" #include "ScriptMgr.h" +#include "SpellAuraEffects.h" #include "SpellScript.h" +namespace Scripts::EasternKingdoms::Westfall +{ +namespace Creatures +{ + static constexpr uint32 EnergizedHarvestReaper = 42342; + static constexpr uint32 OverloadedHarvestGolem = 42601; +} + +namespace Events +{ + namespace ItsAlive + { + static constexpr uint32 CheckArea = 1; + static constexpr uint32 DespawnHarvester = 2; + } +} + +namespace Text +{ + namespace HarvestGolem + { + static constexpr uint32 AnnounceOutOfArea = 0; + } +} + +namespace Area +{ + static constexpr uint32 TheMoestFarm = 918; +} + // 79084 - Unbound Energy class spell_westfall_unbound_energy : public SpellScript { @@ -44,7 +78,121 @@ class spell_westfall_unbound_energy : public SpellScript } }; +// 42601 - Overloaded Harvest Golem +struct npc_westfall_overloaded_harvest_golem : public ScriptedAI +{ + npc_westfall_overloaded_harvest_golem(Creature* creature) : ScriptedAI(creature) {} + + void JustAppeared() override + { + _events.ScheduleEvent(Events::ItsAlive::CheckArea, 1s); + } + + void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool apply) override + { + if (!apply) + me->DespawnOrUnsummon(); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case Events::ItsAlive::CheckArea: + if (me->GetAreaId() != Area::TheMoestFarm) + { + if (Unit* owner = me->GetCharmerOrOwner()) + Talk(Text::HarvestGolem::AnnounceOutOfArea, owner); + _events.ScheduleEvent(Events::ItsAlive::DespawnHarvester, 8s); + } + else + _events.Repeat(1s); + break; + case Events::ItsAlive::DespawnHarvester: + if (me->GetAreaId() != Area::TheMoestFarm) + me->DespawnOrUnsummon(); + else + _events.ScheduleEvent(Events::ItsAlive::CheckArea, 1s); + break; + default: + break; + } + } + } + +private: + EventMap _events; +}; + +// 79425 - Reaping Blows +class spell_westfall_reaping_blows : public AuraScript +{ + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellEffect({ { spellInfo->Id, EFFECT_1 } }) && ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_1).TriggerSpell) }); + } + + void HandlePeriodic(AuraEffect const* /*aurEff*/) + { + // HACK + // periodic ticks are forcing to cast the spell onto himself instead of target + // ref AuraEffect::HandlePeriodicTriggerSpellAuraTick + PreventDefaultAction(); + if (Creature* reaper = GetTarget()->FindNearestCreature(Creatures::EnergizedHarvestReaper, 5.f, true)) + GetTarget()->CastSpell(reaper, GetSpellInfo()->GetEffect(EFFECT_1).TriggerSpell, true); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_westfall_reaping_blows::HandlePeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + +// 79436 - Wake Harvest Golem +class spell_westfall_wake_harvest_golem : public SpellScript +{ + SpellCastResult CheckTarget() + { + Unit* target = GetExplTargetUnit(); + if (!target || !target->IsCreature()) + return SPELL_FAILED_BAD_TARGETS; + + return SPELL_CAST_OK; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (!caster || !caster->IsPlayer()) + return; + + if (Creature* target = GetHitCreature()) + { + caster->ToPlayer()->KilledMonsterCredit(Creatures::OverloadedHarvestGolem); + target->DespawnOrUnsummon(100ms); + } + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_westfall_wake_harvest_golem::CheckTarget); + OnEffectHitTarget += SpellEffectFn(spell_westfall_wake_harvest_golem::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; +} + void AddSC_westfall() { + using namespace Scripts::EasternKingdoms::Westfall; + + // Creature + RegisterCreatureAI(npc_westfall_overloaded_harvest_golem); + + // Spells RegisterSpellScript(spell_westfall_unbound_energy); + RegisterSpellScript(spell_westfall_reaping_blows); + RegisterSpellScript(spell_westfall_wake_harvest_golem); } |