Examples of ItemCollection


Examples of games.stendhal.server.util.ItemCollection

      res.add("Vasi Elos asked me for help, but I'm not really interested to help the scientist.");
      return res;
    }
    res.add("Vasi Elos asked me bring gems, gold and mithril to make a present of jewelled legs for his honey, Vera.");
    if ((getConditionForBeingInCollectionPhase()).fire(player,null,null)) {
      final ItemCollection missingItems = new ItemCollection();
      missingItems.addFromQuestStateString(questState);
      res.add("The jewelled legs still need " + Grammar.enumerateCollection(missingItems.toStringList()) + ".");
      return res;
    }
    res.add("Vasi Elos needs a base to add those gems I brought, to. He asked for shadow legs.");
    if ("legs".equals(questState)) { 
      return res;
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

        ConversationStates.QUESTION_1,
        "Fine! So what did you bring with you?",
        null);
   
    //add transition for each item
    final ItemCollection items = new ItemCollection();
    items.addFromQuestStateString(NEEDED_ITEMS);
    for (final Map.Entry<String, Integer> item : items.entrySet()) {
      npc.add(ConversationStates.QUESTION_1, item.getKey(), null,
          ConversationStates.QUESTION_1, null,
          new CollectRequestedItemsAction(
              item.getKey(), QUEST_SLOT,
              "Good, do you have anything else?",
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

    res.add("Carmen asked me to fetch ingredients to help her continue to heal others.");
    final String questState = player.getQuest(QUEST_SLOT);
    if ("rejected".equals(questState)) {
      res.add("I don't want to help Carmen. I guess she'll find someone else to help her.");
    } else if (!"done".equals(questState)) {
      final ItemCollection missingItems = new ItemCollection();
      missingItems.addFromQuestStateString(questState);
      res.add("I still need to bring Carmen " + Grammar.enumerateCollection(missingItems.toStringList()) + ".");
    } else {
      res.add("I helped Carmen and she can now continue her healing work.");
    }
    return res;
  }
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

        new IncreaseKarmaAction(5),
        new EquipItemAction("minor potion", 5)
        );

    /* add triggers for the item names */
    final ItemCollection items = new ItemCollection();
    items.addFromQuestStateString(NEEDED_ITEMS);
    for (final Map.Entry<String, Integer> entry : items.entrySet()) {
      String itemName = entry.getKey();

      String singular = Grammar.singular(itemName);
      List<String> sl = new ArrayList<String>();
      sl.add(itemName);
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

                }
                final long timeRemaining = (timestamp - System.currentTimeMillis());
                res.add("Her stock of supplies will be fine for " + TimeUtil.approxTimeUntil((int) (timeRemaining / 1000L)) + ".");
            }
        } else {
            final ItemCollection missingItems = new ItemCollection();
            /**
             * NOTE:
             * The quest is running,
             * QUEST_SLOT sub slot 0 holds a semicolon separated list of key=value token pairs.
             * Do not use player.getQuest(QUEST_SLOT, 0) as that would only retrieve the first token pair.
             */
            missingItems.addFromQuestStateString(player.getQuest(QUEST_SLOT));
            res.add("I'm helping her replenish her stock of supplies for preparing her Koboldish Torcibud."
                + " I still have to bring her " + Grammar.enumerateCollection(missingItems.toStringList()));
        }

        return res;
    }
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

            new SetQuestToFutureRandomTimeStampAction(QUEST_SLOT, 1, MIN_DELAY, MAX_DELAY),
            new IncreaseXPAction(XP_REWARD),
            addRewardAction);

        // add triggers for the item names
        final ItemCollection items = new ItemCollection();
        items.addFromQuestStateString(REQUIRED_ITEMS_TEMPLATE);
        for (final Map.Entry<String, Integer> item : items.entrySet()) {
            npc.add(ConversationStates.QUESTION_1,
                item.getKey(), null,
                ConversationStates.QUESTION_1, null,
                new CollectRequestedItemsAction(
                    item.getKey(),
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

                      new SayTextAction("You have served me well, my crown will be the mightiest of them all!"
                      + " Go to see "+ REWARD_NPC_NAME+ " in the Wizard City to get your #reward."),
                      new IncreaseXPAction(XP_REWARD)
                      );
    /* add triggers for the item names */
    final ItemCollection items = new ItemCollection();
    items.addFromQuestStateString(NEEDED_ITEMS);
    for (final Map.Entry<String, Integer> item : items.entrySet()) {
      npc.add(ConversationStates.QUESTION_1, item.getKey(), null,
          ConversationStates.QUESTION_1, null,
          new CollectRequestedItemsAction(
              item.getKey(), QUEST_SLOT,
              "Good, do you have anything else?", "You have already brought that!",
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

    res.add(NPC_NAME + " asked me to help him dethrone King Cozart. To be a King he needs a crown.");
    final String questState = player.getQuest(QUEST_SLOT);
    if ("rejected".equals(questState)) {
      res.add("I think getting involved in these politics is a bad idea.");
    } else if (!"done".equals(questState) && !"reward".equals(questState)) {
      final ItemCollection missingItems = new ItemCollection();
      missingItems.addFromQuestStateString(questState);
      res.add(Grammar.enumerateCollection(missingItems.toStringList()) + " are still needed for the crown.");
    } else if ("reward".equals(questState)) { 
      res.add("I got the precious gems to make a crown, and " + REWARD_NPC_NAME + " has been instructed to give me my reward.");
    } else {
      res.add("I got the precious gems to make a crown, and " + REWARD_NPC_NAME + " rewarded me with a boost to my powers.");
    }
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

    res.add("I met Ortiv Milquetoast, a retired teacher in his house at Kirdneh River and asked him for a quest.");
    final String questState = player.getQuest(QUEST_SLOT);
    if ("rejected".equals(questState)) {
      res.add("I don't want to help Ortiv at the moment. He should go out and take the ingredients by himself.");
    } else if (!"done".equals(questState)) {
      final ItemCollection missingItems = new ItemCollection();
      missingItems.addFromQuestStateString(questState);
      res.add("I still need to bring Ortiv " + Grammar.enumerateCollection(missingItems.toStringList()) + ".");
    } else {
      res.add("I helped Ortiv. Now he can sleep safe again in his bed. He rewarded me with some XP and an assassin dagger for my use.");
    }
    return res;
  }
View Full Code Here

Examples of games.stendhal.server.util.ItemCollection

        new IncreaseXPAction(5000),
        new IncreaseKarmaAction(25),
        new EquipItemAction("assassin dagger", 1 ,true)
        );
    /* add triggers for the item names */
    final ItemCollection items = new ItemCollection();
    items.addFromQuestStateString(NEEDED_ITEMS);
    for (final Map.Entry<String, Integer> item : items.entrySet()) {
      npc.add(ConversationStates.QUESTION_2, item.getKey(), null,
          ConversationStates.QUESTION_2, null,
          new CollectRequestedItemsAction(
              item.getKey(), QUEST_SLOT,
              "Wonderful! Did you bring anything else with you?", "You brought me that ingredient already.",
View Full Code Here
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.