Package games.stendhal.server.maps.semos.wizardstower

Source Code of games.stendhal.server.maps.semos.wizardstower.SixthFloorCreatures

/* $Id: SixthFloorCreatures.java,v 1.4 2010/11/28 21:56:07 martinfuchs Exp $ */
/***************************************************************************
*                   (C) Copyright 2003-2010 - Stendhal                    *
***************************************************************************
***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/
package games.stendhal.server.maps.semos.wizardstower;

import games.stendhal.common.Direction;
import games.stendhal.server.core.config.ZoneConfigurator;
import games.stendhal.server.core.engine.SingletonRepository;
import games.stendhal.server.core.engine.StendhalRPZone;
import games.stendhal.server.core.rule.EntityManager;
import games.stendhal.server.entity.creature.Creature;

import java.util.HashMap;
import java.util.Map;

public class SixthFloorCreatures implements ZoneConfigurator {

  /**
   * Configure a zone.
   *
   * @param  zone    The zone to be configured.
   * @param  attributes  Configuration attributes.
   */

  public void configureZone(final StendhalRPZone zone, final Map<String, String> attributes) {
    buildSixthFloor(zone, attributes);
  }

  private void buildSixthFloor(final StendhalRPZone zone, final Map<String, String> attributes) {
    final EntityManager manager = SingletonRepository.getEntityManager();

    final Creature creature = manager.getCreature("littlefairy");
    final Creature creature1 = manager.getCreature("pegasus");
    final Creature creature2 = manager.getCreature("unicorn");
    final Creature creature3 = manager.getCreature("archangel");

    creature.setAIProfiles(new HashMap<String, String>());
    creature1.setAIProfiles(new HashMap<String, String>());
    creature2.setAIProfiles(new HashMap<String, String>());
    creature3.setAIProfiles(new HashMap<String, String>());

    creature.clearDropItemList();
    creature1.clearDropItemList();
    creature2.clearDropItemList();
    creature3.clearDropItemList();

    creature.setXP(0);
    creature1.setXP(0);
    creature2.setXP(0);
    creature3.setXP(0);
   
    creature.setPosition(15,28);
    creature1.setPosition(29,15);
    creature2.setPosition(1,15);
    creature3.setPosition(14,2);

    creature.setDirection(Direction.UP);
    creature1.setDirection(Direction.LEFT);
    creature2.setDirection(Direction.RIGHT);

    zone.add(creature);
    zone.add(creature1);
    zone.add(creature2);
    zone.add(creature3);
  }
}
TOP

Related Classes of games.stendhal.server.maps.semos.wizardstower.SixthFloorCreatures

TOP
Copyright © 2018 www.massapi.com. 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.