Package games.stendhal.server.entity

Examples of games.stendhal.server.entity.RPEntity


        return ((Player) entity).getName();
      }
    }

    // which player did we attack last?
    RPEntity target = getAttackTarget();
    if ((target != null) && (target instanceof Player)) {
      if (getZone() == target.getZone()) {
        return target.getName();
      }
    }

    return null;
  }
View Full Code Here


    buildMagicSchoolCellarArea(zone, attributes);
  }
 
  protected void updatePlayerQuest(final CircumstancesOfDeath circ) {
    final String victim = circ.getVictim().getName();
    final RPEntity killer = circ.getKiller();
    Logger.getLogger(SpidersCreatures.class).debug(
        "in "+circ.getZone().getName()+
        ": "+victim+
        " killed by "+killer.getName());
    // check if was killed by other animal/pet
    if(!circ.getKiller().getClass().getName().equals(Player.class.getName()) ) {
      return;
    }
View Full Code Here

  }

  @Override
  public void onDead(final Entity killer, final boolean remove) {
    if (killer instanceof RPEntity) {
      final RPEntity killerRPEntity = (RPEntity) killer;

      if (killerRPEntity.drop(oldItemType)) {
        final Item item = SingletonRepository.getEntityManager().getItem(
            itemType);

        killerRPEntity.equipOrPutOnGround(item);
      }
    }
    super.onDead(killer, remove);
  }
View Full Code Here

  /**
   * function will fill information about victim to killer's quest slot.
   * @param circ - information about victim,zone and killer.
   */
  private void updatePlayerQuest(final CircumstancesOfDeath circ) {
    final RPEntity killer = circ.getKiller();
    final String victim = circ.getVictim().getName();
    Logger.getLogger(SpidersCreatures.class).debug(
        "in "+circ.getZone().getName()+
        ": "+circ.getVictim().getName()+
        " killed by "+circ.getKiller().getName());
View Full Code Here

    final List<RPEntity> enemyList = creature.getEnemyList();
    if (enemyList.isEmpty()) {
      return false;
    }

    RPEntity target = null;
   
    if (creature.isAttacking() && isPreferredTarget(creature.getAttackTarget())) {
      target = creature.getAttackTarget();
    }

    int level;
    if (target != null) {
      level = target.getLevel();
    } else {
      // just something above anything
      level = 1000;
    }
View Full Code Here

  /**
   * function will fill information about victim to killer's quest slot.
   * @param circ - information about victim,zone and killer.
   */ 
  private void updatePlayerQuest(final CircumstancesOfDeath circ) {
    final RPEntity killer = circ.getKiller();
    final String victim = circ.getVictim().getName();
    Logger.getLogger(SpidersCreatures.class).debug(
        "in "+circ.getZone().getName()+
        ": "+circ.getVictim().getName()+
        " killed by "+circ.getKiller().getName());
View Full Code Here

      return false;
    }
  }

  public void findNewTarget(final Creature creature) {
    final RPEntity enemy = creature.getNearestEnemy(creature.getPerceptionRange()+2);
    if (enemy != null) {
      creature.setTarget(enemy);
    }
  }
View Full Code Here

  public boolean hasValidTarget(final Creature creature) {
    if (!creature.isAttacking()) {
      return false;
    }

    final RPEntity victim = creature.getAttackTarget();
    if (victim.isInvisibleToCreatures()) {
      return false;
    }
    if (!victim.getZone().equals(creature.getZone())) {
      return false;
    }

    if (!creature.getZone().has(victim.getID())) {
      return false;
    }
    return creature.squaredDistance(victim) < (FOLLOW_RADIUS * FOLLOW_RADIUS);
  }
 
View Full Code Here

      return false;
    }
  }

  public void findNewTarget(final Creature creature) {
    final RPEntity enemy = creature.getNearestEnemy(creature.getPerceptionRange()+2);
    if (enemy != null) {
      creature.setTarget(enemy);
    }
  }
View Full Code Here

  public boolean hasValidTarget(final Creature creature) {
    if (!creature.isAttacking()) {
      return false;
    }

    final RPEntity victim = creature.getAttackTarget();
    if (victim.isInvisibleToCreatures()) {
      return false;
    }
    if (!victim.getZone().equals(creature.getZone())) {
      return false;
    }

    if (!creature.getZone().has(victim.getID())) {
      return false;
    }
    return creature.squaredDistance(victim) < MAX_RANGE_SQUARED;
  }
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.RPEntity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.