예제 #1
0
 @Override
 public double getExperience(Interaction interaction) {
   double xp = 42;
   if (interaction.getDamage().getHit() > 0) {
     xp += interaction.getDamage().getHit() * 0.2;
   }
   return xp;
 }
예제 #2
0
 @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;
 }
예제 #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;
 }
예제 #4
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;
 }