Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Vincent-Michael
2014-04-26 12:35:21 +02:00
20 changed files with 701 additions and 363 deletions
+1
View File
@@ -0,0 +1 @@
cat ../sql/updates/world/*.sql > world_update.sql
+1
View File
@@ -0,0 +1 @@
copy /a ..\sql\updates\world\*.sql /b world_updates.sql
-1
View File
@@ -1 +0,0 @@
copy /a sql\updates\world\*world*.sql /b world_updates.sql
@@ -0,0 +1,58 @@
SET @CGUID := 76265;
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+12;
INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
(@CGUID+0, 29, 607, 3, 193, 841.921, -134.194, 196.838, 6.23082, 7200, 0, 0),
(@CGUID+1, 15214, 607, 3, 193, 1230.2, -67.941, 83.7716, 4.08407, 7200, 0, 0),
(@CGUID+2, 15214, 607, 3, 193, 1611.57, 73.0032, 8.14356, 2.05949, 7200, 0, 0),
(@CGUID+3, 15214, 607, 3, 193, 1623.94, -96.5658, 12.5011, 4.4855, 7200, 0, 0),
(@CGUID+4, 22515, 607, 3, 193, 1351.07, -87.6424, 43.4303, 0.191986, 7200, 0, 0),
(@CGUID+5, 22515, 607, 3, 193, 1357.35, -37.702, 46.4816, 5.3058, 7200, 0, 0),
(@CGUID+6, 22515, 607, 3, 193, 1363.41, -85.741, 48.9664, 0.593412, 7200, 0, 0),
(@CGUID+7, 22515, 607, 3, 193, 1364.28, -34.382, 42.9869, 4.7822, 7200, 0, 0),
(@CGUID+8, 23472, 607, 3, 193, 1043.52, -87.8507, 87.197, 2.96706, 7200, 0, 0),
(@CGUID+9, 23472, 607, 3, 193, 1193.76, 69.9405, 58.1295, 2.49582, 7200, 0, 0),
(@CGUID+10, 23472, 607, 3, 193, 1227.89, -235.458, 60.1112, 3.40339, 7200, 0, 0),
(@CGUID+11, 23472, 607, 3, 193, 1389.06, 102.941, 34.5742, 2.16421, 7200, 0, 0),
(@CGUID+12, 23472, 607, 3, 193, 1441.08, -240.594, 35.3471, 4.03171, 7200, 0, 0);
DELETE FROM `creature_text` WHERE `entry` IN (29, 29260, 29262, 22515);
INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES
(29, 1, 0, 'Let the battle for the Strand of the Ancients begin!', 41, 0, 100, 0, 0, 0, 'Kanrethad', 28844),
(29, 2, 0, 'Round 1 - Finished!', 41, 0, 100, 0, 0, 0, 'Kanrethad', 28989),
(29260, 1, 0, 'Sparklight''s vehicle emporium is open for business!', 14, 0, 100, 0, 0, 0, 'Rigger Sparklight', 30230),
(29262, 1, 0, 'Rigspark''s vehicle shop is open for business!', 14, 0, 100, 0, 0, 0, 'Gorgril Rigspark', 30229),
(22515, 1, 0, 'The Gate of the Blue Sapphire is under attack!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Blue Sapphire is under attack', 29296),
(22515, 2, 0, 'The Gate of the Green Emerald is under attack!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Green Emerald is under attack', 29297),
(22515, 3, 0, 'The Gate of the Red Sun is under attack!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Red Sun is under attack', 29298),
(22515, 4, 0, 'The Gate of the Purple Amethyst is under attack!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Purple Amethyst is under attack', 29299),
(22515, 5, 0, 'The Gate of the Yellow Moon is under attack!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Yellow Moon is under attack', 29300),
(22515, 6, 0, 'The Gate of the Yellow Moon was destroyed!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Yellow Moon was destroyed', 29304),
(22515, 7, 0, 'The Gate of the Purple Amethyst was destroyed!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Purple Amethyst was destroyed', 29305),
(22515, 8, 0, 'The Gate of the Red Sun was destroyed!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Red Sun was destroyed', 29306),
(22515, 9, 0, 'The Gate of the Green Emerald was destroyed!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Green Emerald was destroyed', 29307),
(22515, 10, 0, 'The Gate of the Blue Sapphire was destroyed!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The Gate of the Blue Sapphire was destroyed', 29308),
(22515, 11, 0, 'The Eastern Graveyard has been captured by the Alliance!', 41, 0, 100, 0, 0, 8212, 'World Trigger - SOA - The Eastern Graveyard has been captured by the Alliance', 29925),
(22515, 12, 0, 'The Western Graveyard has been captured by the Alliance!', 41, 0, 100, 0, 0, 8212, 'World Trigger - SOA - The Western Graveyard has been captured by the Alliance', 29926),
(22515, 13, 0, 'The Southern Graveyard has been captured by the Alliance!', 41, 0, 100, 0, 0, 8212, 'World Trigger - SOA - The Southern Graveyard has been captured by the Alliance', 29927),
(22515, 14, 0, 'The Eastern Graveyard has been captured by the Horde!', 41, 0, 100, 0, 0, 8174, 'World Trigger - SOA - The Eastern Graveyard has been captured by the Horde', 29928),
(22515, 15, 0, 'The Western Graveyard has been captured by the Horde!', 41, 0, 100, 0, 0, 8174, 'World Trigger - SOA - The Western Graveyard has been captured by the Horde', 29929),
(22515, 16, 0, 'The Southern Graveyard has been captured by the Horde!', 41, 0, 100, 0, 0, 8174, 'World Trigger - SOA - The Southern Graveyard has been captured by the Horde', 29930),
(22515, 17, 0, 'The relic chamber is under attack!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The relic chamber is under attack', 33072),
(22515, 18, 0, 'The chamber has been breached! The titan relic is vulnerable!', 41, 0, 100, 0, 0, 0, 'World Trigger - SOA - The chamber has been breached', 33073);
DELETE FROM `spell_area` WHERE `spell` IN (60027, 60028);
INSERT INTO `spell_area` (`spell`,`area`,`autocast`) VALUES
(60027, 4384, 1),
(60028, 4384, 1);
DELETE FROM `trinity_string` WHERE (`entry` BETWEEN 10059 AND 10062) OR (`entry` BETWEEN 10067 and 10073);
@@ -0,0 +1,201 @@
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3370 WHERE `menu_id`=0 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=0 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2822 WHERE `menu_id`=0 AND `id`=6;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3415 WHERE `menu_id`=0 AND `id`=9;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8912 WHERE `menu_id`=0 AND `id`=12;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3370 WHERE `menu_id`=0 AND `id`=13;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8271 WHERE `menu_id`=0 AND `id`=14;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2591 WHERE `menu_id`=125 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2589 WHERE `menu_id`=126 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=435 AND `id`=6;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=721 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5514 WHERE `menu_id`=721 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5515 WHERE `menu_id`=721 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7253 WHERE `menu_id`=721 AND `id`=6;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10359 WHERE `menu_id`=721 AND `id`=8;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5518 WHERE `menu_id`=721 AND `id`=12;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3370 WHERE `menu_id`=922 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2822 WHERE `menu_id`=1293 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3370 WHERE `menu_id`=1293 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=1951 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5514 WHERE `menu_id`=1951 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5515 WHERE `menu_id`=1951 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5518 WHERE `menu_id`=1951 AND `id`=6;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7253 WHERE `menu_id`=1951 AND `id`=7;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=9756 WHERE `menu_id`=1951 AND `id`=9;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10359 WHERE `menu_id`=1951 AND `id`=10;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=4972 WHERE `menu_id`=1970 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=2121 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5152 WHERE `menu_id`=2177 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5152 WHERE `menu_id`=2178 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5152 WHERE `menu_id`=2179 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=2352 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5758 WHERE `menu_id`=2703 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=6241 WHERE `menu_id`=3049 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=3506 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=3533 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=3580 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7556 WHERE `menu_id`=4023 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8229 WHERE `menu_id`=4346 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8230 WHERE `menu_id`=4346 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8231 WHERE `menu_id`=4346 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8223 WHERE `menu_id`=4362 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8223 WHERE `menu_id`=4362 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7556 WHERE `menu_id`=4506 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8298 WHERE `menu_id`=4609 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7556 WHERE `menu_id`=4648 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8298 WHERE `menu_id`=4655 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=8298 WHERE `menu_id`=4656 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=9332 WHERE `menu_id`=5702 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=13491 WHERE `menu_id`=5750 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10035 WHERE `menu_id`=6182 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10067 WHERE `menu_id`=6207 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10069 WHERE `menu_id`=6207 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10071 WHERE `menu_id`=6207 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10073 WHERE `menu_id`=6207 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=20889 WHERE `menu_id`=6207 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=20890 WHERE `menu_id`=6207 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=20891 WHERE `menu_id`=6207 AND `id`=6;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=20892 WHERE `menu_id`=6207 AND `id`=7;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10179 WHERE `menu_id`=6230 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12647 WHERE `menu_id`=6321 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12641 WHERE `menu_id`=6321 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12670 WHERE `menu_id`=6322 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12673 WHERE `menu_id`=6322 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12672 WHERE `menu_id`=6322 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12661 WHERE `menu_id`=6341 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10775 WHERE `menu_id`=6582 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10777 WHERE `menu_id`=6582 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12021 WHERE `menu_id`=7096 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12237 WHERE `menu_id`=7208 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12238 WHERE `menu_id`=7208 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12239 WHERE `menu_id`=7208 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12240 WHERE `menu_id`=7208 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=13499 WHERE `menu_id`=7371 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=7633 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=15315 WHERE `menu_id`=7675 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=15323 WHERE `menu_id`=7679 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=7777 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=16928 WHERE `menu_id`=7984 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=16928 WHERE `menu_id`=7985 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=16928 WHERE `menu_id`=7986 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=16928 WHERE `menu_id`=7987 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=16928 WHERE `menu_id`=7988 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=16928 WHERE `menu_id`=7989 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=8129 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=8185 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19671 WHERE `menu_id`=8304 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19668 WHERE `menu_id`=8304 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19669 WHERE `menu_id`=8304 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19283 WHERE `menu_id`=8306 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19270 WHERE `menu_id`=8339 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19268 WHERE `menu_id`=8340 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19728 WHERE `menu_id`=8454 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19668 WHERE `menu_id`=8455 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=19669 WHERE `menu_id`=8455 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=20638 WHERE `menu_id`=8616 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=20640 WHERE `menu_id`=8617 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=21627 WHERE `menu_id`=8725 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=22383 WHERE `menu_id`=8775 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=22768 WHERE `menu_id`=8894 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=23789 WHERE `menu_id`=9007 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=23827 WHERE `menu_id`=9015 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=23964 WHERE `menu_id`=9040 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=23964 WHERE `menu_id`=9041 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=23964 WHERE `menu_id`=9042 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=25653 WHERE `menu_id`=9304 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=26120 WHERE `menu_id`=9456 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=26262 WHERE `menu_id`=9484 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=26439 WHERE `menu_id`=9507 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=26443 WHERE `menu_id`=9509 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=26448 WHERE `menu_id`=9510 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=27303 WHERE `menu_id`=9621 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=27463 WHERE `menu_id`=9647 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=27820 WHERE `menu_id`=9683 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=28527 WHERE `menu_id`=9714 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=28607 WHERE `menu_id`=9727 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=28608 WHERE `menu_id`=9727 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=30420 WHERE `menu_id`=9841 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=30429 WHERE `menu_id`=9842 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=30431 WHERE `menu_id`=9843 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=30644 WHERE `menu_id`=9859 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=9879 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=9893 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=9895 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31058 WHERE `menu_id`=9904 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31055 WHERE `menu_id`=9904 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31061 WHERE `menu_id`=9904 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31296 WHERE `menu_id`=9961 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31296 WHERE `menu_id`=9963 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31296 WHERE `menu_id`=9964 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31296 WHERE `menu_id`=9968 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31296 WHERE `menu_id`=9980 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=9987 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=9988 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31934 WHERE `menu_id`=10036 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=10043 AND `id`=7;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=10115 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3266 WHERE `menu_id`=10117 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=32458 WHERE `menu_id`=10137 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=10265 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33401 WHERE `menu_id`=10318 AND `id`=7;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34038 WHERE `menu_id`=10368 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34039 WHERE `menu_id`=10368 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34041 WHERE `menu_id`=10368 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34042 WHERE `menu_id`=10368 AND `id`=3;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34090 WHERE `menu_id`=10398 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34092 WHERE `menu_id`=10400 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=34091 WHERE `menu_id`=10402 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5515 WHERE `menu_id`=10769 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10359 WHERE `menu_id`=10769 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2870 WHERE `menu_id`=10769 AND `id`=5;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=4895 WHERE `menu_id`=10769 AND `id`=8;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=7253 WHERE `menu_id`=10769 AND `id`=10;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5518 WHERE `menu_id`=10769 AND `id`=11;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=36832 WHERE `menu_id`=10857 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=36824 WHERE `menu_id`=10858 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=40435 WHERE `menu_id`=11345 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=40436 WHERE `menu_id`=11345 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=31296 WHERE `menu_id`=21036 AND `id`=4;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=30181 WHERE `menu_id`=21194 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=2822 WHERE `menu_id`=21195 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3370 WHERE `menu_id`=21195 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=3370 WHERE `menu_id`=21215 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=25042 WHERE `menu_id`=21248 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33039 WHERE `menu_id`=21255 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=33043 WHERE `menu_id`=21256 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12653 WHERE `menu_id`=21262 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12646 WHERE `menu_id`=21263 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12645 WHERE `menu_id`=21263 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12644 WHERE `menu_id`=21263 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12643 WHERE `menu_id`=21264 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12642 WHERE `menu_id`=21264 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12640 WHERE `menu_id`=21264 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12675 WHERE `menu_id`=21265 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12676 WHERE `menu_id`=21265 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12680 WHERE `menu_id`=21266 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12681 WHERE `menu_id`=21266 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12682 WHERE `menu_id`=21266 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12677 WHERE `menu_id`=21267 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12678 WHERE `menu_id`=21267 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12679 WHERE `menu_id`=21267 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12665 WHERE `menu_id`=21268 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12666 WHERE `menu_id`=21268 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12664 WHERE `menu_id`=21268 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12668 WHERE `menu_id`=21269 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12669 WHERE `menu_id`=21269 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12667 WHERE `menu_id`=21269 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12656 WHERE `menu_id`=21270 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=12655 WHERE `menu_id`=21270 AND `id`=2;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=11042 WHERE `menu_id`=21280 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=11054 WHERE `menu_id`=21286 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=15285 WHERE `menu_id`=21291 AND `id`=1;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=15315 WHERE `menu_id`=21295 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=11733 WHERE `menu_id`=21311 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5996 WHERE `menu_id`=21315 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=6245 WHERE `menu_id`=21323 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=6251 WHERE `menu_id`=21326 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=9847 WHERE `menu_id`=21333 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=10011 WHERE `menu_id`=21334 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=4754 WHERE `menu_id`=40060 AND `id`=0;
UPDATE `gossip_menu_option` SET `OptionBroadcastTextID`=5936 WHERE `menu_id`=55002 AND `id`=1;
@@ -42,18 +42,13 @@ class BroadcastTextBuilder
{
public:
BroadcastTextBuilder(WorldObject const* obj, ChatMsg msgtype, uint32 id, WorldObject const* target, uint32 gender = GENDER_MALE)
: _source(obj), _msgType(msgtype), _textId(id), _target(target), _gender(gender)
{
}
: _source(obj), _msgType(msgtype), _textId(id), _target(target), _gender(gender) { }
size_t operator()(WorldPacket* data, LocaleConstant locale) const
{
BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId);
std::string text = "";
if (bct)
ObjectMgr::GetLocaleString(_gender == GENDER_MALE ? bct->MaleText : bct->FemaleText, locale, text);
return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, text, 0, "", locale);
return ChatHandler::BuildChatPacket(*data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _source, _target, bct ? bct->GetText(locale, _gender) : "", 0, "", locale);
}
WorldObject const* _source;
@@ -53,12 +53,9 @@ namespace Trinity
void operator()(WorldPacket& data, LocaleConstant locale)
{
std::string text = "";
BroadcastText const* bct = sObjectMgr->GetBroadcastText(_textId);
if (bct)
ObjectMgr::GetLocaleString(_player->getGender() == GENDER_MALE ? bct->MaleText : bct->FemaleText, locale, text);
ChatHandler::BuildChatPacket(data, _msgType, LANG_UNIVERSAL, _player, _player, text, _achievementId);
ChatHandler::BuildChatPacket(data, _msgType, bct ? Language(bct->Language) : LANG_UNIVERSAL, _player, _player, bct ? bct->GetText(locale, _player->getGender()) : "", _achievementId);
}
private:
@@ -67,7 +64,7 @@ namespace Trinity
int32 _textId;
uint32 _achievementId;
};
} // namespace Trinity
} // namespace Trinity
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
{
+20 -6
View File
@@ -21,6 +21,7 @@
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "Creature.h"
#include "CreatureTextMgr.h"
#include "Chat.h"
#include "Formulas.h"
#include "GridNotifiersImpl.h"
@@ -102,13 +103,13 @@ namespace Trinity
int32 _arg1;
int32 _arg2;
};
} // namespace Trinity
} // namespace Trinity
template<class Do>
void Battleground::BroadcastWorker(Do& _do)
{
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
if (Player* player = _GetPlayer(itr, "BroadcastWorker"))
_do(player);
}
@@ -677,6 +678,11 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player*
}
}
void Battleground::SendChatMessage(Creature* source, uint8 textId, WorldObject* target /*= NULL*/)
{
sCreatureTextMgr->SendChat(source, textId, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
}
void Battleground::PlaySoundToAll(uint32 SoundID)
{
WorldPacket data;
@@ -1528,8 +1534,6 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, GetBgMap(),
PHASEMASK_NORMAL, x, y, z, o, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
TC_LOG_ERROR("sql.sql", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
TC_LOG_ERROR("bg.battleground", "Battleground::AddObject: cannot create gameobject (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete go;
@@ -1567,6 +1571,11 @@ bool Battleground::AddObject(uint32 type, uint32 entry, float x, float y, float
return true;
}
bool Battleground::AddObject(uint32 type, uint32 entry, Position const& pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime /*= 0*/)
{
return AddObject(type, entry, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), rotation0, rotation1, rotation2, rotation3, respawnTime);
}
// Some doors aren't despawned so we cannot handle their closing in gameobject::update()
// It would be nice to correctly implement GO_ACTIVATED state and open/close doors in gameobject code
void Battleground::DoorClose(uint32 type)
@@ -1686,7 +1695,12 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, f
if (respawntime)
creature->SetRespawnDelay(respawntime);
return creature;
return creature;
}
Creature* Battleground::AddCreature(uint32 entry, uint32 type, uint32 teamval, Position const& pos, uint32 respawntime /*= 0*/)
{
return AddCreature(entry, type, teamval, pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), respawntime);
}
bool Battleground::DelCreature(uint32 type)
@@ -1784,7 +1798,7 @@ void Battleground::SendWarningToAll(int32 entry, ...)
std::map<uint32, WorldPacket> localizedPackets;
for (BattlegroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
if (Player* player = _GetPlayer(itr, "SendWarningToAll"))
{
if (localizedPackets.find(player->GetSession()->GetSessionDbLocaleIndex()) == localizedPackets.end())
{
+7 -2
View File
@@ -28,9 +28,11 @@ class GameObject;
class Group;
class Player;
class Unit;
class WorldObject;
class WorldPacket;
class BattlegroundMap;
struct Position;
struct PvPDifficultyEntry;
struct WorldSafeLocsEntry;
@@ -419,6 +421,8 @@ class Battleground
void SendPacketToAll(WorldPacket* packet);
void YellToAll(Creature* creature, const char* text, uint32 language);
void SendChatMessage(Creature* source, uint8 textId, WorldObject* target = NULL);
template<class Do>
void BroadcastWorker(Do& _do);
@@ -483,8 +487,7 @@ class Battleground
virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) { }
void EventPlayerLoggedIn(Player* player);
void EventPlayerLoggedOut(Player* player);
virtual void EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/, uint32 /*eventType*/) { }
virtual void EventPlayerUsedGO(Player* /*player*/, GameObject* /*go*/){ }
virtual void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = NULL) { }
// this function can be used by spell to interact with the BG map
virtual void DoAction(uint32 /*action*/, uint64 /*var*/) { }
@@ -511,7 +514,9 @@ class Battleground
BGCreatures BgCreatures;
void SpawnBGObject(uint32 type, uint32 respawntime);
bool AddObject(uint32 type, uint32 entry, float x, float y, float z, float o, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0);
bool AddObject(uint32 type, uint32 entry, Position const& pos, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime = 0);
Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, float x, float y, float z, float o, uint32 respawntime = 0);
Creature* AddCreature(uint32 entry, uint32 type, uint32 teamval, Position const& pos, uint32 respawntime = 0);
bool DelCreature(uint32 type);
bool DelObject(uint32 type);
bool AddSpiritGuide(uint32 type, float x, float y, float z, float o, uint32 team);
@@ -842,8 +842,6 @@ void BattlegroundIC::DestroyGate(Player* player, GameObject* go)
SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP));
}
void BattlegroundIC::EventPlayerDamagedGO(Player* /*player*/, GameObject* /*go*/, uint32 /*eventType*/) { }
WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player)
{
TeamId teamIndex = GetTeamIndexByTeamId(player->GetTeam());
@@ -876,7 +876,6 @@ class BattlegroundIC : public Battleground
void EndBattleground(uint32 winner);
void EventPlayerClickedOnFlag(Player* source, GameObject* /*target_obj*/);
void EventPlayerDamagedGO(Player* /*player*/, GameObject* go, uint32 eventType);
void DestroyGate(Player* player, GameObject* go);
WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
@@ -17,10 +17,11 @@
*/
#include "BattlegroundSA.h"
#include "Language.h"
#include "Player.h"
#include "GameObject.h"
#include "Language.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "WorldPacket.h"
#include "WorldSession.h"
@@ -29,7 +30,8 @@ BattlegroundSA::BattlegroundSA()
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_SA_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_SA_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_SA_START_HALF_MINUTE;
StartMessageIds[BG_STARTING_EVENT_FOURTH] = LANG_BG_SA_HAS_BEGUN;
StartMessageIds[BG_STARTING_EVENT_FOURTH] = 0;
BgObjects.resize(BG_SA_MAXOBJ);
BgCreatures.resize(BG_SA_MAXNPC + BG_SA_MAX_GY);
TimerEnabled = false;
@@ -37,14 +39,14 @@ BattlegroundSA::BattlegroundSA()
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = false;
gateDestroyed = false;
_gateDestroyed = false;
Attackers = TEAM_ALLIANCE;
TotalTime = 0;
EndRoundTimer = 0;
ShipsStarted = false;
Status = BG_SA_NOTSTARTED;
Status = BG_SA_NOT_STARTED;
for (uint8 i = 0; i < 6; i++)
for (uint8 i = 0; i < MAX_GATES; ++i)
GateStatus[i] = BG_SA_GATE_OK;
for (uint8 i = 0; i < 2; i++)
@@ -69,7 +71,7 @@ void BattlegroundSA::Reset()
for (uint8 i = 0; i <= 5; i++)
GateStatus[i] = BG_SA_GATE_OK;
ShipsStarted = false;
gateDestroyed = false;
_gateDestroyed = false;
_allVehiclesAlive[TEAM_ALLIANCE] = true;
_allVehiclesAlive[TEAM_HORDE] = true;
Status = BG_SA_WARMUP;
@@ -101,9 +103,11 @@ bool BattlegroundSA::ResetObjs()
for (uint8 i = 0; i < 6; i++)
GateStatus[i] = BG_SA_GATE_OK;
AddCreature(BG_SA_NpcEntries[BG_SA_NPC_KANRETHAD], BG_SA_NPC_KANRETHAD, 0, BG_SA_NpcSpawnlocs[BG_SA_NPC_KANRETHAD]);
for (uint8 i = 0; i <= BG_SA_PORTAL_DEFFENDER_RED; i++)
{
if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
}
@@ -121,20 +125,17 @@ bool BattlegroundSA::ResetObjs()
default:
break;
}
if (!AddObject(i, boatid, BG_SA_ObjSpawnlocs[i][0],
BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2]+(Attackers ? -3.750f: 0),
BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY))
if (!AddObject(i, boatid, BG_SA_ObjSpawnlocs[i].GetPositionX(),
BG_SA_ObjSpawnlocs[i].GetPositionY(),
BG_SA_ObjSpawnlocs[i].GetPositionZ() + (Attackers ? -3.750f: 0),
BG_SA_ObjSpawnlocs[i].GetOrientation(), 0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
}
for (uint8 i = BG_SA_SIGIL_1; i <= BG_SA_LEFT_FLAGPOLE; i++)
{
if (!AddObject(i, BG_SA_ObjEntries[i],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY))
return false;
}
// MAD props for Kiper for discovering those values - 4 hours of his work.
@@ -147,10 +148,8 @@ bool BattlegroundSA::ResetObjs()
//By capturing GYs.
for (uint8 i = 0; i < BG_SA_DEMOLISHER_5; i++)
{
if (!AddCreature(BG_SA_NpcEntries[i], i, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1],
BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3], 600))
return false;
if (!AddCreature(BG_SA_NpcEntries[i], i, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), BG_SA_NpcSpawnlocs[i], 600))
return false;
}
OverrideGunFaction();
@@ -159,10 +158,10 @@ bool BattlegroundSA::ResetObjs()
for (uint8 i = 0; i <= BG_SA_PORTAL_DEFFENDER_RED; i++)
{
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, defF);
GetBGObject(i)->SetFaction(defF);
}
GetBGObject(BG_SA_TITAN_RELIC)->SetUInt32Value(GAMEOBJECT_FACTION, atF);
GetBGObject(BG_SA_TITAN_RELIC)->SetFaction(atF);
GetBGObject(BG_SA_TITAN_RELIC)->Refresh();
for (uint8 i = 0; i <= 5; i++)
@@ -199,20 +198,14 @@ bool BattlegroundSA::ResetObjs()
//GY capture points
for (uint8 i = BG_SA_CENTRAL_FLAG; i <= BG_SA_LEFT_FLAG; i++)
{
AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1 : 0)),
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF);
AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1 : 0)), BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetFaction(atF);
}
for (uint8 i = BG_SA_BOMB; i < BG_SA_MAXOBJ; i++)
{
AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB],
BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1],
BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3],
0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF);
AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB], BG_SA_ObjSpawnlocs[i], 0, 0, 0, 0, RESPAWN_ONE_DAY);
GetBGObject(i)->SetFaction(atF);
}
//Player may enter BEFORE we set up BG - lets update his worldstates anyway...
@@ -316,11 +309,14 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
}
TotalTime += diff;
if (Status == BG_SA_WARMUP )
if (Status == BG_SA_WARMUP)
{
EndRoundTimer = BG_SA_ROUNDLENGTH;
if (TotalTime >= BG_SA_WARMUPLENGTH)
{
if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD))
SendChatMessage(c, TEXT_ROUND_STARTED);
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
@@ -340,7 +336,9 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
if (TotalTime >= 60000)
{
SendWarningToAll(LANG_BG_SA_HAS_BEGUN);
if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD))
SendChatMessage(c, TEXT_ROUND_STARTED);
TotalTime = 0;
ToggleTimer();
DemolisherStartState(false);
@@ -380,6 +378,9 @@ void BattlegroundSA::PostUpdateImpl(uint32 diff)
InitSecondRound = true;
ToggleTimer();
ResetObjs();
GetBgMap()->UpdateAreaDependentAuras();
CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE);
CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE);
return;
}
}
@@ -412,42 +413,42 @@ void BattlegroundSA::StartingEventOpenDoors() { }
void BattlegroundSA::FillInitialWorldStates(WorldPacket& data)
{
uint32 ally_attacks = uint32(Attackers == TEAM_ALLIANCE ? 1 : 0);
uint32 horde_attacks = uint32(Attackers == TEAM_HORDE ? 1 : 0);
bool allyAttacks = Attackers == TEAM_ALLIANCE;
bool hordeAttacks = Attackers == TEAM_HORDE;
data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]);
data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]);
data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]);
data << uint32(BG_SA_BLUE_GATEWS) << uint32(GateStatus[BG_SA_BLUE_GATE]);
data << uint32(BG_SA_RED_GATEWS) << uint32(GateStatus[BG_SA_RED_GATE]);
data << uint32(BG_SA_PURPLE_GATEWS) << uint32(GateStatus[BG_SA_PURPLE_GATE]);
data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]);
data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]);
data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]);
data << uint32(BG_SA_BLUE_GATEWS) << uint32(GateStatus[BG_SA_BLUE_GATE]);
data << uint32(BG_SA_RED_GATEWS) << uint32(GateStatus[BG_SA_RED_GATE]);
data << uint32(BG_SA_PURPLE_GATEWS) << uint32(GateStatus[BG_SA_PURPLE_GATE]);
data << uint32(BG_SA_BONUS_TIMER) << uint32(0);
data << uint32(BG_SA_BONUS_TIMER) << uint32(0);
data << uint32(BG_SA_HORDE_ATTACKS) << horde_attacks;
data << uint32(BG_SA_ALLY_ATTACKS) << ally_attacks;
data << uint32(BG_SA_HORDE_ATTACKS) << uint32(hordeAttacks);
data << uint32(BG_SA_ALLY_ATTACKS) << uint32(allyAttacks);
//Time will be sent on first update...
data << uint32(BG_SA_ENABLE_TIMER) << ((TimerEnabled) ? uint32(1) : uint32(0));
data << uint32(BG_SA_TIMER_MINS) << uint32(0);
data << uint32(BG_SA_TIMER_SEC_TENS) << uint32(0);
data << uint32(BG_SA_TIMER_SEC_DECS) << uint32(0);
// Time will be sent on first update...
data << uint32(BG_SA_ENABLE_TIMER) << uint32(TimerEnabled);
data << uint32(BG_SA_TIMER_MINS) << uint32(0);
data << uint32(BG_SA_TIMER_SEC_TENS) << uint32(0);
data << uint32(BG_SA_TIMER_SEC_DECS) << uint32(0);
data << uint32(BG_SA_RIGHT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
data << uint32(BG_SA_LEFT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
data << uint32(BG_SA_CENTER_GY_HORDE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE ? 1 : 0);
data << uint32(BG_SA_RIGHT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_HORDE);
data << uint32(BG_SA_LEFT_GY_HORDE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_HORDE);
data << uint32(BG_SA_CENTER_GY_HORDE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_HORDE);
data << uint32(BG_SA_RIGHT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
data << uint32(BG_SA_LEFT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
data << uint32(BG_SA_CENTER_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE ? 1 : 0);
data << uint32(BG_SA_RIGHT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_RIGHT_CAPTURABLE_GY] == TEAM_ALLIANCE);
data << uint32(BG_SA_LEFT_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_LEFT_CAPTURABLE_GY] == TEAM_ALLIANCE);
data << uint32(BG_SA_CENTER_GY_ALLIANCE) << uint32(GraveyardStatus[BG_SA_CENTRAL_CAPTURABLE_GY] == TEAM_ALLIANCE);
data << uint32(BG_SA_HORDE_DEFENCE_TOKEN) << ally_attacks;
data << uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN) << horde_attacks;
data << uint32(BG_SA_HORDE_DEFENCE_TOKEN) << uint32(allyAttacks);
data << uint32(BG_SA_ALLIANCE_DEFENCE_TOKEN) << uint32(hordeAttacks);
data << uint32(BG_SA_LEFT_ATT_TOKEN_HRD) << horde_attacks;
data << uint32(BG_SA_RIGHT_ATT_TOKEN_HRD) << horde_attacks;
data << uint32(BG_SA_RIGHT_ATT_TOKEN_ALL) << ally_attacks;
data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << ally_attacks;
data << uint32(BG_SA_LEFT_ATT_TOKEN_HRD) << uint32(hordeAttacks);
data << uint32(BG_SA_RIGHT_ATT_TOKEN_HRD) << uint32(hordeAttacks);
data << uint32(BG_SA_RIGHT_ATT_TOKEN_ALL) << uint32(allyAttacks);
data << uint32(BG_SA_LEFT_ATT_TOKEN_ALL) << uint32(allyAttacks);
}
void BattlegroundSA::AddPlayer(Player* player)
@@ -455,12 +456,15 @@ void BattlegroundSA::AddPlayer(Player* player)
Battleground::AddPlayer(player);
//create score and add it to map, default values are set in constructor
BattlegroundSAScore* sc = new BattlegroundSAScore;
PlayerScores[player->GetGUID()] = sc;
SendTransportInit(player);
if (!ShipsStarted)
{
if (player->GetTeamId() == Attackers)
{
player->CastSpell(player, 12438, true);//Without this player falls before boat loads...
player->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
if (urand(0, 1))
player->TeleportTo(607, 2682.936f, -830.368f, 15.0f, 2.895f, 0);
@@ -478,8 +482,6 @@ void BattlegroundSA::AddPlayer(Player* player)
else
player->TeleportTo(607, 1209.7f, -65.16f, 70.1f, 0.0f, 0);
}
SendTransportInit(player);
PlayerScores[player->GetGUID()] = sc;
}
void BattlegroundSA::RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) { }
@@ -530,7 +532,7 @@ void BattlegroundSA::TeleportPlayers()
if (player->GetTeamId() == Attackers)
{
player->CastSpell(player, 12438, true); //Without this player falls before boat loads...
player->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT);
if (urand(0, 1))
player->TeleportTo(607, 2682.936f, -830.368f, 15.0f, 2.895f, 0);
@@ -543,30 +545,91 @@ void BattlegroundSA::TeleportPlayers()
}
}
void BattlegroundSA::EventPlayerDamagedGO(Player* /*player*/, GameObject* go, uint32 eventType)
void BattlegroundSA::ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject* invoker /*= NULL*/)
{
if (!go || !go->GetGOInfo())
return;
if (eventType == go->GetGOInfo()->building.damagedEvent)
if (GameObject* go = obj->ToGameObject())
{
uint32 i = getGateIdFromDamagedOrDestroyEventId(eventType);
GateStatus[i] = BG_SA_GATE_DAMAGED;
uint32 uws = getWorldStateFromGateId(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
}
switch (go->GetGoType())
{
case GAMEOBJECT_TYPE_GOOBER:
if (eventId == BG_SA_EVENT_TITAN_RELIC_ACTIVATED)
TitanRelicActivated(invoker->ToPlayer());
break;
case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
{
if (GateInfo const* gate = GetGate(obj->GetEntry()))
{
uint8 gateId = gate->GateId;
if (eventType == go->GetGOInfo()->building.destroyedEvent)
{
if (go->GetGOInfo()->building.destroyedEvent == BG_SA_EVENT_ANCIENT_GATE_DESTROYED)
SendWarningToAll(LANG_BG_SA_CHAMBER_BREACHED);
else
SendWarningToAll(LANG_BG_SA_WAS_DESTROYED, go->GetGOInfo()->name.c_str());
}
// damaged
if (eventId == go->GetGOInfo()->building.damagedEvent)
{
GateStatus[gateId] = BG_SA_GATE_DAMAGED;
if (eventType == go->GetGOInfo()->building.damageEvent)
SendWarningToAll(LANG_BG_SA_IS_UNDER_ATTACK, go->GetGOInfo()->name.c_str());
if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, gate->DamagedText, invoker);
PlaySoundToAll(Attackers == ALLIANCE ? SOUND_WALL_ATTACKED_ALLIANCE : SOUND_WALL_ATTACKED_HORDE);
}
// destroyed
else if (eventId == go->GetGOInfo()->building.destroyedEvent)
{
GateStatus[gate->GateId] = BG_SA_GATE_DESTROYED;
_gateDestroyed = true;
bool rewardHonor = true;
switch (gateId)
{
case BG_SA_GREEN_GATE:
if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_BLUE_GATE:
if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_RED_GATE:
if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_PURPLE_GATE:
if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
default:
break;
}
if (gateId < 5)
DelObject(gateId + 14);
if (Unit* unit = invoker->ToUnit())
{
if (Player* player = unit->GetCharmerOrOwnerPlayerOrPlayerItself())
{
UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1);
if (rewardHonor)
UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1));
}
}
if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, gate->DestroyedText, invoker);
PlaySoundToAll(Attackers == ALLIANCE ? SOUND_WALL_DESTROYED_ALLIANCE : SOUND_WALL_DESTROYED_HORDE);
}
else
break;
UpdateWorldState(gate->WorldState, GateStatus[gateId]);
}
break;
}
default:
break;
}
}
}
void BattlegroundSA::HandleKillUnit(Creature* creature, Player* killer)
@@ -620,49 +683,6 @@ void BattlegroundSA::DemolisherStartState(bool start)
void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
{
uint32 i = getGateIdFromDamagedOrDestroyEventId(go->GetGOInfo()->building.destroyedEvent);
if (!GateStatus[i])
return;
if (GameObject* g = GetBGObject(i))
{
if (g->GetGOValue()->Building.Health == 0)
{
GateStatus[i] = BG_SA_GATE_DESTROYED;
uint32 uws = getWorldStateFromGateId(i);
if (uws)
UpdateWorldState(uws, GateStatus[i]);
bool rewardHonor = true;
gateDestroyed = true;
switch (i)
{
case BG_SA_GREEN_GATE:
if (GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_BLUE_GATE:
if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_RED_GATE:
if (GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
case BG_SA_PURPLE_GATE:
if (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED)
rewardHonor = false;
break;
default:
break;
}
if (i < 5)
DelObject(i + 14);
UpdatePlayerScore(player, SCORE_DESTROYED_WALL, 1);
if (rewardHonor)
UpdatePlayerScore(player, SCORE_BONUS_HONOR, GetBonusHonorFromKill(1));
}
}
}
WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player)
@@ -708,24 +728,24 @@ void BattlegroundSA::SendTime()
UpdateWorldState(BG_SA_TIMER_SEC_DECS, ((end_of_round%60000)%10000)/1000);
}
void BattlegroundSA::EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj)
void BattlegroundSA::EventPlayerClickedOnFlag(Player* source, GameObject* go)
{
switch (target_obj->GetEntry())
switch (go->GetEntry())
{
case 191307:
case 191308:
if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY, Source);
CaptureGraveyard(BG_SA_LEFT_CAPTURABLE_GY, source);
break;
case 191305:
case 191306:
if (GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED)
CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY, Source);
CaptureGraveyard(BG_SA_RIGHT_CAPTURABLE_GY, source);
break;
case 191310:
case 191309:
if ((GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED) && (GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED))
CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY, Source);
CaptureGraveyard(BG_SA_CENTRAL_CAPTURABLE_GY, source);
break;
default:
return;
@@ -756,19 +776,16 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
flag = BG_SA_LEFT_FLAG;
DelObject(flag);
AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0 : 1)),
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);
BG_SA_ObjSpawnlocs[flag], 0, 0, 0, 0, RESPAWN_ONE_DAY);
npc = BG_SA_NPC_RIGSPARK;
AddCreature(BG_SA_NpcEntries[npc], npc, Attackers,
BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1],
BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]);
if (Creature* rigspark = AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, BG_SA_NpcSpawnlocs[npc]))
rigspark->AI()->Talk(TEXT_SPARKLIGHT_RIGSPARK_SPAWN);
for (uint8 j = BG_SA_DEMOLISHER_7; j <= BG_SA_DEMOLISHER_8; j++)
{
AddCreature(BG_SA_NpcEntries[j], j, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
BG_SA_NpcSpawnlocs[j][0], BG_SA_NpcSpawnlocs[j][1],
BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600);
BG_SA_NpcSpawnlocs[j], 600);
if (Creature* dem = GetBGCreature(j))
dem->setFaction(BG_SA_Factions[Attackers]);
@@ -776,28 +793,25 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
UpdateWorldState(BG_SA_LEFT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
if (Source->GetTeamId() == TEAM_ALLIANCE)
SendWarningToAll(LANG_BG_SA_A_GY_WEST);
else
SendWarningToAll(LANG_BG_SA_H_GY_WEST);
if (Creature* c = Source->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, Source->GetTeamId() == TEAM_ALLIANCE ? TEXT_WEST_GRAVEYARD_CAPTURED_A : TEXT_WEST_GRAVEYARD_CAPTURED_H, Source);
break;
case BG_SA_RIGHT_CAPTURABLE_GY:
flag = BG_SA_RIGHT_FLAG;
DelObject(flag);
AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0 : 1)),
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);
BG_SA_ObjSpawnlocs[flag], 0, 0, 0, 0, RESPAWN_ONE_DAY);
npc = BG_SA_NPC_SPARKLIGHT;
AddCreature(BG_SA_NpcEntries[npc], npc, Attackers,
BG_SA_NpcSpawnlocs[npc][0], BG_SA_NpcSpawnlocs[npc][1],
BG_SA_NpcSpawnlocs[npc][2], BG_SA_NpcSpawnlocs[npc][3]);
if (Creature* sparklight = AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, BG_SA_NpcSpawnlocs[npc]))
sparklight->AI()->Talk(TEXT_SPARKLIGHT_RIGSPARK_SPAWN);
for (uint8 j = BG_SA_DEMOLISHER_5; j <= BG_SA_DEMOLISHER_6; j++)
{
AddCreature(BG_SA_NpcEntries[j], j, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE),
BG_SA_NpcSpawnlocs[j][0], BG_SA_NpcSpawnlocs[j][1],
BG_SA_NpcSpawnlocs[j][2], BG_SA_NpcSpawnlocs[j][3], 600);
BG_SA_NpcSpawnlocs[j], 600);
if (Creature* dem = GetBGCreature(j))
dem->setFaction(BG_SA_Factions[Attackers]);
@@ -805,24 +819,23 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
UpdateWorldState(BG_SA_RIGHT_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 1 : 0));
UpdateWorldState(BG_SA_RIGHT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE ? 0 : 1));
if (Source->GetTeamId() == TEAM_ALLIANCE)
SendWarningToAll(LANG_BG_SA_A_GY_EAST);
else
SendWarningToAll(LANG_BG_SA_H_GY_EAST);
if (Creature* c = Source->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, Source->GetTeamId() == TEAM_ALLIANCE ? TEXT_EAST_GRAVEYARD_CAPTURED_A : TEXT_EAST_GRAVEYARD_CAPTURED_H, Source);
break;
case BG_SA_CENTRAL_CAPTURABLE_GY:
flag = BG_SA_CENTRAL_FLAG;
DelObject(flag);
AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0 : 1)),
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);
BG_SA_ObjSpawnlocs[flag], 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));
if (Source->GetTeamId() == TEAM_ALLIANCE)
SendWarningToAll(LANG_BG_SA_A_GY_SOUTH);
else
SendWarningToAll(LANG_BG_SA_H_GY_SOUTH);
if (Creature* c = Source->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, Source->GetTeamId() == TEAM_ALLIANCE ? TEXT_SOUTH_GRAVEYARD_CAPTURED_A : TEXT_SOUTH_GRAVEYARD_CAPTURED_H, Source);
break;
default:
ASSERT(false);
@@ -830,25 +843,28 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player* Source)
};
}
void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
void BattlegroundSA::TitanRelicActivated(Player* clicker)
{
if (object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC] &&
GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED &&
if (!clicker)
return;
if (GateStatus[BG_SA_ANCIENT_GATE] == BG_SA_GATE_DESTROYED &&
GateStatus[BG_SA_YELLOW_GATE] == BG_SA_GATE_DESTROYED &&
(GateStatus[BG_SA_PURPLE_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_RED_GATE] == BG_SA_GATE_DESTROYED) &&
(GateStatus[BG_SA_GREEN_GATE] == BG_SA_GATE_DESTROYED || GateStatus[BG_SA_BLUE_GATE] == BG_SA_GATE_DESTROYED))
{
if (Source->GetTeamId() == Attackers)
if (clicker->GetTeamId() == Attackers)
{
if (Source->GetTeamId() == TEAM_ALLIANCE)
if (clicker->GetTeamId() == TEAM_ALLIANCE)
SendMessageToAll(LANG_BG_SA_ALLIANCE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
else
SendMessageToAll(LANG_BG_SA_HORDE_CAPTURED_RELIC, CHAT_MSG_BG_SYSTEM_NEUTRAL);
if (Status == BG_SA_ROUND_ONE)
{
RoundScores[0].winner = Attackers;
RoundScores[0].time = TotalTime;
//Achievement Storm the Beach (1310)
// Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
@@ -860,19 +876,25 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
Status = BG_SA_SECOND_WARMUP;
TotalTime = 0;
ToggleTimer();
SendWarningToAll(LANG_BG_SA_ROUND_ONE_END);
if (Creature* c = GetBGCreature(BG_SA_NPC_KANRETHAD))
SendChatMessage(c, TEXT_ROUND_1_FINISHED);
UpdateWaitTimer = 5000;
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = true;
ResetObjs();
GetBgMap()->UpdateAreaDependentAuras();
CastSpellOnTeam(SPELL_END_OF_ROUND, ALLIANCE);
CastSpellOnTeam(SPELL_END_OF_ROUND, HORDE);
}
else if (Status == BG_SA_ROUND_TWO)
{
RoundScores[1].winner = Attackers;
RoundScores[1].time = TotalTime;
ToggleTimer();
//Achievement Storm the Beach (1310)
// Achievement Storm the Beach (1310)
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
@@ -894,18 +916,18 @@ void BattlegroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
void BattlegroundSA::ToggleTimer()
{
TimerEnabled = !TimerEnabled;
UpdateWorldState(BG_SA_ENABLE_TIMER, (TimerEnabled) ? 1 : 0);
UpdateWorldState(BG_SA_ENABLE_TIMER, TimerEnabled);
}
void BattlegroundSA::EndBattleground(uint32 winner)
{
//honor reward for winning
// honor reward for winning
if (winner == ALLIANCE)
RewardHonorToTeam(GetBonusHonorFromKill(1), ALLIANCE);
else if (winner == HORDE)
RewardHonorToTeam(GetBonusHonorFromKill(1), HORDE);
//complete map_end rewards (even if no team wins)
// complete map_end rewards (even if no team wins)
RewardHonorToTeam(GetBonusHonorFromKill(2), ALLIANCE);
RewardHonorToTeam(GetBonusHonorFromKill(2), HORDE);
@@ -931,9 +953,7 @@ void BattlegroundSA::UpdateDemolisherSpawns()
{
if (DemoliserRespawnList[i] < getMSTime())
{
Demolisher->Relocate(BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1],
BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3]);
Demolisher->Relocate(BG_SA_NpcSpawnlocs[i]);
Demolisher->Respawn();
DemoliserRespawnList.erase(i);
}
@@ -982,8 +1002,25 @@ bool BattlegroundSA::CheckAchievementCriteriaMeet(uint32 criteriaId, Player cons
case BG_CRITERIA_CHECK_NOT_EVEN_A_SCRATCH:
return _allVehiclesAlive[GetTeamIndexByTeamId(source->GetTeam())];
case BG_CRITERIA_CHECK_DEFENSE_OF_THE_ANCIENTS:
return source->GetTeamId() != Attackers && !gateDestroyed;
return source->GetTeamId() != Attackers && !_gateDestroyed;
}
return Battleground::CheckAchievementCriteriaMeet(criteriaId, source, target, miscValue);
}
bool BattlegroundSA::IsSpellAllowed(uint32 spellId, Player const* /*player*/) const
{
switch (spellId)
{
case SPELL_ALLIANCE_CONTROL_PHASE_SHIFT:
return Attackers == TEAM_HORDE;
case SPELL_HORDE_CONTROL_PHASE_SHIFT:
return Attackers == TEAM_ALLIANCE;
case SPELL_PREPARATION:
return Status == BG_SA_WARMUP || Status == BG_SA_SECOND_WARMUP;
default:
break;
}
return true;
}
@@ -23,7 +23,7 @@
struct BattlegroundSAScore : public BattlegroundScore
{
BattlegroundSAScore(): demolishers_destroyed(0), gates_destroyed(0) { }
BattlegroundSAScore() : demolishers_destroyed(0), gates_destroyed(0) { }
~BattlegroundSAScore() { }
uint8 demolishers_destroyed;
uint8 gates_destroyed;
@@ -34,7 +34,7 @@ struct BattlegroundSAScore : public BattlegroundScore
enum BG_SA_Status
{
BG_SA_NOTSTARTED = 0,
BG_SA_NOT_STARTED = 0,
BG_SA_WARMUP,
BG_SA_ROUND_ONE,
BG_SA_SECOND_WARMUP,
@@ -49,7 +49,7 @@ enum BG_SA_GateState
BG_SA_GATE_DESTROYED = 3
};
enum BG_SA_EventIdGate
enum BG_SA_EventIds
{
BG_SA_EVENT_BLUE_GATE_DAMAGED = 19040,
BG_SA_EVENT_BLUE_GATE_DESTROYED = 19045,
@@ -67,7 +67,42 @@ enum BG_SA_EventIdGate
BG_SA_EVENT_YELLOW_GATE_DESTROYED = 19049,
BG_SA_EVENT_ANCIENT_GATE_DAMAGED = 19836,
BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837
BG_SA_EVENT_ANCIENT_GATE_DESTROYED = 19837,
BG_SA_EVENT_TITAN_RELIC_ACTIVATED = 22097
};
enum SASpellIds
{
SPELL_TELEPORT_DEFENDER = 52364,
SPELL_TELEPORT_ATTACKERS = 60178,
SPELL_END_OF_ROUND = 52459,
SPELL_REMOVE_SEAFORIUM = 59077,
SPELL_ALLIANCE_CONTROL_PHASE_SHIFT = 60027,
SPELL_HORDE_CONTROL_PHASE_SHIFT = 60028
};
enum SACreatureIds
{
NPC_KANRETHAD = 29,
NPC_INVISIBLE_STALKER = 15214,
NPC_WORLD_TRIGGER = 22515,
NPC_WORLD_TRIGGER_LARGE_AOI_NOT_IMMUNE_PC_NPC = 23472,
NPC_ANTI_PERSONNAL_CANNON = 27894,
NPC_DEMOLISHER_SA = 28781,
NPC_RIGGER_SPARKLIGHT = 29260,
NPC_GORGRIL_RIGSPARK = 29262
};
enum SAGameObjectIds
{
GO_GATE_OF_THE_GREEN_EMERALD = 190722,
GO_GATE_OF_THE_PURPLE_AMETHYST = 190723,
GO_GATE_OF_THE_BLUE_SAPPHIRE = 190724,
GO_GATE_OF_THE_RED_SUN = 190726,
GO_GATE_OF_THE_YELLOW_MOON = 190727,
GO_CHAMBER_OF_ANCIENT_RELICS = 192549,
};
enum BG_SA_Timers
@@ -77,7 +112,51 @@ enum BG_SA_Timers
BG_SA_ROUNDLENGTH = 600 * IN_MILLISECONDS
};
enum BG_SA_WorldStates
enum SASounds
{
SOUND_GRAVEYARD_TAKEN_HORDE = 8174,
SOUND_GRAVEYARD_TAKEN_ALLIANCE = 8212,
SOUND_DEFEAT_HORDE = 15905,
SOUND_VICTORY_HORDE = 15906,
SOUND_VICTORY_ALLIANCE = 15907,
SOUND_DEFEAT_ALLIANCE = 15908,
SOUND_WALL_DESTROYED_ALLIANCE = 15909,
SOUND_WALL_DESTROYED_HORDE = 15910,
SOUND_WALL_ATTACKED_HORDE = 15911,
SOUND_WALL_ATTACKED_ALLIANCE = 15912
};
enum SATexts
{
// Kanrethad
TEXT_ROUND_STARTED = 1,
TEXT_ROUND_1_FINISHED = 2,
// Rigger Sparklight / Gorgril Rigspark
TEXT_SPARKLIGHT_RIGSPARK_SPAWN = 1,
// World Trigger
TEXT_BLUE_GATE_UNDER_ATTACK = 1,
TEXT_GREEN_GATE_UNDER_ATTACK = 2,
TEXT_RED_GATE_UNDER_ATTACK = 3,
TEXT_PURPLE_GATE_UNDER_ATTACK = 4,
TEXT_YELLOW_GATE_UNDER_ATTACK = 5,
TEXT_YELLOW_GATE_DESTROYED = 6,
TEXT_PURPLE_GATE_DESTROYED = 7,
TEXT_RED_GATE_DESTROYED = 8,
TEXT_GREEN_GATE_DESTROYED = 9,
TEXT_BLUE_GATE_DESTROYED = 10,
TEXT_EAST_GRAVEYARD_CAPTURED_A = 11,
TEXT_WEST_GRAVEYARD_CAPTURED_A = 12,
TEXT_SOUTH_GRAVEYARD_CAPTURED_A = 13,
TEXT_EAST_GRAVEYARD_CAPTURED_H = 14,
TEXT_WEST_GRAVEYARD_CAPTURED_H = 15,
TEXT_SOUTH_GRAVEYARD_CAPTURED_H = 16,
TEXT_ANCIENT_GATE_UNDER_ATTACK = 17,
TEXT_ANCIENT_GATE_DESTROYED = 18
};
enum SAWorldStates
{
BG_SA_TIMER_MINS = 3559,
BG_SA_TIMER_SEC_TENS = 3560,
@@ -102,20 +181,12 @@ enum BG_SA_WorldStates
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_BONUS_TIMER = 3571,
BG_SA_ENABLE_TIMER = 3564
};
enum npc
{
NPC_ANTI_PERSONNAL_CANNON = 27894,
NPC_DEMOLISHER_SA = 28781,
NPC_RIGGER_SPARKLIGHT = 29260,
NPC_GORGRIL_RIGSPARK = 29262
};
enum BG_SA_NPCs
{
{
BG_SA_GUN_1 = 0,
BG_SA_GUN_2,
BG_SA_GUN_3,
@@ -126,11 +197,6 @@ enum BG_SA_NPCs
BG_SA_GUN_8,
BG_SA_GUN_9,
BG_SA_GUN_10,
BG_SA_NPC_TRIGGER_1,
BG_SA_NPC_TRIGGER_2,
BG_SA_NPC_TRIGGER_3,
BG_SA_NPC_TRIGGER_4,
BG_SA_NPC_TRIGGER_5,
BG_SA_DEMOLISHER_1,
BG_SA_DEMOLISHER_2,
BG_SA_DEMOLISHER_3,
@@ -141,8 +207,9 @@ enum BG_SA_NPCs
BG_SA_DEMOLISHER_8,
BG_SA_NPC_SPARKLIGHT,
BG_SA_NPC_RIGSPARK,
BG_SA_NPC_KANRETHAD,
BG_SA_MAXNPC
};
};
enum BG_SA_Boat
{
@@ -164,12 +231,6 @@ uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] =
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
NPC_ANTI_PERSONNAL_CANNON,
// Triggers
23472,
23472,
23472,
23472,
23472,
// 4 beach demolishers
NPC_DEMOLISHER_SA,
NPC_DEMOLISHER_SA,
@@ -182,10 +243,12 @@ uint32 const BG_SA_NpcEntries[BG_SA_MAXNPC] =
NPC_DEMOLISHER_SA,
// Used Demolisher Salesman
NPC_RIGGER_SPARKLIGHT,
NPC_GORGRIL_RIGSPARK
NPC_GORGRIL_RIGSPARK,
// Kanrethad
NPC_KANRETHAD
};
float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
Position const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT] =
{
// Cannons
{ 1436.429f, 110.05f, 41.407f, 5.4f },
@@ -198,12 +261,6 @@ float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
{ 1249.634f, -224.189f, 66.72f, 0.635f },
{ 1236.213f, 92.287f, 64.965f, 5.751f },
{ 1215.11f, 57.772f, 64.739f, 5.78f },
// Triggers
{ 1453.49f, -250.453f, 30.896f, 4.2883f},
{ 1377.05f, 97.036f, 30.8605f, 2.46539f},
{ 1186.05f, 58.8048f, 56.5491f, 2.75992f},
{ 1042.83f, -72.839f, 84.8145f, 3.58615f},
{ 1233.62f, -250.49f, 55.4036f, 3.7016f},
// Demolishers
{ 1611.597656f, -117.270073f, 8.719355f, 2.513274f},
{ 1575.562500f, -158.421875f, 5.024450f, 2.129302f},
@@ -216,7 +273,8 @@ float const BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] =
{ 1404.809570f, 197.027237f, 32.046032f, 3.605401f},
// Npcs
{ 1348.644165f, -298.786469f, 31.080130f, 1.710423f},
{ 1358.191040f, 195.527786f, 31.018187f, 4.171337f}
{ 1358.191040f, 195.527786f, 31.018187f, 4.171337f},
{ 841.921f, -134.194f, 196.838f, 6.23082f }
};
enum BG_SA_Objects
@@ -250,7 +308,7 @@ enum BG_SA_Objects
BG_SA_MAXOBJ = BG_SA_BOMB+68
};
float const BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] =
Position const BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ] =
{
{ 1411.57f, 108.163f, 28.692f, 5.441f },
{ 1055.452f, -108.1f, 82.134f, 0.034f },
@@ -430,6 +488,26 @@ float const BG_SA_GYOrientation[BG_SA_MAX_GY] =
6.148f, // defender last GY
};
struct GateInfo
{
uint8 GateId;
uint32 GameObjectId;
uint32 WorldState;
uint8 DamagedText;
uint8 DestroyedText;
};
#define MAX_GATES 6
GateInfo const Gates[MAX_GATES] =
{
{ BG_SA_GREEN_GATE, GO_GATE_OF_THE_GREEN_EMERALD, BG_SA_GREEN_GATEWS, TEXT_GREEN_GATE_UNDER_ATTACK, TEXT_GREEN_GATE_DESTROYED },
{ BG_SA_YELLOW_GATE, GO_GATE_OF_THE_YELLOW_MOON, BG_SA_YELLOW_GATEWS, TEXT_YELLOW_GATE_UNDER_ATTACK, TEXT_YELLOW_GATE_DESTROYED },
{ BG_SA_BLUE_GATE, GO_GATE_OF_THE_BLUE_SAPPHIRE, BG_SA_BLUE_GATEWS, TEXT_BLUE_GATE_UNDER_ATTACK, TEXT_BLUE_GATE_DESTROYED },
{ BG_SA_RED_GATE, GO_GATE_OF_THE_RED_SUN, BG_SA_RED_GATEWS, TEXT_RED_GATE_UNDER_ATTACK, TEXT_RED_GATE_DESTROYED },
{ BG_SA_PURPLE_GATE, GO_GATE_OF_THE_PURPLE_AMETHYST, BG_SA_PURPLE_GATEWS, TEXT_PURPLE_GATE_UNDER_ATTACK, TEXT_PURPLE_GATE_DESTROYED },
{ BG_SA_ANCIENT_GATE, GO_CHAMBER_OF_ANCIENT_RELICS, BG_SA_ANCIENT_GATEWS, TEXT_ANCIENT_GATE_UNDER_ATTACK, TEXT_ANCIENT_GATE_DESTROYED }
};
struct BG_SA_RoundScore
{
TeamId winner;
@@ -461,77 +539,30 @@ class BattlegroundSA : public Battleground
void Reset();
/// Called for generate packet contain worldstate data
void FillInitialWorldStates(WorldPacket& data);
/// Called when a player deal damage to building (door)
void EventPlayerDamagedGO(Player* player, GameObject* go, uint32 eventType);
/// Called when a player kill a unit in bg
void HandleKillUnit(Creature* creature, Player* killer);
/// Return the nearest graveyard where player can respawn
WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
/// Called when someone activates an event
void ProcessEvent(WorldObject* /*obj*/, uint32 /*eventId*/, WorldObject* /*invoker*/ = NULL) OVERRIDE;
/// Called when a player click on flag (graveyard flag)
void EventPlayerClickedOnFlag(Player* Source, GameObject* target_obj);
/// Called when a player use a gamobject (relic)
void EventPlayerUsedGO(Player* Source, GameObject* object);
/// Return gate id, relative to bg data, according to gameobject id
uint32 getGateIdFromDamagedOrDestroyEventId(uint32 id)
void EventPlayerClickedOnFlag(Player* source, GameObject* go);
/// Called when a player clicked on relic
void TitanRelicActivated(Player* clicker);
/// Return GateInfo, relative to bg data, according to gameobject entry
GateInfo const* GetGate(uint32 entry)
{
switch (id)
{
// Green gate
case BG_SA_EVENT_GREEN_GATE_DAMAGED:
case BG_SA_EVENT_GREEN_GATE_DESTROYED:
return BG_SA_GREEN_GATE;
// Blue gate
case BG_SA_EVENT_BLUE_GATE_DAMAGED:
case BG_SA_EVENT_BLUE_GATE_DESTROYED:
return BG_SA_BLUE_GATE;
// Red gate
case BG_SA_EVENT_RED_GATE_DAMAGED:
case BG_SA_EVENT_RED_GATE_DESTROYED:
return BG_SA_RED_GATE;
// Purple gate
case BG_SA_EVENT_PURPLE_GATE_DAMAGED:
case BG_SA_EVENT_PURPLE_GATE_DESTROYED:
return BG_SA_PURPLE_GATE;
// Yellow gate
case BG_SA_EVENT_YELLOW_GATE_DAMAGED:
case BG_SA_EVENT_YELLOW_GATE_DESTROYED:
return BG_SA_YELLOW_GATE;
// Ancient gate
case BG_SA_EVENT_ANCIENT_GATE_DAMAGED:
case BG_SA_EVENT_ANCIENT_GATE_DESTROYED:
return BG_SA_ANCIENT_GATE;
default:
break;
}
return 0;
}
/// Return worldstate id, according to door id
uint32 getWorldStateFromGateId(uint32 id)
{
switch (id)
{
case BG_SA_GREEN_GATE:
return BG_SA_GREEN_GATEWS;
case BG_SA_YELLOW_GATE:
return BG_SA_YELLOW_GATEWS;
case BG_SA_BLUE_GATE:
return BG_SA_BLUE_GATEWS;
case BG_SA_RED_GATE:
return BG_SA_RED_GATEWS;
case BG_SA_PURPLE_GATE:
return BG_SA_PURPLE_GATEWS;
case BG_SA_ANCIENT_GATE:
return BG_SA_ANCIENT_GATEWS;
default:
break;
}
return 0;
for (uint8 i = 0; i < MAX_GATES; ++i)
if (Gates[i].GameObjectId == entry)
return &Gates[i];
return NULL;
}
/// Called on battleground ending
void EndBattleground(uint32 winner);
/// CAlled when a player leave battleground
/// Called when a player leave battleground
void RemovePlayer(Player* player, uint64 guid, uint32 team);
void HandleAreaTrigger(Player* Source, uint32 Trigger);
@@ -539,14 +570,11 @@ class BattlegroundSA : public Battleground
/// Update score board
void UpdatePlayerScore(Player* Source, uint32 type, uint32 value, bool doAddHonor = true);
// Achievement: Defense of the Ancients
bool gateDestroyed;
// Achievement: Not Even a Scratch
bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscvalue1 = 0);
bool CheckAchievementCriteriaMeet(uint32 criteriaId, Player const* source, Unit const* target = NULL, uint32 miscValue = 0) OVERRIDE;
/// Id of attacker team
TeamId Attackers;
// Control Phase Shift
bool IsSpellAllowed(uint32 spellId, Player const* player) const OVERRIDE;
private:
@@ -600,6 +628,9 @@ class BattlegroundSA : public Battleground
/// Send packet to player for destroy boats (client part)
void SendTransportsRemove(Player* player);
/// Id of attacker team
TeamId Attackers;
/// Totale elapsed time of current round
uint32 TotalTime;
/// Max time of round
@@ -607,7 +638,7 @@ class BattlegroundSA : public Battleground
/// For know if boats has start moving or not yet
bool ShipsStarted;
/// Status of each gate (Destroy/Damage/Intact)
BG_SA_GateState GateStatus[6];
BG_SA_GateState GateStatus[MAX_GATES];
/// Statu of battle (Start or not, and what round)
BG_SA_Status Status;
/// Team witch conntrol each graveyard
@@ -626,6 +657,9 @@ class BattlegroundSA : public Battleground
bool InitSecondRound;
std::map<uint32/*id*/, uint32/*timer*/> DemoliserRespawnList;
// Achievement: Defense of the Ancients
bool _gateDestroyed;
// Achievement: Not Even a Scratch
bool _allVehiclesAlive[BG_TEAMS_COUNT];
};
@@ -1275,10 +1275,8 @@ void GameObject::Use(Unit* user)
{
GameObjectTemplate const* info = GetGOInfo();
if (user->GetTypeId() == TYPEID_PLAYER)
if (Player* player = user->ToPlayer())
{
Player* player = user->ToPlayer();
if (info->goober.pageId) // show page...
{
WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8);
@@ -1295,7 +1293,7 @@ void GameObject::Use(Unit* user)
{
TC_LOG_DEBUG("maps.script", "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
EventInform(info->goober.eventId);
EventInform(info->goober.eventId, user);
}
// possible quest objective for active quests
@@ -1306,9 +1304,6 @@ void GameObject::Use(Unit* user)
break;
}
if (Battleground* bg = player->GetBattleground())
bg->EventPlayerUsedGO(player, this);
player->KillCreditGO(info->entry, GetGUID());
}
@@ -1804,7 +1799,7 @@ bool GameObject::IsInRange(float x, float y, float z, float radius) const
&& dz < info->maxZ + radius && dz > info->minZ - radius;
}
void GameObject::EventInform(uint32 eventId)
void GameObject::EventInform(uint32 eventId, WorldObject* invoker /*= NULL*/)
{
if (!eventId)
return;
@@ -1812,8 +1807,12 @@ void GameObject::EventInform(uint32 eventId)
if (AI())
AI()->EventInform(eventId);
if (m_zoneScript)
m_zoneScript->ProcessEvent(this, eventId);
if (GetZoneScript())
GetZoneScript()->ProcessEvent(this, eventId);
if (BattlegroundMap* bgMap = GetMap()->ToBattlegroundMap())
if (bgMap->GetBG())
bgMap->GetBG()->ProcessEvent(this, eventId, invoker);
}
// overwrite WorldObject function for proper name localization
@@ -1879,7 +1878,7 @@ void GameObject::ModifyHealth(int32 change, Unit* attackerOrHealer /*= NULL*/, u
// Set the health bar, value = 255 * healthPct;
SetGoAnimProgress(m_goValue.Building.Health * 255 / m_goValue.Building.MaxHealth);
Player* player = attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself();
Player* player = attackerOrHealer ? attackerOrHealer->GetCharmerOrOwnerPlayerOrPlayerItself() : NULL;
// dealing damage, send packet
if (player)
@@ -1928,11 +1927,8 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
break;
case GO_DESTRUCTIBLE_DAMAGED:
{
EventInform(m_goInfo->building.damagedEvent);
EventInform(m_goInfo->building.damagedEvent, eventInvoker);
sScriptMgr->OnGameObjectDamaged(this, eventInvoker);
if (eventInvoker)
if (Battleground* bg = eventInvoker->GetBattleground())
bg->EventPlayerDamagedGO(eventInvoker, this, m_goInfo->building.damagedEvent);
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
@@ -1957,15 +1953,10 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
case GO_DESTRUCTIBLE_DESTROYED:
{
sScriptMgr->OnGameObjectDestroyed(this, eventInvoker);
EventInform(m_goInfo->building.destroyedEvent);
EventInform(m_goInfo->building.destroyedEvent, eventInvoker);
if (eventInvoker)
{
if (Battleground* bg = eventInvoker->GetBattleground())
{
bg->EventPlayerDamagedGO(eventInvoker, this, m_goInfo->building.destroyedEvent);
bg->DestroyGate(eventInvoker, this);
}
}
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
@@ -1986,7 +1977,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
}
case GO_DESTRUCTIBLE_REBUILDING:
{
EventInform(m_goInfo->building.rebuildingEvent);
EventInform(m_goInfo->building.rebuildingEvent, eventInvoker);
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED | GO_FLAG_DESTROYED);
uint32 modelId = m_goInfo->displayId;
@@ -807,7 +807,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>, public Map
return GO_DESTRUCTIBLE_INTACT;
}
void EventInform(uint32 eventId);
void EventInform(uint32 eventId, WorldObject* invoker = NULL);
uint64 GetRotation() const { return m_rotation; }
virtual uint32 GetScriptId() const { return GetGOInfo()->ScriptId; }
+1 -13
View File
@@ -8611,6 +8611,7 @@ void ObjectMgr::LoadBroadcastTexts()
return;
}
_broadcastTextStore.rehash(result->GetRowCount());
uint32 count = 0;
do
@@ -8748,19 +8749,6 @@ void ObjectMgr::LoadDbScriptStrings()
TC_LOG_ERROR("sql.sql", "Table `db_script_string` has unused string id %u", *itr);
}
bool LoadTrinityStrings(const char* table, int32 start_value, int32 end_value)
{
// MAX_DB_SCRIPT_STRING_ID is max allowed negative value for scripts (scrpts can use only more deep negative values
// start/end reversed for negative values
if (start_value > MAX_DB_SCRIPT_STRING_ID || end_value >= start_value)
{
TC_LOG_ERROR("sql.sql", "Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1);
return false;
}
return sObjectMgr->LoadTrinityStrings(table, start_value, end_value);
}
CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass)
{
CreatureBaseStatsContainer::const_iterator it = _creatureBaseStatsStore.find(MAKE_PAIR16(level, unitClass));
+16 -5
View File
@@ -427,6 +427,22 @@ struct BroadcastText
uint32 Unk1;
uint32 Unk2;
// uint32 WDBVerified;
std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const
{
if (gender == GENDER_FEMALE && (forceGender || !FemaleText[DEFAULT_LOCALE].empty()))
{
if (FemaleText.size() > size_t(locale) && !FemaleText[locale].empty())
return FemaleText[locale];
return FemaleText[DEFAULT_LOCALE];
}
// else if (gender == GENDER_MALE)
{
if (MaleText.size() > size_t(locale) && !MaleText[locale].empty())
return MaleText[locale];
return MaleText[DEFAULT_LOCALE];
}
}
};
typedef UNORDERED_MAP<uint32, BroadcastText> BroadcastTextContainer;
@@ -447,8 +463,6 @@ typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> Map
#define MAX_TRINITY_STRING_ID 2000000000
#define MIN_DB_SCRIPT_STRING_ID MAX_TRINITY_STRING_ID // 'db_script_string'
#define MAX_DB_SCRIPT_STRING_ID 2000010000
#define MIN_CREATURE_AI_TEXT_STRING_ID (-1) // 'creature_ai_texts'
#define MAX_CREATURE_AI_TEXT_STRING_ID (-1000000)
// Trinity Trainer Reference start range
#define TRINITY_TRAINER_START_REF 200000
@@ -1448,7 +1462,4 @@ class ObjectMgr
#define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance()
// scripting access functions
bool LoadTrinityStrings(char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min());
#endif
+12
View File
@@ -3541,3 +3541,15 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 lightId, uint32 fadeInTime)
player->SendDirectMessage(&data);
}
}
void Map::UpdateAreaDependentAuras()
{
Map::PlayerList const& players = GetPlayers();
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
if (Player* player = itr->GetSource())
if (player->IsInWorld())
{
player->UpdateAreaDependentAuras(player->GetAreaId());
player->UpdateZoneDependentAuras(player->GetZoneId());
}
}
+11 -4
View File
@@ -51,6 +51,7 @@ struct ScriptAction;
struct Position;
class Battleground;
class MapInstanced;
class BattlegroundMap;
class InstanceMap;
class Transport;
namespace Trinity { struct ObjectUpdater; }
@@ -457,11 +458,15 @@ class Map : public GridRefManager<NGridType>
Transport* GetTransport(uint64 guid);
DynamicObject* GetDynamicObject(uint64 guid);
MapInstanced* ToMapInstanced(){ if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); else return NULL; }
const MapInstanced* ToMapInstanced() const { if (Instanceable()) return (const MapInstanced*)((MapInstanced*)this); else return NULL; }
MapInstanced* ToMapInstanced() { if (Instanceable()) return reinterpret_cast<MapInstanced*>(this); return NULL; }
MapInstanced const* ToMapInstanced() const { if (Instanceable()) return reinterpret_cast<MapInstanced const*>(this); return NULL; }
InstanceMap* ToInstanceMap() { if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; }
InstanceMap const* ToInstanceMap() const { if (IsDungeon()) return reinterpret_cast<InstanceMap const*>(this); return NULL; }
BattlegroundMap* ToBattlegroundMap() { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap*>(this); else return NULL; }
BattlegroundMap const* ToBattlegroundMap() const { if (IsBattlegroundOrArena()) return reinterpret_cast<BattlegroundMap const*>(this); return NULL; }
InstanceMap* ToInstanceMap(){ if (IsDungeon()) return reinterpret_cast<InstanceMap*>(this); else return NULL; }
const InstanceMap* ToInstanceMap() const { if (IsDungeon()) return (const InstanceMap*)((InstanceMap*)this); else return NULL; }
float GetWaterOrGroundLevel(float x, float y, float z, float* ground = NULL, bool swim = false) const;
float GetHeight(uint32 phasemask, float x, float y, float z, bool vmap = true, float maxSearchDist = DEFAULT_HEIGHT_SEARCH) const;
bool isInLineOfSight(float x1, float y1, float z1, float x2, float y2, float z2, uint32 phasemask) const;
@@ -511,6 +516,8 @@ class Map : public GridRefManager<NGridType>
void SetZoneWeather(uint32 zoneId, uint32 weatherId, float weatherGrade);
void SetZoneOverrideLight(uint32 zoneId, uint32 lightId, uint32 fadeInTime);
void UpdateAreaDependentAuras();
private:
void LoadMapAndVMap(int gx, int gy);
void LoadVMap(int gx, int gy);
+1 -11
View File
@@ -1210,21 +1210,11 @@ enum TrinityStrings
LANG_BG_SA_START_TWO_MINUTES = 10056,
LANG_BG_SA_START_ONE_MINUTE = 10057,
LANG_BG_SA_START_HALF_MINUTE = 10058,
LANG_BG_SA_HAS_BEGUN = 10059,
LANG_BG_SA_IS_UNDER_ATTACK = 10060, //The %s is under attack!
LANG_BG_SA_WAS_DESTROYED = 10061, //The %s was destroyed!
LANG_BG_SA_ROUND_ONE_END = 10062, //Round 1 - finished!
// unused 10059-10062
LANG_BG_SA_ALLIANCE_CAPTURED_RELIC = 10063, //The Alliance captured the titan portal!
LANG_BG_SA_HORDE_CAPTURED_RELIC = 10064, //The Horde captured the titan portal!
LANG_BG_SA_ROUND_TWO_ONE_MINUTE = 10065, //Round 2 of the Battle for the Strand of the Ancients begins in 1 minute.
LANG_BG_SA_ROUND_TWO_START_HALF_MINUTE = 10066, //Round 2 begins in 30 seconds. Prepare yourselves!
LANG_BG_SA_CHAMBER_BREACHED = 10067, //The chamber has been breached! The titan relic is vulnerable!
LANG_BG_SA_A_GY_SOUTH = 10068, //The Alliance captured the South Graveyard!
LANG_BG_SA_A_GY_WEST = 10069, //The Alliance captured the West Graveyard!
LANG_BG_SA_A_GY_EAST = 10070, //The Alliance captured the East Graveyard!
LANG_BG_SA_H_GY_SOUTH = 10071, //The Horde captured the South Graveyard!
LANG_BG_SA_H_GY_WEST = 10072, //The Horde captured the West Graveyard!
LANG_BG_SA_H_GY_EAST = 10073, //The Horde captured the East Graveyard!
// Use for custom patches 11000-11999
LANG_AUTO_BROADCAST = 11000,