@Override
 public double getExperience(Interaction interaction) {
   double xp = 42;
   if (interaction.getDamage().getHit() > 0) {
     xp += interaction.getDamage().getHit() * 0.2;
   }
   return xp;
 }
 @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 #3
0
 @Override
 public boolean commenceSpecialAttack(Interaction interaction) {
   interaction.setDamage(
       Damage.getDamage(
           interaction.getSource(),
           interaction.getVictim(),
           CombatType.MELEE,
           MeleeFormulae.getDamage(
               interaction.getSource(), interaction.getVictim(), 1.1, 1.1, 1)));
   interaction.getDamage().setMaximum(MeleeFormulae.getMeleeDamage(interaction.getSource(), 1.1));
   if (interaction.getVictim().isPlayer()) {
     interaction.setDeflected(interaction.getVictim().getPlayer().getPrayer().usingPrayer(1, 9));
   }
   interaction.getSource().animate(ANIMATION);
   interaction.getSource().graphics(GRAPHICS, 96 << 16);
   interaction
       .getVictim()
       .animate(interaction.isDeflected() ? 12573 : interaction.getVictim().getDefenceAnimation());
   if (interaction.isDeflected()) {
     interaction.getVictim().graphics(2230);
   }
   return true;
 }