aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
authorSouler <soulerhyd@gmail.com>2012-02-25 17:27:19 +0100
committerSouler <soulerhyd@gmail.com>2012-03-02 17:20:45 +0100
commitc119c0ce13ab85e775ff399f7e28a38d72ac4e45 (patch)
tree8990777f542acc096968fe36a7a0685db9aaafae /src/server/scripts
parent3ea9fe4022f5614553b1e9ec9be4e731d7809419 (diff)
Core/Arenas/Dalaran Sewers: Players who stay on the pipe after the battle has begun should be knocked into the arena.
Also corrected the orientation of horde starting position
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp38
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();
}