diff options
author | SnapperRy <snapperryen@gmail.com> | 2016-10-11 16:59:28 +0200 |
---|---|---|
committer | SnapperRy <snapperryen@gmail.com> | 2016-10-11 16:59:28 +0200 |
commit | 387b18775d6f7b7d6e8cf669d36328867e5f39d5 (patch) | |
tree | a6b348a47a52b624ac53736a4256ae29b5e0b6d1 /src | |
parent | f64041e602dfcf80608402257782ff2627f09384 (diff) |
Script/Quest: Apply Heat and Stir.
Enjoy one of the most frustrating quests in Northrend!
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 2eca20199b4..fd99888f8d9 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2565,6 +2565,146 @@ public: } }; +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(); @@ -2628,4 +2768,8 @@ void AddSC_quest_spell_scripts() 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(); } |