diff options
| author | Nay <dnpd.dd@gmail.com> | 2011-07-03 19:18:20 +0100 |
|---|---|---|
| committer | Kandera <KanderaDev@gmail.com> | 2012-08-20 13:29:22 -0400 |
| commit | afd9c28d8e69885e9e58e7241d9ea6d21a7b294d (patch) | |
| tree | efd069d0de47b5171068f2f5f59caf75166ee887 | |
| parent | b1a300545ca36b54659aad0d6d47c947888fc0ad (diff) | |
- Rename scriptnames to keep naming consistent;
- Template updates and spells to WG vehicles;
- Cleanup SQL files a bit.
| -rw-r--r-- | Wintergrasp_temp/Gossips.sql | 62 | ||||
| -rw-r--r-- | Wintergrasp_temp/Misc.sql | 24 | ||||
| -rw-r--r-- | Wintergrasp_temp/Quests.sql | 24 | ||||
| -rw-r--r-- | Wintergrasp_temp/SAI.sql | 3 | ||||
| -rw-r--r-- | Wintergrasp_temp/Scriptnames.sql | 20 | ||||
| -rw-r--r-- | Wintergrasp_temp/Spells.txt | 8 | ||||
| -rw-r--r-- | Wintergrasp_temp/Strings.sql | 13 | ||||
| -rw-r--r-- | Wintergrasp_temp/Template_update.sql | 66 | ||||
| -rw-r--r-- | src/server/scripts/Northrend/wintergrasp.cpp | 429 |
9 files changed, 545 insertions, 104 deletions
diff --git a/Wintergrasp_temp/Gossips.sql b/Wintergrasp_temp/Gossips.sql index 90f903b7717..3f9ce230d5f 100644 --- a/Wintergrasp_temp/Gossips.sql +++ b/Wintergrasp_temp/Gossips.sql @@ -1,53 +1,54 @@ --- Gossip Menu insert from sniff +-- Template gossip updates +UPDATE `creature_template` SET `gossip_menu_id`=9904 WHERE `entry`=30400; +UPDATE `creature_template` SET `gossip_menu_id`=10229 WHERE `entry`=31091; + +-- Gossip Menu DELETE FROM `gossip_menu` WHERE `entry`=9904 AND `text_id`=13759; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9904,13759); DELETE FROM `gossip_menu` WHERE `entry`=9904 AND `text_id`=13761; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9904,13761); DELETE FROM `gossip_menu` WHERE `entry`=9923 AND `text_id`=14172; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (9923,14172); DELETE FROM `gossip_menu` WHERE `entry`=10229 AND `text_id`=14221; -INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES (10229,14221); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(9904,13759), +(9904,13761), +(9923,14172), +(10229,14221); --- Creature Gossip_menu_option Update from sniff -DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9904); +-- Gossip Menu Option +DELETE FROM `gossip_menu_option` WHERE `menu_id`=9904; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=10129 AND `id` IN (2,4); INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES (9904,0,0, 'I would like to build a catapult.',1,1,0,0,0,0, ''), (9904,1,0, 'I would like to build a demolisher.',1,1,0,0,0,0, ''), -(9904,2,0, 'I would like to build a siege engine.',1,1,0,0,0,0, ''); +(9904,2,0, 'I would like to build a siege engine.',1,1,0,0,0,0, ''), +(10129,2,0, 'Guide me to the Broken Temple Graveyard.',1,1,0,0,0,0, ''), +(10129,4,0, 'Guide me to the Eastspark Graveyard.',1,1,0,0,0,0, ''); + +-- Conditions -- Add gossip_menu condition for 9904 Horde DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=9904; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=9923; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9904; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9923; INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES (14,9904,13759,0,1,33280), -- Must have Rank 1: Corporal (14,9904,13759,1,1,55629), -- Or must have Rank 2: First Lieutenant (14,9904,13761,0,11,33280), -- Must not have Rank 1: Corporal -(14,9904,13761,0,11,55629); -- Must not have Rank 2: First Lieutenant +(14,9904,13761,0,11,55629), -- Must not have Rank 2: First Lieutenant -- Add gossip_menu condition for 9923 Alliance -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=9923; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`) VALUES (14,9923,13798,0,1,33280), -- Must have Rank 1: Corporal (14,9923,13798,1,1,55629), -- Or must have Rank 2: First Lieutenant (14,9923,14172,0,11,33280), -- Must not have Rank 1: Corporal -(14,9923,14172,0,11,55629); -- Must not have Rank 2: First Lieutenant +(14,9923,14172,0,11,55629), -- Must not have Rank 2: First Lieutenant -- Add conditions to gossip options horde -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9904; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`) VALUES -(15,9904,0,0,1,33280,0), -- Must have reached Rank 1: Corporal -(15,9904,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant -(15,9904,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant -(15,9904,2,0,1,55629,0); -- Must have reached Rank 2: First Lieutenant +(15,9904,0,0,1,33280), -- Must have reached Rank 1: Corporal +(15,9904,0,1,1,55629), -- Or must have reached Rank 2: First Lieutenant +(15,9904,1,0,1,55629), -- Must have reached Rank 2: First Lieutenant +(15,9904,2,0,1,55629), -- Must have reached Rank 2: First Lieutenant -- Add conditions to gossip options alliance -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=9923; -INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`) VALUES -(15,9923,0,0,1,33280,0), -- Must have reached Rank 1: Corporal -(15,9923,0,1,1,55629,0), -- Or must have reached Rank 2: First Lieutenant -(15,9923,1,0,1,55629,0), -- Must have reached Rank 2: First Lieutenant -(15,9923,2,0,1,55629,0); -- Must have reached Rank 2: First Lieutenant - --- Add Missing Horde Spirt Healer options Wintergrasp -DELETE FROM `gossip_menu_option` WHERE `menu_id`=10129 AND `id` IN (2,4); -INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES -(10129,2,0, 'Guide me to the Broken Temple Graveyard.',1,1,0,0,0,0, ''), -(10129,4,0, 'Guide me to the Eastspark Graveyard.',1,1,0,0,0,0, ''); +(15,9923,0,0,1,33280), -- Must have reached Rank 1: Corporal +(15,9923,0,1,1,55629), -- Or must have reached Rank 2: First Lieutenant +(15,9923,1,0,1,55629), -- Must have reached Rank 2: First Lieutenant +(15,9923,2,0,1,55629); -- Must have reached Rank 2: First Lieutenant /* -- Add scripts to Wintergrasp spirit guide gossip -- !!!should be scripted by SAI or cpp script!!! @@ -85,4 +86,3 @@ INSERT INTO `gossip_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`) VAL (990402,0,33,0,0),(990402,0,15,61408,1), (990403,0,33,0,0),(990403,0,15,56661,1); */ - diff --git a/Wintergrasp_temp/Misc.sql b/Wintergrasp_temp/Misc.sql index 42817764fef..d68853b6c04 100644 --- a/Wintergrasp_temp/Misc.sql +++ b/Wintergrasp_temp/Misc.sql @@ -3,10 +3,10 @@ DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=54640; INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES (54640,54643,0, 'WG teleporter'); --- 58730 Restricted Flight Area (Wintergrasp Eject) -DELETE FROM `spell_area` WHERE `spell`=58730; +-- Spell area +DELETE FROM `spell_area` WHERE `spell` IN (58730,57940); INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES -(58730,4581,0,0,0,0,0,2,1), +(58730,4581,0,0,0,0,0,2,1), -- Restricted Flight Area (Wintergrasp Eject) (58730,4539,0,0,0,0,0,2,1), (58730,4197,0,0,0,0,0,2,1), (58730,4585,0,0,0,0,0,2,1), @@ -16,12 +16,8 @@ INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`que (58730,4589,0,0,0,0,0,2,1), (58730,4575,0,0,0,0,0,2,1), (58730,4538,0,0,0,0,0,2,1), -(58730,4577,0,0,0,0,0,2,1); - --- 57940 Essence of Wintergrasp -DELETE FROM `spell_area` WHERE `spell`=57940; -INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES -(57940,65,0,0,0,0,0,2,1), +(58730,4577,0,0,0,0,0,2,1), +(57940,65,0,0,0,0,0,2,1), -- Essence of Wintergrasp (57940,66,0,0,0,0,0,2,1), (57940,67,0,0,0,0,0,2,1), (57940,206,0,0,0,0,0,2,1), @@ -48,12 +44,12 @@ INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`que (57940,4494,0,0,0,0,0,2,1), (57940,4603,0,0,0,0,0,2,1); --- 49899 Activate Robotic Arms +-- Spell scripts DELETE FROM `spell_scripts` WHERE `id`=49899; INSERT INTO `spell_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES -(49899,0,1,406,0,0,0,0,0,0); +(49899,0,1,406,0,0,0,0,0,0); -- Activate Robotic Arms --- Add Spell Target position for Wintergrasp Graveyard spells +-- Spell Target position for Wintergrasp Graveyard spells DELETE FROM `spell_target_position` WHERE `id` IN (59760,59762,59763,59765,59766,59767,59769); INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`target_position_y`,`target_position_z`,`target_orientation`) VALUES (59760,571,5537.986,2897.493,517.057,4.819249), -- Teleport: Fortress Graveyard @@ -63,7 +59,3 @@ INSERT INTO `spell_target_position` (`id`,`target_map`,`target_position_x`,`targ (59766,571,4331.716,3235.695,390.251,0.008500), -- Teleport: Westspark Factory Graveyard "area 4611" (59767,571,4314.648,2408.522,392.642,6.268125), -- Teleport: Eastspark Factory Graveyard "area 4612" (59769,571,5140.790,2179.120,390.950,1.972220); -- Teleport: Alliance Landing Zone - - - - diff --git a/Wintergrasp_temp/Quests.sql b/Wintergrasp_temp/Quests.sql index 277f9ebb038..75f2e931806 100644 --- a/Wintergrasp_temp/Quests.sql +++ b/Wintergrasp_temp/Quests.sql @@ -1,14 +1,16 @@ -- Wintergrasp Quests - Horde -UPDATE `quest_template` SET `ExclusiveGroup`=13180 WHERE `entry` IN (13180, 13178); -UPDATE `quest_template` SET `ExclusiveGroup`=13185 WHERE `entry` IN (13185, 13223); -UPDATE `quest_template` SET `ExclusiveGroup`=13192 WHERE `entry` IN (13192, 13202); -UPDATE `quest_template` SET `ExclusiveGroup`=13199 WHERE `entry` IN (13193, 13199); -UPDATE `quest_template` SET `ExclusiveGroup`=13200 WHERE `entry` IN (13200, 13191); -UPDATE `quest_template` SET `ExclusiveGroup`=13201 WHERE `entry` IN (13201, 13194); +UPDATE `quest_template` SET `ExclusiveGroup`=13180 WHERE `entry` IN (13180,13178); -- Slay them all! +UPDATE `quest_template` SET `ExclusiveGroup`=13185 WHERE `entry` IN (13185,13223); -- Stop/Defend the Siege +UPDATE `quest_template` SET `ExclusiveGroup`=13201 WHERE `entry` IN (13201,13194); -- Healing with Roses +UPDATE `quest_template` SET `ExclusiveGroup`=13199 WHERE `entry` IN (13193,13199); -- Bones and Arrows +UPDATE `quest_template` SET `ExclusiveGroup`=13192 WHERE `entry` IN (13192,13202); -- Warding/Jinxing the Walls +UPDATE `quest_template` SET `ExclusiveGroup`=13200 WHERE `entry` IN (13200,13191); -- Fueling the Demolishers -- Wintergrasp Quests - Alliance -UPDATE `quest_template` SET `ExclusiveGroup`=13179 WHERE `entry` IN (13179, 13177); -UPDATE `quest_template` SET `ExclusiveGroup`=13186 WHERE `entry` IN (13186, 13222); -UPDATE `quest_template` SET `ExclusiveGroup`=13195 WHERE `entry` IN (13195, 13156); -UPDATE `quest_template` SET `ExclusiveGroup`=13196 WHERE `entry` IN (13196, 13154); -UPDATE `quest_template` SET `ExclusiveGroup`=13198 WHERE `entry` IN (13198, 13153);
\ No newline at end of file +UPDATE `quest_template` SET `ExclusiveGroup`=13179 WHERE `entry` IN (13179,13177); -- No Mercy for the Merciless +UPDATE `quest_template` SET `ExclusiveGroup`=13186 WHERE `entry` IN (13186,13222); -- Stop/Defend the Siege +UPDATE `quest_template` SET `ExclusiveGroup`=13195 WHERE `entry` IN (13195,13156); -- A Rare Herb +UPDATE `quest_template` SET `ExclusiveGroup`=13196 WHERE `entry` IN (13196,13154); -- Bones and Arrows +UPDATE `quest_template` SET `ExclusiveGroup`=13198 WHERE `entry` IN (13198,13153); -- Warding the Warriors + +-- Note: The offered quests (they are in pairs) depend on who controls the keep. npc_wg_quest_giver does that already? diff --git a/Wintergrasp_temp/SAI.sql b/Wintergrasp_temp/SAI.sql index 098565ce016..71d1b8de81c 100644 --- a/Wintergrasp_temp/SAI.sql +++ b/Wintergrasp_temp/SAI.sql @@ -1,6 +1,9 @@ +/* +These two npcs already have a scriptname assigned (npc_wg_spiritguide). That core script should make these npcs cast the 22011 spell. -- Spirit healers SAI UPDATE `creature_template` SET `AIName`= 'SmartAI' WHERE `entry` IN (31841,31842); DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (31841,31842); INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES (31841,0,0,0,1,0,100,0,0,0,30000,30000,11,22011,0,0,0,0,0,1,0,0,0,0,0,0,0, 'cast Spirit Heal Channel every 30 sec'), (31842,0,0,0,1,0,100,0,0,0,30000,30000,11,22011,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Dwarven Spirit Guide - cast Spirit Heal Channel every 30 sec'); +*/ diff --git a/Wintergrasp_temp/Scriptnames.sql b/Wintergrasp_temp/Scriptnames.sql index f8eb806fc6d..f9a121b3e78 100644 --- a/Wintergrasp_temp/Scriptnames.sql +++ b/Wintergrasp_temp/Scriptnames.sql @@ -1,14 +1,14 @@ --- Wintergrasp queue template NPCs -UPDATE `creature_template` SET `ScriptName`= 'npc_wg_dalaran_queue' WHERE `entry` IN (32169,32170,35599,35596,35600,35601,35598,35603,35602,35597,35612,35611); +-- Wintergrasp queue template NPCs script +UPDATE `creature_template` SET `ScriptName`= 'npc_wg_queue' WHERE `entry` IN (32169,32170,35599,35596,35600,35601,35598,35603,35602,35597,35612,35611); -- <Wintergrasp Battle-Master> --- Wintergrasp spiritguide NPC script -UPDATE `creature_template` SET `ScriptName`= 'npc_wg_spiritguide' WHERE `entry` IN (31841,31842); +-- Wintergrasp spirit guide NPCs script +UPDATE `creature_template` SET `ScriptName`= 'npc_wg_spirit_guide' WHERE `entry` IN (31841,31842); -- Taunka Spirit Guide, Dwarven Spirit Guide --- Wintergrasp demolisher engineer NPC script -UPDATE `creature_template` SET `ScriptName`= 'npc_demolisher_engineerer' WHERE `entry` IN (30400,30499); +-- Wintergrasp demolisher engineer NPCs script +UPDATE `creature_template` SET `ScriptName`= 'npc_wg_demolisher_engineer' WHERE `entry` IN (30400,30499); -- Goblin Mechanic, Gnomish Engineer --- Wintergrasp vehicle teleport -UPDATE `gameobject_template` SET `ScriptName`= 'go_wintergrasp_teleporter' WHERE `entry`=192951; +-- Wintergrasp Questgiver NPCs script +UPDATE `creature_template` SET `ScriptName`= 'npc_wg_quest_giver' WHERE `entry` IN (31054,31052,31091,31036,31101,31107,31053,31051,31153,31151,31102,31106); --- Wintergrasp Questgiver NPCs - requires binding to Wintergrasp questgiver script -UPDATE `creature_template` SET `ScriptName`= 'npc_wintergrasp_quest_giver' WHERE `entry` IN (31054, 31052, 31091, 31036, 31101, 31107, 31053, 31051, 31153, 31151, 31102, 31106); +-- Wintergrasp vehicle teleport GO script +UPDATE `gameobject_template` SET `ScriptName`= 'go_wg_vehicle_teleporter' WHERE `entry`=192951; -- Vehicle Teleporter diff --git a/Wintergrasp_temp/Spells.txt b/Wintergrasp_temp/Spells.txt index b70507e700e..583e46db04e 100644 --- a/Wintergrasp_temp/Spells.txt +++ b/Wintergrasp_temp/Spells.txt @@ -20,4 +20,10 @@ Wintergrasp Vehicle On spawn entries: 28312,27881,28094,32627 set x,y,z,o to nearest trigger entry: 23472 make player cast 60968 on vehicle aura 14267 on self if player is horde -aura 14268 on self if player is alliance
\ No newline at end of file +aura 14268 on self if player is alliance + +Spells cast on vehicle as auras... or something (PET_SPELLS cooldowns): +61178 (Grab Passenger) (Catapult, Siege Engine... NOT tower cannons) +56866 (-Unknown-) (Catapult, Siege Engine.... NOT tower cannons) +14268 (Alliance Flag) (Catapult, Siege Engine... NOT tower cannons) +14267 (Horde Flag)
\ No newline at end of file diff --git a/Wintergrasp_temp/Strings.sql b/Wintergrasp_temp/Strings.sql index 43038cc9fba..090c5350c74 100644 --- a/Wintergrasp_temp/Strings.sql +++ b/Wintergrasp_temp/Strings.sql @@ -47,15 +47,16 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1` (0, -1850504, 'Guide me to the Eastspark Graveyard.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''), (0, -1850505, 'Guide me back to the Horde landing camp.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''), (0, -1850506, 'Guide me back to the Alliance landing camp.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''), -(0, -1850507, 'Se mettre dans la file pour le Joug-d''hiver.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''); -- (Needs proper english text) +(0, -1850507, 'Se mettre dans la file pour le Joug-d''hiver.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, ''); -- (Needs proper english text, maybe "Get in the queue for Wintergrasp."?) -- New support-commands for battlefield class DELETE FROM `command` WHERE name IN ('bf start', 'bf stop', 'bf enable', 'bf switch', 'bf timer'); -INSERT INTO `command` (`name`,`security`,`help`) VALUES ('bf start',3,'Syntaxe: .bf start #battleid'); -INSERT INTO `command` (`name`,`security`,`help`) VALUES ('bf stop',3,'Syntaxe: .bf stop #battleid'); -INSERT INTO `command` (`name`,`security`,`help`) VALUES ('bf enable',3,'Syntaxe: .bf enable #battleid'); -INSERT INTO `command` (`name`,`security`,`help`) VALUES ('bf switch',3,'Syntaxe: .bf switch #battleid'); -INSERT INTO `command` (`name`,`security`,`help`) VALUES ('bf timer',3,'Syntaxe: .bf timer #battleid #timer'); +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('bf start',3,'Syntax: .bf start #battleid'), +('bf stop',3,'Syntax: .bf stop #battleid'), +('bf enable',3,'Syntax: .bf enable #battleid'), +('bf switch',3,'Syntax: .bf switch #battleid'), +('bf timer',3,'Syntax: .bf timer #battleid #timer'); -- NPC talk text insert from sniff DELETE FROM `creature_text` WHERE `entry`=15214 AND `groupid` BETWEEN 0 AND 30; diff --git a/Wintergrasp_temp/Template_update.sql b/Wintergrasp_temp/Template_update.sql index c55f86fceef..1b1ff6d130f 100644 --- a/Wintergrasp_temp/Template_update.sql +++ b/Wintergrasp_temp/Template_update.sql @@ -1,15 +1,14 @@ UPDATE `gameobject_template` SET `faction`=114 WHERE `entry` IN (192310,192312,192313,192314,192316,192317,192318,192319,192320,192321,192322,192323,192324,192325,192326,192327,192328,192329, - 192330,192331,192332,192333,192334,192335,192286,192287,192292,192299,192304,192305,192306,192307,192308,192309); -- Alliance Banner +192330,192331,192332,192333,192334,192335,192286,192287,192292,192299,192304,192305,192306,192307,192308,192309); -- Alliance Banner - UPDATE `gameobject_template` SET `faction`=114 WHERE `entry` IN (192269,192284,192285,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,192376,192377,192378,192379,192254, - 192255,192336); -- Horde Banner - +192362,192363,192364,192366,192367,192368,192369,192370,192371,192372,192373,192374,192375,192376,192377,192378,192379,192254, +192255,192336); -- Horde Banner + UPDATE `gameobject_template` SET `faction`=114 WHERE `entry` IN (193096,193097,193098,193099,193100,193101,193102,193103,193104,193105,193106,193107,193108,193109,193124,193125,193126,193127, - 193128,193129,193130,193131,193132,193133,193134,193135,193136,193137,193138,193139,193140,193141,193142,193143,193144,193145, - 193146,193147,193148,193149,193150,193151,193152,193153,193154,193155,193156,193157,193158,193159,193160,193161,193162,193163, - 193164,193165); -- nameless GOs +193128,193129,193130,193131,193132,193133,193134,193135,193136,193137,193138,193139,193140,193141,193142,193143,193144,193145, +193146,193147,193148,193149,193150,193151,193152,193153,193154,193155,193156,193157,193158,193159,193160,193161,193162,193163, +193164,193165); -- nameless GOs UPDATE `creature_template` SET `exp`=0 WHERE `entry`=31841; -- Taunka Spirit Guide UPDATE `creature_template` SET `exp`=0 WHERE `entry`=31842; -- Dwarven Spirit Guide @@ -21,31 +20,20 @@ UPDATE `creature_template` SET `dynamicflags`=`dynamicflags`|4 WHERE `entry`=311 UPDATE `creature_template` SET `baseattacktime`=2000,`unit_flags`=`unit_flags`|768 WHERE `entry`=39173; -- Champion Ros'slai UPDATE `creature_template` SET `unit_flags`=`unit_flags`|16 WHERE `entry`=30740; -- Valiance Expedition Champion (?) UPDATE `creature_template` SET `InhabitType`=7 WHERE `entry`=27852; -- Wintergrasp Control Arms - -/* -Sniff check these --- Wintergrasp Cannons (Spell 51421 : Fire Cannon) -UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1735 WHERE `entry`=28366; -- *** WRONG **** -UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1732 WHERE `entry` IN (30499,30740, 28319); -- Alliance -UPDATE `creature_template` SET `faction_A`=1735,`faction_H`=1735 WHERE `entry` IN (30400,30739, 32629); -- Horde - --- Added by Malcrom -UPDATE `creature_template` SET `faction_A`=1732,`faction_H`=1732 WHERE `entry` IN (28312); -- Alliance -UPDATE `creature_template` SET `faction_A`=1735,`faction_H`=1735 WHERE `entry` IN (32627); -- Horde - --- Wintergrasp Catapult speed adjustments -UPDATE `creature_template` SET `speed_walk`=2.8,`speed_run`=1.71429 WHERE `entry`=27881; - --- Creature Gossip_menu_id Update from sniff -UPDATE `creature_template` SET `gossip_menu_id`=9904 WHERE `entry`=30400; -UPDATE `creature_template` SET `gossip_menu_id`=10229 WHERE `entry`=31091; -*/ +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216 WHERE `entry`=28366; -- Wintergrasp Tower Cannon +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2 WHERE `entry`=32629; -- Wintergrasp Siege Turret +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2 WHERE `entry`=28319; -- Wintergrasp Siege Turret +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2,`speed_run`=1 WHERE `entry`=32627; -- Wintergrasp Siege Engine +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=1.2,`speed_run`=1 WHERE `entry`=28312; -- Wintergrasp Siege Engine +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216,`unit_flags`=16384,`speed_walk`=1.2,`speed_run`=1 WHERE `entry`=28094; -- Wintergrasp Demolisher +UPDATE `creature_template` SET `faction_A`=35,`faction_H`=35,`npcflag`=16777216,`unit_flags`=16384,`unit_class`=4,`speed_walk`=2.8,`speed_run`=1.71429 WHERE `entry`=27881; -- Wintergrasp Catapult UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1.65,`gender`=0 WHERE `modelid`=27894; -- Knight Dameron UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1.65,`gender`=0 WHERE `modelid`=31346; -- Marshal Magruder UPDATE `creature_model_info` SET `bounding_radius`=0.3366,`combat_reach`=1.65,`gender`=0 WHERE `modelid`=31347; -- Champion Ros'slai +UPDATE `creature_model_info` SET `bounding_radius`=0.305,`combat_reach`=5,`gender`=2 WHERE `modelid`=25301; -- Wintergrasp Siege Turret -DELETE FROM `creature_template_addon` WHERE `entry` IN (31841,31842,30400,30499,30489,30869,31036,31051,31052,31054,31108,31109,31153,32294,39172,30870,31053,31091,31101,31102,31106,31107,31151,32296,39173,30740); +DELETE FROM `creature_template_addon` WHERE `entry` IN (31841,31842,30400,30499,30489,30869,31036,31051,31052,31054,31108,31109,31153,32294,39172,30870,31053,31091,31101,31102,31106,31107,31151,32296,39173,30740,32629,28319,28366,32627,28312,28094,27881,30739); INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (31841,0,0,1,0, '58729'), -- Taunka Spirit Guide (Spiritual Immunity, Spirit Heal Channel) FIX: Do we need the spell that revives players here (22011)? It has a duration (found in sniffs). (31842,0,0,1,0, '58729'), -- Dwarven Spirit Guide This spell (and the spell it triggers, are used in the "ressurect system" in Battleground.cpp @@ -72,5 +60,25 @@ INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`emote` (31151,0,0,257,0, NULL), -- Tactical Officer Kilrath (32296,27245,0,1,0, NULL), -- Stone Guard Mukar (39173,29261,0,1,0, NULL), -- Champion Ros'slai -(30740,0,0,257,375, NULL); -- Valiance Expedition Champion +(30740,0,0,257,375, NULL), -- Valiance Expedition Champion +(32629,0,0,257,0, NULL), -- Wintergrasp Siege Turret +(28319,0,0,257,0, NULL), -- Wintergrasp Siege Turret +(28366,0,0,257,0, NULL), -- Wintergrasp Tower Cannon +(32627,0,0,257,0, NULL), -- Wintergrasp Siege Engine +(28312,0,0,257,0, NULL), -- Wintergrasp Siege Engine +(28094,0,0,257,0, NULL), -- Wintergrasp Demolisher +(27881,0,0,257,0, NULL), -- Wintergrasp Catapult +(30739,0,0,257,375, NULL); -- Warsong Champion + +-- Wintergrasp vehicles: +UPDATE `creature_template` SET `spell1`=51421, /* Fire Cannon */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28366; -- Wintergrasp Tower Cannon (Both) +UPDATE `creature_template` SET `spell1`=57609, /* Fire Cannon */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=32629; -- Wintergrasp Siege Turret (H) +UPDATE `creature_template` SET `spell1`=57609, /* Fire Cannon */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28319; -- Wintergrasp Siege Turret (A) +UPDATE `creature_template` SET `spell1`=54109, /* Ram */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=32627; -- Wintergrasp Siege Engine (H) +UPDATE `creature_template` SET `spell1`=54109, /* Ram */ `spell2`=0,`spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28312; -- Wintergrasp Siege Engine (A) +UPDATE `creature_template` SET `spell1`=54107, /* Ram */ `spell2`=50896, /* Hurl Boulder */ `spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=28094; -- Wintergrasp Demolisher (H) +UPDATE `creature_template` SET `spell1`=57606, /* Plague Barrel */ `spell2`=50989, /* Flame Breath */ `spell3`=0,`spell4`=0,`spell5`=0,`spell6`=0,`spell7`=0,`spell8`=0 WHERE `entry`=27881; -- Wintergrasp Catapult (Both) +-- Note: Siege Engines, Demolisher faction is guess (vehicles get the faction of his driver) +-- Demolisher spell positions is not confirmed +-- Wintergrasp Tower Cannon H: 1735 A: 1732 diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp new file mode 100644 index 00000000000..3e35500a556 --- /dev/null +++ b/src/server/scripts/Northrend/wintergrasp.cpp @@ -0,0 +1,429 @@ +/* Copyright (C) 2008 - 2009 Trinity <http://www.trinitycore.org/> + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "ScriptPCH.h" +#include "BattlefieldMgr.h" +#include "BattlefieldWG.h" +#include "Battlefield.h" +#include "ScriptSystem.h" +#include "WorldSession.h" +#include "ObjectMgr.h" + +#define GOSSIP_HELLO_DEMO1 "Build catapult." +#define GOSSIP_HELLO_DEMO2 "Build demolisher." +#define GOSSIP_HELLO_DEMO3 "Build siege engine." +#define GOSSIP_HELLO_DEMO4 "I cannot build more!" + +enum eWGqueuenpctext +{ + WG_NPCQUEUE_TEXT_H_NOWAR = 14775, + WG_NPCQUEUE_TEXT_H_QUEUE = 14790, + WG_NPCQUEUE_TEXT_H_WAR = 14777, + WG_NPCQUEUE_TEXT_A_NOWAR = 14782, + WG_NPCQUEUE_TEXT_A_QUEUE = 14791, + WG_NPCQUEUE_TEXT_A_WAR = 14781, + WG_NPCQUEUE_TEXTOPTION_JOIN = -1850507, +}; + +enum eWGdata +{ + // engineer spells + SPELL_BUILD_CATAPULT = 56663, + SPELL_BUILD_DEMOLISHER = 56575, + SPELL_BUILD_SIEGE_ENGINE = 61408, + SPELL_BUILD_SIEGE_ENGINE2 = 56661, // does it's really needed here? + SPELL_ACTIVATE_ROBOTIC_ARMS = 49899, + + // teleporter spells + SPELL_VEHICLE_TELEPORT = 49759, +}; + +class npc_wg_demolisher_engineer : public CreatureScript +{ + public: + npc_wg_demolisher_engineer() : CreatureScript("npc_wg_demolisher_engineer") + { + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(1); + + if (!BfWG) + return true; + + if (BfWG->GetData(pCreature->GetEntry() == 30400 ? BATTLEFIELD_WG_DATA_MAX_VEHICLE_H : BATTLEFIELD_WG_DATA_MAX_VEHICLE_A) > + BfWG->GetData(pCreature->GetEntry() == 30400 ? BATTLEFIELD_WG_DATA_VEHICLE_H : BATTLEFIELD_WG_DATA_VEHICLE_A)) + { + if (pPlayer->HasAura(SPELL_CORPORAL)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + else if (pPlayer->HasAura(SPELL_LIEUTENANT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + } + } + else + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* pCreature, uint32 /*uiSender */ , uint32 uiAction) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(1); + + if (!BfWG) + return true; + + if (BfWG->GetData(pCreature->GetEntry() == 30400 ? BATTLEFIELD_WG_DATA_MAX_VEHICLE_H : BATTLEFIELD_WG_DATA_MAX_VEHICLE_A) > + BfWG->GetData(pCreature->GetEntry() == 30400 ? BATTLEFIELD_WG_DATA_VEHICLE_H : BATTLEFIELD_WG_DATA_VEHICLE_A)) + { + switch (uiAction - GOSSIP_ACTION_INFO_DEF) + { + case 0: + pPlayer->CastSpell(pPlayer, SPELL_BUILD_CATAPULT, false, NULL, NULL, pCreature->GetGUID()); + break; + case 1: + pPlayer->CastSpell(pPlayer, SPELL_BUILD_DEMOLISHER, false, NULL, NULL, pCreature->GetGUID()); + break; + case 2: + pPlayer->CastSpell(pPlayer, pPlayer->GetTeamId() ? SPELL_BUILD_SIEGE_ENGINE : SPELL_BUILD_SIEGE_ENGINE2, false, NULL, NULL, pCreature->GetGUID()); + break; + } + //spell 49899 Emote : 406 from sniff + //INSERT INTO `spell_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES ('49899', '0', '1', '406', '0', '0', '0', '0', '0', '0'); + if (Creature* creature = pCreature->FindNearestCreature(27852, 30.0f, true)) + creature->CastSpell(creature, SPELL_ACTIVATE_ROBOTIC_ARMS, true); + } + return true; + } +}; + +class npc_wg_spirit_guide : public CreatureScript +{ + public: + npc_wg_spirit_guide() : CreatureScript("npc_wg_spirit_guide") + { + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (BfWG) + { + GraveYardVect gy = BfWG->GetGraveYardVect(); + for (uint8 i = 0; i < gy.size(); i++) + { + if (gy[i]->GetControlTeamId() == pPlayer->GetTeamId()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(((BfGraveYardWG *) gy[i])->GetTextId()), GOSSIP_SENDER_MAIN, + GOSSIP_ACTION_INFO_DEF + i); + } + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature */ , uint32 /*uiSender */ , uint32 uiAction) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (BfWG) + { + GraveYardVect gy = BfWG->GetGraveYardVect(); + for (uint8 i = 0; i < gy.size(); i++) + { + if (uiAction - GOSSIP_ACTION_INFO_DEF == i && gy[i]->GetControlTeamId() == pPlayer->GetTeamId()) + { + WorldSafeLocsEntry const* ws = sWorldSafeLocsStore.LookupEntry(gy[i]->GetGraveYardId()); + pPlayer->TeleportTo(ws->map_id, ws->x, ws->y, ws->z, 0); + } + } + } + return true; + } +}; + +class npc_wg_queue : public CreatureScript +{ + public: + npc_wg_queue() : CreatureScript("npc_wg_queue") + { + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (BfWG) + { + + if (BfWG->IsWarTime()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(BfWG->GetDefenderTeam()? WG_NPCQUEUE_TEXT_H_WAR : WG_NPCQUEUE_TEXT_A_WAR, pCreature->GetGUID()); + } + else + { + uint32 uiTime = BfWG->GetTimer() / 1000; + pPlayer->SendUpdateWorldState(4354, time(NULL) + uiTime); + if (uiTime < 15 * MINUTE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, sObjectMgr->GetTrinityStringForDBCLocale(WG_NPCQUEUE_TEXTOPTION_JOIN), GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(BfWG->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_QUEUE : WG_NPCQUEUE_TEXT_A_QUEUE, pCreature->GetGUID()); + } + else + { + pPlayer->SEND_GOSSIP_MENU(BfWG->GetDefenderTeam() ? WG_NPCQUEUE_TEXT_H_NOWAR : WG_NPCQUEUE_TEXT_A_NOWAR, pCreature->GetGUID()); + } + } + } + return true; + } + + bool OnGossipSelect(Player* pPlayer, Creature* /*pCreature */ , uint32 /*uiSender */ , uint32 /*uiAction */ ) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (BfWG) + { + if (BfWG->IsWarTime()) + { + BfWG->InvitePlayerToWar(pPlayer); + } + else + { + uint32 uiTime = BfWG->GetTimer() / 1000; + if (uiTime < 15 * MINUTE) + BfWG->InvitePlayerToQueue(pPlayer); + } + } + return true; + } +}; + +const uint32 Vehicules[4] = { 32627, 28312, 28094, 27881 }; + +class go_wg_vehicle_teleporter : public GameObjectScript +{ + public: + go_wg_vehicle_teleporter() : GameObjectScript("go_wg_vehicle_teleporter") + { + } + + struct go_wg_vehicle_teleporterAI : public GameObjectAI + { + go_wg_vehicle_teleporterAI(GameObject* g) : GameObjectAI(g) + { + uiCheckTimer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (uiCheckTimer <= diff) + { + for (uint8 i = 0; i < 4; i++) + if (Creature* pVehicle = go->FindNearestCreature(Vehicules[i], 3.0f, true)) + if (!pVehicle->HasAura(SPELL_VEHICLE_TELEPORT)) + { + if (pVehicle->GetVehicle()) + { + if (Unit* player = pVehicle->GetVehicle()->GetPassenger(0)) + { + uint32 gofaction = go->GetUInt32Value(GAMEOBJECT_FACTION); + uint32 plfaction = player->getFaction(); + if (gofaction == plfaction) + { + pVehicle->CastSpell(pVehicle, SPELL_VEHICLE_TELEPORT, true); + if (Creature* TargetTeleport = pVehicle->FindNearestCreature(23472, 100.0f, true)) + { + float x, y, z, o; + TargetTeleport->GetPosition(x, y, z, o); + pVehicle->GetVehicle()->TeleportVehicle(x, y, z, o); + } + } + } + } + } + uiCheckTimer = 1000; + } + else + uiCheckTimer -= diff; + } + private: + uint32 uiCheckTimer; + }; + + GameObjectAI *GetAI(GameObject* go) const + { + return new go_wg_vehicle_teleporterAI(go); + } +}; + +class npc_wg_quest_giver : public CreatureScript +{ + public: + npc_wg_quest_giver() : CreatureScript("npc_wg_quest_giver") + { + } + + bool OnGossipHello(Player* pPlayer, Creature* pCreature) + { + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + BattlefieldWG* BfWG = (BattlefieldWG *) sBattlefieldMgr.GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (BfWG) + { + if (pCreature->isQuestGiver()) + { + Object* pObject = (Object *) pCreature; + QuestRelations* pObjectQR = sObjectMgr->GetCreatureQuestRelationMap(); + QuestRelations* pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelation(); + + QuestMenu & qm = pPlayer->PlayerTalkClass->GetQuestMenu(); + qm.ClearMenu(); + + for (QuestRelations::const_iterator i = pObjectQIR->lower_bound(pObject->GetEntry()); i != pObjectQIR->upper_bound(pObject->GetEntry()); ++i) + { + uint32 quest_id = i->second; + QuestStatus status = pPlayer->GetQuestStatus(quest_id); + if (status == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(quest_id)) + qm.AddMenuItem(quest_id, 4); + else if (status == QUEST_STATUS_INCOMPLETE) + qm.AddMenuItem(quest_id, 4); + } + + for (QuestRelations::const_iterator i = pObjectQR->lower_bound(pObject->GetEntry()); i != pObjectQR->upper_bound(pObject->GetEntry()); ++i) + { + uint32 quest_id = i->second; + Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id); + if (!pQuest) + continue; + + switch (quest_id) + { + // Horde attacker + case 13193: + case 13202: + case 13180: + case 13200: + case 13201: + case 13223: + if (BfWG->GetAttackerTeam() == TEAM_HORDE) + { + QuestStatus status = pPlayer->GetQuestStatus(quest_id); + + if (pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 4); + else if (status == QUEST_STATUS_NONE && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 2); + } + break; + // Horde defender + case 13199: + case 13192: + case 13178: + case 13191: + case 13194: + case 13539: + case 13185: + if (BfWG->GetDefenderTeam() == TEAM_HORDE) + { + QuestStatus status = pPlayer->GetQuestStatus(quest_id); + + if (pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 4); + else if (status == QUEST_STATUS_NONE && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 2); + } + break; + // Alliance attacker + case 13196: + case 13198: + case 13179: + case 13222: + case 13195: + if (BfWG->GetAttackerTeam() == TEAM_ALLIANCE) + { + QuestStatus status = pPlayer->GetQuestStatus(quest_id); + + if (pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 4); + else if (status == QUEST_STATUS_NONE && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 2); + } + break; + // Alliance defender + case 13154: + case 13153: + case 13177: + case 13538: + case 13186: + case 13156: + if (BfWG->GetDefenderTeam() == TEAM_ALLIANCE) + { + QuestStatus status = pPlayer->GetQuestStatus(quest_id); + + if (pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 4); + else if (status == QUEST_STATUS_NONE && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 2); + } + break; + default: + QuestStatus status = pPlayer->GetQuestStatus(quest_id); + + if (pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 4); + else if (status == QUEST_STATUS_NONE && pPlayer->CanTakeQuest(pQuest, false)) + qm.AddMenuItem(quest_id, 2); + break; + } + } + } + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; + } + return true; + } +}; + +void AddSC_wintergrasp() +{ + new npc_wg_queue(); + new npc_wg_spirit_guide(); + new npc_wg_demolisher_engineer(); + new go_wg_vehicle_teleporter(); + new npc_wg_quest_giver(); +} |
