Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-05-02 16:50:45 +08:00
138 changed files with 4062 additions and 3707 deletions
@@ -0,0 +1,7 @@
-- DB update 2025_04_17_01 -> 2025_04_19_00
-- replace noblegarden gameobject script by spell script
UPDATE `gameobject_template` SET `ScriptName` = '' WHERE (`ScriptName` = 'go_noblegarden_colored_egg') AND (`entry` BETWEEN 113768 AND 113772);
-- 61712 Summon Noblegarden Bunny Controller
DELETE FROM `spell_script_names` WHERE (`spell_id` = 61712) AND (`ScriptName` = 'spell_summon_noblegarden_bunny_controller');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (61712, 'spell_summon_noblegarden_bunny_controller');
@@ -0,0 +1,40 @@
-- DB update 2025_04_19_00 -> 2025_04_20_00
DELETE FROM `creature_loot_template` WHERE `Reference` = 34092;
UPDATE `creature_loot_template` SET `Chance` = 10 WHERE `Reference` = 34091;
DELETE FROM `reference_loot_template` WHERE `Entry` IN (34091, 34092);
INSERT INTO `reference_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(34091, 35186, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Annihilator Holo-Gogs'),
(34091, 35187, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Justicebringer 3000 Specs'),
(34091, 35189, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Powerheal 9000 Lens'),
(34091, 35190, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Hyper-Magnified Moon Specs'),
(34091, 35191, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Wonderheal XT68 Shades'),
(34091, 35192, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Primal-Attuned Goggles'),
(34091, 35193, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Lightning Etched Specs'),
(34091, 35194, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Surestrike Goggles v3.0'),
(34091, 35195, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Mayhem Projection Goggles'),
(34091, 35196, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Hard Khorium Goggles'),
(34091, 35197, 0, 0, 0, 1, 1, 1, 1, 'Schematic: Quad Deathblow X44 Goggles'),
(34091, 35198, 0, 0, 0, 1, 1, 1, 1, 'Design: Loop of Forged Power'),
(34091, 35199, 0, 0, 0, 1, 1, 1, 1, 'Design: Ring of Flowing Life'),
(34091, 35200, 0, 0, 0, 1, 1, 1, 1, 'Design: Hard Khorium Band'),
(34091, 35201, 0, 0, 0, 1, 1, 1, 1, 'Design: Pendant of Sunfire'),
(34091, 35202, 0, 0, 0, 1, 1, 1, 1, 'Design: Amulet of Flowing Life'),
(34091, 35203, 0, 0, 0, 1, 1, 1, 1, 'Design: Hard Khorium Choker'),
(34091, 35204, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sunfire Handwraps'),
(34091, 35205, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Hands of Eternal Light'),
(34091, 35206, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sunfire Robe'),
(34091, 35207, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Robe of Eternal Light'),
(34091, 35208, 0, 0, 0, 1, 1, 1, 1, 'Plans: Sunblessed Gauntlets'),
(34091, 35209, 0, 0, 0, 1, 1, 1, 1, 'Plans: Hard Khorium Battlefists'),
(34091, 35210, 0, 0, 0, 1, 1, 1, 1, 'Plans: Sunblessed Breastplate'),
(34091, 35211, 0, 0, 0, 1, 1, 1, 1, 'Plans: Hard Khorium Battleplate'),
(34091, 35212, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Leather Gauntlets of the Sun'),
(34091, 35213, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Flethcher''s Gloves of the Phoenix'),
(34091, 35214, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Gloves of Immortal Dusk'),
(34091, 35215, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sun-Drenched Scale Gloves'),
(34091, 35216, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Leather Chestguard of the Sun'),
(34091, 35217, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Embrace of the Phoenix'),
(34091, 35218, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Carapace of Sun and Shadow'),
(34091, 35219, 0, 0, 0, 1, 1, 1, 1, 'Pattern: Sun-Drenched Scale Chestguard'),
(34091, 35273, 0, 0, 0, 1, 1, 1, 1, 'Study of Advanced Smelting');
@@ -0,0 +1,73 @@
-- DB update 2025_04_20_00 -> 2025_04_20_01
DELETE FROM `arena_season_reward_group` WHERE `arena_season` IN (1, 2, 3, 4);
INSERT INTO `arena_season_reward_group` (`id`, `arena_season`, `criteria_type`, `min_criteria`, `max_criteria`, `reward_mail_template_id`, `reward_mail_subject`, `reward_mail_body`, `gold_reward`) VALUES
-- Season 4 (Brutal)
(21, 4, 'abs', 1, 1, 0, '', '', 0),
(22, 4, 'pct', 0, 0.5, 262, '', '', 0),
(23, 4, 'pct', 0.5, 3, 0, '', '', 0),
(24, 4, 'pct', 3, 10, 0, '', '', 0),
(25, 4, 'pct', 10, 35, 0, '', '', 0),
-- Season 3 (Vengeful)
(26, 3, 'abs', 1, 1, 0, '', '', 0),
(27, 3, 'pct', 0, 0.5, 211, '', '', 0),
(28, 3, 'pct', 0.5, 3, 0, '', '', 0),
(29, 3, 'pct', 3, 10, 0, '', '', 0),
(30, 3, 'pct', 10, 35, 0, '', '', 0),
-- Season 2 (Merciless)
(31, 2, 'abs', 1, 1, 0, '', '', 0),
(32, 2, 'pct', 0, 0.5, 0, 'Congratulations!', 'On behalf of the Steamwheedle Fighting Circuit, we congratulate you for your successes in this arena season.$B$BIn recognition of your skill and savagery, we hereby bestow upon you this Merciless Nether Drake. May it serve you well.', 0),
(33, 2, 'pct', 0.5, 3, 0, '', '', 0),
(34, 2, 'pct', 3, 10, 0, '', '', 0),
(35, 2, 'pct', 10, 35, 0, '', '', 0),
-- Season 1
(36, 1, 'pct', 0, 0.5, 0, 'Congratulations!', 'On behalf of the Steamwheedle Fighting Circuit, we congratulate you for your successes in this arena season.$B$BIn recognition of your skill and savagery, we hereby bestow upon you this Swift Nether Drake. May it serve you well.', 0),
(37, 1, 'pct', 0.5, 3, 0, '', '', 0),
(38, 1, 'pct', 3, 10, 0, '', '', 0),
(39, 1, 'pct', 10, 35, 0, '', '', 0);
DELETE FROM `arena_season_reward` WHERE `group_id` IN (1, 6, 11, 16, 21, 22, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 32, 33, 34, 35, 36, 36, 37, 38, 39);
INSERT INTO `arena_season_reward` (`group_id`, `type`, `entry`) VALUES
-- Season 8 (Wrathful)
(1, 'achievement', 4599),
-- Season 7 (Relentless)
(6, 'achievement', 3758),
-- Season 6 (Furious)
(11, 'achievement', 3436),
-- Season 5 (Deadly)
(16, 'achievement', 3336),
-- Season 4 (Brutal)
(21, 'achievement', 420),
(22, 'item', 43516),
(22, 'achievement', 2091),
(23, 'achievement', 2092),
(24, 'achievement', 2093),
(25, 'achievement', 2090),
-- Season 3 (Vengeful)
(26, 'achievement', 419),
(27, 'item', 37676),
(27, 'achievement', 2091),
(28, 'achievement', 2092),
(29, 'achievement', 2093),
(30, 'achievement', 2090),
-- Season 2 (Merciless)
(31, 'achievement', 418),
(32, 'item', 34092),
(32, 'achievement', 2091),
(33, 'achievement', 2092),
(34, 'achievement', 2093),
(35, 'achievement', 2090),
-- Season 1
(36, 'item', 30609),
(36, 'achievement', 2091),
(37, 'achievement', 2092),
(38, 'achievement', 2093),
(39, 'achievement', 2090);
DELETE FROM `achievement_reward` WHERE `ID` IN (418, 419, 420, 3436, 3758, 4599);
INSERT INTO `achievement_reward` (`ID`, `TitleA`, `TitleH`, `ItemID`, `Sender`, `Subject`, `Body`, `MailTemplateID`) VALUES
(418, 62, 62, 0, 0, '', '', 0),
(419, 71, 71, 0, 0, '', '', 0),
(420, 80, 80, 0, 0, '', '', 0),
(3436, 167, 167, 0, 0, '', '', 0),
(3758, 169, 169, 0, 0, '', '', 0),
(4599, 177, 177, 0, 0, '', '', 0);
@@ -0,0 +1,5 @@
-- DB update 2025_04_20_01 -> 2025_04_25_00
--
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 25824) AND (`source_type` = 0) AND (`id` IN (2));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(25824, 0, 2, 0, 7, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Void Spawn - On Evade - Despawn Instant');
@@ -0,0 +1,6 @@
-- DB update 2025_04_25_00 -> 2025_04_25_01
-- blue dragon 25% haste aura
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 45856 AND `spell_effect` = 49725;
INSERT INTO `spell_linked_spell`
(`spell_trigger`, `spell_effect`, `type`, `comment`)
VALUES(45856, 49725, 1, 'Power of the Blue Flight - Breath: Haste');
@@ -0,0 +1,38 @@
-- DB update 2025_04_25_01 -> 2025_04_26_00
-- Set Not Selectable for dead bodies inside Scarlet Tavern
UPDATE `creature` SET `unit_flags` = `unit_flags` |33554432 WHERE (`id1` IN(28610, 28939, 28940, 28941, 28942)) AND (`guid` IN(129664, 129682, 129683, 129727, 129769, 130001, 130002));
-- Set Timed Action List for reset (to prevent total aura resets)
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2894103) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(2894103, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52262, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Cornered and Enraged!\''),
(2894103, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 51604, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Serverside - Stun Self\''),
(2894103, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52716, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Terrified\''),
(2894103, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Set Reactstate Aggressive');
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2894203) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 3));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(2894203, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52262, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Cornered and Enraged!\''),
(2894203, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 51604, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Serverside - Stun Self\''),
(2894203, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 28, 52716, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Remove Aura \'Terrified\''),
(2894203, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - Actionlist - Set Reactstate Aggressive');
-- Set SmartAI for Citizen of New Avalon
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28941;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28941);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28941, 0, 0, 0, 4, 0, 100, 512, 0, 0, 0, 0, 0, 0, 87, 2894100, 2894101, 2894102, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aggro - Run Random Script'),
(28941, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2894103, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Reset - Run Script'),
(28941, 0, 2, 3, 23, 1, 100, 0, 52716, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Evade (Phase 1)'),
(28941, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Set Event Phase 0 (Phase 1)');
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28942;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28942);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28942, 0, 0, 0, 4, 0, 100, 512, 0, 0, 0, 0, 0, 0, 87, 2894100, 2894101, 2894102, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aggro - Run Random Script'),
(28942, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2894103, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Reset - Run Script'),
(28942, 0, 2, 3, 23, 1, 100, 0, 52716, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Evade (Phase 1)'),
(28942, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Citizen of New Avalon - On Aura \'Terrified\' - Set Event Phase 0 (Phase 1)');
+108
View File
@@ -0,0 +1,108 @@
-- DB update 2025_04_26_00 -> 2025_04_29_00
-- Add Waypoint for Knight Commander Plaguefist (sniffed)
DELETE FROM `waypoint_data` WHERE `id` IN (12994700);
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
(12994700, 1, 1369.2288, -5721.9683, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 2, 1361.9355, -5725.302, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 3, 1353.9138, -5723.0273, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 4, 1348.8505, -5717.2407, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 5, 1353.9138, -5723.0273, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 6, 1361.9355, -5725.302, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 7, 1369.2288, -5721.9683, 136.41475, NULL, 0, 0, 0, 100, 0),
(12994700, 8, 1380.4694, -5711.5713, 136.48778, NULL, 0, 0, 0, 100, 0);
-- Set Spawn Point and path id for Plaguefist
UPDATE `creature` SET `position_x` = 1380.4694, `position_y` = -5711.5713, `position_z` = 136.48778, `MovementType` = 2 WHERE (`id1` IN(29053)) AND (`guid` IN(129947));
DELETE FROM `creature_addon` WHERE (`guid` IN (129947));
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
(129947, 12994700, 0, 0, 0, 0, 0, NULL);
-- Set Rooted on triggers (sniffed)
UPDATE `creature_template_movement` SET `Rooted` = 1 WHERE (`CreatureId` = 29038);
-- Update Triggers' positions (sniffed)
UPDATE `creature` SET `wander_distance` = 0, `MovementType` = 0 WHERE (`id1` = 29038);
UPDATE `creature` SET `position_x` = 1382.6744, `position_y` = -5700.4575, `position_z` = 156.20384, `orientation` = 2.40855, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129906));
UPDATE `creature` SET `position_x` = 1366.528, `position_y` = -5701.2534, `position_z` = 147.08313, `orientation` = 1.30899, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129907));
UPDATE `creature` SET `position_x` = 1365.096, `position_y` = -5699.7446, `position_z` = 138.45604, `orientation` = 5.04400, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129908));
UPDATE `creature` SET `position_x` = 1371.1465, `position_y` = -5705.8774, `position_z` = 136.49808, `orientation` = 5.25344, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129909));
UPDATE `creature` SET `position_x` = 1384.8456, `position_y` = -5699.0986, `position_z` = 138.05069, `orientation` = 1.78023, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129910));
UPDATE `creature` SET `position_x` = 1386.3185, `position_y` = -5704.4565, `position_z` = 137.52542, `orientation` = 2.16420, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129911));
UPDATE `creature` SET `position_x` = 1373.8696, `position_y` = -5698.5435, `position_z` = 162.48119, `orientation` = 2.33874, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129912));
UPDATE `creature` SET `position_x` = 1380.1602, `position_y` = -5701.692, `position_z` = 164.21506, `orientation` = 5.16617, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129913));
UPDATE `creature` SET `position_x` = 1375.4838, `position_y` = -5700.0117, `position_z` = 150.63083, `orientation` = 3.82227, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129914));
UPDATE `creature` SET `position_x` = 1376.7048, `position_y` = -5700.71, `position_z` = 138.45558, `orientation` = 3.49065, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129915));
UPDATE `creature` SET `position_x` = 1369.781, `position_y` = -5702.2817, `position_z` = 138.52371, `orientation` = 0.94247, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129916));
UPDATE `creature` SET `position_x` = 1370.8365, `position_y` = -5700.444, `position_z` = 148.90135, `orientation` = 5.68977, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129917));
UPDATE `creature` SET `position_x` = 1383.7201, `position_y` = -5700.9634, `position_z` = 145.79176, `orientation` = 1.46607, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129918));
UPDATE `creature` SET `position_x` = 1372.7944, `position_y` = -5705.7993, `position_z` = 147.11938, `orientation` = 2.72271, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129919));
UPDATE `creature` SET `position_x` = 1363.2407, `position_y` = -5699.7573, `position_z` = 148.0276, `orientation` = 0.82030, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129920));
UPDATE `creature` SET `position_x` = 1381.6825, `position_y` = -5694.4004, `position_z` = 151.04852, `orientation` = 4.92182, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129921));
UPDATE `creature` SET `position_x` = 1376.7838, `position_y` = -5694.987, `position_z` = 164.34004, `orientation` = 1.18682, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129922));
UPDATE `creature` SET `position_x` = 1382.9271, `position_y` = -5696.133, `position_z` = 164.35858, `orientation` = 6.07374, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129923));
UPDATE `creature` SET `position_x` = 1381.9062, `position_y` = -5699.478, `position_z` = 165.0547, `orientation` = 6.16101, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129924));
UPDATE `creature` SET `position_x` = 1353.2142, `position_y` = -5691.629, `position_z` = 138.42285, `orientation` = 4.41568, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129925));
UPDATE `creature` SET `position_x` = 1360.2578, `position_y` = -5696.7036, `position_z` = 138.42085, `orientation` = 0.73303, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129926));
UPDATE `creature` SET `position_x` = 1361.8759, `position_y` = -5694.812, `position_z` = 148.35965, `orientation` = 1.04719, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129927));
UPDATE `creature` SET `position_x` = 1378.0033, `position_y` = -5691.8677, `position_z` = 151.09659, `orientation` = 5.89921, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129928));
UPDATE `creature` SET `position_x` = 1356.3627, `position_y` = -5690.5327, `position_z` = 148.52733, `orientation` = 3.35103, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129929));
UPDATE `creature` SET `position_x` = 1367.5154, `position_y` = -5683.803, `position_z` = 150.42963, `orientation` = 5.41052, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129930));
UPDATE `creature` SET `position_x` = 1357.8496, `position_y` = -5694.9785, `position_z` = 147.40619, `orientation` = 3.00196, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129931));
UPDATE `creature` SET `position_x` = 1365.8773, `position_y` = -5689.083, `position_z` = 151.89368, `orientation` = 0.48869, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129932));
UPDATE `creature` SET `position_x` = 1352.3483, `position_y` = -5689.826, `position_z` = 147.72693, `orientation` = 4.71238, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129933));
UPDATE `creature` SET `position_x` = 1384.1615, `position_y` = -5686.4473, `position_z` = 136.17474, `orientation` = 0.59341, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129934));
UPDATE `creature` SET `position_x` = 1374.2194, `position_y` = -5687.5293, `position_z` = 150.03831, `orientation` = 3.71755, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129935));
UPDATE `creature` SET `position_x` = 1372.7466, `position_y` = -5693.947, `position_z` = 152.32385, `orientation` = 2.35619, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129936));
UPDATE `creature` SET `position_x` = 1368.3043, `position_y` = -5694.866, `position_z` = 150.27689, `orientation` = 5.75958, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129937));
UPDATE `creature` SET `position_x` = 1377.7802, `position_y` = -5682.7607, `position_z` = 138.39493, `orientation` = 1.93731, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129938));
UPDATE `creature` SET `position_x` = 1383.7242, `position_y` = -5689.474, `position_z` = 148.14038, `orientation` = 1.51843, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129939));
UPDATE `creature` SET `position_x` = 1355.9176, `position_y` = -5680.996, `position_z` = 138.38802, `orientation` = 4.46804, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129940));
UPDATE `creature` SET `position_x` = 1351.64, `position_y` = -5685.475, `position_z` = 135.25368, `orientation` = 3.87463, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129941));
UPDATE `creature` SET `position_x` = 1354.3893, `position_y` = -5686.206, `position_z` = 150.09084, `orientation` = 5.68977, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129942));
UPDATE `creature` SET `position_x` = 1360.0142, `position_y` = -5679.5996, `position_z` = 151.54948, `orientation` = 4.59021, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129943));
UPDATE `creature` SET `position_x` = 1369.0516, `position_y` = -5675.592, `position_z` = 135.7965, `orientation` = 0.19198, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129944));
UPDATE `creature` SET `position_x` = 1367.1002, `position_y` = -5677.607, `position_z` = 148.00508, `orientation` = 3.96189, `VerifiedBuild` = 60192 WHERE (`id1` IN(29038)) AND (`guid` IN(129945));
-- Edit SmartAI for Triggers
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29038;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29038);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(29038, 0, 0, 0, 8, 0, 100, 0, 52953, 0, 12000, 14000, 0, 0, 11, 52955, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, '[Chapter II] Torch Toss Dummy - On Spellhit \'Torch\' - Cast \'Torch\'');
-- Add condition for spell torch (Its target must be only a trigger)
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceGroup` = 1) AND (`SourceEntry` = 52953) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` = 24) AND (`ConditionTarget` = 0) AND (`ConditionValue1` = 10) AND (`ConditionValue2` = 0) AND (`ConditionValue3` = 0);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(13, 1, 52953, 0, 0, 24, 0, 10, 0, 0, 0, 0, 0, '', '');
-- Add SmartAI on Death Knights near the Chapel
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28030;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29030);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(29030, 0, 0, 0, 1, 0, 100, 0, 4000, 10000, 8000, 14000, 0, 0, 11, 52953, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - Out of Combat - Cast \'Torch\''),
(29030, 0, 1, 0, 31, 0, 100, 0, 52953, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - On Target Spellhit \'Torch\' - Play Emote 4'),
(29030, 0, 2, 0, 0, 0, 100, 0, 4000, 6000, 8000, 12000, 0, 0, 11, 52372, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Icy Touch\''),
(29030, 0, 3, 0, 0, 0, 100, 0, 3000, 5000, 8000, 12000, 0, 0, 11, 52373, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Plague Strike\''),
(29030, 0, 4, 0, 0, 0, 100, 0, 4000, 8000, 4000, 8000, 0, 0, 11, 52374, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Blood Strike\'');
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29031;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 29031);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(29031, 0, 0, 0, 1, 0, 100, 0, 4000, 10000, 8000, 14000, 0, 0, 11, 52953, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - Out of Combat - Cast \'Torch\''),
(29031, 0, 1, 0, 31, 0, 100, 0, 52953, 0, 0, 0, 0, 0, 5, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - On Target Spellhit \'Torch\' - Play Emote 4'),
(29031, 0, 2, 0, 0, 0, 100, 0, 4000, 6000, 8000, 12000, 0, 0, 11, 52372, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Icy Touch\''),
(29031, 0, 3, 0, 0, 0, 100, 0, 3000, 5000, 8000, 12000, 0, 0, 11, 52373, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Plague Strike\''),
(29031, 0, 4, 0, 0, 0, 100, 0, 4000, 8000, 4000, 8000, 0, 0, 11, 52374, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Blood Strike\'');
-- Set SmartAI for Death Knights inside the tavern.
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 28934;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 28934);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(28934, 0, 0, 0, 0, 0, 100, 0, 4000, 6000, 8000, 12000, 0, 0, 11, 52372, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Icy Touch\''),
(28934, 0, 1, 0, 0, 0, 100, 0, 3000, 5000, 8000, 12000, 0, 0, 11, 52373, 32, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Plague Strike\''),
(28934, 0, 2, 0, 0, 0, 100, 0, 4000, 8000, 4000, 8000, 0, 0, 11, 52374, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Blood Strike\''),
(28934, 0, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52375, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight - In Combat - Cast \'Death Coil\'');
@@ -0,0 +1,4 @@
-- DB update 2025_04_29_00 -> 2025_04_29_01
-- Active SmartAI for female DKs.
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 29030;
@@ -0,0 +1,4 @@
-- DB update 2025_04_29_01 -> 2025_04_30_00
--
DELETE FROM `spell_script_names` WHERE `spell_id` = 46771 and `ScriptName` = 'spell_eredar_twins_flame_sear';
INSERT INTO `spell_script_names` VALUES (46771,'spell_eredar_twins_flame_sear');
@@ -0,0 +1,96 @@
-- DB update 2025_04_30_00 -> 2025_04_30_01
DELETE FROM `creature_template_locale` WHERE `locale`='ruRU' AND `entry` IN (5927, 7424, 7425, 15487, 31169, 31170, 6012, 7423, 10557, 15485, 31132, 31158, 31133, 7412, 7413, 15486, 31171, 31172, 3906, 3907, 3908, 3909, 15488, 31181, 31182, 31185, 7464, 7465, 7466, 15484, 31166, 31167, 7414, 7415, 7416, 15489, 31186, 31189, 31190, 7468, 7469, 15490, 31173, 31174, 3902, 3903, 3904, 7400, 7402, 15480, 31162, 31164, 31165, 3911, 3912, 3913, 7398, 7399, 15478, 31120, 31121, 31122, 5919, 5920, 7366, 7367, 7368, 15470, 15474, 31175, 31176, 5921, 5922, 7403, 15464, 15479, 30647, 31129, 7483, 7484, 15496, 15497, 11100, 11101, 17061, 7486, 7487, 15463, 30654, 9687, 9688, 9689, 15492);
INSERT INTO `creature_template_locale` (`entry`, `locale`, `Name`, `Title`, `VerifiedBuild`) VALUES
(5927, 'ruRU', 'Тотем сопротивления огню', '', 0),
(7424, 'ruRU', 'Тотем сопротивления огню II', '', 0),
(7425, 'ruRU', 'Тотем сопротивления огню III', '', 0),
(15487, 'ruRU', 'Тотем сопротивления огню IV', '', 0),
(31169, 'ruRU', 'Тотем сопротивления огню V', '', 0),
(31170, 'ruRU', 'Тотем сопротивления огню VI', '', 0),
(6012, 'ruRU', 'Тотем языка пламени II', '', 0),
(7423, 'ruRU', 'Тотем языка пламени III', '', 0),
(10557, 'ruRU', 'Тотем языка пламени IV', '', 0),
(15485, 'ruRU', 'Тотем языка пламени V', '', 0),
(31132, 'ruRU', 'Тотем языка пламени VI', '', 0),
(31158, 'ruRU', 'Тотем языка пламени VII', '', 0),
(31133, 'ruRU', 'Тотем языка пламени VIII', '', 0),
(7412, 'ruRU', 'Тотем сопротивления льду II', '', 0),
(7413, 'ruRU', 'Тотем сопротивления льду III', '', 0),
(15486, 'ruRU', 'Тотем сопротивления льду IV', '', 0),
(31171, 'ruRU', 'Тотем сопротивления льду V', '', 0),
(31172, 'ruRU', 'Тотем сопротивления льду VI', '', 0),
(3906, 'ruRU', 'Тотем исцеляющего потока II', '', 0),
(3907, 'ruRU', 'Тотем исцеляющего потока III', '', 0),
(3908, 'ruRU', 'Тотем исцеляющего потока IV', '', 0),
(3909, 'ruRU', 'Тотем исцеляющего потока V', '', 0),
(15488, 'ruRU', 'Тотем исцеляющего потока VI', '', 0),
(31181, 'ruRU', 'Тотем исцеляющего потока VII', '', 0),
(31182, 'ruRU', 'Тотем исцеляющего потока VIII', '', 0),
(31185, 'ruRU', 'Тотем исцеляющего потока IX', '', 0),
(7464, 'ruRU', 'Тотем магмы II', '', 0),
(7465, 'ruRU', 'Тотем магмы III', '', 0),
(7466, 'ruRU', 'Тотем магмы IV', '', 0),
(15484, 'ruRU', 'Тотем магмы V', '', 0),
(31166, 'ruRU', 'Тотем магмы VI', '', 0),
(31167, 'ruRU', 'Тотем магмы VII', '', 0),
(7414, 'ruRU', 'Тотем источника маны II', '', 0),
(7415, 'ruRU', 'Тотем источника маны III', '', 0),
(7416, 'ruRU', 'Тотем источника маны IV', '', 0),
(15489, 'ruRU', 'Тотем источника маны V', '', 0),
(31186, 'ruRU', 'Тотем источника маны VI', '', 0),
(31189, 'ruRU', 'Тотем источника маны VII', '', 0),
(31190, 'ruRU', 'Тотем источника маны VIII', '', 0),
(7468, 'ruRU', 'Тотем сопротивления силам природы II', '', 0),
(7469, 'ruRU', 'Тотем сопротивления силам природы III', '', 0),
(15490, 'ruRU', 'Тотем сопротивления силам природы IV', '', 0),
(31173, 'ruRU', 'Тотем сопротивления силам природы V', '', 0),
(31174, 'ruRU', 'Тотем сопротивления силам природы VI', '', 0),
(3902, 'ruRU', 'Опаляющий тотем II', '', 0),
(3903, 'ruRU', 'Опаляющий тотем III', '', 0),
(3904, 'ruRU', 'Опаляющий тотем IV', '', 0),
(7400, 'ruRU', 'Опаляющий тотем V', '', 0),
(7402, 'ruRU', 'Опаляющий тотем VI', '', 0),
(15480, 'ruRU', 'Опаляющий тотем VII', '', 0),
(31162, 'ruRU', 'Опаляющий тотем VIII', '', 0),
(31164, 'ruRU', 'Опаляющий тотем IX', '', 0),
(31165, 'ruRU', 'Опаляющий тотем X', '', 0),
(3911, 'ruRU', 'Тотем каменного когтя II', '', 0),
(3912, 'ruRU', 'Тотем каменного когтя III', '', 0),
(3913, 'ruRU', 'Тотем каменного когтя IV', '', 0),
(7398, 'ruRU', 'Тотем каменного когтя V', '', 0),
(7399, 'ruRU', 'Тотем каменного когтя VI', '', 0),
(15478, 'ruRU', 'Тотем каменного когтя VII', '', 0),
(31120, 'ruRU', 'Тотем каменного когтя VIII', '', 0),
(31121, 'ruRU', 'Тотем каменного когтя IX', '', 0),
(31122, 'ruRU', 'Тотем каменного когтя X', '', 0),
(5919, 'ruRU', 'Тотем каменной кожи II', '', 0),
(5920, 'ruRU', 'Тотем каменной кожи III', '', 0),
(7366, 'ruRU', 'Тотем каменной кожи IV', '', 0),
(7367, 'ruRU', 'Тотем каменной кожи V', '', 0),
(7368, 'ruRU', 'Тотем каменной кожи VI', '', 0),
(15470, 'ruRU', 'Тотем каменной кожи VII', '', 0),
(15474, 'ruRU', 'Тотем каменной кожи VIII', '', 0),
(31175, 'ruRU', 'Тотем каменной кожи IX', '', 0),
(31176, 'ruRU', 'Тотем каменной кожи X', '', 0),
(5921, 'ruRU', 'Тотем силы земли II', '', 0),
(5922, 'ruRU', 'Тотем силы земли III', '', 0),
(7403, 'ruRU', 'Тотем силы земли IV', '', 0),
(15464, 'ruRU', 'Тотем силы земли V', '', 0),
(15479, 'ruRU', 'Тотем силы земли VI', '', 0),
(30647, 'ruRU', 'Тотем силы земли VII', '', 0),
(31129, 'ruRU', 'Тотем силы земли VIII', '', 0),
(7483, 'ruRU', 'Тотем неистовства ветра II', '', 0),
(7484, 'ruRU', 'Тотем неистовства ветра III', '', 0),
(15496, 'ruRU', 'Тотем неистовства ветра IV', '', 0),
(15497, 'ruRU', 'Тотем неистовства ветра V', '', 0),
(11100, 'ruRU', 'Тотем прилива маны II', '', 0),
(11101, 'ruRU', 'Тотем прилива маны III', '', 0),
(17061, 'ruRU', 'Тотем прилива маны IV', '', 0),
(7486, 'ruRU', 'Тотем легкости воздуха', '', 0),
(7487, 'ruRU', 'Тотем легкости воздуха II', '', 0),
(15463, 'ruRU', 'Тотем легкости воздуха III', '', 0),
(30654, 'ruRU', 'Тотем гнева IV', '', 0),
(9687, 'ruRU', 'Тотем стены ветра', '', 0),
(9688, 'ruRU', 'Тотем стены ветра II', '', 0),
(9689, 'ruRU', 'Тотем стены ветра III', '', 0),
(15492, 'ruRU', 'Тотем стены ветра IV', '', 0);
@@ -0,0 +1,4 @@
-- DB update 2025_04_30_01 -> 2025_04_30_02
--
DELETE FROM `spell_group` WHERE `id` = 1005 AND `spell_id` = 23060;
INSERT INTO `spell_group` VALUES (1005, 23060, 0);
@@ -0,0 +1,12 @@
-- DB update 2025_04_30_02 -> 2025_04_30_03
--
DELETE FROM `spell_group` WHERE `id` = 1024;
DELETE FROM `spell_group_stack_rules` WHERE `group_id` = 1024;
DELETE FROM `spell_group` WHERE `id` = 1019 AND `spell_id` IN (1243,8099,21562,23947,23948,46302,72590);
INSERT INTO `spell_group` VALUES (1019, 1243, 0),
(1019, 8099, 0),
(1019, 21562, 0),
(1019, 23947, 0),
(1019, 23948, 0),
(1019, 46302, 0),
(1019, 72590, 0);
@@ -0,0 +1,3 @@
-- DB update 2025_04_30_03 -> 2025_04_30_04
--
DELETE FROM `spell_dbc` WHERE `ID` IN (75, 1454, 1455, 1456, 11687, 11688, 11689, 27222, 57946, 4074, 4511, 7922, 9457, 10732, 20252, 20253, 20335, 20336, 20337, 22736, 23272, 30298, 33271, 36500, 39183, 47747, 49214, 54469, 58620, 58621, 60474, 64382);
@@ -0,0 +1,29 @@
-- DB update 2025_04_30_04 -> 2025_04_30_05
--
SET @SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS := 268435456;
SET @SPELL_ATTR5_ALLOW_WHILE_STUNNED := 8;
SET @SPELL_ATTR2_IGNORE_LINE_OF_SIGHT := 4;
-- Update server-side spell 43360 - model after 41295 Fixate
UPDATE `spell_dbc` SET
`AttributesEx2`= `AttributesEx2` & ~(@SPELL_ATTR2_IGNORE_LINE_OF_SIGHT),
`AttributesEx3`= `AttributesEx3` | @SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS,
`AttributesEx5`= `AttributesEx5` | @SPELL_ATTR5_ALLOW_WHILE_STUNNED,
`RangeIndex` = 36,
`Effect_1` = 6,
`EffectRadiusIndex_1` = 27,
`EffectAura_1` = 11,
`SpellIconID` = 1,
`ImplicitTargetA_1` = 7,
`Description_Lang_enUS` = 'The target is fixated upon the caster.',
`Name_Lang_enUS`='Fixate'
WHERE `ID` = 43360;
DELETE FROM `spell_script_names` WHERE `spell_id` = 43359 AND `ScriptName` = 'spell_call_of_the_beast';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES(43359, 'spell_call_of_the_beast');
-- Amani'shi Beast Tamer
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24059;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24059);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(24059, 0, 0, 0, 0, 0, 100, 0, 8000, 12000, 10000, 15000, 0, 0, 11, 43359, 0, 0, 0, 0, 0, 5, 100, 1, 0, 43359, 0, 0, 0, 0, 'Amani\'shi Beast Tamer - In Combat - Cast \'Call of the Beast\''),
(24059, 0, 1, 0, 0, 0, 100, 0, 6000, 12000, 9000, 18000, 0, 0, 11, 43361, 0, 0, 0, 0, 0, 5, 100, 1, 0, 0, 0, 0, 0, 0, 'Amani\'shi Beast Tamer - In Combat - Cast \'Domesticate\'');
@@ -0,0 +1,72 @@
-- DB update 2025_04_30_05 -> 2025_05_01_00
-- Add waypoints
DELETE FROM `waypoint_data` WHERE `id` IN ("12921200");
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
("12921200", 1, 2212.1313, -5812.2856, 101.33683, NULL, 0, 0, 0, 100, 0),
("12921200", 2, 2204.9878, -5801.3545, 101.352875, NULL, 0, 0, 0, 100, 0),
("12921200", 3, 2183.3723, -5812.831, 101.349945, NULL, 0, 0, 0, 100, 0),
("12921200", 4, 2178.0305, -5838.2285, 101.35527, NULL, 0, 0, 0, 100, 0),
("12921200", 5, 2187.962, -5859.553, 101.332436, NULL, 0, 0, 0, 100, 0),
("12921200", 6, 2221.1243, -5861.5303, 101.47864, NULL, 0, 0, 0, 100, 0),
("12921200", 7, 2250.3555, -5834.3096, 101.25951, NULL, 0, 0, 0, 100, 0),
("12921200", 8, 2217.0012, -5826.042, 101.37887, NULL, 0, 0, 0, 100, 0),
("12921200", 9, 2191.5737, -5828.108, 101.93167, NULL, 0, 0, 0, 100, 0),
("12921200", 10, 2199.251, -5852.3496, 101.37288, NULL, 0, 0, 0, 100, 0),
("12921200", 11, 2225.122, -5850.7876, 101.233604, NULL, 0, 0, 0, 100, 0),
("12921200", 12, 2252.0554, -5834.1104, 101.232346, NULL, 0, 0, 0, 100, 0),
("12921200", 13, 2246.5051, -5829.7847, 101.24832, NULL, 0, 0, 0, 100, 0),
("12921200", 14, 2221.6838, -5823.5996, 101.55388, NULL, 0, 0, 0, 100, 0);
DELETE FROM `waypoint_data` WHERE `id` IN ("12921000");
INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES
("12921000", 1, 2222.3447, -5818.2954, 101.58636, NULL, 0, 0, 0, 100, 0),
("12921000", 2, 2193.6536, -5804.279, 101.345184, NULL, 0, 0, 0, 100, 0),
("12921000", 3, 2190.4019, -5833.695, 101.39836, NULL, 0, 0, 0, 100, 0),
("12921000", 4, 2192.386, -5848.4937, 101.35042, NULL, 0, 0, 0, 100, 0),
("12921000", 5, 2202.781, -5858.187, 101.56625, NULL, 0, 0, 0, 100, 0),
("12921000", 6, 2217.3516, -5860.6836, 101.396805, NULL, 0, 0, 0, 100, 0),
("12921000", 7, 2228.4097, -5858.6533, 101.26566, NULL, 0, 0, 0, 100, 0),
("12921000", 8, 2233.331, -5851.655, 101.59271, NULL, 0, 0, 0, 100, 0);
-- Remove Wrong guids (Havenshire Stallion, Mare, Colt).
DELETE FROM `creature` WHERE (`id1` = 28605) AND (`guid` IN (129216, 129217));
DELETE FROM `creature` WHERE (`id1` = 28606) AND (`guid` IN (129237));
DELETE FROM `creature` WHERE (`id1` = 28607) AND (`guid` IN (129252));
DELETE FROM `creature_addon` WHERE (`guid` IN (129237, 129252));
-- Set MT waypoint for Pack Leader
UPDATE `creature` SET `MovementType` = 2 WHERE (`id1` = 28605) AND (`guid` IN (129212));
DELETE FROM `creature_addon` WHERE (`guid` IN (129212));
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
(129212, 12921200, 0, 0, 0, 0, 0, NULL);
-- Add Formation for horse's pack
DELETE FROM `creature_formations` WHERE `leaderGUID` = 129212;
INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
(129212, 129212, 0, 0, 512, 0, 0),
(129212, 129230, 3, 220, 512, 0, 0),
(129212, 129208, 3.5, 160, 512, 0, 0),
(129212, 129243, 4, 200, 512, 0, 0),
(129212, 129234, 4.5, 180, 512, 0, 0);
-- Add comment for the single Horse
UPDATE `creature` SET `Comment` = 'has guid specific SAI' WHERE (`id1` = 28605) AND (`guid` IN (129210));
-- Set Action List
DELETE FROM `smart_scripts` WHERE (`source_type` = 9 AND `entryorguid` = 2860500);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(2860500, 9, 0, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 66, 1, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 1.6, 'Havenshire Stallion - Actionlist - Set Orientation 1.6'),
(2860500, 9, 1, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 5, 377, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - Actionlist - Play Emote 377'),
(2860500, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 136, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - Actionlist - Set Walk Speed to 2.0'),
(2860500, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2232.89, -5840.03, 101.482, 0, 'Havenshire Stallion - Actionlist - Move To Self'),
(2860500, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 97, 10, 10, 1, 0, 0, 0, 202, 0, 0, 1, 0, 2231.45, -5828.9, 101.371, 0, 'Havenshire Stallion - Actionlist - Jump To Pos'),
(2860500, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 232, 12921000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - Actionlist - Start Path 12921000');
-- Set personal SmartAI
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = -129210);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(-129210, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 0, 0, 232, 12921000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - On Respawn - Start Path 12921000'),
(-129210, 0, 1, 2, 108, 0, 100, 0, 8, 12921000, 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - On Point 8 of Path 12921000 Reached - Stop Movement'),
(-129210, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 80, 2860500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Havenshire Stallion - On Point 8 of Path 12921000 Reached - Run Script');
+32 -10
View File
@@ -1,6 +1,6 @@
AzerothCore uses (parts of or in whole) the following opensource software:
argon2
argon2 (The password hash Argon2)
https://github.com/P-H-C/phc-winner-argon2
Version: 62358ba
@@ -14,15 +14,22 @@ bzip2 (a freely available, patent free, high-quality data compressor)
G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License)
http://g3d.sourceforge.net/
Version: 8.01-Release
Version: v9.0 hotfix7
gperftools (Google Performance Tools)
Version: external
jemalloc (a general-purpose scalable concurrent malloc-implementation)
http://www.canonware.com/jemalloc/
Version: 5.0.1
Version: 5.2.1
jsonpath (JSONPath implementation in Bash for filtering, merging and modifying JSON)
https://github.com/mclarkson/JSONPath.sh.git
Version: 0.0.14
libMPQ (a library for reading MPQ files)
https://libmpq.org/
Version: 1.0.4
Version: 0.4.2
libreadline (command line editing library)
https://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
@@ -34,11 +41,26 @@ OpenSSL (general-purpose cryptography library)
MySQL (the world's most popular open source database software)
http://www.mysql.com/
Version: 5.5.9 (GA)
Version: external
semver_bash (bash parser for semantic versioning)
https://github.com/cloudflare/semver_bash/tree/master
Version: c1133faf0efe17767b654b213f212c326df73fa3
SFMT (SIMD-oriented Fast Mersenne Twister)
Based on http://agner.org/random/
Version: 2010-Aug-03
Version: 1.5
sse2neon (A translator from Intel SSE intrinsics to Arm/Aarch64 NEON implementation)
https://github.com/DLTcollab/sse2neon
Location: deps\argon2\argon2\blake2\sse2neon.h
Version: 0c0dee02bb9d9848c294db1179fc278a4649979d
stdfs (filesystem library)
Version: external
threads
Version: external
utf8-cpp (UTF-8 with C++ in a Portable Way)
http://utfcpp.sourceforge.net/
@@ -46,16 +68,16 @@ utf8-cpp (UTF-8 with C++ in a Portable Way)
zlib (A Massively Spiffy Yet Delicately Unobtrusive Compression Library)
http://www.zlib.net/
Version: 1.2.12
Version: 1.3.1
gSOAP (a portable development toolkit for C and C++ XML Web services and XML data bindings)
http://gsoap2.sourceforge.net/
Version: 2.8.10
Version: 2.8.105
recastnavigation (Recast is state of the art navigation mesh construction toolset for games)
https://github.com/memononen/recastnavigation
Version: 64385e9ed0822427bca5814d03a3f4c4d7a6db9f
Version: c40188c796f089f89a42e0b939d934178dbcfc5c
{fmt} is an open-source formatting library providing a fast and safe alternative to C stdio and C++ iostreams.
https://github.com/fmtlib/fmt
Version: 7.1.3
Version: 7.1.3
-1
View File
@@ -1 +0,0 @@
3.6.0-0-g46c0af68bd248b04df75e4f92d5fb804c3d75340
+5 -27
View File
@@ -7,8 +7,6 @@
#include "zutil.h"
local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
@@ -60,11 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#endif
/* ========================================================================= */
uLong ZEXPORT adler32_z(adler, buf, len)
uLong adler;
const Bytef *buf;
z_size_t len;
{
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
unsigned long sum2;
unsigned n;
@@ -131,20 +125,12 @@ uLong ZEXPORT adler32_z(adler, buf, len)
}
/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
return adler32_z(adler, buf, len);
}
/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
unsigned long sum1;
unsigned long sum2;
unsigned rem;
@@ -169,18 +155,10 @@ local uLong adler32_combine_(adler1, adler2, len2)
}
/* ========================================================================= */
uLong ZEXPORT adler32_combine(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off_t len2;
{
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
return adler32_combine_(adler1, adler2, len2);
}
uLong ZEXPORT adler32_combine64(adler1, adler2, len2)
uLong adler1;
uLong adler2;
z_off64_t len2;
{
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
return adler32_combine_(adler1, adler2, len2);
}
+5 -16
View File
@@ -19,13 +19,8 @@
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
int level;
{
int ZEXPORT compress2(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen, int level) {
z_stream stream;
int err;
const uInt max = (uInt)-1;
@@ -65,12 +60,8 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
/* ===========================================================================
*/
int ZEXPORT compress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
{
int ZEXPORT compress(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen) {
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
}
@@ -78,9 +69,7 @@ int ZEXPORT compress (dest, destLen, source, sourceLen)
If the default memLevel or windowBits for deflateInit() is changed, then
this function needs to be updated.
*/
uLong ZEXPORT compressBound (sourceLen)
uLong sourceLen;
{
uLong ZEXPORT compressBound(uLong sourceLen) {
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}
+94 -161
View File
@@ -98,10 +98,6 @@
# endif
#endif
/* Local functions. */
local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
/* If available, use the ARM processor CRC32 instruction. */
#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
# define ARMCRC32
@@ -114,9 +110,7 @@ local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
instruction, if one is available. This assumes that word_t is either 32 bits
or 64 bits.
*/
local z_word_t byte_swap(word)
z_word_t word;
{
local z_word_t byte_swap(z_word_t word) {
# if W == 8
return
(word & 0xff00000000000000) >> 56 |
@@ -137,24 +131,77 @@ local z_word_t byte_swap(word)
}
#endif
#ifdef DYNAMIC_CRC_TABLE
/* =========================================================================
* Table of powers of x for combining CRC-32s, filled in by make_crc_table()
* below.
*/
local z_crc_t FAR x2n_table[32];
#else
/* =========================================================================
* Tables for byte-wise and braided CRC-32 calculations, and a table of powers
* of x for combining CRC-32s, all made by make_crc_table().
*/
# include "crc32.h"
#endif
/* CRC polynomial. */
#define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */
#ifdef DYNAMIC_CRC_TABLE
/*
Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
reflected. For speed, this requires that a not be zero.
*/
local z_crc_t multmodp(z_crc_t a, z_crc_t b) {
z_crc_t m, p;
m = (z_crc_t)1 << 31;
p = 0;
for (;;) {
if (a & m) {
p ^= b;
if ((a & (m - 1)) == 0)
break;
}
m >>= 1;
b = b & 1 ? (b >> 1) ^ POLY : b >> 1;
}
return p;
}
/*
Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
initialized.
*/
local z_crc_t x2nmodp(z_off64_t n, unsigned k) {
z_crc_t p;
p = (z_crc_t)1 << 31; /* x^0 == 1 */
while (n) {
if (n & 1)
p = multmodp(x2n_table[k & 31], p);
n >>= 1;
k++;
}
return p;
}
#ifdef DYNAMIC_CRC_TABLE
/* =========================================================================
* Build the tables for byte-wise and braided CRC-32 calculations, and a table
* of powers of x for combining CRC-32s.
*/
local z_crc_t FAR crc_table[256];
local z_crc_t FAR x2n_table[32];
local void make_crc_table OF((void));
#ifdef W
local z_word_t FAR crc_big_table[256];
local z_crc_t FAR crc_braid_table[W][256];
local z_word_t FAR crc_braid_big_table[W][256];
local void braid OF((z_crc_t [][256], z_word_t [][256], int, int));
local void braid(z_crc_t [][256], z_word_t [][256], int, int);
#endif
#ifdef MAKECRCH
local void write_table OF((FILE *, const z_crc_t FAR *, int));
local void write_table32hi OF((FILE *, const z_word_t FAR *, int));
local void write_table64 OF((FILE *, const z_word_t FAR *, int));
local void write_table(FILE *, const z_crc_t FAR *, int);
local void write_table32hi(FILE *, const z_word_t FAR *, int);
local void write_table64(FILE *, const z_word_t FAR *, int);
#endif /* MAKECRCH */
/*
@@ -167,7 +214,6 @@ local void make_crc_table OF((void));
/* Definition of once functionality. */
typedef struct once_s once_t;
local void once OF((once_t *, void (*)(void)));
/* Check for the availability of atomics. */
#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \
@@ -187,10 +233,7 @@ struct once_s {
invoke once() at the same time. The state must be a once_t initialized with
ONCE_INIT.
*/
local void once(state, init)
once_t *state;
void (*init)(void);
{
local void once(once_t *state, void (*init)(void)) {
if (!atomic_load(&state->done)) {
if (atomic_flag_test_and_set(&state->begun))
while (!atomic_load(&state->done))
@@ -213,10 +256,7 @@ struct once_s {
/* Test and set. Alas, not atomic, but tries to minimize the period of
vulnerability. */
local int test_and_set OF((int volatile *));
local int test_and_set(flag)
int volatile *flag;
{
local int test_and_set(int volatile *flag) {
int was;
was = *flag;
@@ -225,10 +265,7 @@ local int test_and_set(flag)
}
/* Run the provided init() function once. This is not thread-safe. */
local void once(state, init)
once_t *state;
void (*init)(void);
{
local void once(once_t *state, void (*init)(void)) {
if (!state->done) {
if (test_and_set(&state->begun))
while (!state->done)
@@ -270,8 +307,7 @@ local once_t made = ONCE_INIT;
combinations of CRC register values and incoming bytes.
*/
local void make_crc_table()
{
local void make_crc_table(void) {
unsigned i, j, n;
z_crc_t p;
@@ -438,11 +474,7 @@ local void make_crc_table()
Write the 32-bit values in table[0..k-1] to out, five per line in
hexadecimal separated by commas.
*/
local void write_table(out, table, k)
FILE *out;
const z_crc_t FAR *table;
int k;
{
local void write_table(FILE *out, const z_crc_t FAR *table, int k) {
int n;
for (n = 0; n < k; n++)
@@ -455,11 +487,7 @@ local void write_table(out, table, k)
Write the high 32-bits of each value in table[0..k-1] to out, five per line
in hexadecimal separated by commas.
*/
local void write_table32hi(out, table, k)
FILE *out;
const z_word_t FAR *table;
int k;
{
local void write_table32hi(FILE *out, const z_word_t FAR *table, int k) {
int n;
for (n = 0; n < k; n++)
@@ -475,11 +503,7 @@ int k;
bits. If not, then the type cast and format string can be adjusted
accordingly.
*/
local void write_table64(out, table, k)
FILE *out;
const z_word_t FAR *table;
int k;
{
local void write_table64(FILE *out, const z_word_t FAR *table, int k) {
int n;
for (n = 0; n < k; n++)
@@ -489,8 +513,7 @@ local void write_table64(out, table, k)
}
/* Actually do the deed. */
int main()
{
int main(void) {
make_crc_table();
return 0;
}
@@ -502,12 +525,7 @@ int main()
Generate the little and big-endian braid tables for the given n and z_word_t
size w. Each array must have room for w blocks of 256 elements.
*/
local void braid(ltl, big, n, w)
z_crc_t ltl[][256];
z_word_t big[][256];
int n;
int w;
{
local void braid(z_crc_t ltl[][256], z_word_t big[][256], int n, int w) {
int k;
z_crc_t i, p, q;
for (k = 0; k < w; k++) {
@@ -522,69 +540,13 @@ local void braid(ltl, big, n, w)
}
#endif
#else /* !DYNAMIC_CRC_TABLE */
/* ========================================================================
* Tables for byte-wise and braided CRC-32 calculations, and a table of powers
* of x for combining CRC-32s, all made by make_crc_table().
*/
#include "crc32.h"
#endif /* DYNAMIC_CRC_TABLE */
/* ========================================================================
* Routines used for CRC calculation. Some are also required for the table
* generation above.
*/
/*
Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
reflected. For speed, this requires that a not be zero.
*/
local z_crc_t multmodp(a, b)
z_crc_t a;
z_crc_t b;
{
z_crc_t m, p;
m = (z_crc_t)1 << 31;
p = 0;
for (;;) {
if (a & m) {
p ^= b;
if ((a & (m - 1)) == 0)
break;
}
m >>= 1;
b = b & 1 ? (b >> 1) ^ POLY : b >> 1;
}
return p;
}
/*
Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
initialized.
*/
local z_crc_t x2nmodp(n, k)
z_off64_t n;
unsigned k;
{
z_crc_t p;
p = (z_crc_t)1 << 31; /* x^0 == 1 */
while (n) {
if (n & 1)
p = multmodp(x2n_table[k & 31], p);
n >>= 1;
k++;
}
return p;
}
/* =========================================================================
* This function can be used by asm versions of crc32(), and to force the
* generation of the CRC tables in a threaded application.
*/
const z_crc_t FAR * ZEXPORT get_crc_table()
{
const z_crc_t FAR * ZEXPORT get_crc_table(void) {
#ifdef DYNAMIC_CRC_TABLE
once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
@@ -610,11 +572,8 @@ const z_crc_t FAR * ZEXPORT get_crc_table()
#define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */
#define Z_BATCH_MIN 800 /* fewest words in a final batch */
unsigned long ZEXPORT crc32_z(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
z_size_t len;
{
unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
z_size_t len) {
z_crc_t val;
z_word_t crc1, crc2;
const z_word_t *word;
@@ -630,7 +589,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif /* DYNAMIC_CRC_TABLE */
/* Pre-condition the CRC */
crc ^= 0xffffffff;
crc = (~crc) & 0xffffffff;
/* Compute the CRC up to a word boundary. */
while (len && ((z_size_t)buf & 7) != 0) {
@@ -645,8 +604,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
len &= 7;
/* Do three interleaved CRCs to realize the throughput of one crc32x
instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
CRCs are combined into a single CRC after each set of batches. */
instruction per cycle. Each CRC is calculated on Z_BATCH words. The
three CRCs are combined into a single CRC after each set of batches. */
while (num >= 3 * Z_BATCH) {
crc1 = 0;
crc2 = 0;
@@ -714,18 +673,14 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
least-significant byte of the word as the first byte of data, without any pre
or post conditioning. This is used to combine the CRCs of each braid.
*/
local z_crc_t crc_word(data)
z_word_t data;
{
local z_crc_t crc_word(z_word_t data) {
int k;
for (k = 0; k < W; k++)
data = (data >> 8) ^ crc_table[data & 0xff];
return (z_crc_t)data;
}
local z_word_t crc_word_big(data)
z_word_t data;
{
local z_word_t crc_word_big(z_word_t data) {
int k;
for (k = 0; k < W; k++)
data = (data << 8) ^
@@ -736,11 +691,8 @@ local z_word_t crc_word_big(data)
#endif
/* ========================================================================= */
unsigned long ZEXPORT crc32_z(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
z_size_t len;
{
unsigned long ZEXPORT crc32_z(unsigned long crc, const unsigned char FAR *buf,
z_size_t len) {
/* Return initial CRC, if requested. */
if (buf == Z_NULL) return 0;
@@ -749,7 +701,7 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif /* DYNAMIC_CRC_TABLE */
/* Pre-condition the CRC */
crc ^= 0xffffffff;
crc = (~crc) & 0xffffffff;
#ifdef W
@@ -772,8 +724,8 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
words = (z_word_t const *)buf;
/* Do endian check at execution time instead of compile time, since ARM
processors can change the endianess at execution time. If the
compiler knows what the endianess will be, it can optimize out the
processors can change the endianness at execution time. If the
compiler knows what the endianness will be, it can optimize out the
check and the unused branch. */
endian = 1;
if (*(unsigned char *)&endian) {
@@ -1060,39 +1012,26 @@ unsigned long ZEXPORT crc32_z(crc, buf, len)
#endif
/* ========================================================================= */
unsigned long ZEXPORT crc32(crc, buf, len)
unsigned long crc;
const unsigned char FAR *buf;
uInt len;
{
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf,
uInt len) {
return crc32_z(crc, buf, len);
}
/* ========================================================================= */
uLong ZEXPORT crc32_combine64(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off64_t len2;
{
uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) {
#ifdef DYNAMIC_CRC_TABLE
once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
}
/* ========================================================================= */
uLong ZEXPORT crc32_combine(crc1, crc2, len2)
uLong crc1;
uLong crc2;
z_off_t len2;
{
return crc32_combine64(crc1, crc2, len2);
uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) {
return crc32_combine64(crc1, crc2, (z_off64_t)len2);
}
/* ========================================================================= */
uLong ZEXPORT crc32_combine_gen64(len2)
z_off64_t len2;
{
uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) {
#ifdef DYNAMIC_CRC_TABLE
once(&made, make_crc_table);
#endif /* DYNAMIC_CRC_TABLE */
@@ -1100,17 +1039,11 @@ uLong ZEXPORT crc32_combine_gen64(len2)
}
/* ========================================================================= */
uLong ZEXPORT crc32_combine_gen(len2)
z_off_t len2;
{
return crc32_combine_gen64(len2);
uLong ZEXPORT crc32_combine_gen(z_off_t len2) {
return crc32_combine_gen64((z_off64_t)len2);
}
/* ========================================================================= */
uLong crc32_combine_op(crc1, crc2, op)
uLong crc1;
uLong crc2;
uLong op;
{
return multmodp(op, crc1) ^ crc2;
uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) {
return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
}
+362 -434
View File
File diff suppressed because it is too large Load Diff
+43 -12
View File
@@ -1,5 +1,5 @@
/* deflate.h -- internal compression state
* Copyright (C) 1995-2018 Jean-loup Gailly
* Copyright (C) 1995-2024 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -23,6 +23,10 @@
# define GZIP
#endif
/* define LIT_MEM to slightly increase the speed of deflate (order 1% to 2%) at
the cost of a larger memory footprint */
/* #define LIT_MEM */
/* ===========================================================================
* Internal compression state.
*/
@@ -217,7 +221,14 @@ typedef struct internal_state {
/* Depth of each subtree used as tie breaker for trees of equal frequency
*/
#ifdef LIT_MEM
# define LIT_BUFS 5
ushf *d_buf; /* buffer for distances */
uchf *l_buf; /* buffer for literals/lengths */
#else
# define LIT_BUFS 4
uchf *sym_buf; /* buffer for distances and literals/lengths */
#endif
uInt lit_bufsize;
/* Size of match buffer for literals/lengths. There are 4 reasons for
@@ -239,7 +250,7 @@ typedef struct internal_state {
* - I can't count above 4
*/
uInt sym_next; /* running index in sym_buf */
uInt sym_next; /* running index in symbol buffer */
uInt sym_end; /* symbol table full when sym_next reaches this */
ulg opt_len; /* bit length of current block with optimal trees */
@@ -291,14 +302,14 @@ typedef struct internal_state {
memory checker errors from longest match routines */
/* in trees.c */
void ZLIB_INTERNAL _tr_init OF((deflate_state *s));
int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc));
void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
void ZLIB_INTERNAL _tr_flush_bits OF((deflate_state *s));
void ZLIB_INTERNAL _tr_align OF((deflate_state *s));
void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
ulg stored_len, int last));
void ZLIB_INTERNAL _tr_init(deflate_state *s);
int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc);
void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
ulg stored_len, int last);
void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s);
void ZLIB_INTERNAL _tr_align(deflate_state *s);
void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
ulg stored_len, int last);
#define d_code(dist) \
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)])
@@ -318,6 +329,25 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
extern const uch ZLIB_INTERNAL _dist_code[];
#endif
#ifdef LIT_MEM
# define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \
s->d_buf[s->sym_next] = 0; \
s->l_buf[s->sym_next++] = cc; \
s->dyn_ltree[cc].Freq++; \
flush = (s->sym_next == s->sym_end); \
}
# define _tr_tally_dist(s, distance, length, flush) \
{ uch len = (uch)(length); \
ush dist = (ush)(distance); \
s->d_buf[s->sym_next] = dist; \
s->l_buf[s->sym_next++] = len; \
dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
s->dyn_dtree[d_code(dist)].Freq++; \
flush = (s->sym_next == s->sym_end); \
}
#else
# define _tr_tally_lit(s, c, flush) \
{ uch cc = (c); \
s->sym_buf[s->sym_next++] = 0; \
@@ -329,14 +359,15 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf,
# define _tr_tally_dist(s, distance, length, flush) \
{ uch len = (uch)(length); \
ush dist = (ush)(distance); \
s->sym_buf[s->sym_next++] = dist; \
s->sym_buf[s->sym_next++] = dist >> 8; \
s->sym_buf[s->sym_next++] = (uch)dist; \
s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
s->sym_buf[s->sym_next++] = len; \
dist--; \
s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
s->dyn_dtree[d_code(dist)].Freq++; \
flush = (s->sym_next == s->sym_end); \
}
#endif
#else
# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c)
# define _tr_tally_dist(s, distance, length, flush) \
+1 -3
View File
@@ -8,9 +8,7 @@
/* gzclose() is in a separate file so that it is linked in only if it is used.
That way the other gzclose functions can be used instead to avoid linking in
unneeded compression or decompression routines. */
int ZEXPORT gzclose(file)
gzFile file;
{
int ZEXPORT gzclose(gzFile file) {
#ifndef NO_GZCOMPRESS
gz_statep state;
+13 -18
View File
@@ -1,5 +1,5 @@
/* gzguts.h -- zlib internal header definitions for gz* operations
* Copyright (C) 2004-2019 Mark Adler
* Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -7,9 +7,8 @@
# ifndef _LARGEFILE_SOURCE
# define _LARGEFILE_SOURCE 1
# endif
# ifdef _FILE_OFFSET_BITS
# undef _FILE_OFFSET_BITS
# endif
# undef _FILE_OFFSET_BITS
# undef _TIME_BITS
#endif
#ifdef HAVE_HIDDEN
@@ -119,8 +118,8 @@
/* gz* functions always use library allocation functions */
#ifndef STDC
extern voidp malloc OF((uInt size));
extern void free OF((voidpf ptr));
extern voidp malloc(uInt size);
extern void free(voidpf ptr);
#endif
/* get errno and strerror definition */
@@ -138,10 +137,10 @@
/* provide prototypes for these when building zlib without LFS */
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);
ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);
ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);
#endif
/* default memLevel */
@@ -203,17 +202,13 @@ typedef struct {
typedef gz_state FAR *gz_statep;
/* shared functions */
void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
void ZLIB_INTERNAL gz_error(gz_statep, int, const char *);
#if defined UNDER_CE
char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
char ZLIB_INTERNAL *gz_strwinerror(DWORD error);
#endif
/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
value -- needed when comparing unsigned to z_off64_t, which is signed
(possible z_off64_t types off_t, off64_t, and long are all signed) */
#ifdef INT_MAX
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
#else
unsigned ZLIB_INTERNAL gz_intmax OF((void));
# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
#endif
unsigned ZLIB_INTERNAL gz_intmax(void);
#define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
+28 -85
View File
@@ -1,5 +1,5 @@
/* gzlib.c -- zlib functions common to reading and writing gzip files
* Copyright (C) 2004-2019 Mark Adler
* Copyright (C) 2004-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -15,10 +15,6 @@
#endif
#endif
/* Local functions */
local void gz_reset OF((gz_statep));
local gzFile gz_open OF((const void *, int, const char *));
#if defined UNDER_CE
/* Map the Windows error number in ERROR to a locale-dependent error message
@@ -30,9 +26,7 @@ local gzFile gz_open OF((const void *, int, const char *));
The gz_strwinerror function does not change the current setting of
GetLastError. */
char ZLIB_INTERNAL *gz_strwinerror (error)
DWORD error;
{
char ZLIB_INTERNAL *gz_strwinerror(DWORD error) {
static char buf[1024];
wchar_t *msgbuf;
@@ -72,9 +66,7 @@ char ZLIB_INTERNAL *gz_strwinerror (error)
#endif /* UNDER_CE */
/* Reset gzip file state */
local void gz_reset(state)
gz_statep state;
{
local void gz_reset(gz_statep state) {
state->x.have = 0; /* no output data available */
if (state->mode == GZ_READ) { /* for reading ... */
state->eof = 0; /* not at end of file */
@@ -90,11 +82,7 @@ local void gz_reset(state)
}
/* Open a gzip file either by name or file descriptor. */
local gzFile gz_open(path, fd, mode)
const void *path;
int fd;
const char *mode;
{
local gzFile gz_open(const void *path, int fd, const char *mode) {
gz_statep state;
z_size_t len;
int oflag;
@@ -269,26 +257,17 @@ local gzFile gz_open(path, fd, mode)
}
/* -- see zlib.h -- */
gzFile ZEXPORT gzopen(path, mode)
const char *path;
const char *mode;
{
gzFile ZEXPORT gzopen(const char *path, const char *mode) {
return gz_open(path, -1, mode);
}
/* -- see zlib.h -- */
gzFile ZEXPORT gzopen64(path, mode)
const char *path;
const char *mode;
{
gzFile ZEXPORT gzopen64(const char *path, const char *mode) {
return gz_open(path, -1, mode);
}
/* -- see zlib.h -- */
gzFile ZEXPORT gzdopen(fd, mode)
int fd;
const char *mode;
{
gzFile ZEXPORT gzdopen(int fd, const char *mode) {
char *path; /* identifier for error messages */
gzFile gz;
@@ -306,19 +285,13 @@ gzFile ZEXPORT gzdopen(fd, mode)
/* -- see zlib.h -- */
#ifdef WIDECHAR
gzFile ZEXPORT gzopen_w(path, mode)
const wchar_t *path;
const char *mode;
{
gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode) {
return gz_open(path, -2, mode);
}
#endif
/* -- see zlib.h -- */
int ZEXPORT gzbuffer(file, size)
gzFile file;
unsigned size;
{
int ZEXPORT gzbuffer(gzFile file, unsigned size) {
gz_statep state;
/* get internal structure and check integrity */
@@ -335,16 +308,14 @@ int ZEXPORT gzbuffer(file, size)
/* check and set requested size */
if ((size << 1) < size)
return -1; /* need to be able to double it */
if (size < 2)
size = 2; /* need two bytes to check magic header */
if (size < 8)
size = 8; /* needed to behave well with flushing */
state->want = size;
return 0;
}
/* -- see zlib.h -- */
int ZEXPORT gzrewind(file)
gzFile file;
{
int ZEXPORT gzrewind(gzFile file) {
gz_statep state;
/* get internal structure */
@@ -365,11 +336,7 @@ int ZEXPORT gzrewind(file)
}
/* -- see zlib.h -- */
z_off64_t ZEXPORT gzseek64(file, offset, whence)
gzFile file;
z_off64_t offset;
int whence;
{
z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
unsigned n;
z_off64_t ret;
gz_statep state;
@@ -442,11 +409,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence)
}
/* -- see zlib.h -- */
z_off_t ZEXPORT gzseek(file, offset, whence)
gzFile file;
z_off_t offset;
int whence;
{
z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence) {
z_off64_t ret;
ret = gzseek64(file, (z_off64_t)offset, whence);
@@ -454,9 +417,7 @@ z_off_t ZEXPORT gzseek(file, offset, whence)
}
/* -- see zlib.h -- */
z_off64_t ZEXPORT gztell64(file)
gzFile file;
{
z_off64_t ZEXPORT gztell64(gzFile file) {
gz_statep state;
/* get internal structure and check integrity */
@@ -471,9 +432,7 @@ z_off64_t ZEXPORT gztell64(file)
}
/* -- see zlib.h -- */
z_off_t ZEXPORT gztell(file)
gzFile file;
{
z_off_t ZEXPORT gztell(gzFile file) {
z_off64_t ret;
ret = gztell64(file);
@@ -481,9 +440,7 @@ z_off_t ZEXPORT gztell(file)
}
/* -- see zlib.h -- */
z_off64_t ZEXPORT gzoffset64(file)
gzFile file;
{
z_off64_t ZEXPORT gzoffset64(gzFile file) {
z_off64_t offset;
gz_statep state;
@@ -504,9 +461,7 @@ z_off64_t ZEXPORT gzoffset64(file)
}
/* -- see zlib.h -- */
z_off_t ZEXPORT gzoffset(file)
gzFile file;
{
z_off_t ZEXPORT gzoffset(gzFile file) {
z_off64_t ret;
ret = gzoffset64(file);
@@ -514,9 +469,7 @@ z_off_t ZEXPORT gzoffset(file)
}
/* -- see zlib.h -- */
int ZEXPORT gzeof(file)
gzFile file;
{
int ZEXPORT gzeof(gzFile file) {
gz_statep state;
/* get internal structure and check integrity */
@@ -531,10 +484,7 @@ int ZEXPORT gzeof(file)
}
/* -- see zlib.h -- */
const char * ZEXPORT gzerror(file, errnum)
gzFile file;
int *errnum;
{
const char * ZEXPORT gzerror(gzFile file, int *errnum) {
gz_statep state;
/* get internal structure and check integrity */
@@ -552,9 +502,7 @@ const char * ZEXPORT gzerror(file, errnum)
}
/* -- see zlib.h -- */
void ZEXPORT gzclearerr(file)
gzFile file;
{
void ZEXPORT gzclearerr(gzFile file) {
gz_statep state;
/* get internal structure and check integrity */
@@ -578,11 +526,7 @@ void ZEXPORT gzclearerr(file)
memory). Simply save the error message as a static string. If there is an
allocation failure constructing the error message, then convert the error to
out of memory. */
void ZLIB_INTERNAL gz_error(state, err, msg)
gz_statep state;
int err;
const char *msg;
{
void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
/* free previously allocated message and clear */
if (state->msg != NULL) {
if (state->err != Z_MEM_ERROR)
@@ -619,21 +563,20 @@ void ZLIB_INTERNAL gz_error(state, err, msg)
#endif
}
#ifndef INT_MAX
/* portably return maximum value for an int (when limits.h presumed not
available) -- we need to do this to cover cases where 2's complement not
used, since C standard permits 1's complement and sign-bit representations,
otherwise we could just use ((unsigned)-1) >> 1 */
unsigned ZLIB_INTERNAL gz_intmax()
{
unsigned p, q;
p = 1;
unsigned ZLIB_INTERNAL gz_intmax(void) {
#ifdef INT_MAX
return INT_MAX;
#else
unsigned p = 1, q;
do {
q = p;
p <<= 1;
p++;
} while (p > q);
return q >> 1;
}
#endif
}
+23 -73
View File
@@ -5,25 +5,12 @@
#include "gzguts.h"
/* Local functions */
local int gz_load OF((gz_statep, unsigned char *, unsigned, unsigned *));
local int gz_avail OF((gz_statep));
local int gz_look OF((gz_statep));
local int gz_decomp OF((gz_statep));
local int gz_fetch OF((gz_statep));
local int gz_skip OF((gz_statep, z_off64_t));
local z_size_t gz_read OF((gz_statep, voidp, z_size_t));
/* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from
state->fd, and update state->eof, state->err, and state->msg as appropriate.
This function needs to loop on read(), since read() is not guaranteed to
read the number of bytes requested, depending on the type of descriptor. */
local int gz_load(state, buf, len, have)
gz_statep state;
unsigned char *buf;
unsigned len;
unsigned *have;
{
local int gz_load(gz_statep state, unsigned char *buf, unsigned len,
unsigned *have) {
int ret;
unsigned get, max = ((unsigned)-1 >> 2) + 1;
@@ -53,9 +40,7 @@ local int gz_load(state, buf, len, have)
If strm->avail_in != 0, then the current data is moved to the beginning of
the input buffer, and then the remainder of the buffer is loaded with the
available data from the input file. */
local int gz_avail(state)
gz_statep state;
{
local int gz_avail(gz_statep state) {
unsigned got;
z_streamp strm = &(state->strm);
@@ -88,9 +73,7 @@ local int gz_avail(state)
case, all further file reads will be directly to either the output buffer or
a user buffer. If decompressing, the inflate state will be initialized.
gz_look() will return 0 on success or -1 on failure. */
local int gz_look(state)
gz_statep state;
{
local int gz_look(gz_statep state) {
z_streamp strm = &(state->strm);
/* allocate read buffers and inflate memory */
@@ -157,11 +140,9 @@ local int gz_look(state)
the output buffer is larger than the input buffer, which also assures
space for gzungetc() */
state->x.next = state->out;
if (strm->avail_in) {
memcpy(state->x.next, strm->next_in, strm->avail_in);
state->x.have = strm->avail_in;
strm->avail_in = 0;
}
memcpy(state->x.next, strm->next_in, strm->avail_in);
state->x.have = strm->avail_in;
strm->avail_in = 0;
state->how = COPY;
state->direct = 1;
return 0;
@@ -172,9 +153,7 @@ local int gz_look(state)
data. If the gzip stream completes, state->how is reset to LOOK to look for
the next gzip stream or raw data, once state->x.have is depleted. Returns 0
on success, -1 on failure. */
local int gz_decomp(state)
gz_statep state;
{
local int gz_decomp(gz_statep state) {
int ret = Z_OK;
unsigned had;
z_streamp strm = &(state->strm);
@@ -226,9 +205,7 @@ local int gz_decomp(state)
looked for to determine whether to copy or decompress. Returns -1 on error,
otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the
end of the input file has been reached and all data has been processed. */
local int gz_fetch(state)
gz_statep state;
{
local int gz_fetch(gz_statep state) {
z_streamp strm = &(state->strm);
do {
@@ -256,10 +233,7 @@ local int gz_fetch(state)
}
/* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */
local int gz_skip(state, len)
gz_statep state;
z_off64_t len;
{
local int gz_skip(gz_statep state, z_off64_t len) {
unsigned n;
/* skip over len bytes or reach end-of-file, whichever comes first */
@@ -291,11 +265,7 @@ local int gz_skip(state, len)
input. Return the number of bytes read. If zero is returned, either the
end of file was reached, or there was an error. state->err must be
consulted in that case to determine which. */
local z_size_t gz_read(state, buf, len)
gz_statep state;
voidp buf;
z_size_t len;
{
local z_size_t gz_read(gz_statep state, voidp buf, z_size_t len) {
z_size_t got;
unsigned n;
@@ -372,11 +342,7 @@ local z_size_t gz_read(state, buf, len)
}
/* -- see zlib.h -- */
int ZEXPORT gzread(file, buf, len)
gzFile file;
voidp buf;
unsigned len;
{
int ZEXPORT gzread(gzFile file, voidp buf, unsigned len) {
gz_statep state;
/* get internal structure */
@@ -408,12 +374,7 @@ int ZEXPORT gzread(file, buf, len)
}
/* -- see zlib.h -- */
z_size_t ZEXPORT gzfread(buf, size, nitems, file)
voidp buf;
z_size_t size;
z_size_t nitems;
gzFile file;
{
z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems, gzFile file) {
z_size_t len;
gz_statep state;
@@ -444,9 +405,7 @@ z_size_t ZEXPORT gzfread(buf, size, nitems, file)
#else
# undef gzgetc
#endif
int ZEXPORT gzgetc(file)
gzFile file;
{
int ZEXPORT gzgetc(gzFile file) {
unsigned char buf[1];
gz_statep state;
@@ -471,17 +430,12 @@ int ZEXPORT gzgetc(file)
return gz_read(state, buf, 1) < 1 ? -1 : buf[0];
}
int ZEXPORT gzgetc_(file)
gzFile file;
{
int ZEXPORT gzgetc_(gzFile file) {
return gzgetc(file);
}
/* -- see zlib.h -- */
int ZEXPORT gzungetc(c, file)
int c;
gzFile file;
{
int ZEXPORT gzungetc(int c, gzFile file) {
gz_statep state;
/* get internal structure */
@@ -489,6 +443,10 @@ int ZEXPORT gzungetc(c, file)
return -1;
state = (gz_statep)file;
/* in case this was just opened, set up the input buffer */
if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
(void)gz_look(state);
/* check that we're reading and that there's no (serious) error */
if (state->mode != GZ_READ ||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
@@ -538,11 +496,7 @@ int ZEXPORT gzungetc(c, file)
}
/* -- see zlib.h -- */
char * ZEXPORT gzgets(file, buf, len)
gzFile file;
char *buf;
int len;
{
char * ZEXPORT gzgets(gzFile file, char *buf, int len) {
unsigned left, n;
char *str;
unsigned char *eol;
@@ -602,9 +556,7 @@ char * ZEXPORT gzgets(file, buf, len)
}
/* -- see zlib.h -- */
int ZEXPORT gzdirect(file)
gzFile file;
{
int ZEXPORT gzdirect(gzFile file) {
gz_statep state;
/* get internal structure */
@@ -622,9 +574,7 @@ int ZEXPORT gzdirect(file)
}
/* -- see zlib.h -- */
int ZEXPORT gzclose_r(file)
gzFile file;
{
int ZEXPORT gzclose_r(gzFile file) {
int ret, err;
gz_statep state;
+19 -65
View File
@@ -5,18 +5,10 @@
#include "gzguts.h"
/* Local functions */
local int gz_init OF((gz_statep));
local int gz_comp OF((gz_statep, int));
local int gz_zero OF((gz_statep, z_off64_t));
local z_size_t gz_write OF((gz_statep, voidpc, z_size_t));
/* Initialize state for writing a gzip file. Mark initialization by setting
state->size to non-zero. Return -1 on a memory allocation failure, or 0 on
success. */
local int gz_init(state)
gz_statep state;
{
local int gz_init(gz_statep state) {
int ret;
z_streamp strm = &(state->strm);
@@ -70,10 +62,7 @@ local int gz_init(state)
deflate() flush value. If flush is Z_FINISH, then the deflate() state is
reset to start a new gzip stream. If gz->direct is true, then simply write
to the output file without compressing, and ignore flush. */
local int gz_comp(state, flush)
gz_statep state;
int flush;
{
local int gz_comp(gz_statep state, int flush) {
int ret, writ;
unsigned have, put, max = ((unsigned)-1 >> 2) + 1;
z_streamp strm = &(state->strm);
@@ -151,10 +140,7 @@ local int gz_comp(state, flush)
/* Compress len zeros to output. Return -1 on a write error or memory
allocation failure by gz_comp(), or 0 on success. */
local int gz_zero(state, len)
gz_statep state;
z_off64_t len;
{
local int gz_zero(gz_statep state, z_off64_t len) {
int first;
unsigned n;
z_streamp strm = &(state->strm);
@@ -184,11 +170,7 @@ local int gz_zero(state, len)
/* Write len bytes from buf to file. Return the number of bytes written. If
the returned value is less than len, then there was an error. */
local z_size_t gz_write(state, buf, len)
gz_statep state;
voidpc buf;
z_size_t len;
{
local z_size_t gz_write(gz_statep state, voidpc buf, z_size_t len) {
z_size_t put = len;
/* if len is zero, avoid unnecessary operations */
@@ -252,11 +234,7 @@ local z_size_t gz_write(state, buf, len)
}
/* -- see zlib.h -- */
int ZEXPORT gzwrite(file, buf, len)
gzFile file;
voidpc buf;
unsigned len;
{
int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len) {
gz_statep state;
/* get internal structure */
@@ -280,12 +258,8 @@ int ZEXPORT gzwrite(file, buf, len)
}
/* -- see zlib.h -- */
z_size_t ZEXPORT gzfwrite(buf, size, nitems, file)
voidpc buf;
z_size_t size;
z_size_t nitems;
gzFile file;
{
z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size, z_size_t nitems,
gzFile file) {
z_size_t len;
gz_statep state;
@@ -310,10 +284,7 @@ z_size_t ZEXPORT gzfwrite(buf, size, nitems, file)
}
/* -- see zlib.h -- */
int ZEXPORT gzputc(file, c)
gzFile file;
int c;
{
int ZEXPORT gzputc(gzFile file, int c) {
unsigned have;
unsigned char buf[1];
gz_statep state;
@@ -358,10 +329,7 @@ int ZEXPORT gzputc(file, c)
}
/* -- see zlib.h -- */
int ZEXPORT gzputs(file, s)
gzFile file;
const char *s;
{
int ZEXPORT gzputs(gzFile file, const char *s) {
z_size_t len, put;
gz_statep state;
@@ -388,8 +356,7 @@ int ZEXPORT gzputs(file, s)
#include <stdarg.h>
/* -- see zlib.h -- */
int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
{
int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va) {
int len;
unsigned left;
char *next;
@@ -460,8 +427,7 @@ int ZEXPORTVA gzvprintf(gzFile file, const char *format, va_list va)
return len;
}
int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
{
int ZEXPORTVA gzprintf(gzFile file, const char *format, ...) {
va_list va;
int ret;
@@ -474,13 +440,10 @@ int ZEXPORTVA gzprintf(gzFile file, const char *format, ...)
#else /* !STDC && !Z_HAVE_STDARG_H */
/* -- see zlib.h -- */
int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
gzFile file;
const char *format;
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
a11, a12, a13, a14, a15, a16, a17, a18, a19, a20;
{
int ZEXPORTVA gzprintf(gzFile file, const char *format, int a1, int a2, int a3,
int a4, int a5, int a6, int a7, int a8, int a9, int a10,
int a11, int a12, int a13, int a14, int a15, int a16,
int a17, int a18, int a19, int a20) {
unsigned len, left;
char *next;
gz_statep state;
@@ -562,10 +525,7 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
#endif
/* -- see zlib.h -- */
int ZEXPORT gzflush(file, flush)
gzFile file;
int flush;
{
int ZEXPORT gzflush(gzFile file, int flush) {
gz_statep state;
/* get internal structure */
@@ -594,11 +554,7 @@ int ZEXPORT gzflush(file, flush)
}
/* -- see zlib.h -- */
int ZEXPORT gzsetparams(file, level, strategy)
gzFile file;
int level;
int strategy;
{
int ZEXPORT gzsetparams(gzFile file, int level, int strategy) {
gz_statep state;
z_streamp strm;
@@ -609,7 +565,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
strm = &(state->strm);
/* check that we're writing and that there's no error */
if (state->mode != GZ_WRITE || state->err != Z_OK)
if (state->mode != GZ_WRITE || state->err != Z_OK || state->direct)
return Z_STREAM_ERROR;
/* if no change is requested, then do nothing */
@@ -636,9 +592,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
}
/* -- see zlib.h -- */
int ZEXPORT gzclose_w(file)
gzFile file;
{
int ZEXPORT gzclose_w(gzFile file) {
int ret = Z_OK;
gz_statep state;
+17 -30
View File
@@ -15,9 +15,6 @@
#include "inflate.h"
#include "inffast.h"
/* function prototypes */
local void fixedtables OF((struct inflate_state FAR *state));
/*
strm provides memory allocation functions in zalloc and zfree, or
Z_NULL to use the library memory allocation functions.
@@ -25,13 +22,9 @@ local void fixedtables OF((struct inflate_state FAR *state));
windowBits is in the range 8..15, and window is a user-supplied
window and output buffer that is 2**windowBits bytes.
*/
int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size)
z_streamp strm;
int windowBits;
unsigned char FAR *window;
const char *version;
int stream_size;
{
int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
unsigned char FAR *window, const char *version,
int stream_size) {
struct inflate_state FAR *state;
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
@@ -66,6 +59,7 @@ int stream_size;
state->window = window;
state->wnext = 0;
state->whave = 0;
state->sane = 1;
return Z_OK;
}
@@ -79,9 +73,7 @@ int stream_size;
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
local void fixedtables(state)
struct inflate_state FAR *state;
{
local void fixedtables(struct inflate_state FAR *state) {
#ifdef BUILDFIXED
static int virgin = 1;
static code *lenfix, *distfix;
@@ -247,13 +239,8 @@ struct inflate_state FAR *state;
inflateBack() can also return Z_STREAM_ERROR if the input parameters
are not correct, i.e. strm is Z_NULL or the state was not initialized.
*/
int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc)
z_streamp strm;
in_func in;
void FAR *in_desc;
out_func out;
void FAR *out_desc;
{
int ZEXPORT inflateBack(z_streamp strm, in_func in, void FAR *in_desc,
out_func out, void FAR *out_desc) {
struct inflate_state FAR *state;
z_const unsigned char FAR *next; /* next input */
unsigned char FAR *put; /* next output */
@@ -605,33 +592,33 @@ void FAR *out_desc;
break;
case DONE:
/* inflate stream terminated properly -- write leftover output */
/* inflate stream terminated properly */
ret = Z_STREAM_END;
if (left < state->wsize) {
if (out(out_desc, state->window, state->wsize - left))
ret = Z_BUF_ERROR;
}
goto inf_leave;
case BAD:
ret = Z_DATA_ERROR;
goto inf_leave;
default: /* can't happen, but makes compilers happy */
default:
/* can't happen, but makes compilers happy */
ret = Z_STREAM_ERROR;
goto inf_leave;
}
/* Return unused input */
/* Write leftover output and return unused input */
inf_leave:
if (left < state->wsize) {
if (out(out_desc, state->window, state->wsize - left) &&
ret == Z_STREAM_END)
ret = Z_BUF_ERROR;
}
strm->next_in = next;
strm->avail_in = have;
return ret;
}
int ZEXPORT inflateBackEnd(strm)
z_streamp strm;
{
int ZEXPORT inflateBackEnd(z_streamp strm) {
if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
return Z_STREAM_ERROR;
ZFREE(strm, strm->state);
+1 -4
View File
@@ -47,10 +47,7 @@
requires strm->avail_out >= 258 for each loop to avoid checking for
output space.
*/
void ZLIB_INTERNAL inflate_fast(strm, start)
z_streamp strm;
unsigned start; /* inflate()'s starting value for strm->avail_out */
{
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start) {
struct inflate_state FAR *state;
z_const unsigned char FAR *in; /* local strm->next_in */
z_const unsigned char FAR *last; /* have enough input while in < last */
+1 -1
View File
@@ -8,4 +8,4 @@
subject to change. Applications should only use zlib.h.
*/
void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
void ZLIB_INTERNAL inflate_fast(z_streamp strm, unsigned start);
+35 -102
View File
@@ -91,20 +91,7 @@
# endif
#endif
/* function prototypes */
local int inflateStateCheck OF((z_streamp strm));
local void fixedtables OF((struct inflate_state FAR *state));
local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
unsigned copy));
#ifdef BUILDFIXED
void makefixed OF((void));
#endif
local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
unsigned len));
local int inflateStateCheck(strm)
z_streamp strm;
{
local int inflateStateCheck(z_streamp strm) {
struct inflate_state FAR *state;
if (strm == Z_NULL ||
strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
@@ -116,9 +103,7 @@ z_streamp strm;
return 0;
}
int ZEXPORT inflateResetKeep(strm)
z_streamp strm;
{
int ZEXPORT inflateResetKeep(z_streamp strm) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -142,9 +127,7 @@ z_streamp strm;
return Z_OK;
}
int ZEXPORT inflateReset(strm)
z_streamp strm;
{
int ZEXPORT inflateReset(z_streamp strm) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -155,10 +138,7 @@ z_streamp strm;
return inflateResetKeep(strm);
}
int ZEXPORT inflateReset2(strm, windowBits)
z_streamp strm;
int windowBits;
{
int ZEXPORT inflateReset2(z_streamp strm, int windowBits) {
int wrap;
struct inflate_state FAR *state;
@@ -168,6 +148,8 @@ int windowBits;
/* extract wrap request from windowBits parameter */
if (windowBits < 0) {
if (windowBits < -15)
return Z_STREAM_ERROR;
wrap = 0;
windowBits = -windowBits;
}
@@ -193,12 +175,8 @@ int windowBits;
return inflateReset(strm);
}
int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size)
z_streamp strm;
int windowBits;
const char *version;
int stream_size;
{
int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
const char *version, int stream_size) {
int ret;
struct inflate_state FAR *state;
@@ -237,22 +215,17 @@ int stream_size;
return ret;
}
int ZEXPORT inflateInit_(strm, version, stream_size)
z_streamp strm;
const char *version;
int stream_size;
{
int ZEXPORT inflateInit_(z_streamp strm, const char *version,
int stream_size) {
return inflateInit2_(strm, DEF_WBITS, version, stream_size);
}
int ZEXPORT inflatePrime(strm, bits, value)
z_streamp strm;
int bits;
int value;
{
int ZEXPORT inflatePrime(z_streamp strm, int bits, int value) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
if (bits == 0)
return Z_OK;
state = (struct inflate_state FAR *)strm->state;
if (bits < 0) {
state->hold = 0;
@@ -276,9 +249,7 @@ int value;
used for threaded applications, since the rewriting of the tables and virgin
may not be thread-safe.
*/
local void fixedtables(state)
struct inflate_state FAR *state;
{
local void fixedtables(struct inflate_state FAR *state) {
#ifdef BUILDFIXED
static int virgin = 1;
static code *lenfix, *distfix;
@@ -340,7 +311,7 @@ struct inflate_state FAR *state;
a.out > inffixed.h
*/
void makefixed()
void makefixed(void)
{
unsigned low, size;
struct inflate_state state;
@@ -394,11 +365,7 @@ void makefixed()
output will fall in the output data, making match copies simpler and faster.
The advantage may be dependent on the size of the processor's data caches.
*/
local int updatewindow(strm, end, copy)
z_streamp strm;
const Bytef *end;
unsigned copy;
{
local int updatewindow(z_streamp strm, const Bytef *end, unsigned copy) {
struct inflate_state FAR *state;
unsigned dist;
@@ -620,10 +587,7 @@ unsigned copy;
will return Z_BUF_ERROR if it has not reached the end of the stream.
*/
int ZEXPORT inflate(strm, flush)
z_streamp strm;
int flush;
{
int ZEXPORT inflate(z_streamp strm, int flush) {
struct inflate_state FAR *state;
z_const unsigned char FAR *next; /* next input */
unsigned char FAR *put; /* next output */
@@ -763,10 +727,10 @@ int flush;
copy = state->length;
if (copy > have) copy = have;
if (copy) {
len = state->head->extra_len - state->length;
if (state->head != Z_NULL &&
state->head->extra != Z_NULL &&
len < state->head->extra_max) {
(len = state->head->extra_len - state->length) <
state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);
@@ -1299,9 +1263,7 @@ int flush;
return ret;
}
int ZEXPORT inflateEnd(strm)
z_streamp strm;
{
int ZEXPORT inflateEnd(z_streamp strm) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm))
return Z_STREAM_ERROR;
@@ -1313,11 +1275,8 @@ z_streamp strm;
return Z_OK;
}
int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength)
z_streamp strm;
Bytef *dictionary;
uInt *dictLength;
{
int ZEXPORT inflateGetDictionary(z_streamp strm, Bytef *dictionary,
uInt *dictLength) {
struct inflate_state FAR *state;
/* check state */
@@ -1336,11 +1295,8 @@ uInt *dictLength;
return Z_OK;
}
int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength)
z_streamp strm;
const Bytef *dictionary;
uInt dictLength;
{
int ZEXPORT inflateSetDictionary(z_streamp strm, const Bytef *dictionary,
uInt dictLength) {
struct inflate_state FAR *state;
unsigned long dictid;
int ret;
@@ -1371,10 +1327,7 @@ uInt dictLength;
return Z_OK;
}
int ZEXPORT inflateGetHeader(strm, head)
z_streamp strm;
gz_headerp head;
{
int ZEXPORT inflateGetHeader(z_streamp strm, gz_headerp head) {
struct inflate_state FAR *state;
/* check state */
@@ -1399,11 +1352,8 @@ gz_headerp head;
called again with more data and the *have state. *have is initialized to
zero for the first call.
*/
local unsigned syncsearch(have, buf, len)
unsigned FAR *have;
const unsigned char FAR *buf;
unsigned len;
{
local unsigned syncsearch(unsigned FAR *have, const unsigned char FAR *buf,
unsigned len) {
unsigned got;
unsigned next;
@@ -1422,9 +1372,7 @@ unsigned len;
return next;
}
int ZEXPORT inflateSync(strm)
z_streamp strm;
{
int ZEXPORT inflateSync(z_streamp strm) {
unsigned len; /* number of bytes to look at or looked at */
int flags; /* temporary to save header status */
unsigned long in, out; /* temporary to save total_in and total_out */
@@ -1439,7 +1387,7 @@ z_streamp strm;
/* if first time, start search in bit buffer */
if (state->mode != SYNC) {
state->mode = SYNC;
state->hold <<= state->bits & 7;
state->hold >>= state->bits & 7;
state->bits -= state->bits & 7;
len = 0;
while (state->bits >= 8) {
@@ -1480,9 +1428,7 @@ z_streamp strm;
block. When decompressing, PPP checks that at the end of input packet,
inflate is waiting for these length bytes.
*/
int ZEXPORT inflateSyncPoint(strm)
z_streamp strm;
{
int ZEXPORT inflateSyncPoint(z_streamp strm) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1490,10 +1436,7 @@ z_streamp strm;
return state->mode == STORED && state->bits == 0;
}
int ZEXPORT inflateCopy(dest, source)
z_streamp dest;
z_streamp source;
{
int ZEXPORT inflateCopy(z_streamp dest, z_streamp source) {
struct inflate_state FAR *state;
struct inflate_state FAR *copy;
unsigned char FAR *window;
@@ -1537,10 +1480,7 @@ z_streamp source;
return Z_OK;
}
int ZEXPORT inflateUndermine(strm, subvert)
z_streamp strm;
int subvert;
{
int ZEXPORT inflateUndermine(z_streamp strm, int subvert) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1555,10 +1495,7 @@ int subvert;
#endif
}
int ZEXPORT inflateValidate(strm, check)
z_streamp strm;
int check;
{
int ZEXPORT inflateValidate(z_streamp strm, int check) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
@@ -1570,9 +1507,7 @@ int check;
return Z_OK;
}
long ZEXPORT inflateMark(strm)
z_streamp strm;
{
long ZEXPORT inflateMark(z_streamp strm) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm))
@@ -1583,9 +1518,7 @@ z_streamp strm;
(state->mode == MATCH ? state->was - state->length : 0));
}
unsigned long ZEXPORT inflateCodesUsed(strm)
z_streamp strm;
{
unsigned long ZEXPORT inflateCodesUsed(z_streamp strm) {
struct inflate_state FAR *state;
if (inflateStateCheck(strm)) return (unsigned long)-1;
state = (struct inflate_state FAR *)strm->state;
+6 -11
View File
@@ -1,5 +1,5 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-2022 Mark Adler
* Copyright (C) 1995-2024 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -9,7 +9,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
" inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
" inflate 1.3.1 Copyright 1995-2024 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -29,14 +29,9 @@ const char inflate_copyright[] =
table index bits. It will differ if the request is greater than the
longest code or if it is less than the shortest code.
*/
int ZLIB_INTERNAL inflate_table(type, lens, codes, table, bits, work)
codetype type;
unsigned short FAR *lens;
unsigned codes;
code FAR * FAR *table;
unsigned FAR *bits;
unsigned short FAR *work;
{
int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work) {
unsigned len; /* a code's length in bits */
unsigned sym; /* index of code symbols */
unsigned min, max; /* minimum and maximum code lengths */
@@ -62,7 +57,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 203, 77};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
+6 -6
View File
@@ -38,11 +38,11 @@ typedef struct {
/* Maximum size of the dynamic table. The maximum number of code structures is
1444, which is the sum of 852 for literal/length codes and 592 for distance
codes. These values were found by exhaustive searches using the program
examples/enough.c found in the zlib distribtution. The arguments to that
examples/enough.c found in the zlib distribution. The arguments to that
program are the number of symbols, the initial root table size, and the
maximum bit length of a code. "enough 286 9 15" for literal/length codes
returns returns 852, and "enough 30 6 15" for distance codes returns 592.
The initial root table size (9 or 6) is found in the fifth argument of the
returns 852, and "enough 30 6 15" for distance codes returns 592. The
initial root table size (9 or 6) is found in the fifth argument of the
inflate_table() calls in inflate.c and infback.c. If the root table size is
changed, then these maximum sizes would be need to be recalculated and
updated. */
@@ -57,6 +57,6 @@ typedef enum {
DISTS
} codetype;
int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work));
int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens,
unsigned codes, code FAR * FAR *table,
unsigned FAR *bits, unsigned short FAR *work);
+290 -355
View File
@@ -1,5 +1,5 @@
/* trees.c -- output deflated data using Huffman coding
* Copyright (C) 1995-2021 Jean-loup Gailly
* Copyright (C) 1995-2024 Jean-loup Gailly
* detect_data_type() function provided freely by Cosmin Truta, 2006
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -122,39 +122,116 @@ struct static_tree_desc_s {
int max_length; /* max bit length for the codes */
};
local const static_tree_desc static_l_desc =
#ifdef NO_INIT_GLOBAL_POINTERS
# define TCONST
#else
# define TCONST const
#endif
local TCONST static_tree_desc static_l_desc =
{static_ltree, extra_lbits, LITERALS+1, L_CODES, MAX_BITS};
local const static_tree_desc static_d_desc =
local TCONST static_tree_desc static_d_desc =
{static_dtree, extra_dbits, 0, D_CODES, MAX_BITS};
local const static_tree_desc static_bl_desc =
local TCONST static_tree_desc static_bl_desc =
{(const ct_data *)0, extra_blbits, 0, BL_CODES, MAX_BL_BITS};
/* ===========================================================================
* Local (static) routines in this file.
* Output a short LSB first on the stream.
* IN assertion: there is enough room in pendingBuf.
*/
#define put_short(s, w) { \
put_byte(s, (uch)((w) & 0xff)); \
put_byte(s, (uch)((ush)(w) >> 8)); \
}
local void tr_static_init OF((void));
local void init_block OF((deflate_state *s));
local void pqdownheap OF((deflate_state *s, ct_data *tree, int k));
local void gen_bitlen OF((deflate_state *s, tree_desc *desc));
local void gen_codes OF((ct_data *tree, int max_code, ushf *bl_count));
local void build_tree OF((deflate_state *s, tree_desc *desc));
local void scan_tree OF((deflate_state *s, ct_data *tree, int max_code));
local void send_tree OF((deflate_state *s, ct_data *tree, int max_code));
local int build_bl_tree OF((deflate_state *s));
local void send_all_trees OF((deflate_state *s, int lcodes, int dcodes,
int blcodes));
local void compress_block OF((deflate_state *s, const ct_data *ltree,
const ct_data *dtree));
local int detect_data_type OF((deflate_state *s));
local unsigned bi_reverse OF((unsigned code, int len));
local void bi_windup OF((deflate_state *s));
local void bi_flush OF((deflate_state *s));
/* ===========================================================================
* Reverse the first len bits of a code, using straightforward code (a faster
* method would use a table)
* IN assertion: 1 <= len <= 15
*/
local unsigned bi_reverse(unsigned code, int len) {
register unsigned res = 0;
do {
res |= code & 1;
code >>= 1, res <<= 1;
} while (--len > 0);
return res >> 1;
}
/* ===========================================================================
* Flush the bit buffer, keeping at most 7 bits in it.
*/
local void bi_flush(deflate_state *s) {
if (s->bi_valid == 16) {
put_short(s, s->bi_buf);
s->bi_buf = 0;
s->bi_valid = 0;
} else if (s->bi_valid >= 8) {
put_byte(s, (Byte)s->bi_buf);
s->bi_buf >>= 8;
s->bi_valid -= 8;
}
}
/* ===========================================================================
* Flush the bit buffer and align the output on a byte boundary
*/
local void bi_windup(deflate_state *s) {
if (s->bi_valid > 8) {
put_short(s, s->bi_buf);
} else if (s->bi_valid > 0) {
put_byte(s, (Byte)s->bi_buf);
}
s->bi_buf = 0;
s->bi_valid = 0;
#ifdef ZLIB_DEBUG
s->bits_sent = (s->bits_sent + 7) & ~7;
#endif
}
/* ===========================================================================
* Generate the codes for a given tree and bit counts (which need not be
* optimal).
* IN assertion: the array bl_count contains the bit length statistics for
* the given tree and the field len is set for all tree elements.
* OUT assertion: the field code is set for all tree elements of non
* zero code length.
*/
local void gen_codes(ct_data *tree, int max_code, ushf *bl_count) {
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
unsigned code = 0; /* running code value */
int bits; /* bit index */
int n; /* code index */
/* The distribution counts are first used to generate the code values
* without bit reversal.
*/
for (bits = 1; bits <= MAX_BITS; bits++) {
code = (code + bl_count[bits - 1]) << 1;
next_code[bits] = (ush)code;
}
/* Check that the bit counts in bl_count are consistent. The last code
* must be all ones.
*/
Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
"inconsistent bit counts");
Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
for (n = 0; n <= max_code; n++) {
int len = tree[n].Len;
if (len == 0) continue;
/* Now reverse the bits */
tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
}
}
#ifdef GEN_TREES_H
local void gen_trees_header OF((void));
local void gen_trees_header(void);
#endif
#ifndef ZLIB_DEBUG
@@ -167,33 +244,18 @@ local void gen_trees_header OF((void));
send_bits(s, tree[c].Code, tree[c].Len); }
#endif
/* ===========================================================================
* Output a short LSB first on the stream.
* IN assertion: there is enough room in pendingBuf.
*/
#define put_short(s, w) { \
put_byte(s, (uch)((w) & 0xff)); \
put_byte(s, (uch)((ush)(w) >> 8)); \
}
/* ===========================================================================
* Send a value on a given number of bits.
* IN assertion: length <= 16 and value fits in length bits.
*/
#ifdef ZLIB_DEBUG
local void send_bits OF((deflate_state *s, int value, int length));
local void send_bits(s, value, length)
deflate_state *s;
int value; /* value to send */
int length; /* number of bits */
{
local void send_bits(deflate_state *s, int value, int length) {
Tracevv((stderr," l %2d v %4x ", length, value));
Assert(length > 0 && length <= 15, "invalid length");
s->bits_sent += (ulg)length;
/* If not enough room in bi_buf, use (valid) bits from bi_buf and
* (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
* (16 - bi_valid) bits from value, leaving (width - (16 - bi_valid))
* unused bits in value.
*/
if (s->bi_valid > (int)Buf_size - length) {
@@ -229,8 +291,7 @@ local void send_bits(s, value, length)
/* ===========================================================================
* Initialize the various 'constant' tables.
*/
local void tr_static_init()
{
local void tr_static_init(void) {
#if defined(GEN_TREES_H) || !defined(STDC)
static int static_init_done = 0;
int n; /* iterates over tree elements */
@@ -256,7 +317,7 @@ local void tr_static_init()
length = 0;
for (code = 0; code < LENGTH_CODES-1; code++) {
base_length[code] = length;
for (n = 0; n < (1<<extra_lbits[code]); n++) {
for (n = 0; n < (1 << extra_lbits[code]); n++) {
_length_code[length++] = (uch)code;
}
}
@@ -265,13 +326,13 @@ local void tr_static_init()
* in two different ways: code 284 + 5 bits or code 285, so we
* overwrite length_code[255] to use the best encoding:
*/
_length_code[length-1] = (uch)code;
_length_code[length - 1] = (uch)code;
/* Initialize the mapping dist (0..32K) -> dist code (0..29) */
dist = 0;
for (code = 0 ; code < 16; code++) {
base_dist[code] = dist;
for (n = 0; n < (1<<extra_dbits[code]); n++) {
for (n = 0; n < (1 << extra_dbits[code]); n++) {
_dist_code[dist++] = (uch)code;
}
}
@@ -279,11 +340,11 @@ local void tr_static_init()
dist >>= 7; /* from now on, all distances are divided by 128 */
for ( ; code < D_CODES; code++) {
base_dist[code] = dist << 7;
for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
_dist_code[256 + dist++] = (uch)code;
}
}
Assert (dist == 256, "tr_static_init: 256+dist != 512");
Assert (dist == 256, "tr_static_init: 256 + dist != 512");
/* Construct the codes of the static literal tree */
for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
@@ -312,7 +373,7 @@ local void tr_static_init()
}
/* ===========================================================================
* Genererate the file trees.h describing the static trees.
* Generate the file trees.h describing the static trees.
*/
#ifdef GEN_TREES_H
# ifndef ZLIB_DEBUG
@@ -321,10 +382,9 @@ local void tr_static_init()
# define SEPARATOR(i, last, width) \
((i) == (last)? "\n};\n\n" : \
((i) % (width) == (width)-1 ? ",\n" : ", "))
((i) % (width) == (width) - 1 ? ",\n" : ", "))
void gen_trees_header()
{
void gen_trees_header(void) {
FILE *header = fopen("trees.h", "w");
int i;
@@ -373,12 +433,26 @@ void gen_trees_header()
}
#endif /* GEN_TREES_H */
/* ===========================================================================
* Initialize a new block.
*/
local void init_block(deflate_state *s) {
int n; /* iterates over tree elements */
/* Initialize the trees. */
for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
s->dyn_ltree[END_BLOCK].Freq = 1;
s->opt_len = s->static_len = 0L;
s->sym_next = s->matches = 0;
}
/* ===========================================================================
* Initialize the tree data structures for a new zlib stream.
*/
void ZLIB_INTERNAL _tr_init(s)
deflate_state *s;
{
void ZLIB_INTERNAL _tr_init(deflate_state *s) {
tr_static_init();
s->l_desc.dyn_tree = s->dyn_ltree;
@@ -401,24 +475,6 @@ void ZLIB_INTERNAL _tr_init(s)
init_block(s);
}
/* ===========================================================================
* Initialize a new block.
*/
local void init_block(s)
deflate_state *s;
{
int n; /* iterates over tree elements */
/* Initialize the trees. */
for (n = 0; n < L_CODES; n++) s->dyn_ltree[n].Freq = 0;
for (n = 0; n < D_CODES; n++) s->dyn_dtree[n].Freq = 0;
for (n = 0; n < BL_CODES; n++) s->bl_tree[n].Freq = 0;
s->dyn_ltree[END_BLOCK].Freq = 1;
s->opt_len = s->static_len = 0L;
s->sym_next = s->matches = 0;
}
#define SMALLEST 1
/* Index within the heap array of least frequent node in the Huffman tree */
@@ -448,17 +504,13 @@ local void init_block(s)
* when the heap property is re-established (each father smaller than its
* two sons).
*/
local void pqdownheap(s, tree, k)
deflate_state *s;
ct_data *tree; /* the tree to restore */
int k; /* node to move down */
{
local void pqdownheap(deflate_state *s, ct_data *tree, int k) {
int v = s->heap[k];
int j = k << 1; /* left son of k */
while (j <= s->heap_len) {
/* Set j to the smallest of the two sons: */
if (j < s->heap_len &&
smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
j++;
}
/* Exit if v is smaller than both sons */
@@ -483,10 +535,7 @@ local void pqdownheap(s, tree, k)
* The length opt_len is updated; static_len is also updated if stree is
* not null.
*/
local void gen_bitlen(s, desc)
deflate_state *s;
tree_desc *desc; /* the tree descriptor */
{
local void gen_bitlen(deflate_state *s, tree_desc *desc) {
ct_data *tree = desc->dyn_tree;
int max_code = desc->max_code;
const ct_data *stree = desc->stat_desc->static_tree;
@@ -507,7 +556,7 @@ local void gen_bitlen(s, desc)
*/
tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
n = s->heap[h];
bits = tree[tree[n].Dad].Len + 1;
if (bits > max_length) bits = max_length, overflow++;
@@ -518,7 +567,7 @@ local void gen_bitlen(s, desc)
s->bl_count[bits]++;
xbits = 0;
if (n >= base) xbits = extra[n-base];
if (n >= base) xbits = extra[n - base];
f = tree[n].Freq;
s->opt_len += (ulg)f * (unsigned)(bits + xbits);
if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
@@ -530,10 +579,10 @@ local void gen_bitlen(s, desc)
/* Find the first bit length which could increase: */
do {
bits = max_length-1;
bits = max_length - 1;
while (s->bl_count[bits] == 0) bits--;
s->bl_count[bits]--; /* move one leaf down the tree */
s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
s->bl_count[bits]--; /* move one leaf down the tree */
s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
s->bl_count[max_length]--;
/* The brother of the overflow item also moves one step up,
* but this does not affect bl_count[max_length]
@@ -561,48 +610,9 @@ local void gen_bitlen(s, desc)
}
}
/* ===========================================================================
* Generate the codes for a given tree and bit counts (which need not be
* optimal).
* IN assertion: the array bl_count contains the bit length statistics for
* the given tree and the field len is set for all tree elements.
* OUT assertion: the field code is set for all tree elements of non
* zero code length.
*/
local void gen_codes (tree, max_code, bl_count)
ct_data *tree; /* the tree to decorate */
int max_code; /* largest code with non zero frequency */
ushf *bl_count; /* number of codes at each bit length */
{
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
unsigned code = 0; /* running code value */
int bits; /* bit index */
int n; /* code index */
/* The distribution counts are first used to generate the code values
* without bit reversal.
*/
for (bits = 1; bits <= MAX_BITS; bits++) {
code = (code + bl_count[bits-1]) << 1;
next_code[bits] = (ush)code;
}
/* Check that the bit counts in bl_count are consistent. The last code
* must be all ones.
*/
Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
"inconsistent bit counts");
Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
for (n = 0; n <= max_code; n++) {
int len = tree[n].Len;
if (len == 0) continue;
/* Now reverse the bits */
tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
}
}
#ifdef DUMP_BL_TREE
# include <stdio.h>
#endif
/* ===========================================================================
* Construct one Huffman tree and assigns the code bit strings and lengths.
@@ -612,10 +622,7 @@ local void gen_codes (tree, max_code, bl_count)
* and corresponding code. The length opt_len is updated; static_len is
* also updated if stree is not null. The field max_code is set.
*/
local void build_tree(s, desc)
deflate_state *s;
tree_desc *desc; /* the tree descriptor */
{
local void build_tree(deflate_state *s, tree_desc *desc) {
ct_data *tree = desc->dyn_tree;
const ct_data *stree = desc->stat_desc->static_tree;
int elems = desc->stat_desc->elems;
@@ -624,7 +631,7 @@ local void build_tree(s, desc)
int node; /* new node being created */
/* Construct the initial heap, with least frequent element in
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
* heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
* heap[0] is not used.
*/
s->heap_len = 0, s->heap_max = HEAP_SIZE;
@@ -652,7 +659,7 @@ local void build_tree(s, desc)
}
desc->max_code = max_code;
/* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
/* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
* establish sub-heaps of increasing lengths:
*/
for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
@@ -700,11 +707,7 @@ local void build_tree(s, desc)
* Scan a literal or distance tree to determine the frequencies of the codes
* in the bit length tree.
*/
local void scan_tree (s, tree, max_code)
deflate_state *s;
ct_data *tree; /* the tree to be scanned */
int max_code; /* and its largest code of non zero frequency */
{
local void scan_tree(deflate_state *s, ct_data *tree, int max_code) {
int n; /* iterates over all tree elements */
int prevlen = -1; /* last emitted length */
int curlen; /* length of current code */
@@ -714,10 +717,10 @@ local void scan_tree (s, tree, max_code)
int min_count = 4; /* min repeat count */
if (nextlen == 0) max_count = 138, min_count = 3;
tree[max_code+1].Len = (ush)0xffff; /* guard */
tree[max_code + 1].Len = (ush)0xffff; /* guard */
for (n = 0; n <= max_code; n++) {
curlen = nextlen; nextlen = tree[n+1].Len;
curlen = nextlen; nextlen = tree[n + 1].Len;
if (++count < max_count && curlen == nextlen) {
continue;
} else if (count < min_count) {
@@ -745,11 +748,7 @@ local void scan_tree (s, tree, max_code)
* Send a literal or distance tree in compressed form, using the codes in
* bl_tree.
*/
local void send_tree (s, tree, max_code)
deflate_state *s;
ct_data *tree; /* the tree to be scanned */
int max_code; /* and its largest code of non zero frequency */
{
local void send_tree(deflate_state *s, ct_data *tree, int max_code) {
int n; /* iterates over all tree elements */
int prevlen = -1; /* last emitted length */
int curlen; /* length of current code */
@@ -758,11 +757,11 @@ local void send_tree (s, tree, max_code)
int max_count = 7; /* max repeat count */
int min_count = 4; /* min repeat count */
/* tree[max_code+1].Len = -1; */ /* guard already set */
/* tree[max_code + 1].Len = -1; */ /* guard already set */
if (nextlen == 0) max_count = 138, min_count = 3;
for (n = 0; n <= max_code; n++) {
curlen = nextlen; nextlen = tree[n+1].Len;
curlen = nextlen; nextlen = tree[n + 1].Len;
if (++count < max_count && curlen == nextlen) {
continue;
} else if (count < min_count) {
@@ -773,13 +772,13 @@ local void send_tree (s, tree, max_code)
send_code(s, curlen, s->bl_tree); count--;
}
Assert(count >= 3 && count <= 6, " 3_6?");
send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
} else if (count <= 10) {
send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
} else {
send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
}
count = 0; prevlen = curlen;
if (nextlen == 0) {
@@ -796,9 +795,7 @@ local void send_tree (s, tree, max_code)
* Construct the Huffman tree for the bit lengths and return the index in
* bl_order of the last bit length code to send.
*/
local int build_bl_tree(s)
deflate_state *s;
{
local int build_bl_tree(deflate_state *s) {
int max_blindex; /* index of last bit length code of non zero freq */
/* Determine the bit length frequencies for literal and distance trees */
@@ -807,8 +804,8 @@ local int build_bl_tree(s)
/* Build the bit length tree: */
build_tree(s, (tree_desc *)(&(s->bl_desc)));
/* opt_len now includes the length of the tree representations, except
* the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
/* opt_len now includes the length of the tree representations, except the
* lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts.
*/
/* Determine the number of bit length codes to send. The pkzip format
@@ -819,7 +816,7 @@ local int build_bl_tree(s)
if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
}
/* Update opt_len to include the bit length tree and counts */
s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4;
s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
s->opt_len, s->static_len));
@@ -831,42 +828,36 @@ local int build_bl_tree(s)
* lengths of the bit length codes, the literal tree and the distance tree.
* IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
*/
local void send_all_trees(s, lcodes, dcodes, blcodes)
deflate_state *s;
int lcodes, dcodes, blcodes; /* number of codes for each tree */
{
local void send_all_trees(deflate_state *s, int lcodes, int dcodes,
int blcodes) {
int rank; /* index in bl_order */
Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
"too many codes");
Tracev((stderr, "\nbl counts: "));
send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
send_bits(s, dcodes-1, 5);
send_bits(s, blcodes-4, 4); /* not -3 as stated in appnote.txt */
send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
send_bits(s, dcodes - 1, 5);
send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
for (rank = 0; rank < blcodes; rank++) {
Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
}
Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1); /* literal tree */
Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1); /* distance tree */
Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
}
/* ===========================================================================
* Send a stored block
*/
void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
deflate_state *s;
charf *buf; /* input block */
ulg stored_len; /* length of input block */
int last; /* one if this is the last block for a file */
{
send_bits(s, (STORED_BLOCK<<1)+last, 3); /* send block type */
void ZLIB_INTERNAL _tr_stored_block(deflate_state *s, charf *buf,
ulg stored_len, int last) {
send_bits(s, (STORED_BLOCK<<1) + last, 3); /* send block type */
bi_windup(s); /* align on byte boundary */
put_short(s, (ush)stored_len);
put_short(s, (ush)~stored_len);
@@ -877,16 +868,14 @@ void ZLIB_INTERNAL _tr_stored_block(s, buf, stored_len, last)
s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
s->compressed_len += (stored_len + 4) << 3;
s->bits_sent += 2*16;
s->bits_sent += stored_len<<3;
s->bits_sent += stored_len << 3;
#endif
}
/* ===========================================================================
* Flush the bits in the bit buffer to pending output (leaves at most 7 bits)
*/
void ZLIB_INTERNAL _tr_flush_bits(s)
deflate_state *s;
{
void ZLIB_INTERNAL _tr_flush_bits(deflate_state *s) {
bi_flush(s);
}
@@ -894,9 +883,7 @@ void ZLIB_INTERNAL _tr_flush_bits(s)
* Send one empty static block to give enough lookahead for inflate.
* This takes 10 bits, of which 7 may remain in the bit buffer.
*/
void ZLIB_INTERNAL _tr_align(s)
deflate_state *s;
{
void ZLIB_INTERNAL _tr_align(deflate_state *s) {
send_bits(s, STATIC_TREES<<1, 3);
send_code(s, END_BLOCK, static_ltree);
#ifdef ZLIB_DEBUG
@@ -905,16 +892,108 @@ void ZLIB_INTERNAL _tr_align(s)
bi_flush(s);
}
/* ===========================================================================
* Send the block data compressed using the given Huffman trees
*/
local void compress_block(deflate_state *s, const ct_data *ltree,
const ct_data *dtree) {
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
unsigned sx = 0; /* running index in symbol buffers */
unsigned code; /* the code to send */
int extra; /* number of extra bits to send */
if (s->sym_next != 0) do {
#ifdef LIT_MEM
dist = s->d_buf[sx];
lc = s->l_buf[sx++];
#else
dist = s->sym_buf[sx++] & 0xff;
dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
lc = s->sym_buf[sx++];
#endif
if (dist == 0) {
send_code(s, lc, ltree); /* send a literal byte */
Tracecv(isgraph(lc), (stderr," '%c' ", lc));
} else {
/* Here, lc is the match length - MIN_MATCH */
code = _length_code[lc];
send_code(s, code + LITERALS + 1, ltree); /* send length code */
extra = extra_lbits[code];
if (extra != 0) {
lc -= base_length[code];
send_bits(s, lc, extra); /* send the extra length bits */
}
dist--; /* dist is now the match distance - 1 */
code = d_code(dist);
Assert (code < D_CODES, "bad d_code");
send_code(s, code, dtree); /* send the distance code */
extra = extra_dbits[code];
if (extra != 0) {
dist -= (unsigned)base_dist[code];
send_bits(s, dist, extra); /* send the extra distance bits */
}
} /* literal or match pair ? */
/* Check for no overlay of pending_buf on needed symbols */
#ifdef LIT_MEM
Assert(s->pending < 2 * (s->lit_bufsize + sx), "pendingBuf overflow");
#else
Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
#endif
} while (sx < s->sym_next);
send_code(s, END_BLOCK, ltree);
}
/* ===========================================================================
* Check if the data type is TEXT or BINARY, using the following algorithm:
* - TEXT if the two conditions below are satisfied:
* a) There are no non-portable control characters belonging to the
* "block list" (0..6, 14..25, 28..31).
* b) There is at least one printable character belonging to the
* "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
* - BINARY otherwise.
* - The following partially-portable control characters form a
* "gray list" that is ignored in this detection algorithm:
* (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
* IN assertion: the fields Freq of dyn_ltree are set.
*/
local int detect_data_type(deflate_state *s) {
/* block_mask is the bit mask of block-listed bytes
* set bits 0..6, 14..25, and 28..31
* 0xf3ffc07f = binary 11110011111111111100000001111111
*/
unsigned long block_mask = 0xf3ffc07fUL;
int n;
/* Check for non-textual ("block-listed") bytes. */
for (n = 0; n <= 31; n++, block_mask >>= 1)
if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
return Z_BINARY;
/* Check for textual ("allow-listed") bytes. */
if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
|| s->dyn_ltree[13].Freq != 0)
return Z_TEXT;
for (n = 32; n < LITERALS; n++)
if (s->dyn_ltree[n].Freq != 0)
return Z_TEXT;
/* There are no "block-listed" or "allow-listed" bytes:
* this stream either is empty or has tolerated ("gray-listed") bytes only.
*/
return Z_BINARY;
}
/* ===========================================================================
* Determine the best encoding for the current block: dynamic trees, static
* trees or store, and write out the encoded block.
*/
void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
deflate_state *s;
charf *buf; /* input block, or NULL if too old */
ulg stored_len; /* length of input block */
int last; /* one if this is the last block for a file */
{
void ZLIB_INTERNAL _tr_flush_block(deflate_state *s, charf *buf,
ulg stored_len, int last) {
ulg opt_lenb, static_lenb; /* opt_len and static_len in bytes */
int max_blindex = 0; /* index of last bit length code of non zero freq */
@@ -943,14 +1022,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
max_blindex = build_bl_tree(s);
/* Determine the best encoding. Compute the block lengths in bytes. */
opt_lenb = (s->opt_len+3+7)>>3;
static_lenb = (s->static_len+3+7)>>3;
opt_lenb = (s->opt_len + 3 + 7) >> 3;
static_lenb = (s->static_len + 3 + 7) >> 3;
Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
s->sym_next / 3));
if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
#ifndef FORCE_STATIC
if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
#endif
opt_lenb = static_lenb;
} else {
Assert(buf != (char*)0, "lost buf");
@@ -960,7 +1042,7 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
#ifdef FORCE_STORED
if (buf != (char*)0) { /* force stored block */
#else
if (stored_len+4 <= opt_lenb && buf != (char*)0) {
if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
/* 4: two words for the lengths */
#endif
/* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
@@ -971,21 +1053,17 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
*/
_tr_stored_block(s, buf, stored_len, last);
#ifdef FORCE_STATIC
} else if (static_lenb >= 0) { /* force static trees */
#else
} else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
#endif
send_bits(s, (STATIC_TREES<<1)+last, 3);
} else if (static_lenb == opt_lenb) {
send_bits(s, (STATIC_TREES<<1) + last, 3);
compress_block(s, (const ct_data *)static_ltree,
(const ct_data *)static_dtree);
#ifdef ZLIB_DEBUG
s->compressed_len += 3 + s->static_len;
#endif
} else {
send_bits(s, (DYN_TREES<<1)+last, 3);
send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
max_blindex+1);
send_bits(s, (DYN_TREES<<1) + last, 3);
send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
max_blindex + 1);
compress_block(s, (const ct_data *)s->dyn_ltree,
(const ct_data *)s->dyn_dtree);
#ifdef ZLIB_DEBUG
@@ -1004,22 +1082,23 @@ void ZLIB_INTERNAL _tr_flush_block(s, buf, stored_len, last)
s->compressed_len += 7; /* align on byte boundary */
#endif
}
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
s->compressed_len-7*last));
Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
s->compressed_len - 7*last));
}
/* ===========================================================================
* Save the match info and tally the frequency counts. Return true if
* the current block must be flushed.
*/
int ZLIB_INTERNAL _tr_tally (s, dist, lc)
deflate_state *s;
unsigned dist; /* distance of matched string */
unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
{
s->sym_buf[s->sym_next++] = dist;
s->sym_buf[s->sym_next++] = dist >> 8;
s->sym_buf[s->sym_next++] = lc;
int ZLIB_INTERNAL _tr_tally(deflate_state *s, unsigned dist, unsigned lc) {
#ifdef LIT_MEM
s->d_buf[s->sym_next] = (ush)dist;
s->l_buf[s->sym_next++] = (uch)lc;
#else
s->sym_buf[s->sym_next++] = (uch)dist;
s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
s->sym_buf[s->sym_next++] = (uch)lc;
#endif
if (dist == 0) {
/* lc is the unmatched char */
s->dyn_ltree[lc].Freq++;
@@ -1031,152 +1110,8 @@ int ZLIB_INTERNAL _tr_tally (s, dist, lc)
(ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
(ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
s->dyn_ltree[_length_code[lc] + LITERALS + 1].Freq++;
s->dyn_dtree[d_code(dist)].Freq++;
}
return (s->sym_next == s->sym_end);
}
/* ===========================================================================
* Send the block data compressed using the given Huffman trees
*/
local void compress_block(s, ltree, dtree)
deflate_state *s;
const ct_data *ltree; /* literal tree */
const ct_data *dtree; /* distance tree */
{
unsigned dist; /* distance of matched string */
int lc; /* match length or unmatched char (if dist == 0) */
unsigned sx = 0; /* running index in sym_buf */
unsigned code; /* the code to send */
int extra; /* number of extra bits to send */
if (s->sym_next != 0) do {
dist = s->sym_buf[sx++] & 0xff;
dist += (unsigned)(s->sym_buf[sx++] & 0xff) << 8;
lc = s->sym_buf[sx++];
if (dist == 0) {
send_code(s, lc, ltree); /* send a literal byte */
Tracecv(isgraph(lc), (stderr," '%c' ", lc));
} else {
/* Here, lc is the match length - MIN_MATCH */
code = _length_code[lc];
send_code(s, code+LITERALS+1, ltree); /* send the length code */
extra = extra_lbits[code];
if (extra != 0) {
lc -= base_length[code];
send_bits(s, lc, extra); /* send the extra length bits */
}
dist--; /* dist is now the match distance - 1 */
code = d_code(dist);
Assert (code < D_CODES, "bad d_code");
send_code(s, code, dtree); /* send the distance code */
extra = extra_dbits[code];
if (extra != 0) {
dist -= (unsigned)base_dist[code];
send_bits(s, dist, extra); /* send the extra distance bits */
}
} /* literal or match pair ? */
/* Check that the overlay between pending_buf and sym_buf is ok: */
Assert(s->pending < s->lit_bufsize + sx, "pendingBuf overflow");
} while (sx < s->sym_next);
send_code(s, END_BLOCK, ltree);
}
/* ===========================================================================
* Check if the data type is TEXT or BINARY, using the following algorithm:
* - TEXT if the two conditions below are satisfied:
* a) There are no non-portable control characters belonging to the
* "block list" (0..6, 14..25, 28..31).
* b) There is at least one printable character belonging to the
* "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
* - BINARY otherwise.
* - The following partially-portable control characters form a
* "gray list" that is ignored in this detection algorithm:
* (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
* IN assertion: the fields Freq of dyn_ltree are set.
*/
local int detect_data_type(s)
deflate_state *s;
{
/* block_mask is the bit mask of block-listed bytes
* set bits 0..6, 14..25, and 28..31
* 0xf3ffc07f = binary 11110011111111111100000001111111
*/
unsigned long block_mask = 0xf3ffc07fUL;
int n;
/* Check for non-textual ("block-listed") bytes. */
for (n = 0; n <= 31; n++, block_mask >>= 1)
if ((block_mask & 1) && (s->dyn_ltree[n].Freq != 0))
return Z_BINARY;
/* Check for textual ("allow-listed") bytes. */
if (s->dyn_ltree[9].Freq != 0 || s->dyn_ltree[10].Freq != 0
|| s->dyn_ltree[13].Freq != 0)
return Z_TEXT;
for (n = 32; n < LITERALS; n++)
if (s->dyn_ltree[n].Freq != 0)
return Z_TEXT;
/* There are no "block-listed" or "allow-listed" bytes:
* this stream either is empty or has tolerated ("gray-listed") bytes only.
*/
return Z_BINARY;
}
/* ===========================================================================
* Reverse the first len bits of a code, using straightforward code (a faster
* method would use a table)
* IN assertion: 1 <= len <= 15
*/
local unsigned bi_reverse(code, len)
unsigned code; /* the value to invert */
int len; /* its bit length */
{
register unsigned res = 0;
do {
res |= code & 1;
code >>= 1, res <<= 1;
} while (--len > 0);
return res >> 1;
}
/* ===========================================================================
* Flush the bit buffer, keeping at most 7 bits in it.
*/
local void bi_flush(s)
deflate_state *s;
{
if (s->bi_valid == 16) {
put_short(s, s->bi_buf);
s->bi_buf = 0;
s->bi_valid = 0;
} else if (s->bi_valid >= 8) {
put_byte(s, (Byte)s->bi_buf);
s->bi_buf >>= 8;
s->bi_valid -= 8;
}
}
/* ===========================================================================
* Flush the bit buffer and align the output on a byte boundary
*/
local void bi_windup(s)
deflate_state *s;
{
if (s->bi_valid > 8) {
put_short(s, s->bi_buf);
} else if (s->bi_valid > 0) {
put_byte(s, (Byte)s->bi_buf);
}
s->bi_buf = 0;
s->bi_valid = 0;
#ifdef ZLIB_DEBUG
s->bits_sent = (s->bits_sent+7) & ~7;
#endif
}
+4 -12
View File
@@ -24,12 +24,8 @@
Z_DATA_ERROR if the input data was corrupted, including if the input data is
an incomplete zlib stream.
*/
int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong *sourceLen;
{
int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong *sourceLen) {
z_stream stream;
int err;
const uInt max = (uInt)-1;
@@ -83,11 +79,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
err;
}
int ZEXPORT uncompress (dest, destLen, source, sourceLen)
Bytef *dest;
uLongf *destLen;
const Bytef *source;
uLong sourceLen;
{
int ZEXPORT uncompress(Bytef *dest, uLongf *destLen, const Bytef *source,
uLong sourceLen) {
return uncompress2(dest, destLen, source, &sourceLen);
}
+23 -14
View File
@@ -1,5 +1,5 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -38,6 +38,9 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define crc32_combine_gen z_crc32_combine_gen
# define crc32_combine_gen64 z_crc32_combine_gen64
# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
@@ -238,7 +241,11 @@
#endif
#ifdef Z_SOLO
typedef unsigned long z_size_t;
# ifdef _WIN64
typedef unsigned long long z_size_t;
# else
typedef unsigned long z_size_t;
# endif
#else
# define z_longlong long long
# if defined(NO_SIZE_T)
@@ -293,14 +300,6 @@
# endif
#endif
#ifndef Z_ARG /* function prototypes for stdarg */
# if defined(STDC) || defined(Z_HAVE_STDARG_H)
# define Z_ARG(args) args
# else
# define Z_ARG(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
@@ -349,6 +348,9 @@
# ifdef FAR
# undef FAR
# endif
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# include <windows.h>
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -467,11 +469,18 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE
#endif
#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
# define Z_HAVE_UNISTD_H
#ifndef Z_HAVE_UNISTD_H
# ifdef __WATCOMC__
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_HAVE_UNISTD_H
# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
# define Z_HAVE_UNISTD_H
# endif
#endif
#ifndef Z_SOLO
# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
# if defined(Z_HAVE_UNISTD_H)
# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include <unixio.h> /* for off_t */
@@ -507,7 +516,7 @@ typedef uLong FAR uLongf;
#if !defined(_WIN32) && defined(Z_LARGE64)
# define z_off64_t off64_t
#else
# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
# if defined(_WIN32) && !defined(__GNUC__)
# define z_off64_t __int64
# else
# define z_off64_t z_off_t
+202 -199
View File
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.12, March 11th, 2022
version 1.3.1, January 22nd, 2024
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -37,11 +37,11 @@
extern "C" {
#endif
#define ZLIB_VERSION "1.2.12"
#define ZLIB_VERNUM 0x12c0
#define ZLIB_VERSION "1.3.1"
#define ZLIB_VERNUM 0x1310
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 12
#define ZLIB_VER_MINOR 3
#define ZLIB_VER_REVISION 1
#define ZLIB_VER_SUBREVISION 0
/*
@@ -78,8 +78,8 @@ extern "C" {
even in the case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address));
typedef voidpf (*alloc_func)(voidpf opaque, uInt items, uInt size);
typedef void (*free_func)(voidpf opaque, voidpf address);
struct internal_state;
@@ -217,7 +217,7 @@ typedef gz_header FAR *gz_headerp;
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
ZEXTERN const char * ZEXPORT zlibVersion(void);
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is not
compatible with the zlib.h header file used by the application. This check
@@ -225,12 +225,12 @@ ZEXTERN const char * ZEXPORT zlibVersion OF((void));
*/
/*
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
ZEXTERN int ZEXPORT deflateInit(z_streamp strm, int level);
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller. If
zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
allocation functions.
allocation functions. total_in, total_out, adler, and msg are initialized.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at all
@@ -247,7 +247,7 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
*/
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
ZEXTERN int ZEXPORT deflate(z_streamp strm, int flush);
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
@@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
== 0), or after each call of deflate(). If deflate returns Z_OK and with
zero avail_out, it must be called again after making room in the output
buffer because there might be more output pending. See deflatePending(),
which can be used if desired to determine whether or not there is more ouput
which can be used if desired to determine whether or not there is more output
in that case.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
@@ -320,8 +320,8 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
avail_out is greater than six to avoid repeated flush markers due to
avail_out == 0 on return.
avail_out is greater than six when the flush marker begins, in order to avoid
repeated flush markers upon calling deflate() again when avail_out == 0.
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there was
@@ -360,7 +360,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
*/
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
ZEXTERN int ZEXPORT deflateEnd(z_streamp strm);
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any pending
@@ -375,7 +375,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
ZEXTERN int ZEXPORT inflateInit(z_streamp strm);
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
@@ -383,7 +383,8 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
read or consumed. The allocation of a sliding window will be deferred to
the first call of inflate (if the decompression does not complete on the
first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
them to use default allocation functions.
them to use default allocation functions. total_in, total_out, adler, and
msg are initialized.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
@@ -397,7 +398,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
*/
ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
ZEXTERN int ZEXPORT inflate(z_streamp strm, int flush);
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce
@@ -517,7 +518,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
*/
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
ZEXTERN int ZEXPORT inflateEnd(z_streamp strm);
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any pending
@@ -535,12 +536,12 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
*/
/*
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));
ZEXTERN int ZEXPORT deflateInit2(z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy);
This is another version of deflateInit with more compression options. The
fields zalloc, zfree and opaque must be initialized before by the caller.
@@ -607,9 +608,9 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
ZEXTERN int ZEXPORT deflateSetDictionary(z_streamp strm,
const Bytef *dictionary,
uInt dictLength);
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. When using the zlib format, this
@@ -651,16 +652,16 @@ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
not perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
Bytef *dictionary,
uInt *dictLength));
ZEXTERN int ZEXPORT deflateGetDictionary(z_streamp strm,
Bytef *dictionary,
uInt *dictLength);
/*
Returns the sliding dictionary being maintained by deflate. dictLength is
set to the number of bytes in the dictionary, and that many bytes are copied
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If deflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
Similary, if dictLength is Z_NULL, then it is not set.
Similarly, if dictLength is Z_NULL, then it is not set.
deflateGetDictionary() may return a length less than the window size, even
when more than the window size in input has been provided. It may return up
@@ -673,8 +674,8 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
stream state is inconsistent.
*/
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
z_streamp source));
ZEXTERN int ZEXPORT deflateCopy(z_streamp dest,
z_streamp source);
/*
Sets the destination stream as a complete copy of the source stream.
@@ -691,20 +692,20 @@ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
destination.
*/
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
ZEXTERN int ZEXPORT deflateReset(z_streamp strm);
/*
This function is equivalent to deflateEnd followed by deflateInit, but
does not free and reallocate the internal compression state. The stream
will leave the compression level and any other attributes that may have been
set unchanged.
set unchanged. total_in, total_out, adler, and msg are initialized.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
int level,
int strategy));
ZEXTERN int ZEXPORT deflateParams(z_streamp strm,
int level,
int strategy);
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2(). This can be
@@ -729,7 +730,7 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
Then no more input data should be provided before the deflateParams() call.
If this is done, the old level and strategy will be applied to the data
compressed before deflateParams(), and the new level and strategy will be
applied to the the data compressed after deflateParams().
applied to the data compressed after deflateParams().
deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
@@ -740,11 +741,11 @@ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
retried with more output space.
*/
ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
int good_length,
int max_lazy,
int nice_length,
int max_chain));
ZEXTERN int ZEXPORT deflateTune(z_streamp strm,
int good_length,
int max_lazy,
int nice_length,
int max_chain);
/*
Fine tune deflate's internal compression parameters. This should only be
used by someone who understands the algorithm used by zlib's deflate for
@@ -757,8 +758,8 @@ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
*/
ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
uLong sourceLen));
ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm,
uLong sourceLen);
/*
deflateBound() returns an upper bound on the compressed size after
deflation of sourceLen bytes. It must be called after deflateInit() or
@@ -772,9 +773,9 @@ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
than Z_FINISH or Z_NO_FLUSH are used.
*/
ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
unsigned *pending,
int *bits));
ZEXTERN int ZEXPORT deflatePending(z_streamp strm,
unsigned *pending,
int *bits);
/*
deflatePending() returns the number of bytes and bits of output that have
been generated, but not yet provided in the available output. The bytes not
@@ -787,9 +788,9 @@ ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
stream state was inconsistent.
*/
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
int bits,
int value));
ZEXTERN int ZEXPORT deflatePrime(z_streamp strm,
int bits,
int value);
/*
deflatePrime() inserts bits in the deflate output stream. The intent
is that this function is used to start off the deflate output with the bits
@@ -804,8 +805,8 @@ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
source stream state was inconsistent.
*/
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
gz_headerp head));
ZEXTERN int ZEXPORT deflateSetHeader(z_streamp strm,
gz_headerp head);
/*
deflateSetHeader() provides gzip header information for when a gzip
stream is requested by deflateInit2(). deflateSetHeader() may be called
@@ -821,16 +822,17 @@ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
gzip file" and give up.
If deflateSetHeader is not used, the default gzip header has text false,
the time set to zero, and os set to 255, with no extra, name, or comment
fields. The gzip header is returned to the default state by deflateReset().
the time set to zero, and os set to the current operating system, with no
extra, name, or comment fields. The gzip header is returned to the default
state by deflateReset().
deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent.
*/
/*
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
ZEXTERN int ZEXPORT inflateInit2(z_streamp strm,
int windowBits);
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
@@ -883,9 +885,9 @@ ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
deferred until inflate() is called.
*/
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
ZEXTERN int ZEXPORT inflateSetDictionary(z_streamp strm,
const Bytef *dictionary,
uInt dictLength);
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate,
@@ -906,22 +908,22 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
inflate().
*/
ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
Bytef *dictionary,
uInt *dictLength));
ZEXTERN int ZEXPORT inflateGetDictionary(z_streamp strm,
Bytef *dictionary,
uInt *dictLength);
/*
Returns the sliding dictionary being maintained by inflate. dictLength is
set to the number of bytes in the dictionary, and that many bytes are copied
to dictionary. dictionary must have enough space, where 32768 bytes is
always enough. If inflateGetDictionary() is called with dictionary equal to
Z_NULL, then only the dictionary length is returned, and nothing is copied.
Similary, if dictLength is Z_NULL, then it is not set.
Similarly, if dictLength is Z_NULL, then it is not set.
inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
stream state is inconsistent.
*/
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
ZEXTERN int ZEXPORT inflateSync(z_streamp strm);
/*
Skips invalid compressed data until a possible full flush point (see above
for the description of deflate with Z_FULL_FLUSH) can be found, or until all
@@ -934,14 +936,14 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
inflateSync returns Z_OK if a possible full flush point has been found,
Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
In the success case, the application may save the current current value of
total_in which indicates where valid compressed data was found. In the
error case, the application may repeatedly call inflateSync, providing more
input each time, until success or end of the input data.
In the success case, the application may save the current value of total_in
which indicates where valid compressed data was found. In the error case,
the application may repeatedly call inflateSync, providing more input each
time, until success or end of the input data.
*/
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
z_streamp source));
ZEXTERN int ZEXPORT inflateCopy(z_streamp dest,
z_streamp source);
/*
Sets the destination stream as a complete copy of the source stream.
@@ -956,18 +958,19 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
destination.
*/
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
ZEXTERN int ZEXPORT inflateReset(z_streamp strm);
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate the internal decompression state. The
stream will keep attributes that may have been set by inflateInit2.
total_in, total_out, adler, and msg are initialized.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
int windowBits));
ZEXTERN int ZEXPORT inflateReset2(z_streamp strm,
int windowBits);
/*
This function is the same as inflateReset, but it also permits changing
the wrap and window size requests. The windowBits parameter is interpreted
@@ -980,9 +983,9 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
the windowBits parameter is invalid.
*/
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
int bits,
int value));
ZEXTERN int ZEXPORT inflatePrime(z_streamp strm,
int bits,
int value);
/*
This function inserts bits in the inflate input stream. The intent is
that this function is used to start inflating at a bit position in the
@@ -1001,7 +1004,7 @@ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
stream state was inconsistent.
*/
ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
ZEXTERN long ZEXPORT inflateMark(z_streamp strm);
/*
This function returns two values, one in the lower 16 bits of the return
value, and the other in the remaining upper bits, obtained by shifting the
@@ -1029,8 +1032,8 @@ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
source stream state was inconsistent.
*/
ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
gz_headerp head));
ZEXTERN int ZEXPORT inflateGetHeader(z_streamp strm,
gz_headerp head);
/*
inflateGetHeader() requests that gzip header information be stored in the
provided gz_header structure. inflateGetHeader() may be called after
@@ -1070,8 +1073,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
*/
/*
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
unsigned char FAR *window));
ZEXTERN int ZEXPORT inflateBackInit(z_streamp strm, int windowBits,
unsigned char FAR *window);
Initialize the internal stream state for decompression using inflateBack()
calls. The fields zalloc, zfree and opaque in strm must be initialized
@@ -1091,13 +1094,13 @@ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
the version of the header file.
*/
typedef unsigned (*in_func) OF((void FAR *,
z_const unsigned char FAR * FAR *));
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
typedef unsigned (*in_func)(void FAR *,
z_const unsigned char FAR * FAR *);
typedef int (*out_func)(void FAR *, unsigned char FAR *, unsigned);
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
in_func in, void FAR *in_desc,
out_func out, void FAR *out_desc));
ZEXTERN int ZEXPORT inflateBack(z_streamp strm,
in_func in, void FAR *in_desc,
out_func out, void FAR *out_desc);
/*
inflateBack() does a raw inflate with a single call using a call-back
interface for input and output. This is potentially more efficient than
@@ -1165,7 +1168,7 @@ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
cannot return Z_OK.
*/
ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
ZEXTERN int ZEXPORT inflateBackEnd(z_streamp strm);
/*
All memory allocated by inflateBackInit() is freed.
@@ -1173,7 +1176,7 @@ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
state was inconsistent.
*/
ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
ZEXTERN uLong ZEXPORT zlibCompileFlags(void);
/* Return flags indicating compile-time options.
Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
@@ -1226,8 +1229,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
you need special options.
*/
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
ZEXTERN int ZEXPORT compress(Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen);
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
@@ -1241,9 +1244,9 @@ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
buffer.
*/
ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level));
ZEXTERN int ZEXPORT compress2(Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level);
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
@@ -1257,15 +1260,15 @@ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
Z_STREAM_ERROR if the level parameter is invalid.
*/
ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen);
/*
compressBound() returns an upper bound on the compressed size after
compress() or compress2() on sourceLen bytes. It would be used before a
compress() or compress2() call to allocate the destination buffer.
*/
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
ZEXTERN int ZEXPORT uncompress(Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen);
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total size
@@ -1282,8 +1285,8 @@ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
buffer with the uncompressed data up to that point.
*/
ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong *sourceLen));
ZEXTERN int ZEXPORT uncompress2(Bytef *dest, uLongf *destLen,
const Bytef *source, uLong *sourceLen);
/*
Same as uncompress, except that sourceLen is a pointer, where the
length of the source is *sourceLen. On return, *sourceLen is the number of
@@ -1302,7 +1305,7 @@ ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
/*
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
ZEXTERN gzFile ZEXPORT gzopen(const char *path, const char *mode);
Open the gzip (.gz) file at path for reading and decompressing, or
compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
@@ -1339,7 +1342,7 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
file could not be opened.
*/
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
ZEXTERN gzFile ZEXPORT gzdopen(int fd, const char *mode);
/*
Associate a gzFile with the file descriptor fd. File descriptors are
obtained from calls like open, dup, creat, pipe or fileno (if the file has
@@ -1362,7 +1365,7 @@ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
will not detect if fd is invalid (unless fd is -1).
*/
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
ZEXTERN int ZEXPORT gzbuffer(gzFile file, unsigned size);
/*
Set the internal buffer size used by this library's functions for file to
size. The default buffer size is 8192 bytes. This function must be called
@@ -1378,7 +1381,7 @@ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
too late.
*/
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
ZEXTERN int ZEXPORT gzsetparams(gzFile file, int level, int strategy);
/*
Dynamically update the compression level and strategy for file. See the
description of deflateInit2 for the meaning of these parameters. Previously
@@ -1389,7 +1392,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
or Z_MEM_ERROR if there is a memory allocation error.
*/
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
ZEXTERN int ZEXPORT gzread(gzFile file, voidp buf, unsigned len);
/*
Read and decompress up to len uncompressed bytes from file into buf. If
the input file is not in gzip format, gzread copies the given number of
@@ -1419,8 +1422,8 @@ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
Z_STREAM_ERROR.
*/
ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
gzFile file));
ZEXTERN z_size_t ZEXPORT gzfread(voidp buf, z_size_t size, z_size_t nitems,
gzFile file);
/*
Read and decompress up to nitems items of size size from file into buf,
otherwise operating as gzread() does. This duplicates the interface of
@@ -1437,22 +1440,22 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
In the event that the end of file is reached and only a partial item is
available at the end, i.e. the remaining uncompressed data length is not a
multiple of size, then the final partial item is nevetheless read into buf
multiple of size, then the final partial item is nevertheless read into buf
and the end-of-file flag is set. The length of the partial item read is not
provided, but could be inferred from the result of gztell(). This behavior
is the same as the behavior of fread() implementations in common libraries,
but it prevents the direct use of gzfread() to read a concurrently written
file, reseting and retrying on end-of-file, when size is not 1.
file, resetting and retrying on end-of-file, when size is not 1.
*/
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
ZEXTERN int ZEXPORT gzwrite(gzFile file, voidpc buf, unsigned len);
/*
Compress and write the len uncompressed bytes at buf to file. gzwrite
returns the number of uncompressed bytes written or 0 in case of error.
*/
ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
z_size_t nitems, gzFile file));
ZEXTERN z_size_t ZEXPORT gzfwrite(voidpc buf, z_size_t size,
z_size_t nitems, gzFile file);
/*
Compress and write nitems items of size size from buf to file, duplicating
the interface of stdio's fwrite(), with size_t request and return types. If
@@ -1465,7 +1468,7 @@ ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
is returned, and the error state is set to Z_STREAM_ERROR.
*/
ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
ZEXTERN int ZEXPORTVA gzprintf(gzFile file, const char *format, ...);
/*
Convert, format, compress, and write the arguments (...) to file under
control of the string format, as in fprintf. gzprintf returns the number of
@@ -1480,7 +1483,7 @@ ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
This can be determined using zlibCompileFlags().
*/
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
ZEXTERN int ZEXPORT gzputs(gzFile file, const char *s);
/*
Compress and write the given null-terminated string s to file, excluding
the terminating null character.
@@ -1488,7 +1491,7 @@ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
gzputs returns the number of characters written, or -1 in case of error.
*/
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
ZEXTERN char * ZEXPORT gzgets(gzFile file, char *buf, int len);
/*
Read and decompress bytes from file into buf, until len-1 characters are
read, or until a newline character is read and transferred to buf, or an
@@ -1502,13 +1505,13 @@ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
buf are indeterminate.
*/
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
ZEXTERN int ZEXPORT gzputc(gzFile file, int c);
/*
Compress and write c, converted to an unsigned char, into file. gzputc
returns the value that was written, or -1 in case of error.
*/
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
ZEXTERN int ZEXPORT gzgetc(gzFile file);
/*
Read and decompress one byte from file. gzgetc returns this byte or -1
in case of end of file or error. This is implemented as a macro for speed.
@@ -1517,7 +1520,7 @@ ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
points to has been clobbered or not.
*/
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
ZEXTERN int ZEXPORT gzungetc(int c, gzFile file);
/*
Push c back onto the stream for file to be read as the first character on
the next read. At least one character of push-back is always allowed.
@@ -1529,7 +1532,7 @@ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
gzseek() or gzrewind().
*/
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
ZEXTERN int ZEXPORT gzflush(gzFile file, int flush);
/*
Flush all pending output to file. The parameter flush is as in the
deflate() function. The return value is the zlib error number (see function
@@ -1545,8 +1548,8 @@ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
*/
/*
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
z_off_t offset, int whence));
ZEXTERN z_off_t ZEXPORT gzseek(gzFile file,
z_off_t offset, int whence);
Set the starting position to offset relative to whence for the next gzread
or gzwrite on file. The offset represents a number of bytes in the
@@ -1564,7 +1567,7 @@ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
would be before the current position.
*/
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
ZEXTERN int ZEXPORT gzrewind(gzFile file);
/*
Rewind file. This function is supported only for reading.
@@ -1572,7 +1575,7 @@ ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
*/
/*
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
ZEXTERN z_off_t ZEXPORT gztell(gzFile file);
Return the starting position for the next gzread or gzwrite on file.
This position represents a number of bytes in the uncompressed data stream,
@@ -1583,7 +1586,7 @@ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
*/
/*
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
ZEXTERN z_off_t ZEXPORT gzoffset(gzFile file);
Return the current compressed (actual) read or write offset of file. This
offset includes the count of bytes that precede the gzip stream, for example
@@ -1592,7 +1595,7 @@ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
be used for a progress indicator. On error, gzoffset() returns -1.
*/
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
ZEXTERN int ZEXPORT gzeof(gzFile file);
/*
Return true (1) if the end-of-file indicator for file has been set while
reading, false (0) otherwise. Note that the end-of-file indicator is set
@@ -1607,7 +1610,7 @@ ZEXTERN int ZEXPORT gzeof OF((gzFile file));
has grown since the previous end of file was detected.
*/
ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
ZEXTERN int ZEXPORT gzdirect(gzFile file);
/*
Return true (1) if file is being copied directly while reading, or false
(0) if file is a gzip stream being decompressed.
@@ -1628,7 +1631,7 @@ ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
gzip file reading and decompression, which may not be desired.)
*/
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
ZEXTERN int ZEXPORT gzclose(gzFile file);
/*
Flush all pending output for file, if necessary, close file and
deallocate the (de)compression state. Note that once file is closed, you
@@ -1641,8 +1644,8 @@ ZEXTERN int ZEXPORT gzclose OF((gzFile file));
last read ended in the middle of a gzip stream, or Z_OK on success.
*/
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
ZEXTERN int ZEXPORT gzclose_r(gzFile file);
ZEXTERN int ZEXPORT gzclose_w(gzFile file);
/*
Same as gzclose(), but gzclose_r() is only for use when reading, and
gzclose_w() is only for use when writing or appending. The advantage to
@@ -1653,7 +1656,7 @@ ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
zlib library.
*/
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
ZEXTERN const char * ZEXPORT gzerror(gzFile file, int *errnum);
/*
Return the error message for the last error which occurred on file.
errnum is set to zlib error number. If an error occurred in the file system
@@ -1669,7 +1672,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
functions above that do not distinguish those cases in their return values.
*/
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
ZEXTERN void ZEXPORT gzclearerr(gzFile file);
/*
Clear the error and end-of-file flags for file. This is analogous to the
clearerr() function in stdio. This is useful for continuing to read a gzip
@@ -1686,7 +1689,7 @@ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
library.
*/
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. An Adler-32 value is in the range of a 32-bit
@@ -1706,15 +1709,15 @@ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
z_size_t len));
ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,
z_size_t len);
/*
Same as adler32(), but with a size_t length.
*/
/*
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
z_off_t len2));
ZEXTERN uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2,
z_off_t len2);
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
@@ -1724,7 +1727,7 @@ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
negative, the result has no meaning or utility.
*/
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
/*
Update a running CRC-32 with the bytes buf[0..len-1] and return the
updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
@@ -1742,30 +1745,30 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
if (crc != original_crc) error();
*/
ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
z_size_t len));
ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,
z_size_t len);
/*
Same as crc32(), but with a size_t length.
*/
/*
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
ZEXTERN uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2);
Combine two CRC-32 check values into one. For two sequences of bytes,
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
len2.
len2. len2 must be non-negative.
*/
/*
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t len2);
Return the operator corresponding to length len2, to be used with
crc32_combine_op().
crc32_combine_op(). len2 must be non-negative.
*/
ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
/*
Give the same result as crc32_combine(), using op in place of len2. op is
is generated from len2 by crc32_combine_gen(). This will be faster than
@@ -1778,20 +1781,20 @@ ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
const char *version, int stream_size));
ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
int windowBits, int memLevel,
int strategy, const char *version,
int stream_size));
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
unsigned char FAR *window,
const char *version,
int stream_size));
ZEXTERN int ZEXPORT deflateInit_(z_streamp strm, int level,
const char *version, int stream_size);
ZEXTERN int ZEXPORT inflateInit_(z_streamp strm,
const char *version, int stream_size);
ZEXTERN int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
int windowBits, int memLevel,
int strategy, const char *version,
int stream_size);
ZEXTERN int ZEXPORT inflateInit2_(z_streamp strm, int windowBits,
const char *version, int stream_size);
ZEXTERN int ZEXPORT inflateBackInit_(z_streamp strm, int windowBits,
unsigned char FAR *window,
const char *version,
int stream_size);
#ifdef Z_PREFIX_SET
# define z_deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
@@ -1836,7 +1839,7 @@ struct gzFile_s {
unsigned char *next;
z_off64_t pos;
};
ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
ZEXTERN int ZEXPORT gzgetc_(gzFile file); /* backward compatibility */
#ifdef Z_PREFIX_SET
# undef z_gzgetc
# define z_gzgetc(g) \
@@ -1853,13 +1856,13 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
* without large file support, _LFS64_LARGEFILE must also be true
*/
#ifdef Z_LARGE64
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
ZEXTERN z_off64_t ZEXPORT gzseek64(gzFile, z_off64_t, int);
ZEXTERN z_off64_t ZEXPORT gztell64(gzFile);
ZEXTERN z_off64_t ZEXPORT gzoffset64(gzFile);
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
#endif
#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
@@ -1881,50 +1884,50 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
# define crc32_combine_gen crc32_combine_gen64
# endif
# ifndef Z_LARGE64
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
ZEXTERN gzFile ZEXPORT gzopen64(const char *, const char *);
ZEXTERN z_off_t ZEXPORT gzseek64(gzFile, z_off_t, int);
ZEXTERN z_off_t ZEXPORT gztell64(gzFile);
ZEXTERN z_off_t ZEXPORT gzoffset64(gzFile);
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
# endif
#else
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
ZEXTERN gzFile ZEXPORT gzopen(const char *, const char *);
ZEXTERN z_off_t ZEXPORT gzseek(gzFile, z_off_t, int);
ZEXTERN z_off_t ZEXPORT gztell(gzFile);
ZEXTERN z_off_t ZEXPORT gzoffset(gzFile);
ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
#endif
#else /* Z_SOLO */
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
#endif /* !Z_SOLO */
/* undocumented functions */
ZEXTERN const char * ZEXPORT zError OF((int));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
ZEXTERN const char * ZEXPORT zError(int);
ZEXTERN int ZEXPORT inflateSyncPoint(z_streamp);
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table(void);
ZEXTERN int ZEXPORT inflateUndermine(z_streamp, int);
ZEXTERN int ZEXPORT inflateValidate(z_streamp, int);
ZEXTERN unsigned long ZEXPORT inflateCodesUsed(z_streamp);
ZEXTERN int ZEXPORT inflateResetKeep(z_streamp);
ZEXTERN int ZEXPORT deflateResetKeep(z_streamp);
#if defined(_WIN32) && !defined(Z_SOLO)
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
const char *mode));
ZEXTERN gzFile ZEXPORT gzopen_w(const wchar_t *path,
const char *mode);
#endif
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
# ifndef Z_SOLO
ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
const char *format,
va_list va));
ZEXTERN int ZEXPORTVA gzvprintf(gzFile file,
const char *format,
va_list va);
# endif
#endif
+18 -44
View File
@@ -24,13 +24,11 @@ z_const char * const z_errmsg[10] = {
};
const char * ZEXPORT zlibVersion()
{
const char * ZEXPORT zlibVersion(void) {
return ZLIB_VERSION;
}
uLong ZEXPORT zlibCompileFlags()
{
uLong ZEXPORT zlibCompileFlags(void) {
uLong flags;
flags = 0;
@@ -61,9 +59,11 @@ uLong ZEXPORT zlibCompileFlags()
#ifdef ZLIB_DEBUG
flags += 1 << 8;
#endif
/*
#if defined(ASMV) || defined(ASMINF)
flags += 1 << 9;
#endif
*/
#ifdef ZLIB_WINAPI
flags += 1 << 10;
#endif
@@ -119,9 +119,7 @@ uLong ZEXPORT zlibCompileFlags()
# endif
int ZLIB_INTERNAL z_verbose = verbose;
void ZLIB_INTERNAL z_error (m)
char *m;
{
void ZLIB_INTERNAL z_error(char *m) {
fprintf(stderr, "%s\n", m);
exit(1);
}
@@ -130,9 +128,7 @@ void ZLIB_INTERNAL z_error (m)
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
const char * ZEXPORT zError(err)
int err;
{
const char * ZEXPORT zError(int err) {
return ERR_MSG(err);
}
@@ -146,22 +142,14 @@ const char * ZEXPORT zError(err)
#ifndef HAVE_MEMCPY
void ZLIB_INTERNAL zmemcpy(dest, source, len)
Bytef* dest;
const Bytef* source;
uInt len;
{
void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len) {
if (len == 0) return;
do {
*dest++ = *source++; /* ??? to be unrolled */
} while (--len != 0);
}
int ZLIB_INTERNAL zmemcmp(s1, s2, len)
const Bytef* s1;
const Bytef* s2;
uInt len;
{
int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len) {
uInt j;
for (j = 0; j < len; j++) {
@@ -170,10 +158,7 @@ int ZLIB_INTERNAL zmemcmp(s1, s2, len)
return 0;
}
void ZLIB_INTERNAL zmemzero(dest, len)
Bytef* dest;
uInt len;
{
void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len) {
if (len == 0) return;
do {
*dest++ = 0; /* ??? to be unrolled */
@@ -214,8 +199,7 @@ local ptr_table table[MAX_PTR];
* a protected system like OS/2. Use Microsoft C instead.
*/
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
{
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
voidpf buf;
ulg bsize = (ulg)items*size;
@@ -240,8 +224,7 @@ voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
return buf;
}
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
int n;
(void)opaque;
@@ -277,14 +260,12 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
# define _hfree hfree
#endif
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
{
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size) {
(void)opaque;
return _halloc((long)items, size);
}
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
(void)opaque;
_hfree(ptr);
}
@@ -297,25 +278,18 @@ void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
#ifndef STDC
extern voidp malloc OF((uInt size));
extern voidp calloc OF((uInt items, uInt size));
extern void free OF((voidpf ptr));
extern voidp malloc(uInt size);
extern voidp calloc(uInt items, uInt size);
extern void free(voidpf ptr);
#endif
voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
voidpf opaque;
unsigned items;
unsigned size;
{
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size) {
(void)opaque;
return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
(voidpf)calloc(items, size);
}
void ZLIB_INTERNAL zcfree (opaque, ptr)
voidpf opaque;
voidpf ptr;
{
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr) {
(void)opaque;
free(ptr);
}
+13 -33
View File
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
* Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -56,7 +56,7 @@ typedef unsigned long ulg;
extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_MSG(err) z_errmsg[(err) < -6 || (err) > 2 ? 9 : 2 - (err)]
#define ERR_RETURN(strm,err) \
return (strm->msg = ERR_MSG(err), (err))
@@ -137,17 +137,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
#if defined(MACOS)
# define OS_CODE 7
# ifndef Z_SOLO
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fdopen */
# else
# ifndef fdopen
# define fdopen(fd,mode) NULL /* No fdopen() */
# endif
# endif
# endif
#endif
#ifdef __acorn
@@ -170,18 +161,6 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define OS_CODE 19
#endif
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
# else
# define fdopen(fd,type) _fdopen(fd,type)
# endif
#endif
#if defined(__BORLANDC__) && !defined(MSDOS)
#pragma warn -8004
#pragma warn -8008
@@ -191,8 +170,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* provide prototypes for these when building zlib without LFS */
#if !defined(_WIN32) && \
(!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
#endif
/* common defaults */
@@ -231,16 +211,16 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
void ZLIB_INTERNAL zmemcpy(Bytef* dest, const Bytef* source, uInt len);
int ZLIB_INTERNAL zmemcmp(const Bytef* s1, const Bytef* s2, uInt len);
void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len);
#endif
/* Diagnostic functions */
#ifdef ZLIB_DEBUG
# include <stdio.h>
extern int ZLIB_INTERNAL z_verbose;
extern void ZLIB_INTERNAL z_error OF((char *m));
extern void ZLIB_INTERNAL z_error(char *m);
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
@@ -257,9 +237,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
#ifndef Z_SOLO
voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
unsigned size));
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items,
unsigned size);
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr);
#endif
#define ZALLOC(strm, items, size) \
+16 -1
View File
@@ -22,10 +22,21 @@
#include "Util.h"
#include <boost/algorithm/string/join.hpp>
#include <boost/iostreams/copy.hpp>
#include "boost/process.hpp"
#include <filesystem>
#if BOOST_VERSION < 108800
#include <boost/process.hpp>
using namespace boost::process;
#else
#include <boost/process/v1/args.hpp>
#include <boost/process/v1/child.hpp>
#include <boost/process/v1/env.hpp>
#include <boost/process/v1/exe.hpp>
#include <boost/process/v1/io.hpp>
#include <boost/process/v1/search_path.hpp>
using namespace boost::process::v1;
#endif
using namespace boost::iostreams;
namespace Acore
@@ -118,7 +129,11 @@ namespace Acore
exe = std::filesystem::absolute(executable).string(),
args = argsVector,
env = environment(boost::this_process::environment()),
#if BOOST_VERSION < 108800
std_in = boost::process::close,
#else
std_in = boost::process::v1::close,
#endif
std_out = outStream,
std_err = errStream
};
+1 -1
View File
@@ -246,7 +246,7 @@ void KeepDatabaseAliveHandler(std::weak_ptr<boost::asio::steady_timer> dbPingTim
{
if (std::shared_ptr<boost::asio::steady_timer> dbPingTimer = dbPingTimerRef.lock())
{
LOG_INFO("server.authserver", "Ping MySQL to keep connection alive");
LOG_DEBUG("sql.driver", "Ping MySQL to keep connection alive");
LoginDatabase.KeepAlive();
dbPingTimer->expires_at(Acore::Asio::SteadyTimer::GetExpirationTime(dbPingInterval));
@@ -3438,14 +3438,14 @@ Wintergrasp.Enable = 1
#
# Wintergrasp.PlayerMax
# Description: Maximum number of players allowed in Wintergrasp.
# Default: 100
# Description: Maximum number of players allowed in Wintergrasp per team.
# Default: 120
Wintergrasp.PlayerMax = 100
Wintergrasp.PlayerMax = 120
#
# Wintergrasp.PlayerMin
# Description: Minimum number of players required for Wintergrasp.
# Description: Minimum number of players required for Wintergrasp per team.
# Default: 0
Wintergrasp.PlayerMin = 0
@@ -3453,9 +3453,9 @@ Wintergrasp.PlayerMin = 0
#
# Wintergrasp.PlayerMinLvl
# Description: Required character level for the Wintergrasp battle.
# Default: 77
# Default: 75
Wintergrasp.PlayerMinLvl = 77
Wintergrasp.PlayerMinLvl = 75
#
# Wintergrasp.BattleTimer
@@ -4209,7 +4209,8 @@ AllowTwoSide.Interaction.Arena = 0
#
# AllowTwoSide.Interaction.Auction
# Description: Allow auctions between factions.
# Description: Allow auctions between factions. This flags all auction houses as Neutral,
# and would also take a Neutral auction house cut from auctions.
# Default: 0 - (Disabled)
# 1 - (Enabled)
+14 -1
View File
@@ -514,9 +514,22 @@ Unit* PetAI::SelectNextTarget(bool allowAutoSelect) const
// To prevent aggressive pets from chain selecting targets and running off, we
// only select a random target if certain conditions are met.
if (allowAutoSelect)
{
if (!me->GetCharmInfo()->IsReturning() || me->GetCharmInfo()->IsFollowing() || me->GetCharmInfo()->IsAtStay())
{
if (Unit* nearTarget = me->ToCreature()->SelectNearestTargetInAttackDistance(MAX_AGGRO_RADIUS))
return nearTarget;
{
if (nearTarget->IsPlayer() && nearTarget->ToPlayer()->IsPvP() && !owner->IsPvP()) // If owner is not PvP flagged and target is PvP flagged, do not attack
{
return nullptr; /// @todo: try for another target
}
else
{
return nearTarget;
}
}
}
}
// Default - no valid targets
return nullptr;
@@ -848,6 +848,7 @@ void SmartAI::AttackStart(Unit* who)
{
me->GetMotionMaster()->MovementExpired();
me->StopMoving();
me->GetMotionMaster()->Clear(false);
}
me->GetMotionMaster()->MoveChase(who);
+2 -2
View File
@@ -383,8 +383,8 @@ protected:
uint32 m_ZoneId; // ZoneID of Wintergrasp = 4197
uint32 m_MapId; // MapId where is Battlefield
Map* m_Map;
uint32 m_MaxPlayer; // Maximum number of player that participated to Battlefield
uint32 m_MinPlayer; // Minimum number of player for Battlefield start
uint32 m_MaxPlayer; // Maximum number of players per team that participated to Battlefield
uint32 m_MinPlayer; // Minimum number of players per team for Battlefield start
uint32 m_MinLevel; // Required level to participate at Battlefield
uint32 m_BattleTime; // Length of a battle
uint32 m_NoWarBattleTime; // Time between two battles
@@ -30,6 +30,7 @@
#include "Vehicle.h"
#include "WorldSession.h"
#include "WorldSessionMgr.h"
#include "WorldStateDefines.h"
#include "WorldStatePackets.h"
BattlefieldWG::~BattlefieldWG()
@@ -80,17 +81,17 @@ bool BattlefieldWG::SetupBattlefield()
SetGraveyardNumber(BATTLEFIELD_WG_GRAVEYARD_MAX);
// Load from db
if (!sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE) &&
!sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER) &&
if (!sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE) &&
!sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER) &&
!sWorld->getWorldState(ClockWorldState[0]))
{
sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, uint64(false));
sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, uint64(urand(0, 1)));
sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, uint64(false));
sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, uint64(urand(0, 1)));
sWorld->setWorldState(ClockWorldState[0], uint64(m_NoWarBattleTime));
}
m_isActive = bool(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE));
m_DefenderTeam = TeamId(sWorld->getWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER));
m_isActive = bool(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE));
m_DefenderTeam = TeamId(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER));
m_Timer = sWorld->getWorldState(ClockWorldState[0]);
if (m_isActive)
@@ -194,8 +195,8 @@ bool BattlefieldWG::Update(uint32 diff)
bool m_return = Battlefield::Update(diff);
if (m_saveTimer <= diff)
{
sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, m_isActive);
sWorld->setWorldState(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, m_DefenderTeam);
sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, m_isActive);
sWorld->setWorldState(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, m_DefenderTeam);
sWorld->setWorldState(ClockWorldState[0], m_Timer);
m_saveTimer = 60 * IN_MILLISECONDS;
}
@@ -327,10 +328,10 @@ void BattlefieldWG::UpdateVehicleCountWG()
for (GuidUnorderedSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
{
player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
player->SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A));
player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
player->SendUpdateWorldState(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A));
}
}
@@ -488,14 +489,14 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer)
if (!endByTimer) // win alli/horde
{
uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLDSTATE_ALLIANCE_KEEP_CAPTURED : WORLDSTATE_HORDE_KEEP_CAPTURED;
uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED : WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED;
sWorld->setWorldState(worldStateId, sWorld->getWorldState(worldStateId) + 1);
SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_WIN_KEEP : (BATTLEFIELD_WG_TEXT_WIN_KEEP + 2));
}
else // defend alli/horde
{
uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLDSTATE_ALLIANCE_KEEP_DEFENDED : WORLDSTATE_HORDE_KEEP_DEFENDED;
uint32 const worldStateId = GetDefenderTeam() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED : WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED;
sWorld->setWorldState(worldStateId, sWorld->getWorldState(worldStateId) + 1);
SendWarning((GetDefenderTeam() == TEAM_ALLIANCE) ? BATTLEFIELD_WG_TEXT_DEFEND_KEEP : (BATTLEFIELD_WG_TEXT_DEFEND_KEEP + 2));
@@ -941,27 +942,27 @@ void BattlefieldWG::FillInitialWorldStates(WorldPackets::WorldState::InitWorldSt
bool iconActive = timer < 15 * MINUTE || IsWarTime();
packet.Worldstates.reserve(4+4+WG_MAX_OBJ+WG_MAX_WORKSHOP);
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam());
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ATTACKER, GetAttackerTeam());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, GetDefenderTeam());
// Note: cleanup these two, their names look awkward
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, IsWarTime() ? 0 : 1);
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE, IsWarTime() ? 1 : 0);
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_CONTROL, m_DefenderTeam == TEAM_ALLIANCE ? 2 : 1); // Alliance 2, Hord 1
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_ICON_ACTIVE, iconActive ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, IsWarTime() ? 0 : 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_SHOW, IsWarTime() ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_CONTROL, m_DefenderTeam == TEAM_ALLIANCE ? 2 : 1); // Alliance 2, Hord 1
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ICON_ACTIVE, iconActive ? 1 : 0);
for (uint32 i = 0; i < 2; ++i)
packet.Worldstates.emplace_back(ClockWorldState[i], GameTime::GetGameTime().count() + timer);
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
packet.Worldstates.emplace_back(BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_VEHICLE_H));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_H));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_VEHICLE_A));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A, GetData(BATTLEFIELD_WG_DATA_MAX_VEHICLE_A));
packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_DEFENDED)));
packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_CAPTURED)));
packet.Worldstates.emplace_back(WORLDSTATE_HORDE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLDSTATE_HORDE_KEEP_DEFENDED)));
packet.Worldstates.emplace_back(WORLDSTATE_ALLIANCE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLDSTATE_ALLIANCE_KEEP_CAPTURED)));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED)));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED)));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED)));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED, uint32(sWorld->getWorldState(WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED)));
for (GameObjectBuilding::const_iterator itr = BuildingsInZone.begin(); itr != BuildingsInZone.end(); ++itr)
packet.Worldstates.emplace_back((*itr)->m_WorldState, (*itr)->m_State);
@@ -995,12 +996,12 @@ void BattlefieldWG::SendUpdateWorldStates(Player* player)
uint32 timer = GetTimer() / 1000;
bool iconActive = timer < 15 * MINUTE || IsWarTime();
SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_ATTACKER, GetAttackerTeam(), player);
SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_DEFENDER, GetDefenderTeam(), player);
SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, IsWarTime() ? 0 : 1, player);
SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE, IsWarTime() ? 1 : 0, player);
SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_CONTROL, GetDefenderTeam() == TEAM_ALLIANCE ? 2 : 1, player);
SendUpdateWorldStateMessage(BATTLEFIELD_WG_WORLD_STATE_ICON_ACTIVE, iconActive ? 1 : 0, player);
SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_ATTACKER, GetAttackerTeam(), player);
SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_DEFENDER, GetDefenderTeam(), player);
SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_ACTIVE, IsWarTime() ? 0 : 1, player);
SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_SHOW, IsWarTime() ? 1 : 0, player);
SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_CONTROL, GetDefenderTeam() == TEAM_ALLIANCE ? 2 : 1, player);
SendUpdateWorldStateMessage(WORLD_STATE_BATTLEFIELD_WG_ICON_ACTIVE, iconActive ? 1 : 0, player);
for (uint32 i = 0; i < 2; ++i)
SendUpdateWorldStateMessage(ClockWorldState[i], uint32(GameTime::GetGameTime().count() + timer), player);
@@ -21,6 +21,7 @@
#include "Battlefield.h"
#include "Log.h"
#include "World.h"
#include "WorldStateDefines.h"
#include "WorldStatePackets.h"
class Group;
@@ -36,9 +37,9 @@ typedef std::set<WGWorkshop*> Workshop;
typedef std::set<Group*> GroupSet;
//typedef std::set<WintergraspCapturePoint *> CapturePointSet; unused ?
uint32 const VehNumWorldState[2] = { 3680, 3490 };
uint32 const MaxVehNumWorldState[2] = { 3681, 3491 };
uint32 const ClockWorldState[2] = { 3781, 4354 };
uint32 const VehNumWorldState[2] = { WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A, WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H };
uint32 const MaxVehNumWorldState[2] = { WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A, WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H };
uint32 const ClockWorldState[2] = { WORLD_STATE_BATTLEFIELD_WG_CLOCK, WORLD_STATE_BATTLEFIELD_WG_CLOCK_TEXTS };
uint32 const WintergraspFaction[3] = { 1, 2, 35 };
float const WintergraspStalkerPos[4] = { 4948.985f, 2937.789f, 550.5172f, 1.815142f };
@@ -99,20 +100,6 @@ enum WintergraspData
BATTLEFIELD_WG_DATA_MAX,
};
enum WintergraspWorldStates
{
BATTLEFIELD_WG_WORLD_STATE_VEHICLE_H = 3490,
BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_H = 3491,
BATTLEFIELD_WG_WORLD_STATE_VEHICLE_A = 3680,
BATTLEFIELD_WG_WORLD_STATE_MAX_VEHICLE_A = 3681,
BATTLEFIELD_WG_WORLD_STATE_ACTIVE = 3801,
BATTLEFIELD_WG_WORLD_STATE_DEFENDER = 3802,
BATTLEFIELD_WG_WORLD_STATE_ATTACKER = 3803,
BATTLEFIELD_WG_WORLD_STATE_SHOW_WORLDSTATE = 3710,
BATTLEFIELD_WG_WORLD_STATE_CONTROL = 3804, // Shows on the map who controls WG
BATTLEFIELD_WG_WORLD_STATE_ICON_ACTIVE = 4375, // Activates "ice" icon
};
enum WintergraspAreaIds
{
BATTLEFIELD_WG_ZONEID = 4197, // Wintergrasp
@@ -522,20 +509,6 @@ enum WintergraspWorkshopIds
BATTLEFIELD_WG_WORKSHOP_KEEP_EAST,
};
enum WintergraspWorldstates
{
WORLDSTATE_WORKSHOP_NE = 3701,
WORLDSTATE_WORKSHOP_NW = 3700,
WORLDSTATE_WORKSHOP_SE = 3703,
WORLDSTATE_WORKSHOP_SW = 3702,
WORLDSTATE_WORKSHOP_K_W = 3698,
WORLDSTATE_WORKSHOP_K_E = 3699,
WORLDSTATE_HORDE_KEEP_CAPTURED = 4022,
WORLDSTATE_HORDE_KEEP_DEFENDED = 4024,
WORLDSTATE_ALLIANCE_KEEP_CAPTURED = 4023,
WORLDSTATE_ALLIANCE_KEEP_DEFENDED = 4025,
};
/// @todo: Handle this with creature_text ?
enum eWGText
{
@@ -1079,17 +1052,17 @@ struct WGWorkshopData
WGWorkshopData const WorkshopsData[WG_MAX_WORKSHOP] =
{
// NE
{BATTLEFIELD_WG_WORKSHOP_NE, WORLDSTATE_WORKSHOP_NE, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN},
{BATTLEFIELD_WG_WORKSHOP_NE, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NE, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN},
// NW
{BATTLEFIELD_WG_WORKSHOP_NW, WORLDSTATE_WORKSHOP_NW, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_TAKEN},
{BATTLEFIELD_WG_WORKSHOP_NW, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NW, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_NW_TAKEN},
// SE
{BATTLEFIELD_WG_WORKSHOP_SE, WORLDSTATE_WORKSHOP_SE, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_TAKEN},
{BATTLEFIELD_WG_WORKSHOP_SE, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SE, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SE_TAKEN},
// SW
{BATTLEFIELD_WG_WORKSHOP_SW, WORLDSTATE_WORKSHOP_SW, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_TAKEN},
{BATTLEFIELD_WG_WORKSHOP_SW, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SW, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_ATTACK, BATTLEFIELD_WG_TEXT_WORKSHOP_SW_TAKEN},
// KEEP WEST - It can't be taken
{BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, WORLDSTATE_WORKSHOP_K_W, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN},
{BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_W, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN},
// KEEP EAST - It can't be taken
{BATTLEFIELD_WG_WORKSHOP_KEEP_EAST, WORLDSTATE_WORKSHOP_K_E, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN}
{BATTLEFIELD_WG_WORKSHOP_KEEP_EAST, WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_E, 0, BATTLEFIELD_WG_TEXT_WORKSHOP_NE_TAKEN}
};
// ********************************************************************
+5 -4
View File
@@ -26,6 +26,7 @@
#include "World.h"
#include "WorldSession.h"
#include "WorldSessionMgr.h"
#include "WorldStateDefines.h"
#include "WorldStatePackets.h"
void ArenaScore::AppendToPacket(WorldPacket& data)
@@ -150,14 +151,14 @@ void Arena::RemovePlayer(Player* /*player*/)
void Arena::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.reserve(2);
packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE));
packet.Worldstates.emplace_back(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_ARENA_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_ARENA_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE));
}
void Arena::UpdateArenaWorldState()
{
UpdateWorldState(ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE));
UpdateWorldState(ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE));
UpdateWorldState(WORLD_STATE_ARENA_ALIVE_PLAYERS_GREEN, GetAlivePlayersCountByTeam(TEAM_HORDE));
UpdateWorldState(WORLD_STATE_ARENA_ALIVE_PLAYERS_GOLD, GetAlivePlayersCountByTeam(TEAM_ALLIANCE));
}
void Arena::HandleKillPlayer(Player* player, Player* killer)
-6
View File
@@ -38,12 +38,6 @@ enum ArenaSpellIds
SPELL_LAST_MAN_STANDING = 26549 // Achievement Credit
};
enum ArenaWorldStates
{
ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN = 3600,
ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD = 3601
};
class AC_GAME_API Arena : public Battleground
{
protected:
@@ -47,6 +47,7 @@
#include "SharedDefines.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
#include <unordered_map>
bool BattlegroundTemplate::IsArena() const
@@ -182,7 +183,7 @@ void BattlegroundMgr::Update(uint32 diff)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = GameTime::GetGameTime() + Seconds(DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count());
}
m_AutoDistributionTimeChecker = 600000; // 10 minutes check
}
@@ -561,7 +562,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
if (!sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
return;
Seconds wstime = Seconds(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME));
Seconds curtime = GameTime::GetGameTime();
LOG_INFO("server.loading", "Initializing Automatic Arena Point Distribution");
@@ -24,6 +24,7 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "WorldStatePackets.h"
#include "WorldStateDefines.h"
void BattlegroundABScore::BuildObjectivesBlock(WorldPacket& data)
{
@@ -129,7 +130,7 @@ void BattlegroundAB::PostUpdateImpl(uint32 diff)
}
}
UpdateWorldState(teamId == TEAM_ALLIANCE ? BG_AB_OP_RESOURCES_ALLY : BG_AB_OP_RESOURCES_HORDE, m_TeamScores[teamId]);
UpdateWorldState(teamId == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE : WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE, m_TeamScores[teamId]);
if (m_TeamScores[teamId] > m_TeamScores[GetOtherTeamId(teamId)] + 500)
_teamScores500Disadvantage[GetOtherTeamId(teamId)] = true;
if (m_TeamScores[teamId] >= static_cast<int32>(_configurableMaxTeamScore))
@@ -247,13 +248,13 @@ void BattlegroundAB::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
packet.Worldstates.emplace_back(node._iconCapture + i - 1, node._state == i ? 1 : 0);
}
packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_ALLY, _controlledPoints[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(BG_AB_OP_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]);
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_MAX, _configurableMaxTeamScore);
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE);
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_ALLY, m_TeamScores[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(BG_AB_OP_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]);
packet.Worldstates.emplace_back(0x745, 2);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE, _controlledPoints[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_MAX, _configurableMaxTeamScore);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_WARNING, BG_AB_WARNING_NEAR_VICTORY_SCORE);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE, m_TeamScores[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE, m_TeamScores[TEAM_HORDE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AB_UNK, 2);
}
void BattlegroundAB::SendNodeUpdate(uint8 node)
@@ -262,8 +263,8 @@ void BattlegroundAB::SendNodeUpdate(uint8 node)
for (uint8 i = BG_AB_NODE_STATE_ALLY_OCCUPIED; i <= BG_AB_NODE_STATE_HORDE_CONTESTED; ++i)
UpdateWorldState(_capturePointInfo[node]._iconCapture + i - 1, _capturePointInfo[node]._state == i);
UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_ALLY, _controlledPoints[TEAM_ALLIANCE]);
UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE, _controlledPoints[TEAM_ALLIANCE]);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE, _controlledPoints[TEAM_HORDE]);
}
void BattlegroundAB::NodeOccupied(uint8 node)
@@ -470,16 +471,16 @@ void BattlegroundAB::Init()
_honorTics = BattlegroundMgr::IsBGWeekend(GetBgTypeID(true)) ? BG_AB_HONOR_TICK_WEEKEND : BG_AB_HONOR_TICK_NORMAL;
_reputationTics = BattlegroundMgr::IsBGWeekend(GetBgTypeID(true)) ? BG_AB_REP_TICK_WEEKEND : BG_AB_REP_TICK_NORMAL;
_capturePointInfo[BG_AB_NODE_STABLES]._iconNone = BG_AB_OP_STABLE_ICON;
_capturePointInfo[BG_AB_NODE_FARM]._iconNone = BG_AB_OP_FARM_ICON;
_capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconNone = BG_AB_OP_BLACKSMITH_ICON;
_capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconNone = BG_AB_OP_LUMBERMILL_ICON;
_capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconNone = BG_AB_OP_GOLDMINE_ICON;
_capturePointInfo[BG_AB_NODE_STABLES]._iconCapture = BG_AB_OP_STABLE_STATE_ALIENCE;
_capturePointInfo[BG_AB_NODE_FARM]._iconCapture = BG_AB_OP_FARM_STATE_ALIENCE;
_capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconCapture = BG_AB_OP_BLACKSMITH_STATE_ALIENCE;
_capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconCapture = BG_AB_OP_LUMBERMILL_STATE_ALIENCE;
_capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconCapture = BG_AB_OP_GOLDMINE_STATE_ALIENCE;
_capturePointInfo[BG_AB_NODE_STABLES]._iconNone = WORLD_STATE_BATTLEGROUND_AB_STABLE_ICON;
_capturePointInfo[BG_AB_NODE_FARM]._iconNone = WORLD_STATE_BATTLEGROUND_AB_FARM_ICON;
_capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconNone = WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_ICON;
_capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconNone = WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_ICON;
_capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconNone = WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_ICON;
_capturePointInfo[BG_AB_NODE_STABLES]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_ALLIANCE;
_capturePointInfo[BG_AB_NODE_FARM]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_ALLIANCE;
_capturePointInfo[BG_AB_NODE_BLACKSMITH]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_ALLIANCE;
_capturePointInfo[BG_AB_NODE_LUMBER_MILL]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_ALLIANCE;
_capturePointInfo[BG_AB_NODE_GOLD_MINE]._iconCapture = WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_ALLIANCE;
uint32 bgArathiCapturePointsConfig = sWorld->getIntConfig(CONFIG_BATTLEGROUND_ARATHI_CAPTUREPOINTS);
_configurableMaxTeamScore = bgArathiCapturePointsConfig > 0
@@ -40,46 +40,6 @@ enum BG_AB_Events
BG_AB_EVENT_HORDE_TICK = 12
};
enum BG_AB_WorldStates
{
BG_AB_OP_OCCUPIED_BASES_HORDE = 1778,
BG_AB_OP_OCCUPIED_BASES_ALLY = 1779,
BG_AB_OP_RESOURCES_ALLY = 1776,
BG_AB_OP_RESOURCES_HORDE = 1777,
BG_AB_OP_RESOURCES_MAX = 1780,
BG_AB_OP_RESOURCES_WARNING = 1955,
BG_AB_OP_STABLE_ICON = 1842, //Stable map icon (NONE)
BG_AB_OP_STABLE_STATE_ALIENCE = 1767, //Stable map state (ALIENCE)
BG_AB_OP_STABLE_STATE_HORDE = 1768, //Stable map state (HORDE)
BG_AB_OP_STABLE_STATE_CON_ALI = 1769, //Stable map state (CON ALIENCE)
BG_AB_OP_STABLE_STATE_CON_HOR = 1770, //Stable map state (CON HORDE)
BG_AB_OP_FARM_ICON = 1845, //Farm map icon (NONE)
BG_AB_OP_FARM_STATE_ALIENCE = 1772, //Farm state (ALIENCE)
BG_AB_OP_FARM_STATE_HORDE = 1773, //Farm state (HORDE)
BG_AB_OP_FARM_STATE_CON_ALI = 1774, //Farm state (CON ALIENCE)
BG_AB_OP_FARM_STATE_CON_HOR = 1775, //Farm state (CON HORDE)
BG_AB_OP_BLACKSMITH_ICON = 1846, //Blacksmith map icon (NONE)
BG_AB_OP_BLACKSMITH_STATE_ALIENCE = 1782, //Blacksmith map state (ALIENCE)
BG_AB_OP_BLACKSMITH_STATE_HORDE = 1783, //Blacksmith map state (HORDE)
BG_AB_OP_BLACKSMITH_STATE_CON_ALI = 1784, //Blacksmith map state (CON ALIENCE)
BG_AB_OP_BLACKSMITH_STATE_CON_HOR = 1785, //Blacksmith map state (CON HORDE)
BG_AB_OP_LUMBERMILL_ICON = 1844, //Lumber Mill map icon (NONE)
BG_AB_OP_LUMBERMILL_STATE_ALIENCE = 1792, //Lumber Mill map state (ALIENCE)
BG_AB_OP_LUMBERMILL_STATE_HORDE = 1793, //Lumber Mill map state (HORDE)
BG_AB_OP_LUMBERMILL_STATE_CON_ALI = 1794, //Lumber Mill map state (CON ALIENCE)
BG_AB_OP_LUMBERMILL_STATE_CON_HOR = 1795, //Lumber Mill map state (CON HORDE)
BG_AB_OP_GOLDMINE_ICON = 1843, //Gold Mine map icon (NONE)
BG_AB_OP_GOLDMINE_STATE_ALIENCE = 1787, //Gold Mine map state (ALIENCE)
BG_AB_OP_GOLDMINE_STATE_HORDE = 1788, //Gold Mine map state (HORDE)
BG_AB_OP_GOLDMINE_STATE_CON_ALI = 1789, //Gold Mine map state (CON ALIENCE
BG_AB_OP_GOLDMINE_STATE_CON_HOR = 1790, //Gold Mine map state (CON HORDE)
};
enum BG_AB_ObjectIds
{
BG_AB_OBJECTID_NODE_BANNER_0 = 180087, // Stables banner
@@ -272,7 +272,7 @@ void BattlegroundAV::UpdateScore(TeamId teamId, int16 points)
//note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive
m_Team_Scores[teamId] += points;
UpdateWorldState(((teamId == TEAM_HORDE) ? AV_Horde_Score : AV_Alliance_Score), m_Team_Scores[teamId]);
UpdateWorldState(((teamId == TEAM_HORDE) ? WORLD_STATE_BATTLEGROUND_AV_HORDE_SCORE : WORLD_STATE_BATTLEGROUND_AV_ALLIANCE_SCORE), m_Team_Scores[teamId]);
if (points < 0)
{
if (m_Team_Scores[teamId] < 1)
@@ -480,8 +480,8 @@ void BattlegroundAV::StartingEventOpenDoors()
if (BG_AV_SCORE_INITIAL_POINTS > 0) // display teamscores on top only if reinforcements are enabled
{
UpdateWorldState(AV_SHOW_H_SCORE, 1);
UpdateWorldState(AV_SHOW_A_SCORE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_AV_SHOW_HORDE_SCORE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_AV_SHOW_ALLIANCE_SCORE, 1);
}
DoorOpen(BG_AV_OBJECT_DOOR_H);
@@ -1118,14 +1118,14 @@ void BattlegroundAV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
}
if (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].OwnerId == TEAM_NEUTRAL) //cause neutral teams aren't handled generic
{
packet.Worldstates.emplace_back(AV_SNOWFALL_N, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N, 1);
}
packet.Worldstates.emplace_back(AV_Alliance_Score, m_Team_Scores[0]);
packet.Worldstates.emplace_back(AV_Horde_Score, m_Team_Scores[1]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_ALLIANCE_SCORE, m_Team_Scores[0]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_HORDE_SCORE, m_Team_Scores[1]);
packet.Worldstates.emplace_back(AV_SHOW_A_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0);
packet.Worldstates.emplace_back(AV_SHOW_H_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SHOW_ALLIANCE_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_AV_SHOW_HORDE_SCORE, GetStatus() == STATUS_IN_PROGRESS && BG_AV_SCORE_INITIAL_POINTS > 0 ? 1 : 0);
SendMineWorldStates(AV_NORTH_MINE);
SendMineWorldStates(AV_SOUTH_MINE);
@@ -1158,7 +1158,7 @@ void BattlegroundAV::UpdateNodeWorldState(BG_AV_Nodes node)
{
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State, m_Nodes[node].OwnerId)], 1);
if (m_Nodes[node].PrevOwnerId == TEAM_NEUTRAL) //currently only snowfall is supported as neutral node (i don't want to make an extra row (neutral states) in worldstatesarray just for one node
UpdateWorldState(AV_SNOWFALL_N, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N, 0);
else
UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState, m_Nodes[node].PrevOwnerId)], 0);
}
@@ -20,6 +20,7 @@
#include "Battleground.h"
#include "BattlegroundScore.h"
#include "WorldStateDefines.h"
#define BG_AV_CAPTIME 240000 //4:00
#define BG_AV_SNOWFALL_FIRSTCAP 300000 //5:00 but i also have seen 4:05
@@ -1548,159 +1549,46 @@ enum BG_AV_States
POINT_CONTROLED = 3
};
enum BG_AV_WorldStates
{
AV_Alliance_Score = 3127,
AV_Horde_Score = 3128,
AV_SHOW_H_SCORE = 3133,
AV_SHOW_A_SCORE = 3134,
/*
//the comments behind the state shows which icon overlaps the other.. but is, until now, unused and maybe not a good solution (but give few performance (:)
// Graves
// Alliance
//Stormpike first aid station
AV_AID_A_C = 1325,
AV_AID_A_A = 1326,
AV_AID_H_C = 1327,
AV_AID_H_A = 1328,
//Stormpike Graveyard
AV_PIKEGRAVE_A_C = 1333,
AV_PIKEGRAVE_A_A = 1335,
AV_PIKEGRAVE_H_C = 1334,
AV_PIKEGRAVE_H_A = 1336,
//Stoneheart Grave
AV_STONEHEART_A_C = 1302,
AV_STONEHEART_A_A = 1304, //over hc
AV_STONEHEART_H_C = 1301, //over ac
AV_STONEHEART_H_A = 1303, //over aa
//Neutral
//Snowfall Grave
*/
AV_SNOWFALL_N = 1966, //over aa
/*
AV_SNOWFALL_A_C = 1341, //over hc
AV_SNOWFALL_A_A = 1343, //over ha
AV_SNOWFALL_H_C = 1342,
AV_SNOWFALL_H_A = 1344, //over ac
//Horde
//Iceblood grave
AV_ICEBLOOD_A_C = 1346, //over hc
AV_ICEBLOOD_A_A = 1348, //over ac
AV_ICEBLOOD_H_C = 1347,
AV_ICEBLOOD_H_A = 1349, //over aa
//Frostwolf Grave
AV_FROSTWOLF_A_C = 1337, //over hc
AV_FROSTWOLF_A_A = 1339, //over ac
AV_FROSTWOLF_H_C = 1338,
AV_FROSTWOLF_H_A = 1340, //over aa
//Frostwolf Hut
AV_FROSTWOLFHUT_A_C = 1329, //over hc
AV_FROSTWOLFHUT_A_A = 1331, //over ha
AV_FROSTWOLFHUT_H_C = 1330,
AV_FROSTWOLFHUT_H_A = 1332, //over ac
//Towers
//Alliance
//Dunbaldar South Bunker
AV_DUNS_CONTROLLED = 1361,
AV_DUNS_DESTROYED = 1370,
AV_DUNS_ASSAULTED = 1378,
//Dunbaldar North Bunker
AV_DUNN_CONTROLLED = 1362,
AV_DUNN_DESTROYED = 1371,
AV_DUNN_ASSAULTED = 1379,
//Icewing Bunker
AV_ICEWING_CONTROLLED = 1363,
AV_ICEWING_DESTROYED = 1372,
AV_ICEWING_ASSAULTED = 1380,
//Stoneheart Bunker
AV_STONEH_CONTROLLED = 1364,
AV_STONEH_DESTROYED = 1373,
AV_STONEH_ASSAULTED = 1381,
//Horde
//Iceblood Tower
AV_ICEBLOOD_CONTROLLED = 1385,
AV_ICEBLOOD_DESTROYED = 1368,
AV_ICEBLOOD_ASSAULTED = 1390,
//Tower Point
AV_TOWERPOINT_CONTROLLED = 1384,
AV_TOWERPOINT_DESTROYED = 1367, //goes over controlled
AV_TOWERPOINT_ASSAULTED = 1389, //goes over destroyed
//Frostwolf West
AV_FROSTWOLFW_CONTROLLED = 1382,
AV_FROSTWOLFW_DESTROYED = 1365, //over controlled
AV_FROSTWOLFW_ASSAULTED = 1387, //over destroyed
//Frostwolf East
AV_FROSTWOLFE_CONTROLLED = 1383,
AV_FROSTWOLFE_DESTROYED = 1366,
AV_FROSTWOLFE_ASSAULTED = 1388,
//mines
AV_N_MINE_N = 1360,
AV_N_MINE_A = 1358,
AV_N_MINE_H = 1359,
AV_S_MINE_N = 1357,
AV_S_MINE_A = 1355,
AV_S_MINE_H = 1356,
//towers assaulted by own team (unused)
AV_STONEH_UNUSED = 1377,
AV_ICEWING_UNUSED = 1376,
AV_DUNS_UNUSED = 1375,
AV_DUNN_UNUSED = 1374,
AV_ICEBLOOD_UNUSED = 1395,
AV_TOWERPOINT_UNUSED = 1394,
AV_FROSTWOLFE_UNUSED = 1393,
AV_FROSTWOLFW_UNUSED = 1392
*/
};
//alliance_control neutral_control horde_control
const uint32 BG_AV_MineWorldStates[2][3] =
{
{1358, 1360, 1359},
{1355, 1357, 1356}
{WORLD_STATE_BATTLEGROUND_AV_N_MINE_A, WORLD_STATE_BATTLEGROUND_AV_N_MINE_N, WORLD_STATE_BATTLEGROUND_AV_N_MINE_H},
{WORLD_STATE_BATTLEGROUND_AV_S_MINE_A, WORLD_STATE_BATTLEGROUND_AV_S_MINE_N, WORLD_STATE_BATTLEGROUND_AV_S_MINE_H}
};
//alliance_control alliance_assault h_control h_assault
const uint32 BG_AV_NodeWorldStates[16][4] =
{
//Stormpike first aid station
{1325, 1326, 1327, 1328},
{WORLD_STATE_BATTLEGROUND_AV_AID_A_C, WORLD_STATE_BATTLEGROUND_AV_AID_A_A, WORLD_STATE_BATTLEGROUND_AV_AID_H_C, WORLD_STATE_BATTLEGROUND_AV_AID_H_A},
//Stormpike Graveyard
{1333, 1335, 1334, 1336},
{WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_C, WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_A, WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_C, WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_A},
//Stoneheart Grave
{1302, 1304, 1301, 1303},
{WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_C, WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_A, WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_C, WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_A},
//Snowfall Grave
{1341, 1343, 1342, 1344},
{WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_C, WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_A, WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_C, WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_A},
//Iceblood grave
{1346, 1348, 1347, 1349},
{WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_C, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_A, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_C, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_A},
//Frostwolf Grave
{1337, 1339, 1338, 1340},
{WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_A, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_A},
//Frostwolf Hut
{1329, 1331, 1330, 1332},
{WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_A, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_C, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_A},
//Dunbaldar South Bunker
{1361, 1375, 1370, 1378},
{WORLD_STATE_BATTLEGROUND_AV_DUNS_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_DUNS_UNUSED, WORLD_STATE_BATTLEGROUND_AV_DUNS_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_DUNS_ASSAULTED},
//Dunbaldar North Bunker
{1362, 1374, 1371, 1379},
{WORLD_STATE_BATTLEGROUND_AV_DUNN_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_DUNN_UNUSED, WORLD_STATE_BATTLEGROUND_AV_DUNN_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_DUNN_ASSAULTED},
//Icewing Bunker
{1363, 1376, 1372, 1380},
{WORLD_STATE_BATTLEGROUND_AV_ICEWING_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_ICEWING_UNUSED, WORLD_STATE_BATTLEGROUND_AV_ICEWING_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_ICEWING_ASSAULTED},
//Stoneheart Bunker
{1364, 1377, 1373, 1381},
{WORLD_STATE_BATTLEGROUND_AV_STONEH_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_STONEH_UNUSED, WORLD_STATE_BATTLEGROUND_AV_STONEH_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_STONEH_ASSAULTED},
//Iceblood Tower
{1368, 1390, 1385, 1395},
{WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_UNUSED},
//Tower Point
{1367, 1389, 1384, 1394},
{WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_UNUSED},
//Frostwolf East
{1366, 1388, 1383, 1393},
{WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_UNUSED},
//Frostwolf West
{1365, 1387, 1382, 1392},
{WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_DESTROYED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_ASSAULTED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_CONTROLLED, WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_UNUSED},
};
enum BG_AV_QuestIds
@@ -20,6 +20,7 @@
#include "Player.h"
#include "WorldPacket.h"
#include "WorldStatePackets.h"
#include "WorldStateDefines.h"
BattlegroundBE::BattlegroundBE()
{
@@ -90,7 +91,7 @@ void BattlegroundBE::HandleAreaTrigger(Player* player, uint32 trigger)
void BattlegroundBE::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(0x9f3, 1); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_BE_ARENA_SHOW, 1);
Arena::FillInitialWorldStates(packet);
}
@@ -22,6 +22,7 @@
#include "ObjectAccessor.h"
#include "Player.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
#include "WorldStatePackets.h"
BattlegroundDS::BattlegroundDS()
@@ -176,7 +177,7 @@ bool BattlegroundDS::HandlePlayerUnderMap(Player* player)
void BattlegroundDS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(0xe1a, 1); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW, 1); // Wrong worldstate used
Arena::FillInitialWorldStates(packet);
}
@@ -120,7 +120,7 @@ void BattlegroundEY::AddPoints(TeamId teamId, uint32 points)
for (; honorRewards < uint8(m_TeamScores[teamId] / _honorTics); ++honorRewards)
RewardHonorToTeam(GetBonusHonorFromKill(1), teamId);
UpdateWorldState(teamId == TEAM_ALLIANCE ? EY_ALLIANCE_RESOURCES : EY_HORDE_RESOURCES, std::min<uint32>(m_TeamScores[teamId], _configurableMaxTeamScore));
UpdateWorldState(teamId == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES : WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES, std::min<uint32>(m_TeamScores[teamId], _configurableMaxTeamScore));
if (m_TeamScores[teamId] >= static_cast<int32>(_configurableMaxTeamScore))
EndBattleground(teamId);
}
@@ -138,14 +138,14 @@ void BattlegroundEY::UpdatePointsState()
const BattlegroundPlayerMap& bgPlayerMap = GetPlayers();
for (BattlegroundPlayerMap::const_iterator itr = bgPlayerMap.begin(); itr != bgPlayerMap.end(); ++itr)
{
itr->second->SendUpdateWorldState(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW);
itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_DONT_SHOW);
for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
if (GameObject* pointObject = pointsVec[point])
if (itr->second->CanCaptureTowerPoint() && itr->second->IsWithinDistInMap(pointObject, BG_EY_POINT_RADIUS))
{
itr->second->SendUpdateWorldState(PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW);
itr->second->SendUpdateWorldState(PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY);
itr->second->SendUpdateWorldState(PROGRESS_BAR_STATUS, _capturePointInfo[point]._barStatus);
itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, BG_EY_PROGRESS_BAR_SHOW);
itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY, BG_EY_PROGRESS_BAR_PERCENT_GREY);
itr->second->SendUpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS, _capturePointInfo[point]._barStatus);
++_capturePointInfo[point]._playersCount[itr->second->GetTeamId()];
_capturePointInfo[point].player = itr->second;
@@ -187,8 +187,8 @@ void BattlegroundEY::EndBattleground(TeamId winnerTeamId)
void BattlegroundEY::UpdatePointsCount()
{
UpdateWorldState(EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]);
UpdateWorldState(EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]);
}
void BattlegroundEY::UpdatePointsIcons(uint32 point)
@@ -382,7 +382,7 @@ void BattlegroundEY::RespawnFlag()
SendBroadcastText(BG_EY_TEXT_FLAG_RESET, CHAT_MSG_BG_SYSTEM_NEUTRAL);
PlaySoundToAll(BG_EY_SOUND_FLAG_RESET);
UpdateWorldState(NETHERSTORM_FLAG, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_FLAG, 1);
}
void BattlegroundEY::RespawnFlagAfterDrop()
@@ -442,7 +442,7 @@ void BattlegroundEY::EventPlayerClickedOnFlag(Player* player, GameObject* gameOb
player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
PlaySoundToAll(player->GetTeamId() == TEAM_ALLIANCE ? BG_EY_SOUND_FLAG_PICKED_UP_ALLIANCE : BG_EY_SOUND_FLAG_PICKED_UP_HORDE);
UpdateWorldState(NETHERSTORM_FLAG, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_EY_FLAG, 0);
if (player->GetTeamId() == TEAM_ALLIANCE)
SendBroadcastText(BG_EY_TEXT_TAKEN_FLAG, CHAT_MSG_BG_SYSTEM_ALLIANCE, player);
@@ -577,28 +577,28 @@ bool BattlegroundEY::UpdatePlayerScore(Player* player, uint32 type, uint32 value
void BattlegroundEY::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.reserve(22);
packet.Worldstates.emplace_back(EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]);
packet.Worldstates.emplace_back(EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(DRAENEI_RUINS_HORDE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(DRAENEI_RUINS_ALLIANCE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(DRAENEI_RUINS_UNCONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled());
packet.Worldstates.emplace_back(MAGE_TOWER_ALLIANCE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(MAGE_TOWER_HORDE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(MAGE_TOWER_UNCONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled());
packet.Worldstates.emplace_back(FEL_REAVER_HORDE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(FEL_REAVER_ALLIANCE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(FEL_REAVER_UNCONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUncontrolled());
packet.Worldstates.emplace_back(BLOOD_ELF_HORDE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(BLOOD_ELF_ALLIANCE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(BLOOD_ELF_UNCONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled());
packet.Worldstates.emplace_back(NETHERSTORM_FLAG, _flagState == BG_EY_FLAG_STATE_ON_BASE);
packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_HORDE, 1);
packet.Worldstates.emplace_back(NETHERSTORM_FLAG_STATE_ALLIANCE, 1);
packet.Worldstates.emplace_back(EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE));
packet.Worldstates.emplace_back(EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(PROGRESS_BAR_SHOW, 0);
packet.Worldstates.emplace_back(PROGRESS_BAR_PERCENT_GREY, 0);
packet.Worldstates.emplace_back(PROGRESS_BAR_STATUS, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE, _ownedPointsCount[TEAM_HORDE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE, _ownedPointsCount[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL, _capturePointInfo[POINT_DRAENEI_RUINS].IsUncontrolled());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL, _capturePointInfo[POINT_MAGE_TOWER].IsUncontrolled());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL, _capturePointInfo[POINT_FEL_REAVER].IsUncontrolled());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUnderControl(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL, _capturePointInfo[POINT_BLOOD_ELF].IsUncontrolled());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG, _flagState == BG_EY_FLAG_STATE_ON_BASE);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_HORDE, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_ALLIANCE, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES, GetTeamScore(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES, GetTeamScore(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS, 0);
}
GraveyardStruct const* BattlegroundEY::GetClosestGraveyard(Player* player)
@@ -21,6 +21,7 @@
#include "Battleground.h"
#include "BattlegroundScore.h"
#include "EventMap.h"
#include "WorldStateDefines.h"
enum BG_EY_Events
{
@@ -38,33 +39,6 @@ enum BG_EY_Timers
BG_EY_FPOINTS_TICK_TIME = 2 * IN_MILLISECONDS
};
enum BG_EY_WorldStates
{
EY_ALLIANCE_RESOURCES = 2749,
EY_HORDE_RESOURCES = 2750,
EY_ALLIANCE_BASE = 2752,
EY_HORDE_BASE = 2753,
DRAENEI_RUINS_HORDE_CONTROL = 2733,
DRAENEI_RUINS_ALLIANCE_CONTROL = 2732,
DRAENEI_RUINS_UNCONTROL = 2731,
MAGE_TOWER_ALLIANCE_CONTROL = 2730,
MAGE_TOWER_HORDE_CONTROL = 2729,
MAGE_TOWER_UNCONTROL = 2728,
FEL_REAVER_HORDE_CONTROL = 2727,
FEL_REAVER_ALLIANCE_CONTROL = 2726,
FEL_REAVER_UNCONTROL = 2725,
BLOOD_ELF_HORDE_CONTROL = 2724,
BLOOD_ELF_ALLIANCE_CONTROL = 2723,
BLOOD_ELF_UNCONTROL = 2722,
PROGRESS_BAR_PERCENT_GREY = 2720, //100 = empty (only grey), 0 = blue|red (no grey)
PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky, 100 = full alliance
PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled aliance
NETHERSTORM_FLAG = 2757,
//set to 2 when flag is picked up, and to 1 if it is dropped
NETHERSTORM_FLAG_STATE_ALLIANCE = 2769,
NETHERSTORM_FLAG_STATE_HORDE = 2770
};
enum BG_EY_ProgressBarConsts
{
BG_EY_POINT_MAX_CAPTURERS_COUNT = 5,
@@ -326,10 +300,10 @@ const uint32 BG_EY_FlagPoints[EY_POINTS_MAX] = {75, 85, 100, 500};
//constant arrays:
const BattlegroundEYPointIconsStruct m_PointsIconStruct[EY_POINTS_MAX] =
{
BattlegroundEYPointIconsStruct(FEL_REAVER_UNCONTROL, FEL_REAVER_ALLIANCE_CONTROL, FEL_REAVER_HORDE_CONTROL),
BattlegroundEYPointIconsStruct(BLOOD_ELF_UNCONTROL, BLOOD_ELF_ALLIANCE_CONTROL, BLOOD_ELF_HORDE_CONTROL),
BattlegroundEYPointIconsStruct(DRAENEI_RUINS_UNCONTROL, DRAENEI_RUINS_ALLIANCE_CONTROL, DRAENEI_RUINS_HORDE_CONTROL),
BattlegroundEYPointIconsStruct(MAGE_TOWER_UNCONTROL, MAGE_TOWER_ALLIANCE_CONTROL, MAGE_TOWER_HORDE_CONTROL)
BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL),
BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL),
BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL),
BattlegroundEYPointIconsStruct(WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL, WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL, WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL)
};
const BattlegroundEYLosingPointStruct m_LosingPointTypes[EY_POINTS_MAX] =
@@ -268,7 +268,7 @@ void BattlegroundIC::PostUpdateImpl(uint32 diff)
{
factionReinforcements[nodePoint[i].faction] += 1;
RewardHonorToTeam(RESOURCE_HONOR_AMOUNT, nodePoint[i].faction);
UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[nodePoint[i].faction]);
UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT : WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT), factionReinforcements[nodePoint[i].faction]);
}
}
resourceTimer = IC_RESOURCE_TIME;
@@ -385,10 +385,10 @@ bool BattlegroundIC::UpdatePlayerScore(Player* player, uint32 type, uint32 value
void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.reserve(4+MAX_FORTRESS_GATES_SPAWNS+MAX_NODE_TYPES+1);
packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT_SET, 1);
packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1);
packet.Worldstates.emplace_back(BG_IC_ALLIANCE_RENFORT, factionReinforcements[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT, factionReinforcements[TEAM_HORDE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT_SET, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT, factionReinforcements[TEAM_ALLIANCE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT, factionReinforcements[TEAM_HORDE]);
for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; ++i)
{
@@ -399,7 +399,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
for (uint8 i = 0; i < MAX_NODE_TYPES; ++i)
packet.Worldstates.emplace_back(nodePoint[i].worldStates[nodePoint[i].nodeState], 1);
packet.Worldstates.emplace_back(BG_IC_HORDE_RENFORT_SET, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET, 1);
}
bool BattlegroundIC::SetupBattleground()
@@ -545,7 +545,7 @@ void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer)
factionReinforcements[player->GetTeamId()] -= 1;
UpdateWorldState((player->GetTeamId() == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[player->GetTeamId()]);
UpdateWorldState((player->GetTeamId() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT : WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT), factionReinforcements[player->GetTeamId()]);
// we must end the battleground
if (factionReinforcements[player->GetTeamId()] < 1)
@@ -21,6 +21,7 @@
#include "Battleground.h"
#include "BattlegroundScore.h"
#include "Object.h"
#include "WorldStateDefines.h"
const uint32 BG_IC_Factions[PVP_TEAMS_COUNT] =
{
@@ -735,68 +736,6 @@ enum BG_IC_Objectives
IC_OBJECTIVE_DEFEND_BASE = 246
};
enum ICWorldStates
{
BG_IC_ALLIANCE_RENFORT_SET = 4221,
BG_IC_HORDE_RENFORT_SET = 4222,
BG_IC_ALLIANCE_RENFORT = 4226,
BG_IC_HORDE_RENFORT = 4227,
BG_IC_GATE_FRONT_H_WS_CLOSED = 4317,
BG_IC_GATE_WEST_H_WS_CLOSED = 4318,
BG_IC_GATE_EAST_H_WS_CLOSED = 4319,
BG_IC_GATE_FRONT_A_WS_CLOSED = 4328,
BG_IC_GATE_WEST_A_WS_CLOSED = 4327,
BG_IC_GATE_EAST_A_WS_CLOSED = 4326,
BG_IC_GATE_FRONT_H_WS_OPEN = 4322,
BG_IC_GATE_WEST_H_WS_OPEN = 4321,
BG_IC_GATE_EAST_H_WS_OPEN = 4320,
BG_IC_GATE_FRONT_A_WS_OPEN = 4323,
BG_IC_GATE_WEST_A_WS_OPEN = 4324,
BG_IC_GATE_EAST_A_WS_OPEN = 4325,
BG_IC_DOCKS_UNCONTROLLED = 4301,
BG_IC_DOCKS_CONFLICT_A = 4305,
BG_IC_DOCKS_CONFLICT_H = 4302,
BG_IC_DOCKS_CONTROLLED_A = 4304,
BG_IC_DOCKS_CONTROLLED_H = 4303,
BG_IC_HANGAR_UNCONTROLLED = 4296,
BG_IC_HANGAR_CONFLICT_A = 4300,
BG_IC_HANGAR_CONFLICT_H = 4297,
BG_IC_HANGAR_CONTROLLED_A = 4299,
BG_IC_HANGAR_CONTROLLED_H = 4298,
BG_IC_QUARRY_UNCONTROLLED = 4306,
BG_IC_QUARRY_CONFLICT_A = 4310,
BG_IC_QUARRY_CONFLICT_H = 4307,
BG_IC_QUARRY_CONTROLLED_A = 4309,
BG_IC_QUARRY_CONTROLLED_H = 4308,
BG_IC_REFINERY_UNCONTROLLED = 4311,
BG_IC_REFINERY_CONFLICT_A = 4315,
BG_IC_REFINERY_CONFLICT_H = 4312,
BG_IC_REFINERY_CONTROLLED_A = 4314,
BG_IC_REFINERY_CONTROLLED_H = 4313,
BG_IC_WORKSHOP_UNCONTROLLED = 4294,
BG_IC_WORKSHOP_CONFLICT_A = 4228,
BG_IC_WORKSHOP_CONFLICT_H = 4293,
BG_IC_WORKSHOP_CONTROLLED_A = 4229,
BG_IC_WORKSHOP_CONTROLLED_H = 4230,
BG_IC_ALLIANCE_KEEP_UNCONTROLLED = 4341,
BG_IC_ALLIANCE_KEEP_CONFLICT_A = 4342,
BG_IC_ALLIANCE_KEEP_CONFLICT_H = 4343,
BG_IC_ALLIANCE_KEEP_CONTROLLED_A = 4339,
BG_IC_ALLIANCE_KEEP_CONTROLLED_H = 4340,
BG_IC_HORDE_KEEP_UNCONTROLLED = 4346,
BG_IC_HORDE_KEEP_CONFLICT_A = 4347,
BG_IC_HORDE_KEEP_CONFLICT_H = 4348,
BG_IC_HORDE_KEEP_CONTROLLED_A = 4344,
BG_IC_HORDE_KEEP_CONTROLLED_H = 4345
};
enum BG_IC_GateState
{
BG_IC_GATE_OK = 1,
@@ -901,13 +840,13 @@ struct ICNodePoint
const ICNodePoint nodePointInitial[MAX_NODE_TYPES] =
{
{BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, TEAM_NEUTRAL, NODE_TYPE_REFINERY, {GO_ALLIANCE_BANNER_REFINERY, GO_ALLIANCE_BANNER_REFINERY_CONT, GO_HORDE_BANNER_REFINERY, GO_HORDE_BANNER_REFINERY_CONT}, false, 0, 0, {BG_IC_REFINERY_UNCONTROLLED, BG_IC_REFINERY_CONFLICT_A, BG_IC_REFINERY_CONFLICT_H, BG_IC_REFINERY_CONTROLLED_A, BG_IC_REFINERY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, TEAM_NEUTRAL, NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY, GO_ALLIANCE_BANNER_QUARRY_CONT, GO_HORDE_BANNER_QUARRY, GO_HORDE_BANNER_QUARRY_CONT}, false, 0, 0, {BG_IC_QUARRY_UNCONTROLLED, BG_IC_QUARRY_CONFLICT_A, BG_IC_QUARRY_CONFLICT_H, BG_IC_QUARRY_CONTROLLED_A, BG_IC_QUARRY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, TEAM_NEUTRAL, NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK, GO_ALLIANCE_BANNER_DOCK_CONT, GO_HORDE_BANNER_DOCK, GO_HORDE_BANNER_DOCK_CONT}, false, 0, 0, {BG_IC_DOCKS_UNCONTROLLED, BG_IC_DOCKS_CONFLICT_A, BG_IC_DOCKS_CONFLICT_H, BG_IC_DOCKS_CONTROLLED_A, BG_IC_DOCKS_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, TEAM_NEUTRAL, NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR, GO_ALLIANCE_BANNER_HANGAR_CONT, GO_HORDE_BANNER_HANGAR, GO_HORDE_BANNER_HANGAR_CONT}, false, 0, 0, {BG_IC_HANGAR_UNCONTROLLED, BG_IC_HANGAR_CONFLICT_A, BG_IC_HANGAR_CONFLICT_H, BG_IC_HANGAR_CONTROLLED_A, BG_IC_HANGAR_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP, GO_ALLIANCE_BANNER_WORKSHOP_CONT, GO_HORDE_BANNER_WORKSHOP, GO_HORDE_BANNER_WORKSHOP_CONT}, false, 0, 0, {BG_IC_WORKSHOP_UNCONTROLLED, BG_IC_WORKSHOP_CONFLICT_A, BG_IC_WORKSHOP_CONFLICT_H, BG_IC_WORKSHOP_CONTROLLED_A, BG_IC_WORKSHOP_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, TEAM_ALLIANCE, NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A, GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT, GO_HORDE_BANNER_GRAVEYARD_A, GO_HORDE_BANNER_GRAVEYARD_A_CONT}, false, 0, 0, {BG_IC_ALLIANCE_KEEP_UNCONTROLLED, BG_IC_ALLIANCE_KEEP_CONFLICT_A, BG_IC_ALLIANCE_KEEP_CONFLICT_H, BG_IC_ALLIANCE_KEEP_CONTROLLED_A, BG_IC_ALLIANCE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_A},
{BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, TEAM_HORDE, NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H, GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT, GO_HORDE_BANNER_GRAVEYARD_H, GO_HORDE_BANNER_GRAVEYARD_H_CONT}, false, 0, 0, {BG_IC_HORDE_KEEP_UNCONTROLLED, BG_IC_HORDE_KEEP_CONFLICT_A, BG_IC_HORDE_KEEP_CONFLICT_H, BG_IC_HORDE_KEEP_CONTROLLED_A, BG_IC_HORDE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_H}
{BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, TEAM_NEUTRAL, NODE_TYPE_REFINERY, {GO_ALLIANCE_BANNER_REFINERY, GO_ALLIANCE_BANNER_REFINERY_CONT, GO_HORDE_BANNER_REFINERY, GO_HORDE_BANNER_REFINERY_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_REFINERY_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, TEAM_NEUTRAL, NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY, GO_ALLIANCE_BANNER_QUARRY_CONT, GO_HORDE_BANNER_QUARRY, GO_HORDE_BANNER_QUARRY_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_QUARRY_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, TEAM_NEUTRAL, NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK, GO_ALLIANCE_BANNER_DOCK_CONT, GO_HORDE_BANNER_DOCK, GO_HORDE_BANNER_DOCK_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_DOCKS_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, TEAM_NEUTRAL, NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR, GO_ALLIANCE_BANNER_HANGAR_CONT, GO_HORDE_BANNER_HANGAR, GO_HORDE_BANNER_HANGAR_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_HANGAR_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP, GO_ALLIANCE_BANNER_WORKSHOP_CONT, GO_HORDE_BANNER_WORKSHOP, GO_HORDE_BANNER_WORKSHOP_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_H}, NODE_STATE_UNCONTROLLED},
{BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, TEAM_ALLIANCE, NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A, GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT, GO_HORDE_BANNER_GRAVEYARD_A, GO_HORDE_BANNER_GRAVEYARD_A_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_A},
{BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, TEAM_HORDE, NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H, GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT, GO_HORDE_BANNER_GRAVEYARD_H, GO_HORDE_BANNER_GRAVEYARD_H_CONT}, false, 0, 0, {WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_UNCONTROLLED, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_A, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_H, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_A, WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_H}
};
enum HonorRewards
@@ -1038,22 +977,22 @@ private:
switch (id)
{
case GO_HORDE_GATE_1:
uws = (open ? BG_IC_GATE_FRONT_H_WS_OPEN : BG_IC_GATE_FRONT_H_WS_CLOSED);
uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_CLOSED);
break;
case GO_HORDE_GATE_2:
uws = (open ? BG_IC_GATE_EAST_H_WS_OPEN : BG_IC_GATE_EAST_H_WS_CLOSED);
uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_CLOSED);
break;
case GO_HORDE_GATE_3:
uws = (open ? BG_IC_GATE_WEST_H_WS_OPEN : BG_IC_GATE_WEST_H_WS_CLOSED);
uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_CLOSED);
break;
case GO_ALLIANCE_GATE_3:
uws = (open ? BG_IC_GATE_FRONT_A_WS_OPEN : BG_IC_GATE_FRONT_A_WS_CLOSED);
uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_CLOSED);
break;
case GO_ALLIANCE_GATE_1:
uws = (open ? BG_IC_GATE_WEST_A_WS_OPEN : BG_IC_GATE_WEST_A_WS_CLOSED);
uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_CLOSED);
break;
case GO_ALLIANCE_GATE_2:
uws = (open ? BG_IC_GATE_EAST_A_WS_OPEN : BG_IC_GATE_EAST_A_WS_CLOSED);
uws = (open ? WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_OPEN : WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_CLOSED);
break;
}
return uws;
@@ -18,6 +18,7 @@
#include "BattlegroundNA.h"
#include "Player.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
BattlegroundNA::BattlegroundNA()
{
@@ -66,7 +67,7 @@ void BattlegroundNA::HandleAreaTrigger(Player* player, uint32 trigger)
void BattlegroundNA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(0xa11, 1); // BATTLEGROUND_NAGRAND_ARENA_SHOW
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_NA_ARENA_SHOW, 1);
Arena::FillInitialWorldStates(packet);
}
@@ -19,6 +19,7 @@
#include "Log.h"
#include "Player.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
BattlegroundRL::BattlegroundRL()
{
@@ -93,7 +94,7 @@ void BattlegroundRL::HandleAreaTrigger(Player* player, uint32 trigger)
void BattlegroundRL::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(0xbba, 1); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RL_ARENA_SHOW, 1);
Arena::FillInitialWorldStates(packet);
}
@@ -22,6 +22,7 @@
#include "ObjectAccessor.h"
#include "Player.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
static constexpr Milliseconds BG_RV_PILLAR_SWITCH_TIMER = 25s;
static constexpr Milliseconds BG_RV_FIRE_TO_PILLAR_TIMER = 20s;
@@ -206,7 +207,7 @@ void BattlegroundRV::HandleAreaTrigger(Player* player, uint32 trigger)
void BattlegroundRV::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.emplace_back(BG_RV_WORLD_STATE, 1);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW, 1);
Arena::FillInitialWorldStates(packet);
}
@@ -76,10 +76,6 @@ enum BattlegroundRVData
BG_RV_STATE_OPEN_FENCES,
BG_RV_STATE_SWITCH_PILLARS,
BG_RV_STATE_CLOSE_FIRE,
BG_RV_WORLD_STATE_A = 0xe11,
BG_RV_WORLD_STATE_H = 0xe10,
BG_RV_WORLD_STATE = 0xe1a,
};
class AC_GAME_API BattlegroundRV : public Arena
@@ -238,47 +238,47 @@ bool BattlegroundSA::ResetObjs()
}
//Player may enter BEFORE we set up bG - lets update his worldstates anyway...
UpdateWorldState(BG_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
UpdateWorldState(BG_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
UpdateWorldState(BG_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
if (Attackers == TEAM_ALLIANCE)
{
UpdateWorldState(BG_SA_ALLY_ATTACKS, 1);
UpdateWorldState(BG_SA_HORDE_ATTACKS, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS, 0);
UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_ALL, 1);
UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_ALL, 1);
UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 0);
UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, 0);
UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 1);
UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, 0);
}
else
{
UpdateWorldState(BG_SA_HORDE_ATTACKS, 1);
UpdateWorldState(BG_SA_ALLY_ATTACKS, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS, 0);
UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_ALL, 0);
UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_ALL, 0);
UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 1);
UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, 1);
UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 0);
UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, 1);
}
UpdateWorldState(BG_SA_PURPLE_GATEWS, 1);
UpdateWorldState(BG_SA_RED_GATEWS, 1);
UpdateWorldState(BG_SA_BLUE_GATEWS, 1);
UpdateWorldState(BG_SA_GREEN_GATEWS, 1);
UpdateWorldState(BG_SA_YELLOW_GATEWS, 1);
UpdateWorldState(BG_SA_ANCIENT_GATEWS, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RED_GATE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE, 1);
for (int i = BG_SA_BOAT_ONE; i <= BG_SA_BOAT_TWO; i++)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
@@ -473,40 +473,40 @@ void BattlegroundSA::FillInitialWorldStates(WorldPackets::WorldState::InitWorldS
bool const horde_attacks = Attackers == TEAM_HORDE;
packet.Worldstates.reserve(25);
packet.Worldstates.emplace_back(BG_SA_ANCIENT_GATEWS, GateStatus[BG_SA_ANCIENT_GATE]);
packet.Worldstates.emplace_back(BG_SA_YELLOW_GATEWS, GateStatus[BG_SA_YELLOW_GATE]);
packet.Worldstates.emplace_back(BG_SA_GREEN_GATEWS, GateStatus[BG_SA_GREEN_GATE]);
packet.Worldstates.emplace_back(BG_SA_BLUE_GATEWS, GateStatus[BG_SA_BLUE_GATE]);
packet.Worldstates.emplace_back(BG_SA_RED_GATEWS, GateStatus[BG_SA_RED_GATE]);
packet.Worldstates.emplace_back(BG_SA_PURPLE_GATEWS, GateStatus[BG_SA_PURPLE_GATE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE, GateStatus[BG_SA_ANCIENT_GATE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE, GateStatus[BG_SA_YELLOW_GATE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE, GateStatus[BG_SA_GREEN_GATE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE, GateStatus[BG_SA_BLUE_GATE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RED_GATE, GateStatus[BG_SA_RED_GATE]);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE, GateStatus[BG_SA_PURPLE_GATE]);
packet.Worldstates.emplace_back(BG_SA_BONUS_TIMER, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_BONUS_TIMER, 0);
packet.Worldstates.emplace_back(BG_SA_HORDE_ATTACKS, horde_attacks);
packet.Worldstates.emplace_back(BG_SA_ALLY_ATTACKS, ally_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS, horde_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS, ally_attacks);
//Time will be sent on first update...
packet.Worldstates.emplace_back(BG_SA_ENABLE_TIMER, TimerEnabled ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER, TimerEnabled ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_TIMER_MINS, 0);
packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_TENS, 0);
packet.Worldstates.emplace_back(BG_SA_TIMER_SEC_DECS, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT, 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT, 0);
packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
packet.Worldstates.emplace_back(BG_SA_HORDE_DEFENCE_TOKEN, ally_attacks);
packet.Worldstates.emplace_back(BG_SA_ALLIANCE_DEFENCE_TOKEN, horde_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN, ally_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN, horde_attacks);
packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_HRD, horde_attacks);
packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_HRD, horde_attacks);
packet.Worldstates.emplace_back(BG_SA_RIGHT_ATT_TOKEN_ALL, ally_attacks);
packet.Worldstates.emplace_back(BG_SA_LEFT_ATT_TOKEN_ALL, ally_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE, horde_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE, horde_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE, ally_attacks);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE, ally_attacks);
}
void BattlegroundSA::AddPlayer(Player* player)
@@ -830,9 +830,9 @@ GraveyardStruct const* BattlegroundSA::GetClosestGraveyard(Player* player)
void BattlegroundSA::SendTime()
{
Milliseconds end_of_round = (EndRoundTimer - TotalTime);
UpdateWorldState(BG_SA_TIMER_MINS, end_of_round / 1min);
UpdateWorldState(BG_SA_TIMER_SEC_TENS, (end_of_round % 1min) / 10s);
UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round % 1min) % 10s) / 1s);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES, end_of_round / 1min);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT, (end_of_round % 1min) / 10s);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT, ((end_of_round % 1min) % 10s) / 1s);
}
bool BattlegroundSA::CanInteractWithObject(uint32 objectId)
@@ -973,8 +973,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
dem->SetFaction(BG_SA_Factions[Attackers]);
}
UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
GetBgMap()->DoForAllPlayers([&](Player* player)
{
if (player->GetTeamId() == TEAM_ALLIANCE)
@@ -1004,8 +1004,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
dem->SetFaction(BG_SA_Factions[Attackers]);
}
UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
GetBgMap()->DoForAllPlayers([&](Player* player)
{
if (player->GetTeamId() == TEAM_ALLIANCE)
@@ -1021,8 +1021,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1],
BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY);
UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
GetBgMap()->DoForAllPlayers([&](Player* player)
{
if (player->GetTeamId() == TEAM_ALLIANCE)
@@ -1082,7 +1082,7 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
void BattlegroundSA::ToggleTimer()
{
TimerEnabled = !TimerEnabled;
UpdateWorldState(BG_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0);
}
void BattlegroundSA::EndBattleground(TeamId winnerTeamId)
@@ -20,6 +20,7 @@
#include "Battleground.h"
#include "BattlegroundScore.h"
#include "WorldStateDefines.h"
#define BG_SA_FLAG_AMOUNT 3
#define BG_SA_DEMOLISHER_AMOUNT 4
@@ -42,35 +43,6 @@ enum BG_SA_GateState
BG_SA_GATE_DESTROYED = 3
};
enum BG_SA_WorldStates
{
BG_SA_TIMER_MINS = 3559,
BG_SA_TIMER_SEC_TENS = 3560,
BG_SA_TIMER_SEC_DECS = 3561,
BG_SA_ALLY_ATTACKS = 4352,
BG_SA_HORDE_ATTACKS = 4353,
BG_SA_PURPLE_GATEWS = 3614,
BG_SA_RED_GATEWS = 3617,
BG_SA_BLUE_GATEWS = 3620,
BG_SA_GREEN_GATEWS = 3623,
BG_SA_YELLOW_GATEWS = 3638,
BG_SA_ANCIENT_GATEWS = 3849,
BG_SA_LEFT_GY_ALLIANCE = 3635,
BG_SA_RIGHT_GY_ALLIANCE = 3636,
BG_SA_CENTER_GY_ALLIANCE = 3637,
BG_SA_RIGHT_ATT_TOKEN_ALL = 3627,
BG_SA_LEFT_ATT_TOKEN_ALL = 3626,
BG_SA_LEFT_ATT_TOKEN_HRD = 3629,
BG_SA_RIGHT_ATT_TOKEN_HRD = 3628,
BG_SA_HORDE_DEFENCE_TOKEN = 3631,
BG_SA_ALLIANCE_DEFENCE_TOKEN = 3630,
BG_SA_RIGHT_GY_HORDE = 3632,
BG_SA_LEFT_GY_HORDE = 3633,
BG_SA_CENTER_GY_HORDE = 3634,
BG_SA_BONUS_TIMER = 0xdf3,
BG_SA_ENABLE_TIMER = 3564,
};
enum npc
{
NPC_ANTI_PERSONNAL_CANNON = 27894,
@@ -494,22 +466,22 @@ public:
switch (id)
{
case BG_SA_GREEN_GATE:
uws = BG_SA_GREEN_GATEWS;
uws = WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE;
break;
case BG_SA_YELLOW_GATE:
uws = BG_SA_YELLOW_GATEWS;
uws = WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE;
break;
case BG_SA_BLUE_GATE:
uws = BG_SA_BLUE_GATEWS;
uws = WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE;
break;
case BG_SA_RED_GATE:
uws = BG_SA_RED_GATEWS;
uws = WORLD_STATE_BATTLEGROUND_SA_RED_GATE;
break;
case BG_SA_PURPLE_GATE:
uws = BG_SA_PURPLE_GATEWS;
uws = WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE;
break;
case BG_SA_ANCIENT_GATE:
uws = BG_SA_ANCIENT_GATEWS;
uws = WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE;
break;
}
return uws;
@@ -24,6 +24,7 @@
#include "Player.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
void BattlegroundWGScore::BuildObjectivesBlock(WorldPacket& data)
{
@@ -61,7 +62,7 @@ void BattlegroundWS::PostUpdateImpl(uint32 diff)
switch (_bgEvents.ExecuteEvent())
{
case BG_WS_EVENT_UPDATE_GAME_TIME:
UpdateWorldState(BG_WS_STATE_TIMER, GetMatchTime());
UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER, GetMatchTime());
_bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, ((BG_WS_TOTAL_GAME_TIME - GetStartTime()) % (MINUTE * IN_MILLISECONDS)) + 1);
break;
case BG_WS_EVENT_NO_TIME_LEFT:
@@ -135,7 +136,7 @@ void BattlegroundWS::StartingEventOpenDoors()
SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY);
StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, WS_EVENT_START_BATTLE);
UpdateWorldState(BG_WS_STATE_TIMER_ACTIVE, 1);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, 1);
_bgEvents.ScheduleEvent(BG_WS_EVENT_UPDATE_GAME_TIME, 0);
_bgEvents.ScheduleEvent(BG_WS_EVENT_NO_TIME_LEFT, BG_WS_TOTAL_GAME_TIME - 2 * MINUTE * IN_MILLISECONDS); // 27 - 2 = 25 minutes
_bgEvents.ScheduleEvent(BG_WS_EVENT_DESPAWN_DOORS, BG_WS_DOOR_DESPAWN_TIME);
@@ -216,7 +217,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player)
SpawnBGObject(BG_WS_OBJECT_H_FLAG, BG_WS_FLAG_RESPAWN_TIME);
SpawnBGObject(BG_WS_OBJECT_A_FLAG, BG_WS_FLAG_RESPAWN_TIME);
UpdateWorldState(player->GetTeamId() == TEAM_ALLIANCE ? BG_WS_FLAG_CAPTURES_ALLIANCE : BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(player->GetTeamId()));
UpdateWorldState(player->GetTeamId() == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE : WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE, GetTeamScore(player->GetTeamId()));
UpdatePlayerScore(player, SCORE_FLAG_CAPTURES, 1); // +1 flag captures
_lastFlagCaptureTeam = player->GetTeamId();
@@ -224,7 +225,7 @@ void BattlegroundWS::EventPlayerCapturedFlag(Player* player)
if (GetTeamScore(TEAM_ALLIANCE) == _configurableMaxTeamScore || GetTeamScore(TEAM_HORDE) == _configurableMaxTeamScore)
{
UpdateWorldState(BG_WS_STATE_TIMER_ACTIVE, 0);
UpdateWorldState(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, 0);
EndBattleground(GetTeamScore(TEAM_HORDE) == _configurableMaxTeamScore ? TEAM_HORDE : TEAM_ALLIANCE);
}
else
@@ -391,7 +392,7 @@ void BattlegroundWS::RemovePlayer(Player* player)
void BattlegroundWS::UpdateFlagState(TeamId teamId, uint32 value)
{
_flagState[teamId] = value;
UpdateWorldState(teamId == TEAM_ALLIANCE ? BG_WS_FLAG_STATE_HORDE : BG_WS_FLAG_STATE_ALLIANCE, value);
UpdateWorldState(teamId == TEAM_ALLIANCE ? WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE : WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE, value);
}
void BattlegroundWS::HandleAreaTrigger(Player* player, uint32 trigger)
@@ -554,15 +555,15 @@ GraveyardStruct const* BattlegroundWS::GetClosestGraveyard(Player* player)
void BattlegroundWS::FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet)
{
packet.Worldstates.reserve(7);
packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE));
packet.Worldstates.emplace_back(BG_WS_FLAG_CAPTURES_MAX, _configurableMaxTeamScore);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE, GetTeamScore(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE, GetTeamScore(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_MAX, _configurableMaxTeamScore);
packet.Worldstates.emplace_back(BG_WS_STATE_TIMER_ACTIVE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0);
packet.Worldstates.emplace_back(BG_WS_STATE_TIMER, GetMatchTime());
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE, GetStatus() == STATUS_IN_PROGRESS ? 1 : 0);
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER, GetMatchTime());
packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_HORDE, GetFlagState(TEAM_HORDE));
packet.Worldstates.emplace_back(BG_WS_FLAG_STATE_ALLIANCE, GetFlagState(TEAM_ALLIANCE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE, GetFlagState(TEAM_HORDE));
packet.Worldstates.emplace_back(WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE, GetFlagState(TEAM_ALLIANCE));
}
TeamId BattlegroundWS::GetPrematureWinner()
@@ -86,17 +86,6 @@ enum BG_WS_SpellId
BG_WS_SPELL_BRUTAL_ASSAULT = 46393
};
enum BG_WS_WorldStates
{
BG_WS_FLAG_CAPTURES_ALLIANCE = 1581,
BG_WS_FLAG_CAPTURES_HORDE = 1582,
BG_WS_FLAG_CAPTURES_MAX = 1601,
BG_WS_FLAG_STATE_HORDE = 2338,
BG_WS_FLAG_STATE_ALLIANCE = 2339,
BG_WS_STATE_TIMER = 4248,
BG_WS_STATE_TIMER_ACTIVE = 4247
};
enum BG_WS_ObjectTypes
{
BG_WS_OBJECT_DOOR_A_1 = 0,
+8 -11
View File
@@ -1938,17 +1938,8 @@ bool Creature::CanStartAttack(Unit const* who) const
if (!_IsTargetAcceptable(who))
return false;
// pussywizard: at this point we are either hostile to who or friendly to who->getAttackerForHelper()
// pussywizard: if who is in combat and has an attacker, help him if the distance is right (help because who is hostile or help because attacker is friendly)
bool assist = false;
if (who->IsEngaged() && IsWithinDist(who, ATTACK_DISTANCE))
if (Unit* victim = who->getAttackerForHelper())
if (IsWithinDistInMap(victim, sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS)))
assist = true;
if (!assist)
if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false)) // pussywizard: +m_combatDistance for turrets and similar
return false;
if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAggroRange(who) + m_CombatDistance, true, false)) // pussywizard: +m_combatDistance for turrets and similar
return false;
if (!CanCreatureAttack(who))
return false;
@@ -1956,6 +1947,9 @@ bool Creature::CanStartAttack(Unit const* who) const
if (HasUnitState(UNIT_STATE_STUNNED))
return false;
if (!IsHostileTo(who))
return false;
return IsWithinLOSInMap(who);
}
@@ -2538,6 +2532,9 @@ bool Creature::CanAssistTo(Unit const* u, Unit const* enemy, bool checkfaction /
{
if (GetFaction() != u->GetFaction())
return false;
if (!RespondsToCallForHelp())
return false;
}
else
{
File diff suppressed because it is too large Load Diff
+4
View File
@@ -187,6 +187,7 @@ struct SpellModifier
flag96 mask;
uint32 spellId{0};
Aura* const ownerAura;
uint32 priority{0};
};
typedef std::unordered_map<uint32, PlayerTalent*> PlayerTalentMap;
@@ -2877,6 +2878,9 @@ protected:
uint8 m_swingErrorMsg;
float m_ammoDPS;
float m_Expertise;
float m_OffhandExpertise;
////////////////////Rest System/////////////////////
time_t _restTime;
uint32 _innTriggerId;
+5 -3
View File
@@ -879,7 +879,7 @@ void Player::UpdateExpertise(WeaponAttackType attack)
if (attack == RANGED_ATTACK)
return;
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
float expertise = GetRatingBonusValue(CR_EXPERTISE);
Item* weapon = GetWeaponForAttack(attack, true);
@@ -900,10 +900,12 @@ void Player::UpdateExpertise(WeaponAttackType attack)
switch (attack)
{
case BASE_ATTACK:
SetUInt32Value(PLAYER_EXPERTISE, expertise);
m_Expertise = expertise;
SetUInt32Value(PLAYER_EXPERTISE, int32(expertise));
break;
case OFF_ATTACK:
SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, expertise);
m_OffhandExpertise = expertise;
SetUInt32Value(PLAYER_OFFHAND_EXPERTISE, int32(expertise));
break;
default:
break;
+7
View File
@@ -986,6 +986,13 @@ public:
return false;
}
[[nodiscard]] bool RespondsToCallForHelp() const
{
if (FactionTemplateEntry const* entry = GetFactionTemplateEntry())
return entry->FactionRespondsToCallForHelp();
return false;
}
[[nodiscard]] bool IsInSanctuary() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY); }
[[nodiscard]] bool IsPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP); }
[[nodiscard]] bool IsFFAPvP() const { return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); }
+1
View File
@@ -214,6 +214,7 @@ Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool log
else
{
LOG_DEBUG("maps", "Map::PlayerCannotEnter - player '{}' is dead but does not have a corpse!", player->GetName());
return Map::CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE;
}
}
@@ -701,6 +701,7 @@ void AuraEffect::CalculateSpellMod()
m_spellmod->spellId = GetId();
m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask;
m_spellmod->charges = GetBase()->GetCharges();
m_spellmod->priority = GetSpellInfo()->SpellPriority;
}
m_spellmod->value = GetAmount();
break;
+1 -1
View File
@@ -1659,7 +1659,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (removeMode != AURA_REMOVE_BY_EXPIRE || aurApp->GetBase()->IsExpired())
break;
if (target->HasAura(70752)) // Item - Mage T10 2P Bonus
target->CastSpell(target, 70753, true);
target->CastSpell(target, 70753, true); // Pushing the Limit
break;
default:
break;
+1 -1
View File
@@ -28,7 +28,7 @@ enum SpellInterruptFlags
SPELL_INTERRUPT_FLAG_UNK3 = 0x04, // any info?
SPELL_INTERRUPT_FLAG_INTERRUPT = 0x08, // interrupt
SPELL_INTERRUPT_FLAG_ABORT_ON_DMG = 0x10, // _complete_ interrupt on direct damage
//SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph"
SPELL_INTERRUPT_UNK = 0x20 // unk, 564 of 727 spells having this spell start with "Glyph"
};
// See SpellAuraInterruptFlags for other values definitions
+197 -9
View File
@@ -272,20 +272,13 @@ void SpellMgr::LoadSpellInfoCorrections()
54741, // Firestarter
64823, // Item - Druid T8 Balance 4P Bonus
34477, // Misdirection
44401, // Missile Barrage
18820 // Insight
18820, // Insight
57761 // Fireball!
}, [](SpellInfo* spellInfo)
{
spellInfo->ProcCharges = 1;
});
// Fireball
ApplySpellFix({ 57761 }, [](SpellInfo* spellInfo)
{
spellInfo->ProcCharges = 1;
spellInfo->SpellPriority = 50;
});
// Tidal Wave
ApplySpellFix({ 53390 }, [](SpellInfo* spellInfo)
{
@@ -4910,6 +4903,201 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->AttributesEx7 |= SPELL_ATTR7_TREAT_AS_NPC_AOE;
});
// Heal (Crystal Spire of Karabor)
ApplySpellFix({ 40972 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx3 |= SPELL_ATTR3_SUPPRESS_CASTER_PROCS;
});
// Torch (Death Knights near the Chapel)
ApplySpellFix({ 52953 }, [](SpellInfo* spellInfo)
{
spellInfo->MaxAffectedTargets = 1;
});
// Missile Barrage
ApplySpellFix({ 44401 }, [](SpellInfo* spellInfo)
{
spellInfo->ProcCharges = 1;
spellInfo->SpellPriority = 100;
});
// Auto Shot
ApplySpellFix({ 75 }, [](SpellInfo* spellInfo)
{
spellInfo->CastTimeEntry = sSpellCastTimesStore.LookupEntry(1); // 0s
spellInfo->InterruptFlags &= ~SPELL_INTERRUPT_UNK;
});
// Life Tap
ApplySpellFix({ 1454 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0.0f;
});
// Life Tap
ApplySpellFix({ 1455, 1456, 11687, 11688, 11689, 27222, 57946 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].RealPointsPerLevel = 0.0f;
spellInfo->MaxLevel = 16;
spellInfo->BaseLevel = 6;
spellInfo->SpellLevel = 6;
});
// Explosive Sheep
ApplySpellFix({ 4074 }, [](SpellInfo* spellInfo)
{
spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(25);
});
// Phase Shift
ApplySpellFix({ 4511 }, [](SpellInfo* spellInfo)
{
spellInfo->AuraInterruptFlags &= ~AURA_INTERRUPT_FLAG_MELEE_ATTACK;
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST;
});
// Charge Stun
ApplySpellFix({ 7922 }, [](SpellInfo* spellInfo)
{
spellInfo->Attributes |= SPELL_ATTR0_NO_ACTIVE_DEFENSE;
});
// Tharnariun's Heal
ApplySpellFix({ 9457 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx2 &= ~SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
spellInfo->AttributesEx3 |= SPELL_ATTR3_IGNORE_CASTER_AND_TARGET_RESTRICTIONS;
spellInfo->Effects[EFFECT_0].DieSides = 0;
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY);
});
// Supercharge
ApplySpellFix({ 10732 }, [](SpellInfo* spellInfo)
{
spellInfo->CategoryEntry = sSpellCategoryStore.LookupEntry(0);
spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_DO_NOT_SHEATH);
spellInfo->Attributes |= SPELL_ATTR0_NOT_SHAPESHIFTED;
spellInfo->AttributesEx |= SPELL_ATTR1_TRACK_TARGET_IN_CHANNEL;
spellInfo->AttributesEx2 |= SPELL_ATTR2_NO_TARGET_PER_SECOND_COST;
spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_FROM_PROCS;
spellInfo->FacingCasterFlags |= SPELL_FACING_FLAG_INFRONT;
spellInfo->InterruptFlags |= (SPELL_INTERRUPT_FLAG_MOVEMENT | SPELL_INTERRUPT_FLAG_PUSH_BACK |
SPELL_INTERRUPT_FLAG_UNK3 | SPELL_INTERRUPT_FLAG_INTERRUPT);
spellInfo->ChannelInterruptFlags &= ~AURA_INTERRUPT_FLAG_JUMP;
spellInfo->ChannelInterruptFlags |= AURA_INTERRUPT_FLAG_UNK14;
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ALLY);
spellInfo->Effects[EFFECT_0].Amplitude = 3000;
spellInfo->Effects[EFFECT_1].Amplitude = 3000;
spellInfo->Effects[EFFECT_2].Amplitude = 3000;
spellInfo->SpellVisual[0] = 12656;
});
// Intercept
ApplySpellFix({ 20252 }, [](SpellInfo* spellInfo)
{
spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_NOT_SHAPESHIFTED | SPELL_ATTR0_DO_NOT_SHEATH);
spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP;
});
// Intercept
ApplySpellFix({ 20253 }, [](SpellInfo* spellInfo)
{
spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_NOT_SHAPESHIFTED | SPELL_ATTR0_DO_NOT_SHEATH);
spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP;
spellInfo->AttributesEx7 |= (SPELL_ATTR7_NO_ATTACK_DODGE | SPELL_ATTR7_NO_ATTACK_PARRY);
spellInfo->SpellLevel = 0;
});
// Heart of the Crusader
ApplySpellFix({ 20335, 20336, 20337 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_2].Effect = SPELL_EFFECT_APPLY_AURA;
spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ENEMY);
spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_DUMMY;
});
// Gordok Ogre Suit
ApplySpellFix({ 22736 }, [](SpellInfo* spellInfo)
{
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_MOUNT;
});
// Soul Flame
ApplySpellFix({ 23272 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_2].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
});
// Tree Disguise
ApplySpellFix({ 30298 }, [](SpellInfo* spellInfo)
{
spellInfo->InterruptFlags |= (SPELL_INTERRUPT_FLAG_MOVEMENT | SPELL_INTERRUPT_FLAG_PUSH_BACK |
SPELL_INTERRUPT_FLAG_UNK3 | SPELL_INTERRUPT_FLAG_INTERRUPT);
spellInfo->Effects[EFFECT_2].ApplyAuraName = SPELL_AURA_MOD_STUN;
});
// Internal Shake Camera w/ rumble sound
ApplySpellFix({ 33271 }, [](SpellInfo* spellInfo)
{
spellInfo->Attributes |= SPELL_ATTR0_ALLOW_WHILE_MOUNTED;
});
// Glaive
ApplySpellFix({ 36500 }, [](SpellInfo* spellInfo)
{
spellInfo->Attributes &= ~SPELL_ATTR0_SCALES_WITH_CREATURE_LEVEL;
spellInfo->Effects[EFFECT_0].DieSides = 68;
spellInfo->Effects[EFFECT_0].BasePoints = 201;
});
// Create Anchorite Relic
ApplySpellFix({ 39183 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_1].TargetA = SpellImplicitTargetInfo(0);
});
// Charge Rifts
ApplySpellFix({ 47747 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_45_YARDS);
});
// New Summon Test
ApplySpellFix({ 49214 }, [](SpellInfo* spellInfo)
{
spellInfo->DurationEntry = sSpellDurationStore.LookupEntry(3);
});
// Plague Strike
ApplySpellFix({ 54469 }, [](SpellInfo* spellInfo)
{
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS);
spellInfo->Effects[EFFECT_1].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS);
spellInfo->Effects[EFFECT_2].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_5_YARDS);
});
// Glyph of Chains of Ice:
ApplySpellFix({ 58620 }, [](SpellInfo* spellInfo)
{
spellInfo->SpellLevel = 0;
});
// Exit Portal
ApplySpellFix({ 60474 }, [](SpellInfo* spellInfo)
{
spellInfo->AttributesEx6 |= SPELL_ATTR6_ALLOW_WHILE_RIDING_VEHICLE;
});
// Shattering Throw
ApplySpellFix({ 64382 }, [](SpellInfo* spellInfo)
{
spellInfo->Attributes &= ~(SPELL_ATTR0_IS_ABILITY | SPELL_ATTR0_NOT_SHAPESHIFTED | SPELL_ATTR0_DO_NOT_SHEATH);
spellInfo->Attributes |= SPELL_ATTR0_ALLOW_ITEM_SPELL_IN_PVP;
});
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo* spellInfo = mSpellInfoMap[i];
@@ -22,6 +22,7 @@
#include "QueryResult.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldStateDefines.h"
void CharacterDatabaseCleaner::CleanDatabase()
{
@@ -34,7 +35,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
uint32 oldMSTime = getMSTime();
// check flags which clean ups are necessary
QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = {}", WS_CLEANING_FLAGS);
QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = {}", WORLD_STATE_CUSTOM_CLEANING_FLAGS);
if (!result)
return;
@@ -59,7 +60,7 @@ void CharacterDatabaseCleaner::CleanDatabase()
// NOTE: In order to have persistentFlags be set in worldstates for the next cleanup,
// you need to define them at least once in worldstates.
flags &= sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS);
CharacterDatabase.DirectExecute("UPDATE worldstates SET value = {} WHERE entry = {}", flags, WS_CLEANING_FLAGS);
CharacterDatabase.DirectExecute("UPDATE worldstates SET value = {} WHERE entry = {}", flags, WORLD_STATE_CUSTOM_CLEANING_FLAGS);
sWorld->SetCleaningFlags(flags);
+21 -20
View File
@@ -97,6 +97,7 @@
#include "WorldSession.h"
#include "WorldSessionMgr.h"
#include "WorldState.h"
#include "WorldStateDefines.h"
#include <boost/asio/ip/address.hpp>
#include <cmath>
@@ -1168,9 +1169,9 @@ void World::LoadConfigSettings(bool reload)
// Wintergrasp
_int_configs[CONFIG_WINTERGRASP_ENABLE] = sConfigMgr->GetOption<int32>("Wintergrasp.Enable", 1);
_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMax", 100);
_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMax", 120);
_int_configs[CONFIG_WINTERGRASP_PLR_MIN] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMin", 0);
_int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMinLvl", 77);
_int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMinLvl", 75);
_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = sConfigMgr->GetOption<int32>("Wintergrasp.BattleTimer", 30);
_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = sConfigMgr->GetOption<int32>("Wintergrasp.NoBattleTimer", 150);
_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = sConfigMgr->GetOption<int32>("Wintergrasp.CrashRestartTimer", 10);
@@ -2521,67 +2522,67 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount,uint32 acc
void World::InitWeeklyQuestResetTime()
{
Seconds wstime = Seconds(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME));
Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME));
_nextWeeklyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6));
if (wstime == 0s)
{
sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count());
}
}
void World::InitDailyQuestResetTime()
{
Seconds wstime = Seconds(sWorld->getWorldState(WS_DAILY_QUEST_RESET_TIME));
Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME));
_nextDailyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
if (wstime == 0s)
{
sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count());
}
}
void World::InitMonthlyQuestResetTime()
{
Seconds wstime = Seconds(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME));
Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME));
_nextMonthlyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
if (wstime == 0s)
{
sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count());
}
}
void World::InitRandomBGResetTime()
{
Seconds wstime = Seconds(sWorld->getWorldState(WS_BG_DAILY_RESET_TIME));
Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME));
_nextRandomBGReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
if (wstime == 0s)
{
sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME, _nextRandomBGReset.count());
}
}
void World::InitCalendarOldEventsDeletionTime()
{
Seconds currentDeletionTime = Seconds(getWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME));
Seconds currentDeletionTime = Seconds(getWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME));
Seconds nextDeletionTime = currentDeletionTime > 0s ? currentDeletionTime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, getIntConfig(CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR)));
if (currentDeletionTime == 0s)
{
sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, nextDeletionTime.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, nextDeletionTime.count());
}
}
void World::InitGuildResetTime()
{
Seconds wstime = Seconds(getWorldState(WS_GUILD_DAILY_RESET_TIME));
Seconds wstime = Seconds(getWorldState(WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME));
_nextGuildReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
if (wstime == 0s)
{
sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME, _nextGuildReset.count());
}
}
@@ -2596,7 +2597,7 @@ void World::ResetDailyQuests()
itr->second->GetPlayer()->ResetDailyQuestStatus();
_nextDailyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count());
// change available dailies
sPoolMgr->ChangeDailyQuests();
@@ -2632,7 +2633,7 @@ void World::ResetWeeklyQuests()
itr->second->GetPlayer()->ResetWeeklyQuestStatus();
_nextWeeklyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6));
sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count());
// change available weeklies
sPoolMgr->ChangeWeeklyQuests();
@@ -2651,7 +2652,7 @@ void World::ResetMonthlyQuests()
itr->second->GetPlayer()->ResetMonthlyQuestStatus();
_nextMonthlyQuestReset = Seconds(Acore::Time::GetNextTimeWithMonthAndHour(-1, 6));
sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count());
}
void World::ResetEventSeasonalQuests(uint16 event_id)
@@ -2679,7 +2680,7 @@ void World::ResetRandomBG()
itr->second->GetPlayer()->SetRandomWinner(false);
_nextRandomBGReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME, _nextRandomBGReset.count());
}
void World::CalendarDeleteOldEvents()
@@ -2687,7 +2688,7 @@ void World::CalendarDeleteOldEvents()
LOG_INFO("server.worldserver", "Calendar deletion of old events.");
_nextCalendarOldEventsDeletionTime = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, getIntConfig(CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR)));
sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, _nextCalendarOldEventsDeletionTime.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, _nextCalendarOldEventsDeletionTime.count());
sCalendarMgr->DeleteOldEvents();
}
@@ -2696,7 +2697,7 @@ void World::ResetGuildCap()
LOG_INFO("server.worldserver", "Guild Daily Cap reset.");
_nextGuildReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME, _nextGuildReset.count());
sGuildMgr->ResetTimes();
}
-12
View File
@@ -127,18 +127,6 @@ enum RealmZone
REALM_ZONE_CN5_8 = 37 // basic-Latin at create, any at login
};
enum WorldStates
{
WS_ARENA_DISTRIBUTION_TIME = 20001, // Next arena distribution time
WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time
WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time
WS_CLEANING_FLAGS = 20004, // Cleaning Flags
WS_DAILY_QUEST_RESET_TIME = 20005, // Next daily reset time
WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time
WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time
WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME = 20008 // Next daily calendar deletions of old events time
};
// xinef: petitions storage
struct PetitionData
{
+1
View File
@@ -21,6 +21,7 @@
#include "SharedDefines.h"
#include "Weather.h"
#include "WorldState.h"
#include "WorldStateDefines.h"
WorldState* WorldState::instance()
{
-18
View File
@@ -21,24 +21,6 @@
#include "Player.h"
#include <atomic>
// TODO: Move these to WorldStateDefines.h
enum WorldStateWorldStates
{
// Sun's Reach Reclamation
WORLD_STATE_QUEL_DANAS_MUSIC = 3426,
WORLD_STATE_QUEL_DANAS_HARBOR = 3238,
WORLD_STATE_QUEL_DANAS_ALCHEMY_LAB = 3223,
WORLD_STATE_QUEL_DANAS_ARMORY = 3233,
WORLD_STATE_QUEL_DANAS_SANCTUM = 3244,
WORLD_STATE_QUEL_DANAS_PORTAL = 3269,
WORLD_STATE_QUEL_DANAS_ANVIL = 3228,
WORLD_STATE_QUEL_DANAS_MONUMENT = 3275,
// Sunwell Gate
WORLD_STATE_AGAMATH_THE_FIRST_GATE_HEALTH = 3253, // guessed, potentially wrong
WORLD_STATE_ROHENDOR_THE_SECOND_GATE_HEALTH = 3255,
WORLD_STATE_ARCHONISUS_THE_FINAL_GATE_HEALTH = 3257,
};
enum WorldStateCondition
{
WORLD_STATE_CONDITION_TROLLBANES_COMMAND = 39911,
+622
View File
@@ -0,0 +1,622 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WORLD_STATE_DEFINES_H
#define WORLD_STATE_DEFINES_H
enum WorldStateIDs
{
// Scourge Invasion
WORLD_STATE_SCOURGE_INVASION_VICTORIES = 2219,
// Active Invasion Indicators
WORLD_STATE_SCOURGE_INVASION_WINTERSPRING = 2259,
WORLD_STATE_SCOURGE_INVASION_AZSHARA = 2260,
WORLD_STATE_SCOURGE_INVASION_BLASTED_LANDS = 2261,
WORLD_STATE_SCOURGE_INVASION_BURNING_STEPPES = 2262,
WORLD_STATE_SCOURGE_INVASION_TANARIS = 2263,
WORLD_STATE_SCOURGE_INVASION_EASTERN_PLAGUELANDS = 2264,
// Active Necropoli
WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_AZSHARA = 2279,
WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_BLASTED_LANDS = 2280,
WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_BURNING_STEPPES = 2281,
WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_EASTERN_PLAGUELANDS = 2282,
WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_TANARIS = 2283,
WORLD_STATE_SCOURGE_INVASION_NECROPOLIS_WINTERSPRING = 2284,
// Arena
WORLD_STATE_ARENA_SEASON_PROGRESS = 3191,
WORLD_STATE_ARENA_ALIVE_PLAYERS_GREEN = 3600,
WORLD_STATE_ARENA_ALIVE_PLAYERS_GOLD = 3601,
WORLD_STATE_ARENA_SEASON_ID = 3901,
// Sun's Reach Reclamation
WORLD_STATE_QUEL_DANAS_MUSIC = 3426,
WORLD_STATE_QUEL_DANAS_HARBOR = 3238,
WORLD_STATE_QUEL_DANAS_ALCHEMY_LAB = 3223,
WORLD_STATE_QUEL_DANAS_ARMORY = 3233,
WORLD_STATE_QUEL_DANAS_SANCTUM = 3244,
WORLD_STATE_QUEL_DANAS_PORTAL = 3269,
WORLD_STATE_QUEL_DANAS_ANVIL = 3228,
WORLD_STATE_QUEL_DANAS_MONUMENT = 3275,
// Sunwell Gate
WORLD_STATE_AGAMATH_THE_FIRST_GATE_HEALTH = 3253, // guessed, potentially wrong
WORLD_STATE_ROHENDOR_THE_SECOND_GATE_HEALTH = 3255,
WORLD_STATE_ARCHONISUS_THE_FINAL_GATE_HEALTH = 3257,
// Wintergrasp
WORLD_STATE_BATTLEFIELD_WG_VEHICLE_H = 3490,
WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_H = 3491,
WORLD_STATE_BATTLEFIELD_WG_VEHICLE_A = 3680,
WORLD_STATE_BATTLEFIELD_WG_MAX_VEHICLE_A = 3681,
WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_W = 3698,
WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_K_E = 3699,
WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NW = 3700,
WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_NE = 3701,
WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SW = 3702,
WORLD_STATE_BATTLEFIELD_WG_WORKSHOP_SE = 3703,
WORLD_STATE_BATTLEFIELD_WG_SHOW = 3710,
WORLD_STATE_BATTLEFIELD_WG_CLOCK = 3781,
WORLD_STATE_BATTLEFIELD_WG_ACTIVE = 3801,
WORLD_STATE_BATTLEFIELD_WG_DEFENDER = 3802,
WORLD_STATE_BATTLEFIELD_WG_ATTACKER = 3803,
WORLD_STATE_BATTLEFIELD_WG_CONTROL = 3804, // Shows on the map who controls WG
WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_CAPTURED = 4022,
WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_CAPTURED = 4023,
WORLD_STATE_BATTLEFIELD_WG_HORDE_KEEP_DEFENDED = 4024,
WORLD_STATE_BATTLEFIELD_WG_ALLIANCE_KEEP_DEFENDED = 4025,
WORLD_STATE_BATTLEFIELD_WG_CLOCK_TEXTS = 4354,
WORLD_STATE_BATTLEFIELD_WG_ICON_ACTIVE = 4375, // Activates "ice" icon
// Alterac Valley
WORLD_STATE_BATTLEGROUND_AV_STORMPIKE_LIEUTENANTS = 950,
WORLD_STATE_BATTLEGROUND_AV_STORMPIKE_COMMANDERS = 962,
WORLD_STATE_BATTLEGROUND_AV_UNK_0 = 964,
WORLD_STATE_BATTLEGROUND_AV_UNK_1 = 966,
WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_C = 1301,
WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_C = 1302,
WORLD_STATE_BATTLEGROUND_AV_STONEHEART_H_A = 1303,
WORLD_STATE_BATTLEGROUND_AV_STONEHEART_A_A = 1304,
WORLD_STATE_BATTLEGROUND_AV_AID_A_C = 1325,
WORLD_STATE_BATTLEGROUND_AV_AID_A_A = 1326,
WORLD_STATE_BATTLEGROUND_AV_AID_H_C = 1327,
WORLD_STATE_BATTLEGROUND_AV_AID_H_A = 1328,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_C = 1329,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_C = 1330,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_A_A = 1331,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFHUT_H_A = 1332,
WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_C = 1333,
WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_C = 1334,
WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_A_A = 1335,
WORLD_STATE_BATTLEGROUND_AV_PIKEGRAVE_H_A = 1336,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_C = 1337,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_C = 1338,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_A_A = 1339,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLF_H_A = 1340,
WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_C = 1341,
WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_C = 1342,
WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_A_A = 1343,
WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_H_A = 1344,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_C = 1346,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_C = 1347,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_A_A = 1348,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_H_A = 1349,
WORLD_STATE_BATTLEGROUND_AV_S_MINE_A = 1355,
WORLD_STATE_BATTLEGROUND_AV_S_MINE_H = 1356,
WORLD_STATE_BATTLEGROUND_AV_S_MINE_N = 1357,
WORLD_STATE_BATTLEGROUND_AV_N_MINE_A = 1358,
WORLD_STATE_BATTLEGROUND_AV_N_MINE_H = 1359,
WORLD_STATE_BATTLEGROUND_AV_N_MINE_N = 1360,
WORLD_STATE_BATTLEGROUND_AV_DUNS_CONTROLLED = 1361,
WORLD_STATE_BATTLEGROUND_AV_DUNN_CONTROLLED = 1362,
WORLD_STATE_BATTLEGROUND_AV_ICEWING_CONTROLLED = 1363,
WORLD_STATE_BATTLEGROUND_AV_STONEH_CONTROLLED = 1364,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_DESTROYED = 1365,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_DESTROYED = 1366,
WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_DESTROYED = 1367,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_DESTROYED = 1368,
WORLD_STATE_BATTLEGROUND_AV_UNK_2 = 1369,
WORLD_STATE_BATTLEGROUND_AV_DUNS_DESTROYED = 1370,
WORLD_STATE_BATTLEGROUND_AV_DUNN_DESTROYED = 1371,
WORLD_STATE_BATTLEGROUND_AV_ICEWING_DESTROYED = 1372,
WORLD_STATE_BATTLEGROUND_AV_STONEH_DESTROYED = 1373,
WORLD_STATE_BATTLEGROUND_AV_DUNN_UNUSED = 1374, // Unused
WORLD_STATE_BATTLEGROUND_AV_DUNS_UNUSED = 1375, // Unused
WORLD_STATE_BATTLEGROUND_AV_ICEWING_UNUSED = 1376, // Unused
WORLD_STATE_BATTLEGROUND_AV_STONEH_UNUSED = 1377, // Unused
WORLD_STATE_BATTLEGROUND_AV_DUNS_ASSAULTED = 1378,
WORLD_STATE_BATTLEGROUND_AV_DUNN_ASSAULTED = 1379,
WORLD_STATE_BATTLEGROUND_AV_ICEWING_ASSAULTED = 1380,
WORLD_STATE_BATTLEGROUND_AV_STONEH_ASSAULTED = 1381,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_CONTROLLED = 1382,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_CONTROLLED = 1383,
WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_CONTROLLED = 1384,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_CONTROLLED = 1385,
WORLD_STATE_BATTLEGROUND_AV_UNK_3 = 1386,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_ASSAULTED = 1387,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_ASSAULTED = 1388,
WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_ASSAULTED = 1389,
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_ASSAULTED = 1390,
WORLD_STATE_BATTLEGROUND_AV_UNK_4 = 1391,
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFW_UNUSED = 1392, // Unused
WORLD_STATE_BATTLEGROUND_AV_FROSTWOLFE_UNUSED = 1393, // Unused
WORLD_STATE_BATTLEGROUND_AV_TOWERPOINT_UNUSED = 1394, // Unused
WORLD_STATE_BATTLEGROUND_AV_ICEBLOOD_UNUSED = 1395, // Unused
WORLD_STATE_BATTLEGROUND_AV_UNK_5 = 1396,
WORLD_STATE_BATTLEGROUND_AV_SNOWFALL_N = 1966,
WORLD_STATE_BATTLEGROUND_AV_ALLIANCE_SCORE = 3127,
WORLD_STATE_BATTLEGROUND_AV_HORDE_SCORE = 3128,
WORLD_STATE_BATTLEGROUND_AV_SHOW_HORDE_SCORE = 3133,
WORLD_STATE_BATTLEGROUND_AV_SHOW_ALLIANCE_SCORE = 3134,
// Warsong Gulch
WORLD_STATE_BATTLEGROUND_WS_UNK_0 = 1545, // set to 1 on alliance flag pickup...
WORLD_STATE_BATTLEGROUND_WS_UNK_1 = 1546, // set to 1 on horde flag pickup, after drop it's -1
WORLD_STATE_BATTLEGROUND_WS_UNK_2 = 1547,
WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_ALLIANCE = 1581,
WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_HORDE = 1582,
WORLD_STATE_BATTLEGROUND_WS_FLAG_CAPTURES_MAX = 1601, // unk
WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_HORDE = 2338, // (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing)
WORLD_STATE_BATTLEGROUND_WS_FLAG_STATE_ALLIANCE = 2339, // (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing)
WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER_ACTIVE = 4247,
WORLD_STATE_BATTLEGROUND_WS_STATE_TIMER = 4248,
// Arathi Basin
WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_ALLIANCE = 1767,
WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_HORDE = 1768,
WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_CONTROLLED_ALLIANCE = 1769,
WORLD_STATE_BATTLEGROUND_AB_STABLE_STATE_CONTROLLED_HORDE = 1770,
WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_ALLIANCE = 1772,
WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_HORDE = 1773,
WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_CONTROLLED_ALLIANCE = 1774,
WORLD_STATE_BATTLEGROUND_AB_FARM_STATE_CONTROLLED_HORDE = 1775,
WORLD_STATE_BATTLEGROUND_AB_RESOURCES_ALLIANCE = 1776,
WORLD_STATE_BATTLEGROUND_AB_RESOURCES_HORDE = 1777,
WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_HORDE = 1778,
WORLD_STATE_BATTLEGROUND_AB_OCCUPIED_BASES_ALLIANCE = 1779,
WORLD_STATE_BATTLEGROUND_AB_RESOURCES_MAX = 1780,
WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_ALLIANCE = 1782,
WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_HORDE = 1783,
WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_CONTROLLED_ALLIANCE = 1784,
WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_STATE_CONTROLLED_HORDE = 1785,
WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_ALLIANCE = 1787,
WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_HORDE = 1788,
WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_CONTROLLED_ALLIANCE = 1789,
WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_STATE_CONTROLLED_HORDE = 1790,
WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_ALLIANCE = 1792,
WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_HORDE = 1793,
WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_CONTROLLED_ALLIANCE = 1794,
WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_STATE_CONTROLLED_HORDE = 1795,
WORLD_STATE_BATTLEGROUND_AB_STABLE_ICON = 1842, // 1 - uncontrolled
WORLD_STATE_BATTLEGROUND_AB_GOLDMINE_ICON = 1843, // 1 - uncontrolled
WORLD_STATE_BATTLEGROUND_AB_LUMBERMILL_ICON = 1844, // 1 - uncontrolled
WORLD_STATE_BATTLEGROUND_AB_FARM_ICON = 1845, // 1 - uncontrolled
WORLD_STATE_BATTLEGROUND_AB_BLACKSMITH_ICON = 1846, // 1 - uncontrolled
WORLD_STATE_BATTLEGROUND_AB_UNK = 1861,
WORLD_STATE_BATTLEGROUND_AB_RESOURCES_WARNING = 1955,
// Eye of the Storm
WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_SHOW = 2718, //1 init, 0 druhy send - bez messagu, 1 = controlled aliance // Capturing progress-bar (1 - show, 0 - hide)
WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_STATUS = 2719, //50 init!, 48 ... hordak bere .. 33 .. 0 = full 100% hordacky, 100 = full alliance // Capturing progress-bar (0 - left, 100 - right)
WORLD_STATE_BATTLEGROUND_EY_PROGRESS_BAR_PERCENT_GREY = 2720, //100 = empty (only grey), 0 = blue|red (no grey)
WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_UNCONTROL = 2722, // 1 - yes, 0 - no
WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_ALLIANCE_CONTROL = 2723,
WORLD_STATE_BATTLEGROUND_EY_BLOOD_ELF_HORDE_CONTROL = 2724,
WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_UNCONTROL = 2725, // 1 - yes, 0 - no
WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONTROL = 2726,
WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONTROL = 2727,
WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_UNCONTROL = 2728, // 1 - yes, 0 - no
WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONTROL = 2729,
WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONTROL = 2730,
WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_UNCONTROL = 2731, // 1 - yes, 0 - no
WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONTROL = 2732,
WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONTROL = 2733,
WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_HORDE_CONFLICT = 2737,
WORLD_STATE_BATTLEGROUND_EY_DRAENEI_RUINS_ALLIANCE_CONFLICT = 2738,
WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_ALLIANCE_CONFLICT = 2739,
WORLD_STATE_BATTLEGROUND_EY_FEL_REAVER_HORDE_CONFLICT = 2740,
WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_ALLIANCE_CONFLICT = 2741,
WORLD_STATE_BATTLEGROUND_EY_MAGE_TOWER_HORDE_CONFLICT = 2742,
WORLD_STATE_BATTLEGROUND_EY_UNK_0 = 2565, // 142, constant?
WORLD_STATE_BATTLEGROUND_EY_UNK_1 = 2735, // 0 at start
WORLD_STATE_BATTLEGROUND_EY_UNK_2 = 2736, // 0 at start
WORLD_STATE_BATTLEGROUND_EY_UNK_3 = 3085, // 379, constant?
WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_RESOURCES = 2749,
WORLD_STATE_BATTLEGROUND_EY_HORDE_RESOURCES = 2750,
WORLD_STATE_BATTLEGROUND_EY_ALLIANCE_BASE = 2752,
WORLD_STATE_BATTLEGROUND_EY_HORDE_BASE = 2753,
WORLD_STATE_BATTLEGROUND_EY_FLAG = 2757, // 1 - show, 0 - hide (doesn't work exactly this way!)
WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_ALLIANCE = 2769, // 0 - hide, 1 - show stats, 2 - Alliance picked up the flag
WORLD_STATE_BATTLEGROUND_EY_FLAG_STATE_HORDE = 2770, // 0 - hide, 1 - show stats, 2 - Horde picked up the flag
// Isle of Conquest
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT_SET = 4221,
WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT_SET = 4222,
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_REINFORCEMENT = 4226,
WORLD_STATE_BATTLEGROUND_IC_HORDE_REINFORCEMENT = 4227,
WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_A = 4228,
WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_A = 4229,
WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONTROLLED_H = 4230,
WORLD_STATE_BATTLEGROUND_IC_UNK = 4243,
WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_CONFLICT_H = 4293,
WORLD_STATE_BATTLEGROUND_IC_WORKSHOP_UNCONTROLLED = 4294,
WORLD_STATE_BATTLEGROUND_IC_HANGAR_UNCONTROLLED = 4296,
WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_H = 4297,
WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_H = 4298,
WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONTROLLED_A = 4299,
WORLD_STATE_BATTLEGROUND_IC_HANGAR_CONFLICT_A = 4300,
WORLD_STATE_BATTLEGROUND_IC_DOCKS_UNCONTROLLED = 4301,
WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_H = 4302,
WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_H = 4303,
WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONTROLLED_A = 4304,
WORLD_STATE_BATTLEGROUND_IC_DOCKS_CONFLICT_A = 4305,
WORLD_STATE_BATTLEGROUND_IC_QUARRY_UNCONTROLLED = 4306,
WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_H = 4307,
WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_H = 4308,
WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONTROLLED_A = 4309,
WORLD_STATE_BATTLEGROUND_IC_QUARRY_CONFLICT_A = 4310,
WORLD_STATE_BATTLEGROUND_IC_REFINERY_UNCONTROLLED = 4311,
WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_H = 4312,
WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_H = 4313,
WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONTROLLED_A = 4314,
WORLD_STATE_BATTLEGROUND_IC_REFINERY_CONFLICT_A = 4315,
WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_CLOSED = 4317,
WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_CLOSED = 4318,
WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_CLOSED = 4319,
WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_H_WS_OPEN = 4320,
WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_H_WS_OPEN = 4321,
WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_H_WS_OPEN = 4322,
WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_OPEN = 4323,
WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_OPEN = 4324,
WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_OPEN = 4325,
WORLD_STATE_BATTLEGROUND_IC_GATE_EAST_A_WS_CLOSED = 4326,
WORLD_STATE_BATTLEGROUND_IC_GATE_WEST_A_WS_CLOSED = 4327,
WORLD_STATE_BATTLEGROUND_IC_GATE_FRONT_A_WS_CLOSED = 4328,
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_A = 4339,
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONTROLLED_H = 4340,
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_UNCONTROLLED = 4341,
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_A = 4342,
WORLD_STATE_BATTLEGROUND_IC_ALLIANCE_KEEP_CONFLICT_H = 4343,
WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_A = 4344,
WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONTROLLED_H = 4345,
WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_UNCONTROLLED = 4346,
WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_A = 4347,
WORLD_STATE_BATTLEGROUND_IC_HORDE_KEEP_CONFLICT_H = 4348,
// Strand of the Ancients
// Gates: 1-3 A defend, 4-6 H defend, 7-9 unk defend, 1 - ok, 2 - half destroyed, 3 - destroyed
WORLD_STATE_BATTLEGROUND_SA_TIMER_MINUTES = 3559,
WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_FIRST_DIGIT = 3560,
WORLD_STATE_BATTLEGROUND_SA_TIMER_SECONDS_SECOND_DIGIT = 3561,
WORLD_STATE_BATTLEGROUND_SA_ENABLE_TIMER = 3564, // previously mislabelled? (Alliance Attacker)
WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKER = 3565, // mislabelled?
WORLD_STATE_BATTLEGROUND_SA_BONUS_TIMER = 3571, // bonus timer (1 - on, 0 - off)
WORLD_STATE_BATTLEGROUND_SA_PURPLE_GATE = 3614, // Gate of Purple Amethyst
WORLD_STATE_BATTLEGROUND_SA_RED_GATE = 3617, // Gate of Red Sun
WORLD_STATE_BATTLEGROUND_SA_BLUE_GATE = 3620, // Gate of Blue Sapphire
WORLD_STATE_BATTLEGROUND_SA_GREEN_GATE = 3623, // Gate of Green Emerald
WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_ALLIANCE = 3626,
WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_ALLIANCE = 3627,
WORLD_STATE_BATTLEGROUND_SA_RIGHT_ATTACK_TOKEN_HORDE = 3628,
WORLD_STATE_BATTLEGROUND_SA_LEFT_ATTACK_TOKEN_HORDE = 3629,
WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_DEFENSE_TOKEN = 3630,
WORLD_STATE_BATTLEGROUND_SA_HORDE_DEFENSE_TOKEN = 3631,
WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_HORDE = 3632,
WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_HORDE = 3633,
WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_HORDE = 3634,
WORLD_STATE_BATTLEGROUND_SA_LEFT_GY_ALLIANCE = 3635,
WORLD_STATE_BATTLEGROUND_SA_RIGHT_GY_ALLIANCE = 3636,
WORLD_STATE_BATTLEGROUND_SA_CENTER_GY_ALLIANCE = 3637,
WORLD_STATE_BATTLEGROUND_SA_YELLOW_GATE = 3638, // Gate of Yellow Moon
WORLD_STATE_BATTLEGROUND_SA_ANCIENT_GATE = 3849, // Gate of Temple
WORLD_STATE_BATTLEGROUND_SA_ALLIANCE_ATTACKS = 4352,
WORLD_STATE_BATTLEGROUND_SA_HORDE_ATTACKS = 4353,
// Blade's Edge Arena
WORLD_STATE_BATTLEGROUND_BE_ARENA_GOLD = 2544,
WORLD_STATE_BATTLEGROUND_BE_ARENA_GREEN = 2545,
WORLD_STATE_BATTLEGROUND_BE_ARENA_SHOW = 2547,
// Nagrand Arena
WORLD_STATE_BATTLEGROUND_NA_ARENA_GOLD = 2575,
WORLD_STATE_BATTLEGROUND_NA_ARENA_GREEN = 2576,
WORLD_STATE_BATTLEGROUND_NA_ARENA_SHOW = 2577,
// Ruins of Lordaeron
WORLD_STATE_BATTLEGROUND_RL_ARENA_GOLD = 3000,
WORLD_STATE_BATTLEGROUND_RL_ARENA_GREEN = 3001,
WORLD_STATE_BATTLEGROUND_RL_ARENA_SHOW = 3002,
// Dalaran Sewers
WORLD_STATE_BATTLEGROUND_DS_ARENA_GREEN = 3600,
WORLD_STATE_BATTLEGROUND_DS_ARENA_GOLD = 3601,
WORLD_STATE_BATTLEGROUND_DS_ARENA_SHOW = 3610,
// The Ring of Valor
WORLD_STATE_BATTLEGROUND_RV_ARENA_GREEN = 3600, // Used generically for all arenas
WORLD_STATE_BATTLEGROUND_RV_ARENA_GOLD = 3601, // Used generically for all arenas
WORLD_STATE_BATTLEGROUND_RV_ARENA_SHOW = 3610,
// The Silithyst Must Flow - Silithus Outdoor PvP
WORLD_STATE_OPVP_SI_GATHERED_A = 2313,
WORLD_STATE_OPVP_SI_GATHERED_H = 2314,
WORLD_STATE_OPVP_SI_SILITHYST_MAX = 2317,
// A Game of Towers - Eastern Plaguelands Outdoor PvP
WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_A = 2327,
WORLD_STATE_OPVP_EP_UI_TOWER_COUNT_H = 2328,
WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N = 2352,
WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N = 2353,
WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_H = 2353, // 2367 not present! use neutral!
WORLD_STATE_OPVP_EP_EASTWALLTOWER_A = 2354,
WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N = 2355,
WORLD_STATE_OPVP_EP_EASTWALLTOWER_H = 2356,
WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_A = 2359, // ally conquested
WORLD_STATE_OPVP_EP_EASTWALLTOWER_N_H = 2360,
WORLD_STATE_OPVP_EP_EASTWALLTOWER_N = 2361,
WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_A = 2362,
WORLD_STATE_OPVP_EP_NORTHPASSTOWER_N_H = 2363, // GENERAL_WORLDSTATES_08
WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_N_A = 2366,
WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_A = 2370,
WORLD_STATE_OPVP_EP_PLAGUEWOODTOWER_H = 2371,
WORLD_STATE_OPVP_EP_NORTHPASSTOWER_A = 2372,
WORLD_STATE_OPVP_EP_NORTHPASSTOWER_H = 2373,
WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_A = 2374,
WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_N_H = 2375,
WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_A = 2378,
WORLD_STATE_OPVP_EP_CROWNGUARDTOWER_H = 2379,
WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_DISPLAY = 2426, // GENERAL_WORLDSTATES_01 "Progress: %2427w"
WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_POS = 2427, // GENERAL_WORLDSTATES_02
WORLD_STATE_OPVP_EP_UI_TOWER_SLIDER_N = 2428, // GENERAL_WORLDSTATES_03
WORLD_STATE_OPVP_EP_UNK_0 = 2357, // GENERAL_WORLDSTATES_06
WORLD_STATE_OPVP_EP_UNK_1 = 2358, // GENERAL_WORLDSTATES_07
WORLD_STATE_OPVP_EP_UNK_2 = 2364, // GENERAL_WORLDSTATES_09
WORLD_STATE_OPVP_EP_UNK_3 = 2365, // GENERAL_WORLDSTATES_10
// WORLD_STATE_OPVP_EP_UNK_4 = 2367, // GENERAL_WORLDSTATES_13 grey horde not in dbc! See: PlaguewoodTowerNH
WORLD_STATE_OPVP_EP_UNK_5 = 2368, // GENERAL_WORLDSTATES_11
WORLD_STATE_OPVP_EP_UNK_6 = 2369, // GENERAL_WORLDSTATES_12
WORLD_STATE_OPVP_EP_UNK_7 = 2376, // GENERAL_WORLDSTATES_04
WORLD_STATE_OPVP_EP_UNK_8 = 2377, // GENERAL_WORLDSTATES_05
// Hellfire Peninsula Outdoor PvP
WORLD_STATE_OPVP_HP_STADIUM_H = 2470, // show the horde stadium icon
WORLD_STATE_OPVP_HP_STADIUM_A = 2471, // show the ally stadium icon
WORLD_STATE_OPVP_HP_STADIUM_N = 2472, // show the neutral stadium icon
WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_DISPLAY = 2473, //: ally / horde slider display // show only in direct vicinity!
WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_POS = 2474, //: ally / horde slider percentage, 100 for ally, 0 for horde // show only in direct vicinity!
WORLD_STATE_OPVP_HP_UI_TOWER_SLIDER_N = 2475, //: ally / horde slider grey area // show only in direct vicinity!
WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_A = 2476, // ally pvp objectives captured
WORLD_STATE_OPVP_HP_UI_TOWER_COUNT_H = 2478, // horde pvp objectives captured
WORLD_STATE_OPVP_HP_OVERLOOK_A = 2480, // show ally overlook icon
WORLD_STATE_OPVP_HP_OVERLOOK_H = 2481, // show the overlook arrow
WORLD_STATE_OPVP_HP_OVERLOOK_N = 2482, // show neutral overlook icon
WORLD_STATE_OPVP_HP_BROKENHILL_A = 2483, // show ally broken hill icon
WORLD_STATE_OPVP_HP_BROKENHILL_H = 2484, // show icon above broken hill
WORLD_STATE_OPVP_HP_BROKENHILL_N = 2485, // show neutral broken hill icon
WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_H = 2489, // add horde tower main gui icon // maybe should be sent only on login?
WORLD_STATE_OPVP_HP_UI_TOWER_DISPLAY_A = 2490, // add ally tower main gui icon // maybe should be sent only on login?
// Zangarmarsh Outdoor PvP
WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_W = 2527,
WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_W = 2528,
WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_W = 2529,
WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_DISPLAY_E = 2533,
WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_POS_E = 2534,
WORLD_STATE_OPVP_ZM_UI_TOWER_SLIDER_N_E = 2535,
WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_A = 2555,
WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_H = 2556,
WORLD_STATE_OPVP_ZM_UI_TOWER_WEST_N = 2557,
WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_A = 2558,
WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_H = 2559,
WORLD_STATE_OPVP_ZM_UI_TOWER_EAST_N = 2560,
WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_A = 2644,
WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_H = 2645,
WORLD_STATE_OPVP_ZM_MAP_TOWER_WEST_N = 2646,
WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_N = 2647,
WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_A = 2648,
WORLD_STATE_OPVP_ZM_MAP_GRAVEYARD_H = 2649, // Twin spire graveyard horde
WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_A = 2650,
WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_H = 2651,
WORLD_STATE_OPVP_ZM_MAP_TOWER_EAST_N = 2652,
WORLD_STATE_OPVP_ZM_UNK = 2653,
WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_READY = 2655,
WORLD_STATE_OPVP_ZM_MAP_ALLIANCE_FLAG_NOT_READY = 2656,
WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_NOT_READY = 2657,
WORLD_STATE_OPVP_ZM_MAP_HORDE_FLAG_READY = 2658,
// Terokkar Forest Outdoor PvP
WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_NEUTRAL = 2508,
WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_HOURS = 2509,
WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_SECOND_DIGIT = 2510,
WORLD_STATE_OPVP_TF_UI_LOCKED_TIME_MINUTES_FIRST_DIGIT = 2512,
WORLD_STATE_OPVP_TF_UI_TOWERS_CONTROLLED_DISPLAY = 2620,
WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_A = 2621,
WORLD_STATE_OPVP_TF_UI_TOWER_COUNT_H = 2622,
WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_DISPLAY = 2623,
WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_N = 2624,
WORLD_STATE_OPVP_TF_UI_TOWER_SLIDER_POS = 2625,
WORLD_STATE_OPVP_TF_TOWER_NUM_00 = 2681, // NW Neutral
WORLD_STATE_OPVP_TF_TOWER_NUM_01 = 2682, // NW Horde
WORLD_STATE_OPVP_TF_TOWER_NUM_02 = 2683, // NW Alliance
WORLD_STATE_OPVP_TF_TOWER_NUM_03 = 2684, // N Alliance
WORLD_STATE_OPVP_TF_TOWER_NUM_04 = 2685, // N Horde
WORLD_STATE_OPVP_TF_TOWER_NUM_05 = 2686, // N Neutral
WORLD_STATE_OPVP_TF_TOWER_NUM_15 = 2687, // unk
WORLD_STATE_OPVP_TF_TOWER_NUM_06 = 2688, // NE Alliance
WORLD_STATE_OPVP_TF_TOWER_NUM_07 = 2689, // NE Horde
WORLD_STATE_OPVP_TF_TOWER_NUM_08 = 2690, // NE Neutral
WORLD_STATE_OPVP_TF_TOWER_NUM_09 = 2691, // S Alliance
WORLD_STATE_OPVP_TF_TOWER_NUM_10 = 2692, // S Horde
WORLD_STATE_OPVP_TF_TOWER_NUM_11 = 2693, // S Neutral
WORLD_STATE_OPVP_TF_TOWER_NUM_12 = 2694, // SE Alliance
WORLD_STATE_OPVP_TF_TOWER_NUM_13 = 2695, // SE Horde
WORLD_STATE_OPVP_TF_TOWER_NUM_14 = 2696, // SE Neutral
WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_ALLIANCE = 2767,
WORLD_STATE_OPVP_TF_UI_LOCKED_DISPLAY_HORDE = 2768,
// Halaa, Nagrand Outdoor PvP
WORLD_STATE_OPVP_NA_UI_GUARDS_LEFT = 2491,
WORLD_STATE_OPVP_NA_UI_GUARDS_MAX = 2493,
WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_POS = 2494,
WORLD_STATE_OPVP_NA_UI_TOWER_SLIDER_DISPLAY = 2495, // OUTLAND_01 "Progress: %2494w"
WORLD_STATE_OPVP_NA_UI_SLIDER_N = 2497,
WORLD_STATE_OPVP_NA_UI_ALLIANCE_GUARDS_SHOW = 2502,
WORLD_STATE_OPVP_NA_UI_HORDE_GUARDS_SHOW = 2503,
WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_A = 2659,
WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_H = 2660,
WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_A = 2661,
WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_A = 2662,
WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_H = 2663,
WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_A = 2664,
WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_H = 2665,
WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_A = 2666,
WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_A = 2667,
WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_H = 2668,
WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_A = 2669,
WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_A = 2670,
WORLD_STATE_OPVP_NA_MAP_HALAA_NEUTRAL = 2671,
WORLD_STATE_OPVP_NA_MAP_HALAA_HORDE = 2672,
WORLD_STATE_OPVP_NA_MAP_HALAA_ALLIANCE = 2673,
WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_A = 2676,
WORLD_STATE_OPVP_NA_MAP_HALAA_NEU_H = 2677,
WORLD_STATE_OPVP_NA_MAP_WYVERN_SOUTH_NEU_H = 2760,
WORLD_STATE_OPVP_NA_MAP_WYVERN_WEST_NEU_H = 2761,
WORLD_STATE_OPVP_NA_MAP_WYVERN_NORTH_NEU_H = 2762,
WORLD_STATE_OPVP_NA_MAP_WYVERN_EAST_NEU_H = 2763,
// Grizzly Hills Outdoor PvP
WORLD_STATE_OPVP_GH_UI_SLIDER_DISPLAY = 3466,
WORLD_STATE_OPVP_GH_UI_SLIDER_POS = 3467,
WORLD_STATE_OPVP_GH_UI_SLIDER_N = 3468,
// Ahn'Qiraj
WORLD_STATE_AHNQIRAJ_SANDWORM_N = 2322,
WORLD_STATE_AHNQIRAJ_SANDWORM_S = 2323,
WORLD_STATE_AHNQIRAJ_SANDWORM_SW = 2324,
WORLD_STATE_AHNQIRAJ_SANDWORM_E = 2325,
// The Battle for Light's Hope Chapel - Scarlet Enclave
WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT = 3590,
WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT = 3591,
WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE = 3592,
WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE = 3603,
WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME = 3604,
WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE = 3605,
// The Battle for the Undercity
WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_COUNTDOWN_A = 3958,
WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_FIGHT_A = 3962,
WORLD_STATE_BATTLE_FOR_UNDERCITY_FAIL_A = 3963,
WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_DONE_A = 3964,
WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A = 3966,
WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_A = 3971,
WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_A = 3972,
WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H = 3875,
WORLD_STATE_BATTLE_FOR_UNDERCITY_COUNTDOWN_H = 3876,
WORLD_STATE_BATTLE_FOR_UNDERCITY_FAIL_H = 3878,
WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H = 3885,
WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_DONE_H = 3886,
WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_FIGHT_H = 3887,
WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_DONE_H = 3888,
WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H = 3889,
WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_DONE_H = 3890,
WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_H = 3891, // unused
WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_H = 3892, // unused
// The Ruby Sanctum
WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_MATERIAL = 5049,
WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TWILIGHT = 5050,
WORLD_STATE_RUBY_SANCTUM_CORPOREALITY_TOGGLE = 5051,
// Icecrown Citadel
WORLD_STATE_ICECROWN_CITADEL_SHOW_TIMER = 4903, // Blood Quickening weekly
WORLD_STATE_ICECROWN_CITADEL_EXECUTION_TIME = 4904,
WORLD_STATE_ICECROWN_CITADEL_SHOW_ATTEMPTS = 4940,
WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_REMAINING = 4941,
WORLD_STATE_ICECROWN_CITADEL_ATTEMPTS_MAX = 4942,
// The Culling of Stratholme
WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES = 3479,
WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED = 3480,
WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT = 3504,
WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN = 3931,
WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW = 3932,
// The Oculus
WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_AMOUNT = 3486,
WORLD_STATE_OCULUS_CENTRIFUGE_CONSTRUCT_SHOW = 3524,
// Ulduar
WORLD_STATE_ULDUAR_ALGALON_DESPAWN_TIMER = 4131,
WORLD_STATE_ULDUAR_ALGALON_TIMER_ENABLED = 4132,
// The Violet Hold
WORLD_STATE_VIOLET_HOLD_WAVE_COUNT = 3810,
WORLD_STATE_VIOLET_HOLD_PRISON_STATE = 3815,
WORLD_STATE_VIOLET_HOLD_SHOW = 3816,
// Halls of Reflection
WORLD_STATE_HALLS_OF_REFLECTION_WAVE_COUNT = 4882,
WORLD_STATE_HALLS_OF_REFLECTION_WAVES_ENABLED = 4884,
// Zul'Aman
WORLD_STATE_ZUL_AMAN_SHOW_TIMER = 3104,
WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE = 3106,
// The Black Morass
WORLD_STATE_BLACK_MORASS_SHIELD = 2540,
WORLD_STATE_BLACK_MORASS = 2541,
WORLD_STATE_BLACK_MORASS_RIFT = 2784,
// Battle for Mount Hyjal
WORLD_STATE_HYJAL_ENEMY = 2453,
WORLD_STATE_HYJAL_ENEMY_COUNT = 2454,
WORLD_STATE_HYJAL_WAVES = 2842,
// Escape From Durnholde Keep
WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED = 2436,
// Trial of the Crusader
WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_COUNT = 4389,
WORLD_STATE_TRIAL_OF_THE_CRUSADER_UI_SHOW = 4390,
// Unknown
WORLD_STATE_GENERIC_UNK_0 = 2322,
WORLD_STATE_GENERIC_UNK_1 = 2323,
WORLD_STATE_GENERIC_UNK_2 = 2324,
WORLD_STATE_GENERIC_UNK_3 = 2325,
// Stranglethorn Fishing Extravaganza (Are these custom IDs?)
WORLD_STATE_STRANGLETHORN_VALE_FISHING_PREV_WIN_TIME = 197,
WORLD_STATE_STRANGLETHORN_VALE_FISHING_HAS_WINNER = 198,
WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_EVENT_BEGIN = 199,
WORLD_STATE_STRANGLETHORN_VALE_FISHING_ANNOUNCE_POOLS_DESPAWN = 200,
// Custom
WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME = 20001, // Next arena distribution time
WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time
WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time
WORLD_STATE_CUSTOM_CLEANING_FLAGS = 20004, // Cleaning Flags
WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME = 20005, // Next daily reset time
WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time
WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time
WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME = 20008, // Next daily calendar deletions of old events time
};
#endif
@@ -21,6 +21,7 @@
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "WorldStateDefines.h"
enum LightOfDawnSays
{
@@ -198,13 +199,6 @@ enum LightOfDawnEncounter
ENCOUNTER_TOTAL_DEFENDERS = 300,
ENCOUNTER_TOTAL_SCOURGE = 10000,
WORLD_STATE_DEFENDERS_COUNT = 3590,
WORLD_STATE_SCOURGE_COUNT = 3591,
WORLD_STATE_SOLDIERS_ENABLE = 3592,
WORLD_STATE_COUNTDOWN_ENABLE = 3603,
WORLD_STATE_COUNTDOWN_TIME = 3604,
WORLD_STATE_EVENT_BEGIN_ENABLE = 3605,
ENCOUNTER_STATE_NONE = 0,
ENCOUNTER_STATE_FIGHT = 1,
ENCOUNTER_STATE_OUTRO = 2,
@@ -343,7 +337,7 @@ public:
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE && !creature->AI()->GetData(WORLD_STATE_SOLDIERS_ENABLE))
if (player->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE && !creature->AI()->GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE))
AddGossipItemFor(player, 9795, 0, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
@@ -414,17 +408,17 @@ public:
{
switch (type)
{
case WORLD_STATE_DEFENDERS_COUNT:
case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT:
return defendersRemaining;
case WORLD_STATE_SCOURGE_COUNT:
case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT:
return scourgeRemaining;
case WORLD_STATE_SOLDIERS_ENABLE:
case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE:
return me->IsAlive() && (startTimeRemaining || battleStarted);
case WORLD_STATE_COUNTDOWN_ENABLE:
case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE:
return me->IsAlive() && startTimeRemaining;
case WORLD_STATE_COUNTDOWN_TIME:
case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME:
return startTimeRemaining;
case WORLD_STATE_EVENT_BEGIN_ENABLE:
case WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE:
return me->IsAlive() && !startTimeRemaining && battleStarted;
}
return 0;
@@ -442,12 +436,12 @@ public:
void SendInitialWorldStates()
{
SendUpdateWorldState(WORLD_STATE_DEFENDERS_COUNT, GetData(WORLD_STATE_DEFENDERS_COUNT));
SendUpdateWorldState(WORLD_STATE_SCOURGE_COUNT, GetData(WORLD_STATE_SCOURGE_COUNT));
SendUpdateWorldState(WORLD_STATE_SOLDIERS_ENABLE, GetData(WORLD_STATE_SOLDIERS_ENABLE));
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_ENABLE, GetData(WORLD_STATE_COUNTDOWN_ENABLE));
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, GetData(WORLD_STATE_COUNTDOWN_TIME));
SendUpdateWorldState(WORLD_STATE_EVENT_BEGIN_ENABLE, GetData(WORLD_STATE_EVENT_BEGIN_ENABLE));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SOLDIERS_ENABLE));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE));
}
void JustSummoned(Creature* cr) override
@@ -482,12 +476,12 @@ public:
if (creature->GetEntry() >= NPC_RAMPAGING_ABOMINATION)
{
--scourgeRemaining;
SendUpdateWorldState(WORLD_STATE_SCOURGE_COUNT, GetData(WORLD_STATE_SCOURGE_COUNT));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_SCOURGE_COUNT));
}
else
{
--defendersRemaining;
SendUpdateWorldState(WORLD_STATE_DEFENDERS_COUNT, GetData(WORLD_STATE_DEFENDERS_COUNT));
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT, GetData(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_DEFENDERS_COUNT));
if (defendersRemaining == 200)
FinishFight();
@@ -610,25 +604,25 @@ public:
switch (eventId)
{
case EVENT_START_COUNTDOWN_1:
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 4);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 4);
break;
case EVENT_START_COUNTDOWN_2:
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 3);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 3);
break;
case EVENT_START_COUNTDOWN_3:
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 2);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 2);
break;
case EVENT_START_COUNTDOWN_4:
Talk(SAY_LIGHT_OF_DAWN02);
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 1);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 1);
break;
case EVENT_START_COUNTDOWN_5:
battleStarted = ENCOUNTER_STATE_FIGHT;
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
Talk(SAY_LIGHT_OF_DAWN04); // Wrong order in DB!
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_TIME, 0);
SendUpdateWorldState(WORLD_STATE_COUNTDOWN_ENABLE, 0);
SendUpdateWorldState(WORLD_STATE_EVENT_BEGIN_ENABLE, 1);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_TIME, 0);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_COUNTDOWN_ENABLE, 0);
SendUpdateWorldState(WORLD_STATE_BATTLE_FOR_LIGHTS_HOPE_EVENT_BEGIN_ENABLE, 1);
break;
case EVENT_START_COUNTDOWN_6:
case EVENT_START_COUNTDOWN_7:
@@ -85,6 +85,8 @@ struct boss_brutallus : public BossAI
Talk(YELL_AGGRO);
BossAI::JustEngagedWith(who);
ScheduleEnrageTimer(SPELL_BERSERK, 6min, YELL_BERSERK);
ScheduleTimedEvent(11s, [&] {
DoCastVictim(SPELL_METEOR_SLASH);
}, 12s);
@@ -98,11 +100,6 @@ struct boss_brutallus : public BossAI
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, true, -SPELL_BURN_DAMAGE))
DoCast(target, SPELL_BURN);
}, 20s);
me->m_Events.AddEventAtOffset([&] {
DoCastSelf(SPELL_BERSERK, true);
Talk(YELL_BERSERK);
}, 6min);
}
void KilledUnit(Unit* victim) override
@@ -119,7 +119,7 @@ struct boss_sacrolash : public BossAI
scheduler.CancelGroup(GROUP_SPECIAL_ABILITY);
ScheduleTimedEvent(20s, [&] {
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false);
if (!target)
target = me->GetVictim();
@@ -153,7 +153,14 @@ struct boss_sacrolash : public BossAI
}, 8s, 12s);
scheduler.Schedule(36s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) {
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
Unit* target = nullptr;
if (Creature* alythess = instance->GetCreature(DATA_ALYTHESS))
{
std::list<Unit*> targets;
alythess->AI()->SelectTargetList(targets, 6, SelectTargetMethod::MaxThreat, 0, 100.0f, true, false);
if (!targets.empty())
target = Acore::Containers::SelectRandomContainerElement(targets);
}
if (!target)
target = me->GetVictim();
Talk(EMOTE_SHADOW_NOVA, target);
@@ -240,11 +247,11 @@ struct boss_alythess : public BossAI
});
ScheduleTimedEvent(8s, 10s, [&] {
me->CastCustomSpell(SPELL_FLAME_SEAR, SPELLVALUE_MAX_TARGETS, urand(4, 5), me, TRIGGERED_NONE);
DoCast(SPELL_FLAME_SEAR);
}, 8s, 10s);
ScheduleTimedEvent(20s, 26s, [&] {
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true, false);
if (!target)
target = me->GetVictim();
DoCast(target, SPELL_SHADOW_NOVA);
@@ -276,11 +283,18 @@ struct boss_alythess : public BossAI
// FLAME_SEAR Phase 1
ScheduleTimedEvent(10s, 15s, [&] {
me->CastCustomSpell(SPELL_FLAME_SEAR, SPELLVALUE_MAX_TARGETS, urand(4, 5), me, TRIGGERED_NONE);
DoCast(SPELL_FLAME_SEAR);
}, 10s, 15s);
scheduler.Schedule(20s, GROUP_SPECIAL_ABILITY, [this](TaskContext context) {
Unit* target = SelectTarget(SelectTargetMethod::MaxThreat, 1, 100.0f);
Unit* target = nullptr;
if (Creature* sacrolash = instance->GetCreature(DATA_SACROLASH))
{
std::list<Unit*> targets;
sacrolash->AI()->SelectTargetList(targets, 6, SelectTargetMethod::MaxThreat, 0, 100.0f, true, false);
if (!targets.empty())
target = Acore::Containers::SelectRandomContainerElement(targets);
}
if (!target)
target = me->GetVictim();
Talk(EMOTE_CONFLAGRATION, target);
@@ -381,6 +395,22 @@ class spell_eredar_twins_handle_touch : public SpellScript
}
};
class spell_eredar_twins_flame_sear : public SpellScript
{
PrepareSpellScript(spell_eredar_twins_flame_sear);
void FilterTargets(std::list<WorldObject*>& targets)
{
Acore::Containers::RandomResize(targets,5);
targets.remove(GetCaster()->GetVictim());
}
void Register() override
{
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eredar_twins_flame_sear::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
}
};
class spell_eredar_twins_blaze : public SpellScript
{
PrepareSpellScript(spell_eredar_twins_blaze);
@@ -466,6 +496,7 @@ void AddSC_boss_eredar_twins()
RegisterSpellScriptWithArgs(spell_eredar_twins_apply_touch, "spell_eredar_twins_apply_flame_touched", SPELL_FLAME_TOUCHED);
RegisterSpellScript(spell_eredar_twins_handle_touch);
RegisterSpellScript(spell_eredar_twins_blaze);
RegisterSpellScript(spell_eredar_twins_flame_sear);
RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_dark_touched_periodic", SPELL_DARK_TOUCHED, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_flame_touched_periodic", SPELL_FLAME_TOUCHED, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_flame_touched_flame_sear", SPELL_FLAME_TOUCHED, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
@@ -108,8 +108,8 @@ const Position RightSideLanes[3] =
const Position RightSide = { 1458.5555f, 502.1995f, 59.899513f, 1.605702f };
const Position LeftSide = { 1469.0642f, 729.5854f, 59.823853f, 4.6774f };
const Position LandingRightPos = { 1476.77f, 665.094f, 20.6423f };
const Position LandingLeftPos = { 1469.93f, 557.009f, 22.631699f };
const Position LandingLeftPos = { 1476.77f, 665.094f, 20.6423f };
const Position LandingRightPos = { 1469.93f, 557.009f, 22.631699f };
class CorruptTriggers : public BasicEvent
{
@@ -79,6 +79,10 @@ enum Spells
SPELL_SINISTER_REFLECTION_SUMMON = 45891,
SPELL_SINISTER_REFLECTION_CLASS = 45893,
SPELL_SINISTER_REFLECTION_CLONE = 45785,
// TODO
// These should be applied to target of SPELL_SINISTER_REFLECTION but not implemented
//SPELL_SINISTER_COPY_WEAPON = 41054,
//SPELL_SINISTER_COPY_OFFHAND_WEAPON = 45205,
// Misc
SPELL_ANVEENA_ENERGY_DRAIN = 46410,
@@ -270,9 +274,6 @@ struct boss_kiljaeden : public BossAI
me->m_Events.AddEventAtOffset([&] {
Talk(SAY_KJ_REFLECTION);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
}, 1s);
scheduler.Schedule(1s+200ms, [this](TaskContext)
@@ -313,9 +314,6 @@ struct boss_kiljaeden : public BossAI
me->m_Events.AddEventAtOffset([&] {
Talk(SAY_KJ_REFLECTION);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
}, 1s);
scheduler.Schedule(1s + 200ms, [this](TaskContext)
@@ -345,9 +343,6 @@ struct boss_kiljaeden : public BossAI
me->m_Events.AddEventAtOffset([&] {
Talk(SAY_KJ_REFLECTION);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
me->CastCustomSpell(SPELL_SINISTER_REFLECTION, SPELLVALUE_MAX_TARGETS, 1, me, TRIGGERED_NONE);
}, 1s);
me->m_Events.AddEventAtOffset([&] {
@@ -530,6 +525,7 @@ struct boss_kiljaeden : public BossAI
void JustSummoned(Creature* summon) override
{
BossAI::JustSummoned(summon);
if (summon->GetEntry() == NPC_ARMAGEDDON_TARGET)
{
summon->SetCanFly(true);
@@ -960,8 +956,14 @@ class spell_kiljaeden_sinister_reflection : public SpellScript
PreventHitDefaultEffect(effIndex);
if (Unit* target = GetHitUnit())
{
target->CastSpell(target, SPELL_SINISTER_REFLECTION_SUMMON, true);
//target->CastSpell(target, SPELL_SINISTER_REFLECTION_CLONE, true);
for (uint8 i = 0; i < 4; ++i)
{
target->CastSpell(target, SPELL_SINISTER_REFLECTION_SUMMON, true);
}
// TODO implement these auras
//target->AddAura(SPELL_SINISTER_COPY_WEAPON, target);
//target->AddAura(SPELL_SINISTER_COPY_OFFHAND_WEAPON, target);
target->CastSpell(target, SPELL_SINISTER_REFLECTION_CLONE, true);
}
}
@@ -23,6 +23,8 @@
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "sunwell_plateau.h"
#include "VMapFactory.h"
#include "VMapMgr2.h"
enum Spells
{
@@ -43,7 +45,7 @@ enum Spells
SPELL_ENTROPIUS_COSMETIC_SPAWN = 46223,
SPELL_NEGATIVE_ENERGY_PERIODIC = 46284,
SPELL_BLACK_HOLE = 46282,
SPELL_DARKNESS = 46268,
SPELL_DARKNESS = 46269,
SPELL_SUMMON_DARK_FIEND_ENTROPIUS = 46263,
//Black Hole Spells
@@ -166,13 +168,13 @@ struct boss_entropius : public ScriptedAI
void JustEngagedWith(Unit* /*who*/) override
{
ScheduleTimedEvent(10s, [&] {
ScheduleTimedEvent(8s, 29s, [this]() {
DoCastRandomTarget(SPELL_DARKNESS, 0, 50.0f, true, true);
}, 15s);
}, 8s, 29s);
ScheduleTimedEvent(15s, [&] {
DoCastRandomTarget(SPELL_BLACK_HOLE, 0, 50.0f, true, true);
}, 15s);
ScheduleTimedEvent(14s, 29s, [this]() {
DoCastRandomTarget(SPELL_BLACK_HOLE, 0, 50.0f, false, true);
}, 14s, 29s);
}
void JustDied(Unit* /*killer*/) override
@@ -207,7 +209,54 @@ struct npc_dark_fiend : public ScriptedAI
me->m_Events.AddEventAtOffset([this]() {
me->SetReactState(REACT_AGGRESSIVE);
if (Unit* target = SelectTargetFromPlayerList(200.0f, 0, true))
Unit* target = nullptr;
if (InstanceScript* instance = me->GetInstanceScript())
{
if (Creature* muru = instance->GetCreature(DATA_MURU))
{
if (muru->IsAlive() && !muru->HasUnitFlag(UNIT_FLAG_NOT_SELECTABLE))
{
std::list<HostileReference*> const& threatList = muru->GetThreatMgr().GetThreatList();
std::vector<Unit*> validTargets;
for (HostileReference* ref : threatList)
{
if (Unit* unit = ObjectAccessor::GetUnit(*muru, ref->getUnitGuid()))
{
if (unit->IsPlayer() && unit->IsAlive() && unit->IsWithinDist(me, 50.0f))
validTargets.push_back(unit);
}
}
if (!validTargets.empty())
target = validTargets[urand(0, validTargets.size() - 1)];
}
else
{
if (Creature* entropius = me->FindNearestCreature(NPC_ENTROPIUS, 100.0f))
{
std::list<HostileReference*> const& threatList = entropius->GetThreatMgr().GetThreatList();
std::vector<Unit*> validTargets;
for (HostileReference* ref : threatList)
{
if (Unit* unit = ObjectAccessor::GetUnit(*entropius, ref->getUnitGuid()))
{
if (unit->IsPlayer() && unit->IsAlive() && unit->IsWithinDist(me, 50.0f))
{
validTargets.push_back(unit);
}
}
}
if (!validTargets.empty())
target = validTargets[urand(0, validTargets.size() - 1)];
}
}
}
}
if (target)
{
AttackStart(target);
me->AddThreat(target, 100000.0f);
@@ -253,8 +302,6 @@ struct npc_dark_fiend : public ScriptedAI
me->DespawnOrUnsummon();
}, 1s);
}
DoMeleeAttackIfReady();
}
private:
@@ -327,7 +374,7 @@ struct npc_singularity : public NullCreatureAI
else
{
// No valid target found, check again soon
context.Repeat(1s);
context.Repeat();
}
});
}
@@ -421,6 +468,28 @@ class spell_entropius_void_zone_visual_aura : public AuraScript
class spell_entropius_black_hole_effect : public SpellScript
{
PrepareSpellScript(spell_entropius_black_hole_effect);
float RaycastToObstacle(Unit* unit, float angle, float z, float maxDist = 20.0f)
{
float baseX = unit->GetPositionX();
float baseY = unit->GetPositionY();
float targetX = baseX + maxDist * cos(angle);
float targetY = baseY + maxDist * sin(angle);
float hitX, hitY, hitZ;
if (VMAP::VMapFactory::createOrGetVMapMgr()->GetObjectHitPos(
unit->GetMapId(),
baseX, baseY, z,
targetX, targetY, z,
hitX, hitY, hitZ,
0.0f))
{
return std::sqrt(
std::pow(hitX - baseX, 2) +
std::pow(hitY - baseY, 2) +
std::pow(hitZ - z, 2)
);
}
return maxDist;
}
void HandlePull(SpellEffIndex effIndex)
{
@@ -428,21 +497,25 @@ class spell_entropius_black_hole_effect : public SpellScript
Unit* target = GetHitUnit();
if (!target)
return;
Position pos;
if (target->GetDistance(GetCaster()) < 5.0f)
{
float o = frand(0, 2 * M_PI);
pos.Relocate(GetCaster()->GetPositionX() + 8.0f * cos(o),
GetCaster()->GetPositionY() + 8.0f * std::sin(o),
GetCaster()->GetPositionZ() + frand(2.0f, 5.0f));
float z = GetCaster()->GetPositionZ() + frand(1.0f, 2.0f);
float safeDistance = RaycastToObstacle(GetCaster(), o, z, 10.0f);
float actualDistance = std::min(8.0f, safeDistance * 0.8f);
pos.Relocate(
GetCaster()->GetPositionX() + actualDistance * cos(o),
GetCaster()->GetPositionY() + actualDistance * sin(o),
z
);
}
else
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
float speedXY = float(GetSpellInfo()->Effects[effIndex].MiscValue) * 0.1f;
float speedZ = target->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
target->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
}
@@ -19,13 +19,12 @@
#include "InstanceScript.h"
#include "Player.h"
#include "TemporarySummon.h"
#include "WorldStateDefines.h"
#include "zulaman.h"
enum Misc
{
RAND_VENDOR = 2,
WORLDSTATE_SHOW_TIMER = 3104,
WORLDSTATE_TIME_TO_SACRIFICE = 3106
RAND_VENDOR = 2,
};
// Chests spawn at bear/eagle/dragonhawk/lynx bosses
@@ -175,8 +174,8 @@ public:
{
if (uint32 timer = GetPersistentData(DATA_TIMED_RUN))
{
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1);
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 1);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer);
}
scheduler.Schedule(1min, GROUP_TIMED_RUN, [this](TaskContext context)
@@ -184,13 +183,13 @@ public:
if (uint32 timer = GetPersistentData(DATA_TIMED_RUN))
{
--timer;
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 1);
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 1);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer);
StorePersistentData(DATA_TIMED_RUN, timer);
context.Repeat();
}
else
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 0);
});
}
}
@@ -303,7 +302,7 @@ public:
if (uint32 timer = GetPersistentData(DATA_TIMED_RUN))
{
StorePersistentData(DATA_TIMED_RUN, timer += 15);
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer);
}
SummonHostage(type);
break;
@@ -311,7 +310,7 @@ public:
if (uint32 timer = GetPersistentData(DATA_TIMED_RUN))
{
StorePersistentData(DATA_TIMED_RUN, timer += 10);
DoUpdateWorldState(WORLDSTATE_TIME_TO_SACRIFICE, timer);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_TIME_TO_SACRIFICE, timer);
}
SummonHostage(type);
break;
@@ -328,7 +327,7 @@ public:
if (GetPersistentData(DATA_TIMED_RUN) && AllBossesDone({ DATA_NALORAKK, DATA_AKILZON, DATA_JANALAI, DATA_HALAZZI }))
{
StorePersistentData(DATA_TIMED_RUN, 0);
DoUpdateWorldState(WORLDSTATE_SHOW_TIMER, 0);
DoUpdateWorldState(WORLD_STATE_ZUL_AMAN_SHOW_TIMER, 0);
}
CheckInstanceStatus();
@@ -37,6 +37,7 @@ EndContentData */
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "WorldStateDefines.h"
/*######
## npc_lady_sylvanas_windrunner
@@ -723,31 +724,6 @@ enum QuestMisc
ZONE_UNDERCITY = 1497
};
enum Worldstates
{
// Alliance
WORLD_STATE_MANHUNT_COUNTDOWN_A = 3958,
WORLD_STATE_MANHUNT_STARTS_A = 3966,
WORLD_STATE_SEWERS_FIGHT_A = 3962,
WORLD_STATE_SEWERS_DONE_A = 3964,
WORLD_STATE_APOTHECARIUM_FIGHT_A = 3972,
WORLD_STATE_APOTHECARIUM_DONE_A = 3971,
WORLD_STATE_FAIL_A = 3963,
// Horde
WORLD_STATE_BATTLE_COUNTDOWN_H = 3876,
WORLD_STATE_BATTLE_START_H = 3875,
WORLD_STATE_COURTYARD_FIGHT_H = 3885,
WORLD_STATE_COURTYARD_DONE_H = 3886,
WORLD_STATE_INNER_SANKTUM_FIGHT_H = 3887,
WORLD_STATE_INNER_SANKTUM_DONE_H = 3888,
WORLD_STATE_APOTHECARIUM_FIGHT_H = 3891, // unused
WORLD_STATE_APOTHECARIUM_DONE_H = 3892, // unused
WORLD_STATE_ROYAL_QUARTER_FIGHT_H = 3889,
WORLD_STATE_ROYAL_QUARTER_DONE_H = 3890,
WORLD_STATE_FAIL_H = 3878
};
struct LocationXYZO {
float x, y, z, o;
};
@@ -1131,13 +1107,13 @@ public:
switch (summon->GetEntry())
{
case NPC_BLIGHTWORM:
UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_FIGHT_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_DONE_A, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_FIGHT_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_DONE_A, 1);
bStepping = true;
break;
case NPC_PUTRESS:
UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_FIGHT_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_DONE_A, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_A, 1);
bStepping = true;
break;
default:
@@ -1536,7 +1512,7 @@ public:
//Preparation
case 0:
me->setActive(true);
UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_COUNTDOWN_A, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_COUNTDOWN_A, 1);
Talk(WRYNN_SAY_PREP_1);
JumpToNextStep(10 * IN_MILLISECONDS);
break;
@@ -1553,8 +1529,8 @@ public:
JumpToNextStep(20 * IN_MILLISECONDS);
break;
case 4:
UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_COUNTDOWN_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_STARTS_A, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_COUNTDOWN_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A, 1);
Talk(WRYNN_SAY_PREP_5);
JumpToNextStep(10 * IN_MILLISECONDS);
break;
@@ -1600,8 +1576,8 @@ public:
break;
case 12:
SetEscortPaused(false);
UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_STARTS_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_FIGHT_A, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_FIGHT_A, 1);
JumpToNextStep(1 * IN_MILLISECONDS);
break;
case 13:
@@ -1692,7 +1668,7 @@ public:
JumpToNextStep(1.5 * IN_MILLISECONDS);
break;
case 30:
UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_FIGHT_A, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_FIGHT_A, 1);
if (Creature* putress = ObjectAccessor::GetCreature(*me, putressGUID))
putress->AI()->Talk(PUTRESS_SAY_1);
if (Player* player = GetPlayerForEscort())
@@ -2018,9 +1994,9 @@ public:
}
}
}
UpdateWorldState(me->GetMap(), WORLD_STATE_MANHUNT_STARTS_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_SEWERS_DONE_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_APOTHECARIUM_DONE_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_MANHUNT_STARTS_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_SEWERS_DONE_A, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_APOTHECARIUM_DONE_A, 0);
me->DespawnOrUnsummon();
break;
}
@@ -2471,14 +2447,14 @@ public:
switch (summon->GetEntry())
{
case NPC_BLIGHT_ABBERATION:
UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_DONE_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_DONE_H, 1);
bStepping = true;
break;
case NPC_KHANOK:
{
UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_DONE_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_DONE_H, 1);
FollowThrall();
SetEscortPaused(false);
std::list<Creature*> SanktumList;
@@ -2497,8 +2473,8 @@ public:
}
case NPC_VARIMATHRAS:
{
UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_DONE_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_DONE_H, 1);
std::list<Creature*> ThroneList;
me->GetCreatureListWithEntryInGrid(ThroneList, NPC_LEGION_OVERLORD, 1000.0f);
me->GetCreatureListWithEntryInGrid(ThroneList, NPC_LEGION_INVADER, 1000.0f);
@@ -2874,7 +2850,7 @@ public:
break;
case 36:
Talk(THRALL_SAY_SANCTUM_1);
UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_FIGHT_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 1);
break;
case 46:
SetHoldState(true);
@@ -2951,7 +2927,7 @@ public:
JumpToNextStep(3 * IN_MILLISECONDS);
break;
case 1:
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_COUNTDOWN_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COUNTDOWN_H, 1);
Talk(THRALL_SAY_PREP_1);
JumpToNextStep(6 * IN_MILLISECONDS);
break;
@@ -2995,8 +2971,8 @@ public:
break;
// Start Event
case 11:
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_COUNTDOWN_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_START_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COUNTDOWN_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 1);
Talk(THRALL_SAY_PREP_8);
SetEscortPaused(false);
bStepping = false;
@@ -3108,8 +3084,8 @@ public:
bStepping = false;
SetRun(true);
Talk(THRALL_SAY_COURTYARD_4);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_START_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_FIGHT_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_START_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 1);
JumpToNextStep(0);
break;
case 28:
@@ -3548,7 +3524,7 @@ public:
}
case 116:
Talk(THRALL_SAY_SANCTUM_7);
UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_FIGHT_H, 1);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 1);
FollowThrall();
SetEscortPaused(false);
bStepping = false;
@@ -3885,9 +3861,9 @@ public:
me->SetNpcFlag(UNIT_NPC_FLAG_GOSSIP);
me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
Talk(THRALL_SAY_THRONE_11);
UpdateWorldState(me->GetMap(), WORLD_STATE_ROYAL_QUARTER_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_INNER_SANKTUM_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_COURTYARD_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_ROYAL_QUARTER_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_INNER_SANCTUM_FIGHT_H, 0);
UpdateWorldState(me->GetMap(), WORLD_STATE_BATTLE_FOR_UNDERCITY_COURTYARD_FIGHT_H, 0);
std::list<Creature*> HelperList;
me->GetCreatureListWithEntryInGrid(HelperList, NPC_SYLVANAS, 100.0f);
me->GetCreatureListWithEntryInGrid(HelperList, NPC_OVERLORD_SAURFANG, 100.0f);
@@ -24,6 +24,7 @@ void AddSC_event_love_in_the_air();
void AddSC_event_midsummer_scripts();
void AddSC_event_childrens_week();
void AddSC_event_firework_show_scripts();
void AddSC_event_noblegarden_scripts();
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
@@ -37,4 +38,5 @@ void AddEventsScripts()
AddSC_event_midsummer_scripts();
AddSC_event_childrens_week();
AddSC_event_firework_show_scripts();
AddSC_event_noblegarden_scripts();
}
+61
View File
@@ -0,0 +1,61 @@
/*
* This file is part of the AzerothCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by the
* Free Software Foundation; either version 3 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Player.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
enum eNoblegarden
{
SPELL_NOBLEGARDEN_BUNNY = 61734
};
// 61712 Summon Noblegarden Bunny Controller
class spell_summon_noblegarden_bunny_controller : public SpellScript
{
PrepareSpellScript(spell_summon_noblegarden_bunny_controller);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_NOBLEGARDEN_BUNNY });
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (Player* player = GetHitPlayer())
player->CastSpell(player, SPELL_NOBLEGARDEN_BUNNY, true);
}
SpellCastResult CheckCast()
{
if (roll_chance_i(5))
return SPELL_CAST_OK;
return SPELL_FAILED_UNKNOWN;
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_summon_noblegarden_bunny_controller::HandleDummy, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
OnCheckCast += SpellCheckCastFn(spell_summon_noblegarden_bunny_controller::CheckCast);
}
};
void AddSC_event_noblegarden_scripts()
{
RegisterSpellScript(spell_summon_noblegarden_bunny_controller);
}
@@ -51,13 +51,6 @@ enum DataTypes
DATA_BOSS_WAVE = 27
};
enum HyjalWorldStateIds
{
WORLD_STATE_WAVES = 2842,
WORLD_STATE_ENEMY = 2453,
WORLD_STATE_ENEMYCOUNT = 2454
};
enum HyjalCreaturesIds
{
// Trash Mobs summoned in waves
@@ -19,6 +19,7 @@
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Player.h"
#include "WorldStateDefines.h"
#include "hyjal.h"
/* Battle of Mount Hyjal encounters:
@@ -193,7 +194,7 @@ public:
{
if (_currentWave == 0 && _initialWaves)
creature->SetReputationRewardDisabled(true);
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, ++_trash); // Update the instance wave count on new trash spawn
DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY_COUNT, ++_trash); // Update the instance wave count on new trash spawn
_encounterNPCs.insert(creature->GetGUID()); // Used for despawning on wipe
}
break;
@@ -231,7 +232,7 @@ public:
{
if (_bossWave != TO_BE_DECIDED)
{
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, --_trash); // Update the instance wave count on new trash death
DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY_COUNT, --_trash); // Update the instance wave count on new trash death
_encounterNPCs.erase(creature->GetGUID()); // Used for despawning on wipe
if (_trash == 0) // It can reach negatives if trash spawned after a retreat are killed, it shouldn't affect anything. Also happens on retail
@@ -406,7 +407,7 @@ public:
if (_bossWave != TO_BE_DECIDED)
{
DoUpdateWorldState(WORLD_STATE_WAVES, 0);
DoUpdateWorldState(WORLD_STATE_HYJAL_WAVES, 0);
scheduler.Schedule(30s, [this](TaskContext context)
{
if (IsEncounterInProgress())
@@ -491,9 +492,9 @@ public:
_trash = 0;
_bossWave = TO_BE_DECIDED;
_retreat = 0;
DoUpdateWorldState(WORLD_STATE_WAVES, _currentWave);
DoUpdateWorldState(WORLD_STATE_ENEMY, _trash);
DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, _trash);
DoUpdateWorldState(WORLD_STATE_HYJAL_WAVES, _currentWave);
DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY, _trash);
DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY_COUNT, _trash);
break;
}
@@ -548,8 +549,8 @@ public:
context.Repeat(timerptr[_currentWave]);
if (++_currentWave < maxWaves && _bossWave != TO_BE_DECIDED)
{
DoUpdateWorldState(WORLD_STATE_WAVES, _currentWave);
DoUpdateWorldState(WORLD_STATE_ENEMY, 1);
DoUpdateWorldState(WORLD_STATE_HYJAL_WAVES, _currentWave);
DoUpdateWorldState(WORLD_STATE_HYJAL_ENEMY, 1);
}
context.SetGroup(CONTEXT_GROUP_WAVES);
@@ -23,6 +23,7 @@
#include "ScriptedEscortAI.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
#include "WorldStateDefines.h"
enum Says
{
@@ -924,7 +925,7 @@ public:
break;
case EVENT_ACTION_PHASE2+9:
if (pInstance)
pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 0);
pInstance->DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 0);
Talk(SAY_PHASE210);
eventInRun = false;
@@ -1274,7 +1275,7 @@ void npc_arthas::npc_arthasAI::ReorderInstance(uint32 data)
else // if (data == COS_PROGRESS_KILLED_SALRAMM)
{
if (pInstance)
pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 10);
pInstance->DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 10);
DoAction(ACTION_KILLED_SALRAMM);
}
break;
@@ -1331,7 +1332,7 @@ void npc_arthas::npc_arthasAI::SendNextWave(uint32 entry)
else
SummonNextWave();
pInstance->DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, waveGroupId + 1);
pInstance->DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, waveGroupId + 1);
}
}
@@ -73,15 +73,6 @@ enum GameObjects
GO_PLAGUED_CRATE = 190095,
};
enum WorldStatesCoT
{
WORLDSTATE_SHOW_CRATES = 3479,
WORLDSTATE_CRATES_REVEALED = 3480,
WORLDSTATE_WAVE_COUNT = 3504,
WORLDSTATE_TIME_GUARDIAN = 3931,
WORLDSTATE_TIME_GUARDIAN_SHOW = 3932,
};
enum CrateSpells
{
SPELL_CRATES_CREDIT = 58109,
@@ -22,6 +22,7 @@
#include "ScriptedCreature.h"
#include "SpellInfo.h"
#include "TemporarySummon.h"
#include "WorldStateDefines.h"
#include "WorldStatePackets.h"
#include "culling_of_stratholme.h"
@@ -57,11 +58,11 @@ public:
void FillInitialWorldStates(WorldPackets::WorldState::InitWorldStates& packet) override
{
packet.Worldstates.reserve(5);
packet.Worldstates.emplace_back(WORLDSTATE_SHOW_CRATES, 0);
packet.Worldstates.emplace_back(WORLDSTATE_CRATES_REVEALED, _crateCount);
packet.Worldstates.emplace_back(WORLDSTATE_WAVE_COUNT, 0);
packet.Worldstates.emplace_back(WORLDSTATE_TIME_GUARDIAN, 25);
packet.Worldstates.emplace_back(WORLDSTATE_TIME_GUARDIAN_SHOW, 0);
packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, 0);
packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED, _crateCount);
packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 0);
packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, 25);
packet.Worldstates.emplace_back(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, 0);
}
void OnPlayerEnter(Player* plr) override
@@ -112,13 +113,13 @@ public:
switch (type)
{
case DATA_SHOW_CRATES:
DoUpdateWorldState(WORLDSTATE_SHOW_CRATES, data);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, data);
return;
case DATA_SHOW_INFINITE_TIMER:
if (!instance->IsHeroic() || !_guardianTimer)
return;
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, data);
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS)));
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, data);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, uint32(_guardianTimer / (MINUTE * IN_MILLISECONDS)));
if (data == 0)
{
_guardianTimer = 0;
@@ -128,10 +129,10 @@ public:
instance->SummonCreature(NPC_INFINITE, EventPos[EVENT_SRC_CORRUPTOR]);
return;
case DATA_START_WAVES:
DoUpdateWorldState(WORLDSTATE_WAVE_COUNT, 1);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_WAVE_COUNT, 1);
if (instance->IsHeroic())
{
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, true);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, true);
_guardianTimer = 26 * MINUTE * IN_MILLISECONDS;
if (!_infiniteGUID)
instance->SummonCreature(NPC_INFINITE, EventPos[EVENT_SRC_CORRUPTOR]);
@@ -151,7 +152,7 @@ public:
SetData(DATA_ARTHAS_EVENT, COS_PROGRESS_CRATES_FOUND);
}
DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_CRATES_REVEALED, _crateCount);
return;
case DATA_ARTHAS_EVENT:
// Start Event
@@ -256,7 +257,7 @@ public:
if (divAfter == 0)
{
_guardianTimer = 0;
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN_SHOW, 0);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN_SHOW, 0);
// Inform infinite we run out of time
if (instance->IsHeroic() && _infiniteGUID)
@@ -270,7 +271,7 @@ public:
else if (divAfter == 1)
ChromieWhisper(2);
DoUpdateWorldState(WORLDSTATE_TIME_GUARDIAN, divAfter);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_TIME_GUARDIAN, divAfter);
SaveToDB();
}
}
@@ -290,7 +291,7 @@ public:
ChromieWhisper(0);
// hide crates count
DoUpdateWorldState(WORLDSTATE_SHOW_CRATES, 0);
DoUpdateWorldState(WORLD_STATE_CULLING_OF_STRATHOLME_SHOW_CRATES, 0);
_showCrateTimer = 0;
_encounterState = COS_PROGRESS_CRATES_FOUND;
}
@@ -19,6 +19,7 @@
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Player.h"
#include "WorldStateDefines.h"
#include "old_hillsbrad.h"
static Position const instancePositions[INSTANCE_POSITIONS_COUNT] =
@@ -70,7 +71,7 @@ public:
CleanupInstance();
if (_encounterProgress < ENCOUNTER_PROGRESS_BARRELS)
player->SendUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, _barrelCount);
player->SendUpdateWorldState(WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED, _barrelCount);
}
void CleanupInstance()
@@ -153,7 +154,7 @@ public:
if (_barrelCount >= 5 || _encounterProgress > ENCOUNTER_PROGRESS_NONE)
return;
DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, ++_barrelCount);
DoUpdateWorldState(WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED, ++_barrelCount);
if (_barrelCount == 5)
{
_events.ScheduleEvent(EVENT_INITIAL_BARRELS_FLAME, 4000);
@@ -237,7 +238,7 @@ public:
orc->HandleEmoteCommand(EMOTE_ONESHOT_CHEER);
SetData(DATA_ESCORT_PROGRESS, ENCOUNTER_PROGRESS_BARRELS);
DoUpdateWorldState(WORLD_STATE_BARRELS_PLANTED, 0);
DoUpdateWorldState(WORLD_STATE_OLD_HILLSBRAD_BARRELS_PLANTED, 0);
break;
}
case EVENT_SUMMON_LIEUTENANT:

Some files were not shown because too many files have changed in this diff Show More