Package games.stendhal.server.entity.item

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


              npc.say("I'm still working on your request to "
                  + getProductionActivity() + " " + getProductName()
                  + " for you. Please return in "
                  + getApproximateRemainingTime(player) + " to get it. Don't forget to #remind me again ... ");
            } else {
              final StackableItem products = (StackableItem) SingletonRepository.getEntityManager().getItem(getProductName());

              products.setQuantity(numberOfProductItems);

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

              player.equipOrPutOnGround(products);
              npc.say("I'm done! Here you have "
                  + Grammar.quantityplnoun(numberOfProductItems,
View Full Code Here


        }

        if (dropped.min == dropped.max) {
          list.add(item);
        } else {
          final StackableItem stackItem = (StackableItem) item;
          stackItem.setQuantity(Rand.rand(dropped.max - dropped.min)
              + dropped.min);
          list.add(stackItem);
        }
      }
    }
View Full Code Here

              npc.say("I'm still working on your request to "
                  + getProductionActivity() + " " + getProductName()
                  + " for you. Please return in "
                  + getApproximateRemainingTime(player) + " to get it. Don't forget to #remind me again ... ");
            } else {
              final StackableItem products = (StackableItem) SingletonRepository.getEntityManager().getItem(getProductName());

              products.setQuantity(numberOfProductItems);

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

              player.equipOrPutOnGround(products);
              npc.say("I'm done! Here you have "
                  + Grammar.quantityplnoun(numberOfProductItems,
View Full Code Here

    assertEquals(
        "Okay. You can find wood in the forest north of here. Come back when you get ten pieces of wood!",
        getReply(npc));
    assertTrue(en.step(player, "bye"));
    assertEquals("Bye.", getReply(npc));
    final StackableItem wood = new StackableItem("wood", "", "", null);
    wood.setQuantity(10);
    wood.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(wood);
    assertEquals(10, player.getNumberOfEquipped("wood"));
    assertTrue(en.step(player, "hi"));
    assertEquals(
        "Hi again! You've got wood, I see; do you have those 10 pieces of wood I asked about earlier?",
View Full Code Here

            sb.append("\nSlot " + slot.getName() + ": \n");

            // list objects
            for (final RPObject object : slot) {
              if (object instanceof StackableItem) {
                final StackableItem item = (StackableItem) object;
                if ("cod".equals(item.getName()) && (item.getQuantity() > 300)) {
                  caught = true;
                } else if ("trout".equals(item.getName()) && (item.getQuantity() > 300)) {
                  caught = true;
                } else if ("mackerel".equals(item.getName()) && (item.getQuantity() > 300)) {
                                             caught = true;
                                        } else if ("perch".equals(item.getName()) && (item.getQuantity() > 300)) {
                                          caught = true;
                                        } else if ("roach".equals(item.getName()) && (item.getQuantity() > 300)) {
                                              caught = true;
                                        } else if ("surgeonfish".equals(item.getName()) && (item.getQuantity() > 300)) {
                                              caught = true;
                                        } else if ("clownfish".equals(item.getName()) && (item.getQuantity() > 300)) {
                                              caught = true;
                                        } else if ("char".equals(item.getName()) && (item.getQuantity() > 300)) {
                                              caught = true;
                                        }
              }
              sb.append("   " + object + "\n");
            }
View Full Code Here

      SingletonRepository.getTurnNotifier().notifyInSeconds(5, new ContMoveAndStrengthenPlayersTurnListener());
    }

    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

              npc.say("I'm still working on your request to "
                  + getProductionActivity() + " " + getProductName()
                  + " for you. Please return in "
                  + getApproximateRemainingTime(player) + " to get it. Don't forget to #remind me again ... ");
            } else {
              final StackableItem products = (StackableItem) SingletonRepository.getEntityManager().getItem(
                  getProductName());

              products.setQuantity(numberOfProductItems);

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

              player.equipOrPutOnGround(products);
              npc.say("I'm done! Here you have "
                  + Grammar.quantityplnoun(numberOfProductItems,
View Full Code Here

              npc.say("I'm still working on your request to "
                  + getProductionActivity() + " " + getProductName()
                  + " for you. Please return in "
                  + getApproximateRemainingTime(player) + " to get it. Don't forget to #remind me again ... ");
            } else {
              final StackableItem products = (StackableItem) SingletonRepository.getEntityManager().getItem(
                  getProductName());

              products.setQuantity(numberOfProductItems);

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

              player.equipOrPutOnGround(products);
              npc.say("I'm done! Here you have "
                  + Grammar.quantityplnoun(numberOfProductItems,
View Full Code Here

          // it should always be a stackable items as we checked for
          // ConsumableItem when accepting the bet. But just in case
          // something is changed in the future, we will check it
          // again:
          if (item instanceof StackableItem) {
            final StackableItem stackableItem = (StackableItem) item;
            // bet + win
            stackableItem.setQuantity(2 * betInfo.amount);
          }
          player.equipOrPutOnGround(item);
        }

      }
View Full Code Here

            sb.append("\nSlot " + slot.getName() + ": \n");

            // list objects
            for (final RPObject object : slot) {
              if (object instanceof StackableItem) {
                final StackableItem item = (StackableItem) object;
                if (!"money".equals(item.getName()) && (item.getQuantity() > 10000)) {
                  caught = true;
                }
                if ("money".equals(item.getName()) && (item.getQuantity() > 10000000)) {
                  caught = true;
                }
                if (!"money".equals(item.getName()) && (item.getQuantity() > 1000)) {
                  warn = true;
                }
                if ("money".equals(item.getName()) && (item.getQuantity() > 100000)) {
                  warn = true;
                }
              }
              sb.append("   " + object + "\n");
            }
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.