diff options
| author | Subv <s.v.h21@hotmail.com> | 2012-03-03 12:20:39 -0800 |
|---|---|---|
| committer | Subv <s.v.h21@hotmail.com> | 2012-03-03 12:20:39 -0800 |
| commit | d21179ab56f80c14982b0753c19e6fdc7ffc9503 (patch) | |
| tree | 096455436e26f96fae05dc9d4cb41aaec9f2ce94 /src/server/scripts/Spells | |
| parent | 6df9adf6d5853a555a40ea3ed5442d8d4b2f6d5a (diff) | |
| parent | b825573c2919af5a06b6482f3a437c0638171b92 (diff) | |
Merge pull request #5426 from Souler/fix_ds_pipe_knockback
Dalaran Sewers Arena: Knockback from starting pipe
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_generic.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index db33a9e0332..f2a48b0f9d2 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -2548,6 +2548,43 @@ class spell_gen_chaos_blast : public SpellScriptLoader }; +class spell_gen_ds_flush_knockback : public SpellScriptLoader +{ + public: + spell_gen_ds_flush_knockback() : SpellScriptLoader("spell_gen_ds_flush_knockback") {} + + class spell_gen_ds_flush_knockback_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_ds_flush_knockback_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + // Here the target is the water spout and determines the position where the player is knocked from + if (Unit* target = GetHitUnit()) + { + if (Player* player = GetCaster()->ToPlayer()) + { + float horizontalSpeed = 20.0f + (40.0f - GetCaster()->GetDistance(target)); + float verticalSpeed = 8.0f; + // This method relies on the Dalaran Sewer map disposition and Water Spout position + // What we do is knock the player from a position exactly behind him and at the end of the pipe + player->KnockbackFrom(target->GetPositionX(), player->GetPositionY(), horizontalSpeed, verticalSpeed); + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_ds_flush_knockback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_ds_flush_knockback_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -2597,4 +2634,5 @@ void AddSC_generic_spell_scripts() new spell_gen_on_tournament_mount(); new spell_gen_tournament_pennant(); new spell_gen_chaos_blast(); + new spell_gen_ds_flush_knockback(); } |
