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
This commit is contained in:
Souler
2012-02-25 17:27:19 +01:00
parent 3ea9fe4022
commit c119c0ce13
4 changed files with 103 additions and 3 deletions

View File

@@ -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();
}