/**
   * Places a domestic animal in the world. If it matches it's owner's zone, then try to keep it's
   * position.
   *
   * @param animal The domestic animal.
   * @param player The owner.
   * @return <code>true</code> if placed.
   */
  protected static boolean placeAnimalIntoWorld(final DomesticAnimal animal, final Player player) {
    final StendhalRPZone playerZone = player.getZone();

    /*
     * Only add directly if required attributes are present
     */
    if (animal.has("zoneid") && animal.has("x") && animal.has("y")) {
      final StendhalRPZone zone = SingletonRepository.getRPWorld().getZone(animal.get("zoneid"));

      /*
       * Player could have been forced to change zones
       */
      if (zone == playerZone) {
        if (StendhalRPAction.placeat(zone, animal, animal.getX(), animal.getY())) {
          return true;
        }
      }
    }

    return StendhalRPAction.placeat(playerZone, animal, player.getX(), player.getY());
  }
  /**
   * Places the player (and his/her sheep if there is one) into the world on login.
   *
   * @param object RPObject representing the player
   * @param player Player-object
   */
  public static void placePlayerIntoWorldOnLogin(final RPObject object, final Player player) {
    StendhalRPZone zone = null;

    String zoneName = System.getProperty("stendhal.forcezone");
    if (zoneName != null) {
      zone = SingletonRepository.getRPWorld().getZone(zoneName);
      zone.placeObjectAtEntryPoint(player);
      return;
    }

    try {
      if (object.has("zoneid") && object.has("x") && object.has("y")) {
        if (Version.checkCompatibility(object.get("release"), Debug.VERSION)) {
          zone = SingletonRepository.getRPWorld().getZone(object.get("zoneid"));
        } else {
          if (player.getLevel() >= 2) {
            TutorialNotifier.newrelease(player);
          }
        }
        player.put("release", Debug.VERSION);
      }
    } catch (final RuntimeException e) {
      // If placing the player at its last position
      // fails, we reset to default zone
      logger.warn("Cannot place player at its last position. Using default", e);
    }

    if (zone != null) {
      /*
       * Put the player in their zone (use placeat() for collision rules)
       */
      if (!StendhalRPAction.placeat(zone, player, player.getX(), player.getY())) {
        logger.warn("Cannot place player at their last position: " + player.getName());
        zone = null;
      }
    }

    if (zone == null) {
      /*
       * Fallback to default zone
       */
      final String defaultZoneName = getDefaultZoneForPlayer(player);
      zone = SingletonRepository.getRPWorld().getZone(defaultZoneName);

      if (zone == null) {
        logger.error("Unable to locate default zone [" + defaultZoneName + "]");
        return;
      }

      zone.placeObjectAtEntryPoint(player);
    }
  }
 /**
  * function for emulating killing of creature by player.
  *
  * @param name - creature's name
  */
 private void killSpider(String name) {
   final Creature creature = new Creature();
   creature.put("class", "");
   creature.put("subclass", "");
   creature.setName(name);
   creature.setHP(1);
   creature.setAtkXP(1);
   creature.setDefXP(1);
   creature.setSounds(new LinkedList<String>());
   final Creature spider = new Creature(creature);
   spider.registerObjectsForNotification(observer);
   player.teleport(basement, 5, 5, null, player);
   StendhalRPAction.placeat(basement, spider, 51, 50);
   spider.onDead(player, true);
 }