From ef4f89b405f861904de5c855d33f14d95920768e Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 7 Oct 2012 13:44:30 +0100 Subject: Make Rune of Cinderglacier not proc off dots --- sql/updates/world/2012_10_07_01_world_spell_proc_event.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2012_10_07_01_world_spell_proc_event.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_07_01_world_spell_proc_event.sql b/sql/updates/world/2012_10_07_01_world_spell_proc_event.sql new file mode 100644 index 00000000000..810cd90290c --- /dev/null +++ b/sql/updates/world/2012_10_07_01_world_spell_proc_event.sql @@ -0,0 +1 @@ +UPDATE `spell_proc_event` SET `procflags`=0x15510 WHERE `entry`=53386; -- cgit v1.2.3 From 608ed2cf1df5e609977a44458f88ceb0cdba9477 Mon Sep 17 00:00:00 2001 From: zxbiohazardzx Date: Sun, 7 Oct 2012 17:43:13 +0200 Subject: DB/Loot: increase dropchance for Plump Buzzard Wing Closes #7989 --- sql/updates/world/2012_10_07_00_world_creature_loot_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_10_07_00_world_creature_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_07_00_world_creature_loot_template.sql b/sql/updates/world/2012_10_07_00_world_creature_loot_template.sql new file mode 100644 index 00000000000..2829725c76c --- /dev/null +++ b/sql/updates/world/2012_10_07_00_world_creature_loot_template.sql @@ -0,0 +1,2 @@ +-- increase droprate for Plump Buzzard Wing +UPDATE `creature_loot_template` SET `chanceOrQuestChance`=-50 WHERE `item`=23239; -- cgit v1.2.3 From c0e0f1d89b8522d3eb77bac484f392c166b1c102 Mon Sep 17 00:00:00 2001 From: tibbi Date: Tue, 9 Oct 2012 16:58:29 +0100 Subject: allow glyph1 be null like other glyph slots --- sql/base/characters_database.sql | 2 +- sql/updates/characters/2012_10_09_00_character_glyphs.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/characters/2012_10_09_00_character_glyphs.sql (limited to 'sql') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index d2ec0a94a2b..b1c57a2f5fb 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -618,7 +618,7 @@ DROP TABLE IF EXISTS `character_glyphs`; CREATE TABLE `character_glyphs` ( `guid` int(10) unsigned NOT NULL, `spec` tinyint(3) unsigned NOT NULL DEFAULT '0', - `glyph1` smallint(5) unsigned NOT NULL DEFAULT '0', + `glyph1` smallint(5) unsigned DEFAULT '0', `glyph2` smallint(5) unsigned DEFAULT '0', `glyph3` smallint(5) unsigned DEFAULT '0', `glyph4` smallint(5) unsigned DEFAULT '0', diff --git a/sql/updates/characters/2012_10_09_00_character_glyphs.sql b/sql/updates/characters/2012_10_09_00_character_glyphs.sql new file mode 100644 index 00000000000..b90fa7d7682 --- /dev/null +++ b/sql/updates/characters/2012_10_09_00_character_glyphs.sql @@ -0,0 +1 @@ +ALTER TABLE character_glyphs CHANGE glyph1 glyph1 smallint(5) unsigned DEFAULT '0'; -- cgit v1.2.3 From cce014a2ba48460722e4308bfdcf632e2a2817ec Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 9 Oct 2012 11:01:51 -0500 Subject: SQL/StackRules: Added a stack rule for some spells. Improved Scorch, Improved Shadow Bolt and Winter's Chill should not stack ref #7667 --- sql/updates/world/2012_10_09_00_world_spell_groups.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_10_09_00_world_spell_groups.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_09_00_world_spell_groups.sql b/sql/updates/world/2012_10_09_00_world_spell_groups.sql new file mode 100644 index 00000000000..71f58c6322e --- /dev/null +++ b/sql/updates/world/2012_10_09_00_world_spell_groups.sql @@ -0,0 +1,9 @@ +-- Improved Scorch, Improved Shadow Bolt and Winter's Chill effect should not stack +DELETE FROM `spell_group` WHERE `id`=1037; +INSERT INTO `spell_group`(`id`,`spell_id`) VALUES +(1037,22959), +(1037,17800), +(1037,12579); + +DELETE FROM `spell_group_stack_rules` WHERE `group_id`=1037; +INSERT INTO `spell_group_stack_rules`(`group_id`,`stack_rule`) VALUES (1037,3); -- cgit v1.2.3 From 5eccf9f4da29d2006e2f07a1e5ec0c01173a9c4a Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 9 Oct 2012 11:22:46 -0500 Subject: SQL/StackRules: Added one more stack rule. Blood Frenzy (Warrior) and Savage Combat should not stack. ref #7667 --- sql/updates/world/2012_10_09_01_world_spell_groups.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 sql/updates/world/2012_10_09_01_world_spell_groups.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_09_01_world_spell_groups.sql b/sql/updates/world/2012_10_09_01_world_spell_groups.sql new file mode 100644 index 00000000000..75c57d0f77f --- /dev/null +++ b/sql/updates/world/2012_10_09_01_world_spell_groups.sql @@ -0,0 +1,11 @@ +-- Blood Frenzy (Warrior) and Savage Combat effect should not stack +DELETE FROM `spell_group` WHERE `id`=1119; +INSERT INTO `spell_group`(`id`,`spell_id`) VALUES +(1119,30069), +(1119,58684); + +DELETE FROM `spell_group_stack_rules` WHERE `group_id`=1119; +INSERT INTO `spell_group_stack_rules`(`group_id`,`stack_rule`) VALUES (1119,3); + +-- Remove invalid spell_groups +DELETE FROM `spell_group` WHERE `id` IN (1038,1039); -- cgit v1.2.3 From 93189bacc528dcea11039930b3168a16a5b9c3a2 Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 9 Oct 2012 12:04:04 -0500 Subject: SQL/StackRules: Added one more stack rule. Totem of Wrath and Heart of the Crusader should not stack. --- sql/updates/world/2012_10_09_02_world_spell_groups.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2012_10_09_02_world_spell_groups.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_09_02_world_spell_groups.sql b/sql/updates/world/2012_10_09_02_world_spell_groups.sql new file mode 100644 index 00000000000..8e4864bc039 --- /dev/null +++ b/sql/updates/world/2012_10_09_02_world_spell_groups.sql @@ -0,0 +1,9 @@ +SET @GROUP := 1120; +-- Totem of Wrath and Heart of the Crusader effect should not stack +DELETE FROM `spell_group` WHERE `id`=@GROUP; +INSERT INTO `spell_group`(`id`,`spell_id`) VALUES +(@GROUP,21183), +(@GROUP,30708); + +DELETE FROM `spell_group_stack_rules` WHERE `group_id`=@GROUP; +INSERT INTO `spell_group_stack_rules`(`group_id`,`stack_rule`) VALUES (@GROUP,3); -- cgit v1.2.3 From 028b6e778c9561a40254a42242d5d47e2d1e9f30 Mon Sep 17 00:00:00 2001 From: Retriman Date: Wed, 10 Oct 2012 11:06:15 -0400 Subject: DB: Remove all bgs from e1bee86ee6f5c3ab7b1da6d1b54c98c2851f11ec --- sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql (limited to 'sql') diff --git a/sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql b/sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql new file mode 100644 index 00000000000..a9a1cdb04d1 --- /dev/null +++ b/sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql @@ -0,0 +1,2 @@ +-- Remove all bgs from e1bee86ee6f5c3ab7b1da6d1b54c98c2851f11ec +DELETE FROM `battleground_template` WHERE `id` = 6; -- all Bgs \ No newline at end of file -- cgit v1.2.3 From af005641847690ec76bb8eb704aec22435030093 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 10 Oct 2012 09:15:34 -0500 Subject: SQL: Renamed SQL from previous pull request. --- sql/updates/world/2012_10_10_00_world_battleground_template.sql | 2 ++ sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/2012_10_10_00_world_battleground_template.sql delete mode 100644 sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_10_00_world_battleground_template.sql b/sql/updates/world/2012_10_10_00_world_battleground_template.sql new file mode 100644 index 00000000000..a9a1cdb04d1 --- /dev/null +++ b/sql/updates/world/2012_10_10_00_world_battleground_template.sql @@ -0,0 +1,2 @@ +-- Remove all bgs from e1bee86ee6f5c3ab7b1da6d1b54c98c2851f11ec +DELETE FROM `battleground_template` WHERE `id` = 6; -- all Bgs \ No newline at end of file diff --git a/sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql b/sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql deleted file mode 100644 index a9a1cdb04d1..00000000000 --- a/sql/updates/world/2012_XXX_XX_XX_world_battleground_template.sql +++ /dev/null @@ -1,2 +0,0 @@ --- Remove all bgs from e1bee86ee6f5c3ab7b1da6d1b54c98c2851f11ec -DELETE FROM `battleground_template` WHERE `id` = 6; -- all Bgs \ No newline at end of file -- cgit v1.2.3 From 923cad31f3972fa5388d492e99161e3234d8a78c Mon Sep 17 00:00:00 2001 From: Kandera Date: Thu, 11 Oct 2012 11:28:44 -0400 Subject: Wintergrasp: move keep banner spawns to db. fix invisible stalker position. --- .../world/2012_10_11_00_world_gameobject.sql | 92 +++++++++++++++++ .../game/Battlefield/Zones/BattlefieldWG.cpp | 23 ----- src/server/game/Battlefield/Zones/BattlefieldWG.h | 109 +++------------------ 3 files changed, 106 insertions(+), 118 deletions(-) create mode 100644 sql/updates/world/2012_10_11_00_world_gameobject.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_11_00_world_gameobject.sql b/sql/updates/world/2012_10_11_00_world_gameobject.sql new file mode 100644 index 00000000000..0c08d9d5622 --- /dev/null +++ b/sql/updates/world/2012_10_11_00_world_gameobject.sql @@ -0,0 +1,92 @@ +SET @GUID = 74685; +SET @MAP = 571; +DELETE FROM `gameobject` WHERE (`id` IN (192254,192255,192269,192284,192285,192336,192338,192339,192349,192350,192351,192352,192353,192354,192355,192356,192357,192358,192359,192360,192361,192362,192363,192364,192366,192367,192368,192369,192370,192371,192372,192373,192374,192375,192378,192379,192416,192488,192501) AND `guid` != 67250) OR `guid` BETWEEN @GUID AND @GUID+87; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`) VALUES +(@GUID+0, 192488, @MAP, 64, 5262.540039, 3047.949951, 432.054993, 3.106650), -- Flag on tower +(@GUID+1, 192501, @MAP, 128, 5262.540039, 3047.949951, 432.054993, 3.106650), -- Flag on tower +(@GUID+2, 192374, @MAP, 64, 5272.939941, 2976.550049, 444.492004, 3.124120), -- Flag on Wall Intersect +(@GUID+3, 192416, @MAP, 128, 5272.939941, 2976.550049, 444.492004, 3.124120), -- Flag on Wall Intersect +(@GUID+4, 192375, @MAP, 64, 5235.189941, 2941.899902, 444.278015, 1.588250), -- Flag on Wall Intersect +(@GUID+5, 192416, @MAP, 128, 5235.189941, 2941.899902, 444.278015, 1.588250), -- Flag on Wall Intersect +(@GUID+6, 192488, @MAP, 64, 5163.129883, 2952.590088, 433.502991, 1.535890), -- Flag on tower +(@GUID+7, 192501, @MAP, 128, 5163.129883, 2952.590088, 433.502991, 1.535890), -- Flag on tower +(@GUID+8, 192488, @MAP, 64, 5145.109863, 2935.000000, 433.385986, 3.141590), -- Flag on tower +(@GUID+9, 192501, @MAP, 128, 5145.109863, 2935.000000, 433.385986, 3.141590), -- Flag on tower +(@GUID+10, 192488, @MAP, 64, 5158.810059, 2883.129883, 431.618011, 3.141590), -- Flag on wall +(@GUID+11, 192416, @MAP, 128, 5158.810059, 2883.129883, 431.618011, 3.141590), -- Flag on wall +(@GUID+12, 192336, @MAP, 64, 5154.490234, 2862.149902, 445.011993, 3.141590), -- Flag on Wall Intersect +(@GUID+13, 192416, @MAP, 128, 5154.490234, 2862.149902, 445.011993, 3.141590), -- Flag on Wall Intersect +(@GUID+14, 192255, @MAP, 64, 5154.520020, 2853.310059, 409.183014, 3.141590), -- Flag on the floor +(@GUID+15, 192269, @MAP, 128, 5154.520020, 2853.310059, 409.183014, 3.141590), -- Flag on the floor +(@GUID+16, 192254, @MAP, 64, 5154.459961, 2828.939941, 409.188995, 3.141590), -- Flag on the floor +(@GUID+17, 192269, @MAP, 128, 5154.459961, 2828.939941, 409.188995, 3.141590), -- Flag on the floor +(@GUID+18, 192349, @MAP, 64, 5155.310059, 2820.739990, 444.979004, -3.13286), -- Flag on wall intersect +(@GUID+19, 192416, @MAP, 128, 5155.310059, 2820.739990, 444.979004, -3.13286), -- Flag on wall intersect +(@GUID+20, 192488, @MAP, 64, 5160.339844, 2798.610107, 430.769012, 3.141590), -- Flag on wall +(@GUID+21, 192416, @MAP, 128, 5160.339844, 2798.610107, 430.769012, 3.141590), -- Flag on wall +(@GUID+22, 192488, @MAP, 64, 5146.040039, 2747.209961, 433.584015, 3.071770), -- Flag on tower +(@GUID+23, 192501, @MAP, 128, 5146.040039, 2747.209961, 433.584015, 3.071770), -- Flag on tower +(@GUID+24, 192488, @MAP, 64, 5163.779785, 2729.679932, 433.394012, -1.58825), -- Flag on tower +(@GUID+25, 192501, @MAP, 128, 5163.779785, 2729.679932, 433.394012, -1.58825), -- Flag on tower +(@GUID+26, 192366, @MAP, 64, 5236.270020, 2739.459961, 444.992004, -1.59698), -- Flag on wall intersect +(@GUID+27, 192416, @MAP, 128, 5236.270020, 2739.459961, 444.992004, -1.59698), -- Flag on wall intersect +(@GUID+28, 192367, @MAP, 64, 5271.799805, 2704.870117, 445.183014, -3.13286), -- Flag on wall intersect +(@GUID+29, 192416, @MAP, 128, 5271.799805, 2704.870117, 445.183014, -3.13286), -- Flag on wall intersect +(@GUID+30, 192488, @MAP, 64, 5260.819824, 2631.800049, 433.324005, 3.054330), -- Flag on tower +(@GUID+31, 192501, @MAP, 128, 5260.819824, 2631.800049, 433.324005, 3.054330), -- Flag on tower +(@GUID+32, 192488, @MAP, 64, 5278.379883, 2613.830078, 433.408997, -1.58825), -- Flag on tower +(@GUID+33, 192501, @MAP, 128, 5278.379883, 2613.830078, 433.408997, -1.58825), -- Flag on tower +(@GUID+34, 192364, @MAP, 64, 5350.879883, 2622.719971, 444.686005, -1.57080), -- Flag on wall intersect +(@GUID+35, 192416, @MAP, 128, 5350.879883, 2622.719971, 444.686005, -1.57080), -- Flag on wall intersect +(@GUID+36, 192370, @MAP, 64, 5392.270020, 2639.739990, 435.330994, 1.509710), -- Flag on wall intersect +(@GUID+37, 192416, @MAP, 128, 5392.270020, 2639.739990, 435.330994, 1.509710), -- Flag on wall intersect +(@GUID+38, 192369, @MAP, 64, 5350.950195, 2640.360107, 435.407990, 1.570800), -- Flag on wall intersect +(@GUID+39, 192416, @MAP, 128, 5350.950195, 2640.360107, 435.407990, 1.570800), -- Flag on wall intersect +(@GUID+40, 192368, @MAP, 64, 5289.459961, 2704.679932, 435.875000, -0.01745), -- Flag on wall intersect +(@GUID+41, 192416, @MAP, 128, 5289.459961, 2704.679932, 435.875000, -0.01745), -- Flag on wall intersect +(@GUID+42, 192362, @MAP, 64, 5322.120117, 2763.610107, 444.973999, -1.55334), -- Flag on wall intersect +(@GUID+43, 192416, @MAP, 128, 5322.120117, 2763.610107, 444.973999, -1.55334), -- Flag on wall intersect +(@GUID+44, 192363, @MAP, 64, 5363.609863, 2763.389893, 445.023987, -1.54462), -- Flag on wall intersect +(@GUID+45, 192416, @MAP, 128, 5363.609863, 2763.389893, 445.023987, -1.54462), -- Flag on wall intersect +(@GUID+46, 192379, @MAP, 64, 5363.419922, 2781.030029, 435.763000, 1.570800), -- Flag on wall intersect +(@GUID+47, 192416, @MAP, 128, 5363.419922, 2781.030029, 435.763000, 1.570800), -- Flag on wall intersect +(@GUID+48, 192378, @MAP, 64, 5322.020020, 2781.129883, 435.811005, 1.570800), -- Flag on wall intersect +(@GUID+49, 192416, @MAP, 128, 5322.020020, 2781.129883, 435.811005, 1.570800), -- Flag on wall intersect +(@GUID+50, 192355, @MAP, 64, 5288.919922, 2820.219971, 435.721008, 0.017452), -- Flag on wall intersect +(@GUID+51, 192416, @MAP, 128, 5288.919922, 2820.219971, 435.721008, 0.017452), -- Flag on wall intersect +(@GUID+52, 192354, @MAP, 64, 5288.410156, 2861.790039, 435.721008, 0.017452), -- Flag on wall intersect +(@GUID+53, 192416, @MAP, 128, 5288.410156, 2861.790039, 435.721008, 0.017452), -- Flag on wall intersect +(@GUID+54, 192358, @MAP, 64, 5322.229980, 2899.429932, 435.808014, -1.58825), -- Flag on wall intersect +(@GUID+55, 192416, @MAP, 128, 5322.229980, 2899.429932, 435.808014, -1.58825), -- Flag on wall intersect +(@GUID+56, 192359, @MAP, 64, 5364.350098, 2899.399902, 435.838989, -1.57080), -- Flag on wall intersect +(@GUID+57, 192416, @MAP, 128, 5364.350098, 2899.399902, 435.838989, -1.57080), -- Flag on wall intersect +(@GUID+58, 192338, @MAP, 64, 5397.759766, 2873.080078, 455.460999, 3.106650), -- Flag on keep +(@GUID+59, 192416, @MAP, 128, 5397.759766, 2873.080078, 455.460999, 3.106650), -- Flag on keep +(@GUID+60, 192339, @MAP, 64, 5397.390137, 2809.330078, 455.343994, 3.106650), -- Flag on keep +(@GUID+61, 192416, @MAP, 128, 5397.390137, 2809.330078, 455.343994, 3.106650), -- Flag on keep +(@GUID+62, 192284, @MAP, 64, 5372.479980, 2862.500000, 409.049011, 3.141590), -- Flag on floor +(@GUID+63, 192269, @MAP, 128, 5372.479980, 2862.500000, 409.049011, 3.141590), -- Flag on floor +(@GUID+64, 192285, @MAP, 64, 5371.490234, 2820.800049, 409.177002, 3.141590), -- Flag on floor +(@GUID+65, 192269, @MAP, 128, 5371.490234, 2820.800049, 409.177002, 3.141590), -- Flag on floor +(@GUID+66, 192371, @MAP, 64, 5364.290039, 2916.939941, 445.330994, 1.579520), -- Flag on wall intersect +(@GUID+67, 192416, @MAP, 128, 5364.290039, 2916.939941, 445.330994, 1.579520), -- Flag on wall intersect +(@GUID+68, 192372, @MAP, 64, 5322.859863, 2916.949951, 445.153992, 1.562070), -- Flag on wall intersect +(@GUID+69, 192416, @MAP, 128, 5322.859863, 2916.949951, 445.153992, 1.562070), -- Flag on wall intersect +(@GUID+70, 192373, @MAP, 64, 5290.350098, 2976.560059, 435.221008, 0.017452), -- Flag on wall intersect +(@GUID+71, 192416, @MAP, 128, 5290.350098, 2976.560059, 435.221008, 0.017452), -- Flag on wall intersect +(@GUID+72, 192360, @MAP, 64, 5352.370117, 3037.090088, 435.252014, -1.57080), -- Flag on wall intersect +(@GUID+73, 192416, @MAP, 128, 5352.370117, 3037.090088, 435.252014, -1.57080), -- Flag on wall intersect +(@GUID+74, 192361, @MAP, 64, 5392.649902, 3037.110107, 433.713013, -1.52716), -- Flag on wall intersect +(@GUID+75, 192416, @MAP, 128, 5392.649902, 3037.110107, 433.713013, -1.52716), -- Flag on wall intersect +(@GUID+76, 192356, @MAP, 64, 5237.069824, 2757.030029, 435.795990, 1.518440), -- Flag on wall intersect +(@GUID+77, 192416, @MAP, 128, 5237.069824, 2757.030029, 435.795990, 1.518440), -- Flag on wall intersect +(@GUID+78, 192352, @MAP, 64, 5173.020020, 2820.929932, 435.720001, 0.017452), -- Flag on wall intersect +(@GUID+79, 192416, @MAP, 128, 5173.020020, 2820.929932, 435.720001, 0.017452), -- Flag on wall intersect +(@GUID+80, 192353, @MAP, 64, 5172.109863, 2862.570068, 435.721008, 0.017452), -- Flag on wall intersect +(@GUID+81, 192416, @MAP, 128, 5172.109863, 2862.570068, 435.721008, 0.017452), -- Flag on wall intersect +(@GUID+82, 192357, @MAP, 64, 5235.339844, 2924.340088, 435.040009, -1.57080), -- Flag on wall intersect +(@GUID+83, 192416, @MAP, 128, 5235.339844, 2924.340088, 435.040009, -1.57080), -- Flag on wall intersect +(@GUID+84, 192350, @MAP, 64, 5270.689941, 2861.780029, 445.058014, -3.11539), -- Flag on wall intersect +(@GUID+85, 192416, @MAP, 128, 5270.689941, 2861.780029, 445.058014, -3.11539), -- Flag on wall intersect +(@GUID+86, 192351, @MAP, 64, 5271.279785, 2820.159912, 445.200989, -3.13286), -- Flag on wall intersect +(@GUID+87, 192416, @MAP, 128, 5271.279785, 2820.159912, 445.200989, -3.13286); -- Flag on wall intersect diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index 119880bae8d..59dc6761583 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -188,29 +188,6 @@ bool BattlefieldWG::SetupBattlefield() go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[GetDefenderTeam()]); } - // Spawn banners in the keep - for (uint8 i = 0; i < WG_KEEPGAMEOBJECT_MAX; i++) - { - if (GameObject* go = SpawnGameObject(WGKeepGameObject[i].entryHorde, WGKeepGameObject[i].x, WGKeepGameObject[i].y, WGKeepGameObject[i].z, WGKeepGameObject[i].o)) - { - go->SetRespawnTime(GetDefenderTeam()? RESPAWN_ONE_DAY : RESPAWN_IMMEDIATELY); - m_KeepGameObject[1].insert(go); - } - if (GameObject* go = SpawnGameObject(WGKeepGameObject[i].entryAlliance, WGKeepGameObject[i].x, WGKeepGameObject[i].y, WGKeepGameObject[i].z, WGKeepGameObject[i].o)) - { - go->SetRespawnTime(GetDefenderTeam()? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - m_KeepGameObject[0].insert(go); - } - } - - // Show defender banner in keep - for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetDefenderTeam()].begin(); itr != m_KeepGameObject[GetDefenderTeam()].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_IMMEDIATELY); - - // Hide attackant banner in keep - for (GameObjectSet::const_iterator itr = m_KeepGameObject[GetAttackerTeam()].begin(); itr != m_KeepGameObject[GetAttackerTeam()].end(); ++itr) - (*itr)->SetRespawnTime(RESPAWN_ONE_DAY); - UpdateCounterVehicle(true); return true; } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 323f7f2b13d..1af096a3180 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -440,10 +440,9 @@ uint32 const VehNumWorldState[] = { 3680, 3490 }; uint32 const MaxVehNumWorldState[] = { 3681, 3491 }; uint32 const ClockWorldState[] = { 3781, 4354 }; uint32 const WintergraspFaction[] = { 1732, 1735, 35 }; -float const WintergraspStalkerPos[] = { 0, 0, 0, 0 }; +float const WintergraspStalkerPos[] = { 4948.985f, 2937.789f, 550.5172f, 1.815142f }; uint8 const WG_MAX_OBJ = 32; -uint8 const WG_KEEPGAMEOBJECT_MAX = 44; uint8 const WG_MAX_TURRET = 15; uint8 const WG_MAX_KEEP_NPC = 39; uint8 const WG_MAX_OUTSIDE_NPC = 14; @@ -580,6 +579,19 @@ struct WintergraspBuildingSpawnData uint32 nameId; }; +struct WintergraspRebuildableBuildingData +{ + uint32 entry; + uint64 Guid + uint32 WorldState; + float x; + float y; + float z; + float o; + uint32 type; + uint32 nameId; +}; + const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { // Wall (Not spawned in db) @@ -628,99 +640,6 @@ const WintergraspBuildingSpawnData WGGameObjectBuilding[WG_MAX_OBJ] = { GO_WINTERGRASP_VAULT_GATE, 3773, 5397.11f, 2841.54f, 425.899f, 3.14159f, BATTLEFIELD_WG_OBJECTTYPE_DOOR_LAST, 0 }, }; - -// ********************************************************* -// **********Keep Element(GameObject,Creature)************** -// ********************************************************* - -// Keep gameobject -// 192488 : 10 in sql, 19 in header -// 192501 : 12 in sql, 17 in header -// 192416 : 1 in sql, 33 in header -// 192374 : 1 in sql, 1 in header -// 192375 : 1 in sql, 1 in header -// 192336 : 1 in sql, 1 in header -// 192255 : 1 in sql, 1 in header -// 192269 : 1 in sql, 7 in header -// 192254 : 1 in sql, 1 in header -// 192349 : 1 in sql, 1 in header -// 192366 : 1 in sql, 3 in header -// 192367 : 1 in sql, 1 in header -// 192364 : 1 in sql, 1 in header -// 192370 : 1 in sql, 1 in header -// 192369 : 1 in sql, 1 in header -// 192368 : 1 in sql, 1 in header -// 192362 : 1 in sql, 1 in header -// 192363 : 1 in sql, 1 in header -// 192379 : 1 in sql, 1 in header -// 192378 : 1 in sql, 1 in header -// 192355 : 1 in sql, 1 in header -// 192354 : 1 in sql, 1 in header -// 192358 : 1 in sql, 1 in header -// 192359 : 1 in sql, 1 in header -// 192338 : 1 in sql, 1 in header -// 192339 : 1 in sql, 1 in header -// 192284 : 1 in sql, 1 in header -// 192285 : 1 in sql, 1 in header -// 192371 : 1 in sql, 1 in header -// 192372 : 1 in sql, 1 in header -// 192373 : 1 in sql, 1 in header -// 192360 : 1 in sql, 1 in header -// 192361 : 1 in sql, 1 in header -// 192356 : 1 in sql, 1 in header -// 192352 : 1 in sql, 1 in header -// 192353 : 1 in sql, 1 in header -// 192357 : 1 in sql, 1 in header -// 192350 : 1 in sql, 1 in header -// 192351 : 1 in sql, 1 in header -const WintergraspObjectPositionData WGKeepGameObject[WG_KEEPGAMEOBJECT_MAX] = -{ - { 5262.540039f, 3047.949951f, 432.054993f, 3.106650f, 192488, 192501 }, // Flag on tower - { 5272.939941f, 2976.550049f, 444.492004f, 3.124120f, 192374, 192416 }, // Flag on Wall Intersect - { 5235.189941f, 2941.899902f, 444.278015f, 1.588250f, 192375, 192416 }, // Flag on Wall Intersect - { 5163.129883f, 2952.590088f, 433.502991f, 1.535890f, 192488, 192501 }, // Flag on tower - { 5145.109863f, 2935.000000f, 433.385986f, 3.141590f, 192488, 192501 }, // Flag on tower - { 5158.810059f, 2883.129883f, 431.618011f, 3.141590f, 192488, 192416 }, // Flag on wall - { 5154.490234f, 2862.149902f, 445.011993f, 3.141590f, 192336, 192416 }, // Flag on Wall Intersect - { 5154.520020f, 2853.310059f, 409.183014f, 3.141590f, 192255, 192269 }, // Flag on the floor - { 5154.459961f, 2828.939941f, 409.188995f, 3.141590f, 192254, 192269 }, // Flag on the floor - { 5155.310059f, 2820.739990f, 444.979004f, -3.13286f, 192349, 192416 }, // Flag on wall intersect - { 5160.339844f, 2798.610107f, 430.769012f, 3.141590f, 192488, 192416 }, // Flag on wall - { 5146.040039f, 2747.209961f, 433.584015f, 3.071770f, 192488, 192501 }, // Flag on tower - { 5163.779785f, 2729.679932f, 433.394012f, -1.58825f, 192488, 192501 }, // Flag on tower - { 5236.270020f, 2739.459961f, 444.992004f, -1.59698f, 192366, 192416 }, // Flag on wall intersect - { 5271.799805f, 2704.870117f, 445.183014f, -3.13286f, 192367, 192416 }, // Flag on wall intersect - { 5260.819824f, 2631.800049f, 433.324005f, 3.054330f, 192488, 192501 }, // Flag on tower - { 5278.379883f, 2613.830078f, 433.408997f, -1.58825f, 192488, 192501 }, // Flag on tower - { 5350.879883f, 2622.719971f, 444.686005f, -1.57080f, 192364, 192416 }, // Flag on wall intersect - { 5392.270020f, 2639.739990f, 435.330994f, 1.509710f, 192370, 192416 }, // Flag on wall intersect - { 5350.950195f, 2640.360107f, 435.407990f, 1.570800f, 192369, 192416 }, // Flag on wall intersect - { 5289.459961f, 2704.679932f, 435.875000f, -0.01745f, 192368, 192416 }, // Flag on wall intersect - { 5322.120117f, 2763.610107f, 444.973999f, -1.55334f, 192362, 192416 }, // Flag on wall intersect - { 5363.609863f, 2763.389893f, 445.023987f, -1.54462f, 192363, 192416 }, // Flag on wall intersect - { 5363.419922f, 2781.030029f, 435.763000f, 1.570800f, 192379, 192416 }, // Flag on wall intersect - { 5322.020020f, 2781.129883f, 435.811005f, 1.570800f, 192378, 192416 }, // Flag on wall intersect - { 5288.919922f, 2820.219971f, 435.721008f, 0.017452f, 192355, 192416 }, // Flag on wall intersect - { 5288.410156f, 2861.790039f, 435.721008f, 0.017452f, 192354, 192416 }, // Flag on wall intersect - { 5322.229980f, 2899.429932f, 435.808014f, -1.58825f, 192358, 192416 }, // Flag on wall intersect - { 5364.350098f, 2899.399902f, 435.838989f, -1.57080f, 192359, 192416 }, // Flag on wall intersect - { 5397.759766f, 2873.080078f, 455.460999f, 3.106650f, 192338, 192416 }, // Flag on keep - { 5397.390137f, 2809.330078f, 455.343994f, 3.106650f, 192339, 192416 }, // Flag on keep - { 5372.479980f, 2862.500000f, 409.049011f, 3.141590f, 192284, 192269 }, // Flag on floor - { 5371.490234f, 2820.800049f, 409.177002f, 3.141590f, 192285, 192269 }, // Flag on floor - { 5364.290039f, 2916.939941f, 445.330994f, 1.579520f, 192371, 192416 }, // Flag on wall intersect - { 5322.859863f, 2916.949951f, 445.153992f, 1.562070f, 192372, 192416 }, // Flag on wall intersect - { 5290.350098f, 2976.560059f, 435.221008f, 0.017452f, 192373, 192416 }, // Flag on wall intersect - { 5352.370117f, 3037.090088f, 435.252014f, -1.57080f, 192360, 192416 }, // Flag on wall intersect - { 5392.649902f, 3037.110107f, 433.713013f, -1.52716f, 192361, 192416 }, // Flag on wall intersect - { 5237.069824f, 2757.030029f, 435.795990f, 1.518440f, 192356, 192416 }, // Flag on wall intersect - { 5173.020020f, 2820.929932f, 435.720001f, 0.017452f, 192352, 192416 }, // Flag on wall intersect - { 5172.109863f, 2862.570068f, 435.721008f, 0.017452f, 192353, 192416 }, // Flag on wall intersect - { 5235.339844f, 2924.340088f, 435.040009f, -1.57080f, 192357, 192416 }, // Flag on wall intersect - { 5270.689941f, 2861.780029f, 445.058014f, -3.11539f, 192350, 192416 }, // Flag on wall intersect - { 5271.279785f, 2820.159912f, 445.200989f, -3.13286f, 192351, 192416 } // Flag on wall intersect -}; - const Position WGTurret[WG_MAX_TURRET] = { { 5391.19f, 3060.8f, 419.616f, 1.69557f }, -- cgit v1.2.3 From e3d8c666bd72a2c3062d8a258fc41c9cf2d7d523 Mon Sep 17 00:00:00 2001 From: Warpten Date: Fri, 12 Oct 2012 23:04:56 +0200 Subject: Scripts/Ruby Sanctum: * Fixed Halion's health pool in the Twilight Realm. * Updated missing expansion fields for Saviana Ragefire, General Zarithrian. * Have Halion bind players to instance on any other mode than 10NM. * Link template entries depending on difficulties. Closes #8017. Closes #8024. --- .../2012_10_13_00_world_creature_template.sql | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sql/updates/world/2012_10_13_00_world_creature_template.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_13_00_world_creature_template.sql b/sql/updates/world/2012_10_13_00_world_creature_template.sql new file mode 100644 index 00000000000..7dc7a463f3f --- /dev/null +++ b/sql/updates/world/2012_10_13_00_world_creature_template.sql @@ -0,0 +1,25 @@ +-- Orb rotation focus +UPDATE `creature_template` SET `modelid1`=11868,`modelid2`=169,`minlevel`=80,`maxlevel`=80,`faction_A`=14,`faction_H`=14,`speed_walk`=2.2,`speed_run`=0.785714,`baseattacktime`=2000,`unit_flags`=33554688 WHERE `entry` IN(43280,43281,43282); +UPDATE `creature_template` SET `difficulty_entry_1`=43280, `difficulty_entry_2`=43281,`difficulty_entry_3`=43282 WHERE `entry`=40091; + +-- Orb carrier +UPDATE `creature_template` SET `minlevel`=80,`maxlevel`=80,`exp`=2,`faction_A`=14,`faction_H`=14,`speed_walk`=1.2,`speed_run`=1.14286,`baseattacktime`=2000 WHERE `entry` IN(40470,40471,40472); +UPDATE `creature_template` SET `difficulty_entry_1`=40470, `difficulty_entry_2`=40471,`difficulty_entry_3`=40472 WHERE `entry`=40081; + +-- Saviana Ragefire +UPDATE `creature_template` SET `exp`=2 WHERE `entry`=39823; + +-- General Zarithrian +UPDATE `creature_template` SET `exp`=2 WHERE `entry`=39805; + +-- Twilight Halion +UPDATE `creature_template` SET `difficulty_entry_1`=40143, `difficulty_entry_2`=40144,`difficulty_entry_3`=40145 WHERE `entry`=40142; +UPDATE `creature_template` SET `minlevel`=83,`maxlevel`=83,`speed_walk`=1.6,`speed_run`=1.42857,`baseattacktime`=1800,`unit_flags`=559168,`dynamicflags`=12 WHERE `entry` IN(40143,40144,40145); + +-- Halion +UPDATE `creature_template` SET `speed_walk`=1.6,`speed_run`=1.42857,`baseattacktime`=1500,`unit_flags`=32832,`dynamicflags`=12,`flags_extra`=1 WHERE `entry` IN(39864,39944,39945); +UPDATE `creature_template` SET `dmg_multiplier`=50 WHERE `entry`=39944; +UPDATE `creature_template` SET `dmg_multiplier`=85 WHERE `entry`=39945; + +-- Onyx Flamecaller +UPDATE `creature_template` SET `minlevel`=82,`maxlevel`=82,`faction_A`=103,`faction_H`=103,`exp`=2,`speed_walk`=0.88888,`speed_run`=1.42857,`baseattacktime`=2000,`unit_flags`=32768,`equipment_id`=2468 WHERE `entry`=39815; -- cgit v1.2.3 From 98588aa19202c2d259fba0717f9c4a4feac32a0a Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 17 Oct 2012 00:53:55 +0200 Subject: Core/Ticket: - Fully parse CMSG_GMTICKET_CREATE, use GmTicket::GetChatLog() to access the reporters chat log from this session (unused atm, possible useful to detect chat harassment) - Simplify SMSG_GMTICKET_GETTICKET and fix "category" field (renamed it same as in blizz LUA files) - Store response in DB --- .../2012_10_17_00_character_gm_tickets.sql | 3 + src/server/game/Handlers/TicketHandler.cpp | 44 +++++++++++- src/server/game/Tickets/TicketMgr.cpp | 79 ++++++++++------------ src/server/game/Tickets/TicketMgr.h | 7 +- .../Database/Implementation/CharacterDatabase.cpp | 4 +- 5 files changed, 90 insertions(+), 47 deletions(-) create mode 100644 sql/updates/characters/2012_10_17_00_character_gm_tickets.sql (limited to 'sql') diff --git a/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql b/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql new file mode 100644 index 00000000000..c41df0c115d --- /dev/null +++ b/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql @@ -0,0 +1,3 @@ +ALTER TABLE `gm_tickets` + ADD COLUMN `response` TEXT NOT NULL AFTER `comment`, + ADD COLUMN `haveTicket` TINYINT(3) UNSIGNED NOT NULL AFTER `viewed`; diff --git a/src/server/game/Handlers/TicketHandler.cpp b/src/server/game/Handlers/TicketHandler.cpp index d6675188f6e..7fcfbbbc23e 100755 --- a/src/server/game/Handlers/TicketHandler.cpp +++ b/src/server/game/Handlers/TicketHandler.cpp @@ -16,6 +16,7 @@ * with this program. If not, see . */ +#include "zlib.h" #include "Language.h" #include "WorldPacket.h" #include "Common.h" @@ -26,7 +27,7 @@ #include "WorldSession.h" #include "Util.h" -void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) +void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData) { // Don't accept tickets if the ticket queue is disabled. (Ticket UI is greyed out but not fully dependable) if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED) @@ -42,7 +43,46 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data) // Player must not have ticket if (!sTicketMgr->GetTicketByPlayer(GetPlayer()->GetGUID())) { - GmTicket* ticket = new GmTicket(GetPlayer(), recv_data); + GmTicket* ticket = new GmTicket(GetPlayer(), recvData); + + uint32 count; + std::list times; + uint32 decompressedSize; + std::string chatLog; + + recvData >> count; + + for (uint32 i = 0; i < count; i++) + { + uint32 time; + recvData >> time; + times.push_back(time); + } + + recvData >> decompressedSize; + + if (count && decompressedSize && decompressedSize < 0xFFFF) + { + uint32 pos = recvData.rpos(); + ByteBuffer dest; + dest.resize(decompressedSize); + + uLongf realSize = decompressedSize; + if (uncompress(const_cast(dest.contents()), &realSize, const_cast(recvData.contents() + pos), recvData.size() - pos) == Z_OK) + { + dest >> chatLog; + ticket->SetChatLog(times, chatLog); + } + else + { + sLog->outError(LOG_FILTER_NETWORKIO, "CMSG_GMTICKET_CREATE possibly corrupt. Uncompression failed."); + recvData.rfinish(); + return; + } + + recvData.rfinish(); // Will still have compressed data in buffer. + } + sTicketMgr->AddTicket(ticket); sTicketMgr->UpdateLastChange(); diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 0a4682db759..51e17cb9076 100755 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -31,45 +31,32 @@ inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; } // GM ticket GmTicket::GmTicket() { } -GmTicket::GmTicket(Player* player, WorldPacket& recv_data) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED) +GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _haveTicket(false) { _id = sTicketMgr->GenerateTicketId(); _playerName = player->GetName(); _playerGuid = player->GetGUID(); uint32 mapId; - recv_data >> mapId; // Map is sent as UInt32! + recvData >> mapId; // Map is sent as UInt32! _mapId = mapId; - recv_data >> _posX; - recv_data >> _posY; - recv_data >> _posZ; - recv_data >> _message; + recvData >> _posX; + recvData >> _posY; + recvData >> _posZ; + recvData >> _message; uint32 needResponse; - recv_data >> needResponse; - _needResponse = (needResponse == 17); // Requires GM response. 17 = true, 1 = false (17 is default) - uint8 unk1; - recv_data >> unk1; // Requests further GM interaction on a ticket to which a GM has already responded - - recv_data.rfinish(); - /* - recv_data >> uint32(count); // text lines - for (int i = 0; i < count; i++) - recv_data >> uint32(); - - if (something) - recv_data >> uint32(); - else - compressed uint32 + string; - */ + recvData >> needResponse; + _needResponse = (needResponse == 17); // Requires GM response. 17 = true, 1 = false (17 is default) + recvData >> _haveTicket; // Requests further GM interaction on a ticket to which a GM has already responded. Basically means "has a new ticket" } GmTicket::~GmTicket() { } bool GmTicket::LoadFromDB(Field* fields) { - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 + // ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket uint8 index = 0; _id = fields[ index].GetUInt32(); _playerGuid = MAKE_NEW_GUID(fields[++index].GetUInt32(), 0, HIGHGUID_PLAYER); @@ -84,9 +71,11 @@ bool GmTicket::LoadFromDB(Field* fields) _closedBy = fields[++index].GetInt32(); _assignedTo = MAKE_NEW_GUID(fields[++index].GetUInt32(), 0, HIGHGUID_PLAYER); _comment = fields[++index].GetString(); + _response = fields[++index].GetString(); _completed = fields[++index].GetBool(); _escalatedStatus = GMTicketEscalationStatus(fields[++index].GetUInt8()); _viewed = fields[++index].GetBool(); + _haveTicket = fields[++index].GetBool(); return true; } @@ -109,9 +98,11 @@ void GmTicket::SaveToDB(SQLTransaction& trans) const stmt->setInt32 (++index, GUID_LOPART(_closedBy)); stmt->setUInt32(++index, GUID_LOPART(_assignedTo)); stmt->setString(++index, _comment); + stmt->setString(++index, _response); stmt->setBool (++index, _completed); stmt->setUInt8 (++index, uint8(_escalatedStatus)); stmt->setBool (++index, _viewed); + stmt->setBool (++index, _haveTicket); CharacterDatabase.ExecuteOrAppend(trans, stmt); } @@ -125,6 +116,10 @@ void GmTicket::DeleteFromDB() void GmTicket::WritePacket(WorldPacket& data) const { + data << uint32(GMTICKET_STATUS_HASTEXT); + data << uint32(_id); + data << _message; + data << uint8(_haveTicket); data << GetAge(_lastModifiedTime); if (GmTicket* ticket = sTicketMgr->GetOldestOpenTicket()) data << GetAge(ticket->GetLastModifiedTime()); @@ -223,6 +218,20 @@ void GmTicket::TeleportTo(Player* player) const player->TeleportTo(_mapId, _posX, _posY, _posZ, 0.0f, 0); } +void GmTicket::SetChatLog(std::list time, std::string const& log) +{ + std::stringstream ss(log); + std::stringstream newss; + std::string line; + while (std::getline(ss, line)) + { + newss << secsToTimeString(time.front()) << ": " << line << "\n"; + time.pop_front(); + } + + _chatLog = newss.str(); +} + /////////////////////////////////////////////////////////////////////////////////////////////////// // Ticket manager TicketMgr::TicketMgr() : _status(true), _lastTicketId(0), _lastSurveyId(0), _openTicketCount(0), _lastChange(time(NULL)) { } @@ -365,26 +374,12 @@ void TicketMgr::ShowEscalatedList(ChatHandler& handler) const void TicketMgr::SendTicket(WorldSession* session, GmTicket* ticket) const { - uint32 status = GMTICKET_STATUS_DEFAULT; - std::string message; - if (ticket) - { - message = ticket->GetMessage(); - status = GMTICKET_STATUS_HASTEXT; - } - - WorldPacket data(SMSG_GMTICKET_GETTICKET, (4 + 4 + (ticket ? message.length() + 1 + 4 + 4 + 4 + 1 + 1 : 0))); - data << uint32(status); // standard 0x0A, 0x06 if text present - data << uint32(ticket ? ticket->GetId() : 0); // ticketID + WorldPacket data(SMSG_GMTICKET_GETTICKET, (ticket ? (4 + 4 + 1 + 4 + 4 + 4 + 1 + 1) : 4)); if (ticket) - { - data << message.c_str(); // ticket text - data << uint8(0x7); // ticket category; why is this hardcoded? does it make a diff re: client? - - // we've got the easy stuff done by now. - // Now we need to go through the client logic for displaying various levels of ticket load ticket->WritePacket(data); - } + else + data << uint32(GMTICKET_STATUS_DEFAULT); + session->SendPacket(&data); } diff --git a/src/server/game/Tickets/TicketMgr.h b/src/server/game/Tickets/TicketMgr.h index ecf315c059c..63837e39452 100755 --- a/src/server/game/Tickets/TicketMgr.h +++ b/src/server/game/Tickets/TicketMgr.h @@ -82,7 +82,7 @@ class GmTicket { public: GmTicket(); - explicit GmTicket(Player* player, WorldPacket& recv_data); + explicit GmTicket(Player* player, WorldPacket& recvData); ~GmTicket(); bool IsClosed() const { return _closedBy; } @@ -142,6 +142,9 @@ public: std::string FormatMessageString(ChatHandler& handler, bool detailed = false) const; std::string FormatMessageString(ChatHandler& handler, const char* szClosedName, const char* szAssignedToName, const char* szUnassignedName, const char* szDeletedName) const; + void SetChatLog(std::list time, std::string const& log); + std::string GetChatLog() const { return _chatLog; } + private: uint32 _id; uint64 _playerGuid; @@ -160,7 +163,9 @@ private: GMTicketEscalationStatus _escalatedStatus; bool _viewed; bool _needResponse; // TODO: find out the use of this, and then store it in DB + bool _haveTicket; std::string _response; + std::string _chatLog; // No need to store in db, will be refreshed every session client side }; typedef std::map GmTicketList; diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index c29d8313c20..d9b517c098f 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -327,8 +327,8 @@ void CharacterDatabaseConnection::DoPrepareStatements() PREPARE_STATEMENT(CHAR_DEL_GO_RESPAWN_BY_INSTANCE, "DELETE FROM gameobject_respawn WHERE mapId = ? AND instanceId = ?", CONNECTION_ASYNC) // GM Tickets - PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed FROM gm_tickets", CONNECTION_SYNCH) - PREPARE_STATEMENT(CHAR_REP_GM_TICKET, "REPLACE INTO gm_tickets (ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, completed, escalated, viewed) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) + PREPARE_STATEMENT(CHAR_SEL_GM_TICKETS, "SELECT ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket FROM gm_tickets", CONNECTION_SYNCH) + PREPARE_STATEMENT(CHAR_REP_GM_TICKET, "REPLACE INTO gm_tickets (ticketId, guid, name, message, createTime, mapId, posX, posY, posZ, lastModifiedTime, closedBy, assignedTo, comment, response, completed, escalated, viewed, haveTicket) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_GM_TICKET, "DELETE FROM gm_tickets WHERE ticketId = ?", CONNECTION_ASYNC) PREPARE_STATEMENT(CHAR_DEL_PLAYER_GM_TICKETS, "DELETE FROM gm_tickets WHERE guid = ?", CONNECTION_ASYNC) -- cgit v1.2.3 From eae10134de6c0ed47e61e2d05b000e69ef3a21e8 Mon Sep 17 00:00:00 2001 From: durotar Date: Tue, 16 Oct 2012 19:41:36 -0500 Subject: Missing sql for previous commit --- .../world/2012_10_16_00_world_creature_text.sql | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 sql/updates/world/2012_10_16_00_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_16_00_world_creature_text.sql b/sql/updates/world/2012_10_16_00_world_creature_text.sql new file mode 100644 index 00000000000..aad3627a26a --- /dev/null +++ b/sql/updates/world/2012_10_16_00_world_creature_text.sql @@ -0,0 +1,36 @@ +-- Gnomeregan/Blastmaster Emi Shortfuse's event +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1090028 AND -1090000; +DELETE FROM `creature_text` WHERE `entry` IN (7361,7998); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +-- Emi Shortfuse +(7998,0,0, 'With your help, I can evaluate these tunnels.',12,0,100,0,0,0, 'SAY_BLASTMASTER_0'), +(7998,1,0, 'Let''s see if we can find out where these Troggs are coming from... and put a stop to the invasion!',12,0,100,0,0,0, 'SAY_BLASTMASTER_1'), +(7998,2,0, 'Such devastation... what horrible mess...',12,0,100,0,0,0, 'SAY_BLASTMASTER_2'), +(7998,3,0, 'It''s quiet here...',12,0,100,0,0,0, 'SAY_BLASTMASTER_3'), +(7998,4,0, '...too quiet.',12,0,100,0,0,0, 'SAY_BLASTMASTER_4'), +(7998,5,0, 'Look! Over there at the tunnel wall!',12,0,100,0,0,0, 'SAY_BLASTMASTER_5'), +(7998,6,0, 'Trogg incrusion! Defend me while I blast the hole closed!',12,0,100,0,0,0, 'SAY_BLASTMASTER_6'), +(7998,7,0, 'The charges are set. Get back before they blow!',12,0,100,0,0,0, 'SAY_BLASTMASTER_7'), +(7998,8,0, 'Incoming blast in 10 seconds!',14,0,100,0,0,0, 'SAY_BLASTMASTER_8'), +(7998,9,0, 'Incoming blast in 5 seconds. Clear the tunnel!',14,0,100,0,0,0, 'SAY_BLASTMASTER_9'), +(7998,10,0, 'FIRE IN THE HOLE!',14,0,100,0,0,0, 'SAY_BLASTMASTER_10'), +(7998,11,0, 'Well done! Without your help I would have never been able to thwart that wave of troggs.',12,0,100,0,0,0, 'SAY_BLASTMASTER_11'), +(7998,12,0, 'Did you hear something?',12,0,100,0,0,0, 'SAY_BLASTMASTER_12'), +(7998,13,0, 'I heard something over there.',12,0,100,0,0,0, 'SAY_BLASTMASTER_13'), +(7998,14,0, 'More troggs! Ward them off as I prepare the explosives!',12,0,100,0,0,0, 'SAY_BLASTMASTER_14'), +(7998,15,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_15'), +(7998,16,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_16'), +(7998,17,0, 'Incoming blast in 10 seconds!',14,0,100,0,0,0, 'SAY_BLASTMASTER_17'), +(7998,18,0, 'Incoming blast in 5 seconds. Clear the tunnel!',14,0,100,0,0,0, 'SAY_BLASTMASTER_18'), +(7998,19,0, 'I don''t think one charge is going to cut it. Keep fending them off!',12,0,100,0,0,0, 'SAY_BLASTMASTER_19'), +(7998,20,0, 'FIRE IN THE HOLE!',14,0,100,0,0,0, 'SAY_BLASTMASTER_20'), +(7998,21,0, 'Well done! Without your help I would have never been able to thwart that wave of troggs.',12,0,100,0,0,0, 'SAY_BLASTMASTER_21'), +(7998,22,0, 'Did you hear something?',12,0,100,0,0,0, 'SAY_BLASTMASTER_22'), +(7998,23,0, 'I heard something over there.',12,0,100,0,0,0, 'SAY_BLASTMASTER_23'), +(7998,24,0, 'More troggs! Ward them off as I prepare the explosives!',12,0,100,0,0,0, 'SAY_BLASTMASTER_24'), +(7998,25,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_25'), +(7998,26,0, '10 seconds to blast! Stand back!!!',14,0,100,0,0,0, 'SAY_BLASTMASTER_26'), +(7998,27,0, '5 seconds until detonation!!',14,0,100,0,0,0, 'SAY_BLASTMASTER_27'), +(7998,28,0, 'Superb! Because of your help, my people stand a chance of re-taking our belowed city. Three cheers to you!',12,0,100,0,0,0, 'SAY_BLASTMASTER_28'), +-- Grubbis +(7361,0,0, 'We come from below! You can never stop us!',14,0,100,0,0,0, 'SAY_GRUBBIS'); -- cgit v1.2.3 From 6abc6253a63b366b3d0259278889a83a756e9745 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 17 Oct 2012 02:56:07 +0200 Subject: DB: Add gm_tickets changes to base character db --- sql/base/characters_database.sql | 2 ++ sql/updates/characters/2012_10_17_00_character_gm_tickets.sql | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index b1c57a2f5fb..4a2d2951da3 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1429,9 +1429,11 @@ CREATE TABLE `gm_tickets` ( `closedBy` int(10) NOT NULL DEFAULT '0', `assignedTo` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'GUID of admin to whom ticket is assigned', `comment` text NOT NULL, + `response` text NOT NULL, `completed` tinyint(3) unsigned NOT NULL DEFAULT '0', `escalated` tinyint(3) unsigned NOT NULL DEFAULT '0', `viewed` tinyint(3) unsigned NOT NULL DEFAULT '0', + `haveTicket` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`ticketId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql b/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql index c41df0c115d..affb23f836c 100644 --- a/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql +++ b/sql/updates/characters/2012_10_17_00_character_gm_tickets.sql @@ -1,3 +1,3 @@ ALTER TABLE `gm_tickets` - ADD COLUMN `response` TEXT NOT NULL AFTER `comment`, - ADD COLUMN `haveTicket` TINYINT(3) UNSIGNED NOT NULL AFTER `viewed`; + ADD COLUMN `response` text NOT NULL AFTER `comment`, + ADD COLUMN `haveTicket` tinyint(3) unsigned NOT NULL DEFAULT '0' AFTER `viewed`; -- cgit v1.2.3 From 27f091806a6f52f406837d188dd4171019bfa59b Mon Sep 17 00:00:00 2001 From: Subv Date: Tue, 16 Oct 2012 21:43:23 -0500 Subject: Core/SpellAreas: Changed the way quest_start and quest_end works. They now follow this rule: The player's quest status of quest_start must have the mask defined in quest_start_status in order for the spell to be applied/kept. The player's quest status of quest_end must _NOT_ have the mask defined in quest_end_status in order for the spell to be removed To generate the mask: Take the QuestStatus enum in QuestDef.h, use (1 << theValueYouWant) to obtain a mask and you can use | to combine masks. This expands the usage of the spell_area table, making possible to give a player an aura while he has a quest, but remove it as soon as the quest is completed (not rewarded). Feature request by @Svannon --- .../world/2012_10_16_00_world_spell_area.sql | 4 ++ src/server/game/Entities/Player/Player.cpp | 64 ++++++++-------------- src/server/game/Spells/SpellMgr.cpp | 44 +++++---------- src/server/game/Spells/SpellMgr.h | 6 +- 4 files changed, 46 insertions(+), 72 deletions(-) create mode 100644 sql/updates/world/2012_10_16_00_world_spell_area.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_16_00_world_spell_area.sql b/sql/updates/world/2012_10_16_00_world_spell_area.sql new file mode 100644 index 00000000000..3dbc29d077f --- /dev/null +++ b/sql/updates/world/2012_10_16_00_world_spell_area.sql @@ -0,0 +1,4 @@ +ALTER TABLE `spell_area` ADD COLUMN `quest_start_status` INT(11) NOT NULL DEFAULT 64; -- default is QUEST_STATUS_REWARDED +ALTER TABLE `spell_area` ADD COLUMN `quest_end_status` INT(11) NOT NULL DEFAULT 11; -- default is QUEST_STATUS_COMPLETE | QUEST_STATUS_NONE | QUEST_STATUS_INCOMPLETE +UPDATE spell_area SET `quest_start_status` = (1 << 6) | (1 << 3) | (1 << 1) WHERE `quest_start_active` = 1; +ALTER TABLE spell_area DROP COLUMN `quest_start_active`; \ No newline at end of file diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index d22aba92f9e..501379228e2 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -14980,19 +14980,6 @@ void Player::AddQuest(Quest const* quest, Object* questGiver) if (questGiver && quest->GetQuestStartScript() != 0) GetMap()->ScriptsStart(sQuestStartScripts, quest->GetQuestStartScript(), questGiver, this); - // Some spells applied at quest activation - SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id, true); - if (saBounds.first != saBounds.second) - { - uint32 zone, area; - GetZoneAndAreaId(zone, area); - - for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area)) - if (!HasAura(itr->second->spellId)) - CastSpell(this, itr->second->spellId, true); - } - UpdateForQuestWorldObjects(); } @@ -15181,33 +15168,6 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT); UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, quest->GetQuestId()); - uint32 zone = 0; - uint32 area = 0; - - // remove auras from spells with quest reward state limitations - SpellAreaForQuestMapBounds saEndBounds = sSpellMgr->GetSpellAreaForQuestEndMapBounds(quest_id); - if (saEndBounds.first != saEndBounds.second) - { - GetZoneAndAreaId(zone, area); - - for (SpellAreaForAreaMap::const_iterator itr = saEndBounds.first; itr != saEndBounds.second; ++itr) - if (!itr->second->IsFitToRequirements(this, zone, area)) - RemoveAurasDueToSpell(itr->second->spellId); - } - - // Some spells applied at quest reward - SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id, false); - if (saBounds.first != saBounds.second) - { - if (!zone || !area) - GetZoneAndAreaId(zone, area); - - for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area)) - if (!HasAura(itr->second->spellId)) - CastSpell(this, itr->second->spellId, true); - } - //lets remove flag for delayed teleports SetCanDelayTeleport(false); } @@ -15750,6 +15710,30 @@ void Player::SetQuestStatus(uint32 quest_id, QuestStatus status) m_QuestStatusSave[quest_id] = true; } + uint32 zone = 0, area = 0; + + SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id); + if (saBounds.first != saBounds.second) + { + GetZoneAndAreaId(zone, area); + + for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) + if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area)) + if (!HasAura(itr->second->spellId)) + CastSpell(this, itr->second->spellId, true); + } + + saBounds = sSpellMgr->GetSpellAreaForQuestEndMapBounds(quest_id); + if (saBounds.first != saBounds.second) + { + if (!zone || !area) + GetZoneAndAreaId(zone, area); + + for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) + if (!itr->second->IsFitToRequirements(this, zone, area)) + RemoveAurasDueToSpell(itr->second->spellId); + } + UpdateForQuestWorldObjects(); } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7c2ea8fbe9f..06f1187a833 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1061,12 +1061,9 @@ SpellAreaMapBounds SpellMgr::GetSpellAreaMapBounds(uint32 spell_id) const return SpellAreaMapBounds(mSpellAreaMap.lower_bound(spell_id), mSpellAreaMap.upper_bound(spell_id)); } -SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds(uint32 quest_id, bool active) const +SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestMapBounds(uint32 quest_id) const { - if (active) - return SpellAreaForQuestMapBounds(mSpellAreaForActiveQuestMap.lower_bound(quest_id), mSpellAreaForActiveQuestMap.upper_bound(quest_id)); - else - return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id), mSpellAreaForQuestMap.upper_bound(quest_id)); + return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id), mSpellAreaForQuestMap.upper_bound(quest_id)); } SpellAreaForQuestMapBounds SpellMgr::GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const @@ -1099,11 +1096,11 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 return false; if (questStart) // not in expected required quest state - if (!player || ((!questStartCanActive || !player->IsActiveQuest(questStart)) && !player->GetQuestRewardStatus(questStart))) + if (!player || (((1 << player->GetQuestStatus(questStart)) & questStartStatus) == 0)) return false; if (questEnd) // not in expected forbidden quest state - if (!player || player->GetQuestRewardStatus(questEnd)) + if (!player || (((1 << player->GetQuestStatus(questEnd)) & questEndStatus) == 0)) return false; if (auraSpell) // not have expected aura @@ -2433,12 +2430,11 @@ void SpellMgr::LoadSpellAreas() mSpellAreaMap.clear(); // need for reload case mSpellAreaForQuestMap.clear(); - mSpellAreaForActiveQuestMap.clear(); mSpellAreaForQuestEndMap.clear(); mSpellAreaForAuraMap.clear(); - // 0 1 2 3 4 5 6 7 8 - QueryResult result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_active, quest_end, aura_spell, racemask, gender, autocast FROM spell_area"); + // 0 1 2 3 4 5 6 7 8 9 + QueryResult result = WorldDatabase.Query("SELECT spell, area, quest_start, quest_start_status, quest_end_status, quest_end, aura_spell, racemask, gender, autocast FROM spell_area"); if (!result) { @@ -2457,12 +2453,13 @@ void SpellMgr::LoadSpellAreas() spellArea.spellId = spell; spellArea.areaId = fields[1].GetUInt32(); spellArea.questStart = fields[2].GetUInt32(); - spellArea.questStartCanActive = fields[3].GetBool(); - spellArea.questEnd = fields[4].GetUInt32(); - spellArea.auraSpell = fields[5].GetInt32(); - spellArea.raceMask = fields[6].GetUInt32(); - spellArea.gender = Gender(fields[7].GetUInt8()); - spellArea.autocast = fields[8].GetBool(); + spellArea.questStartStatus = fields[3].GetUInt32(); + spellArea.questEndStatus = fields[4].GetUInt32(); + spellArea.questEnd = fields[5].GetUInt32(); + spellArea.auraSpell = fields[6].GetInt32(); + spellArea.raceMask = fields[7].GetUInt32(); + spellArea.gender = Gender(fields[8].GetUInt8()); + spellArea.autocast = fields[9].GetBool(); if (SpellInfo const* spellInfo = GetSpellInfo(spell)) { @@ -2494,7 +2491,7 @@ void SpellMgr::LoadSpellAreas() continue; // duplicate by requirements - ok =false; + ok = false; break; } @@ -2524,12 +2521,6 @@ void SpellMgr::LoadSpellAreas() sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd); continue; } - - if (spellArea.questEnd == spellArea.questStart && !spellArea.questStartCanActive) - { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd); - continue; - } } if (spellArea.auraSpell) @@ -2605,12 +2596,7 @@ void SpellMgr::LoadSpellAreas() // for search at quest start/reward if (spellArea.questStart) - { - if (spellArea.questStartCanActive) - mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa)); - else - mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa)); - } + mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa)); // for search at quest start/reward if (spellArea.questEnd) diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 9646bc9dabf..cec9d4650f5 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -495,7 +495,8 @@ struct SpellArea int32 auraSpell; // spell aura must be applied for spell apply)if possitive) and it must not be applied in other case uint32 raceMask; // can be applied only to races Gender gender; // can be applied only to gender - bool questStartCanActive; // if true then quest start can be active (not only rewarded) + uint32 questStartStatus; // QuestStatus that quest_start must have in order to keep the spell + uint32 questEndStatus; // QuestStatus that the quest_end must have in order to keep the spell (if the quest_end's status is different than this, the spell will be dropped) bool autocast; // if true then auto applied at area enter, in other case just allowed to cast // helpers @@ -681,7 +682,7 @@ class SpellMgr // Spell area SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const; - SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id, bool active) const; + SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id) const; SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const; SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const; SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const; @@ -740,7 +741,6 @@ class SpellMgr EnchantCustomAttribute mEnchantCustomAttr; SpellAreaMap mSpellAreaMap; SpellAreaForQuestMap mSpellAreaForQuestMap; - SpellAreaForQuestMap mSpellAreaForActiveQuestMap; SpellAreaForQuestMap mSpellAreaForQuestEndMap; SpellAreaForAuraMap mSpellAreaForAuraMap; SpellAreaForAreaMap mSpellAreaForAreaMap; -- cgit v1.2.3 From 479d34d2a0e54c13160d8f52c37dbf691d14d933 Mon Sep 17 00:00:00 2001 From: Spp Date: Thu, 18 Oct 2012 14:31:28 +0200 Subject: Core/Dungeon Finder: Minor optimizations - Internal changes in store types - Remove of (Player *) and (Group *) From LFGMgr.cpp (step 2) --- .../world/2012_10_18_00_world_trinity_string.sql | 16 + src/server/game/DungeonFinding/LFG.h | 13 +- src/server/game/DungeonFinding/LFGGroupData.cpp | 42 +- src/server/game/DungeonFinding/LFGGroupData.h | 14 + src/server/game/DungeonFinding/LFGMgr.cpp | 700 +++++++++++---------- src/server/game/DungeonFinding/LFGMgr.h | 90 +-- src/server/game/DungeonFinding/LFGPlayerData.cpp | 38 +- src/server/game/DungeonFinding/LFGPlayerData.h | 22 +- src/server/game/DungeonFinding/LFGScripts.cpp | 92 +-- src/server/game/Handlers/LFGHandler.cpp | 103 ++- src/server/game/Miscellaneous/Language.h | 17 +- 11 files changed, 644 insertions(+), 503 deletions(-) create mode 100644 sql/updates/world/2012_10_18_00_world_trinity_string.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_18_00_world_trinity_string.sql b/sql/updates/world/2012_10_18_00_world_trinity_string.sql new file mode 100644 index 00000000000..8d62174d868 --- /dev/null +++ b/sql/updates/world/2012_10_18_00_world_trinity_string.sql @@ -0,0 +1,16 @@ +REPLACE INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) +VALUES + (11015, 'Error', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11014, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11013, 'Leader', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11012, 'Dps', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11011, 'Healer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11010, 'Tank', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11009, 'Raid browser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11008, 'Finished dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11007, 'In dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11006, 'Vote kick', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11005, 'Proposal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11004, 'Queued', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11003, 'Role check', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (11002, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/src/server/game/DungeonFinding/LFG.h b/src/server/game/DungeonFinding/LFG.h index c00cc830ce8..abdb0ffa511 100755 --- a/src/server/game/DungeonFinding/LFG.h +++ b/src/server/game/DungeonFinding/LFG.h @@ -39,7 +39,7 @@ enum LfgRoles enum LfgUpdateType { LFG_UPDATETYPE_DEFAULT = 0, // Internal Use - LFG_UPDATETYPE_LEADER = 1, + LFG_UPDATETYPE_LEADER_UNK1 = 1, // FIXME: At group leave LFG_UPDATETYPE_ROLECHECK_ABORTED = 4, LFG_UPDATETYPE_JOIN_PROPOSAL = 5, LFG_UPDATETYPE_ROLECHECK_FAILED = 6, @@ -51,7 +51,7 @@ enum LfgUpdateType LFG_UPDATETYPE_PROPOSAL_BEGIN = 13, LFG_UPDATETYPE_CLEAR_LOCK_LIST = 14, LFG_UPDATETYPE_GROUP_MEMBER_OFFLINE = 15, - LFG_UPDATETYPE_GROUP_DISBAND = 16 + LFG_UPDATETYPE_GROUP_DISBAND_UNK16 = 16, // FIXME: Sometimes at group disband }; enum LfgState @@ -69,7 +69,6 @@ enum LfgState /// Instance lock types enum LfgLockStatusType { - LFG_LOCKSTATUS_OK = 0, // Internal use only LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION = 1, LFG_LOCKSTATUS_TOO_LOW_LEVEL = 2, LFG_LOCKSTATUS_TOO_HIGH_LEVEL = 3, @@ -92,18 +91,12 @@ enum LfgAnswer LFG_ANSWER_AGREE = 1 }; -/// Dungeon and reason why player can't join -struct LfgLockStatus -{ - uint32 dungeon; ///< Dungeon Id - LfgLockStatusType lockstatus; ///< Lock type -}; - typedef std::set LfgDungeonSet; typedef std::map LfgLockMap; typedef std::map LfgLockPartyMap; typedef std::set LfgGuidSet; typedef std::list LfgGuidList; typedef std::map LfgRolesMap; +typedef std::map LfgGroupsMap; #endif diff --git a/src/server/game/DungeonFinding/LFGGroupData.cpp b/src/server/game/DungeonFinding/LFGGroupData.cpp index cbcb1d130bb..712ae5132b0 100644 --- a/src/server/game/DungeonFinding/LFGGroupData.cpp +++ b/src/server/game/DungeonFinding/LFGGroupData.cpp @@ -19,7 +19,7 @@ #include "LFGGroupData.h" LfgGroupData::LfgGroupData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE), - m_Dungeon(0), m_KicksLeft(LFG_GROUP_MAX_KICKS) + m_Leader(0), m_Dungeon(0), m_KicksLeft(LFG_GROUP_MAX_KICKS) { } LfgGroupData::~LfgGroupData() @@ -34,9 +34,9 @@ void LfgGroupData::SetState(LfgState state) { switch (state) { + case LFG_STATE_FINISHED_DUNGEON: case LFG_STATE_NONE: case LFG_STATE_DUNGEON: - case LFG_STATE_FINISHED_DUNGEON: m_OldState = state; // No break on purpose default: @@ -49,6 +49,29 @@ void LfgGroupData::RestoreState() m_State = m_OldState; } +void LfgGroupData::AddPlayer(uint64 guid) +{ + m_Players.insert(guid); +} + +uint8 LfgGroupData::RemovePlayer(uint64 guid) +{ + LfgGuidSet::iterator it = m_Players.find(guid); + if (it != m_Players.end()) + m_Players.erase(it); + return uint8(m_Players.size()); +} + +void LfgGroupData::RemoveAllPlayers() +{ + m_Players.clear(); +} + +void LfgGroupData::SetLeader(uint64 guid) +{ + m_Leader = guid; +} + void LfgGroupData::SetDungeon(uint32 dungeon) { m_Dungeon = dungeon; @@ -65,6 +88,21 @@ LfgState LfgGroupData::GetState() const return m_State; } +LfgState LfgGroupData::GetOldState() const +{ + return m_OldState; +} + +const LfgGuidSet &LfgGroupData::GetPlayers() const +{ + return m_Players; +} + +uint64 LfgGroupData::GetLeader() const +{ + return m_Leader; +} + uint32 LfgGroupData::GetDungeon(bool asId /* = true */) const { if (asId) diff --git a/src/server/game/DungeonFinding/LFGGroupData.h b/src/server/game/DungeonFinding/LFGGroupData.h index 359f7be7eee..43cd64f97c3 100644 --- a/src/server/game/DungeonFinding/LFGGroupData.h +++ b/src/server/game/DungeonFinding/LFGGroupData.h @@ -35,18 +35,30 @@ class LfgGroupData ~LfgGroupData(); bool IsLfgGroup(); + // General void SetState(LfgState state); void RestoreState(); + void AddPlayer(uint64 guid); + uint8 RemovePlayer(uint64 guid); + void RemoveAllPlayers(); + void SetLeader(uint64 guid); + // Dungeon void SetDungeon(uint32 dungeon); + // VoteKick void DecreaseKicksLeft(); // General LfgState GetState() const; + LfgState GetOldState() const; + LfgGuidSet const& GetPlayers() const; + uint64 GetLeader() const; + // Dungeon uint32 GetDungeon(bool asId = true) const; + // VoteKick uint8 GetKicksLeft() const; @@ -54,6 +66,8 @@ class LfgGroupData // General LfgState m_State; ///< State if group in LFG LfgState m_OldState; ///< Old State + uint64 m_Leader; ///< Leader GUID + LfgGuidSet m_Players; ///< Players in group // Dungeon uint32 m_Dungeon; ///< Dungeon entry // Vote Kick diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 1b4a2fcdda3..af12ce93c65 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -34,8 +34,6 @@ LFGMgr::LFGMgr(): m_QueueTimer(0), m_lfgProposalId(1), m_options(sWorld->getBoolConfig(CONFIG_DUNGEON_FINDER_ENABLE)), - m_WaitTimeAvg(-1), m_WaitTimeTank(-1), m_WaitTimeHealer(-1), m_WaitTimeDps(-1), - m_NumWaitTimeAvg(0), m_NumWaitTimeTank(0), m_NumWaitTimeHealer(0), m_NumWaitTimeDps(0), m_lfgPlayerScript(new LFGPlayerScript()), m_lfgGroupScript(new LFGGroupScript()) { } @@ -121,64 +119,67 @@ std::string LFGMgr::GetRolesString(uint8 roles) std::string rolesstr = ""; if (roles & PLAYER_ROLE_TANK) - rolesstr.append("Tank"); + rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_TANK)); if (roles & PLAYER_ROLE_HEALER) { if (!rolesstr.empty()) rolesstr.append(", "); - rolesstr.append("Healer"); + rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_HEALER)); } if (roles & PLAYER_ROLE_DAMAGE) { if (!rolesstr.empty()) rolesstr.append(", "); - rolesstr.append("Dps"); + rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_DAMAGE)); } if (roles & PLAYER_ROLE_LEADER) { if (!rolesstr.empty()) rolesstr.append(", "); - rolesstr.append("Leader"); + rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_LEADER)); } if (rolesstr.empty()) - rolesstr.append("None"); + rolesstr.append(sObjectMgr->GetTrinityStringForDBCLocale(LANG_LFG_ROLE_NONE)); return rolesstr; } char const * LFGMgr::GetStateString(LfgState state) { + int32 entry = LANG_LFG_ERROR; switch (state) { case LFG_STATE_NONE: - return "None"; + entry = LANG_LFG_STATE_NONE; break; case LFG_STATE_ROLECHECK: - return "Rolecheck"; + entry = LANG_LFG_STATE_ROLECHECK; break; case LFG_STATE_QUEUED: - return "Queued"; + entry = LANG_LFG_STATE_QUEUED; break; case LFG_STATE_PROPOSAL: - return "Proposal"; + entry = LANG_LFG_STATE_PROPOSAL; break; case LFG_STATE_DUNGEON: - return "In Dungeon"; + entry = LANG_LFG_STATE_DUNGEON; break; case LFG_STATE_BOOT: - return "Boot Player"; + entry = LANG_LFG_STATE_BOOT; break; case LFG_STATE_FINISHED_DUNGEON: - return "Finished"; + entry = LANG_LFG_STATE_FINISHED_DUNGEON; break; case LFG_STATE_RAIDBROWSER: - return "RaidBrowser"; + entry = LANG_LFG_STATE_RAIDBROWSER; + break; } - return "Error"; + char const * const str = sObjectMgr->GetTrinityStringForDBCLocale(entry); + return str; } /// Load rewards for completing dungeons @@ -488,20 +489,22 @@ void LFGMgr::Update(uint32 diff) waitTime = -1; break; case PLAYER_ROLE_TANK: - waitTime = m_WaitTimeTank; + waitTime = m_waitTimesTank.time; break; case PLAYER_ROLE_HEALER: - waitTime = m_WaitTimeHealer; + waitTime = m_waitTimesHealer.time; break; case PLAYER_ROLE_DAMAGE: - waitTime = m_WaitTimeDps; + waitTime = m_waitTimesDps.time; break; default: - waitTime = m_WaitTimeAvg; + waitTime = m_waitTimesAvg.time; break; } - LfgQueueStatusData queueData(dungeonId, waitTime, m_WaitTimeAvg, m_WaitTimeTank, m_WaitTimeHealer, m_WaitTimeDps, queuedTime, queue->tanks, queue->healers, queue->dps); + LfgQueueStatusData queueData(dungeonId, waitTime, m_waitTimesAvg.time, m_waitTimesTank.time, + m_waitTimesHealer.time, m_waitTimesDps.time, queuedTime, + queue->tanks, queue->healers, queue->dps); for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer) SendLfgQueueStatus(itPlayer->first, queueData); } @@ -648,7 +651,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const uint64 guid = player->GetGUID(); uint64 gguid = grp ? grp->GetGUID() : guid; LfgJoinResultData joinData; - PlayerSet players; + LfgGuidSet players; uint32 rDungeonId = 0; bool isContinue = grp && grp->isLFGGroup() && GetState(gguid) != LFG_STATE_FINISHED_DUNGEON; @@ -707,15 +710,16 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const else if (plrg->InBattleground() || plrg->InArena() || plrg->InBattlegroundQueue()) joinData.result = LFG_JOIN_USING_BG_SYSTEM; ++memberCount; - players.insert(plrg); + players.insert(plrg->GetGUID()); } } - if (memberCount != grp->GetMembersCount()) + + if (joinData.result == LFG_JOIN_OK && memberCount != grp->GetMembersCount()) joinData.result = LFG_JOIN_DISCONNECTED; } } else - players.insert(player); + players.insert(player->GetGUID()); // Check if all dungeons are valid bool isRaid = false; @@ -865,57 +869,52 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const Leaves Dungeon System. Player/Group is removed from queue, rolechecks, proposals or votekicks. Player or group needs to be not NULL and using Dungeon System - @param[in] player Player trying to leave (can be NULL) - @param[in] grp Group trying to leave (default NULL) + @param[in] guid Player or group guid */ -void LFGMgr::LeaveLfg(Player* player, Group* grp /* = NULL*/) +void LFGMgr::LeaveLfg(uint64 guid) { - if (!player && !grp) - return; - - uint64 guid = grp ? grp->GetGUID() : player->GetGUID(); LfgState state = GetState(guid); + uint64 gguid = IS_GROUP(guid) ? guid : GetGroup(guid); sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::Leave: [" UI64FMTD "]", guid); switch (state) { case LFG_STATE_QUEUED: + if (gguid) { - RemoveFromQueue(guid); - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); - if (grp) + RemoveFromQueue(gguid); + RestoreState(gguid, "Leave queue"); + const LfgGuidSet& players = GetPlayers(gguid); + for (LfgGuidSet::const_iterator it = players.begin(); it != players.end(); ++it) { - RestoreState(guid, "Leave queue"); - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) - if (Player* plrg = itr->getSource()) - { - plrg->GetSession()->SendLfgUpdateParty(updateData); - uint64 pguid = plrg->GetGUID(); - ClearState(pguid, "Leave queue"); - } - } - else - { - player->GetSession()->SendLfgUpdatePlayer(updateData); + uint64 guid = (*it); ClearState(guid, "Leave queue"); + SendLfgUpdateParty(guid, LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE)); } } + else + { + RemoveFromQueue(guid); + SendLfgUpdatePlayer(guid, LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE)); + ClearState(guid, "Leave queue"); + } break; case LFG_STATE_ROLECHECK: - if (grp) - UpdateRoleCheck(guid); // No player to update role = LFG_ROLECHECK_ABORTED + if (gguid) + UpdateRoleCheck(gguid); // No player to update role = LFG_ROLECHECK_ABORTED break; case LFG_STATE_PROPOSAL: { // Remove from Proposals LfgProposalMap::iterator it = m_Proposals.begin(); + uint64 pguid = gguid == guid ? GetLeader(gguid) : guid; while (it != m_Proposals.end()) { - LfgProposalPlayerMap::iterator itPlayer = it->second->players.find(player ? player->GetGUID() : grp->GetLeaderGUID()); + LfgProposalPlayerMap::iterator itPlayer = it->second->players.find(pguid); if (itPlayer != it->second->players.end()) { // Mark the player/leader of group who left as didn't accept the proposal - itPlayer->second->accept = LFG_ANSWER_DENY; + itPlayer->second.accept = LFG_ANSWER_DENY; break; } ++it; @@ -931,21 +930,6 @@ void LFGMgr::LeaveLfg(Player* player, Group* grp /* = NULL*/) } } -/** - Sends the leader of a group the offer to continue popup - - @param[in] grp Group to send offer to -*/ -void LFGMgr::OfferContinue(Group* grp) -{ - if (grp) - { - uint64 gguid = grp->GetGUID(); - if (Player* leader = ObjectAccessor::FindPlayer(grp->GetLeaderGUID())) - leader->GetSession()->SendLfgOfferContinue(GetDungeon(gguid, false)); - } -} - /** Checks que main queue to try to form a Lfg group. Returns first match found (if any) @@ -1022,7 +1006,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) uint8 numPlayers = 0; uint8 numLfgGroups = 0; - uint32 groupLowGuid = 0; + uint64 groupGuid = 0; LfgQueueInfoMap pqInfoMap; for (LfgGuidList::const_iterator it = check.begin(); it != check.end() && numLfgGroups < 2 && numPlayers <= MAXGROUPSIZE; ++it) { @@ -1039,12 +1023,11 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (IS_GROUP(guid)) { - uint32 lowGuid = GUID_LOPART(guid); - if (Group* grp = sGroupMgr->GetGroupByGUID(lowGuid)) + if (Group* grp = sGroupMgr->GetGroupByGUID(GUID_LOPART(guid))) if (grp->isLFGGroup()) { if (!numLfgGroups) - groupLowGuid = lowGuid; + groupGuid = guid; ++numLfgGroups; } } @@ -1082,25 +1065,16 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) if (rolesMap.size() != numPlayers) // Player in multiples queues! return false; - PlayerSet players; + LfgGuidSet players; for (LfgRolesMap::const_iterator it = rolesMap.begin(); it != rolesMap.end(); ++it) { - Player* player = ObjectAccessor::FindPlayer(it->first); - if (!player) - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Warning! [" UI64FMTD "] offline! Marking as not compatibles!", strGuids.c_str(), it->first); - else - { - for (PlayerSet::const_iterator itPlayer = players.begin(); itPlayer != players.end() && player; ++itPlayer) - { - if (HasIgnore((*itPlayer)->GetGUID(), player->GetGUID())) - { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) Players [" UI64FMTD "] and [" UI64FMTD "] ignoring", strGuids.c_str(), (*itPlayer)->GetGUID(), player->GetGUID()); - player = NULL; - } - } - if (player) - players.insert(player); - } + uint64 guid = it->first; + LfgRolesMap::const_iterator it2 = ++it; + for (; it2 != rolesMap.end(); ++it2) + if (HasIgnore(guid, it2->first)) + break; + if (it2 == rolesMap.end()) + players.insert(guid); } // if we dont have the same ammount of players then we have self ignoring candidates or different faction groups @@ -1159,17 +1133,15 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) --Dps_Needed; } } - for (PlayerSet::const_iterator itPlayers = players.begin(); itPlayers != players.end(); ++itPlayers) + + for (LfgGuidSet::const_iterator itPlayers = players.begin(); itPlayers != players.end(); ++itPlayers) { for (LfgQueueInfoMap::const_iterator itQueue = pqInfoMap.begin(); itQueue != pqInfoMap.end(); ++itQueue) { - LfgQueueInfo* queue = itQueue->second; - if (!queue) - continue; - - for (LfgRolesMap::const_iterator itPlayer = queue->roles.begin(); itPlayer != queue->roles.end(); ++itPlayer) + if (LfgQueueInfo* queue = itQueue->second) { - if (*itPlayers == ObjectAccessor::FindPlayer(itPlayer->first)) + LfgRolesMap::const_iterator itPlayer = queue->roles.find(*itPlayers); + if (itPlayer != queue->roles.end()) { queue->tanks = Tanks_Needed; queue->healers = Healers_Needed; @@ -1178,6 +1150,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) } } } + return true; } sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) MATCH! Group formed", strGuids.c_str()); @@ -1193,36 +1166,37 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) pProposal->cancelTime = time_t(time(NULL)) + LFG_TIME_PROPOSAL; pProposal->state = LFG_PROPOSAL_INITIATING; pProposal->queues = check; - pProposal->groupLowGuid = groupLowGuid; + pProposal->group = groupGuid; + pProposal->isNew = true; // Assign new roles to players and assign new leader - PlayerSet::const_iterator itPlayers = players.begin(); + LfgGuidSet::const_iterator itPlayers = players.begin(); if (!leader) { uint8 pos = uint8(urand(0, players.size() - 1)); for (uint8 i = 0; i < pos; ++i) ++itPlayers; - leader = (*itPlayers)->GetGUID(); + leader = *itPlayers; } pProposal->leader = leader; uint8 numAccept = 0; for (itPlayers = players.begin(); itPlayers != players.end(); ++itPlayers) { - uint64 guid = (*itPlayers)->GetGUID(); - LfgProposalPlayer* ppPlayer = new LfgProposalPlayer(); - if (Group* grp = (*itPlayers)->GetGroup()) + uint64 guid = *itPlayers; + LfgProposalPlayer& player = pProposal->players[guid]; + uint64 gguid = GetGroup(guid); + player.group = gguid; + if (gguid == groupGuid) { - ppPlayer->groupLowGuid = grp->GetLowGUID(); - if (grp->isLFGGroup()) // Player from existing group, autoaccept - { - ppPlayer->accept = LFG_ANSWER_AGREE; - ++numAccept; - } + player.accept = LFG_ANSWER_AGREE; + ++numAccept; } - ppPlayer->role = rolesMap[guid]; - pProposal->players[guid] = ppPlayer; + player.role = rolesMap[guid]; + if (pProposal->group && pProposal->group != gguid) + pProposal->isNew = false; } + if (numAccept == MAXGROUPSIZE) pProposal->state = LFG_PROPOSAL_SUCCESS; @@ -1270,7 +1244,6 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* } } - uint8 team = 0; LfgDungeonSet dungeons; if (roleCheck.rDungeonId) dungeons.insert(roleCheck.rDungeonId); @@ -1291,7 +1264,6 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* continue; } - team = uint8(plrg->GetTeam()); if (!sendRoleChosen) SendLfgRoleChosen(pguid, guid, roles); @@ -1333,6 +1305,7 @@ void LFGMgr::UpdateRoleCheck(uint64 gguid, uint64 guid /* = 0 */, uint8 roles /* --pqInfo->dps; } + uint8 team = GetTeam(guid); m_QueueInfoMap[gguid] = pqInfo; if (GetState(gguid) != LFG_STATE_NONE) { @@ -1402,12 +1375,12 @@ LfgAnswer LFGMgr::GetCompatibles(std::string key) @param[in] players Set of players to check their dungeon restrictions @param[out] lockMap Map of players Lock status info of given dungeons (Empty if dungeons is not empty) */ -void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& players, LfgLockPartyMap& lockMap) +void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const LfgGuidSet& players, LfgLockPartyMap& lockMap) { lockMap.clear(); - for (PlayerSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it) + for (LfgGuidSet::const_iterator it = players.begin(); it != players.end() && !dungeons.empty(); ++it) { - uint64 guid = (*it)->GetGUID(); + uint64 guid = (*it); LfgLockMap const& cachedLockMap = GetLockedDungeons(guid); for (LfgLockMap::const_iterator it2 = cachedLockMap.begin(); it2 != cachedLockMap.end() && !dungeons.empty(); ++it2) { @@ -1497,6 +1470,79 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true return (tank + healer + damage) == uint8(groles.size()); } +/** + Makes a new group given a proposal + @param[in] proposal Proposal to get info from +*/ +void LFGMgr::MakeNewGroup(const LfgProposal& proposal) +{ + LfgGuidList players; + LfgGuidList playersToTeleport; + + for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) + { + uint64 guid = it->first; + if (guid == proposal.leader) + players.push_front(guid); + else + players.push_back(guid); + + if (GetGroup(guid) != proposal.group || GetState(proposal.group) == LFG_STATE_FINISHED_DUNGEON) + playersToTeleport.push_back(guid); + } + + // Set the dungeon difficulty + LFGDungeonEntry const* dungeon = GetLFGDungeon(proposal.dungeonId); + ASSERT(dungeon); + + Group* grp = proposal.group ? sGroupMgr->GetGroupByGUID(GUID_LOPART(proposal.group)) : NULL; + for (LfgGuidList::const_iterator it = players.begin(); it != players.end(); ++it) + { + uint64 pguid = (*it); + Player* player = ObjectAccessor::FindPlayer(pguid); + if (!player) + continue; + + Group* group = player->GetGroup(); + if (group && group != grp) + player->RemoveFromGroup(); + + if (!grp) + { + grp = new Group(); + grp->ConvertToLFG(); + grp->Create(player); + uint64 gguid = grp->GetGUID(); + SetState(gguid, LFG_STATE_PROPOSAL); + sGroupMgr->AddGroup(grp); + } + else if (group != grp) + grp->AddMember(player); + + grp->SetLfgRoles(pguid, proposal.players.find(pguid)->second.role); + SetState(pguid, LFG_STATE_DUNGEON); + + // Add the cooldown spell if queued for a random dungeon + if (dungeon->type == LFG_TYPE_RANDOM) + player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); + } + + grp->SetDungeonDifficulty(Difficulty(dungeon->difficulty)); + uint64 gguid = grp->GetGUID(); + SetDungeon(gguid, dungeon->Entry()); + SetState(gguid, LFG_STATE_DUNGEON); + + _SaveToDB(gguid, grp->GetDbStoreId()); + + // Teleport Player + for (LfgGuidList::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) + if (Player* player = ObjectAccessor::FindPlayer(*it)) + TeleportPlayer(player, false); + + // Update group info + grp->SendUpdate(); +} + /** Update Proposal info with player answer @@ -1510,15 +1556,17 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) LfgProposalMap::iterator itProposal = m_Proposals.find(proposalId); if (itProposal == m_Proposals.end()) return; - LfgProposal* pProposal = itProposal->second; + + LfgProposal& proposal = *(itProposal->second); // Check if proposal have the current player - LfgProposalPlayerMap::iterator itProposalPlayer = pProposal->players.find(guid); - if (itProposalPlayer == pProposal->players.end()) + LfgProposalPlayerMap::iterator itProposalPlayer = proposal.players.find(guid); + if (itProposalPlayer == proposal.players.end()) return; - LfgProposalPlayer* ppPlayer = itProposalPlayer->second; - ppPlayer->accept = LfgAnswer(accept); + LfgProposalPlayer& player = itProposalPlayer->second; + player.accept = LfgAnswer(accept); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Player [" UI64FMTD "] of proposal %u selected: %u", guid, proposalId, accept); if (!accept) { @@ -1526,157 +1574,77 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) return; } - LfgPlayerList players; - LfgPlayerList playersToTeleport; - // check if all have answered and reorder players (leader first) bool allAnswered = true; - for (LfgProposalPlayerMap::const_iterator itPlayers = pProposal->players.begin(); itPlayers != pProposal->players.end(); ++itPlayers) - { - if (Player* player = ObjectAccessor::FindPlayer(itPlayers->first)) - { - if (itPlayers->first == pProposal->leader) - players.push_front(player); - else - players.push_back(player); - - // Only teleport new players - Group* grp = player->GetGroup(); - uint64 gguid = grp ? grp->GetGUID() : 0; - if (!gguid || !grp->isLFGGroup() || GetState(gguid) == LFG_STATE_FINISHED_DUNGEON) - playersToTeleport.push_back(player); - } - - if (itPlayers->second->accept != LFG_ANSWER_AGREE) // No answer (-1) or not accepted (0) + for (LfgProposalPlayerMap::const_iterator itPlayers = proposal.players.begin(); itPlayers != proposal.players.end(); ++itPlayers) + if (itPlayers->second.accept != LFG_ANSWER_AGREE) // No answer (-1) or not accepted (0) allAnswered = false; - } if (!allAnswered) { - for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it) - (*it)->GetSession()->SendLfgUpdateProposal(proposalId, *pProposal); - } - else - { - bool sendUpdate = pProposal->state != LFG_PROPOSAL_SUCCESS; - pProposal->state = LFG_PROPOSAL_SUCCESS; - time_t joinTime = time_t(time(NULL)); - std::map waitTimesMap; - // Save wait times before redoing groups - for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it) + for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) { - LfgProposalPlayer* player = pProposal->players[(*it)->GetGUID()]; - uint32 lowgroupguid = (*it)->GetGroup() ? (*it)->GetGroup()->GetLowGUID() : 0; - if (player->groupLowGuid != lowgroupguid) - sLog->outError(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: [" UI64FMTD "] group mismatch: actual (%u) - queued (%u)", (*it)->GetGUID(), lowgroupguid, player->groupLowGuid); - - uint64 guid2 = player->groupLowGuid ? MAKE_NEW_GUID(player->groupLowGuid, 0, HIGHGUID_GROUP) : (*it)->GetGUID(); - LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid2); - if (itQueue == m_QueueInfoMap.end()) - { - sLog->outError(LOG_FILTER_LFG, "LFGMgr::UpdateProposal: Queue info for guid [" UI64FMTD "] not found!", guid); - waitTimesMap[(*it)->GetGUID()] = -1; - } - else - waitTimesMap[(*it)->GetGUID()] = int32(joinTime - itQueue->second->joinTime); + uint64 guid = it->first; + SendLfgUpdateProposal(guid, proposalId, proposal); } + return; + } - // Set the dungeon difficulty - LFGDungeonEntry const* dungeon = GetLFGDungeon(pProposal->dungeonId); - ASSERT(dungeon); - - // Create a new group (if needed) - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND); - Group* grp = pProposal->groupLowGuid ? sGroupMgr->GetGroupByGUID(pProposal->groupLowGuid) : NULL; - for (LfgPlayerList::const_iterator it = players.begin(); it != players.end(); ++it) - { - Player* player = (*it); - uint64 pguid = player->GetGUID(); - Group* group = player->GetGroup(); - if (sendUpdate) - player->GetSession()->SendLfgUpdateProposal(proposalId, *pProposal); - - if (group) - { - player->GetSession()->SendLfgUpdateParty(updateData); - if (group != grp) - player->RemoveFromGroup(); - } - else - player->GetSession()->SendLfgUpdatePlayer(updateData); - - if (!grp) - { - grp = new Group(); - grp->Create(player); - grp->ConvertToLFG(); - uint64 gguid = grp->GetGUID(); - SetState(gguid, LFG_STATE_PROPOSAL); - sGroupMgr->AddGroup(grp); - } - else if (group != grp) - grp->AddMember(player); - - // Update timers - uint8 role = GetRoles(pguid); - role &= ~PLAYER_ROLE_LEADER; - switch (role) - { - case PLAYER_ROLE_DAMAGE: - { - uint32 old_number = m_NumWaitTimeDps++; - m_WaitTimeDps = int32((m_WaitTimeDps * old_number + waitTimesMap[player->GetGUID()]) / m_NumWaitTimeDps); - break; - } - case PLAYER_ROLE_HEALER: - { - uint32 old_number = m_NumWaitTimeHealer++; - m_WaitTimeHealer = int32((m_WaitTimeHealer * old_number + waitTimesMap[player->GetGUID()]) / m_NumWaitTimeHealer); - break; - } - case PLAYER_ROLE_TANK: - { - uint32 old_number = m_NumWaitTimeTank++; - m_WaitTimeTank = int32((m_WaitTimeTank * old_number + waitTimesMap[player->GetGUID()]) / m_NumWaitTimeTank); - break; - } - default: - { - uint32 old_number = m_NumWaitTimeAvg++; - m_WaitTimeAvg = int32((m_WaitTimeAvg * old_number + waitTimesMap[player->GetGUID()]) / m_NumWaitTimeAvg); - break; - } - } + bool sendUpdate = proposal.state != LFG_PROPOSAL_SUCCESS; + proposal.state = LFG_PROPOSAL_SUCCESS; + time_t joinTime = time_t(time(NULL)); - m_teleport.push_back(pguid); - grp->SetLfgRoles(pguid, pProposal->players[pguid]->role); - SetState(pguid, LFG_STATE_DUNGEON); + LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND); + for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) + { + uint64 pguid = it->first; + uint64 gguid = it->second.group; + int32 waitTime = -1; + if (sendUpdate) + SendLfgUpdateProposal(pguid, proposalId, proposal); - // Add the cooldown spell if queued for a random dungeon - if (dungeon->type == LFG_TYPE_RANDOM) - player->CastSpell(player, LFG_SPELL_DUNGEON_COOLDOWN, false); + if (gguid) + { + SendLfgUpdateParty(pguid, updateData); } + else + SendLfgUpdatePlayer(pguid, updateData); - grp->SetDungeonDifficulty(Difficulty(dungeon->difficulty)); - uint64 gguid = grp->GetGUID(); - SetDungeon(gguid, dungeon->Entry()); - SetState(gguid, LFG_STATE_DUNGEON); - _SaveToDB(gguid, grp->GetDbStoreId()); + uint64 guid2 = gguid ? gguid : pguid; + LfgQueueInfoMap::iterator itQueue = m_QueueInfoMap.find(guid2); + if (itQueue != m_QueueInfoMap.end()) + waitTime = int32(joinTime - itQueue->second->joinTime); - // Remove players/groups from Queue - for (LfgGuidList::const_iterator it = pProposal->queues.begin(); it != pProposal->queues.end(); ++it) - RemoveFromQueue(*it); + // Update timers + uint8 role = GetRoles(pguid); + role &= ~PLAYER_ROLE_LEADER; + switch (role) + { + case PLAYER_ROLE_DAMAGE: + UpdateWaitTimeDps(waitTime); + break; + case PLAYER_ROLE_HEALER: + UpdateWaitTimeHealer(waitTime); + break; + case PLAYER_ROLE_TANK: + UpdateWaitTimeTank(waitTime); + break; + default: + UpdateWaitTimeAvg(waitTime); + break; + } - // Teleport Player - for (LfgPlayerList::const_iterator it = playersToTeleport.begin(); it != playersToTeleport.end(); ++it) - TeleportPlayer(*it, false); + m_teleport.push_back(pguid); + SetState(pguid, LFG_STATE_DUNGEON); + } - // Update group info - grp->SendUpdate(); + // Remove players/groups from Queue + for (LfgGuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it) + RemoveFromQueue(*it); - delete pProposal; - m_Proposals.erase(itProposal); - } + MakeNewGroup(proposal); + delete itProposal->second; + m_Proposals.erase(itProposal); } /** @@ -1693,45 +1661,38 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Proposal %u, state FAILED, UpdateType %u", itProposal->first, type); // Mark all people that didn't answered as no accept if (type == LFG_UPDATETYPE_PROPOSAL_FAILED) - for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) - if (it->second->accept == LFG_ANSWER_PENDING) - it->second->accept = LFG_ANSWER_DENY; + for (LfgProposalPlayerMap::iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) + if (it->second.accept == LFG_ANSWER_PENDING) + it->second.accept = LFG_ANSWER_DENY; // Mark players/groups to be removed LfgGuidSet toRemove; - for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) + for (LfgProposalPlayerMap::iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) { - if (it->second->accept == LFG_ANSWER_AGREE) + if (it->second.accept == LFG_ANSWER_AGREE) continue; - uint64 guid = it->second->groupLowGuid ? MAKE_NEW_GUID(it->second->groupLowGuid, 0, HIGHGUID_GROUP) : it->first; + uint64 guid = it->second.group ? it->second.group : it->first; // Player didn't accept or still pending when no secs left - if (it->second->accept == LFG_ANSWER_DENY || type == LFG_UPDATETYPE_PROPOSAL_FAILED) + if (it->second.accept == LFG_ANSWER_DENY || type == LFG_UPDATETYPE_PROPOSAL_FAILED) { - it->second->accept = LFG_ANSWER_DENY; + it->second.accept = LFG_ANSWER_DENY; toRemove.insert(guid); } } - uint8 team = 0; // Notify players for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) { - Player* player = ObjectAccessor::FindPlayer(it->first); - if (!player) - continue; - - team = uint8(player->GetTeam()); - player->GetSession()->SendLfgUpdateProposal(itProposal->first, proposal); + uint64 guid = it->first; + uint64 gguid = it->second.group ? it->second.group : guid; - Group* grp = player->GetGroup(); - uint64 guid = player->GetGUID(); - uint64 gguid = it->second->groupLowGuid ? MAKE_NEW_GUID(it->second->groupLowGuid, 0, HIGHGUID_GROUP) : guid; + SendLfgUpdateProposal(guid, itProposal->first, proposal); if (toRemove.find(gguid) != toRemove.end()) // Didn't accept or in same group that someone that didn't accept { LfgUpdateData updateData; - if (it->second->accept == LFG_ANSWER_DENY) + if (it->second.accept == LFG_ANSWER_DENY) { updateData.updateType = type; sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] didn't accept. Removing from queue and compatible cache", guid); @@ -1742,25 +1703,25 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: [" UI64FMTD "] in same group that someone that didn't accept. Removing from queue and compatible cache", guid); } ClearState(guid, "Proposal Fail (didn't accepted or in group with someone that didn't accept"); - if (grp) + if (gguid != guid) { RestoreState(gguid, "Proposal Fail (someone in group didn't accepted)"); - player->GetSession()->SendLfgUpdateParty(updateData); + SendLfgUpdateParty(guid, updateData); } else - player->GetSession()->SendLfgUpdatePlayer(updateData); + SendLfgUpdatePlayer(guid, updateData); } else { sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveProposal: Readding [" UI64FMTD "] to queue.", guid); SetState(guid, LFG_STATE_QUEUED); - if (grp) + if (gguid != guid) { SetState(gguid, LFG_STATE_QUEUED); - player->GetSession()->SendLfgUpdateParty(LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid), GetComment(guid))); + SendLfgUpdateParty(guid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid), GetComment(guid))); } else - player->GetSession()->SendLfgUpdatePlayer(LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid), GetComment(guid))); + SendLfgUpdatePlayer(guid, LfgUpdateData(LFG_UPDATETYPE_ADDED_TO_QUEUE, GetSelectedDungeons(guid), GetComment(guid))); } } @@ -1776,29 +1737,26 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t for (LfgGuidList::const_iterator it = proposal.queues.begin(); it != proposal.queues.end(); ++it) { uint64 guid = *it; + uint8 team = GetTeam(guid); LfgGuidList& currentQueue = m_currentQueue[team]; currentQueue.push_front(guid); //Add GUID for high priority AddToQueue(guid, team); //We have to add each GUID in newQueue to check for a new groups } - delete &proposal; + delete itProposal->second; m_Proposals.erase(itProposal); } /** Initialize a boot kick vote - @param[in] grp Group the vote kicks belongs to + @param[in] gguid Group the vote kicks belongs to @param[in] kicker Kicker guid @param[in] victim Victim guid @param[in] reason Kick reason */ -void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string const& reason) +void LFGMgr::InitBoot(uint64 gguid, uint64 kicker, uint64 victim, std::string const& reason) { - if (!grp) - return; - - uint32 gguid = grp->GetLowGUID(); SetState(gguid, LFG_STATE_BOOT); LfgPlayerBoot& boot = m_Boots[gguid]; @@ -1807,10 +1765,7 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string cons boot.reason = reason; boot.victim = victim; - LfgGuidSet players; - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) - if (Player* player = itr->getSource()) - players.insert(player->GetGUID()); + LfgGuidSet const& players = GetPlayers(gguid); // Set votes for (LfgGuidSet::const_iterator itr = players.begin(); itr != players.end(); ++itr) @@ -1831,18 +1786,15 @@ void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string cons /** Update Boot info with player answer - @param[in] player Player who has answered + @param[in] guid Player who has answered @param[in] accept player answer */ -void LFGMgr::UpdateBoot(Player* player, bool accept) +void LFGMgr::UpdateBoot(uint64 guid, bool accept) { - Group* grp = player ? player->GetGroup() : NULL; - if (!grp) + uint64 gguid = GetGroup(guid); + if (!gguid) return; - uint32 gguid = grp->GetLowGUID(); - uint64 guid = player->GetGUID(); - LfgPlayerBootMap::iterator itBoot = m_Boots.find(gguid); if (itBoot == m_Boots.end()) return; @@ -1882,17 +1834,20 @@ void LFGMgr::UpdateBoot(Player* player, bool accept) } } - gguid = grp->GetGUID(); SetState(gguid, LFG_STATE_DUNGEON); if (agreeNum == LFG_GROUP_KICK_VOTES_NEEDED) // Vote passed - Kick player { - Player::RemoveFromGroup(grp, boot.victim); + if (Group* group = sGroupMgr->GetGroupByGUID(GUID_LOPART(gguid))) + Player::RemoveFromGroup(group, boot.victim); + if (Player* victim = ObjectAccessor::FindPlayer(boot.victim)) { TeleportPlayer(victim, true, false); SetState(boot.victim, LFG_STATE_NONE); } - OfferContinue(grp); + + if (Player* leader = ObjectAccessor::FindPlayer(sLFGMgr->GetLeader(gguid))) + leader->GetSession()->SendLfgOfferContinue(GetDungeon(gguid, false)); DecreaseKicksLeft(gguid); } m_Boots.erase(itBoot); @@ -2120,49 +2075,35 @@ LfgType LFGMgr::GetDungeonType(uint32 dungeonId) return LfgType(dungeon->type); } -/** - Given a list of guids returns the concatenation using | as delimiter - - @param[in] check list of guids - @returns Concatenated string -*/ -std::string LFGMgr::ConcatenateGuids(LfgGuidList check) -{ - if (check.empty()) - return ""; - - std::ostringstream o; - LfgGuidList::const_iterator it = check.begin(); - o << (*it); - for (++it; it != check.end(); ++it) - o << '|' << (*it); - return o.str(); -} - LfgState LFGMgr::GetState(uint64 guid) { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "]", guid); + LfgState state; if (IS_GROUP(guid)) - return m_Groups[guid].GetState(); + state = m_Groups[guid].GetState(); else - return m_Players[guid].GetState(); + state = m_Players[guid].GetState(); + + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "] = %u", guid, state); + return state; } -uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true*/) +uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true */) { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId); - return m_Groups[guid].GetDungeon(asId); + uint32 dungeon = m_Groups[guid].GetDungeon(asId); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u = %u", guid, asId, dungeon); + return dungeon; } uint8 LFGMgr::GetRoles(uint64 guid) { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "]", guid); - return m_Players[guid].GetRoles(); + uint8 roles = m_Players[guid].GetRoles(); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "] = %u", guid, roles); + return roles; } const std::string& LFGMgr::GetComment(uint64 guid) { - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "]", guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "] = %s", guid, m_Players[guid].GetComment().c_str()); return m_Players[guid].GetComment(); } @@ -2199,7 +2140,8 @@ void LFGMgr::RestoreState(uint64 guid, char const *debugMsg) { LfgGroupData& data = m_Groups[guid]; char const * const ps = GetStateString(data.GetState()); - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RestoreState: Group: [" UI64FMTD "] (%s), State: %s", guid, debugMsg, ps); + char const * const os = GetStateString(data.GetOldState()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RestoreState: Group: [" UI64FMTD "] (%s), State: %s, oldState: %s", guid, debugMsg, ps, os); data.RestoreState(); } @@ -2207,7 +2149,8 @@ void LFGMgr::ClearState(uint64 guid, char const *debugMsg) { LfgPlayerData& data = m_Players[guid]; char const * const ps = GetStateString(data.GetState()); - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::ClearState: Player: [" UI64FMTD "] (%s) State: %s", guid, debugMsg, ps); + char const * const os = GetStateString(data.GetOldState()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::ClearState: Player: [" UI64FMTD "] (%s) State: %s, oldState: %s", guid, debugMsg, ps, os); data.ClearState(); } @@ -2218,7 +2161,8 @@ void LFGMgr::SetState(uint64 guid, LfgState state) LfgGroupData& data = m_Groups[guid]; char const * const ns = GetStateString(state); char const * const ps = GetStateString(data.GetState()); - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: Group: [" UI64FMTD "] newState: %s, previous: %s", guid, ns, ps); + char const * const os = GetStateString(data.GetOldState()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: Group: [" UI64FMTD "] newState: %s, previous: %s, oldState: %s", guid, ns, ps, os); data.SetState(state); } else @@ -2226,7 +2170,8 @@ void LFGMgr::SetState(uint64 guid, LfgState state) LfgPlayerData& data = m_Players[guid]; char const * const ns = GetStateString(state); char const * const ps = GetStateString(data.GetState()); - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: Player: [" UI64FMTD "] newState: %s, previous: %s", guid, ns, ps); + char const * const os = GetStateString(data.GetOldState()); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: Player: [" UI64FMTD "] newState: %s, previous: %s, oldState: %s", guid, ns, ps, os); data.SetState(state); } } @@ -2283,6 +2228,54 @@ void LFGMgr::RemoveGroupData(uint64 guid) m_Groups.erase(it); } +uint8 LFGMgr::GetTeam(uint64 guid) +{ + return m_Players[guid].GetTeam(); +} + +uint8 LFGMgr::RemovePlayerFromGroup(uint64 gguid, uint64 guid) +{ + return m_Groups[gguid].RemovePlayer(guid); +} + +void LFGMgr::AddPlayerToGroup(uint64 gguid, uint64 guid) +{ + m_Groups[gguid].AddPlayer(guid); +} + +void LFGMgr::SetLeader(uint64 gguid, uint64 leader) +{ + m_Groups[gguid].SetLeader(leader); +} + +void LFGMgr::SetTeam(uint64 guid, uint8 team) +{ + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP)) + team = 0; + + m_Players[guid].SetTeam(team); +} + +uint64 LFGMgr::GetGroup(uint64 guid) +{ + return m_Players[guid].GetGroup(); +} + +void LFGMgr::SetGroup(uint64 guid, uint64 group) +{ + m_Players[guid].SetGroup(group); +} + +const LfgGuidSet& LFGMgr::GetPlayers(uint64 guid) +{ + return m_Groups[guid].GetPlayers(); +} + +uint64 LFGMgr::GetLeader(uint64 guid) +{ + return m_Groups[guid].GetLeader(); +} + bool LFGMgr::HasIgnore(uint64 guid1, uint64 guid2) { Player* plr1 = ObjectAccessor::FindPlayer(guid1); @@ -2360,3 +2353,50 @@ bool LFGMgr::IsSeasonActive(uint32 dungeonId) } return false; } + +void LFGMgr::UpdateWaitTimeAvg(int32 waitTime) +{ + LfgWaitTime &wt = m_waitTimesAvg; + uint32 old_number = wt.number++; + wt.time = int32((wt.time * old_number + waitTime) / wt.number); +} + +void LFGMgr::UpdateWaitTimeTank(int32 waitTime) +{ + LfgWaitTime &wt = m_waitTimesTank; + uint32 old_number = wt.number++; + wt.time = int32((wt.time * old_number + waitTime) / wt.number); +} + +void LFGMgr::UpdateWaitTimeHealer(int32 waitTime) +{ + LfgWaitTime &wt = m_waitTimesHealer; + uint32 old_number = wt.number++; + wt.time = int32((wt.time * old_number + waitTime) / wt.number); +} + +void LFGMgr::UpdateWaitTimeDps(int32 waitTime) +{ + LfgWaitTime &wt = m_waitTimesDps; + uint32 old_number = wt.number++; + wt.time = int32((wt.time * old_number + waitTime) / wt.number); +} + +/** + Given a list of guids returns the concatenation using | as delimiter + + @param[in] check list of guids + @returns Concatenated string +*/ +std::string LFGMgr::ConcatenateGuids(LfgGuidList check) +{ + if (check.empty()) + return ""; + + std::ostringstream o; + LfgGuidList::const_iterator it = check.begin(); + o << (*it); + for (++it; it != check.end(); ++it) + o << '|' << (*it); + return o.str(); +} \ No newline at end of file diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index d4d35974604..756f7094be6 100755 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -21,6 +21,7 @@ #include "Common.h" #include #include "LFG.h" + #include "LFGGroupData.h" #include "LFGPlayerData.h" @@ -127,20 +128,28 @@ struct LfgPlayerBoot; typedef std::map LfgGuidListMap; typedef std::set PlayerSet; typedef std::list LfgPlayerList; +typedef std::map LfgCompatibleMap; +typedef std::map LfgQueueInfoMap; + typedef std::multimap LfgRewardMap; typedef std::pair LfgRewardMapBounds; -typedef std::map LfgCompatibleMap; typedef std::map LfgCachedDungeonMap; typedef std::map LfgAnswerMap; typedef std::map LfgRoleCheckMap; -typedef std::map LfgQueueInfoMap; typedef std::map LfgProposalMap; -typedef std::map LfgProposalPlayerMap; +typedef std::map LfgProposalPlayerMap; typedef std::map LfgPlayerBootMap; typedef std::map LfgGroupDataMap; typedef std::map LfgPlayerDataMap; typedef UNORDERED_MAP LFGDungeonMap; +struct LfgWaitTime +{ + LfgWaitTime(): time(-1), number(0) {} + int32 time; ///< Wait time + uint32 number; ///< Number of people used to get that wait time +}; + // Data needed by SMSG_LFG_JOIN_RESULT struct LfgJoinResultData { @@ -221,27 +230,26 @@ struct LfgQueueInfo /// Stores player data related to proposal to join struct LfgProposalPlayer { - LfgProposalPlayer(): role(0), accept(LFG_ANSWER_PENDING), groupLowGuid(0) {}; + LfgProposalPlayer(): role(0), accept(LFG_ANSWER_PENDING), group(0) { } uint8 role; ///< Proposed role LfgAnswer accept; ///< Accept status (-1 not answer | 0 Not agree | 1 agree) - uint32 groupLowGuid; ///< Original group guid (Low guid) 0 if no original group + uint64 group; ///< Original group guid. 0 if no original group }; /// Stores group data related to proposal to join struct LfgProposal { - LfgProposal(uint32 dungeon = 0): dungeonId(dungeon), state(LFG_PROPOSAL_INITIATING), groupLowGuid(0), leader(0), cancelTime(0) {} + LfgProposal(uint32 dungeon = 0): dungeonId(dungeon), state(LFG_PROPOSAL_INITIATING), + group(0), leader(0), cancelTime(0), encounters(0), isNew(true) + { } - ~LfgProposal() - { - for (LfgProposalPlayerMap::iterator it = players.begin(); it != players.end(); ++it) - delete it->second; - }; uint32 dungeonId; ///< Dungeon to join LfgProposalState state; ///< State of the proposal - uint32 groupLowGuid; ///< Proposal group (0 if new) + uint64 group; ///< Proposal group (0 if new) uint64 leader; ///< Leader guid. time_t cancelTime; ///< Time when we will cancel this proposal + uint32 encounters; ///< Dungeon Encounters + bool isNew; ///< Determines if it's new group or not LfgGuidList queues; ///< Queue Ids to remove/readd LfgProposalPlayerMap players; ///< Players data }; @@ -264,7 +272,6 @@ struct LfgPlayerBoot bool inProgress; ///< Vote in progress LfgAnswerMap votes; ///< Player votes (-1 not answer | 0 Not agree | 1 agree) uint64 victim; ///< Player guid to be kicked (can't vote) - uint8 votedNeeded; ///< Votes needed to kick the player std::string reason; ///< kick reason }; @@ -313,26 +320,33 @@ class LFGMgr // Queue void JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, std::string const& comment); - void LeaveLfg(Player* player, Group* grp = NULL); + void LeaveLfg(uint64 guid); // Role Check void UpdateRoleCheck(uint64 gguid, uint64 guid = 0, uint8 roles = PLAYER_ROLE_NONE); + // Group Matching + static bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true); + void GetCompatibleDungeons(LfgDungeonSet& dungeons, LfgGuidSet const& players, LfgLockPartyMap& lockMap); + // Proposals + uint32 AddProposal(LfgProposal const& proposal); void UpdateProposal(uint32 proposalId, uint64 guid, bool accept); // Teleportation void TeleportPlayer(Player* player, bool out, bool fromOpcode = false); // Vote kick - void InitBoot(Group* grp, uint64 kguid, uint64 vguid, std::string const& reason); - void UpdateBoot(Player* player, bool accept); - void OfferContinue(Group* grp); + void InitBoot(uint64 gguid, uint64 kguid, uint64 vguid, std::string const& reason); + void UpdateBoot(uint64 guid, bool accept); void InitializeLockedDungeons(Player* player, uint8 level = 0); void SetRoles(uint64 guid, uint8 roles); void SetComment(uint64 guid, std::string const& comment); + void SetTeam(uint64 guid, uint8 team); + void SetGroup(uint64 guid, uint64 group); + void SetLeader(uint64 gguid, uint64 leader); void SetState(uint64 guid, LfgState state); void SetSelectedDungeons(uint64 guid, LfgDungeonSet const& dungeons); @@ -341,15 +355,20 @@ class LFGMgr void RemovePlayerData(uint64 guid); void RemoveGroupData(uint64 guid); + uint8 RemovePlayerFromGroup(uint64 gguid, uint64 guid); + void AddPlayerToGroup(uint64 gguid, uint64 guid); LfgLockMap const& GetLockedDungeons(uint64 guid); LfgDungeonSet const& GetSelectedDungeons(uint64 guid); uint32 GetDungeon(uint64 guid, bool asId = true); LfgState GetState(uint64 guid); uint8 GetKicksLeft(uint64 gguid); + uint64 GetLeader(uint64 guid); bool IsLfgGroup(uint64 guid); uint8 GetRoles(uint64 guid); std::string const& GetComment(uint64 gguid); + LfgGuidSet const& GetPlayers(uint64 guid); + bool IsTeleported(uint64 guid); static bool HasIgnore(uint64 guid1, uint64 guid2); @@ -368,6 +387,8 @@ class LFGMgr void ClearState(uint64 guid, char const *debugMsg); private: + uint8 GetTeam(uint64 guid); + uint64 GetGroup(uint64 guid); void RestoreState(uint64 guid, char const *debugMsg); void SetDungeon(uint64 guid, uint32 dungeon); @@ -380,21 +401,23 @@ class LFGMgr // Proposals void RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType type); + void MakeNewGroup(LfgProposal const& proposal); // Group Matching LfgProposal* FindNewGroups(LfgGuidList& check, LfgGuidList& all); - bool CheckGroupRoles(LfgRolesMap &groles, bool removeLeaderFlag = true); bool CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal); - void GetCompatibleDungeons(LfgDungeonSet& dungeons, PlayerSet const& players, LfgLockPartyMap& lockMap); void SetCompatibles(std::string concatenatedGuids, bool compatibles); LfgAnswer GetCompatibles(std::string concatenatedGuids); - void RemoveFromCompatibles(uint64 guid); // Generic LfgDungeonSet const& GetDungeonsByRandom(uint32 randomdungeon); LfgType GetDungeonType(uint32 dungeon); std::string ConcatenateGuids(LfgGuidList check); - + void RemoveFromCompatibles(uint64 guid); + void UpdateWaitTimeAvg(int32 waitTime); + void UpdateWaitTimeTank(int32 waitTime); + void UpdateWaitTimeHealer(int32 waitTime); + void UpdateWaitTimeDps(int32 waitTime); void SendLfgBootProposalUpdate(uint64 guid, LfgPlayerBoot const& boot); void SendLfgJoinResult(uint64 guid, LfgJoinResultData const& data); void SendLfgRoleChosen(uint64 guid, uint64 pguid, uint8 roles); @@ -408,30 +431,27 @@ class LFGMgr uint32 m_lfgProposalId; ///< used as internal counter for proposals uint32 m_options; ///< Stores config options - int32 m_WaitTimeAvg; ///< Average wait time to find a group queuing as multiple roles - int32 m_WaitTimeTank; ///< Average wait time to find a group queuing as tank - int32 m_WaitTimeHealer; ///< Average wait time to find a group queuing as healer - int32 m_WaitTimeDps; ///< Average wait time to find a group queuing as dps - uint32 m_NumWaitTimeAvg; ///< Num of players used to calc avs wait time - uint32 m_NumWaitTimeTank; ///< Num of players used to calc tank wait time - uint32 m_NumWaitTimeHealer; ///< Num of players used to calc healers wait time - uint32 m_NumWaitTimeDps; ///< Num of players used to calc dps wait time LfgCachedDungeonMap m_CachedDungeonMap; ///< Stores all dungeons by groupType // Reward System LfgRewardMap m_RewardMap; ///< Stores rewards for random dungeons LFGDungeonMap m_LfgDungeonMap; - // Queue - LfgQueueInfoMap m_QueueInfoMap; ///< Queued groups - LfgGuidListMap m_currentQueue; ///< Ordered list. Used to find groups - LfgGuidListMap m_newToQueue; ///< New groups to add to queue - LfgCompatibleMap m_CompatibleMap; ///< Compatible dungeons - LfgGuidList m_teleport; ///< Players being teleported // Rolecheck - Proposal - Vote Kicks LfgRoleCheckMap m_RoleChecks; ///< Current Role checks LfgProposalMap m_Proposals; ///< Current Proposals LfgPlayerBootMap m_Boots; ///< Current player kicks LfgPlayerDataMap m_Players; ///< Player data LfgGroupDataMap m_Groups; ///< Group data + LfgGuidList m_teleport; ///< Players being teleported + + // Queue + LfgQueueInfoMap m_QueueInfoMap; ///< Queued groups + LfgGuidListMap m_currentQueue; ///< Ordered list. Used to find groups + LfgGuidListMap m_newToQueue; ///< New groups to add to queue + LfgCompatibleMap m_CompatibleMap; ///< Compatible dungeons + LfgWaitTime m_waitTimesAvg; ///< Average wait time to find a group queuing as multiple roles + LfgWaitTime m_waitTimesTank; ///< Average wait time to find a group queuing as tank + LfgWaitTime m_waitTimesHealer; ///< Average wait time to find a group queuing as healer + LfgWaitTime m_waitTimesDps; ///< Average wait time to find a group queuing as dps LFGPlayerScript *m_lfgPlayerScript; LFGGroupScript *m_lfgGroupScript; diff --git a/src/server/game/DungeonFinding/LFGPlayerData.cpp b/src/server/game/DungeonFinding/LFGPlayerData.cpp index 4a6e86ab966..6f030831342 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.cpp +++ b/src/server/game/DungeonFinding/LFGPlayerData.cpp @@ -17,8 +17,8 @@ #include "LFGPlayerData.h" -LfgPlayerData::LfgPlayerData(): -m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE), m_Roles(0), m_Comment("") +LfgPlayerData::LfgPlayerData(): m_State(LFG_STATE_NONE), m_OldState(LFG_STATE_NONE), + m_Team(0), m_Group(0), m_Roles(0), m_Comment("") {} LfgPlayerData::~LfgPlayerData() @@ -30,10 +30,10 @@ void LfgPlayerData::SetState(LfgState state) switch (state) { case LFG_STATE_NONE: - case LFG_STATE_DUNGEON: case LFG_STATE_FINISHED_DUNGEON: + case LFG_STATE_DUNGEON: m_OldState = state; - // No break on purpose + // No break on purpose default: m_State = state; } @@ -51,6 +51,16 @@ void LfgPlayerData::SetLockedDungeons(const LfgLockMap& lockStatus) m_LockedDungeons = lockStatus; } +void LfgPlayerData::SetTeam(uint8 team) +{ + m_Team = team; +} + +void LfgPlayerData::SetGroup(uint64 group) +{ + m_Group = group; +} + void LfgPlayerData::SetRoles(uint8 roles) { m_Roles = roles; @@ -66,21 +76,31 @@ void LfgPlayerData::SetSelectedDungeons(const LfgDungeonSet& dungeons) m_SelectedDungeons = dungeons; } -void LfgPlayerData::ClearSelectedDungeons() +LfgState LfgPlayerData::GetState() const { - m_SelectedDungeons.clear(); + return m_State; } -LfgState LfgPlayerData::GetState() const +LfgState LfgPlayerData::GetOldState() const { - return m_State; + return m_OldState; } -const LfgLockMap & LfgPlayerData::GetLockedDungeons() const +const LfgLockMap& LfgPlayerData::GetLockedDungeons() const { return m_LockedDungeons; } +uint8 LfgPlayerData::GetTeam() const +{ + return m_Team; +} + +uint64 LfgPlayerData::GetGroup() const +{ + return m_Group; +} + uint8 LfgPlayerData::GetRoles() const { return m_Roles; diff --git a/src/server/game/DungeonFinding/LFGPlayerData.h b/src/server/game/DungeonFinding/LFGPlayerData.h index e8bae1c5a0f..0682ad66698 100644 --- a/src/server/game/DungeonFinding/LFGPlayerData.h +++ b/src/server/game/DungeonFinding/LFGPlayerData.h @@ -18,7 +18,6 @@ #ifndef _LFGPLAYERDATA_H #define _LFGPLAYERDATA_H -#include "Common.h" #include "LFG.h" /** @@ -33,20 +32,26 @@ class LfgPlayerData // General void SetState(LfgState state); void ClearState(); - void SetLockedDungeons(const LfgLockMap& lock); + void SetLockedDungeons(LfgLockMap const& lock); + void SetTeam(uint8 team); + void SetGroup(uint64 group); + // Queue void SetRoles(uint8 roles); - void SetComment(const std::string& comment); + void SetComment(std::string const& comment); void SetSelectedDungeons(const LfgDungeonSet& dungeons); - void ClearSelectedDungeons(); // General LfgState GetState() const; - const LfgLockMap& GetLockedDungeons() const; + LfgState GetOldState() const; + LfgLockMap const& GetLockedDungeons() const; + uint8 GetTeam() const; + uint64 GetGroup() const; + // Queue uint8 GetRoles() const; - const std::string& GetComment() const; - const LfgDungeonSet& GetSelectedDungeons() const; + std::string const& GetComment() const; + LfgDungeonSet const& GetSelectedDungeons() const; private: // General @@ -54,6 +59,9 @@ class LfgPlayerData LfgState m_OldState; ///< Old State // Player LfgLockMap m_LockedDungeons; ///< Dungeons player can't do and reason + uint8 m_Team; ///< Player team - determines the queue to join + uint64 m_Group; ///< Original group of player when joined LFG + // Queue uint8 m_Roles; ///< Roles the player selected when joined LFG std::string m_Comment; ///< Player comment used when joined LFG diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 26686dbaa33..76cc169f477 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -40,7 +40,7 @@ void LFGPlayerScript::OnLevelChanged(Player* player, uint8 /*oldLevel*/) void LFGPlayerScript::OnLogout(Player* player) { uint64 guid = player->GetGUID(); - sLFGMgr->LeaveLfg(player); + sLFGMgr->LeaveLfg(guid); LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_REMOVED_FROM_QUEUE); player->GetSession()->SendLfgUpdateParty(updateData); player->GetSession()->SendLfgUpdatePlayer(updateData); @@ -52,6 +52,7 @@ void LFGPlayerScript::OnLogout(Player* player) void LFGPlayerScript::OnLogin(Player* player) { sLFGMgr->InitializeLockedDungeons(player); + sLFGMgr->SetTeam(player->GetGUID(), player->GetTeam()); // TODO - Restore LfgPlayerData and send proper status to player if it was in a group } @@ -69,73 +70,85 @@ LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript") void LFGGroupScript::OnAddMember(Group* group, uint64 guid) { uint64 gguid = group->GetGUID(); - if (!gguid) - return; + uint64 leader = group->GetLeaderGUID(); - sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "]", gguid, guid); - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_CLEAR_LOCK_LIST); - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (leader == guid) + { + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "]", gguid, guid, leader); + sLFGMgr->SetLeader(gguid, guid); + } + else { - if (Player* plrg = itr->getSource()) + LfgState gstate = sLFGMgr->GetState(gguid); + LfgState state = sLFGMgr->GetState(guid); + sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnAddMember [" UI64FMTD "]: added [" UI64FMTD "] leader " UI64FMTD "] gstate: %u, state: %u", gguid, guid, leader, gstate, state); + LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_CLEAR_LOCK_LIST); + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) { - plrg->GetSession()->SendLfgUpdatePlayer(updateData); - plrg->GetSession()->SendLfgUpdateParty(updateData); + if (Player* plrg = itr->getSource()) + { + plrg->GetSession()->SendLfgUpdatePlayer(updateData); + plrg->GetSession()->SendLfgUpdateParty(updateData); + } } - } - // TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued - if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED) - sLFGMgr->LeaveLfg(NULL, group); + if (state == LFG_STATE_QUEUED) + sLFGMgr->LeaveLfg(guid); - if (sLFGMgr->GetState(guid) == LFG_STATE_QUEUED) - if (Player* player = ObjectAccessor::FindPlayer(guid)) - sLFGMgr->LeaveLfg(player); + // TODO - if group is queued and new player is added convert to rolecheck without notify the current players queued + if (gstate == LFG_STATE_QUEUED) + sLFGMgr->LeaveLfg(gguid); + } + + sLFGMgr->SetGroup(guid, gguid); + sLFGMgr->AddPlayerToGroup(gguid, guid); } void LFGGroupScript::OnRemoveMember(Group* group, uint64 guid, RemoveMethod method, uint64 kicker, char const* reason) { uint64 gguid = group->GetGUID(); - if (!gguid || method == GROUP_REMOVEMETHOD_DEFAULT) - return; - sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnRemoveMember [" UI64FMTD "]: remove [" UI64FMTD "] Method: %d Kicker: [" UI64FMTD "] Reason: %s", gguid, guid, method, kicker, (reason ? reason : "")); - if (sLFGMgr->GetState(gguid) == LFG_STATE_QUEUED) - { - // TODO - Do not remove, just remove the one leaving and rejoin queue with all other data - sLFGMgr->LeaveLfg(NULL, group); - } - if (!group->isLFGGroup()) + if (method == GROUP_REMOVEMETHOD_DEFAULT) return; - if (method == GROUP_REMOVEMETHOD_KICK) // Player have been kicked + LfgState state = sLFGMgr->GetState(gguid); + if (state == LFG_STATE_QUEUED) + sLFGMgr->LeaveLfg(gguid); // TODO - Remove the one leaving and rejoin group + + bool isLFG = group->isLFGGroup(); + + if (isLFG && method == GROUP_REMOVEMETHOD_KICK) // Player have been kicked { // TODO - Update internal kick cooldown of kicker std::string str_reason = ""; if (reason) str_reason = std::string(reason); - sLFGMgr->InitBoot(group, kicker, guid, str_reason); + sLFGMgr->InitBoot(gguid, kicker, guid, str_reason); return; } - uint32 state = sLFGMgr->GetState(gguid); sLFGMgr->ClearState(guid, "OnRemoveMember"); sLFGMgr->SetState(guid, LFG_STATE_NONE); + sLFGMgr->SetGroup(guid, 0); + sLFGMgr->RemovePlayerFromGroup(gguid, guid); + if (Player* player = ObjectAccessor::FindPlayer(guid)) { - if (method == GROUP_REMOVEMETHOD_LEAVE && sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON && sLFGMgr->GetDungeon(gguid, false)) + if (method == GROUP_REMOVEMETHOD_LEAVE && state == LFG_STATE_DUNGEON && + sLFGMgr->GetDungeon(gguid, false)) player->CastSpell(player, LFG_SPELL_DUNGEON_DESERTER, true); //else if (state == LFG_STATE_BOOT) // Update internal kick cooldown of kicked - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER); - player->GetSession()->SendLfgUpdateParty(updateData); - if (player->GetMap()->IsDungeon()) // Teleport player out the dungeon + player->GetSession()->SendLfgUpdateParty(LfgUpdateData(LFG_UPDATETYPE_LEADER_UNK1)); + if (isLFG && player->GetMap()->IsDungeon()) // Teleport player out the dungeon sLFGMgr->TeleportPlayer(player, true); } - if (state != LFG_STATE_FINISHED_DUNGEON)// Need more players to finish the dungeon - sLFGMgr->OfferContinue(group); + if (isLFG && state != LFG_STATE_FINISHED_DUNGEON) // Need more players to finish the dungeon + if (Player* leader = ObjectAccessor::FindPlayer(sLFGMgr->GetLeader(gguid))) + leader->GetSession()->SendLfgOfferContinue(sLFGMgr->GetDungeon(gguid, false)); } void LFGGroupScript::OnDisband(Group* group) @@ -149,20 +162,19 @@ void LFGGroupScript::OnDisband(Group* group) void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 oldLeaderGuid) { uint64 gguid = group->GetGUID(); - if (!gguid) - return; sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnChangeLeader [" UI64FMTD "]: old [" UI64FMTD "] new [" UI64FMTD "]", gguid, newLeaderGuid, oldLeaderGuid); + sLFGMgr->SetLeader(gguid, newLeaderGuid); Player* player = ObjectAccessor::FindPlayer(newLeaderGuid); - LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER); + LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_LEADER_UNK1); if (player) player->GetSession()->SendLfgUpdateParty(updateData); player = ObjectAccessor::FindPlayer(oldLeaderGuid); if (player) { - updateData.updateType = LFG_UPDATETYPE_GROUP_DISBAND; + updateData.updateType = LFG_UPDATETYPE_GROUP_DISBAND_UNK16; player->GetSession()->SendLfgUpdateParty(updateData); } } @@ -170,9 +182,7 @@ void LFGGroupScript::OnChangeLeader(Group* group, uint64 newLeaderGuid, uint64 o void LFGGroupScript::OnInviteMember(Group* group, uint64 guid) { uint64 gguid = group->GetGUID(); - if (!gguid) - return; sLog->outDebug(LOG_FILTER_LFG, "LFGScripts::OnInviteMember [" UI64FMTD "]: invite [" UI64FMTD "] leader [" UI64FMTD "]", gguid, guid, group->GetLeaderGUID()); - sLFGMgr->LeaveLfg(NULL, group); + sLFGMgr->LeaveLfg(gguid); } diff --git a/src/server/game/Handlers/LFGHandler.cpp b/src/server/game/Handlers/LFGHandler.cpp index 59631618757..4f208d33bde 100755 --- a/src/server/game/Handlers/LFGHandler.cpp +++ b/src/server/game/Handlers/LFGHandler.cpp @@ -23,7 +23,6 @@ #include "LFGMgr.h" #include "ObjectMgr.h" #include "GroupMgr.h" -#include "InstanceScript.h" void BuildPlayerLockDungeonBlock(WorldPacket& data, const LfgLockMap& lock) { @@ -88,12 +87,13 @@ void WorldSession::HandleLfgLeaveOpcode(WorldPacket& /*recv_data*/) { Group* grp = GetPlayer()->GetGroup(); uint64 guid = GetPlayer()->GetGUID(); + uint64 gguid = grp ? grp->GetGUID() : guid; sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_LEAVE [" UI64FMTD "] in group: %u", guid, grp ? 1 : 0); // Check cheating - only leader can leave the queue if (!grp || grp->GetLeaderGUID() == GetPlayer()->GetGUID()) - sLFGMgr->LeaveLfg(GetPlayer(), grp); + sLFGMgr->LeaveLfg(gguid); } void WorldSession::HandleLfgProposalResultOpcode(WorldPacket& recv_data) @@ -140,7 +140,7 @@ void WorldSession::HandleLfgSetBootVoteOpcode(WorldPacket& recv_data) uint64 guid = GetPlayer()->GetGUID(); sLog->outDebug(LOG_FILTER_NETWORKIO, "CMSG_LFG_SET_BOOT_VOTE [" UI64FMTD "] agree: %u", guid, agree ? 1 : 0); - sLFGMgr->UpdateBoot(GetPlayer(), agree); + sLFGMgr->UpdateBoot(guid, agree); } void WorldSession::HandleLfgTeleportOpcode(WorldPacket& recv_data) @@ -285,6 +285,8 @@ void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData) { bool queued = false; bool extrainfo = false; + uint64 guid = GetPlayer()->GetGUID(); + uint8 size = uint8(updateData.dungeons.size()); switch (updateData.updateType) { @@ -301,9 +303,6 @@ void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData) break; } - uint64 guid = GetPlayer()->GetGUID(); - uint8 size = uint8(updateData.dungeons.size()); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_UPDATE_PLAYER [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PLAYER, 1 + 1 + (extrainfo ? 1 : 0) * (1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type @@ -328,6 +327,8 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData) bool join = false; bool extrainfo = false; bool queued = false; + uint64 guid = GetPlayer()->GetGUID(); + uint8 size = uint8(updateData.dungeons.size()); switch (updateData.updateType) { @@ -351,9 +352,6 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData) break; } - uint64 guid = GetPlayer()->GetGUID(); - uint8 size = uint8(updateData.dungeons.size()); - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_UPDATE_PARTY [" UI64FMTD "] updatetype: %u", guid, updateData.updateType); WorldPacket data(SMSG_LFG_UPDATE_PARTY, 1 + 1 + (extrainfo ? 1 : 0) * (1 + 1 + 1 + 1 + 1 + size * 4 + updateData.comment.length())); data << uint8(updateData.updateType); // Lfg Update type @@ -522,7 +520,7 @@ void WorldSession::SendLfgBootProposalUpdate(const LfgPlayerBoot& boot) } } sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_BOOT_PROPOSAL_UPDATE [" UI64FMTD "] inProgress: %u - didVote: %u - agree: %u - victim: [" UI64FMTD "] votes: %u - agrees: %u - left: %u - needed: %u - reason %s", - guid, uint8(boot.inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), boot.victim, votesNum, agreeNum, secsleft, boot.votedNeeded, boot.reason.c_str()); + guid, uint8(boot.inProgress), uint8(playerVote != LFG_ANSWER_PENDING), uint8(playerVote == LFG_ANSWER_AGREE), boot.victim, votesNum, agreeNum, secsleft, LFG_GROUP_KICK_VOTES_NEEDED, boot.reason.c_str()); WorldPacket data(SMSG_LFG_BOOT_PROPOSAL_UPDATE, 1 + 1 + 1 + 8 + 4 + 4 + 4 + 4 + boot.reason.length()); data << uint8(boot.inProgress); // Vote in progress data << uint8(playerVote != LFG_ANSWER_PENDING); // Did Vote @@ -531,87 +529,56 @@ void WorldSession::SendLfgBootProposalUpdate(const LfgPlayerBoot& boot) data << uint32(votesNum); // Total Votes data << uint32(agreeNum); // Agree Count data << uint32(secsleft); // Time Left - data << uint32(boot.votedNeeded); // Needed Votes + data << uint32(LFG_GROUP_KICK_VOTES_NEEDED); // Needed Votes data << boot.reason.c_str(); // Kick reason SendPacket(&data); } -void WorldSession::SendLfgUpdateProposal(uint32 proposalId, const LfgProposal& proposal) +void WorldSession::SendLfgUpdateProposal(uint32 proposalId, LfgProposal const& proposal) { uint64 guid = GetPlayer()->GetGUID(); - LfgProposalPlayerMap::const_iterator itPlayer = proposal.players.find(guid); - if (itPlayer == proposal.players.end()) // Player MUST be in the proposal - return; + uint64 gguid = proposal.players.find(guid)->second.group; + bool silent = !proposal.isNew && gguid == proposal.group; + uint32 dungeonEntry = proposal.dungeonId; - LfgProposalPlayer* ppPlayer = itPlayer->second; - uint32 pLowGroupGuid = ppPlayer->groupLowGuid; - uint32 dLowGuid = proposal.groupLowGuid; - uint32 dungeonId = proposal.dungeonId; - bool isSameDungeon = false; - bool isContinue = false; - Group* grp = dLowGuid ? sGroupMgr->GetGroupByGUID(dLowGuid) : NULL; - uint32 completedEncounters = 0; - if (grp) - { - uint64 gguid = grp->GetGUID(); - isContinue = grp->isLFGGroup() && sLFGMgr->GetState(gguid) != LFG_STATE_FINISHED_DUNGEON; - isSameDungeon = GetPlayer()->GetGroup() == grp && isContinue; - } - - sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", GetPlayer()->GetGUID(), proposal.state); + sLog->outDebug(LOG_FILTER_NETWORKIO, "SMSG_LFG_PROPOSAL_UPDATE [" UI64FMTD "] state: %u", guid, proposal.state); WorldPacket data(SMSG_LFG_PROPOSAL_UPDATE, 4 + 1 + 4 + 4 + 1 + 1 + proposal.players.size() * (4 + 1 + 1 + 1 + 1 +1)); - if (!isContinue) // Only show proposal dungeon if it's continue + // show random dungeon if player selected random dungeon and it's not lfg group + if (!silent) { - LfgDungeonSet playerDungeons = sLFGMgr->GetSelectedDungeons(guid); - if (playerDungeons.size() == 1) - dungeonId = (*playerDungeons.begin()); + LfgDungeonSet const& playerDungeons = sLFGMgr->GetSelectedDungeons(guid); + if (playerDungeons.find(proposal.dungeonId) == playerDungeons.end()) + dungeonEntry = (*playerDungeons.begin()); } - if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId)) - { - dungeonId = dungeon->Entry(); - - // Select a player inside to be get completed encounters from - if (grp) - { - for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next()) - { - Player* groupMember = itr->getSource(); - if (groupMember && groupMember->GetMapId() == uint32(dungeon->map)) - { - if (InstanceScript* instance = groupMember->GetInstanceScript()) - completedEncounters = instance->GetCompletedEncounterMask(); - break; - } - } - } - } + if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonEntry)) + dungeonEntry = dungeon->Entry(); - data << uint32(dungeonId); // Dungeon - data << uint8(proposal.state); // Result state - data << uint32(proposalId); // Internal Proposal ID - data << uint32(completedEncounters); // Bosses killed - data << uint8(isSameDungeon); // Silent (show client window) + data << uint32(dungeonEntry); // Dungeon + data << uint8(proposal.state); // Proposal state + data << uint32(proposalId); // Proposal ID + data << uint32(proposal.encounters); // encounters done + data << uint8(silent); // Show proposal window data << uint8(proposal.players.size()); // Group size - for (itPlayer = proposal.players.begin(); itPlayer != proposal.players.end(); ++itPlayer) + for (LfgProposalPlayerMap::const_iterator it = proposal.players.begin(); it != proposal.players.end(); ++it) { - ppPlayer = itPlayer->second; - data << uint32(ppPlayer->role); // Role - data << uint8(itPlayer->first == guid); // Self player - if (!ppPlayer->groupLowGuid) // Player not it a group + LfgProposalPlayer const& player = it->second; + data << uint32(player.role); // Role + data << uint8(it->first == guid); // Self player + if (!player.group) // Player not it a group { data << uint8(0); // Not in dungeon data << uint8(0); // Not same group } else { - data << uint8(ppPlayer->groupLowGuid == dLowGuid); // In dungeon (silent) - data << uint8(ppPlayer->groupLowGuid == pLowGroupGuid); // Same Group than player + data << uint8(player.group == proposal.group); // In dungeon (silent) + data << uint8(player.group == gguid); // Same Group than player } - data << uint8(ppPlayer->accept != LFG_ANSWER_PENDING); // Answered - data << uint8(ppPlayer->accept == LFG_ANSWER_AGREE); // Accepted + data << uint8(player.accept != LFG_ANSWER_PENDING); // Answered + data << uint8(player.accept == LFG_ANSWER_AGREE); // Accepted } SendPacket(&data); } diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 5893bbd6564..ee3be6f2b2d 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1076,7 +1076,22 @@ enum TrinityStrings // Use for custom patches 11000-11999 LANG_AUTO_BROADCAST = 11000, - LANG_INVALID_REALMID = 11001 + LANG_INVALID_REALMID = 11001, + + LANG_LFG_STATE_NONE = 11002, + LANG_LFG_STATE_ROLECHECK = 11003, + LANG_LFG_STATE_QUEUED = 11004, + LANG_LFG_STATE_PROPOSAL = 11005, + LANG_LFG_STATE_BOOT = 11006, + LANG_LFG_STATE_DUNGEON = 11007, + LANG_LFG_STATE_FINISHED_DUNGEON = 11008, + LANG_LFG_STATE_RAIDBROWSER = 11009, + LANG_LFG_ROLE_TANK = 11010, + LANG_LFG_ROLE_HEALER = 11011, + LANG_LFG_ROLE_DAMAGE = 11012, + LANG_LFG_ROLE_LEADER = 11013, + LANG_LFG_ROLE_NONE = 11014, + LANG_LFG_ERROR = 11015, // NOT RESERVED IDS 12000-1999999999 // `db_script_string` table index 2000000000-2000009999 (MIN_DB_SCRIPT_STRING_ID-MAX_DB_SCRIPT_STRING_ID) -- cgit v1.2.3 From 36806bf5b3a9abed467e23eb835a992df3ea0d50 Mon Sep 17 00:00:00 2001 From: Spp Date: Fri, 19 Oct 2012 17:36:24 +0200 Subject: Move LFG string out of Custom patch range --- .../world/2012_10_18_00_world_trinity_string.sql | 31 +++++++++++----------- src/server/game/DataStores/DBCfmt.h | 2 +- src/server/game/Miscellaneous/Language.h | 30 ++++++++++----------- 3 files changed, 32 insertions(+), 31 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2012_10_18_00_world_trinity_string.sql b/sql/updates/world/2012_10_18_00_world_trinity_string.sql index 8d62174d868..a12b20388eb 100644 --- a/sql/updates/world/2012_10_18_00_world_trinity_string.sql +++ b/sql/updates/world/2012_10_18_00_world_trinity_string.sql @@ -1,16 +1,17 @@ -REPLACE INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) +DELETE FROM `trinity_string` WHERE `entry` IN (9986, 9987, 9989, 9990, 9991, 9992, 9993, 9994, 9995, 9996, 9997, 9998, 9999); +INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES - (11015, 'Error', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11014, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11013, 'Leader', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11012, 'Dps', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11011, 'Healer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11010, 'Tank', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11009, 'Raid browser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11008, 'Finished dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11007, 'In dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11006, 'Vote kick', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11005, 'Proposal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11004, 'Queued', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11003, 'Role check', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), - (11002, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + (9986, 'Error', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9987, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9988, 'Leader', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9989, 'Dps', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9990, 'Healer', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9991, 'Tank', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9992, 'Raid browser', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9993, 'Finished dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9994, 'In dungeon', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9995, 'Vote kick', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9996, 'Proposal', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9997, 'Queued', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9998, 'Role check', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL), + (9999, 'None', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 0c2cc565b22..0fe82ea3311 100755 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -77,7 +77,7 @@ char const ItemLimitCategoryEntryfmt[]="nxxxxxxxxxxxxxxxxxii"; char const ItemRandomPropertiesfmt[]="nxiiixxssssssssssssssssx"; char const ItemRandomSuffixfmt[]="nssssssssssssssssxxiiixxiiixx"; char const ItemSetEntryfmt[]="dssssssssssssssssxiiiiiiiiiixxxxxxxiiiiiiiiiiiiiiiiii"; -char const LFGDungeonEntryfmt[]="nssssssssssssssssiiiiiiiiixxixixxxxxxxxxxxxxxxxx"; +char const LFGDungeonEntryfmt[]="nssssssssssssssssxiiiiiiiiixxixixxxxxxxxxxxxxxxxx"; char const LiquidTypefmt[]="nxxixixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; char const LockEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiixxxxxxxx"; char const MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx"; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index ee3be6f2b2d..6868db35975 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -990,6 +990,21 @@ enum TrinityStrings LANG_WORLD_CLOSED = 7523, LANG_WORLD_OPENED = 7524, + LANG_LFG_STATE_NONE = 9986, + LANG_LFG_STATE_ROLECHECK = 9987, + LANG_LFG_STATE_QUEUED = 9988, + LANG_LFG_STATE_PROPOSAL = 9989, + LANG_LFG_STATE_BOOT = 9990, + LANG_LFG_STATE_DUNGEON = 9991, + LANG_LFG_STATE_FINISHED_DUNGEON = 9992, + LANG_LFG_STATE_RAIDBROWSER = 9993, + LANG_LFG_ROLE_TANK = 9994, + LANG_LFG_ROLE_HEALER = 9995, + LANG_LFG_ROLE_DAMAGE = 9996, + LANG_LFG_ROLE_LEADER = 9997, + LANG_LFG_ROLE_NONE = 9998, + LANG_LFG_ERROR = 9999, + // Use for not-in-offcial-sources patches // 10000-10999 // opvp hp @@ -1078,21 +1093,6 @@ enum TrinityStrings LANG_AUTO_BROADCAST = 11000, LANG_INVALID_REALMID = 11001, - LANG_LFG_STATE_NONE = 11002, - LANG_LFG_STATE_ROLECHECK = 11003, - LANG_LFG_STATE_QUEUED = 11004, - LANG_LFG_STATE_PROPOSAL = 11005, - LANG_LFG_STATE_BOOT = 11006, - LANG_LFG_STATE_DUNGEON = 11007, - LANG_LFG_STATE_FINISHED_DUNGEON = 11008, - LANG_LFG_STATE_RAIDBROWSER = 11009, - LANG_LFG_ROLE_TANK = 11010, - LANG_LFG_ROLE_HEALER = 11011, - LANG_LFG_ROLE_DAMAGE = 11012, - LANG_LFG_ROLE_LEADER = 11013, - LANG_LFG_ROLE_NONE = 11014, - LANG_LFG_ERROR = 11015, - // 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) -- cgit v1.2.3 From 38ca1531d8738141c742d9b7f892a75af3283edd Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 19 Oct 2012 17:37:20 -0500 Subject: Core/SQL: Renamed SQL from previous pull request merge. --- .../world/2012_10_16_00_world_creature_text.sql | 36 ---------------------- .../world/2012_10_19_00_world_creature_text.sql | 36 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 sql/updates/world/2012_10_16_00_world_creature_text.sql create mode 100644 sql/updates/world/2012_10_19_00_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2012_10_16_00_world_creature_text.sql b/sql/updates/world/2012_10_16_00_world_creature_text.sql deleted file mode 100644 index aad3627a26a..00000000000 --- a/sql/updates/world/2012_10_16_00_world_creature_text.sql +++ /dev/null @@ -1,36 +0,0 @@ --- Gnomeregan/Blastmaster Emi Shortfuse's event -DELETE FROM `script_texts` WHERE `entry` BETWEEN -1090028 AND -1090000; -DELETE FROM `creature_text` WHERE `entry` IN (7361,7998); -INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES --- Emi Shortfuse -(7998,0,0, 'With your help, I can evaluate these tunnels.',12,0,100,0,0,0, 'SAY_BLASTMASTER_0'), -(7998,1,0, 'Let''s see if we can find out where these Troggs are coming from... and put a stop to the invasion!',12,0,100,0,0,0, 'SAY_BLASTMASTER_1'), -(7998,2,0, 'Such devastation... what horrible mess...',12,0,100,0,0,0, 'SAY_BLASTMASTER_2'), -(7998,3,0, 'It''s quiet here...',12,0,100,0,0,0, 'SAY_BLASTMASTER_3'), -(7998,4,0, '...too quiet.',12,0,100,0,0,0, 'SAY_BLASTMASTER_4'), -(7998,5,0, 'Look! Over there at the tunnel wall!',12,0,100,0,0,0, 'SAY_BLASTMASTER_5'), -(7998,6,0, 'Trogg incrusion! Defend me while I blast the hole closed!',12,0,100,0,0,0, 'SAY_BLASTMASTER_6'), -(7998,7,0, 'The charges are set. Get back before they blow!',12,0,100,0,0,0, 'SAY_BLASTMASTER_7'), -(7998,8,0, 'Incoming blast in 10 seconds!',14,0,100,0,0,0, 'SAY_BLASTMASTER_8'), -(7998,9,0, 'Incoming blast in 5 seconds. Clear the tunnel!',14,0,100,0,0,0, 'SAY_BLASTMASTER_9'), -(7998,10,0, 'FIRE IN THE HOLE!',14,0,100,0,0,0, 'SAY_BLASTMASTER_10'), -(7998,11,0, 'Well done! Without your help I would have never been able to thwart that wave of troggs.',12,0,100,0,0,0, 'SAY_BLASTMASTER_11'), -(7998,12,0, 'Did you hear something?',12,0,100,0,0,0, 'SAY_BLASTMASTER_12'), -(7998,13,0, 'I heard something over there.',12,0,100,0,0,0, 'SAY_BLASTMASTER_13'), -(7998,14,0, 'More troggs! Ward them off as I prepare the explosives!',12,0,100,0,0,0, 'SAY_BLASTMASTER_14'), -(7998,15,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_15'), -(7998,16,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_16'), -(7998,17,0, 'Incoming blast in 10 seconds!',14,0,100,0,0,0, 'SAY_BLASTMASTER_17'), -(7998,18,0, 'Incoming blast in 5 seconds. Clear the tunnel!',14,0,100,0,0,0, 'SAY_BLASTMASTER_18'), -(7998,19,0, 'I don''t think one charge is going to cut it. Keep fending them off!',12,0,100,0,0,0, 'SAY_BLASTMASTER_19'), -(7998,20,0, 'FIRE IN THE HOLE!',14,0,100,0,0,0, 'SAY_BLASTMASTER_20'), -(7998,21,0, 'Well done! Without your help I would have never been able to thwart that wave of troggs.',12,0,100,0,0,0, 'SAY_BLASTMASTER_21'), -(7998,22,0, 'Did you hear something?',12,0,100,0,0,0, 'SAY_BLASTMASTER_22'), -(7998,23,0, 'I heard something over there.',12,0,100,0,0,0, 'SAY_BLASTMASTER_23'), -(7998,24,0, 'More troggs! Ward them off as I prepare the explosives!',12,0,100,0,0,0, 'SAY_BLASTMASTER_24'), -(7998,25,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_25'), -(7998,26,0, '10 seconds to blast! Stand back!!!',14,0,100,0,0,0, 'SAY_BLASTMASTER_26'), -(7998,27,0, '5 seconds until detonation!!',14,0,100,0,0,0, 'SAY_BLASTMASTER_27'), -(7998,28,0, 'Superb! Because of your help, my people stand a chance of re-taking our belowed city. Three cheers to you!',12,0,100,0,0,0, 'SAY_BLASTMASTER_28'), --- Grubbis -(7361,0,0, 'We come from below! You can never stop us!',14,0,100,0,0,0, 'SAY_GRUBBIS'); diff --git a/sql/updates/world/2012_10_19_00_world_creature_text.sql b/sql/updates/world/2012_10_19_00_world_creature_text.sql new file mode 100644 index 00000000000..aad3627a26a --- /dev/null +++ b/sql/updates/world/2012_10_19_00_world_creature_text.sql @@ -0,0 +1,36 @@ +-- Gnomeregan/Blastmaster Emi Shortfuse's event +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1090028 AND -1090000; +DELETE FROM `creature_text` WHERE `entry` IN (7361,7998); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +-- Emi Shortfuse +(7998,0,0, 'With your help, I can evaluate these tunnels.',12,0,100,0,0,0, 'SAY_BLASTMASTER_0'), +(7998,1,0, 'Let''s see if we can find out where these Troggs are coming from... and put a stop to the invasion!',12,0,100,0,0,0, 'SAY_BLASTMASTER_1'), +(7998,2,0, 'Such devastation... what horrible mess...',12,0,100,0,0,0, 'SAY_BLASTMASTER_2'), +(7998,3,0, 'It''s quiet here...',12,0,100,0,0,0, 'SAY_BLASTMASTER_3'), +(7998,4,0, '...too quiet.',12,0,100,0,0,0, 'SAY_BLASTMASTER_4'), +(7998,5,0, 'Look! Over there at the tunnel wall!',12,0,100,0,0,0, 'SAY_BLASTMASTER_5'), +(7998,6,0, 'Trogg incrusion! Defend me while I blast the hole closed!',12,0,100,0,0,0, 'SAY_BLASTMASTER_6'), +(7998,7,0, 'The charges are set. Get back before they blow!',12,0,100,0,0,0, 'SAY_BLASTMASTER_7'), +(7998,8,0, 'Incoming blast in 10 seconds!',14,0,100,0,0,0, 'SAY_BLASTMASTER_8'), +(7998,9,0, 'Incoming blast in 5 seconds. Clear the tunnel!',14,0,100,0,0,0, 'SAY_BLASTMASTER_9'), +(7998,10,0, 'FIRE IN THE HOLE!',14,0,100,0,0,0, 'SAY_BLASTMASTER_10'), +(7998,11,0, 'Well done! Without your help I would have never been able to thwart that wave of troggs.',12,0,100,0,0,0, 'SAY_BLASTMASTER_11'), +(7998,12,0, 'Did you hear something?',12,0,100,0,0,0, 'SAY_BLASTMASTER_12'), +(7998,13,0, 'I heard something over there.',12,0,100,0,0,0, 'SAY_BLASTMASTER_13'), +(7998,14,0, 'More troggs! Ward them off as I prepare the explosives!',12,0,100,0,0,0, 'SAY_BLASTMASTER_14'), +(7998,15,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_15'), +(7998,16,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_16'), +(7998,17,0, 'Incoming blast in 10 seconds!',14,0,100,0,0,0, 'SAY_BLASTMASTER_17'), +(7998,18,0, 'Incoming blast in 5 seconds. Clear the tunnel!',14,0,100,0,0,0, 'SAY_BLASTMASTER_18'), +(7998,19,0, 'I don''t think one charge is going to cut it. Keep fending them off!',12,0,100,0,0,0, 'SAY_BLASTMASTER_19'), +(7998,20,0, 'FIRE IN THE HOLE!',14,0,100,0,0,0, 'SAY_BLASTMASTER_20'), +(7998,21,0, 'Well done! Without your help I would have never been able to thwart that wave of troggs.',12,0,100,0,0,0, 'SAY_BLASTMASTER_21'), +(7998,22,0, 'Did you hear something?',12,0,100,0,0,0, 'SAY_BLASTMASTER_22'), +(7998,23,0, 'I heard something over there.',12,0,100,0,0,0, 'SAY_BLASTMASTER_23'), +(7998,24,0, 'More troggs! Ward them off as I prepare the explosives!',12,0,100,0,0,0, 'SAY_BLASTMASTER_24'), +(7998,25,0, 'The final charge is set. Stand back!',12,0,100,0,0,0, 'SAY_BLASTMASTER_25'), +(7998,26,0, '10 seconds to blast! Stand back!!!',14,0,100,0,0,0, 'SAY_BLASTMASTER_26'), +(7998,27,0, '5 seconds until detonation!!',14,0,100,0,0,0, 'SAY_BLASTMASTER_27'), +(7998,28,0, 'Superb! Because of your help, my people stand a chance of re-taking our belowed city. Three cheers to you!',12,0,100,0,0,0, 'SAY_BLASTMASTER_28'), +-- Grubbis +(7361,0,0, 'We come from below! You can never stop us!',14,0,100,0,0,0, 'SAY_GRUBBIS'); -- cgit v1.2.3