diff options
-rw-r--r-- | sql/updates/world/master/2017_09_05_16_world_2016_10_11_02_world.sql | 20 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 172 |
2 files changed, 192 insertions, 0 deletions
diff --git a/sql/updates/world/master/2017_09_05_16_world_2016_10_11_02_world.sql b/sql/updates/world/master/2017_09_05_16_world_2016_10_11_02_world.sql new file mode 100644 index 00000000000..721869086ab --- /dev/null +++ b/sql/updates/world/master/2017_09_05_16_world_2016_10_11_02_world.sql @@ -0,0 +1,20 @@ +-- +DELETE FROM `spell_scripts` WHERE `id`=43375; +DELETE FROM `spell_script_names` WHERE `spell_id` IN (43375, 43376, 43378, 43972); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(43972, "spell_q11306_mixing_blood"), +(43375, "spell_q11306_mixing_vrykul_blood"), +(43376, "spell_q11306_failed_mix_43376"), +(43378, "spell_q11306_failed_mix_43378"); + +DELETE FROM creature_text WHERE entry IN (24042, 24251); +INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(24042, 0, 0, "$N's concoction is ruined. A new one must be created from scratch.", 16, 0, 100, 0, 0, 0, 23540, 0, "Generic Trigger LAB"), +(24042, 1, 0, "The failed concoction spills on the floor and appears to come to life!", 16, 0, 100, 0, 0, 0, 23071, 0, "Generic Trigger LAB"), +(24251, 0, 0, "The mixture! It moves!", 14, 0, 100, 0, 0, 0, 23101, 0, "Chief Plaguebringer Harris"); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=24279; +DELETE FROM `smart_scripts` WHERE `entryorguid`=24279; +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 +(24279, 0, 0, 0, 4, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 24251, 0, 0, 0, 0, 0, 0, "Animated Plague Slime - On Aggro - Talk 0 (Chief Plaguebringer Harris) (no repeat)"), +(24279, 0, 1, 0, 0, 0, 100, 0, 0, 0, 10000, 10000, 11, 3335, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Animated Plague Slime - In Combat - Cast Dark Sludge"); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index a6364960102..5eb5324df47 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2587,6 +2587,173 @@ class spell_q13665_q13790_bested_trigger : public SpellScriptLoader } }; +// herald of war and life without regret portal spells +class spell_59064_59439_portals : public SpellScriptLoader +{ +public: + spell_59064_59439_portals() : SpellScriptLoader("spell_59064_59439_portals") { } + + class spell_59064_59439_portals_SpellScript : public SpellScript + { + PrepareSpellScript(spell_59064_59439_portals_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectValue())); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_59064_59439_portals_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_59064_59439_portals_SpellScript(); + } +}; + +enum ApplyHeatAndStir +{ + SPELL_SPURTS_AND_SMOKE = 38594, + SPELL_FAILED_MIX_1 = 43376, + SPELL_FAILED_MIX_2 = 43378, + SPELL_FAILED_MIX_3 = 43970, + SPELL_SUCCESSFUL_MIX = 43377, + + CREATURE_GENERIC_TRIGGER_LAB = 24042, + + TALK_0 = 0, + TALK_1 = 1 +}; + +class spell_q11306_mixing_blood : public SpellScriptLoader +{ +public: + spell_q11306_mixing_blood() : SpellScriptLoader("spell_q11306_mixing_blood") { } + + class spell_q11306_mixing_blood_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_mixing_blood_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->DoCastSelf(SPELL_SPURTS_AND_SMOKE); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11306_mixing_blood_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_mixing_blood_SpellScript(); + } +}; + +class spell_q11306_mixing_vrykul_blood : public SpellScriptLoader +{ + public: + spell_q11306_mixing_vrykul_blood() : SpellScriptLoader("spell_q11306_mixing_vrykul_blood") { } + + class spell_q11306_mixing_vrykul_blood_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_mixing_vrykul_blood_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + { + uint8 chance = urand(0, 99); + uint32 spellId = 0; + + // 90% chance of getting one out of three failure effects + if (chance < 30) + spellId = SPELL_FAILED_MIX_1; + else if (chance < 60) + spellId = SPELL_FAILED_MIX_2; + else if (chance < 90) + spellId = SPELL_FAILED_MIX_3; + else // 10% chance of successful cast + spellId = SPELL_SUCCESSFUL_MIX; + + caster->CastSpell(caster, spellId, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11306_mixing_vrykul_blood_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_mixing_vrykul_blood_SpellScript(); + } +}; + +class spell_q11306_failed_mix_43376 : public SpellScriptLoader +{ +public: + spell_q11306_failed_mix_43376() : SpellScriptLoader("spell_q11306_failed_mix_43376") { } + + class spell_q11306_failed_mix_43376_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_failed_mix_43376_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->Talk(TALK_0, caster); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43376_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_failed_mix_43376_SpellScript(); + } +}; + +class spell_q11306_failed_mix_43378 : public SpellScriptLoader +{ +public: + spell_q11306_failed_mix_43378() : SpellScriptLoader("spell_q11306_failed_mix_43378") { } + + class spell_q11306_failed_mix_43378_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_failed_mix_43378_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->Talk(TALK_1, caster); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43378_SpellScript::HandleEffect, EFFECT_2, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_failed_mix_43378_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2651,4 +2818,9 @@ void AddSC_quest_spell_scripts() new spell_q28813_set_health_random(); new spell_q12414_hand_over_reins(); new spell_q13665_q13790_bested_trigger(); + new spell_59064_59439_portals(); + new spell_q11306_mixing_blood(); + new spell_q11306_mixing_vrykul_blood(); + new spell_q11306_failed_mix_43376(); + new spell_q11306_failed_mix_43378(); } |