Package games.stendhal.server.entity.item

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


  public String respondToLastItemBrought() {
    return "These toys will keep me happy for ages! Please take these pies. Arlindo baked them for us but I think you should have them.";
  }

  public void rewardPlayer(final Player player) {
    final StackableItem pie = (StackableItem) SingletonRepository.getEntityManager().getItem(
        "pie");
    pie.setQuantity(3);
    player.equipOrPutOnGround(pie);
    player.addXP(100);
    player.addKarma(10.0);
  }
View Full Code Here


              rewardClass = "cod";
            } else {
              rewardClass = "perch";
            }
            npc.say("Thank you! Here, take some " + rewardClass + "! I do not like to eat them.");
            final StackableItem reward = (StackableItem) SingletonRepository.getEntityManager().getItem(rewardClass);
            reward.setQuantity(20);
            player.equipOrPutOnGround(reward);
            player.notifyWorldAboutChanges();
          }
        });
   
View Full Code Here

                    data.flavor, data.tip));
              } else {
                npc.say(String.format(data.messageOnHotPizza,
                    data.tip));
              }
              final StackableItem money = (StackableItem) SingletonRepository.getEntityManager()
                  .getItem("money");
              money.setQuantity(data.tip);
              player.equipOrPutOnGround(money);
              player.addXP(data.xp);
            }
            player.setQuest(QUEST_SLOT, "done");
            putOffUniform(player);
View Full Code Here

          if(quantity==0) {
            mayor.say("You didn't kill any rats which invaded the city, so you don't deserve a reward.");
            return;
          }
          player.addKarma(5);
          final StackableItem moneys = (StackableItem) SingletonRepository.getEntityManager()
                .getItem("money");
          moneys.setQuantity(quantity);
          player.equipOrPutOnGround(moneys);
          mayor.say("Please take "+quantity+" money, thank you very much for your help.");
          player.setQuest(QUEST_SLOT, "done");
      }
View Full Code Here

    actions.add(new IncreaseXPDependentOnLevelAction(5.0/3.0, 290.0));
    actions.add(new IncreaseKarmaAction(10.0));
    actions.add(new ChatAction() {
      public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
        int goldamount;
        final StackableItem money = (StackableItem) SingletonRepository.getEntityManager()
                .getItem("money");
        goldamount = 100 * Rand.roll1D6();
        money.setQuantity(goldamount);
        player.equipOrPutOnGround(money);
        raiser.say("Wonderful! Here is " + Integer.toString(goldamount) + " money to cover your expenses.");
      }
    });
   
View Full Code Here

      final int id = Integer.parseInt(claimedHouse);
      final HousePortal portal = HouseUtilities.getHousePortal(id);
     
      final int refund = (cost * depreciationPercentage) / 100 - houseTax.getTaxDebt(portal);

      final StackableItem money = (StackableItem) SingletonRepository.getEntityManager().getItem("money");
      money.setQuantity(refund);
      player.equipOrPutOnGround(money);
 
      portal.changeLock();
      portal.setOwner("");
      // the player has sold the house. clear the slot
View Full Code Here

    final SpeakerNPC npc = npcs.get("Jef");

    ChatAction addRandomNumberOfItemsAction = new ChatAction() {
      public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
        //add random number of red lionfish
        final StackableItem red_lionfish = (StackableItem) SingletonRepository.getEntityManager()
            .getItem("red lionfish");
        int redlionfishamount;
        redlionfishamount = Rand.roll1D6();
        red_lionfish.setQuantity(redlionfishamount);
        player.equipOrPutOnGround(red_lionfish);
        npc.say("Thank you! Take " + Grammar.thisthese(redlionfishamount) + " " +  Grammar.quantityplnoun(redlionfishamount,"red lionfish","") + "! I got some from a guy who visited Amazon island some time ago, maybe you need " + Grammar.itthem(redlionfishamount) + " for something.");

      }
    };
View Full Code Here

            null);

        // create the ChatAction to reward the player
        ChatAction addRewardAction = new ChatAction() {
            public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
                final StackableItem
                    koboldish_torcibud_vsop = (StackableItem)
                        SingletonRepository
                            .getEntityManager().getItem("vsop koboldish torcibud");
                final int torcibud_bottles = 1 + Rand.roll1D6();
                koboldish_torcibud_vsop.setQuantity(torcibud_bottles);
                koboldish_torcibud_vsop.setBoundTo(player.getName());
                // vsop torcibud will heal up to 75% of the player's base HP he has when getting rewarded
                // all vsop koboldish torcibud is persistent (set in the xml for this item) so this value will last
                koboldish_torcibud_vsop.put("amount", player.getBaseHP()*75/100);

                //player.equipOrPutOnGround(koboldish_torcibud_vsop);
                //put the rewarded bottles on the counter
                final IRPZone zone = SingletonRepository.getRPWorld().getZone("int_wofol_bar");
                koboldish_torcibud_vsop.setPosition(3, 3);
                zone.add(koboldish_torcibud_vsop);

                npc.say(
                    "Wrof! Here take "
                    + Integer.toString(torcibud_bottles)
View Full Code Here

   *            The multiplier. 1 for draw, 2 for win, 3 for win with
   *            blackjack.
   * @return A message that the NPC should say to inform the player.
   */
  private String payOff(final RPEntity rpEntity, final int factor) {
    final StackableItem money = (StackableItem) SingletonRepository.getEntityManager().getItem("money");
    money.setQuantity(factor * stake);
    rpEntity.equipOrPutOnGround(money);
    if (factor == 1) {
      return "You get your stake back.";
    } else {
      return "Here's your stake, plus " + (factor - 1) * stake
 
View Full Code Here

  private void bringFlowerStep() {
    final SpeakerNPC npc = npcs.get("Tywysoga");
    ChatAction addRandomNumberOfItemsAction = new ChatAction() {
      public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
        //add random number of goldbars
        final StackableItem goldbars = (StackableItem) SingletonRepository.getEntityManager()
            .getItem("gold bar");
        int goldamount;
        goldamount = 5 * Rand.roll1D6();
        goldbars.setQuantity(goldamount);
        // goldbars.setBoundTo(player.getName()); <- not sure
        // if these should get bound or not.
        player.equipOrPutOnGround(goldbars);
        npc.say("Thank you! Take these " + Integer.toString(goldamount) + " gold bars, I have plenty. And, listen: If you'd ever like to get me another, be sure to ask me first. Rose Leigh is superstitious, she won't give the bloom unless she senses you need it.");
      }
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.