Rework the Game of Towers event (EPL PvP) (#1284)

Co-authored-by: ratkosrb <ratkomladic2@abv.bg>
This commit is contained in:
Orozxy
2021-09-30 14:18:47 +02:00
committed by GitHub
parent fdc46ca15c
commit 84ef1237c4
6 changed files with 1067 additions and 487 deletions
+211
View File
@@ -0,0 +1,211 @@
DROP PROCEDURE IF EXISTS add_migration;
delimiter ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20210724110239');
IF v=0 THEN
INSERT INTO `migrations` VALUES ('20210724110239');
-- Add your query below.
-- William Kielar.
UPDATE `creature_template` SET `faction`=35, `speed_walk`=1, `unit_flags`=768, `movement_type`=0, `civilian`=1 WHERE `entry`=17209 AND `patch`=10;
-- Lordaeron Commander.
UPDATE `creature_template` SET `health_min`=3175, `health_max`=3175, `faction`=123, `speed_walk`=1, `speed_run`=1.38571, `unit_flags`=0, `auras`=31748, `ai_name`='EventAI' WHERE `entry`=17635;
-- Lordaeron Soldier.
UPDATE `creature_template` SET `faction`=123, `speed_walk`=1, `movement_type`=0, `unit_flags`=0, `auras`=31748 WHERE `entry`=17647;
-- Lordaeron Veteran.
UPDATE `creature_template` SET `faction`=118, `speed_walk`=1, `base_attack_time`=2000, `ranged_attack_time`=2000, `movement_type`=0, `auras`=31309, `ai_name`='EventAI' WHERE `entry`=17995;
-- Lordaeron Fighter.
UPDATE `creature_template` SET `faction`=118, `speed_walk`=1, `base_attack_time`=2000, `ranged_attack_time`=2000, `movement_type`=0, `auras`=31309 WHERE `entry`=17996;
-- Spectral Gryphon.
INSERT INTO `creature_template` (`entry`, `patch`, `display_total_probability`, `display_id1`, `display_id2`, `display_id3`, `display_id4`, `display_scale1`, `display_scale2`, `display_scale3`, `display_scale4`, `display_probability1`, `display_probability2`, `display_probability3`, `display_probability4`, `name`, `subname`, `unit_class`, `rank`, `pet_family`, `type`, `type_flags`, `level_min`, `level_max`, `health_min`, `health_max`, `armor`, `attack_power`, `dmg_min`, `dmg_max`, `faction`) VALUES (17660, 10, 0, 17328, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Skeletal Gryphon', '', 1, 0, 0, 1, 134217728, 60, 60, 3052, 3052, 3791, 252, 103.9247, 137.887, 35);
-- Add correct mount.
UPDATE `taxi_nodes` SET `mount_creature_id1`=17660, `mount_creature_id2`=17660 WHERE `id` in (84,85,86,87);
-- Spirit of Victory.
INSERT INTO `creature_template` (`entry`, `patch`, `display_id1`, `display_id2`, `display_id3`, `display_id4`, `display_scale1`, `display_scale2`, `display_scale3`, `display_scale4`, `display_probability1`, `display_probability2`, `display_probability3`, `display_probability4`, `display_total_probability`, `mount_display_id`, `name`, `subname`, `gossip_menu_id`, `level_min`, `level_max`, `health_min`, `health_max`, `mana_min`, `mana_max`, `armor`, `faction`, `npc_flags`, `speed_walk`, `speed_run`, `detection_range`, `call_for_help_range`, `leash_range`, `rank`, `xp_multiplier`, `dmg_min`, `dmg_max`, `dmg_school`, `attack_power`, `dmg_multiplier`, `base_attack_time`, `ranged_attack_time`, `unit_class`, `unit_flags`, `dynamic_flags`, `pet_family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `ranged_dmg_min`, `ranged_dmg_max`, `ranged_attack_power`, `type`, `type_flags`, `loot_id`, `pickpocket_loot_id`, `skinning_loot_id`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `spell_id1`, `spell_id2`, `spell_id3`, `spell_id4`, `spell_list_id`, `pet_spell_list_id`, `auras`, `gold_min`, `gold_max`, `ai_name`, `movement_type`, `inhabit_type`, `civilian`, `racial_leader`, `regeneration`, `equipment_id`, `trainer_id`, `vendor_id`, `mechanic_immune_mask`, `school_immune_mask`, `flags_extra`, `script_name`) VALUES (18039, 10, 17548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Victory', NULL, 0, 60, 60, 3052, 3052, 0, 0, 3791, 35, 0, 1, 1.14286, 20, 5, 0, 0, 1, 103.925, 137.887, 0, 252, 1, 2000, 2000, 1, 33555200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 0, '', 0, 3, 1, 0, 3, 0, 0, 0, 0, 0, 64, '');
-- Fix buffers.
UPDATE `creature_template` SET `movement_type`=0, `flags_extra`=2 WHERE `entry` in (17794, 17795);
-- Fix Horde Curing Shrine.
UPDATE `gameobject_template` SET `faction`=1314 WHERE `entry`=181955;
-- Delete unnecessary GameObjects.
DELETE FROM `gameobject` WHERE `guid`=45864;
-- Delete unnecessary Creatures.
DELETE FROM `creature` WHERE `id`=17795;
-- William Kielar Gossips.
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_broadcast_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `box_broadcast_text`, `action_script_id`) VALUES (7379, 0, 0, 'Take me to Northpass Tower.', 13562, 1, 1, 0, 0, 0, 0, NULL, 0, 737901);
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_broadcast_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `box_broadcast_text`, `action_script_id`) VALUES (7379, 1, 0, 'Take me to Eastwall Tower.', 13563, 1, 1, 0, 0, 0, 0, NULL, 0, 737902);
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_broadcast_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `box_broadcast_text`, `action_script_id`) VALUES (7379, 2, 0, 'Take me to Crown Guard Tower.', 13564, 1, 1, 0, 0, 0, 0, NULL, 0, 737903);
INSERT INTO `gossip_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (737901, 0, 15, 29931, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'William Kielar - Cast Spell Flight Path (Northpass Tower)');
INSERT INTO `gossip_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (737902, 0, 15, 29934, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'William Kielar - Cast Spell Flight Path (Eastwall Tower)');
INSERT INTO `gossip_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (737903, 0, 15, 29994, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'William Kielar - Cast Spell Flight Path (Crown Guard Tower)');
-- Waypoints for Lordaeron Commander / Lordaeron Veteran from Eastwall Tower to Northpass Tower.
INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`, `wander_distance`, `script_id`) VALUES
(176350, 1, 2508.97, -4739.86, 94.2171, 100, 0, 0, 0),
(176350, 2, 2499.11, -4728.21, 91.2576, 100, 0, 0, 0),
(176350, 3, 2489.62, -4696.67, 82.5334, 100, 0, 0, 0),
(176350, 4, 2489.41, -4679.48, 79.23, 100, 0, 0, 0),
(176350, 5, 2492.75, -4661.14, 75.2698, 100, 0, 0, 0),
(176350, 6, 2507.7, -4657.5, 75.9172, 100, 0, 0, 0),
(176350, 7, 2527.35, -4655.69, 76.9172, 100, 0, 0, 0),
(176350, 8, 2551.24, -4650.62, 78.2178, 100, 0, 0, 0),
(176350, 9, 2581.14, -4637.59, 80.8094, 100, 0, 0, 0),
(176350, 10, 2606.74, -4620.01, 83.2762, 100, 0, 0, 0),
(176350, 11, 2632.55, -4604.1, 84.6785, 100, 0, 0, 0),
(176350, 12, 2670.71, -4583.26, 85.9197, 100, 0, 0, 0),
(176350, 13, 2704.45, -4563.24, 87.572, 100, 0, 0, 0),
(176350, 14, 2731.74, -4547.38, 88.322, 100, 0, 0, 0),
(176350, 15, 2758.3, -4526.77, 89.1629, 100, 0, 0, 0),
(176350, 16, 2773.15, -4510.53, 89.6595, 100, 0, 0, 0),
(176350, 17, 2790.7, -4493.29, 89.9334, 100, 0, 0, 0),
(176350, 18, 2813.27, -4468.35, 90.0207, 100, 0, 0, 0),
(176350, 19, 2826.77, -4451.97, 89.9391, 100, 0, 0, 0),
(176350, 20, 2836.21, -4437.79, 89.6759, 100, 0, 0, 0),
(176350, 21, 2852.29, -4416.58, 89.4426, 100, 0, 0, 0),
(176350, 22, 2857.23, -4412.86, 89.5676, 100, 0, 0, 0),
(176350, 23, 2881.88, -4408.76, 90.6221, 100, 0, 0, 0),
(176350, 24, 2911.51, -4408.25, 92.2111, 100, 0, 0, 0),
(176350, 25, 2936.4, -4408.94, 93.708, 100, 0, 0, 0),
(176350, 26, 2970.33, -4412.12, 96.0126, 100, 0, 0, 0),
(176350, 27, 2984.13, -4399.77, 96.7575, 100, 0, 0, 0),
(176350, 28, 2999.98, -4371.98, 93.8738, 100, 0, 0, 0),
(176350, 29, 3010.16, -4346.37, 96.5469, 100, 0, 0, 0),
(176350, 30, 3028.67, -4331.88, 99.0939, 100, 0, 0, 0),
(176350, 31, 3044.38, -4332.39, 99.4215, 100, 0, 0, 0),
(176350, 32, 3065.92, -4320.47, 105.869, 100, 0, 0, 0),
(176350, 33, 3102.85, -4316.72, 106.062, 100, 0, 0, 0),
(176350, 34, 3119.25, -4311.59, 118.468, 100, 0, 0, 0),
(176350, 35, 3129.17, -4309.67, 122.739, 100, 0, 0, 0),
(176350, 36, 3140.95, -4315.83, 128.318, 100, 0, 0, 0),
(176350, 37, 3154.63, -4326.59, 133.206, 100, 0, 0, 0),
(176350, 38, 3166.6, -4342.52, 135.782, 100, 0, 0, 0);
-- Not in AreaID 2275 (Northpass Tower).
INSERT INTO `conditions` (`condition_entry`, `type`, `value1`, `value2`, `value3`, `value4`, `flags`) VALUES (17635, 4, 2275, 0, 0, 0, 1);
-- Events list for Lordaeron Commander
DELETE FROM `creature_ai_events` WHERE `creature_id`=17635;
INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1763501, 17635, 0, 11, 0, 100, 0, 0, 0, 0, 0, 1763501, 1763502, 0, 'Lordaeron Commander - Just Spawned');
INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1763503, 17635, 0, 29, 0, 100, 0, 2, 37, 0, 0, 1763503, 0, 0, 'Lordaeron Commander - Last Waypoint');
INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1763505, 17635, 17635, 30, 0, 100, 0, 0, 0, 0, 0, 1763502, 0, 0, 'Lordaeron Commander - Leave Combat & On Waypoints');
DELETE FROM `creature_ai_scripts` WHERE `id`=1763501;
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763501, 0, 60, 3, 0, 7000, 0, 0, 0, 0, 0, 0, 176350, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Start Waypoints');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14746, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Say');
DELETE FROM `creature_ai_scripts` WHERE `id`=1763502;
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763502, 0, 39, 1763501, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Start Script');
-- Lordaeron Commander - Mount up.
DELETE FROM `generic_scripts` WHERE `id`=1763501;
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763501, 5, 24, 2410, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Mount up');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763501, 5, 68, 1764701, 2, 17647, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Mount up all Lordaeron Soldier');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763501, 5, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Toggle run');
-- Lordaeron Commander - Dismount.
DELETE FROM `creature_ai_scripts` WHERE `id`=1763503;
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 67, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Set Random Movement');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Leave Creature Group');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 68, 1764702, 2, 17647, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Execute this Script for all Lordaeron Soldier');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Save Home Position');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 24, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Dismount');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Set Walk');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1763503, 0, 20, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 'Lordaeron Commander - Set Random Movement');
-- Lordaeron Soldier - Mount up.
DELETE FROM `generic_scripts` WHERE `id`=1764701;
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1764701, 0, 24, 2410, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Soldier - Mount up');
-- Lordaeron Soldier - Dismount.
DELETE FROM `generic_scripts` WHERE `id`=1764702;
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1764702, 0, 24, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Dismount');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1764702, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Save Home Position');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1764702, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Set Walk');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1764702, 0, 20, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 'Lordaeron Commander - Set Random Movement');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1764702, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Commander - Leave Creature Group');
-- Events list for Lordaeron Veteran
DELETE FROM `creature_ai_events` WHERE `creature_id`=17995;
INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1799501, 17995, 0, 11, 0, 100, 0, 0, 0, 0, 0, 1799501, 1799502, 0, 'Lordaeron Veteran - Just Spawned');
INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1799503, 17995, 0, 29, 0, 100, 0, 2, 37, 0, 0, 1799503, 0, 0, 'Lordaeron Veteran - Last Waypoint');
INSERT INTO `creature_ai_events` (`id`, `creature_id`, `condition_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_script`, `action2_script`, `action3_script`, `comment`) VALUES (1799505, 17995, 17635, 30, 0, 100, 0, 0, 0, 0, 0, 1799502, 0, 0, 'Lordaeron Veteran - Leave Combat & On Waypoints');
DELETE FROM `creature_ai_scripts` WHERE `id`=1799501;
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799501, 0, 60, 3, 0, 7000, 0, 0, 0, 0, 0, 0, 176350, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Start Waypoints');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799501, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14746, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Say');
DELETE FROM `creature_ai_scripts` WHERE `id`=1799502;
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799502, 0, 39, 1799501, 0, 0, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Start Script');
-- Lordaeron Veteran - Mount up.
DELETE FROM `generic_scripts` WHERE `id`=1799501;
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799501, 5, 24, 10671, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Mount up');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799501, 5, 68, 1799601, 2, 17996, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Mount up all Lordaeron Soldier');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799501, 5, 25, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Toggle run');
-- Lordaeron Veteran - Dismount.
DELETE FROM `creature_ai_scripts` WHERE `id`=1799503;
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 67, 1, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Set Random Movement');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Leave Creature Group');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 68, 1799602, 2, 17996, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Execute this Script for all Lordaeron Soldier');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Save Home Position');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 24, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Dismount');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Set Walk');
INSERT INTO `creature_ai_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799503, 0, 20, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 'Lordaeron Veteran - Set Random Movement');
-- Lordaeron Fighter - Mount up.
DELETE FROM `generic_scripts` WHERE `id`=1799601;
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799601, 0, 24, 10671, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Fighter - Mount up');
-- Lordaeron Fighter - Dismount.
DELETE FROM `generic_scripts` WHERE `id`=1799602;
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799602, 0, 24, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Dismount');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799602, 0, 34, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Save Home Position');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799602, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Set Walk');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799602, 0, 20, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 'Lordaeron Veteran - Set Random Movement');
INSERT INTO `generic_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1799602, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Lordaeron Veteran - Leave Creature Group');
-- Remove endless channel from Tower Capture (DND).
INSERT INTO `spell_mod` (`Id`, `procChance`, `procFlags`, `procCharges`, `DurationIndex`, `Category`, `CastingTimeIndex`, `StackAmount`, `SpellIconID`, `activeIconID`, `manaCost`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `Custom`, `InterruptFlags`, `AuraInterruptFlags`, `ChannelInterruptFlags`, `Dispel`, `Stances`, `StancesNot`, `SpellVisual`, `ManaCostPercentage`, `StartRecoveryCategory`, `StartRecoveryTime`, `MaxAffectedTargets`, `MaxTargetLevel`, `DmgClass`, `rangeIndex`, `RecoveryTime`, `CategoryRecoveryTime`, `SpellFamilyName`, `SpellFamilyFlags`, `Mechanic`, `EquippedItemClass`, `Comment`) VALUES (31929, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 'Tower Capture (DND) - Remove Channeled Flag');
-- Waypoints for Spirit of Victory.
INSERT INTO `creature_movement_special` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`, `wander_distance`, `script_id`) VALUES
(18039, 1, 1856.31, -3714.78, 193.704, 100, 0, 0, 0),
(18039, 2, 1857.34, -3714, 194.264, 100, 0, 0, 0),
(18039, 3, 1869.87, -3702, 187.46, 100, 0, 0, 0),
(18039, 4, 1885.12, -3685.05, 177.598, 100, 0, 0, 0),
(18039, 5, 1897.11, -3670.92, 160.071, 100, 0, 0, 0),
(18039, 6, 1917.23, -3657.38, 146.376, 100, 0, 0, 0),
(18039, 7, 1941.29, -3652.43, 137.571, 100, 0, 0, 0),
(18039, 8, 1964.66, -3648.66, 133.432, 100, 0, 0, 0),
(18039, 9, 1979.2, -3645.12, 128.571, 100, 0, 0, 0),
(18039, 10, 1981.82, -3652.39, 124.21, 100, 0, 0, 0),
(18039, 11, 1978.6, -3654.43, 122.988, 100, 0, 0, 0),
(18039, 12, 1975.98, -3655.29, 120.599, 100, 0, 0, 0),
(18039, 13, 1975.98, -3655.29, 120.599, 100, 0, 0, 1803913);
DELETE FROM `creature_movement_scripts` WHERE `id`=1803913;
INSERT INTO `creature_movement_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1803913, 0, 15, 24221, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Victory - Cast Spell Teleport Spawn-out');
INSERT INTO `creature_movement_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES (1803913, 3, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Spirit of Victory - Despawn');
-- End of migration.
END IF;
END??
delimiter ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
-17
View File
@@ -1152,23 +1152,6 @@ enum MangosStrings
// NOT RESERVED IDS 12000-1999999999
// `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID)
// For other tables maybe 2000010000-2147483647 (max index),
// opvp ep
LANG_OPVP_EP_CAPTURE_NPT_H = 10033,
LANG_OPVP_EP_CAPTURE_NPT_A = 10034,
LANG_OPVP_EP_CAPTURE_EWT_H = 10035,
LANG_OPVP_EP_CAPTURE_EWT_A = 10036,
LANG_OPVP_EP_CAPTURE_CGT_H = 10037,
LANG_OPVP_EP_CAPTURE_CGT_A = 10038,
LANG_OPVP_EP_CAPTURE_PWT_H = 10039,
LANG_OPVP_EP_CAPTURE_PWT_A = 10040,
LANG_OPVP_EP_LOSE_NPT_H = 10041,
LANG_OPVP_EP_LOSE_NPT_A = 10042,
LANG_OPVP_EP_LOSE_EWT_H = 10043,
LANG_OPVP_EP_LOSE_EWT_A = 10044,
LANG_OPVP_EP_LOSE_CGT_H = 10045,
LANG_OPVP_EP_LOSE_CGT_A = 10046,
LANG_OPVP_EP_LOSE_PWT_H = 10047,
LANG_OPVP_EP_LOSE_PWT_A = 10048,
// opvp si
LANG_OPVP_SI_CAPTURE_H = 10049,
LANG_OPVP_SI_CAPTURE_A = 10050,
+122 -110
View File
@@ -25,13 +25,14 @@
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "CellImpl.h"
#include "TemporarySummon.h"
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_11_2
OPvPCapturePoint::OPvPCapturePoint(OutdoorPvP* pvp):
m_capturePointGUID(0), m_capturePoint(nullptr), m_maxValue(0), m_minValue(0), m_maxSpeed(0),
m_value(0), m_team(TEAM_NEUTRAL), m_OldState(OBJECTIVESTATE_NEUTRAL),
m_State(OBJECTIVESTATE_NEUTRAL), m_neutralValuePct(0), m_PvP(pvp)
m_value(0), m_team(TEAM_NEUTRAL), m_oldState(OBJECTIVESTATE_NEUTRAL),
m_state(OBJECTIVESTATE_NEUTRAL), m_neutralValuePct(0), m_valuePct(50), m_factDiff(0), m_PvP(pvp)
{
}
@@ -40,8 +41,20 @@ bool OPvPCapturePoint::HandlePlayerEnter(Player* plr)
if (m_capturePoint)
{
plr->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 1);
plr->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f));
plr->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct);
/* IMPORTANT!
EP_UI_TOWER_SLIDER_POS: Should always be sent last and only when the value (m_valuePct) has been updated.
Alliance [100] <---------[50]---------> [0] Horde
The Client does auto handle the direction indicator:
If the previous value was 50 and the new value 51 , the indicator points to the left (Alliance).
If the previous value was 50 and the new value 49 , the indicator points to the right (Horde).
If the previous value was 50 and the new value 50 , the indicator gets deleted (Possibly if the number of horde players and alliance players are the same, or Slider is at 0/100).
If any other UI element gets updated (SendUpdateWorldState) after the Slider it gets also deleted.
The reason for this is client-specific and has nothing to do with the core.
*/
plr->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, m_valuePct);
}
return m_activePlayers[plr->GetTeamId()].insert(plr).second;
}
@@ -58,63 +71,64 @@ void OPvPCapturePoint::SendChangePhase()
if (!m_capturePoint)
return;
// send this too, sometimes the slider disappears, dunno why :(
SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldState1, 1);
// send these updates to only the ones in this objective
SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f));
// send this too, sometimes it resets :S
SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct);
SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate2, m_valuePct);
}
void OPvPCapturePoint::AddGO(uint32 type, uint32 guid, uint32 entry)
bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 mapId, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
{
if (!entry)
GameObjectInfo const* goInfo = sObjectMgr.GetGameObjectInfo(entry);
if (!goInfo)
{
GameObjectData const* data = sObjectMgr.GetGOData(guid);
if (!data)
return;
entry = data->id;
sLog.outError("Invalid GameObject entry %u in OPvPCapturePoint::AddObject!", entry);
return false;
}
m_Objects[type] = MAKE_NEW_GUID(guid, entry, HIGHGUID_GAMEOBJECT);
m_ObjectTypes[m_Objects[type]] = type;
}
void OPvPCapturePoint::AddCre(uint32 type, uint32 guid, uint32 entry)
{
if (!entry)
Map* map = const_cast<Map*>(sMapMgr.FindMap(mapId));
if (!map)
{
CreatureData const* data = sObjectMgr.GetCreatureData(guid);
if (!data)
return;
entry = data->creature_id[0];
sLog.outError("Invalid Map id %u in OPvPCapturePoint::AddObject!", mapId);
return false;
}
m_Creatures[type] = MAKE_NEW_GUID(guid, entry, HIGHGUID_UNIT);
m_CreatureTypes[m_Creatures[type]] = type;
}
bool OPvPCapturePoint::AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
{
if (uint32 guid = sObjectMgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3))
if (GameObject* pGo = map->SummonGameObject(entry, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 0, WORLD_DEFAULT_OBJECT))
{
AddGO(type, guid, entry);
m_Objects[type] = pGo->GetObjectGuid();
m_ObjectTypes[m_Objects[type]] = type;
return true;
}
sLog.outError("Failed to create GameObject with entry %u in OPvPCapturePoint::AddObject!", entry);
return false;
}
bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 team, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay)
bool OPvPCapturePoint::AddCreature(uint32 type, uint32 entry, uint32 team, uint32 mapId, float x, float y, float z, float o, uint32 spawntimedelay, bool asActiveObject)
{
if (uint32 guid = sObjectMgr.AddCreData(entry, team, map, x, y, z, o, spawntimedelay))
CreatureInfo const* cInfo = sObjectMgr.GetCreatureTemplate(entry);
if (!cInfo)
{
AddCre(type, guid, entry);
sLog.outError("Invalid Creature entry %u in OPvPCapturePoint::AddCreature!", entry);
return false;
}
Map* map = const_cast<Map*>(sMapMgr.FindMap(mapId));
if (!map)
{
sLog.outError("Invalid Map id %u in OPvPCapturePoint::AddCreature!", mapId);
return false;
}
if (Creature* pCreature = map->SummonCreature(entry, x, y, z, o, TEMPSUMMON_MANUAL_DESPAWN, spawntimedelay, asActiveObject))
{
m_Creatures[type] = pCreature->GetObjectGuid();
m_CreatureTypes[m_Creatures[type]] = type;
return true;
}
sLog.outError("Failed to create Creature with entry %u in OPvPCapturePoint::AddCreature!", entry);
return false;
}
bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 mapId, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3)
{
DEBUG_LOG("Creating capture point %u", entry);
@@ -126,9 +140,29 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 map, float x, fl
return false;
}
m_capturePointGUID = sObjectMgr.AddGOData(entry, map, x, y, z, o, 0, rotation0, rotation1, rotation2, rotation3);
if (!m_capturePointGUID)
GameObjectInfo const* goInfo = sObjectMgr.GetGameObjectInfo(entry);
if (!goInfo)
{
sLog.outError("Invalid GameObject entry %u in OPvPCapturePoint::SetCapturePointData!", entry);
return false;
}
Map* map = const_cast<Map*>(sMapMgr.FindMap(mapId));
if (!map)
{
sLog.outError("Invalid Map id %u in OPvPCapturePoint::SetCapturePointData!", mapId);
return false;
}
GameObject* pGo = map->SummonGameObject(entry, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 0, WORLD_DEFAULT_OBJECT);
if (!pGo)
{
sLog.outError("Failed to create GameObject with entry %u in OPvPCapturePoint::SetCapturePointData!", entry);
return false;
}
m_capturePoint = pGo;
m_capturePointGUID = pGo->GetGUIDLow();
// get the needed values from goinfo
m_maxValue = (float)goinfo->capturePoint.maxTime;
@@ -150,24 +184,15 @@ bool OPvPCapturePoint::DelCreature(uint32 type)
Creature* cr = m_PvP->GetCreature(m_Creatures[type]);
if (!cr)
{
// can happen when closing the core
// Can happen when closing the core.
m_Creatures[type] = 0;
return false;
}
DEBUG_LOG("deleting opvp creature type %u", type);
uint32 guid = cr->GetDBTableGUIDLow();
// Don't save respawn time
cr->SetRespawnTime(0);
cr->RemoveCorpse();
// explicit removal from map
// beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted
// so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed
//if (Map* map = sMapMgr->FindMap(cr->GetMapId()))
// map->Remove(cr,false);
// delete respawn time for this creature
CharacterDatabase.PExecute("DELETE FROM creature_respawn WHERE guid = '%u'", guid);
cr->AddObjectToRemoveList();
sObjectMgr.DeleteCreatureData(guid);
MANGOS_ASSERT(cr->IsTemporarySummon());
static_cast<TemporarySummon*>(cr)->UnSummon();
m_CreatureTypes[m_Creatures[type]] = 0;
m_Creatures[type] = 0;
return true;
@@ -184,10 +209,8 @@ bool OPvPCapturePoint::DelObject(uint32 type)
m_Objects[type] = 0;
return false;
}
uint32 guid = obj->GetDBTableGUIDLow();
obj->SetRespawnTime(0); // not save respawn time
obj->SetRespawnTime(0); // Not save respawn time.
obj->Delete();
sObjectMgr.DeleteGOData(guid);
m_ObjectTypes[m_Objects[type]] = 0;
m_Objects[type] = 0;
return true;
@@ -195,12 +218,11 @@ bool OPvPCapturePoint::DelObject(uint32 type)
bool OPvPCapturePoint::DelCapturePoint()
{
sObjectMgr.DeleteGOData(m_capturePointGUID);
m_capturePointGUID = 0;
if (m_capturePoint)
{
m_capturePoint->SetRespawnTime(0); // not save respawn time
m_capturePoint->SetRespawnTime(0); // Not save respawn time.
m_capturePoint->Delete();
}
@@ -232,7 +254,7 @@ OutdoorPvP::OutdoorPvP() : ZoneScript(), m_objective_changed(false), m_TypeId(0)
OutdoorPvP::~OutdoorPvP()
{
// `Map`s should already be unloaded at this point
// `Map`s should already be unloaded at this point.
// DeleteSpawns();
for (const auto& itr : m_capturePoints)
delete itr.second;
@@ -240,7 +262,7 @@ OutdoorPvP::~OutdoorPvP()
void OutdoorPvP::OnPlayerLeave(Player* plr)
{
// inform the objectives of the leaving
// Inform the objectives of the leaving.
for (const auto& itr : m_capturePoints)
itr.second->HandlePlayerLeave(plr);
ZoneScript::OnPlayerLeave(plr);
@@ -280,31 +302,29 @@ bool OPvPCapturePoint::Update(uint32 diff)
}
std::list<Player*> players;
MaNGOS::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius, false);
MaNGOS::AnyPlayerInObjectRangeCheck checker(m_capturePoint, radius, true);
MaNGOS::PlayerListSearcher<MaNGOS::AnyPlayerInObjectRangeCheck> searcher(players, checker);
Cell::VisitWorldObjects(m_capturePoint, searcher, radius);
for (const auto& player : players)
{
if (player->IsOutdoorPvPActive())
if (player->IsOutdoorPvPActive() && !IsInsideObjective(player))
{
if (m_activePlayers[player->GetTeamId()].insert(player).second)
HandlePlayerEnter(player);
}
}
// get the difference of numbers
// Get the difference of numbers.
float fact_diff = ((float)m_activePlayers[0].size() - (float)m_activePlayers[1].size()) * diff / OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL;
if (!fact_diff)
return false;
uint32 Challenger = 0;
float maxDiff = m_maxSpeed * diff;
if (fact_diff < 0)
{
// horde is in majority, but it's already horde-controlled -> no change
if (m_State == OBJECTIVESTATE_HORDE && m_value <= -m_maxValue)
// Horde is in majority, but it's already Horde-controlled -> no change.
if (m_state == OBJECTIVESTATE_HORDE && m_value <= -m_maxValue)
return false;
if (fact_diff < -maxDiff)
@@ -314,8 +334,8 @@ bool OPvPCapturePoint::Update(uint32 diff)
}
else
{
// ally is in majority, but it's already ally-controlled -> no change
if (m_State == OBJECTIVESTATE_ALLIANCE && m_value >= m_maxValue)
// Alliance is in majority, but it's already Alliance-controlled -> no change.
if (m_state == OBJECTIVESTATE_ALLIANCE && m_value >= m_maxValue)
return false;
if (fact_diff > maxDiff)
@@ -324,58 +344,61 @@ bool OPvPCapturePoint::Update(uint32 diff)
Challenger = ALLIANCE;
}
uint32 OldValuePct = m_valuePct;
uint32 OldFactDiff = m_factDiff;
float oldValue = m_value;
TeamId oldTeam = m_team;
m_OldState = m_State;
m_oldState = m_state;
m_value += fact_diff;
if (m_value < -m_minValue) // red
if (m_value < -m_minValue) // Red.
{
if (m_value < -m_maxValue)
m_value = -m_maxValue;
m_State = OBJECTIVESTATE_HORDE;
m_state = OBJECTIVESTATE_HORDE;
m_team = TEAM_HORDE;
}
else if (m_value > m_minValue) // blue
else if (m_value > m_minValue) // Blue.
{
if (m_value > m_maxValue)
m_value = m_maxValue;
m_State = OBJECTIVESTATE_ALLIANCE;
m_state = OBJECTIVESTATE_ALLIANCE;
m_team = TEAM_ALLIANCE;
}
else if (oldValue * m_value <= 0) // grey, go through mid point
else if (oldValue * m_value <= 0) // Grey, go through mid point.
{
// if challenger is ally, then n->a challenge
// If challenger is ally, then N->A challenge.
if (Challenger == ALLIANCE)
m_State = OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE;
// if challenger is horde, then n->h challenge
m_state = OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE;
// If challenger is horde, then N->H challenge.
else if (Challenger == HORDE)
m_State = OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE;
m_state = OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE;
m_team = TEAM_NEUTRAL;
}
else // grey, did not go through mid point
else // Grey, did not go through mid point.
{
// old phase and current are on the same side, so one team challenges the other
if (Challenger == ALLIANCE && (m_OldState == OBJECTIVESTATE_HORDE || m_OldState == OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE))
m_State = OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE;
else if (Challenger == HORDE && (m_OldState == OBJECTIVESTATE_ALLIANCE || m_OldState == OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE))
m_State = OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE;
// Old phase and current are on the same side, so one team challenges the other.
if (Challenger == ALLIANCE && (m_oldState == OBJECTIVESTATE_HORDE || m_oldState == OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE))
m_state = OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE;
else if (Challenger == HORDE && (m_oldState == OBJECTIVESTATE_ALLIANCE || m_oldState == OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE))
m_state = OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE;
m_team = TEAM_NEUTRAL;
}
if (m_value != oldValue)
SendChangePhase();
m_valuePct = (uint32)ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f);
m_factDiff = (m_activePlayers[0].size() - m_activePlayers[1].size());
if (m_OldState != m_State)
if (m_oldState != m_state)
{
//sLog.outError("%u->%u", m_OldState, m_State);
if (oldTeam != m_team)
ChangeTeam(oldTeam);
ChangeState();
return true;
}
else if (m_valuePct != OldValuePct || OldFactDiff != m_factDiff && !m_factDiff) // Only send World Updates if the Slider value actually changes or Faction difference changed to avoid sending unnecessary packets.
SendChangePhase();
return false;
}
@@ -384,7 +407,7 @@ void OPvPCapturePoint::SendUpdateWorldState(uint32 field, uint32 value)
{
for (const auto& playerPerTeam : m_activePlayers)
{
// send to all players present in the area
// Send to all players present in the area.
for (PlayerSet::iterator itr = playerPerTeam.begin(); itr != playerPerTeam.end(); ++itr)
(*itr)->SendUpdateWorldState(field, value);
}
@@ -393,7 +416,7 @@ void OPvPCapturePoint::SendUpdateWorldState(uint32 field, uint32 value)
void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
{
uint32 team;
switch (m_State)
switch (m_state)
{
case OBJECTIVESTATE_ALLIANCE:
team = 0;
@@ -405,7 +428,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid)
return;
}
// send to all players present in the area
// Send to all players present in the area.
for (const auto itr : m_activePlayers[team])
itr->KilledMonsterCredit(id, guid);
}
@@ -421,19 +444,19 @@ void OutdoorPvP::HandleKill(Player* killer, Unit* killed)
if (!pGroupGuy)
continue;
// skip if too far away
// Skip if too far away.
if (!pGroupGuy->IsAtGroupRewardDistance(killed))
continue;
// creature kills must be notified, even if not inside objective / not outdoor pvp active
// player kills only count if active and inside objective
// Creature kills must be notified, even if not inside objective / not outdoor pvp active.
// Player kills only count if active and inside objective.
if ((pGroupGuy->IsOutdoorPvPActive() && IsInsideObjective(pGroupGuy)) || killed->GetTypeId() == TYPEID_UNIT)
HandleKillImpl(pGroupGuy, killed);
}
}
else
{
// creature kills must be notified, even if not inside objective / not outdoor pvp active
// Creature kills must be notified, even if not inside objective / not outdoor pvp active.
if (killer && ((killer->IsOutdoorPvPActive() && IsInsideObjective(killer)) || killed->GetTypeId() == TYPEID_UNIT))
HandleKillImpl(killer, killed);
}
@@ -519,23 +542,12 @@ bool OutdoorPvP::HandleAreaTrigger(Player* /*plr*/, uint32 /*trigger*/)
return false;
}
void OutdoorPvP::OnGameObjectCreate(GameObject* go)
{
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow()))
{
if (go->GetGoType() != GAMEOBJECT_TYPE_CAPTURE_POINT)
sLog.outError("OutdoorPvP : GameObject %u n'est pas de type GAMEOBJECT_TYPE_CAPTURE_POINT (%u)", go->GetEntry(), GAMEOBJECT_TYPE_CAPTURE_POINT);
cp->m_capturePoint = go;
}
}
void OutdoorPvP::OnGameObjectRemove(GameObject* go)
{
if (go->GetGoType() != GAMEOBJECT_TYPE_CAPTURE_POINT)
return;
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetDBTableGUIDLow()))
if (OPvPCapturePoint *cp = GetCapturePoint(go->GetGUIDLow()))
cp->m_capturePoint = nullptr;
}
@@ -560,7 +572,7 @@ void ZoneScript::OnPlayerEnter(Player* plr)
void ZoneScript::OnPlayerLeave(Player* plr)
{
// remove the world state information from the player (we can't keep everyone up to date, so leave out those who are not in the concerning zones)
// Remove the world state information from the player (we can't keep everyone up to date, so leave out those who are not in the concerning zones).
if (!plr->GetSession()->PlayerLogout())
SendRemoveWorldStates(plr);
m_players[plr->GetTeamId()].erase(plr);
@@ -576,7 +588,7 @@ void ZoneScript::SendUpdateWorldState(uint32 field, uint32 value)
void ZoneScript::BroadcastPacket(WorldPacket& data) const
{
// This is faster than sWorld.SendZoneMessage
// This is faster than sWorld.SendZoneMessage.
for (const auto& playerPerTeam : m_players)
for (PlayerSet::const_iterator itr = playerPerTeam.begin(); itr != playerPerTeam.end(); ++itr)
(*itr)->GetSession()->SendPacket(&data);
@@ -599,7 +611,7 @@ void ZoneScript::TeamCastSpell(TeamId team, int32 spellId)
itr->CastSpell(itr, (uint32)spellId, true);
else
for (const auto itr : m_players[team])
itr->RemoveAurasDueToSpell((uint32) - spellId); // by stack?
itr->RemoveAurasDueToSpell((uint32) - spellId); // By stack?
}
void ZoneScript::TeamApplyBuff(TeamId team, uint32 spellId, uint32 spellId2)
+7 -9
View File
@@ -137,17 +137,14 @@ class OPvPCapturePoint
GameObject* m_capturePoint;
void AddGO(uint32 type, uint32 guid, uint32 entry = 0);
void AddCre(uint32 type, uint32 guid, uint32 entry = 0);
bool SetCapturePointData(uint32 entry, uint32 map, float x, float y, float z, float o = 0,
bool SetCapturePointData(uint32 entry, uint32 mapId, float x, float y, float z, float o = 0,
float rotation0 = 0, float rotation1 = 0, float rotation2 = 0, float rotation3 = 0);
protected:
bool AddObject(uint32 type, uint32 entry, uint32 map, float x, float y, float z, float o,
bool AddObject(uint32 type, uint32 entry, uint32 mapId, float x, float y, float z, float o,
float rotation0, float rotation1, float rotation2, float rotation3);
bool AddCreature(uint32 type, uint32 entry, uint32 teamval, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
bool AddCreature(uint32 type, uint32 entry, uint32 teamval, uint32 mapId, float x, float y, float z, float o, uint32 spawntimedelay = 0, bool asActiveObject = false);
bool DelCreature(uint32 type);
bool DelObject(uint32 type);
@@ -170,11 +167,13 @@ class OPvPCapturePoint
TeamId m_team;
// objective states
ObjectiveStates m_OldState;
ObjectiveStates m_State;
ObjectiveStates m_oldState;
ObjectiveStates m_state;
// neutral value on capture bar
uint32 m_neutralValuePct;
uint32 m_valuePct;
uint32 m_factDiff;
// pointer to the OutdoorPvP this objective belongs to
OutdoorPvP* m_PvP;
@@ -297,7 +296,6 @@ class OutdoorPvP : public ZoneScript
// stuff
bool SetupZoneScript() override { return true; }
void OnGameObjectCreate(GameObject* go) override;
void OnGameObjectRemove(GameObject* go) override;
void OnCreatureCreate(Creature*) override {}
File diff suppressed because it is too large Load Diff
+239 -107
View File
@@ -22,75 +22,60 @@
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_11_2
uint32 const EP_AllianceBuffs[4] = {11413, 11414, 11415, 1386};
uint32 const EP_HordeBuffs[4] = {30880, 30683, 30682, 29520};
uint32 const EP_GraveYardZone = 139;
uint32 const EP_GraveYardId = 927;
uint8 const EPBuffZonesNum = 3;
uint32 const EP_EWT_CM = 17690;
uint32 const EP_CGT_CM = 17689;
uint32 const EP_NPT_CM = 17696;
uint32 const EP_PWT_CM = 17698;
uint32 const EPBuffZones[EPBuffZonesNum] = {139, 2017, 2057};
enum EP_TaxiNodes
{
EP_CGT_Taxi = 87,
EP_EWT_Taxi = 86,
EP_NPT_Taxi = 85,
EP_PWT_Taxi = 84
};
enum EP_EastwallTowerWorldStates
{
EP_EWT_A = 2354,
EP_EWT_H = 2356,
EP_EWT_N_A = 2359, // ally conquested
EP_EWT_N_H = 2360,
EP_EWT_N = 2361
EP_EWT_A = 2354, // EWT blue on map
EP_EWT_H = 2356, // EWT red on map
EP_EWT_N_A = 2359, // ally conquested
EP_EWT_N_H = 2360,
EP_EWT_N = 2361
};
enum EP_NorthpassTowerWorldStates
{
EP_NPT_N = 2352,
EP_NPT_N_A = 2362,
EP_NPT_N_H = 2363,
EP_NPT_A = 2372,
EP_NPT_H = 2373
EP_NPT_N = 2352,
EP_NPT_N_A = 2362,
EP_NPT_N_H = 2363,
EP_NPT_A = 2372, // NPT blue on map
EP_NPT_H = 2373 // NPT red on map
};
enum EP_PlagewoodTowerWorldStates
{
EP_PWT_N_A = 2366,
EP_PWT_N_H = 2353, //2367 not present! use neutral!
EP_PWT_A = 2370,
EP_PWT_H = 2371,
EP_PWT_N = 2353
EP_PWT_N_A = 2366,
EP_PWT_N_H = 2353, // 2367 not present! use neutral!
EP_PWT_A = 2370, // PWT blue on map
EP_PWT_H = 2371, // PWT red on map
EP_PWT_N = 2353
};
enum EP_CrownGuardTowerWorldStates
{
EP_CGT_N_A = 2374,
EP_CGT_N_H = 2375,
EP_CGT_A = 2378,
EP_CGT_H = 2379,
EP_CGT_N = 2355
EP_CGT_N_A = 2374,
EP_CGT_N_H = 2375,
EP_CGT_A = 2378,
EP_CGT_H = 2379, // GCT blue on map
EP_CGT_N = 2355
};
enum EP_WorldStates
{
EP_UI_TOWER_SLIDER_DISPLAY = 2426,
EP_UI_TOWER_SLIDER_POS = 2427,
EP_UI_TOWER_SLIDER_N = 2428,
EP_UI_TOWER_SLIDER_DISPLAY = 2426,
EP_UI_TOWER_SLIDER_POS = 2427,
EP_UI_TOWER_SLIDER_N = 2428,
EP_UI_TOWER_COUNT_A = 2327,
EP_UI_TOWER_COUNT_H = 2328
EP_UI_TOWER_COUNT_A = 2327,
EP_UI_TOWER_COUNT_H = 2328,
// Tower colors on Map
unk1 = 2358, // EFT horde
unk2 = 2357, // EFT alliance
unk3 = 2364, // NPT alliance
unk4 = 2365, // NPT horde
unk5 = 2368, // PWT alliance
unk6 = 2369, // PWT horde
unk7 = 2376, // CGT Alliance
unk8 = 2377 // CGT horde
};
enum EP_Summons
@@ -101,67 +86,101 @@ enum EP_Summons
EP_EWT_SOLDIER3,
EP_EWT_SOLDIER4,
EP_PWT_FLIGHTMASTER,
EP_PWT_BUFFER,
EP_CGT_BUFFER,
EP_EWT_BUFFER,
EP_NPT_BUFFER,
EP_CGT_SPIRITOFVICTORY,
};
enum EP_GoSummons
{
EP_NPT_BUFF = 0,
EP_NPT_FLAGS,
EP_EWT_FLAGS,
EP_CGT_FLAGS,
EP_PWT_FLAGS
EP_CGT_FLAG1 = 0,
EP_CGT_FLAG2 = 1,
EP_EWT_FLAG1 = 2,
EP_EWT_FLAG2 = 3,
EP_PWT_FLAG1 = 4,
EP_PWT_FLAG2 = 5,
EP_NPT_FLAG1 = 6,
EP_NPT_FLAG2 = 7,
EP_NPT_CURING_SHRINE = 8,
EP_NPT_BANNER_AURA = 9,
EP_CGT_BANNER_AURA = 10
};
enum EP_BroadCastTexts
{
BCT_EP_PWT_TAKEN_A = 13629, // |cffffff00The Plaguewood Tower has been taken by the Alliance!| r
BCT_EP_NPT_TAKEN_A = 13630, // |cffffff00Northpass Tower has been taken by the Alliance!| r
BCT_EP_EWT_TAKEN_A = 13631, // |cffffff00Eastwall Tower has been taken by the Alliance!| r
BCT_EP_CGT_TAKEN_A = 13632, // |cffffff00Crown Guard Tower has been taken by the Alliance!| r
BCT_EP_CGT_TAKEN_H = 13633, // |cffffff00Crown Guard Tower has been taken by the Horde!| r
BCT_EP_PWT_TAKEN_H = 13634, // |cffffff00The Plaguewood Tower has been taken by the Horde!| r
BCT_EP_NPT_TAKEN_H = 13635, // |cffffff00Northpass Tower has been taken by the Horde!| r
BCT_EP_EWT_TAKEN_H = 13636, // |cffffff00Eastwall Tower has been taken by the Horde!| r
BCT_EP_ALL_TAKEN_H = 13637, // |cffff0000All four towers are now in control of the Horde!| r
BCT_EP_ALL_TAKEN_A = 13638, // |cff33ccffAll four towers are now in control of the Alliance!| r
BCT_EP_EWT_SPAWN_SAY = 14746 // The Northpass tower needs our aid! Once again, let us charge and do proud or liege!
};
enum EP_Sounds
{
SOUND_PVPWARNINGHORDELONG = 8457, // This is played by Horde Tower Buffer on capturing a Tower.
SOUND_PVPFLAGCAPTUREDALLIANCE = 8173 // This is played by Horde Alliance Tower Buffer on capturing a Tower.
};
enum EP_Spells
{
SPELL_TXT_TOWOW_TOWER_KILL_CREDIT_DND = 32061, // Casted by Players which have the Quest on Eastwall Capture Quest Doodad.
SPELL_TOWER_CAPTURE_TEST_DND = 30882, // Casted by Alliance Tower Buffer and Horde Tower Buffer on all Players within 100 yards (77) Script Effect.
SPELL_TOWER_CAPTURE_DND = 31929, // Casted by Players.
SPELL_SPIRIT_SPAWN_IN = 17321, // Casted by Spirit of Victory.
SPELL_SPIRIT_PARTICLES = 17327,
SPELL_SPIRIT_PARTICLES_RED_BIG = 31309,
SPELL_SPIRIT_PARTICLES_SUPER_BIG_DND = 31954,
SPELL_SPIRIT_PARTICLES_RED_SUPER_BIG_DND = 31951,
SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_1 = 30880,
SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_2 = 30683,
SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_3 = 30682,
SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_4 = 29520,
SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_1 = 11413,
SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_2 = 11414,
SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_3 = 11415,
SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_4 = 1386
};
enum EP_NPCs
{
NPC_SPIRIT_OF_VICTORY = 18039,
NPC_WILLIAM_KIELAR = 17209,
NPC_ALLIANCE_TOWER_BUFFER = 17794,
NPC_HORDE_TOWER_BUFFER = 17795,
NPC_LORDAERON_COMMANDER = 17635,
NPC_LORDAERON_SOLDIER = 17647,
NPC_LORDAERON_VETERAN = 17995,
NPC_LORDAERON_FIGHTER = 17996
};
enum EP_Towers
{
EP_EWT = 0, // plaguelands 03
EP_NPT,// plaguelands 01
EP_PWT,// plaguelands 04
EP_CGT,// plaguelands 02
EP_TOWER_NUM
EP_EWT = 0, // plaguelands 03
EP_NPT, // plaguelands 01
EP_PWT, // plaguelands 04
EP_CGT, // plaguelands 02
EP_TOWER_NUM,
EP_FLAG_NUM = 8
};
const go_type EPCapturePoints[EP_TOWER_NUM] =
enum EP_Buffers
{
{182097,0,2574.51f,-4794.89f,144.704f,-1.45003f,-0.097056f,0.095578f,-0.656229f,0.742165f},
{181899,0,3181.08f,-4379.36f,174.123f,-2.03472f,-0.065392f,0.119494f,-0.842275f,0.521553f},
{182098,0,2962.71f,-3042.31f,154.789f,2.08426f,-0.074807f,-0.113837f,0.855928f,0.49883f},
{182096,0,1860.85f,-3731.23f,196.716f,-2.53214f,0.033967f,-0.131914f,0.944741f,-0.298177f}
};
const go_type EPTowerFlags[EP_TOWER_NUM] =
{
{182106,0,2569.60f,-4772.93f,115.399f,2.72271f,0.0f,0.0f,0.978148f,0.207912f},
{182106,0,3148.17f,-4365.51f,145.029f,1.53589f,0.0f,0.0f,0.694658f,0.71934f},
{182106,0,2992.63f,-3022.95f,125.593f,3.03687f,0.0f,0.0f,0.99863f,0.052336f},
{182106,0,1838.42f,-3703.56f,167.713f,0.890118f,0.0f,0.0f,0.430511f,0.902585f}
};
uint32 const EPTowerPlayerEnterEvents[EP_TOWER_NUM] = {10691,10699,10701,10705};
uint32 const EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = {10692,10698,10700,10704};
uint8 const EP_NUM_CREATURES = 6;
uint8 const EP_EWT_NUM_CREATURES = 5;
// one lordaeron commander, 4 soldiers
// should be spawned at EWT and follow a path, but trans-grid pathing isn't safe, so summon them directly at NPT
const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] =
{
{17635,469,0, 3167.61f,-4352.09f,138.20f,4.5811f},
{17647,469,0, 3172.74f,-4352.99f,139.14f,4.9873f},
{17647,469,0, 3165.89f,-4354.46f,138.67f,3.7244f},
{17647,469,0, 3164.65f,-4350.26f,138.22f,2.4794f},
{17647,469,0, 3169.91f,-4349.68f,138.37f,0.7444f}
};
const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] =
{
{17995,67,0, 3167.61f,-4352.09f,138.20f,4.5811f},
{17996,67,0, 3172.74f,-4352.99f,139.14f,4.9873f},
{17996,67,0, 3165.89f,-4354.46f,138.67f,3.7244f},
{17996,67,0, 3164.65f,-4350.26f,138.22f,2.4794f},
{17996,67,0, 3169.91f,-4349.68f,138.37f,0.7444f}
EP_BUFFER_CGT_A = 0,
EP_BUFFER_EWT_A,
EP_BUFFER_PWT_A,
EP_BUFFER_NPT_A,
EP_BUFFER_CGT_H,
EP_BUFFER_EWT_H,
EP_BUFFER_PWT_H,
EP_BUFFER_NPT_H
};
enum EP_TowerStates
@@ -175,11 +194,113 @@ enum EP_TowerStates
EP_TS_H = 64
};
// when spawning, pay attention at setting the faction manually!
const creature_type EP_PWT_FlightMaster = {17209,0,0,2987.5f,-3049.11f,120.126f,5.75959f};
enum EP_Gobjects
{
GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS03 = 182097,
GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS01 = 181899,
GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS04 = 182098,
GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS02 = 182096,
GOBJECT_TOWER_BANNER = 182106,
GOBJECT_CURING_SHRINE_ALLIANCE = 181682,
GOBJECT_ALLIANCE_BANNER_AURA = 180100,
GOBJECT_CURING_SHRINE_HORDE = 181955,
GOBJECT_HORDE_BANNER_AURA = 180101,
GOBJECT_HORDE_BANNER_AURA_LARGE = 180422,
GOBJECT_ALLIANCE_BANNER_AURA_LARGE = 180421
};
// after spawning, modify the faction so that only the controller will be able to use it with SetUInt32Value(GAMEOBJECT_FACTION, faction_id);
const go_type EP_NPT_LordaeronShrine = {181682,0,3167.72f,-4355.91f,138.785f,1.69297f,0.0f,0.0f,0.748956f,0.66262f};
uint32 const EP_AllianceBuffs[4] = { SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_1, SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_2, SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_3, SPELL_ALLIANCE_ECHOES_OF_LORDAERON_RANK_4 };
uint32 const EP_HordeBuffs[4] = { SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_1, SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_2, SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_3, SPELL_HORDE_ECHOES_OF_LORDAERON_RANK_4 };
uint32 const EP_Zone = 139; // Eastern Plaguelands.
uint32 const EP_GraveYardId = 927;
uint8 const EPBuffZonesNum = 3;
uint32 const EP_EWT_CM = 17690;
uint32 const EP_CGT_CM = 17689;
uint32 const EP_NPT_CM = 17696;
uint32 const EP_PWT_CM = 17698;
uint32 const EPBuffZones[EPBuffZonesNum] = { 139, 2017, 2057 };
uint32 const EPTowerPlayerEnterEvents[EP_TOWER_NUM] = { 10691, 10699, 10701, 10705 };
uint32 const EPTowerPlayerLeaveEvents[EP_TOWER_NUM] = { 10692, 10698, 10700, 10704 };
uint8 const EP_EWT_NUM_CREATURES = 5;
// All positions below are sniffed.
const creature_type EPBufferNPCs[8] =
{
{ NPC_ALLIANCE_TOWER_BUFFER, 469, 0, 1860.59f, -3730.8f, 197.854f, 2.54818f },
{ NPC_ALLIANCE_TOWER_BUFFER, 469, 0, 2574.12f, -4795.33f, 145.871f, 5.11381f },
{ NPC_ALLIANCE_TOWER_BUFFER, 469, 0, 2962.6f, -3041.96f, 155.835f, 3.00197f },
{ NPC_ALLIANCE_TOWER_BUFFER, 469, 0, 3180.54f, -4379.31f, 175.275f, 3.57792f },
{ NPC_HORDE_TOWER_BUFFER, 67, 0, 1860.48f, -3731.34f, 197.778f, 2.42601f },
{ NPC_HORDE_TOWER_BUFFER, 67, 0, 2574.0f, -4794.79f, 145.881f, 1.95477f },
{ NPC_HORDE_TOWER_BUFFER, 67, 0, 2963.02f, -3041.9f, 155.965f, 4.27606f },
{ NPC_HORDE_TOWER_BUFFER, 67, 0, 3180.48f, -4379.07f, 174.995f, 2.74017f }
};
const go_type EPCapturePoints[EP_TOWER_NUM] =
{
{ GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS03, 0, 2574.51f, -4794.89f, 144.704f, -1.45003f, -0.097056f, 0.095578f, -0.656229f, 0.742165f },
{ GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS01, 0, 3181.08f, -4379.36f, 174.123f, -2.03472f, -0.065392f, 0.119494f, -0.842275f, 0.521553f },
{ GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS04, 0, 2962.71f, -3042.31f, 154.789f, 2.08426f, -0.074807f, -0.113837f, 0.855928f, 0.49883f },
{ GOBJECT_DOODAD_BATTLEFIELDBANNER_STATE_BASE_PLAGUELANDS02, 0, 1860.85f, -3731.23f, 196.716f, -2.53214f, 0.033967f, -0.131914f, 0.944741f, -0.298177f }
};
const go_type EPTowerFlags[EP_FLAG_NUM] =
{
{ GOBJECT_TOWER_BANNER, 0, 1838.42f, -3703.56f, 167.713f, 0.890117f, 0.0f, 0.0f, 0.43051f, 0.902586f },
{ GOBJECT_TOWER_BANNER, 0, 1877.6f, -3716.76f, 167.188f, 1.74533f, 0.0f, 0.0f, 0.766044f, 0.642789f },
{ GOBJECT_TOWER_BANNER, 0, 2539.61f, -4801.55f, 115.766f, 2.00713f, 0.0f, 0.0f, 0.843391f, 0.5373f },
{ GOBJECT_TOWER_BANNER, 0, 2569.6f, -4772.93f, 115.399f, 2.72271f, 0.0f, 0.0f, 0.978148f, 0.207912f },
{ GOBJECT_TOWER_BANNER, 0, 2975.5f, -3060.36f, 125.108f, 5.23599f, 0.0f, 0.0f, -0.5f, 0.866025f },
{ GOBJECT_TOWER_BANNER, 0, 2992.63f, -3022.95f, 125.593f, 3.03684f, 0.0f, 0.0f, 0.998629f, 0.0523532f },
{ GOBJECT_TOWER_BANNER, 0, 3148.17f, -4365.51f, 145.029f, 1.53589f, 0.0f, 0.0f, 0.694658f, 0.71934f },
{ GOBJECT_TOWER_BANNER, 0, 3188.76f, -4358.5f, 144.555f, 1.97222f, 0.0f, 0.0f, 0.833885f, 0.551938f }
};
const go_type EP_NPT_LordaeronShrine[4] =
{
{ GOBJECT_CURING_SHRINE_ALLIANCE, 0, 3167.72f, -4355.91f, 138.785f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f },
{ GOBJECT_ALLIANCE_BANNER_AURA, 0, 3167.72f, -4355.91f, 138.785f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f },
{ GOBJECT_CURING_SHRINE_HORDE, 0, 3167.5f, -4356.25f, 138.821f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f },
{ GOBJECT_HORDE_BANNER_AURA, 0, 3167.5f, -4356.25f, 138.821f, 1.69297f, 0.0f, 0.0f, 0.748956f, 0.66262f }
};
const go_type EP_CGT_BannerAuraGraveYard[2] =
{
{ GOBJECT_HORDE_BANNER_AURA_LARGE, 0, 1985.47f, -3653.88f, 120.172f, 1.46608f, 0.0f, 0.0f, 0.66913f, 0.743145f },
{ GOBJECT_ALLIANCE_BANNER_AURA_LARGE, 0, 1985.47f, -3653.88f, 120.172f, 1.46608f, 0.0f, 0.0f, 0.66913f, 0.743145f }
};
const creature_type EP_EWT_Summons_A[EP_EWT_NUM_CREATURES] =
{
{ NPC_LORDAERON_COMMANDER, 469, 0, 2532.85f, -4764.92f, 103.617f, 2.35619f },
{ NPC_LORDAERON_SOLDIER, 469, 0, 2533.33f, -4769.31f, 104.396f, 2.37365f },
{ NPC_LORDAERON_SOLDIER, 469, 0, 2537.34f, -4773.92f, 105.941f, 2.21657f },
{ NPC_LORDAERON_SOLDIER, 469, 0, 2537.77f, -4765.94f, 104.432f, 2.3911f },
{ NPC_LORDAERON_SOLDIER, 469, 0, 2542.57f, -4770.22f, 106.145f, 2.42601f }
};
const creature_type EP_EWT_Summons_H[EP_EWT_NUM_CREATURES] =
{
{ NPC_LORDAERON_VETERAN, 67, 0, 2532.85f, -4764.92f, 103.617f, 2.35619f },
{ NPC_LORDAERON_FIGHTER, 67, 0, 2533.33f, -4769.31f, 104.396f, 2.37365f },
{ NPC_LORDAERON_FIGHTER, 67, 0, 2537.34f, -4773.92f, 105.941f, 2.21657f },
{ NPC_LORDAERON_FIGHTER, 67, 0, 2537.77f, -4765.94f, 104.432f, 2.3911f },
{ NPC_LORDAERON_FIGHTER, 67, 0, 2542.57f, -4770.22f, 106.145f, 2.42601f }
};
const creature_type EP_PWT_FlightMaster = { NPC_WILLIAM_KIELAR, 0, 0, 2987.5f, -3049.11f, 120.126f, 5.75959f };
const creature_type EP_CGT_SpiritOfVictory = { NPC_SPIRIT_OF_VICTORY, 0, 0, 1856.58f, -3714.72f, 194.637f, 0.762214f };
class OutdoorPvPEP;
@@ -203,7 +324,7 @@ class OPvPCapturePointEP_EWT : public OPvPCapturePoint
protected:
void SummonSupportUnitAtNorthpassTower(uint32 team);
void SummonSquadAtEastWallTower(uint32 team);
void UpdateTowerState();
@@ -234,7 +355,7 @@ class OPvPCapturePointEP_NPT : public OPvPCapturePoint
protected:
void SummonGO(uint32 team);
void SummonCuringShrine(uint32 team);
void UpdateTowerState();
@@ -242,7 +363,7 @@ class OPvPCapturePointEP_NPT : public OPvPCapturePoint
uint32 m_TowerState;
uint32 m_SummonedGOSide;
uint32 m_SummonedShrineSide;
};
class OPvPCapturePointEP_CGT : public OPvPCapturePoint
@@ -267,13 +388,23 @@ class OPvPCapturePointEP_CGT : public OPvPCapturePoint
void LinkGraveYard(Team team);
void UnLinkGraveYard();
void SummonSpiritOfVictory(uint32 team);
void SummonBannerAura(uint32 team);
void UpdateTowerState();
protected:
uint32 m_TowerState;
uint32 m_SpiritOfVictorySpawned;
Team m_GraveyardSide;
uint32 m_SummonedBannerSide;
};
class OPvPCapturePointEP_PWT : public OPvPCapturePoint
@@ -330,6 +461,7 @@ class OutdoorPvPEP : public OutdoorPvP
void SendRemoveWorldStates(Player* plr);
void BuffTeams();
void TowerBuff(Creature* pCreature);
private: