Examples of QuestNotInStateCondition


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

        && !player.getQuest(QUEST_SLOT).equals("rejected");
  }

  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestNotInStateCondition(QUEST_SLOT, "start"), new QuestStartedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT,REQUIRED_MINUTES)).fire(player, null, null);
  }
View Full Code Here

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

    // says hi - quest was done before and is now repeatable
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "start"),
            new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES)),
        ConversationStates.ATTENDING,
        "Greetings again! Have you seen my latest snow sculptures? I need a #favor again ...",
        null);
   
    // says hi - quest was done before and is not yet repeatable
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, REQUIRED_MINUTES, "I have enough snow for my new sculpture. Thank you for helping! "
            + "I might start a new one in" ));

    // asks about quest - has never started it
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED,
        "I like to make snow sculptures, but the snow in this cavern is not good enough. Would you help me and get some snowballs? I need twenty five of them.",
        null);
   
    // asks about quest but already on it
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "start"),
        ConversationStates.ATTENDING,
        "You already promised me to bring some snowballs! Twenty five pieces, remember ...",
        null);
   
    // asks about quest - has done it but it's repeatable now
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStartedCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "start"), new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "I like to make snow sculptures, but the snow in this cavern is not good enough. Would you help me and get some snowballs? I need twenty five of them.",
        null);
   
    // asks about quest - has done it and it's too soon to do again
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStartedCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "start"), new NotCondition(new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        "I have enough snow to finish my sculpture, but thanks for asking.",
        null);

    // player is willing to help
View Full Code Here

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

        // don't give the flower if the quest state isn't start
        // unless it's been over 12 weeks and are in state got_flower?
      rose.add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
                   new QuestNotInStateCondition(QUEST_SLOT, 0, "start"),
                   new NotCondition(lostFlowerCondition)),
          ConversationStates.IDLE,
          "I've got nothing for you today, sorry dearie. I'll be on my way now, bye.",
          null);
  }
View Full Code Here

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

        null);
   
    npc.add(
        ConversationStates.ATTENDING,
        Arrays.asList("coal","stone coal"),
        new QuestNotInStateCondition(QUEST_SLOT,"start"),
        ConversationStates.ATTENDING,
        "Sometime you could do me a #favour ...", null);
  }
View Full Code Here

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

        "Oh, I wanted to give you a flower for my son to show him that I'm fine, but as I see now, you don't have enough space for equipping it. Please return to me when you will have made some space in your bags!",
        null);

        // don't give the flower if the quest state isn't start
      amber.add(ConversationStates.ATTENDING, "Jef",
           new AndCondition(new QuestNotInStateCondition(QUEST_SLOT, 0, "start")),
          ConversationStates.IDLE,
          "I don't trust you. Your voice shivered while you told me my sons name. I bet he is fine and happy and safe.",
          null);

View Full Code Here

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

        // Player is not inclined to comply with the request and has not already rejected it once
        npc.add(ConversationStates.QUEST_OFFERED,
            ConversationPhrases.NO_MESSAGES,
            new AndCondition(
                new QuestNotActiveCondition(QUEST_SLOT),
                new QuestNotInStateCondition(QUEST_SLOT, "rejected")),
            ConversationStates.ATTENDING,
            "Wruff... I guess I will have to ask to someone with a better attitude!",
            new MultipleActions(
                new SetQuestAction(QUEST_SLOT, "rejected"),
                new DecreaseKarmaAction(20.0)));
View Full Code Here

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

    /* player returns while quest is still active */
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestActiveCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "reward")),
        ConversationStates.QUESTION_1,
        "Oh it's you again. Did you bring me any #items for my new crown?",
        null);

    /* player asks what exactly is missing (says items) */
    npc.add(ConversationStates.QUESTION_1, "items", null,
        ConversationStates.QUESTION_1, 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_1,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.QUESTION_1, "Fine, what did you bring?",
        null);

    ChatAction completeAction = new MultipleActions(
                      new SetQuestAction(QUEST_SLOT, "reward"),
                      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!",
              completeAction, ConversationStates.ATTENDING));
    }

    /* player says he didn't bring any items (says no) */
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.NO_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "reward")),
        ConversationStates.IDLE,
        "Well don't come back before you find something for me!", null);

    /* player says he didn't bring any items to different question */
    npc.add(ConversationStates.QUESTION_1, ConversationPhrases.NO_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT), new QuestNotInStateCondition(QUEST_SLOT, "reward")),
        ConversationStates.IDLE,
        "Farewell, come back after you have what I need!", null);


    /* player says reward */
 
View Full Code Here

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

    // player says he has a blue elf cloak with him but he needs to bring more than one still
    // could also have used GreaterThanCondition for Quest State but this is okay, note we can only get to question 1 if we were active
    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestNotInStateCondition(QUEST_SLOT, "1"), new PlayerHasItemWithHimCondition("blue elf cloak")),
        ConversationStates.QUESTION_1, null,
        new MultipleActions(
            new DropItemAction("blue elf cloak"),
            new ChatAction() {
              public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
View Full Code Here

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

        Arrays.asList("change", "change"), new QuestInStateCondition(
            "debuggera", "friends"), ConversationStates.ATTENDING,
        "I can teleport you.", null);
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("change", "change"),
        new QuestNotInStateCondition("debuggera", "friends"),
        ConversationStates.ATTENDING,
        "Do you want to become my #friend?", null);

    // friends
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("friend", "friends"), new QuestInStateCondition(
            "debuggera", "friends"), ConversationStates.ATTENDING,
        "We are friends.", null);
    npc.add(
        ConversationStates.ATTENDING,
        Arrays.asList("friend", "friends"),
        new QuestNotInStateCondition("debuggera", "friends"),
        ConversationStates.INFORMATION_1,
        "Please repeat:\r\n                        \"A circle is round,\"",
        null);
    npc.add(ConversationStates.INFORMATION_1, Arrays.asList(
        "A circle is round,", "A circle is round"), null,
View Full Code Here

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

      new MultipleActions(new IncreaseXPAction(500), new SetQuestAction(QUEST_SLOT, "done")));

    /** If you aren't in the condition to speak to him (not completed quest, or already spoke) the King will dismiss you */
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotInStateCondition(QUEST_SLOT, "recommended")),
      ConversationStates.IDLE,
      "Leave me! Can't you see I am trying to eat?",
      null);
  }
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.