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

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


        "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,
        ConversationPhrases.ABORT_MESSAGES,
        new QuestNotActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I'm afraid I didn't send you on a #quest yet.",
        null);
   
  }
View Full Code Here


        "It hasn't been long since you've started your quest, you shouldn't give up so soon.",
        null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new QuestNotActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I'm afraid I didn't send you on a #quest yet.",
        null);
   
  }
View Full Code Here

        // Player is not inclined to comply with the request and has not already rejected it once
        npc.add(ConversationStates.QUEST_OFFERED,
            ConversationPhrases.NO_MESSAGES,
            new AndCondition(
                new QuestNotActiveCondition(QUEST_SLOT),
                new QuestNotInStateCondition(QUEST_SLOT, "rejected")),
            ConversationStates.ATTENDING,
            "Wruff... I guess I will have to ask to someone with a better attitude!",
            new MultipleActions(
                new SetQuestAction(QUEST_SLOT, "rejected"),
View Full Code Here

        // him if he wants his oil back!

        add(
        ConversationStates.ATTENDING,
        "make",
        new QuestNotActiveCondition(behaviour.getQuestSlot()),
        ConversationStates.ATTENDING, null,
        new ProducerBehaviourAction(behaviour) {
          @Override
          public void fireRequestOK(final ItemParserResult res, final Player player, final Sentence sentence, final EventRaiser npc) {
            // Find out how much items we shall produce.
View Full Code Here

        /* The Player greets the NPC.
        * The NPC is not currently producing for player (not started, is rejected, or is complete) */
    engine.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npcName),
            new QuestNotActiveCondition(QUEST_SLOT)),
        false, ConversationStates.ATTENDING, thisWelcomeMessage, null);

    engine.add(ConversationStates.ATTENDING,
        behaviour.getProductionActivity(),
        new SentenceHasErrorCondition(),
        false, ConversationStates.ATTENDING,
        null, new ComplainAboutSentenceErrorAction());

        /* In the behaviour a production activity is defined, e.g. 'cast' or 'mill'
        * and this is used as the trigger to start the production,
        * 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) {
          @Override
View Full Code Here

        add(ConversationStates.ATTENDING, "borrow",
            new AndCondition(
                new LevelGreaterThanCondition(5),
                new QuestCompletedCondition("pizza_delivery"),
                new QuestNotActiveCondition(QUEST_SLOT)),
            ConversationStates.ATTENDING,
            "I lend out " + Grammar.enumerateCollectionWithHash(ITEMS) + ". If you're interested, please say which you want.",
            null);

        // player already has borrowed something it didn't return and will pay for it
        add(ConversationStates.ATTENDING, "borrow",
            new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT)))
            ConversationStates.QUESTION_1,
            "You didn't return what I last lent you! Do you want to pay for it at a cost of " + COST + " money?",
            null);
        
        // player already has borrowed something it didn't return and will return it
        add(ConversationStates.ATTENDING, "borrow",
            new AndCondition(new QuestActiveCondition(QUEST_SLOT), new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT))
            ConversationStates.QUESTION_2,
            "You didn't return what I last lent you! Do you want to return it now?",
            null);
        
        // player wants to pay for previous item
        final List<ChatAction> payment = new LinkedList<ChatAction>();
        payment.add(new DropItemAction("money", COST));
        payment.add(new SetQuestAction(QUEST_SLOT, "done"));
        payment.add(new DecreaseKarmaAction(10));
        add(ConversationStates.QUESTION_1,
            ConversationPhrases.YES_MESSAGES,
            new PlayerHasItemWithHimCondition("money", COST)
            ConversationStates.ATTENDING,
            "Thanks. Just let me know if you want to #borrow any tools again.",
            new MultipleActions(payment));
        
        // player already has borrowed something and wants to return it
        final List<ChatAction> returnitem = new LinkedList<ChatAction>();
        returnitem.add(new DropRecordedItemAction(QUEST_SLOT));
        returnitem.add(new SetQuestAction(QUEST_SLOT, "done"));
        add(ConversationStates.QUESTION_2,
            ConversationPhrases.YES_MESSAGES,
            new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT)
            ConversationStates.ATTENDING,
            "Thank you! Just let me know if you want to #borrow any tools again.",
            new MultipleActions(returnitem));
        
        // don't want to pay for it now
        add(ConversationStates.QUESTION_1,
            ConversationPhrases.NO_MESSAGES,
            null, 
            ConversationStates.ATTENDING,
            "No problem. Take as long as you need, but you can't borrow other tools till you return the last, or pay for it.",
            null);
        
        // don't want to return it now
        add(ConversationStates.QUESTION_2,
            ConversationPhrases.NO_MESSAGES,
            null, 
            ConversationStates.ATTENDING,
            "No problem. Take as long as you need, but you can't borrow other tools till you return the last, or pay for it.",
            null);
        
        
        // saying the item name and storing that item name into the quest slot, and giving the item
        for(final String itemName : ITEMS) {
          add(ConversationStates.ATTENDING,
              itemName,
              new AndCondition(
                  new LevelGreaterThanCondition(5),
                  new QuestCompletedCondition("pizza_delivery"),
                  new QuestNotActiveCondition(QUEST_SLOT)),
              ConversationStates.ATTENDING,
              null,
              new ChatAction() {
              public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
                final Item item =  SingletonRepository.getEntityManager().getItem(itemName);
                if (item == null) {
                  npc.say("Sorry, something went wrong. Could you say correctly the item, please?");
                } else {
                  player.equipOrPutOnGround(item);
                  player.setQuest(QUEST_SLOT, itemName);
                  npc.say("Here you are! Don't forget to #return it or you have to pay!");
                }
              }
            });
        }

        // additionally add "sugar" as trigger word
        add(ConversationStates.ATTENDING,
              "sugar",
              new AndCondition(
                  new LevelGreaterThanCondition(5),
                  new QuestCompletedCondition("pizza_delivery"),
                  new QuestNotActiveCondition(QUEST_SLOT)),
              ConversationStates.ATTENDING,
              null,
              new ChatAction() {
              public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
                npc.say("Sorry, I can't lend out sugar, only a #sugar #mill.");
View Full Code Here

        // him if he wants his oil back!

        add(
            ConversationStates.ATTENDING,
            "make",
            new QuestNotActiveCondition(behaviour.getQuestSlot()),
            ConversationStates.ATTENDING, null,
            new ProducerBehaviourAction(behaviour, "produce") {
              @Override
              public void fireRequestOK(final ItemParserResult res, final Player player, final Sentence sentence, final EventRaiser npc) {
                // Find out how much items we shall produce.
View Full Code Here

            "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);
       
        add(ConversationStates.ATTENDING,
            Arrays.asList("fee", "enter"),
            new QuestNotActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "The fee is " + COST
            + " money. Do you want to pay?",
            null);
       
        add(ConversationStates.ATTENDING,
            Arrays.asList("fee", "enter"),
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "As you already know, the fee is "
            + COST + " money.",
            null);
       
        add(ConversationStates.ATTENDING,
            ConversationPhrases.YES_MESSAGES,
            new AndCondition(
                new PlayerHasItemWithHimCondition("money", COST),
                new QuestNotActiveCondition(QUEST_SLOT)),
                ConversationStates.ATTENDING,
                "Semos, Nalwor and Fado bank chests are to my right. The chests owned by Ados Bank Merchants and your friend Zara are to my left. If you are finished before your time here is done, please say #leave.",
                new MultipleActions(
                    new DropItemAction("money", COST),
                    new TeleportAction(ZONE_NAME, 10, 10, Direction.DOWN),
                    new SetQuestAction(QUEST_SLOT, "start"),
                    new ChatAction() {
                      public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
                        SingletonRepository.getTurnNotifier().notifyInTurns(0, new Timer(player));
                      }}));
       
        add(ConversationStates.ATTENDING,
            ConversationPhrases.YES_MESSAGES,
            new AndCondition(
                new NotCondition(new PlayerHasItemWithHimCondition("money", COST)),
                new QuestNotActiveCondition(QUEST_SLOT)),
            ConversationStates.ATTENDING,
            "You do not have enough money!",
            null);
       
        add(ConversationStates.ATTENDING,
            ConversationPhrases.YES_MESSAGES,
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Hm, I do not understand you. If you wish to #leave, just say",
            null);

        add(ConversationStates.ATTENDING,
            ConversationPhrases.NO_MESSAGES,
            new QuestNotActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Very well.",
            null);

        add(ConversationStates.ATTENDING,
            ConversationPhrases.NO_MESSAGES,
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Hm, I do not understand you. If you wish to #leave, just say",
            null);

        add(ConversationStates.ATTENDING,
            "leave",
            new QuestNotActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Leave where?",
            null);

View Full Code Here

TOP

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

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.