Examples of OrCondition


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

        // the answer given by the NPC does not contain any trigger words on pourpose
        // as it should only hint what's kind of things are needed.
        // some details about the required items are given only once the quest has been accepted.
        npc.add(ConversationStates.QUEST_OFFERED,
            Arrays.asList("stuff","ingredients","supplies"),
            new OrCondition(
                new QuestNotStartedCondition(QUEST_SLOT),
                new QuestInStateCondition(QUEST_SLOT, "rejected")),
            ConversationStates.QUEST_OFFERED,
            "Wrof! Some bottles, artichokes, a few herbs and fierywater... Things like that. So, will you help?",
            null);
View Full Code Here

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

     * reward
     */
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new OrCondition(
                new QuestCompletedCondition(QUEST_SLOT),
                new QuestInStateCondition(QUEST_SLOT, "reward"))),
        ConversationStates.IDLE,
        "My new crown will be ready soon and I will dethrone the king! Mwahahaha!",
        null);
View Full Code Here

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

    // player asking for quest when he have active non-expired quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new NotCondition(
                new OrCondition(
                    new QuestNotStartedCondition(QUEST_SLOT),
                    new QuestCompletedCondition(QUEST_SLOT))),
            new NotCondition(
                new TimePassedCondition(QUEST_SLOT, 1, expireDelay))),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(Player player, Sentence sentence, EventRaiser npc) {
            npc.say("You're already on a quest to slay " +
                Grammar.a_noun(player.getQuest(QUEST_SLOT,0).split(",")[0]) +
                ". Say #complete if you're done with it!");
          }     
        });
   
    // player have expired quest time
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new NotCondition(
                new OrCondition(
                    new QuestNotStartedCondition(QUEST_SLOT),
                    new QuestCompletedCondition(QUEST_SLOT))),
            new TimePassedCondition(QUEST_SLOT, 1, expireDelay)),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(Player player, Sentence sentence, EventRaiser npc) {
            if(player.getQuest(QUEST_SLOT, 0)!=null) {
                npc.say("You're already on a quest to slay " +
                    Grammar.a_noun(player.getQuest(QUEST_SLOT, 0).split(",")[0]) +
                    ". Say #complete if you're done with it!" +
                    " If you can't find one, perhaps it won't bother Semos either. You could kill #another creature if you like.");
            }
          }
        });
   
    // player asking for quest before allowed time interval
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(
                new TimePassedCondition(QUEST_SLOT, 1, delay))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT,1, delay, "I can only give you a new quest once a day. Please check back in"));

    // player asked for quest first time or repeat it after passed proper time
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(
            new QuestNotStartedCondition(QUEST_SLOT),
            new AndCondition(
                new QuestCompletedCondition(QUEST_SLOT),
                new TimePassedCondition(QUEST_SLOT, 1, delay))),
        ConversationStates.ATTENDING,
View Full Code Here

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

   */
  private void step_4() {
    // player have no active quest and trying to get another
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new OrCondition(
            new QuestNotStartedCondition(QUEST_SLOT),
            new QuestCompletedCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "I'm afraid I didn't send you on a #quest yet.",
        null);
View Full Code Here

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

        null
    );

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new OrCondition(new QuestNotCompletedCondition(QUEST_SLOT),
                new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT, 1, DELAY))
            )),
        ConversationStates.IDLE, "Sorry, can't stop to chat. The animals are all sick because they don't have enough food. See yourself out, won't you?",
        null
    );
View Full Code Here

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

        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(
            new GreetingMatchesNameCondition(npc.getName()),
            new NotCondition(
                new SystemPropertyCondition("stendhal.minetown")),
            new OrCondition(
                new PlayerIsWearingOutfitCondition(balloonList[0]),
                new PlayerIsWearingOutfitCondition(balloonList[1]),
                new PlayerIsWearingOutfitCondition(balloonList[2]),
                new PlayerIsWearingOutfitCondition(balloonList[3]))),
        ConversationStates.QUEST_ITEM_QUESTION,
View Full Code Here

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

        ConversationStates.ATTENDING,
        "balloon",
        new AndCondition(
            new NotCondition(
                new SystemPropertyCondition("stendhal.minetown")),
            new OrCondition(
                new PlayerIsWearingOutfitCondition(balloonList[0]),
                new PlayerIsWearingOutfitCondition(balloonList[1]),
                new PlayerIsWearingOutfitCondition(balloonList[2]),
                new PlayerIsWearingOutfitCondition(balloonList[3]))),
        ConversationStates.QUEST_ITEM_QUESTION,
        "Is that balloon for me?",
        null);

    npc.add(
        ConversationStates.ATTENDING,
        "balloon",
        new AndCondition(
            new NotCondition(
                new SystemPropertyCondition("stendhal.minetown")),
            new NotCondition(
                new OrCondition(
                    new PlayerIsWearingOutfitCondition(balloonList[0]),
                    new PlayerIsWearingOutfitCondition(balloonList[1]),
                    new PlayerIsWearingOutfitCondition(balloonList[2]),
                    new PlayerIsWearingOutfitCondition(balloonList[3])))),
        ConversationStates.ATTENDING,
View Full Code Here

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

  private void askingStep() {
    final SpeakerNPC npc = npcs.get("Agnus");

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(new QuestNotStartedCondition(QUEST_SLOT), new QuestInStateCondition(QUEST_SLOT, "rejected")),
        ConversationStates.QUEST_OFFERED,
        "I feel so worried. If I only knew my #children were safe I would feel better.",
        null);

    npc.add(
View Full Code Here

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

      "What did you do with the love potion?",
      null);
   
    npc.add(ConversationStates.ATTENDING,
        questTrigger,
        new OrCondition(new QuestInStateCondition(QUEST_SLOT, "start"),
                new QuestInStateCondition(QUEST_SLOT, "pies"),
                new QuestInStateCondition(QUEST_SLOT, "knife")),
        ConversationStates.ATTENDING,
        "I am waiting for you to return with a love potion. Please ask Salva Mattori in the magic city about: #potion.",
        null);
View Full Code Here

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

       
        // hasn't got access to all banks yet
        add(ConversationStates.IDLE,
            ConversationPhrases.GREETING_MESSAGES,
            new AndCondition(new GreetingMatchesNameCondition(super.getName()),
              new OrCondition(
                  new QuestNotCompletedCondition(GRAFINDLE_QUEST_SLOT),
                  new QuestNotCompletedCondition(ZARA_QUEST_SLOT))),
            ConversationStates.IDLE,
            "You may not use this bank if you have not gained the right to use the chests at Nalwor, nor if you have not earned the trust of a certain young woman. Goodbye!",
            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.