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

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


    npc.add(
        ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "Do you think you could find my children again?",
        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Why must my children stay out so long? Please find them and tell me who is ok.",
        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        "Thank you! I feel better now knowing my kids are safe.",
        null);

    npc.add(ConversationStates.QUEST_OFFERED,
View Full Code Here


 
      npc.add(
      ConversationStates.ATTENDING, questTrigger,
      new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "reward"),
               // delay is in minutes, last parameter is argument of timestamp
               new NotCondition(new TimePassedCondition(QUEST_SLOT,1,DELAY_IN_MINUTES))),
      ConversationStates.ATTENDING,
      null,
      new SayTimeRemainingAction(QUEST_SLOT,1,DELAY_IN_MINUTES,"Hello I am still busy with that baby dragon stew for Mr Yeti. You can get your reward in"));


    npc.add(
      ConversationStates.ATTENDING, questTrigger,
      new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "reward"),
               // delay is in minutes, last parameter is argument of timestamp
               new TimePassedCondition(QUEST_SLOT,1,DELAY_IN_MINUTES)),
      ConversationStates.ATTENDING,
      "Thank you! To say thank you, I'd like to offer you the chance to always #buy #roach from me cheaply. I have so much of it and perhaps you have a use for it.",
      new MultipleActions(new SetQuestAction(QUEST_SLOT,"done"), new IncreaseXPAction(1000)));

  }
View Full Code Here

      if ("dragon".equals(questState)) {
        return res;
      }
      res.add("Oh my! She killed my dragon to make stew! That wasn't the kind of treat I thought she had in mind!");
      if (questState.startsWith("reward")) {
        if (new TimePassedCondition(QUEST_SLOT,1,DELAY_IN_MINUTES).fire(player, null, null)) {
          res.add("Mrs. Yeti told me to come back in a day to collect my reward and it's already been long enough.");
        } else {
          res.add("Mrs. Yeti told me to come back in a day to collect my reward so I need to wait.");
        }
        return res;
View Full Code Here

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestStartedCondition(QUEST_SLOT),
          new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
      ConversationStates.QUEST_OFFERED,
      "Oi, you. Back for more rainbow beans?", null);

    // player returns after finishing the quest (it is repeatable) before
    // the time as finished
    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestStartedCondition(QUEST_SLOT),
          new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
      ConversationStates.ATTENDING,
      null,
      new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "Alright? I hope you don't want more beans. You can't take more of that stuff for at least another"));

    // player responds to word 'deal' - enough level
View Full Code Here

        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"killed"),
             new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "Those pesky gnomes are stealing carrots again. I think they need another lesson. Will you help?",
        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"killed"),
             new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES))),
        ConversationStates.ATTENDING,
        "The gnomes haven't made any trouble since you last taught them a lesson.",
        null);

    final Map<String, Pair<Integer, Integer>> toKill = new TreeMap<String, Pair<Integer, Integer>>();
View Full Code Here

  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"killed"),
         new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES)).fire(player,null, null);
  }
View Full Code Here

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

  @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

        null);
   
    // player returns - enough time has passed
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestNotInStateCondition(QUEST_SLOT, "start"), new QuestStartedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT,REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "My Hughie is getting sick again! Please could you bring another bowl of fish soup? It helped last time.",
        null);

    // player returns - not enough time has passed
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestNotInStateCondition(QUEST_SLOT, "start"), new QuestStartedCondition(QUEST_SLOT), new NotCondition(new TimePassedCondition(QUEST_SLOT,REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        "Hughie is sleeping off his fever now and I'm hopeful he recovers. Thank you so much.",
        null);
   
    // player is willing to help
View Full Code Here

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestCompletedCondition(QUEST_SLOT),
          new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
      ConversationStates.QUEST_OFFERED,
      "Hello again. Have you returned for more of my special fish soup?",
      null);

    // player returns after finishing the quest (it is repeatable) before
    // the time as finished
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES , "Oh I am sorry, I have to wash my cooking pots first before making more soup for you. Please come back in")
      );
View Full Code Here

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

TOP

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

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.