Package games.stendhal.server.entity.item

Examples of games.stendhal.server.entity.item.StackableItem


    assertThat("no zones loaded", getReply(seller), is("You do not have enough money to buy a house!"));
    assertThat(en.getCurrentState(), is(ATTENDING));
   
    en.setCurrentState(QUEST_OFFERED);
   
    StackableItem money = (StackableItem) SingletonRepository.getEntityManager().getItem("money");
    money.setQuantity(120000);
    george.equipToInventoryOnly(money);
    assertFalse(george.isEquipped("house key"));
    assertTrue(george.isEquipped("money", 120000));
    en.step(george, "51");
    assertThat(getReply(seller), containsString("Congratulations"));
View Full Code Here


              String partnerName;
              husband = player;
              partnerName = husband.getQuest(marriage.getSpouseQuestSlot());
              wife = SingletonRepository.getRuleProcessor().getPlayer(
                                                                                partnerName);
              final StackableItem invite1 = (StackableItem) SingletonRepository.getEntityManager().getItem(
                                                          "invitation scroll");
              invite1.setQuantity(1);
                            final StackableItem invite2 = (StackableItem) SingletonRepository.getEntityManager().getItem(
                                                                                                                  "invitation scroll");
                            invite2.setQuantity(1);
                            //
              invite1.setInfoString("honeymoon," + partnerName);
              invite2.setInfoString("honeymoon," + husband.getTitle());
              if (wife.equipToInventoryOnly(invite1) &&  husband.equipToInventoryOnly(invite2)) {
                npc.say("Great choice! I will arrange that now.");
                husband.setQuest(marriage.getQuestSlot(), "done");
                wife.setQuest(marriage.getQuestSlot(), "done");
                wife.teleport(zone, 5, 5, Direction.DOWN, player);
View Full Code Here

            final long timeNow = new Date().getTime();
            if (timeNow - orderTime < getProductionTime(numberOfProductItems) * 1000) {
              npc.say("Hello again! Oops, I still don't have your scrolls! Come back in "
                  + getApproximateRemainingTime(player) + " to get them.");
            } else {
                        final StackableItem products = (StackableItem) SingletonRepository.getEntityManager().getItem(
                                        getProductName());

                        products.setQuantity(numberOfProductItems);

                        if (isProductBound()) {
              products.setBoundTo(player.getName());
                        }

                        player.equipOrPutOnGround(products);
                        npc.say("Welcome back! I've put my lunch inside ready to eat later. In exchange here you have "
                + Grammar.quantityplnoun(numberOfProductItems,
View Full Code Here

    nun.setCurrentState(ConversationStates.QUESTION_2);
    nun.setAttending(bride);
  }

  private void giveInvite(final Player player) {
    final StackableItem invite = (StackableItem) SingletonRepository.getEntityManager().getItem(
        "invitation scroll");
    invite.setQuantity(4);
    // location of church
    invite.setInfoString("marriage," + player.getName());

    // perhaps change this to a hotel room where they can get dressed into
    // wedding outfits?
    // then they walk to the church?
    player.equipOrPutOnGround(invite);
View Full Code Here

          int y = Rand.rand(zone.getHeight() - 5) + 2;
          player.teleport(zone, x, y, Direction.DOWN, admin);
        }

        private void equipPlayer(Player player) {
          StackableItem money = (StackableItem) SingletonRepository.getEntityManager().getItem("money");
          money.setQuantity(5000);
          player.equipToInventoryOnly(money);
          StackableItem potions = (StackableItem) SingletonRepository.getEntityManager().getItem("greater potion");
          potions.setQuantity(5000);
          player.equipToInventoryOnly(potions);
          if(!player.isEquipped("chaos dagger")) {
            Item first = (Item) player.getSlot("rhand").getFirst();
            player.drop(first);
            Item dagger = SingletonRepository.getEntityManager().getItem("chaos dagger");
View Full Code Here

      // Give 5000 of each stack in list, regardless of how many are
      // already there
      for (final String itemName : itemsStack) {
        final Item item = sandbox.getItem(itemName);
        if (item instanceof StackableItem) {
          final StackableItem stackableItem = (StackableItem) item;
          stackableItem.setQuantity(5000);
          player.equipToInventoryOnly(stackableItem);
        }
      }
      // turn on their keyring for them
      player.setFeature("keyring", true);
View Full Code Here

   * @param player - player to be rewarded.
   * @param killed - number of killed creatures.
   */
  private void rewardPlayer(final Player player, int killed) {
    int karmabonus = 5*(2*killed/(killsnumber)-1);
    final StackableItem money = (StackableItem) SingletonRepository.getEntityManager()
      .getItem("money");
    money.setQuantity(50000);
    player.setQuest(QUEST_SLOT, "done;"+System.currentTimeMillis());
    player.equipOrPutOnGround(money);
    player.addKarma(karmabonus);
    player.addXP(500000);
  }
View Full Code Here

            final long timeNow = new Date().getTime();
            if (timeNow - orderTime < getProductionTime(numberOfProductItems) * 1000) {
              npc.say("Hello again! Oops, I still don't have your scrolls! Come back in "
                  + getApproximateRemainingTime(player) + " to get them.");
            } else {
                        final StackableItem products = (StackableItem) SingletonRepository.getEntityManager().getItem(
                                        getProductName());

                        products.setQuantity(numberOfProductItems);

                        if (isProductBound()) {
              products.setBoundTo(player.getName());
                        }

                        player.equipOrPutOnGround(products);
                        npc.say("Welcome back! I've put my lunch inside ready to eat later. In exchange here you have "
                + Grammar.quantityplnoun(numberOfProductItems,
View Full Code Here

  public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
    final Item item = SingletonRepository.getEntityManager().getItem(itemName);
    if (item != null) {
        if (item instanceof StackableItem) {
          final StackableItem stackableItem = (StackableItem) item;
          stackableItem.setQuantity(amount);
        }
        if (bind) {
          item.setBoundTo(player.getName());
        }
        player.equipOrPutOnGround(item);
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.item.StackableItem

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.