Package games.stendhal.server.core.engine

Examples of games.stendhal.server.core.engine.StendhalRPWorld


   */
  @Test
  public void testReadZone() throws URISyntaxException, SAXException, IOException {
    ZonesXMLLoader loader = new ZonesXMLLoader(new URI("testsemos.xml"));
    loader.load();
    StendhalRPWorld world = SingletonRepository.getRPWorld();
    Collection<StendhalRPZone> regionKanmararn = world.getAllZonesFromRegion("kanmararn", Boolean.TRUE, Boolean.FALSE, Boolean.TRUE);
    assertThat(regionKanmararn.isEmpty(), is(Boolean.FALSE));
    assertThat(regionKanmararn.size(), is(3));
    Collection<StendhalRPZone> regionWofolExteriors = world.getAllZonesFromRegion("wofol city", Boolean.TRUE, Boolean.FALSE, Boolean.TRUE);
    assertThat(regionWofolExteriors.isEmpty(), is(Boolean.TRUE));
    Collection<StendhalRPZone> regionWofolInteriors = world.getAllZonesFromRegion("wofol city", Boolean.FALSE, Boolean.FALSE, Boolean.TRUE);
    assertThat(regionWofolInteriors.isEmpty(), is(Boolean.FALSE));
    assertThat(regionWofolInteriors.size(), is(19));
    Collection<StendhalRPZone> regionSemosInteriors = world.getAllZonesFromRegion("semos", Boolean.FALSE, Boolean.FALSE, Boolean.TRUE);
    IRPZone rpZone = world.getRPZone("int_semos_house");
    assertThat(regionSemosInteriors.contains(rpZone), is(Boolean.FALSE));
  }
View Full Code Here


  /**
   * Tests for magic.
   */
  @Test
  public final void testMagic() {
    final StendhalRPWorld world = MockStendlRPWorld.get();
    final StendhalRPZone zone = world.getZone(ZONE_NAME);

    final Player admin = PlayerTestHelper.createPlayer("admin");
    admin.setAdminLevel(400);
    PlayerTestHelper.registerPlayer(admin, zone);

View Full Code Here

  /**
   * Tests for buySheep.
   */
  @Test
  public void testBuySheep() {
    final StendhalRPWorld world = SingletonRepository.getRPWorld();
    registerPlayer(player, world.getZone(ZONE_NAME));

    final SpeakerNPC npc = getNPC("Nishiya");
    final Engine en = npc.getEngine();

    assertTrue(en.step(player, "hi"));
View Full Code Here

    }
  }

  @Override
  public void addToWorld() {
    final StendhalRPWorld world = SingletonRepository.getRPWorld();
    super.addToWorld();
    fillHistoryMap();
    fillQuestInfo(
        "Seven Cherubs",
        "Seven cherubs stay on this world, and finding them all is rewarded with a prize.",
        false);
    StendhalRPZone zone;
    SpeakerNPC npc;

    zone = world.getZone("0_semos_village_w");
    npc = new CherubNPC("Cherubiel", 32, 60);
    zone.add(npc);

    zone = world.getZone("0_nalwor_city");
    npc = new CherubNPC("Gabriel", 105, 17);
    zone.add(npc);

    zone = world.getZone("0_orril_river_s");
    npc = new CherubNPC("Ophaniel", 105, 79);
    zone.add(npc);

    zone = world.getZone("0_orril_river_s_w2");
    npc = new CherubNPC("Raphael", 95, 30);
    zone.add(npc);

    zone = world.getZone("0_orril_mountain_w2");
    npc = new CherubNPC("Uriel", 47, 27);
    zone.add(npc);

    zone = world.getZone("0_semos_mountain_n2_w2");
    npc = new CherubNPC("Zophiel", 16, 3);
    zone.add(npc);

    zone = world.getZone("0_ados_rock");
    npc = new CherubNPC("Azazel", 67, 24);
    zone.add(npc);
  }
View Full Code Here

  protected void doRegularBehaviour() {
    speakerNPC.say(repeatedText);
  }
 
  private void addHighProbability() {
    final StendhalRPWorld world = SingletonRepository.getRPWorld();
    for (int i = 0; i < 10; i++) {
      zones.add(world.getZone("0_semos_city"));
      zones.add(world.getZone("0_semos_village_w"));
      zones.add(world.getZone("0_semos_plains_n"));
      zones.add(world.getZone("0_semos_plains_ne"));
      zones.add(world.getZone("0_semos_road_e"));
      zones.add(world.getZone("0_semos_plains_s"));
    }
  }
View Full Code Here

  }

  void release(final Player inmate) {
    // Only teleport the player if he is still in jail.
    // It could be that an admin has teleported him out earlier.
    final StendhalRPWorld world = SingletonRepository.getRPWorld();
    if (isInJail(inmate)) {
      final IRPZone.ID zoneid = new IRPZone.ID("-3_semos_jail");
      if (!world.hasRPZone(zoneid)) {
        LOGGER.debug("Zone " + zoneid + " not found");
      }
      final StendhalRPZone exitZone = (StendhalRPZone) world.getRPZone(zoneid);

      inmate.teleport(exitZone, 6, 3, Direction.RIGHT, null);
      inmate.sendPrivateText("Your sentence is over. You can walk out now.");
      LOGGER.debug("Player " + inmate.getName() + "released from jail.");
    }
View Full Code Here

   */
  protected void growNewFruit() {
    if (!hasPickableFruit) {
      LOGGER.debug("Growing " + growingItemName);

      final StendhalRPWorld world = SingletonRepository.getRPWorld();
      final StendhalRPZone zone = world.getZone(getID().getZoneID());

      // create a new grown item
      final Item grownItem = SingletonRepository.getEntityManager().getItem(
          growingItemName);
      grownItem.setPlantGrower(this);
View Full Code Here

    NPCList.get().add(mayor);
    dmq = new DailyMonsterQuest();
 
    dmq.addToWorld();
    en = mayor.getEngine();
    final StendhalRPWorld world = MockStendlRPWorld.get()
    final StendhalRPZone zone = new StendhalRPZone("int_semos_guard_house");   
    world.addRPZone(zone);
  }
View Full Code Here

    final Map<String, String> attributes = new HashMap<String, String>();
    attributes.put("amount", "1000");
    attributes.put("regen", "200");
    attributes.put("frequency", "1");
    attributes.put("id", "1");
    final StendhalRPWorld world = SingletonRepository.getRPWorld();
    final StendhalRPZone zone = new StendhalRPZone("test");
    world.addRPZone(zone);
    final ConsumableItem c200_1 = new ConsumableItem("cheese", "", "", attributes);
    zone.add(c200_1);
    final Poisoner poisoner = new Poisoner();
    final Player bob = PlayerTestHelper.createPlayer("player");
    poisoner.feed(c200_1, bob);
View Full Code Here

  private final static StendhalRPZone basement = new StendhalRPZone("spiders_zone",100,100);
  private final static AbstractQuest quest = new KillSpiders();
 
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    final StendhalRPWorld world = MockStendlRPWorld.get();
    QuestHelper.setUpBeforeClass();
   
    final StendhalRPZone zone = new StendhalRPZone("int_semos_guard_house");
    new GroundskeeperNPC().configureZone(zone, null);     
 
    world.addRPZone(zone);
    world.addRPZone(basement);
    quest.addToWorld();
  }
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.engine.StendhalRPWorld

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.