diff options
author | offl <11556157+offl@users.noreply.github.com> | 2022-02-17 23:37:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-17 23:37:49 +0200 |
commit | f2904dd5775fdca7894bc16da6e6c0e2ebba79c7 (patch) | |
tree | 3b2ed684a9dfa7ee903288fbd108f8049a71873a | |
parent | 75db924e91ec52661151040bf2aa8f69a312238a (diff) |
Scripts/Quest: Update 'Torture the Torturer' (#27782)
-rw-r--r-- | sql/updates/world/3.3.5/2022_02_17_02_world.sql | 24 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_dragonblight.cpp | 177 |
2 files changed, 97 insertions, 104 deletions
diff --git a/sql/updates/world/3.3.5/2022_02_17_02_world.sql b/sql/updates/world/3.3.5/2022_02_17_02_world.sql new file mode 100644 index 00000000000..956e6405285 --- /dev/null +++ b/sql/updates/world/3.3.5/2022_02_17_02_world.sql @@ -0,0 +1,24 @@ +-- +UPDATE `spell_dbc` SET `ProcChance` = 101, `Effect1` = 134, `EffectImplicitTargetA1` = 25, `EffectMiscValue1` = 27394 WHERE `Id` = 48607; + +DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_high_executor_branding_iron'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(48603,'spell_high_executor_branding_iron'); + +DELETE FROM `creature_text` WHERE `CreatureID` = 27209 AND `GroupID` > 5; +INSERT INTO `creature_text` (`CreatureID`,`GroupID`,`ID`,`Text`,`Type`,`Language`,`Probability`,`Emote`,`Duration`,`Sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(27209,6,0,"I TOLD YOU... I don't know... anything... else!",15,0,100,0,0,0,26496,0,"Torturer LeCraft"), +(27209,6,1,"Please... stop. I'll do... anything....",15,0,100,0,0,0,26498,0,"Torturer LeCraft"), +(27209,6,2,"Just... end it.",15,0,100,0,0,0,26499,0,"Torturer LeCraft"), +(27209,6,3,"They all... begged... for their... lives!",15,0,100,0,0,0,26501,0,"Torturer LeCraft"), +(27209,6,4,"I beg you... no more.",15,0,100,0,0,0,26504,0,"Torturer LeCraft"), +(27209,6,5,"THIS IS TORTURE!",15,0,100,0,0,0,26505,0,"Torturer LeCraft"), +(27209,6,6,"You won't get... anything else... out of me!",15,0,100,0,0,0,26506,0,"Torturer LeCraft"), +(27209,6,7,"OWWWWWWWW!",15,0,100,0,0,0,26507,0,"Torturer LeCraft"); + +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 27209; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 27209 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 +(27209,0,0,0,4,0,100,0,0,0,0,0,0,1,0,0,1,0,0,0,7,0,0,0,0,0,0,0,0,"Torturer LeCraft - On Aggro - Say Line 0"), +(27209,0,1,0,0,0,100,0,0,5000,3000,10000,0,11,30478,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Torturer LeCraft - In Combat - Cast 'Hemorrhage'"), +(27209,0,2,0,0,0,100,0,10000,15000,20000,20000,0,11,30621,0,0,0,0,0,2,0,0,0,0,0,0,0,0,"Torturer LeCraft - In Combat - Cast 'Kidney Shot'"); diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index 5c0ce5876a2..a2a86b61ec4 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -24,6 +24,7 @@ #include "Player.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" +#include "SpellAuras.h" #include "SpellInfo.h" #include "SpellScript.h" #include "TemporarySummon.h" @@ -577,109 +578,6 @@ class npc_wyrmrest_defender : public CreatureScript } }; -/*##### -# npc_torturer_lecraft -#####*/ - -enum TorturerLeCraft -{ - SPELL_HEMORRHAGE = 30478, - SPELL_KIDNEY_SHOT = 30621, - SPELL_HIGH_EXECUTORS_BRANDING_IRON = 48603, - NPC_TORTURER_LECRAFT = 27394, - EVENT_HEMORRHAGE = 1, - EVENT_KIDNEY_SHOT = 2, - SAY_AGGRO = 0 -}; - -class npc_torturer_lecraft : public CreatureScript -{ - public: npc_torturer_lecraft() : CreatureScript("npc_torturer_lecraft") {} - - struct npc_torturer_lecraftAI : public ScriptedAI - { - npc_torturer_lecraftAI(Creature* creature) : ScriptedAI(creature) - { - _textCounter = 1; - } - - void Reset() override - { - _textCounter = 1; - _playerGUID.Clear(); - } - - void JustEngagedWith(Unit* who) override - { - _events.ScheduleEvent(EVENT_HEMORRHAGE, 5s, 8s); - _events.ScheduleEvent(EVENT_KIDNEY_SHOT, 12s, 15s); - - if (Player* player = who->ToPlayer()) - Talk (SAY_AGGRO, player); - } - - void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override - { - if (spellInfo->Id != SPELL_HIGH_EXECUTORS_BRANDING_IRON) - return; - - if (Player* player = caster->ToPlayer()) - { - if (_textCounter == 1) - _playerGUID = player->GetGUID(); - - if (_playerGUID != player->GetGUID()) - return; - - Talk(_textCounter, player); - - if (_textCounter == 5) - player->KilledMonsterCredit(NPC_TORTURER_LECRAFT); - - ++_textCounter; - - if (_textCounter == 13) - _textCounter = 6; - } - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - _events.Update(diff); - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_HEMORRHAGE: - DoCastVictim(SPELL_HEMORRHAGE); - _events.ScheduleEvent(EVENT_HEMORRHAGE, 12s, 168s); - break; - case EVENT_KIDNEY_SHOT: - DoCastVictim(SPELL_KIDNEY_SHOT); - _events.ScheduleEvent(EVENT_KIDNEY_SHOT, 20s, 26s); - break; - default: - break; - } - } - DoMeleeAttackIfReady(); - } - private: - EventMap _events; - uint8 _textCounter; - ObjectGuid _playerGUID; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_torturer_lecraftAI(creature); - } -}; - /*###### ## Quest 12053: The Might of the Horde ######*/ @@ -811,15 +709,86 @@ class spell_call_out_injured_soldier : public SpellScript } }; +/*###### +## Quest 12252: Torture the Torturer +######*/ + +enum TortureTheTorturer +{ + WHISPER_TORTURE_1 = 1, + WHISPER_TORTURE_2 = 2, + WHISPER_TORTURE_3 = 3, + WHISPER_TORTURE_4 = 4, + WHISPER_TORTURE_5 = 5, + WHISPER_TORTURE_RANDOM = 6, + + SPELL_TORTURER_KILL_CREDIT = 48607, + SPELL_BRANDING_IRON_IMPACT = 48614 +}; + +// 48603 - High Executor's Branding Iron +class spell_high_executor_branding_iron : public SpellScript +{ + PrepareSpellScript(spell_high_executor_branding_iron); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return ValidateSpellInfo({ SPELL_TORTURER_KILL_CREDIT, SPELL_BRANDING_IRON_IMPACT }); + } + + void HandleWhisper() + { + Player* caster = GetCaster()->ToPlayer(); + Creature* target = GetHitCreature(); + if (!caster || !target) + return; + + target->CastSpell(target, SPELL_BRANDING_IRON_IMPACT); + + if (Aura* aura = caster->GetAura(GetSpellInfo()->Id)) + { + switch (aura->GetStackAmount()) + { + case 1: + target->AI()->Talk(WHISPER_TORTURE_1, caster); + break; + case 2: + target->AI()->Talk(WHISPER_TORTURE_2, caster); + break; + case 3: + target->AI()->Talk(WHISPER_TORTURE_3, caster); + break; + case 4: + target->AI()->Talk(WHISPER_TORTURE_4, caster); + break; + case 5: + target->AI()->Talk(WHISPER_TORTURE_5, caster); + target->CastSpell(caster, SPELL_TORTURER_KILL_CREDIT); + break; + case 6: + target->AI()->Talk(WHISPER_TORTURE_RANDOM, caster); + break; + default: + return; + } + } + } + + void Register() override + { + AfterHit += SpellHitFn(spell_high_executor_branding_iron::HandleWhisper); + } +}; + void AddSC_dragonblight() { new npc_commander_eligor_dawnbringer(); new spell_q12096_q12092_dummy(); new spell_q12096_q12092_bark(); new npc_wyrmrest_defender(); - new npc_torturer_lecraft(); RegisterSpellScript(spell_warsong_battle_standard); RegisterSpellScript(spell_moti_mirror_image_script_effect); RegisterSpellScript(spell_moti_hourglass_cast_see_invis_on_master); RegisterSpellScript(spell_call_out_injured_soldier); + RegisterSpellScript(spell_high_executor_branding_iron); } |