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

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


    // 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

   */
  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

        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

        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

        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

  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

      "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

       
        // 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

    // player returns while quest is still active
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestInStateCondition(QUEST_SLOT, "start"),
        new OrCondition(
          new PlayerHasItemWithHimCondition("leather cuirass"),
          new PlayerHasItemWithHimCondition("pauldroned leather cuirass"))),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Excuse me, please! I have noticed the leather cuirass you're carrying. Is it for me?",
      null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestInStateCondition(QUEST_SLOT, "start"),
        new NotCondition(new OrCondition(
          new PlayerHasItemWithHimCondition("leather cuirass"),
          new PlayerHasItemWithHimCondition("pauldroned leather cuirass")))),
      ConversationStates.ATTENDING,
      "Luckily I haven't been robbed while you were away. I would be glad to receive a leather cuirass. Anyway, how can I #help you?",
      null);
View Full Code Here

TOP

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

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.