Stampede cancel on damage taken

This commit is contained in:
Chiss 2014-04-21 17:04:51 +10:00
parent a150249f4f
commit 0f0b66a8cf

View File

@ -46,7 +46,9 @@ public class Stampede extends Skill
"",
"Attacking during stampede deals",
"#0#0.5 bonus damage per speed level,",
"and +50% knockback per speed level."
"and +50% knockback per speed level.",
"",
"Resets if you take damage."
});
}
@ -165,6 +167,18 @@ public class Stampede extends Skill
//Event
UtilServer.getServer().getPluginManager().callEvent(new SkillEvent(damager, GetName(), ClassType.Brute, damagee));
}
@EventHandler(priority = EventPriority.HIGH)
public void DamageCancel(CustomDamageEvent event)
{
if (event.IsCancelled())
return;
Player damagee = event.GetDamageePlayer();
if (damagee == null) return;
Reset(damagee);
}
@Override
public void Reset(Player player)