diff options
| author | jackpoz <giacomopoz@gmail.com> | 2016-01-09 23:19:09 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2016-03-21 23:35:57 +0100 |
| commit | f837fc875a6d8e00ade132ba3279ecf4b143ec76 (patch) | |
| tree | 4dfcdaaeb599ce69d6ef88473e95d934295a5ca4 /src | |
| parent | af0da1dde132bf2cc1e112a9a4a2491925b73acf (diff) | |
Merge pull request #15977 from tkrokli/landmine_knockback_achievement
Scripts/Spells: Mine Sweeper achievement
(cherry picked from commit e59b4324b8123fa2123a990cd2b907c39db1a42e)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index aea3cf455c8..85e94c19f93 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -4114,6 +4114,44 @@ public: } }; +enum LandmineKnockbackAchievement +{ + SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT = 57064 +}; + +class spell_gen_landmine_knockback_achievement : public SpellScriptLoader +{ +public: + spell_gen_landmine_knockback_achievement() : SpellScriptLoader("spell_gen_landmine_knockback_achievement") { } + + class spell_gen_landmine_knockback_achievement_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_landmine_knockback_achievement_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Player* target = GetHitPlayer()) + { + Aura const* aura = GetHitAura(); + if (!aura || aura->GetStackAmount() < 10) + return; + + target->CastSpell(target, SPELL_LANDMINE_KNOCKBACK_ACHIEVEMENT, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_gen_landmine_knockback_achievement_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_gen_landmine_knockback_achievement_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -4201,4 +4239,5 @@ void AddSC_generic_spell_scripts() new spell_gen_gm_freeze(); new spell_gen_stand(); new spell_gen_mixology_bonus(); + new spell_gen_landmine_knockback_achievement(); } |
