Code:
int maxHit;
int damage;
int randomHit;
final int hitDelay;
final int hit;
int clientSpeed;
int gfxDelay;
vorkath.playAnimation(Animation.create(7952));
if (vorkath.getLocation().isWithinDistance(vorkath, challenger, 1)) {
clientSpeed = 70;
gfxDelay = 80;
} else if (vorkath.getLocation().isWithinDistance(vorkath, challenger, 5)) {
clientSpeed = 90;
gfxDelay = 100;
} else if (vorkath.getLocation().isWithinDistance(vorkath, challenger, 8)) {
clientSpeed = 110;
gfxDelay = 120;
} else {
clientSpeed = 130;
gfxDelay = 140;
}
hitDelay = (gfxDelay / 20) - 1;
challenger.getActionSender().sendProjectile(Projectile.create(vorkath.getCentreLocation(), challenger.getCentreLocation(), 1479, 45, 50, clientSpeed, 35, 35, challenger.getProjectileLockonIndex(), 10, 48));
maxHit = 61;
damage = MagicCombatAction.getAction().damage(maxHit, vorkath, challenger, CombatState.AttackType.MAGIC, Skills.MAGIC, Prayers.PROTECT_FROM_MAGIC, false, false);
randomHit = Misc.random(damage < 1 ? 0 : damage);
hit = randomHit;
vorkath.getCombatState().setAttackDelay(5);
vorkath.getCombatState().setSpellDelay(6);
World.getWorld().submitStoppingTick(hitDelay, () -> {
challenger.playGraphics(Graphic.create(1480));
challenger.inflictDamage(new Hit(hit), vorkath);
challenger.getActiveCombatAction().recoil(vorkath, challenger, hit);
});
challenger.getActiveCombatAction().vengeance(vorkath, challenger, hit, 1);
vorkath.incremenentAttacks();
}