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

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


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

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, 0, "start"),
            new NotCondition(new KilledForQuestCondition(QUEST_SLOT, 1))),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            raiser.say("Just go kill Dhohr Nuggetcutter and his minions; the mountain leader, hero and elder dwarves. Even the simple mountain dwarves are a danger to us, kill them too.");               
View Full Code Here


        new MultipleActions(reward));
   
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(getName()),
            new QuestInStateCondition(QUEST_SLOT, "lorithien"),
            new NotCondition(new PlayerHasItemWithHimCondition("gold bar", GOLD_AMOUNT))),
        ConversationStates.ATTENDING,
        "Haven't you got the gold bars from #Lorithien yet? Please go get them, quickly!",
        null);
  }
View Full Code Here

  private void step_1() {
    // 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"));
View Full Code Here

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.FINISH_MESSAGES,
        new AndCondition(
            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotCompletedCondition(QUEST_SLOT),
            new NotCondition(
                    new KilledForQuestCondition(QUEST_SLOT, 0))),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(Player player, Sentence sentence, EventRaiser npc) {
View Full Code Here

        null);
   
    // 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);
   
View Full Code Here

    engine.add(ConversationStates.ATTENDING, "buy", new SentenceHasErrorCondition(),
        false, ConversationStates.ATTENDING,
        null, new ComplainAboutSentenceErrorAction());

    ChatCondition condition = new AndCondition(
      new NotCondition(new SentenceHasErrorCondition()),
      new NotCondition(sellerBehaviour.getTransactionCondition()));
    engine.add(ConversationStates.ATTENDING, "buy", condition,
      false, ConversationStates.ATTENDING,
      null, sellerBehaviour.getRejectedTransactionAction());

    condition = new AndCondition(
      new NotCondition(new SentenceHasErrorCondition()),
      sellerBehaviour.getTransactionCondition());

    engine.add(ConversationStates.ATTENDING, "buy", condition, false,
        ConversationStates.ATTENDING, null,
        new BehaviourAction(sellerBehaviour, "buy", "sell") {
View Full Code Here

   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new NotCondition(new QuestInStateCondition(QUEST_SLOT,"recommended"))),
        ConversationStates.ATTENDING,
        "I'm sure I asked you to do something for me, already.",
        null)

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

     * we can check the slot to see what the stored level was.
     * If the player has brought the right number of herbs, get them */
    npc.add(ConversationStates.ATTENDING, Arrays.asList("herb", "herbs"),
        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new NotCondition(new QuestInStateCondition(QUEST_SLOT,"recommended"))),
        ConversationStates.ATTENDING, null,
        new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            try {
              final int level = Integer.parseInt(player.getQuest(QUEST_SLOT));
View Full Code Here

        * provided that the NPC is not currently producing for player (not started, is rejected, or is complete) */   
        engine.add(
        ConversationStates.ATTENDING,
        behaviour.getProductionActivity(),
        new AndCondition(
          new NotCondition(new SentenceHasErrorCondition()),
          new QuestNotActiveCondition(QUEST_SLOT)
        ),
                false,
                ConversationStates.ATTENDING, null,
        new ProducerBehaviourAction(behaviour) {
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"));
   
   
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.