Package games.stendhal.server.entity.creature

Examples of games.stendhal.server.entity.creature.Creature


public class SadScientsBrother implements ZoneConfigurator {

  public void configureZone(StendhalRPZone zone,
      Map<String, String> attributes) {
    final EntityManager manager = SingletonRepository.getEntityManager();
    final Creature creature = new ItemGuardCreature(manager.getCreature("imperial scientist"), "goblet", "sad_scientist", "kill_scientist", 0);
    creature.setName("Sergej Elos");
    final CreatureRespawnPoint point = new CreatureRespawnPoint(zone, 43, 85, creature, 1);
    zone.add(point);
  }
View Full Code Here


      sb.append(part).append(' ');
    }
   
    String creatureClass  = sb.toString().trim();

    final Creature tempCreature = sandbox.getCreature(creatureClass);
   
    if (tempCreature == null) {
      admin.sendPrivateText("No such creature");
    } else if (tempCreature.isRare() && System.getProperty("stendhal.testserver") == null) {
      // Rare creatures should not be summoned even in raids
      // Require parameter -Dstendhal.testserver=junk
      admin.sendPrivateText("Creatures with the rare property may only be summoned on test servers "
                        + "which are activated with the vm parameter: -Dstendhal.testserver=junk");
    } else {
      final Creature creature = new RaidCreature(tempCreature);

      final int k = MathHelper.parseIntDefault(args.get(0), 1);
      if (k <= MAX_RING_COUNT) {
        for (int dx = -k; dx <= k; dx++) {
          for (int dy = -k; dy <= k; dy++) {
View Full Code Here

   */
  protected LinkedList<Creature> getBlordroughs() {
    LinkedList<Creature> blordroughs = new LinkedList<Creature>();
    final EntityManager manager = SingletonRepository.getEntityManager();
    for (int i=0; i<Blordroughs.size(); i++) {
      Creature creature = manager.getCreature(Blordroughs.get(i));
      if (!creature.isRare()) {
        blordroughs.add(creature);
      }
    }
    return(blordroughs);
  }
View Full Code Here

        int tc=Rand.randGaussian(0,RAT_TYPES.size());
        if ((tc>(RAT_TYPES.size()-1)) || (tc<0)) {
          tc=0;
        }
        // checking if EntityManager knows about this creature type.
        final Creature tempCreature = new Creature((Creature) manager.getEntity(RAT_TYPES.get(tc)));
        final Creature rat = new Creature(tempCreature.getNewInstance());

        // chosen place is occupied
        if (zone.collides(rat,x,y)) {
          // Could not place the creature here.
          // Treat it like it was never exists.
          logger.debug("RATS " + zone.getName() + " " + x + " " + y + " collided.");
          continue;
        } else if (zone.getName().startsWith("0")) {
          // If we can't make it here, we can't make it anywhere ...
          // just checking the 0 level zones atm 
          // the rat is not in the zone yet so we can't call the smaller version of the searchPath method
          final List<Node> path = Path.searchPath(zone, x, y, zone.getWidth()/2,
              zone.getHeight()/2, (64+64)*2);
          if (path == null || path.size() == 0){
            logger.debug("RATS " + zone.getName() + " " + x + " " + y + " no path to " + zone.getWidth()/2 + " " + zone.getHeight()/2);
            continue;
          }
        }
        // spawn creature
        rat.registerObjectsForNotification(ratsObserver);
        /* -- commented because of these noises reflects on all archrats in game -- */
        // add unique noises to humanoids
        if (tc==RAT_TYPES.indexOf("archrat")) {
          final LinkedList<String> ll = new LinkedList<String>(
              Arrays.asList("We will capture Ados!",
              "Our revenge will awesome!"));
          LinkedHashMap<String, LinkedList<String>> lhm =
            new LinkedHashMap<String, LinkedList<String>>();
          // add to all states except death.
          lhm.put("idle", ll);
          lhm.put("fight", ll);
          lhm.put("follow", ll);
          rat.setNoises(lhm);
        }
       
        StendhalRPAction.placeat(zone, rat, x, y);
        rats.add(rat);
      }
View Full Code Here

  private void removeAllRats() {
    final int sz=rats.size();
    int i=0;
    while(rats.size()!=0) {
      try {
      final Creature rat = rats.get(0);
      rat.stopAttack();
      rat.clearDropItemList();
      rat.getZone().remove(rat);
      rats.remove(0);
      i++;
      } catch (IndexOutOfBoundsException ioobe) {
        // index is greater then size???
        logger.error("removeAllRats IndexOutOfBoundException at "+
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.creature.Creature

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.