diff --git a/sql/updates/world/4.3.4/custom_2017_12_19_05_world.sql b/sql/updates/world/4.3.4/custom_2017_12_19_05_world.sql new file mode 100644 index 0000000000..f15464abfd --- /dev/null +++ b/sql/updates/world/4.3.4/custom_2017_12_19_05_world.sql @@ -0,0 +1,92 @@ +DELETE FROM `spell_area` WHERE `spell`= 59073 AND `area` IN (4756, 4755, 4757, 4714); +INSERT INTO `spell_area` (`spell`, `area`, `gender`, `quest_start`, `quest_start_status`, `autocast`, `quest_end`, `quest_end_status`) VALUES +(59073, 4756, 2, 14078, 64, 1, 14159, 1|2|8|32), +(59073, 4755, 2, 14099, 2|64, 1, 14159, 1|2|8|32), +(59073, 4757, 2, 14099, 2|64, 1, 14159, 1|2|8|32), +(59073, 4714, 2, 14099, 2|64, 1, 14159, 1|2|8|32); + +DELETE FROM `spell_area` WHERE `spell`= 49416 AND `area`= 4756; +INSERT INTO `spell_area` (`spell`, `area`, `gender`, `quest_start`, `quest_start_status`, `autocast`, `quest_end`, `quest_end_status`) VALUES +(49416, 4756, 2, 14078, 64, 1, 14099, 1|8|32); + +-- Generic NPC phasing fixups +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 371 WHERE `id` IN (39095, 34863); + +-- Generic trigger bunny (multiphase) +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 372 WHERE `id` IN (35374, 35830, 35010, 35011) AND `map`= 654 AND `areaId`= 4756; + +-- Conditions +DELETE FROM `conditions` WHERE `SourceEntry` IN (68087, 68070, 80281) AND `SourceTypeOrReferenceId`= 13; +INSERT INTO conditions (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES +(13, 1, 68087, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Just Citizen'), +(13, 1, 80281, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Summon Citizen and Worgen'), +(13, 3, 68070, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Summon Citizen and Worgen'); + +-- Royal orders pre-quest chain +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 19 AND `SourceEntry`= 14099; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `ConditionTypeOrReference`, `ConditionValue1`, `ElseGroup`) VALUES +-- Royal Orders +(19, 14099, 8, 14093, 0), +(19, 14099, 8, 14098, 0), +(19, 14099, 8, 14094, 0); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ( +'spell_q14098_knocking_67869'); + +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(67869, 'spell_q14098_knocking_67869'); + +DELETE FROM `smart_scripts` WHERE `entryorguid`= 34981; +UPDATE `creature_template` SET `AIName`= '', `ScriptName`= 'npc_frightened_citizen' WHERE `entry` IN (34981, 35836); + +-- Rampaging Worgen fixups +UPDATE `creature_template` SET `flags_extra` = `flags_extra` | 2 WHERE `entry`= 34884; + +-- Merchant Square Quest Chain +DELETE FROM `quest_template_addon` WHERE `ID` IN (14093, 14098, 14099, 14094); +INSERT INTO `quest_template_addon` (`ID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`) VALUES +(14093, 14091, 0, 0), +(14098, 14091, 0, 0), +(14094, 14091, 0, 0), +(14099, 0, 0, 0); -- Royal Orders + +-- Remove questgiver entry from rampaging worgens +DELETE FROM `creature_queststarter` WHERE `id`= 34884; + +DELETE FROM `creature_text` WHERE `CreatureID` IN (34981, 35836, 34913); +INSERT INTO `creature_text` (`CreatureID`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +-- Frightened Citizen +(34981, 0, 0, 'What in the world? Let''s get out of here!', 12, 0, 100, 1, 0, 0, 35235, 'Frightened Citizen to Player'), +(34981, 0, 1, 'Let''s go!', 12, 0, 100, 1, 0, 0, 35236, 'Frightened Citizen to Player'), +(34981, 0, 2, 'No time to waste!', 12, 0, 100, 1, 0, 0, 35237, 'Frightened Citizen to Player'), +(34981, 0, 3, 'Worgen! Worgen everywhere!', 12, 0, 100, 1, 0, 0, 35238, 'Frightened Citizen to Player'), +(34981, 0, 4, 'Flee! They''re everywhere!', 12, 0, 100, 1, 0, 0, 35240, 'Frightened Citizen to Player'), +(34981, 0, 5, 'This place isn''t safe. Let''s leave!', 12, 0, 100, 1, 0, 0, 35239, 'Frightened Citizen to Player'), +(34981, 0, 6, 'Protect me, please!', 12, 0, 100, 1, 0, 0, 35234, 'Frightened Citizen to Player'), +(35836, 0, 0, 'It''s coming right for me!!', 12, 0, 100, 1, 0, 0, 36037, 'Frightened Citizen to Player'), +(35836, 0, 1, 'Help me, please!', 12, 0, 100, 1, 0, 0, 36038, 'Frightened Citizen to Player'), +(35836, 0, 2, 'There''s one after me!', 12, 0, 100, 1, 0, 0, 36039, 'Frightened Citizen to Player'), +(35836, 0, 3, 'Help!', 12, 0, 100, 1, 0, 0, 36040, 'Frightened Citizen to Player'), +(35836, 0, 4, 'I don''t want to die!', 12, 0, 100, 1, 0, 0, 36041, 'Frightened Citizen to Player'), +-- Liam Greyman Phase 170 +(34913, 0, 0, 'Stand your ground, men!', 14, 0, 100, 0, 0, 19617, 35166, 'Prince Liam Greymane'), +(34913, 0, 1, 'Defeat these foul beasts!', 14, 0, 100, 0, 0, 19618, 35167, 'Prince Liam Greymane'), +(34913, 0, 2, 'Protect the civilians!', 14, 0, 100, 0, 0, 19619, 35168, 'Prince Liam Greymane'), +(34913, 0, 3, 'Push them back!', 14, 0, 100, 0, 0, 19620, 35169, 'Prince Liam Greymane'), +(34913, 0, 4, 'Take heart, men! We must protect our city!', 14, 0, 100, 0, 0, 19621, 35170, 'Prince Liam Greymane'); + +-- Creature Prince Liam Greymane 34913 SAI +SET @ENTRY := 34913; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 37, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On AI initialize - Self: Disable combat based movement // "), +(@ENTRY, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On aggro - Self: Talk 0 // "), +(@ENTRY, 0, 2, 0, 0, 0, 100, 0, 0, 0, 2000, 2000, 11, 50092, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 0 and 0 ms (and later repeats every 2000 and 2000 ms) - Self: Cast spell 50092 on Victim // "); + +-- Make Supply crate quest related +UPDATE `gameobject_template_addon` SET `flags`= 4 WHERE `entry`= 195306; +-- Turn Gwen into a civillian so she wont attack anymore +UPDATE `creature_template` SET `flags_extra`= 2 WHERE `entry`= 34936; +-- Add some trigger flags +UPDATE `creature_template` SET `flags_extra`= 128 WHERE `entry`= 35374; diff --git a/sql/updates/world/4.3.4/custom_2017_12_19_06_world.sql b/sql/updates/world/4.3.4/custom_2017_12_19_06_world.sql new file mode 100644 index 0000000000..71117d04da --- /dev/null +++ b/sql/updates/world/4.3.4/custom_2017_12_19_06_world.sql @@ -0,0 +1,216 @@ +-- Chains for Military District + +-- Class Quests +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14280; +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14275; +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14277; +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14278; +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14269; +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14273; +UPDATE `quest_template_addon` SET `PrevQuestID`= 14099 WHERE `ID`= 14265; + +DELETE FROM `quest_template_addon` WHERE `ID` IN (14157, 24930); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 19 AND `SourceEntry` IN (14157, 24930); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceEntry`, `ConditionTypeOrReference`, `ConditionValue1`, `ElseGroup`) VALUES +-- Old Divisions +(19, 14157, 8, 14285, 0), +(19, 14157, 8, 14286, 1), +(19, 14157, 8, 14287, 2), +(19, 14157, 8, 14288, 3), +(19, 14157, 8, 14289, 4), +(19, 14157, 8, 14290, 5), +(19, 14157, 8, 14291, 6), +-- While you're at it +(19, 24930, 8, 14285, 0), +(19, 24930, 8, 14286, 1), +(19, 24930, 8, 14287, 2), +(19, 24930, 8, 14288, 3), +(19, 24930, 8, 14289, 4), +(19, 24930, 8, 14290, 5), +(19, 24930, 8, 14291, 6); + +DELETE FROM `quest_template_addon` WHERE `ID` IN (14159, 14294, 14212); +INSERT INTO `quest_template_addon` (`ID`, `PrevQuestID`, `NextQuestID`, `ExclusiveGroup`) VALUES +(14159, 26129, 0, 0), +(14294, 14293, 0, 0), +(14212, 14294, 0, 0); + +-- Creature Lord Godfrey 35115 SAI +SET @ENTRY := 35115; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 1, 19, 0, 100, 0, 24930, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "When player accepts quest 24930 - Action invoker: Talk 0 // "), +(@ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Target_0 = Action invoker // "), +(@ENTRY, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 11, 35112, 10, 0, 0, 0, 0, 0, " Linked - Self: Send stored target 0 to Creature King Genn Greymane (35112) in 10 yd // "), +(@ENTRY, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 45, 0, 1, 0, 0, 0, 0, 11, 35112, 10, 0, 0, 0, 0, 0, " Linked - Creature King Genn Greymane (35112) in 10 yd: Set creature data #0 to 1 // "); + +-- Creature King Genn Greymane 35112 SAI +SET @ENTRY := 35112; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 38, 0, 100, 0, 0, 1, 0, 0, 67, 0, 5000, 5000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On data 0 set to 1 - Trigger timed event #0 in 5000 - 5000 ms // "), +(@ENTRY, 0, 1, 0, 59, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, "On timed event 0 triggered - storedTarget[0]: Talk 0 // "); + +DELETE FROM `creature_text` WHERE `CreatureID` IN (35112, 35115, 35378, 35550, 35905, 35907, 35906); +INSERT INTO `creature_text` (`CreatureID`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES +(35112, 0, 0, 'Enough! I''ve made up my mind. We need Crowley on our side.', 12, 0, 100, 0, 0, 0, 38602, 'King Genn Greymane to Player'), +(35115, 0, 0, 'We ought to leave Crowley in prison with those beasts!', 12, 0, 100, 0, 0, 0, 38601, 'Lord Godfrey to Player'), +(35378, 0, 0, 'This mastiff will help you find the hidden worgen.', 12, 0, 100, 0, 0, 19696, 38744, 'Lorna Crowley to Player'), +(35550, 0, 0, 'Keep them back!', 14, 0, 100, 0, 0, 19712, 36092, 'King Genn Greymane'), +(35550, 0, 1, 'Fire!', 14, 0, 100, 0, 0, 19710, 36091, 'King Genn Greymane'), +(35550, 0, 2, 'Hold the barricades! Do not give them an inch!', 14, 0, 100, 0, 0, 19709, 36090, 'King Genn Greymane'), +(35905, 0, 0, 'Rescue Krennan Aranas by using your vehicle''s ability.$B|TInterface\\Icons\\inv_misc_groupneedmore.blp:64|t', 42, 0, 100, 0, 0, 0, 36078, 'King Greymane''s Horse to Player'), +(35907, 0, 0, 'Thank you! I owe you my life.', 12, 0, 100, 0, 0, 20922, 38729, 'Krennan Aranas to King Greymane''s Horse'), +(35906, 0, 0, 'We''ve got Aranas! Fire at will!', 14, 0, 100, 0, 0, 19634, 36099, 'Lord Godfrey to Player'); + + +DELETE FROM `creature` WHERE `id` IN (35456, 35457); + +-- Creature Lord Darius Crowley 35077 SAI +SET @ENTRY := 35077; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 19, 0, 100, 0, 14154, 0, 0, 0, 11, 66914, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "When player accepts quest 14154 - Self: Cast spell 66914 on Action invoker // "); + +DELETE FROM `spell_area` WHERE `spell` IN (72870, 49416, 72872, 76642) AND `area` IN (4755, 4757, 4758, 4759, 4761); +INSERT INTO `spell_area` (`spell`, `area`, `gender`, `quest_start`, `quest_start_status`, `autocast`, `quest_end`, `quest_end_status`) VALUES +(72870, 4757, 2, 14159, 64, 1, 14293, 1|2|8|32), +(72870, 4758, 2, 14159, 64, 1, 14293, 1|2|8|32), +(49416, 4757, 2, 14159, 64, 1, 14221, 1|2|8|32), +(72872, 4757, 2, 14293, 64, 1, 14221, 1|2|8|32), +(72872, 4758, 2, 14293, 64, 1, 14221, 1|2|8|32), +(72872, 4759, 2, 14293, 64, 1, 14221, 1|2|8|32), +(72872, 4761, 2, 14293, 64, 1, 14221, 1|2|8|32), +(72872, 4755, 2, 14293, 64, 1, 14221, 1|2|8|32), +-- Last Stand +(76642, 4757, 2, 14221, 64, 1, 14222, 1|2|8|32), +(76642, 4758, 2, 14221, 64, 1, 14222, 1|2|8|32), +(76642, 4759, 2, 14221, 64, 1, 14222, 1|2|8|32), +(76642, 4761, 2, 14221, 64, 1, 14222, 1|2|8|32); + +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 367 WHERE `id` IN (35906); +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 460 WHERE `id` IN (35229, 35317, 35566); +UPDATE `creature` SET `phaseId`= 172, `phaseGroup`= 0 WHERE `id` IN (35618, 36057); + +-- Creature Wounded Guard 47091 SAI +SET @ENTRY := 47091; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 8, 0, 100, 0, 774, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 774 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "), +(@ENTRY, 0, 1, 0, 8, 0, 100, 0, 2061, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 2061 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "), +(@ENTRY, 0, 2, 0, 1, 0, 100, 0, 1, 1, 30000, 30000, 11, 46577, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "When out of combat and timer at the begining between 1 and 1 ms (and later repeats every 30000 and 30000 ms) - Self: Cast spell 46577 on Self // "); + +-- Creature Bloodfang Worgen 35118 SAI +SET @ENTRY := 35118; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 1, 2, 0, 100, 1, 0, 30, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "When health between 0% and 30% (check every 0 - 0 ms) - Self: Cast spell 8599 on Self // Bloodfang Worgen - Between 0-30% Health - Cast 'Enrage' (No Repeat)"), +(@ENTRY, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Talk 0 // Bloodfang Worgen - Between 0-30% Health - Say Line 0 (No Repeat)"), +(@ENTRY, 0, 2, 0, 8, 0, 100, 0, 100, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 100 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "), +(@ENTRY, 0, 3, 0, 8, 0, 100, 0, 56641, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 56641 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "), +(@ENTRY, 0, 4, 0, 8, 0, 100, 0, 2098, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 2098 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "), +(@ENTRY, 0, 5, 0, 8, 0, 100, 0, 348, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 348 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "), +(@ENTRY, 0, 6, 0, 8, 0, 100, 0, 5143, 0, 0, 0, 33, 44175, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On spell 5143 hit - Action invoker: Give kill credit Spell Practice Credit (44175) // "); + +-- Creature Myriam Spellwaker 35872 SAI +SET @ENTRY := 35872; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 37, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On AI initialize - Self: Disable combat based movement // "), +(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 0, 0, 3000, 3000, 11, 11538, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "When in combat and timer at the begining between 0 and 0 ms (and later repeats every 3000 and 3000 ms) - Self: Cast spell 11538 on Victim // "); + +-- Creature Sergeant Cleese 35839 SAI +SET @ENTRY := 35839; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 37, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On AI initialize - Self: Disable combat based movement // "); + +-- Creature Lorna Crowley 35378 SAI +SET @ENTRY := 35378; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 19, 0, 100, 0, 14204, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "When player accepts quest 14204 - Action invoker: Talk 0 // "); + +DELETE FROM `conditions` WHERE `SourceEntry` IN (67805, 68228, 68235) AND `SourceTypeOrReferenceId`= 13; +INSERT INTO conditions (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES +(13, 1, 67805, 0, 0, 31, 0, 3, 35463, 0, 0, 0, '', 'Attack Lurker - Target Bloodfang Lurker'), +(13, 1, 68228, 0, 0, 31, 0, 3, 35753, 0, 0, 0, '', 'Rescue Krennan - Target Krennan'), +(13, 1, 68235, 0, 0, 31, 0, 3, 35374, 0, 0, 0, '', 'Cannon Fire - Target Generic Trigger'); + +-- Creature Bloodfang Lurker 35463 SAI +SET @ENTRY := 35463; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 1, 2, 0, 100, 1, 0, 30, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "When health between 0% and 30% (check every 0 - 0 ms) - Self: Cast spell 8599 on Self // Bloodfang Lurker - Between 0-30% Health - Cast 'Enrage' (No Repeat)"), +(@ENTRY, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Talk 0 // Bloodfang Lurker - Between 0-30% Health - Say Line 0 (No Repeat)"), +(@ENTRY, 0, 2, 3, 11, 0, 100, 1, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On respawn - Self: Set react state to REACT_PASSIVE // "), +(@ENTRY, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 5916, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Cast spell 5916 on Self // Bloodfang Lurker - On Respawn - Cast 'Shadowstalker Stealth' (No Repeat)"), +(@ENTRY, 0, 4, 5, 7, 0, 100, 1, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On evade - Self: Set react state to REACT_PASSIVE // "), +(@ENTRY, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 5916, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Cast spell 5916 on Self // Bloodfang Lurker - On Evade - Cast 'Shadowstalker Stealth' (No Repeat)"), +(@ENTRY, 0, 6, 0, 4, 0, 100, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On aggro - Self: Set react state to REACT_AGGRESSIVE // "); + +-- Creature King Genn Greymane 35550 SAI +SET @ENTRY := 35550; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 60, 0, 100, 0, 19000, 20000, 70000, 70000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Every 70000 and 70000 ms (for the first time, timer between 19000 and 20000 ms) - Self: Talk 0 // "), +(@ENTRY, 0, 1, 0, 19, 0, 100, 0, 14293, 0, 0, 0, 11, 68232, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "When player accepts quest 14293 - Self: Cast spell 68232 on Action invoker // "); + +-- Creature Krennan Aranas 35907 SAI +SET @ENTRY := 35907; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 0, 37, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On AI initialize - Self: Set react state to REACT_PASSIVE // "), +(@ENTRY, 0, 1, 0, 54, 0, 100, 1, 0, 0, 0, 0, 11, 46598, 2, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, "On just summoned - Self: Cast spell 46598 on Invoker's vehicle // "); + +-- Creature Lord Godfrey 35906 SAI +SET @ENTRY := 35906; +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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 +(@ENTRY, 0, 0, 1, 20, 0, 100, 0, 14293, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "When player rewards quest 14293 - Action invoker: Talk 0 // "), +(@ENTRY, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, 3591400, 0, 0, 0, 0, 0, 10, 376902, 0, 0, 0, 0, 0, 0, " Linked - Start timed action list id #0 // "); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= 35914; +DELETE FROM `smart_scripts` WHERE `entryorguid`=35914 AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=3591400 AND `source_type`=9; +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 +(3591400,9,0,0,0,0,100,0,3000,3000,0,0,11,68235,0,0,0,0,0,1,0,0,0,0,0,0,0,"Commandeered Cannon - On Script - cast spell"), -- 3secs delay +(3591400,9,1,0,0,0,100,0,2000,2000,0,0,11,68235,0,0,0,0,0,1,0,0,0,0,0,0,0,"Commandeered Cannon - On Script - cast spell"), -- 2secs delay +(3591400,9,2,0,0,0,100,0,2000,2000,0,0,11,68235,0,0,0,0,0,1,0,0,0,0,0,0,0,"Commandeered Cannon - On Script - cast spell"); -- 2secs delay + +UPDATE `creature_template` SET `vehicleID`= 494, `speed_run`= 1.2857, `ScriptName`= 'npc_greymanes_horse' WHERE `entry`= 35905; +UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry`= 35753; +UPDATE `creature_addon` SET `emote`= 472 WHERE `guid`= 376850; +UPDATE `creature_template` SET `vehicleID`= 1418 WHERE `entry`= 50420; + +UPDATE `creature_addon` SET `emote`= 431 WHERE `guid`= 376588; +UPDATE `gameobject` SET `phaseGroup`= 0, `phaseID`= 171 WHERE `guid`= 235509; +UPDATE `gameobject` SET `phaseGroup`= 507, `phaseID`= 0 WHERE `guid`= 235509; + +UPDATE `creature_template` SET `flags_extra`= 128 WHERE `entry`= 35374; +-- Turn multiple npc's into civillians to avoid aggro +UPDATE `creature_template` SET `flags_extra`= 2 WHERE `entry` IN (35112, 35115, 47091, 35912, 35873, 32768, 35869, 35874, 38832, 35550, 35618, 51947, 35906, 35753, 44469, 44461, 44463, 44465, 35554, 44455, 35552, 35911, 44470, 44468, 44459, 35551); + +-- Spawn Krennan Gameobject Focus +DELETE FROM `gameobject` WHERE `guid`= 235581; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseID`, `position_x`, `position_y`, `position_z`, `orientation`) VALUES +(235581, 195660, 654, 1, 171, -1672.96, 1344.75, 15.1352, 1.36203); + +-- Fix flags for not selectable gameobjects +UPDATE `gameobject_template_addon` SET `flags`= `flags`|16 WHERE `entry` IN (195466, 195465, 195430, 195454, 195453); +-- Put barricades in correct phase +UPDATE `gameobject` SET `phaseId`= 0, `phaseGroup`= 507 WHERE `guid` IN (235561, 235562, 235560, 235559); +-- Corrected trigger phase id's +UPDATE `creature` SET `phaseId`= 0, `phaseGroup`= 372 WHERE `id`= 35374 AND `map`= 654; diff --git a/src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp b/src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp new file mode 100644 index 0000000000..67f93f234e --- /dev/null +++ b/src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp @@ -0,0 +1,290 @@ +/* +* Copyright (C) 2008-2017 TrinityCore +* +* 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, see . +*/ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "ScriptedGossip.h" +#include "Vehicle.h" +#include "ObjectMgr.h" +#include "ScriptedEscortAI.h" +#include "CombatAI.h" +#include "PassiveAI.h" +#include "Player.h" +#include "SpellInfo.h" +#include "CreatureTextMgr.h" +#include "MoveSplineInit.h" +#include "GameObjectAI.h" + +/*###### +##Quest 14098 - Evacuate the Merchant Place +######*/ + +enum FrightenedCitizen +{ + SAY_FRIGHTENED_CITIZEN_RESCUE = 0, + + NPC_EVACUATION_STALKER_FIRST = 35830, + NPC_EVACUATION_STALKER_NEAR = 35010, + NPC_EVACUATION_STALKER_FAR = 35011, + NPC_RAMPAGING_WORGEN = 35660, + + CREDIT_35830 = 35830, + + POINT_STALKER_FIRST = 1, + POINT_STALKER_NEAR = 2, + POINT_STALKER_FAR = 3, + + EVENT_TALK_FRIGHTENED = 1, + EVENT_MOVE_TO_NEAR_STALKER = 2, + EVENT_MOVE_TO_FAR_STALKER = 3, + EVENT_DESPAWN = 4 +}; + +class npc_frightened_citizen : public CreatureScript +{ + public: + npc_frightened_citizen() : CreatureScript("npc_frightened_citizen") { } + + struct npc_frightened_citizenAI : public PassiveAI + { + npc_frightened_citizenAI(Creature* creature) : PassiveAI(creature) { } + + void IsSummonedBy(Unit* /*summoner*/) override + { + if (Creature* stalkerNear = me->FindNearestCreature(NPC_EVACUATION_STALKER_FIRST, 20.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_FIRST, stalkerNear->GetPosition(), true); + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE) + return; + + switch (id) + { + case POINT_STALKER_FIRST: + _events.ScheduleEvent(EVENT_TALK_FRIGHTENED, Seconds(1)); + break; + case POINT_STALKER_NEAR: + _events.ScheduleEvent(EVENT_MOVE_TO_FAR_STALKER, Milliseconds(1)); + break; + case POINT_STALKER_FAR: + _events.ScheduleEvent(EVENT_DESPAWN, Milliseconds(1)); + break; + default: + break; + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TALK_FRIGHTENED: + if (Unit* summoner = me->ToTempSummon()->GetSummoner()) + { + if (Player* player = summoner->ToPlayer()) + { + player->KilledMonsterCredit(CREDIT_35830); + Talk(SAY_FRIGHTENED_CITIZEN_RESCUE, summoner); + } + } + _events.ScheduleEvent(EVENT_MOVE_TO_NEAR_STALKER, Seconds(2)); + break; + case EVENT_MOVE_TO_NEAR_STALKER: + if (Creature* stalker = me->FindNearestCreature(NPC_EVACUATION_STALKER_FAR, 50.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_FAR, stalker->GetPosition(), true); + else if (Creature* stalker = me->FindNearestCreature(NPC_EVACUATION_STALKER_NEAR, 100.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_NEAR, stalker->GetPosition(), true); + break; + case EVENT_MOVE_TO_FAR_STALKER: + if (Creature* stalker = me->FindNearestCreature(NPC_EVACUATION_STALKER_FAR, 500.0f)) + me->GetMotionMaster()->MovePoint(POINT_STALKER_FAR, stalker->GetPosition(), true); + break; + case EVENT_DESPAWN: + me->DespawnOrUnsummon(); + break; + default: + break; + } + } + } + private: + EventMap _events; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_frightened_citizenAI(creature); + } +}; + +/*###### +##Quest 14293 - Save Krennan Aranas +######*/ + +uint32 const pathSize1 = 7; +G3D::Vector3 const greymanesHorsePath1[pathSize1] = +{ + { -1797.425f, 1396.941f, 20.07336f }, + { -1788.675f, 1378.441f, 20.07336f }, + { -1780.925f, 1368.941f, 20.07336f }, + { -1767.425f, 1358.191f, 19.82336f }, + { -1746.425f, 1358.691f, 20.07336f }, + { -1726.175f, 1354.191f, 19.82336f }, + { -1709.064f, 1348.535f, 19.78232f } +}; + +uint32 const pathSize2 = 13; +G3D::Vector3 const greymanesHorsePath2[] = +{ + { -1664.807f, 1345.011f, 15.48499f }, + { -1662.807f, 1354.511f, 15.48499f }, + { -1667.307f, 1362.511f, 15.48499f }, + { -1674.307f, 1363.761f, 15.48499f }, + { -1686.057f, 1355.011f, 15.48499f }, + { -1691.057f, 1347.261f, 15.48499f }, + { -1705.807f, 1350.011f, 19.98499f }, + { -1731.307f, 1360.011f, 19.98499f }, + { -1744.807f, 1370.511f, 20.23499f }, + { -1758.807f, 1389.511f, 19.98499f }, + { -1768.307f, 1410.011f, 19.98499f }, + { -1771.557f, 1423.011f, 19.98499f }, + { -1770.955f, 1430.332f, 19.83506f } +}; + +Position const greymanesHorseJumpPos = { -1676.16f, 1346.19f, 15.1349f }; + +enum GreymanesHorse +{ + SAY_ANNOUNCE_RESCUE = 0, + SAY_RESCUED = 0, + + PATH_KRENNAN_TREE = 0, + PATH_KRENNAN_BACK = 1, + + EVENT_START_PATH_1 = 1, + EVENT_START_PATH_2, + EVENT_JUMP_TO_KRENNAN, + EVENT_ANNOUNCE_RESCUE, + EVENT_DISMOUNT_PLAYER, + + NPC_RESCUED_KRENNAN = 35907 +}; + +class npc_greymanes_horse : public CreatureScript +{ + public: + npc_greymanes_horse() : CreatureScript("npc_greymanes_horse") { } + + struct npc_greymanes_horseAI : public VehicleAI + { + npc_greymanes_horseAI(Creature* creature) : VehicleAI(creature) + { + Initialize(); + } + + void Initialize() + { + _currentPath = PATH_KRENNAN_TREE; + } + + void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) override + { + if (apply && passenger->GetTypeId() == TYPEID_PLAYER) + { + passenger->ToPlayer()->SetMover(me); + _events.ScheduleEvent(EVENT_START_PATH_1, Seconds(1)); + } + else if (apply && passenger->GetEntry() == NPC_RESCUED_KRENNAN) + _events.ScheduleEvent(EVENT_START_PATH_2, Seconds(1)); + } + + void MovementInform(uint32 type, uint32 pointId) override + { + if (type == EFFECT_MOTION_TYPE && pointId == pathSize1 && _currentPath == PATH_KRENNAN_TREE) + _events.ScheduleEvent(EVENT_JUMP_TO_KRENNAN, Milliseconds(1)); + else if (type == EFFECT_MOTION_TYPE && pointId == pathSize2 && _currentPath == PATH_KRENNAN_BACK) + _events.ScheduleEvent(EVENT_DISMOUNT_PLAYER, Milliseconds(1)); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_START_PATH_1: + _currentPath = PATH_KRENNAN_TREE; + me->GetMotionMaster()->MoveSmoothPath(pathSize1, greymanesHorsePath1, pathSize1); + break; + case EVENT_JUMP_TO_KRENNAN: + me->GetMotionMaster()->MoveJump(greymanesHorseJumpPos, 16.0f, 14.00968f); + _events.ScheduleEvent(EVENT_ANNOUNCE_RESCUE, Seconds(2)); + break; + case EVENT_ANNOUNCE_RESCUE: + if (Unit* passenger = me->GetVehicleKit()->GetPassenger(0)) + Talk(SAY_ANNOUNCE_RESCUE, passenger); + break; + case EVENT_START_PATH_2: + _currentPath = PATH_KRENNAN_BACK; + me->GetMotionMaster()->MoveSmoothPath(pathSize2, greymanesHorsePath2, pathSize2); + break; + case EVENT_DISMOUNT_PLAYER: + if (Unit* passenger = me->GetVehicleKit()->GetPassenger(1)) + if (Unit* player = me->GetVehicleKit()->GetPassenger(0)) + if (Creature* krennan = passenger->ToCreature()) + { + me->ClearInCombat(); + player->ClearInCombat(); + krennan->ClearInCombat(); + player->ExitVehicle(); + krennan->ExitVehicle(); + krennan->AI()->Talk(SAY_RESCUED, me); + krennan->DespawnOrUnsummon(Seconds(7)); + } + break; + default: + break; + } + } + } + private: + EventMap _events; + uint32 _currentPath; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_greymanes_horseAI(creature); + } +}; + +void AddSC_gilneas_c1() +{ + new npc_frightened_citizen(); + new npc_greymanes_horse(); +} diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp index fc60f4e8a4..473add294e 100644 --- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp +++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp @@ -70,6 +70,7 @@ void AddSC_instance_blackwing_lair(); void AddSC_deadmines(); //Deadmines void AddSC_instance_deadmines(); void AddSC_boss_mr_smite(); +void AddSC_gilneas_c1(); //Gilneas void AddSC_gnomeregan(); //Gnomeregan void AddSC_instance_gnomeregan(); void AddSC_boss_attumen(); //Karazhan @@ -265,6 +266,7 @@ void AddEasternKingdomsScripts() AddSC_deadmines(); //Deadmines AddSC_boss_mr_smite(); AddSC_instance_deadmines(); + AddSC_gilneas_c1(); //Gilneas AddSC_gnomeregan(); //Gnomeregan AddSC_instance_gnomeregan(); AddSC_boss_attumen(); //Karazhan diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 3cef4f9182..dfddb39a29 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2752,6 +2752,42 @@ public: } }; +class spell_q14098_knocking_67869 : public SpellScriptLoader +{ +public: + spell_q14098_knocking_67869() : SpellScriptLoader("spell_q14098_knocking_67869") { } + + class spell_q14098_knocking_67869_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q14098_knocking_67869_SpellScript); + + bool Validate(SpellInfo const* spellInfo) override + { + return ValidateSpellInfo( + { + uint32(spellInfo->Effects[EFFECT_1].BasePoints), + uint32(spellInfo->Effects[EFFECT_2].BasePoints) + }); + } + + void HandleEffect() + { + if (SpellInfo const* spellInfo = GetSpellInfo()) + GetCaster()->CastSpell(GetCaster(), spellInfo->Effects[RAND(0, 1) == 0 ? EFFECT_1 : EFFECT_2].BasePoints, true); + } + + void Register() override + { + OnCast += SpellCastFn(spell_q14098_knocking_67869_SpellScript::HandleEffect); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q14098_knocking_67869_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2820,4 +2856,5 @@ void AddSC_quest_spell_scripts() new spell_q11306_mixing_vrykul_blood(); new spell_q11306_failed_mix_43376(); new spell_q11306_failed_mix_43378(); + new spell_q14098_knocking_67869(); }