@Override
 public boolean castSpell(Interaction interaction) {
   MagicFormulae.setDamage(interaction);
   int speed =
       (int)
           (46
               + interaction
                       .getSource()
                       .getLocation()
                       .getDistance(interaction.getVictim().getLocation())
                   * 10);
   ProjectileManager.sendProjectile(
       Projectile.create(
           interaction.getSource(), interaction.getVictim(), 380, 43, 0, 51, speed, 16, 64));
   interaction.getSource().animate(1978);
   if (interaction.getDamage().getHit() > -1
       && interaction.getVictim().isPlayer()
       && RANDOM.nextInt(20) < 4) {
     Player p = interaction.getVictim().getPlayer();
     ActionSender.sendMessage(p, "You have been blinded.");
     int attackLevel = p.getSkills().getLevel(Skills.ATTACK);
     attackLevel -= attackLevel * 0.1;
     p.getSkills().set(Skills.ATTACK, attackLevel);
   }
   interaction.setEndGraphic(Graphic.create(381));
   return true;
 }
Exemple #2
0
 @Override
 public boolean castSpell(Interaction interaction) {
   if (interaction.getSource().getPlayer().getSkills().getLevel(Skills.MAGIC) < 75) {
     interaction
         .getSource()
         .getPlayer()
         .sendMessage("You need a level of 75 Magic to use fire wave.");
     return false;
   }
   MagicFormulae.setDamage(interaction);
   int speed =
       (int)
           (46
               + interaction
                       .getSource()
                       .getLocation()
                       .getDistance(interaction.getVictim().getLocation())
                   * 10);
   ProjectileManager.sendProjectile(
       Projectile.create(
           interaction.getSource(), interaction.getVictim(), 2733, 30, 32, 52, speed, 3, 150));
   ProjectileManager.sendProjectile(
       Projectile.create(
           interaction.getSource(), interaction.getVictim(), 2734, 30, 32, 52, speed, 20, 150));
   ProjectileManager.sendProjectile(
       Projectile.create(
           interaction.getSource(), interaction.getVictim(), 2734, 30, 32, 52, speed, 110, 150));
   interaction.getSource().animate(2791);
   interaction.getSource().graphics(2728, 0);
   interaction.setEndGraphic(Graphic.create(2740, 96 << 16));
   return true;
 }