diff options
author | offl <11556157+offl@users.noreply.github.com> | 2021-05-27 19:05:47 +0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-03-10 22:36:09 +0100 |
commit | 09551b663a8190ef2ce9af6ad3e7cb5058e82b2e (patch) | |
tree | 57b69fe4ce06afce7ae759b7aabc6ee1a90222ce | |
parent | 86e77891602797be24c30fe7dfad7ed484a4fcf0 (diff) |
Scripts/Quest: Rework cocooned creatures (#26554)
(cherry picked from commit 78bd609e8a37caa354c42ee6da798ab6c0bb3009)
5 files changed, 446 insertions, 101 deletions
diff --git a/sql/updates/world/master/2022_03_10_20_world_2021_05_27_00_world.sql b/sql/updates/world/master/2022_03_10_20_world_2021_05_27_00_world.sql new file mode 100644 index 00000000000..9fbbc36609e --- /dev/null +++ b/sql/updates/world/master/2022_03_10_20_world_2021_05_27_00_world.sql @@ -0,0 +1,194 @@ +-- Quest creature will be not summoned if cocoon is killed by a pet, it's close to correct behavior. I mean, in retail they summons nothing +-- if killed by pets. Perhaps our conditions work differently or we need to add another condition to check if killer is player. It's also possible that +-- final check is done in spell script +-- Chance to summon hostile unit may be just 75 and not 66, it's just not easy to find a balance between chance and respawn time to +-- reflect what I see in movies. In case of Rivenwood chance 80 looks fine +-- Quest creatures currently can be attacked by other creatures, they don't have immune flag. It may look like a bug but it's probably not + +-- They're Alive! Maybe... +DELETE FROM `spell_script_names` WHERE `spell_id` = 30950 AND `ScriptName` = "spell_free_webbed"; +DELETE FROM `spell_script_names` WHERE `spell_id` = 31009 AND `ScriptName` = "spell_free_webbed_on_quest"; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(30950,"spell_free_webbed"), +(31009,"spell_free_webbed_on_quest"); + +-- Looks like 1 min +UPDATE `creature` SET `spawntimesecs` = 60 WHERE `id` = 17680; + +UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = 17680; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 17680 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(17680,0,0,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Webbed Creature - On AI Initialize - Set Reactstate Passive"), +(17680,0,1,0,6,0,100,0,0,0,0,0,0,11,30950,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Webbed Creature - On Death - Cast 'Free Webbed Creature'"), +(17680,0,2,0,6,0,100,0,0,0,0,0,0,11,31009,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Webbed Creature - On Death - Cast 'Free Webbed Creature'"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 17680 AND `SourceId` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,2,17680,0,0,9,0,9670,0,0,1,0,0,"","Group 0: Execute SAI (Action 1) if quest 'They're Alive! Maybe...' is not taken by invoker"), +(22,3,17680,0,0,9,0,9670,0,0,0,0,0,"","Group 0: Execute SAI (Action 2) if quest 'They're Alive! Maybe...' is taken by invoker"); + +UPDATE `creature_template` SET `unit_flags` = 33024 WHERE `entry` = 17681; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 17681 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 1768100 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(17681,0,0,0,54,0,100,0,0,0,0,0,0,80,1768100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Expedition Researcher - On Just Summoned - Run Script"), +(17681,0,1,0,34,0,100,0,8,1,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Expedition Researcher - On Reached Point 1 - Despawn Instant"), + +(1768100,9,0,0,0,0,100,0,1000,1000,0,0,0,33,17681,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Expedition Researcher - On Script - Quest Credit 'They're Alive! Maybe...'"), +(1768100,9,1,0,0,0,100,0,0,0,0,0,0,66,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Expedition Researcher - On Script - Set Orientation Owner"), +(1768100,9,2,0,0,0,100,0,1000,1000,0,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Expedition Researcher - On Script - Say Line 0"), +-- Completely guessed +(1768100,9,3,0,0,0,100,0,0,0,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,-1596.5,-10847.2,57.352,0,"Expedition Researcher - On Script - Move To Position"); + +DELETE FROM `creature_text` WHERE `CreatureID` = 17681; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(17681,0,0,"We're free! We're free!",12,7,100,0,0,0,14346,0,"Expedition Researcher"), +(17681,0,1,"Woot! Thanks!",12,7,100,0,0,0,14347,0,"Expedition Researcher"), +(17681,0,2,"By the forehead signet of Velen, I am saved!",12,7,100,0,0,0,14348,0,"Expedition Researcher"), +(17681,0,3,"I knew Cornelius wouldn't leave us behind!",12,7,100,0,0,0,14349,0,"Expedition Researcher"); + + +-- Taken in the Night, sniffed +DELETE FROM `spell_script_names` WHERE `spell_id` = 38949 AND `ScriptName` = "spell_free_webbed_terokkar"; +DELETE FROM `spell_script_names` WHERE `spell_id` = 38950 AND `ScriptName` = "spell_free_webbed_terokkar_on_quest"; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(38949,"spell_free_webbed_terokkar"), +(38950,"spell_free_webbed_terokkar_on_quest"); + +-- Looks like 1 min or even less, looks like unlike the other they're pooled so it's hard to be sure +UPDATE `creature` SET `spawntimesecs` = 60 WHERE `id` = 22355; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 22355 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 2235500 AND 2235505 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(22355,0,0,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Netherweb Victim - On AI Initialize - Set Reactstate Passive"), +(22355,0,1,0,6,0,100,0,0,0,0,0,0,11,38949,2,0,0,0,0,1,0,0,0,0,0,0,0,0,"Netherweb Victim - On Death - Cast 'Terrokar Free Webbed Creature'"), +(22355,0,2,0,6,0,100,0,0,0,0,0,0,11,38950,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Netherweb Victim - On Death - Cast 'Terokkar Free Webbed Creature ON QUEST'"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 22355 AND `SourceId` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,2,22355,0,0,9,0,10873,0,0,1,0,0,"","Group 0: Execute SAI (Action 1) if quest 'Taken in the Night' is not taken by invoker"), +(22,3,22355,0,0,9,0,10873,0,0,0,0,0,"","Group 0: Execute SAI (Action 2) if quest 'Taken in the Night' is taken by invoker"); + +UPDATE `creature_template` SET `unit_flags` = 33024 WHERE `entry` = 22459; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 22459 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 2245900 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(22459,0,0,0,54,0,100,0,0,0,0,0,0,80,2245900,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Freed Sha'tar Warrior - On Just Summoned - Run Script"), +(22459,0,1,0,34,0,100,0,8,1,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Freed Sha'tar Warrior - On Reached Point 1 - Despawn Instant"), + +(2245900,9,0,0,0,0,100,0,0,0,0,0,0,33,22459,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Sha'tar Warrior - On Script - Quest Credit 'Taken in the Night'"), +(2245900,9,1,0,0,0,100,0,1000,1000,0,0,0,66,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Sha'tar Warrior - On Script - Set Orientation Owner"), +(2245900,9,2,0,0,0,100,0,1000,1000,0,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Sha'tar Warrior - On Script - Say Line 0"), +(2245900,9,3,0,0,0,100,0,1000,1000,0,0,0,69,1,0,0,0,0,0,8,0,0,0,0,-3801.06,4318.73,5.0761,0,"Freed Sha'tar Warrior - On Script - Move To Position"); + +UPDATE `creature_text` SET `GroupID` = 0, `Language` = 0, `Emote` = 0 WHERE `CreatureID` = 22459; + + +-- Cocooned!, sniffed +DELETE FROM `spell_script_names` WHERE `spell_id` = 51596 AND `ScriptName` = "spell_cocooned_not_on_quest"; +DELETE FROM `spell_script_names` WHERE `spell_id` = 51598 AND `ScriptName` = "spell_cocooned_on_quest"; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(51596,"spell_cocooned_not_on_quest"), +(51598,"spell_cocooned_on_quest"); + +-- Looks like 1 min +UPDATE `creature` SET `spawntimesecs` = 60 WHERE `id` = 28413; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 28413 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 2841300 AND 2841302 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(28413,0,0,0,37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nerubian Cocoon - On AI Initialize - Set Corpse Delay"), +(28413,0,1,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Nerubian Cocoon - On AI Initialize - Set Reactstate Passive"), +(28413,0,2,0,6,0,100,0,0,0,0,0,0,11,51596,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Nerubian Cocoon - On Death - Cast 'Cocooned: Player Not On Quest'"), +(28413,0,3,0,6,0,100,0,0,0,0,0,0,11,51598,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Nerubian Cocoon - On Death - Cast 'Cocooned: Player On Quest'"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 28413 AND `SourceId` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,3,28413,0,0,9,0,12606,0,0,1,0,0,"","Group 0: Execute SAI (Action 2) if quest 'Cocooned!' is not taken by invoker"), +(22,4,28413,0,0,9,0,12606,0,0,0,0,0,"","Group 0: Execute SAI (Action 3) if quest 'Cocooned!' is taken by invoker"); + +UPDATE `creature_template` SET `unit_flags` = 32768 WHERE `entry` = 28415; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 28415 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN 2841500 AND 2841501 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(28415,0,0,0,54,0,100,0,0,0,0,0,0,88,2841500,2841501,0,0,0,0,1,0,0,0,0,0,0,0,0,"Captive Footman - On Just Summoned - Run Random Script"), + +(2841500,9,0,0,0,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Say Line 0"), +(2841500,9,1,0,0,0,100,0,0,0,0,0,0,33,28415,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Quest Credit 'Cocooned!'"), +(2841500,9,2,0,0,0,100,0,0,0,0,0,0,11,7,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Cast 'Suicide'"), +(2841500,9,3,0,0,0,100,0,0,0,0,0,0,41,20000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Delayed Despawn"), + +(2841501,9,0,0,0,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Say Line 1"), +(2841501,9,1,0,0,0,100,0,0,0,0,0,0,33,28415,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Quest Credit 'Cocooned!'"), +(2841501,9,2,0,0,0,100,0,2000,2000,0,0,0,17,333,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Set Emote State 333"), +(2841501,9,3,0,0,0,100,0,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Captive Footman - On Script - Delayed Despawn"); + +DELETE FROM `creature_text` WHERE `CreatureID` = 28415; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(28415,0,0,"ugh...",12,0,100,0,0,0,27890,0,"Captive Footman"), +(28415,0,1,"Avenge me!",12,0,100,0,0,0,27891,0,"Captive Footman"), +(28415,0,2,"I am... finished.",12,0,100,0,0,0,27892,0,"Captive Footman"), +(28415,0,3,"It's too late for me.",12,0,100,0,0,0,27894,0,"Captive Footman"), +(28415,1,0,"I'm saved!",12,0,100,71,0,0,27896,0,"Captive Footman"), +(28415,1,1,"I thought I was done for!",12,0,100,71,0,0,27897,0,"Captive Footman"), +(28415,1,2,"Thank you!",12,0,100,71,0,0,27898,0,"Captive Footman"), +(28415,1,3,"I am in your debt, friend.",12,0,100,71,0,0,27899,0,"Captive Footman"); + +UPDATE `smart_scripts` SET `target_type` = 7, `target_param1` = 0, `comment` = "Drakkari Captive - On Just Summoned - Start Attack Invoker" WHERE `entryorguid` = 28414 AND `source_type` = 0 AND `id` = 0; + + +-- Rivenwood Captives, in general same as above +DELETE FROM `spell_script_names` WHERE `spell_id` = 43288 AND `ScriptName` = "spell_rivenwood_captives_not_on_quest"; +DELETE FROM `spell_script_names` WHERE `spell_id` = 43287 AND `ScriptName` = "spell_rivenwood_captives_on_quest"; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(43288,"spell_rivenwood_captives_not_on_quest"), +(43287,"spell_rivenwood_captives_on_quest"); + +-- They're probably pooled, no clue what is original respawn time but something like 2 minutes or 1 minute, +-- hard to say, let's make it 2 just to make quest less annoying +UPDATE `creature` SET `spawntimesecs` = 120 WHERE `id` = 24210; + +UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = 24210; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 24210 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(24210,0,0,0,37,0,100,0,0,0,0,0,0,116,5,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Riven Widow Cocoon - On AI Initialize - Set Corpse Delay"), +(24210,0,1,0,37,0,100,0,0,0,0,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Riven Widow Cocoon - On AI Initialize - Set Reactstate Passive"), +(24210,0,2,0,6,0,100,0,0,0,0,0,0,11,43288,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Riven Widow Cocoon - On Death - Cast 'Rivenwood Captives: Player Not On Quest'"), +(24210,0,3,0,6,0,100,0,0,0,0,0,0,11,43287,2,0,0,0,0,7,0,0,0,0,0,0,0,0,"Riven Widow Cocoon - On Death - Cast 'Rivenwood Captives: Player On Quest'"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 22 AND `SourceEntry` = 24210 AND `SourceId` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,3,24210,0,0,9,0,11296,0,0,1,0,0,"","Group 0: Execute SAI (Action 2) if quest 'Rivenwood Captives' is not taken by invoker"), +(22,4,24210,0,0,9,0,11296,0,0,0,0,0,"","Group 0: Execute SAI (Action 3) if quest 'Rivenwood Captives' is taken by invoker"); + +-- These are immune +UPDATE `creature_template` SET `unit_flags` = 33536 WHERE `entry` = 24211; + +DELETE FROM `smart_scripts` WHERE `entryorguid` = 24211 AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 2421100 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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(24211,0,0,0,54,0,100,0,0,0,0,0,0,80,2421100,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Just Summoned - Run Script"), + +(2421100,9,0,0,0,0,100,0,1000,1000,0,0,0,33,24211,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Script - Quest Credit 'Rivenwood Captives'"), +(2421100,9,1,0,0,0,100,0,1000,1000,0,0,0,66,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Script - Set Orientation Owner"), +(2421100,9,2,0,0,0,100,0,1000,1000,0,0,0,29,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Script - Start Follow Owner"), +-- Our usual hack +(2421100,9,3,0,0,0,100,0,6000,6000,0,0,0,69,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Script - Stop Follow Owner"), +(2421100,9,4,0,0,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,23,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Script - Say Line 0"), +(2421100,9,5,0,0,0,100,0,0,0,0,0,0,41,6000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Freed Winterhoof Longrunner - On Script - Delayed Despawn"); + +-- Reorder +DELETE FROM `creature_text` WHERE `CreatureID` = 24211; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(24211,0,0,"Thank you, stranger.",12,1,100,1,0,0,22945,0,"Freed Winterhoof Longrunner"), +(24211,0,1,"I must return. Good hunting to you.",12,1,100,1,0,0,22946,0,"Freed Winterhoof Longrunner"), +(24211,0,2,"Blessings of the spirits of the land and air upon you.",12,1,100,1,0,0,22947,0,"Freed Winterhoof Longrunner"), +(24211,0,3,"You saved me from certain death. I owe you.",12,1,100,1,0,0,22948,0,"Freed Winterhoof Longrunner"), +(24211,0,4,"We should never have traveled through the Rivenwood. Everyone knows this!",12,1,100,1,0,0,22949,0,"Freed Winterhoof Longrunner"), +(24211,0,5,"Strange ghosts walk the land. Be careful!",12,1,100,1,0,0,22950,0,"Freed Winterhoof Longrunner"), +(24211,0,6,"They took us one by one. I'm sure there are other survivors.",12,1,100,1,0,0,22951,0,"Freed Winterhoof Longrunner"), +(24211,0,7,"I owe you a life debt, stranger.",12,1,100,1,0,0,22952,0,"Freed Winterhoof Longrunner"); diff --git a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp index 5482bd47c62..0b8f48a26e0 100644 --- a/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_bloodmyst_isle.cpp @@ -15,85 +15,15 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Bloodmyst_Isle -SD%Complete: 80 -SDComment: Quest support: 9670 -SDCategory: Bloodmyst Isle -EndScriptData */ - -/* ContentData -npc_webbed_creature -EndContentData */ - #include "ScriptMgr.h" #include "CellImpl.h" #include "GridNotifiersImpl.h" #include "Group.h" #include "MotionMaster.h" #include "ObjectAccessor.h" -#include "PassiveAI.h" #include "Player.h" #include "ScriptedEscortAI.h" - -/*###### -## npc_webbed_creature -######*/ - -//possible creatures to be spawned -uint32 const possibleSpawns[31] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; - -enum WebbedCreature -{ - NPC_EXPEDITION_RESEARCHER = 17681 -}; - -class npc_webbed_creature : public CreatureScript -{ -public: - npc_webbed_creature() : CreatureScript("npc_webbed_creature") { } - - struct npc_webbed_creatureAI : public NullCreatureAI - { - npc_webbed_creatureAI(Creature* creature) : NullCreatureAI(creature) { } - - void Reset() override { } - - void JustEngagedWith(Unit* /*who*/) override { } - - void AttackStart(Unit* /*who*/) override { } - - void MoveInLineOfSight(Unit* /*who*/) override { } - - void JustDied(Unit* killer) override - { - if (!killer) - return; - - uint32 spawnCreatureID = 0; - - switch (urand(0, 2)) - { - case 0: - if (Player* player = killer->ToPlayer()) - player->KilledMonsterCredit(NPC_EXPEDITION_RESEARCHER); - spawnCreatureID = NPC_EXPEDITION_RESEARCHER; - break; - case 1: - case 2: - spawnCreatureID = possibleSpawns[urand(0, 30)]; - break; - } - - me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1min); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_webbed_creatureAI(creature); - } -}; +#include "SpellScript.h" /*###### ## Quest 9759: Ending Their World @@ -815,9 +745,85 @@ public: } }; +/*###### +## Quest 9670: They're Alive! Maybe... +######*/ + +enum FreeWebbedBloodmyst +{ + SPELL_FREE_WEBBED_1 = 30954, + SPELL_FREE_WEBBED_2 = 30955, + SPELL_FREE_WEBBED_3 = 30956, + SPELL_FREE_WEBBED_4 = 30957, + SPELL_FREE_WEBBED_5 = 30958, + SPELL_FREE_WEBBED_6 = 30959, + SPELL_FREE_WEBBED_7 = 30960, + SPELL_FREE_WEBBED_8 = 30961, + SPELL_FREE_WEBBED_9 = 30962, + SPELL_FREE_WEBBED_10 = 30963, + SPELL_FREE_WEBBED_11 = 31010 +}; + +uint32 const CocoonSummonSpells[10] = +{ + SPELL_FREE_WEBBED_1, SPELL_FREE_WEBBED_2, SPELL_FREE_WEBBED_3, SPELL_FREE_WEBBED_4, SPELL_FREE_WEBBED_5, + SPELL_FREE_WEBBED_6, SPELL_FREE_WEBBED_7, SPELL_FREE_WEBBED_8, SPELL_FREE_WEBBED_9, SPELL_FREE_WEBBED_10 +}; + +// 30950 - Free Webbed Creature +class spell_free_webbed : public SpellScript +{ + PrepareSpellScript(spell_free_webbed); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo(CocoonSummonSpells); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), Trinity::Containers::SelectRandomContainerElement(CocoonSummonSpells), true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_free_webbed::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 31009 - Free Webbed Creature +class spell_free_webbed_on_quest : public SpellScript +{ + PrepareSpellScript(spell_free_webbed_on_quest); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo(CocoonSummonSpells) && ValidateSpellInfo({ SPELL_FREE_WEBBED_11 }); + } + + // This one is a bit different from the one used in Terokkar. There is additional spell 31011 which apply periodic aura to trigger + // summon spell 31010 after 1.5 sec. However in retail Expedition Researcher is summoned instantly, we'll use 31010 directly + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + + if (roll_chance_i(66)) + caster->CastSpell(caster, Trinity::Containers::SelectRandomContainerElement(CocoonSummonSpells), true); + else + target->CastSpell(caster, SPELL_FREE_WEBBED_11, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_free_webbed_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_bloodmyst_isle() { - new npc_webbed_creature(); new npc_sironas(); new npc_demolitionist_legoso(); + RegisterSpellScript(spell_free_webbed); + RegisterSpellScript(spell_free_webbed_on_quest); } diff --git a/src/server/scripts/Northrend/zone_howling_fjord.cpp b/src/server/scripts/Northrend/zone_howling_fjord.cpp index 2590215091e..a5035094a95 100644 --- a/src/server/scripts/Northrend/zone_howling_fjord.cpp +++ b/src/server/scripts/Northrend/zone_howling_fjord.cpp @@ -512,7 +512,11 @@ class spell_mindless_abomination_explosion_fx_master : public SpellScriptLoader } }; -enum SummonSpells +/*###### +## Quest 11296: Rivenwood Captives +######*/ + +enum RivenwoodCaptives { SPELL_SUMMON_BABY_RIVEN_WIDOWS = 43275, SPELL_SUMMON_DARKCLAW_BAT = 43276, @@ -525,11 +529,10 @@ enum SummonSpells SPELL_SUMMON_WINTERSKORN_WOODSMAN = 43283, SPELL_SUMMON_WINTERSKORN_TRIBESMAN = 43284, SPELL_SUMMON_WINTERSKORN_ORACLE = 43285, - SPELL_SUMMON_FREED_MIST_WHISPER_SCOUT = 43289, - NPC_MIST_WHISPER_SCOUT = 24211 + SPELL_SUMMON_FREED_MIST_WHISPER_SCOUT = 43289 }; -const uint32 rivenWidowCocoonVictims[11] = +uint32 const CocoonSummonSpells[11] = { SPELL_SUMMON_BABY_RIVEN_WIDOWS, SPELL_SUMMON_DARKCLAW_BAT, @@ -544,39 +547,51 @@ const uint32 rivenWidowCocoonVictims[11] = SPELL_SUMMON_WINTERSKORN_ORACLE }; -class npc_riven_widow_cocoon : public CreatureScript +// 43288 - Rivenwood Captives: Player Not On Quest +class spell_rivenwood_captives_not_on_quest : public SpellScript { -public: - npc_riven_widow_cocoon() : CreatureScript("npc_riven_widow_cocoon") { } + PrepareSpellScript(spell_rivenwood_captives_not_on_quest); - struct npc_riven_widow_cocoonAI : public ScriptedAI + bool Validate(SpellInfo const* /*spellInfo*/) override { - npc_riven_widow_cocoonAI(Creature* creature) : ScriptedAI(creature) { } + return ValidateSpellInfo(CocoonSummonSpells); + } - void Reset() override { } - void JustEngagedWith(Unit* /*who*/) override { } - void MoveInLineOfSight(Unit* /*who*/) override { } + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetCaster(), Trinity::Containers::SelectRandomContainerElement(CocoonSummonSpells), true); + } - void JustDied(Unit* killer) override - { - if (!killer || killer->GetTypeId() != TYPEID_PLAYER) - return; + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_rivenwood_captives_not_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; - Player* player = killer->ToPlayer(); +// 43287 - Rivenwood Captives: Player On Quest +class spell_rivenwood_captives_on_quest : public SpellScript +{ + PrepareSpellScript(spell_rivenwood_captives_on_quest); - if (roll_chance_i(20)) - { - player->CastSpell(me, SPELL_SUMMON_FREED_MIST_WHISPER_SCOUT, true); - player->KilledMonsterCredit(NPC_MIST_WHISPER_SCOUT); - } - else - player->CastSpell(me, rivenWidowCocoonVictims[urand(0, 10)], true); - } - }; + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo(CocoonSummonSpells) && ValidateSpellInfo({ SPELL_SUMMON_FREED_MIST_WHISPER_SCOUT }); + } - CreatureAI* GetAI(Creature* creature) const override + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + + if (roll_chance_i(80)) + target->CastSpell(caster, Trinity::Containers::SelectRandomContainerElement(CocoonSummonSpells), true); + else + target->CastSpell(caster, SPELL_SUMMON_FREED_MIST_WHISPER_SCOUT, true); + } + + void Register() override { - return new npc_riven_widow_cocoonAI(creature); + OnEffectHitTarget += SpellEffectFn(spell_rivenwood_captives_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); } }; @@ -586,5 +601,6 @@ void AddSC_howling_fjord() RegisterCreatureAI(npc_daegarn); new npc_mindless_abomination(); new spell_mindless_abomination_explosion_fx_master(); - new npc_riven_widow_cocoon(); + RegisterSpellScript(spell_rivenwood_captives_not_on_quest); + RegisterSpellScript(spell_rivenwood_captives_on_quest); } diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp index 6b1022c631f..e3a1c2ae790 100644 --- a/src/server/scripts/Northrend/zone_zuldrak.cpp +++ b/src/server/scripts/Northrend/zone_zuldrak.cpp @@ -1045,6 +1045,64 @@ class spell_drop_disguise : public SpellScript } }; +/*###### +## Quest 12606: Cocooned! +######*/ + +enum Cocooned +{ + SPELL_SUMMON_SCOURGED_CAPTIVE = 51597, + SPELL_SUMMON_CAPTIVE_FOOTMAN = 51599 +}; + +// 51596 - Cocooned: Player Not On Quest +class spell_cocooned_not_on_quest : public SpellScript +{ + PrepareSpellScript(spell_cocooned_not_on_quest); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_SCOURGED_CAPTIVE }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetCaster(), SPELL_SUMMON_SCOURGED_CAPTIVE, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_cocooned_not_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 51598 - Cocooned: Player On Quest +class spell_cocooned_on_quest : public SpellScript +{ + PrepareSpellScript(spell_cocooned_on_quest); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_SCOURGED_CAPTIVE, SPELL_SUMMON_CAPTIVE_FOOTMAN }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + + if (roll_chance_i(66)) + target->CastSpell(caster, SPELL_SUMMON_SCOURGED_CAPTIVE, true); + else + target->CastSpell(caster, SPELL_SUMMON_CAPTIVE_FOOTMAN, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_cocooned_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_zuldrak() { new npc_drakuru_shackles(); @@ -1063,4 +1121,6 @@ void AddSC_zuldrak() RegisterSpellScript(spell_scourge_disguise_instability); RegisterSpellScript(spell_scourge_disguise_expiring); RegisterSpellScript(spell_drop_disguise); + RegisterSpellScript(spell_cocooned_not_on_quest); + RegisterSpellScript(spell_cocooned_on_quest); } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index a77e34f1fe2..b30ef7719a6 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -174,8 +174,77 @@ class spell_skyguard_flare : public SpellScript } }; +/*###### +## Quest 10873: Taken in the Night +######*/ + +enum FreeWebbedTerokkar +{ + SPELL_FREE_WEBBED_1 = 38953, + SPELL_FREE_WEBBED_2 = 38955, + SPELL_FREE_WEBBED_3 = 38956, + SPELL_FREE_WEBBED_4 = 38957, + SPELL_FREE_WEBBED_5 = 38958, + SPELL_FREE_WEBBED_6 = 38978 +}; + +uint32 const CocoonSummonSpells[5] = +{ + SPELL_FREE_WEBBED_1, SPELL_FREE_WEBBED_2, SPELL_FREE_WEBBED_3, SPELL_FREE_WEBBED_4, SPELL_FREE_WEBBED_5 +}; + +// 38949 - Terrokar Free Webbed Creature +class spell_free_webbed_terokkar : public SpellScript +{ + PrepareSpellScript(spell_free_webbed_terokkar); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo(CocoonSummonSpells); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), Trinity::Containers::SelectRandomContainerElement(CocoonSummonSpells), true); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_free_webbed_terokkar::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 38950 - Terokkar Free Webbed Creature ON QUEST +class spell_free_webbed_terokkar_on_quest : public SpellScript +{ + PrepareSpellScript(spell_free_webbed_terokkar_on_quest); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo(CocoonSummonSpells) && ValidateSpellInfo({ SPELL_FREE_WEBBED_6 }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + + if (roll_chance_i(66)) + caster->CastSpell(caster, Trinity::Containers::SelectRandomContainerElement(CocoonSummonSpells), true); + else + target->CastSpell(caster, SPELL_FREE_WEBBED_6, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_free_webbed_terokkar_on_quest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_terokkar_forest() { new npc_unkor_the_ruthless(); RegisterSpellScript(spell_skyguard_flare); + RegisterSpellScript(spell_free_webbed_terokkar); + RegisterSpellScript(spell_free_webbed_terokkar_on_quest); } |