From 71a83f9da1920329391f63014dd28b49d347023b Mon Sep 17 00:00:00 2001 From: BroodWyrm Date: Sun, 21 Aug 2011 23:11:37 +0200 Subject: [PATCH] * Argent Tournament - Add Script for The Grand Melee Quest - Fix Bug in Mastery Gossip - Add Misc SQL Fixes --- .../IceCrownQuests - Argent Tournament.sql | 95 +++++++++--- .../lol/summary/2011_8_20_0_lol_sum_world.sql | 39 +++++ sql/old/lol/summary/2011_8_20_0_sum_world.sql | 62 ++++++++ src/server/scripts/Northrend/icecrown.cpp | 143 +++++++++++++++++- 4 files changed, 318 insertions(+), 21 deletions(-) create mode 100644 sql/old/lol/summary/2011_8_20_0_lol_sum_world.sql create mode 100644 sql/old/lol/summary/2011_8_20_0_sum_world.sql diff --git a/sql/custom/IceCrownQuests - Argent Tournament.sql b/sql/custom/IceCrownQuests - Argent Tournament.sql index c07d20ea30bba..1f06e0af21c8d 100644 --- a/sql/custom/IceCrownQuests - Argent Tournament.sql +++ b/sql/custom/IceCrownQuests - Argent Tournament.sql @@ -35,17 +35,17 @@ UPDATE quest_template SET PrevQuestId = 13672, NextQuestId = 0, ExclusiveGroup = UPDATE quest_template SET PrevQuestId = 13678, NextQuestId = 0, ExclusiveGroup = 0, NextQuestInChain = 0 WHERE entry = 13680; -- Mastery Gossip by tREAK -SET @NPC_MoM := 33973; -- Jeran Lockwood -SET @G_MoM_0 := 10398; -- Gossip Option -SET @G_MoM_1 := @G_MoM_0+1; -- 10398 +SET @NPC_MoM = 33973; -- Jeran Lockwood +SET @G_MoM_0 = 10398; -- Gossip Option +SET @G_MoM_1 = @G_MoM_0+1; -- 10398 -SET @NPC_MoSB := 33974; -- Valis Windchaser -SET @G_MoSB_0 := 10402; -- Gossip Option -SET @G_MoSB_1 :=@G_MoSB_0+1; -- 10403 +SET @NPC_MoSB = 33974; -- Valis Windchaser +SET @G_MoSB_0 = 10402; -- Gossip Option +SET @G_MoSB_1 =@G_MoSB_0+1; -- 10403 -SET @NPC_MoC := 33972; -- Rugan Steelbelly -SET @G_MoC_0 := 10400; -- Gossip Option -SET @G_MoC_1 := @G_MoC_0+1; -- 10401 +SET @NPC_MoC = 33972; -- Rugan Steelbelly +SET @G_MoC_0 = 10400; -- Gossip Option +SET @G_MoC_1 = @G_MoC_0+1; -- 10401 UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='',`unit_flags`=`unit_flags`|1 WHERE `entry` IN (@NPC_MoM,@NPC_MoSB,@NPC_MoC); UPDATE `creature_template` SET `gossip_menu_id`=10398 WHERE `entry`=@NPC_MoM; @@ -88,29 +88,51 @@ DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid` IN (@NPC_MoM 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 (@NPC_MoM,0,0,3,62,0,100,0,@G_MoM_0,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Jeran Lockwood - on Gossip select - close Gossip'), (@NPC_MoM,0,1,2,62,0,100,0,@G_MoM_1,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Jeran Lockwood - on Gossip select - close Gossip'), -(@NPC_MoM,0,2,3,61,0,100,0,0,0,0,0,33,@NPC_MoM,0,0,0,0,0,7,0,0,0,0,0,0,0,'Jeran Lockwood - on Gossip select - give Kill Credit'), +(@NPC_MoM,0,2,3,61,0,100,0,0,0,0,0,11,64113,2,0,0,0,0,7,0,0,0,0,0,0,0,'Jeran Lockwood - on Gossip select - give Kill Credit'), (@NPC_MoM,0,3,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Jeran Lockwood - on Gossip select - Boss Emote to Player'), (@NPC_MoSB,0,0,3,62,0,100,0,@G_MoSB_0,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Valis Windchaser - on Gossip select - close Gossip'), (@NPC_MoSB,0,1,2,62,0,100,0,@G_MoSB_1,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Valis Windchaser - on Gossip select - close Gossip'), -(@NPC_MoSB,0,2,3,61,0,100,0,0,0,0,0,33,@NPC_MoSB,0,0,0,0,0,7,0,0,0,0,0,0,0,'Valis Windchaser - on Gossip select - give Kill Credit'), +(@NPC_MoSB,0,2,3,61,0,100,0,0,0,0,0,11,64115,2,0,0,0,0,7,0,0,0,0,0,0,0,'Valis Windchaser - on Gossip select - give Kill Credit'), (@NPC_MoSB,0,3,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Valis Windchaser - on Gossip select - Boss Emote to Player'), (@NPC_MoC,0,0,3,62,0,100,0,@G_MoC_0,1,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rugan Steelbelly - on Gossip select - close Gossip'), (@NPC_MoC,0,1,2,62,0,100,0,@G_MoC_1,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rugan Steelbelly - on Gossip select - close Gossip'), -(@NPC_MoC,0,2,3,61,0,100,0,0,0,0,0,33,@NPC_MoC,0,0,0,0,0,7,0,0,0,0,0,0,0,'Rugan Steelbelly - on Gossip select - give Kill Credit'), +(@NPC_MoC,0,2,3,61,0,100,0,0,0,0,0,11,64114,2,0,0,0,0,7,0,0,0,0,0,0,0,'Rugan Steelbelly - on Gossip select - give Kill Credit'), (@NPC_MoC,0,3,0,61,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Rugan Steelbelly - on Gossip select - Boss Emote to Player'); -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (@G_MoM_0,@G_MoSB_0,@G_MoC_0) AND `ConditionTypeOrReference`=9; -- more delete conditions because of existing conditions of these quests +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (@G_MoM_0,@G_MoM_1,@G_MoSB_0,@G_MoSB_1,@G_MoC_0,@G_MoC_1) AND `ConditionTypeOrReference` IN (1,9); -- more delete conditions because of existing conditions of these quests +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (@G_MoM_1,@G_MoSB_1,@G_MoC_1) AND `ConditionTypeOrReference` IN (1,8); INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES (15,@G_MoM_0,0,0,9,13828,0,0,0,'','show Gossip Option if Player has taken Quest 13828'), -(15,@G_MoM_0,0,0,9,13829,0,0,0,'','show Gossip Option if Player has taken Quest 13829'), - +(15,@G_MoM_0,0,0,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), +(15,@G_MoM_0,0,1,9,13829,0,0,0,'','show Gossip Option if Player has taken Quest 13829'), +(15,@G_MoM_0,0,1,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), + (15,@G_MoSB_0,0,0,9,13835,0,0,0,'','show Gossip Option if Player has taken Quest 13835'), -(15,@G_MoSB_0,0,0,9,13838,0,0,0,'','show Gossip Option if Player has taken Quest 13838'), - +(15,@G_MoSB_0,0,0,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), +(15,@G_MoSB_0,0,1,9,13838,0,0,0,'','show Gossip Option if Player has taken Quest 13838'), +(15,@G_MoSB_0,0,1,1,63151,0,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), + (15,@G_MoC_0,0,0,9,13837,0,0,0,'','show Gossip Option if Player has taken Quest 13837'), -(15,@G_MoC_0,0,0,9,13839,0,0,0,'','show Gossip Option if Player has taken Quest 13839'); +(15,@G_MoC_0,0,0,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), +(15,@G_MoC_0,0,1,9,13839,0,0,0,'','show Gossip Option if Player has taken Quest 13839'), +(15,@G_MoC_0,0,1,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), + +(15,@G_MoM_1,0,0,8,13828,0,0,0,'','show Gossip Option if Player has rewarded Quest 13828'), +(15,@G_MoM_1,0,0,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), +(15,@G_MoM_1,0,1,8,13829,0,0,0,'','show Gossip Option if Player has rewarded Quest 13829'), +(15,@G_MoM_1,0,1,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), + +(15,@G_MoSB_1,0,0,8,13835,0,0,0,'','show Gossip Option if Player has rewarded Quest 13835'), +(15,@G_MoSB_1,0,0,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), +(15,@G_MoSB_1,0,1,8,13838,0,0,0,'','show Gossip Option if Player has rewarded Quest 13838'), +(15,@G_MoSB_1,0,1,1,63151,0,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), + +(15,@G_MoC_1,0,0,8,13837,0,0,0,'','show Gossip Option if Player has rewarded Quest 13837'), +(15,@G_MoC_1,0,0,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'), +(15,@G_MoC_1,0,1,8,13839,0,0,0,'','show Gossip Option if Player has rewarded Quest 13839'), +(15,@G_MoC_1,0,1,1,63151,1,0,0,'','show Gossip Option if Player has Aura: Ride Vehicle'); -- ## Dailys @@ -925,3 +947,40 @@ DELETE FROM pool_quest WHERE pool_entry IN (34882); INSERT INTO pool_quest VALUES (14107,35094,'Tournament - Champion - The Argent Crusade - Kraken - The Fate Of The Fallen'), (14108,35094,'Tournament - Champion - The Argent Crusade - Kraken - Get Kraken!'); + +-- Valiant Spellaura on Vehicle Quest: The Grand Melee +DELETE FROM spell_linked_spell WHERE spell_trigger IN (63151,-63151); +INSERT INTO spell_linked_spell VALUES +(63151,63405,0,'Darnassus Valiant'), +(63151,63422,0,'Exodar Valiant'), +(63151,63395,0,'Gnomeregan Valiant'), +(63151,63426,0,'Ironforge Valiant'), +(63151,63432,0,'Orgrimmar Valiant'), +(63151,63398,0,'SenJin Valiant'), +(63151,63402,0,'Silvermoon Valiant'), +(63151,62596,0,'Stormwind Valiant'), +(63151,63435,0,'Thunder Bluff Valiant'), +(63151,63429,0,'Undercity Valiant'), +(-63151,-63405,0,'Darnassus Valiant remove'), +(-63151,-63422,0,'Exodar Valiant remove'), +(-63151,-63395,0,'Gnomeregan Valiant remove'), +(-63151,-63426,0,'Ironforge Valiant remove'), +(-63151,-63432,0,'Orgrimmar Valiant remove'), +(-63151,-63398,0,'SenJin Valiant remove'), +(-63151,-63402,0,'Silvermoon Valiant remove'), +(-63151,-62596,0,'Stormwind Valiant remove'), +(-63151,-63435,0,'Thunder Bluff Valiant remove'), +(-63151,-63429,0,'Undercity Valiant remove'); + +DELETE FROM conditions WHERE SourceEntry IN (63405,63422,63395,63426,63432,63398,63402,62596,63435,63429); +INSERT INTO conditions VALUES +(17,0,63405,0,9,13761,0,0,0,'','Darnassus Valiant'), +(17,0,63422,0,9,13756,0,0,0,'','Exodar Valiant'), +(17,0,63395,0,9,13750,0,0,0,'','Gnomeregan Valiant'), +(17,0,63426,0,9,13745,0,0,0,'','Ironforge Valiant'), +(17,0,63432,0,9,13767,0,0,0,'','Orgrimmar Valiant'), +(17,0,63398,0,9,13772,0,0,0,'','SenJin Valiant'), +(17,0,63402,0,9,13787,0,0,0,'','Silvermoon Valiant'), +(17,0,62596,0,9,13665,0,0,0,'','Stormwind Valiant'), +(17,0,63435,0,9,13777,0,0,0,'','Thunder Bluff Valiant'), +(17,0,63429,0,9,13782,0,0,0,'','Undercity Valiant'); \ No newline at end of file diff --git a/sql/old/lol/summary/2011_8_20_0_lol_sum_world.sql b/sql/old/lol/summary/2011_8_20_0_lol_sum_world.sql new file mode 100644 index 0000000000000..35e53a4281b0a --- /dev/null +++ b/sql/old/lol/summary/2011_8_20_0_lol_sum_world.sql @@ -0,0 +1,39 @@ +DELETE FROM `spell_area` WHERE `spell`=64169; +INSERT INTO `spell_area` (`spell`,`area`,`quest_start`,`quest_start_active`,`quest_end`,`aura_spell`,`racemask`,`gender`,`autocast`) VALUES +(64169,4273,0,0,0,0,0,2,0); +-- Quest 12860, 12927 "Data Mining" +UPDATE `creature_template` SET `AIName`='SmartAI',`InhabitType`=3 WHERE `entry`=29746; +UPDATE `creature` SET `spawntimesecs`=180 WHERE `id`=29746; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=29746; +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 +(29746,0,0,0,8,0,100,0,59728,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'On spellhit - Despawn'); + +DELETE FROM `spell_scripts` WHERE `id`=59728; +INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(59728,0,0,8,29752,0,0,0,0,0,0); -- Give quest credit + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=51161; -- delete wrong existing condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=55161; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17,0,55161,0,29,29746,20,0,0,'','Spell Retrieve Data will only be cast near Databank'); +-- Ignis - Hot Pocket +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (10430,10431) AND `type`=18; + +UPDATE `creature_template` SET `ScriptName`='npc_hyldsmeet_protodrake_transport' WHERE `entry`=29679; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (62496,67390,64414); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceEntry`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`) VALUES +(13,62496,18,1,33167), +(13,67390,18,1,33167), +(13,64414,18,1,33109); + +-- Broggok Poison Cloud +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|0x4|0x20000, `flags_extra`=`flags_extra`|128, `ScriptName`='' WHERE `entry` IN (17662,18602); + +-- Cosmetic Drakkari Bat [PH] +UPDATE `creature_template` SET `unit_flags`=`unit_flags`|0x2, `flags_extra`=`flags_extra`|0x2 WHERE `entry`=27490; + +-- Harbinger Skyriss (heroic) +UPDATE `creature_template` SET `Health_mod`=33 WHERE `entry`=21601; + diff --git a/sql/old/lol/summary/2011_8_20_0_sum_world.sql b/sql/old/lol/summary/2011_8_20_0_sum_world.sql new file mode 100644 index 0000000000000..6ffed710bc74c --- /dev/null +++ b/sql/old/lol/summary/2011_8_20_0_sum_world.sql @@ -0,0 +1,62 @@ +DELETE FROM `trinity_string` WHERE `entry` IN (453, 550, 714, 716); +INSERT INTO `trinity_string` (`entry`,`content_default`) VALUES +(453,'Ban time remaining: %s, Banned by: %s, Reason: %s'), +(550,'Mute time remaining: %s'), +(716,'Map: %s, Area: %s'), +(714,'Map: %s, Area: %s, Zone: %s, Phase: %u'); + +DELETE FROM `command` WHERE `name` = 'pinfo'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES ('pinfo','2','Syntax: .pinfo [$player_name/#GUID]\r\n\r\nOutput account information for selected player or player find by $player_name or #GUID.'); + +UPDATE `creature_template` SET `ScriptName`='npc_hyldsmeet_protodrake' WHERE `entry`=29625; +UPDATE `creature_loot_template` SET `maxcount`=3 WHERE `entry`=38401 AND `mincountOrRef`=-34248; + +UPDATE `vehicle_template_accessory` SET `seat_id`=1, `minion`=1 WHERE `entry`=29625; + +UPDATE `creature_template` SET `npcflag`=`npcflag`|0x1000000,`VehicleId`=165,`spell1`=54420,`AIName`='SmartAI',`InhabitType`=5 WHERE `entry`=29403; +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=29403; +INSERT INTO `npc_spellclick_spells` VALUES +(29403,49641,0,0,0,1,0,0,0); + +DELETE FROM `spell_scripts` WHERE `id`=54420; +INSERT INTO `spell_scripts` (`id`,`effIndex`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(54420,1,0,18,0,0,0,0,0,0,0); + + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (12747,12748,12749) AND `type`=12; +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) +VALUES +(12747,12,1,0,''), +(12748,12,1,0,''), +(12749,12,1,0,''); + +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (12740,12741,12744,12993) AND `type`=12; +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) +VALUES +(12740,12,0,0,''), +(12741,12,0,0,''), +(12744,12,0,0,''), +(12993,12,1,0,''); + +DELETE FROM `spell_script_names` WHERE `spell_id`=64414; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(64414,'spell_load_into_catapult'); + +-- Update a wrongly entered spell +UPDATE `creature_template` SET `spell6`=64414 WHERE `entry`=33167; + +DELETE FROM `spell_script_names` WHERE `spell_id`=58886; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) +VALUES +(58886,'spell_magic_eater_food'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=61889; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) +VALUES +(61889,'spell_assembly_meltdown'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=20577; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) +VALUES +(20577,'spell_gen_cannibalize'); + diff --git a/src/server/scripts/Northrend/icecrown.cpp b/src/server/scripts/Northrend/icecrown.cpp index 3366dc14e5ed1..5f92ede6c94ff 100644 --- a/src/server/scripts/Northrend/icecrown.cpp +++ b/src/server/scripts/Northrend/icecrown.cpp @@ -493,9 +493,6 @@ class spell_argent_cannon : public SpellScriptLoader } }; - - - enum BlessedBannerSpells { SPELL_BLESSING_OF_THE_CRUSADE = 58026, @@ -1690,6 +1687,145 @@ class npc_vendor_tournament_fraction_champion : public CreatureScript } }; +/*###### +## npc_fraction_valiant +######*/ + +/* +UPDATE creature_template SET scriptname = 'npc_faction_valiant' WHERE entry IN (33559,33562,33558,33564,33306,33285,33382,33561,33383,33384); +*/ + +enum eFractionValiant +{ + //SPELL_CHARGE = 63010, + //SPELL_SHIELD_BREAKER = 65147, + + SPELL_GIVE_VALIANT_MARK_1 = 62724, + SPELL_GIVE_VALIANT_MARK_2 = 62770, + SPELL_GIVE_VALIANT_MARK_3 = 62771, + SPELL_GIVE_VALIANT_MARK_4 = 62995, + SPELL_GIVE_VALIANT_MARK_5 = 62996, + + QUEST_THE_GRAND_MELEE_0 = 13665, + QUEST_THE_GRAND_MELEE_1 = 13745, + QUEST_THE_GRAND_MELEE_2 = 13750, + QUEST_THE_GRAND_MELEE_3 = 13756, + QUEST_THE_GRAND_MELEE_4 = 13761, + QUEST_THE_GRAND_MELEE_5 = 13767, + QUEST_THE_GRAND_MELEE_6 = 13772, + QUEST_THE_GRAND_MELEE_7 = 13777, + QUEST_THE_GRAND_MELEE_8 = 13782, + QUEST_THE_GRAND_MELEE_9 = 13787, +}; + +#define GOSSIP_MELEE_FIGHT "I'am ready to fight!" + +class npc_faction_valiant : public CreatureScript +{ +public: + npc_faction_valiant() : CreatureScript("npc_faction_valiant") { } + + struct npc_faction_valiantAI : public ScriptedAI + { + npc_faction_valiantAI(Creature* creature) : ScriptedAI(creature) + { + } + + uint32 uiChargeTimer; + uint32 uiShieldBreakerTimer; + uint64 guidAttacker; + + void Reset() + { + uiChargeTimer = 7000; + uiShieldBreakerTimer = 10000; + + me->setFaction(35); + } + + void EnterCombat(Unit* attacker) + { + guidAttacker = attacker->GetGUID(); + } + + void MovementInform(uint32 uiType, uint32 /*uiId*/) + { + if (uiType != POINT_MOTION_TYPE) + return; + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if(pDoneBy && pDoneBy->GetGUID() != guidAttacker) + uiDamage = 0; + + if (uiDamage > me->GetHealth() && pDoneBy->GetTypeId() == TYPEID_PLAYER) + { + uiDamage = 0; + pDoneBy->CastSpell(pDoneBy,SPELL_GIVE_VALIANT_MARK_1,true); + me->setFaction(35); + EnterEvadeMode(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (uiChargeTimer <= uiDiff) + { + DoCastVictim(SPELL_CHARGE); + uiChargeTimer = 7000; + } else uiChargeTimer -= uiDiff; + + if (uiShieldBreakerTimer <= uiDiff) + { + DoCastVictim(SPELL_SHIELD_BREAKER); + uiShieldBreakerTimer = 10000; + } else uiShieldBreakerTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI *GetAI(Creature* creature) const + { + return new npc_faction_valiantAI(creature); + } + + bool OnGossipHello(Player* player, Creature* creature) + { + if((player->GetQuestStatus(QUEST_THE_GRAND_MELEE_0) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_1) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_2) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_3) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_4) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_5) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_6) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_7) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_8) == QUEST_STATUS_INCOMPLETE) || + (player->GetQuestStatus(QUEST_THE_GRAND_MELEE_9) == QUEST_STATUS_INCOMPLETE)) + { + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_MELEE_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + } + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) + { + player->PlayerTalkClass->ClearMenus(); + player->CLOSE_GOSSIP_MENU(); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + creature->setFaction(14); + creature->AI()->AttackStart(player); + } + return true; + } +}; + void AddSC_icecrown() { new npc_arete(); @@ -1709,4 +1845,5 @@ void AddSC_icecrown() new spell_tournament_defend(); new npc_tournament_dummy(); new npc_vendor_tournament_fraction_champion(); + new npc_faction_valiant(); } \ No newline at end of file