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

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


 
  private void getQuest() {
    final SpeakerNPC npc = npcs.get("Hazel");
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                 new NotCondition(new TimePassedCondition(QUEST_SLOT,1,expireDelay))),
        ConversationStates.ATTENDING,
        null,
        new SayRequiredItemAction(QUEST_SLOT,0,"You're already on a quest to bring the museum [item]"
            + ". Please say #complete if you have it with you."));
   
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                 new TimePassedCondition(QUEST_SLOT,1,expireDelay)),
        ConversationStates.ATTENDING,
        null,
        new SayRequiredItemAction(QUEST_SLOT,0,"You're already on a quest to bring the museum [item]"
            + ". Please say #complete if you have it with you. But, perhaps that is now too rare an item. I can give you #another task, or you can return with what I first asked you."));
 
    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, "The museum can only afford to send you to fetch an item once a week. Please check back in"));
   
   
    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new StartRecordingRandomItemCollectionAction(QUEST_SLOT,0,items,"I want Kirdneh's museum to be the greatest in the land! Please fetch [item]"
        + " and say #complete, once you've brought it."))
    actions.add(new SetQuestToTimeStampAction(QUEST_SLOT, 1));
   
    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,
        null,
        startQuestAction());
  }
View Full Code Here


    final SpeakerNPC npc = npcs.get("Hazel");
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                  new TimePassedCondition(QUEST_SLOT,1,expireDelay)),
        ConversationStates.ATTENDING,
        null,
        startQuestAction());
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                  new NotCondition(new TimePassedCondition(QUEST_SLOT,1,expireDelay))),
        ConversationStates.ATTENDING,
        "It hasn't been long since you've started your quest, you shouldn't give up so soon.",
        null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

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

      null);

    // player asks about quest which he has done already and he is allowed to repeat it
        npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "done"), new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "It is a long time ago that you watched out for my mum. May I ask you to take a look at her again and tell me if she is still fine, please?",
        null);

    // player asks about quest but time didn't pass yet
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new NotCondition(new TimePassedCondition(QUEST_SLOT, 1,REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I don't want to disturb my mum at the moment, it seems like she needs some time on herself, so you don't have to look out for her currently. You can ask me again in"));

View Full Code Here


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

        "We just want to visit the first part of the dungeon, it seems to be very interesting. Some of these ugly things jump around there, even some mummies!",
        null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES)), new QuestStateStartsWithCondition(QUEST_SLOT, "killed")),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, WEEK_IN_MINUTES, "These #creatures didn't return so far and we could see some lovely places all over. Please return in"));
   
   
    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 #creatures returned after the last time you helped us. May you help us again please?",
        null);

 
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

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

            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,
        null,
        new DailyQuestAction());   
  }
View Full Code Here

   
    // player have no expired quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new NotCondition(
            new TimePassedCondition(QUEST_SLOT, 1, expireDelay)),
        ConversationStates.ATTENDING,
        "It hasn't been long since you've started your quest, I won't let you give up so soon.",
        null);
   
    // player have expired quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new TimePassedCondition(QUEST_SLOT, 1, expireDelay),
        ConversationStates.ATTENDING,
        null,
        new DailyQuestAction());
  }
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.