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

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


    final SpeakerNPC npc = npcs.get("Ilisa");

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new NotCondition(new PlayerHasItemWithHimCondition("flask"))),
        ConversationStates.ATTENDING,
        "Medicine for #Tad? Didn't he tell you to bring a flask?", null);

    final List<ChatAction> processStep = new LinkedList<ChatAction>();
    processStep.add(new DropItemAction("flask"));
View Full Code Here


    final SpeakerNPC npc = npcs.get("Ilisa");

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "corpse&herbs"),
            new NotCondition(new PlayerHasItemWithHimCondition("arandula"))),
        ConversationStates.ATTENDING,
        "Can you fetch those #herbs for the #medicine?", null);

    final List<ChatAction> processStep = new LinkedList<ChatAction>();
    processStep.add(new DropItemAction("arandula"));
View Full Code Here

    monogenes.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(monogenes.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"),
          new NotCondition(new PlayerHasItemWithHimCondition("leather helmet"))),
      ConversationStates.ATTENDING,
      "Hey, my good friend, remember that leather hat I asked you about before? It's still pretty chilly here...",
      null);

    final List<ChatAction> reward = new LinkedList<ChatAction>();
View Full Code Here

        null);
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT))),
        ConversationStates.ATTENDING,
        null,
        new SayRequiredItemAction(QUEST_SLOT, "Hm, no, you don't have [item], don't try to fool me!"));
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
View Full Code Here

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotCompletedCondition(QUEST_SLOT),
          new NotCondition(new PlayerHasItemWithHimCondition("teddy"))),
      ConversationStates.QUEST_OFFERED,
      "*cries* There were wolves in the #park! *sniff* I ran away, but I dropped my #teddy! Please will you get it for me? *sniff* Please?",
      null);

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

      new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING,
      "teddy",
      new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("teddy"))),
      ConversationStates.ATTENDING,
      "I lost my teddy in the #park over east, where all those #wolves are hanging about.",
      null);

    npc.add(ConversationStates.ATTENDING, "teddy",
View Full Code Here

 
  private void getQuest() {
    final SpeakerNPC npc = npcs.get("Mayor Chalmers");
    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 fetch [item]"
            + ". Say #complete if you brought it!"));
   
    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 fetch [item]"
            + ". Say #complete if you brought it! Perhaps there are no supplies of that left at all! You could fetch #another item if you like, or 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, "I can only give you a new quest once a day. Please check back in"));
   
   
View Full Code Here

        new MultipleActions(actions));
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.FINISH_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                 new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,0))),
        ConversationStates.ATTENDING,
        null,
        new SayRequiredItemAction(QUEST_SLOT,0,"You didn't fetch [item]"
            + " yet. Go and get it and say #complete only once you're done."));
   
View Full Code Here

        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, I won't let you give up so soon.",
        null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

    rose.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
                 new QuestInStateCondition(QUEST_SLOT, 0, "start"),
                                 new TimePassedCondition(QUEST_SLOT, 1, DELAY),
                 new NotCondition(new PlayerCanEquipItemCondition("rhosyd"))),
        ConversationStates.IDLE,
        "Shame you don't have space to take a pretty flower from me. Come back when you can carry my precious blooms without damaging a petal.",
        null);
   
        // don't give the flower if one was given within the last 5 minutes
        rose.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
                 new QuestInStateCondition(QUEST_SLOT, 0, "start"),
                                 new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
        ConversationStates.IDLE,
        "I gave you a flower not five minutes past! Her Royal Highness can enjoy that one for a while.",
        null);
     
      final ChatCondition lostFlowerCondition = new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
         // had got the flower before and was supposed to take it to the princess next
           new QuestInStateCondition(QUEST_SLOT, 0, "got_flower"),
         // check chest and so on first - maybe the player does still have it (though we can't check house chests or the floor)
         new ChatCondition() {
             public boolean fire(final Player player, final Sentence sentence, final Entity entity) {
               return player.getTotalNumberOf("rhosyd") == 0;
             }
         },
        // just to check there is space
        new PlayerCanEquipItemCondition("rhosyd"),
        // note: older quest slots will pass this automatically, but they are old now.
                new TimePassedCondition(QUEST_SLOT, 1, 12*MathHelper.MINUTES_IN_ONE_WEEK));
          
      // if the player never had a timestamp stored (older quest) we have now added timestamp 1.
      // but that was a while ago that we changed it (November 2010?)
    rose.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      lostFlowerCondition,
      ConversationStates.QUESTION_1,
      "Hello dearie. Did you lose the flower I gave you last? If you need another say #yes but it's bad luck for me to have to give you it again, so you better be sure!",
      null);
   
    rose.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        lostFlowerCondition,
        ConversationStates.IDLE,
        "Heres a new flower to take the pretty lady, but mind you don't lose that one.",
        new MultipleActions(new EquipItemAction("rhosyd", 1, true),
                        new SetQuestAction(QUEST_SLOT, 0, "got_flower"),
                        // dock some karma for losing the flower
                        new IncreaseKarmaAction(-20.0),
                        new SetQuestToTimeStampAction(QUEST_SLOT, 1)));
   
    rose.add(ConversationStates.QUESTION_1,
        ConversationPhrases.NO_MESSAGES,
        lostFlowerCondition,
        ConversationStates.IDLE,
        "No worries dearie, you probably got it somewhere!",
        null);
   
        // 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

TOP

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

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.