diff options
| author | ariel- <ariel-@users.noreply.github.com> | 2017-01-07 13:22:58 -0300 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2017-01-07 13:23:20 -0300 |
| commit | db34f6480fa6a84cce3fa2ee76dbe79fce9699c6 (patch) | |
| tree | 1052196528145bf33ff87c0d8b3ce52a2d235867 /src | |
| parent | 1b2684791b28ae1ca5425210471f2176d44766aa (diff) | |
DB/Script: The Only Cure is More Green Glow
Closes #1723
SQL by Staleness89, corrections by Killyana
Script by Keader, corrections by sirikfoll and me
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index bf1fa7b3dde..ed754c68202 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -545,8 +545,56 @@ public: }; +// 12709 - Collecting Fallout +class spell_collecting_fallout : public SpellScriptLoader +{ + public: + spell_collecting_fallout() : SpellScriptLoader("spell_collecting_fallout") { } + + class spell_collecting_fallout_SpellScript : public SpellScript + { + PrepareSpellScript(spell_collecting_fallout_SpellScript); + + bool Load() override + { + _spellFail = true; + return true; + } + + void OnLaunch(SpellEffIndex effIndex) + { + // estimated 25% chance of success + if (roll_chance_i(25)) + _spellFail = false; + else + PreventHitDefaultEffect(effIndex); + } + + void HandleFail(SpellEffIndex effIndex) + { + if (!_spellFail) + PreventHitDefaultEffect(effIndex); + } + + void Register() override + { + OnEffectLaunch += SpellEffectFn(spell_collecting_fallout_SpellScript::OnLaunch, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL); + OnEffectLaunch += SpellEffectFn(spell_collecting_fallout_SpellScript::HandleFail, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL); + } + + bool _spellFail; + }; + + SpellScript* GetSpellScript() const override + { + return new spell_collecting_fallout_SpellScript(); + } +}; + void AddSC_gnomeregan() { new npc_blastmaster_emi_shortfuse(); new boss_grubbis(); + + new spell_collecting_fallout(); } |
