Package games.stendhal.server.entity.npc.condition

Examples of games.stendhal.server.entity.npc.condition.QuestActiveCondition



    // player returns when the quest is in progress and says offer
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.OFFER_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I don't think I trust you well enough yet ... ", null);
  }
View Full Code Here


        null)
   
    // player should be bringing chocolate not asking about the quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "eating;"))),
        ConversationStates.ATTENDING, 
        "Waaaaaaaa! Where is my chocolate ...",
        null);
   
    // Player agrees to get the chocolate
View Full Code Here

        + "Please can you bring me the magic #'suntan cream' that the #lifeguards produce?",
        null);
   
    zara.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Did you forget that you promised me to ask the #lifeguards for #'suntan cream'?",
        null);
   
    zara.add(ConversationStates.ATTENDING,
View Full Code Here

  private void step_1() {
    final SpeakerNPC npc = npcs.get("Maerion");

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I already asked you to kill every dark elf in the tunnel below the secret room. And bring me the amulet from the thing.",
        null);

   
View Full Code Here

        null);
   
    // any other state than above
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "food_brought")),
        ConversationStates.ATTENDING,
        "I'm sure I asked you to do something for me, already.",
        null);
           
View Full Code Here

      null);
   
    // Player asks about quests, but has not finished this quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Why are you bothering me when you haven't completed your quest yet?",
        null);

    final List<ChatAction> gobletactions = new LinkedList<ChatAction>();
View Full Code Here

        null)
   
    // player should be bringing ice cream not asking about the quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "eating;"))),
        ConversationStates.ATTENDING, 
        "Waaaaaaaa! Where is my ice cream ....",
        null);
   
    // Player agrees to get the ice cream
View Full Code Here

                            new QuestCompletedCondition("plinks_toy"),
                            // Anna, in Ados
                            new QuestCompletedCondition("toys_collector"),
                            // Sally, Orril River
                            // 'completed' doesn't work for Sally - return player.hasQuest(QUEST_SLOT) && !"start".equals(player.getQuest(QUEST_SLOT)) && !"rejected".equals(player.getQuest(QUEST_SLOT));
                            new AndCondition(new QuestActiveCondition("campfire"), new QuestNotInStateCondition("campfire", "start")),
                            // Annie, Kalavan city gardens
                            new QuestStateStartsWithCondition("icecream_for_annie","eating;"),
                            // Elisabeth, Kirdneh
                            new QuestStateStartsWithCondition("chocolate_for_elisabeth","eating;"),
                            // Jef, Kirdneh
                            new QuestCompletedCondition("find_jefs_mom"),
                            // Hughie, Ados farmhouse
                            new AndCondition(new QuestActiveCondition("fishsoup_for_hughie"), new QuestNotInStateCondition("fishsoup_for_hughie", "start")))));

    // quests about finding people
    achievements.add(createAchievement("friend.quests.find", "Private Detective", "Find all lost and hidden people",
                        Achievement.HARD_BASE_SCORE, true,
                        new AndCondition(
View Full Code Here

   * Creates a condition for quest being active and in item collection phase
   * @return the condition
   */
  private AndCondition getConditionForBeingInCollectionPhase() {
    return new AndCondition(
                          new QuestActiveCondition(QUEST_SLOT),
                          new NotCondition(
                              new QuestStateStartsWithCondition(QUEST_SLOT,"making;")
                                  ),
                          new NotCondition(
                              new QuestStateStartsWithCondition(QUEST_SLOT,"decorating;")
View Full Code Here

  private void prepareBringingStep() {
    final SpeakerNPC npc = npcs.get("Carmen");
 
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestActiveCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "Hi again. I can #heal you, or if you brought me #ingredients I'll happily take those!",
        null);

    /* player asks what exactly is missing (says ingredients) */
    npc.add(ConversationStates.ATTENDING, "ingredients", null,
        ConversationStates.QUESTION_2, null,
        new SayRequiredItemsFromCollectionAction(QUEST_SLOT, "I need [items]. Did you bring something?"));
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
      ConversationStates.QUESTION_2,
      null, new SayRequiredItemsFromCollectionAction(QUEST_SLOT, "I need [items]. Did you bring something?"));

    /* player says he has a required item with him (says yes) */
    npc.add(ConversationStates.QUESTION_2,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.QUESTION_2, "Great, what did you bring?",
        null);

    ChatAction completeAction = new  MultipleActions(
        new SetQuestAction(QUEST_SLOT, "done"),
        new SayTextAction("Great! Now I can heal many people for free. Thanks a lot. Take this for your work."),
        new IncreaseXPAction(50),
        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);

      // handle the porcino/porcini singular/plural case with item name "porcini"
      if (!singular.equals(itemName)) {
        sl.add(singular);
      }
      // also allow to understand the misspelled "porcinis"
      if (itemName.equals("porcini")) {
        sl.add("porcinis");
      }

      npc.add(ConversationStates.QUESTION_2, sl, null,
          ConversationStates.QUESTION_2, null,
          new CollectRequestedItemsAction(
              itemName, QUEST_SLOT,
              "Good, do you have anything else?", "You have already brought " +
                Grammar.quantityplnoun(entry.getValue(), itemName) + " for me but thank you anyway.",
              completeAction, ConversationStates.ATTENDING));
    }

    /* player says he didn't bring any items (says no) */
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.NO_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Ok, well just let me know if I can #help you with anything else.",
        null);

    /* player says he didn't bring any items to different question */
    npc.add(ConversationStates.QUESTION_2,
        ConversationPhrases.NO_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Ok, well just let me know if I can #help you with anything else.", null);

    /* says quest and quest can't be started nor is active*/
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.condition.QuestActiveCondition

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.