Beispiel #1
0
  @Override
  public boolean customContainerAttack(Character entity, Character victim) {
    NPC lakra = (NPC) entity;
    if (victim.getConstitution() <= 0) {
      return true;
    }
    if (lakra.isChargingAttack()) {
      return true;
    }
    lakra.setChargingAttack(true);
    lakra.performAnimation(new Animation((13770)));
    final CombatType attkType = Misc.getRandom(5) <= 2 ? CombatType.RANGED : CombatType.MAGIC;
    lakra
        .getCombatBuilder()
        .setContainer(
            new CombatContainer(
                lakra, victim, 1, 4, attkType, Misc.getRandom(5) <= 1 ? false : true));
    TaskManager.submit(
        new Task(1, lakra, false) {
          int tick = 0;

          @Override
          public void execute() {
            if (tick == 2) {
              new Projectile(
                      lakra, victim, (attkType == CombatType.RANGED ? 605 : 473), 44, 3, 43, 43, 0)
                  .sendProjectile();
              lakra.setChargingAttack(false);
              stop();
            }
            tick++;
          }
        });
    return true;
  }
Beispiel #2
0
 @Override
 public boolean customContainerAttack(Character entity, Character victim) {
   NPC zilyana = (NPC) entity;
   if (victim.getConstitution() <= 0) {
     return true;
   }
   if (Locations.goodDistance(zilyana.getPosition().copy(), victim.getPosition().copy(), 1)
       && Misc.getRandom(5) <= 3) {
     zilyana.performAnimation(new Animation(zilyana.getDefinition().getAttackAnimation()));
     zilyana
         .getCombatBuilder()
         .setContainer(new CombatContainer(zilyana, victim, 1, 1, CombatType.MELEE, true));
   } else {
     zilyana.performAnimation(attack_anim);
     zilyana.performGraphic(new Graphic(1220));
     zilyana
         .getCombatBuilder()
         .setContainer(new CombatContainer(zilyana, victim, 2, 3, CombatType.MAGIC, true));
     zilyana.getCombatBuilder().setAttackTimer(7);
   }
   return true;
 }
Beispiel #3
0
 @Override
 public boolean canAttack(Character entity, Character victim) {
   return victim.isPlayer();
 }
Beispiel #4
0
 @Override
 public int attackDelay(Character entity) {
   return entity.getAttackSpeed();
 }
Beispiel #5
0
 @Override
 public boolean canAttack(Character entity, Character victim) {
   return victim.isPlayer()
       && ((Player) victim).getMinigameAttributes().getGodwarsDungeonAttributes().hasEnteredRoom();
 }