Examples of PlayerHasRecordedItemWithHimCondition


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

        null);

      // we stored the needed part name as part of the quest slot
      npc.add(ConversationStates.QUEST_ITEM_QUESTION,
          ConversationPhrases.YES_MESSAGES,
          new PlayerHasRecordedItemWithHimCondition(mithrilcloak.getQuestSlot(),1),
          ConversationStates.QUEST_2_OFFERED,
          "Thank you so much! Listen, I must repay the favour, and I have a wonderful idea. Do you want to hear more?",
          new MultipleActions(new DropRecordedItemAction(mithrilcloak.getQuestSlot(),1),
              new SetQuestAction(mithrilcloak.getQuestSlot(), "fixed_machine"),
              new IncreaseXPAction(100)));
     
      // we stored the needed part name as part of the quest slot
      npc.add(ConversationStates.QUEST_ITEM_QUESTION,
          ConversationPhrases.YES_MESSAGES,
          new NotCondition(new PlayerHasRecordedItemWithHimCondition(mithrilcloak.getQuestSlot(),1)),
          ConversationStates.ATTENDING,
          null,
          new SayRequiredItemAction(mithrilcloak.getQuestSlot(),1,"No, you don't have [the item] I need. What a shame."));
                 
View Full Code Here

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

        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,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "Wow, it's incredible to see this close up! Many thanks. Now, perhaps we can #deal together.",
        new MultipleActions(new DropRecordedItemAction(QUEST_SLOT),
                  new SetQuestAction(QUEST_SLOT, "done"),
                  new IncreaseXPAction(100000)));
View Full Code Here

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

    actions.add(new IncreaseKarmaAction(10.0));
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.FINISH_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                 new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,0)),
        ConversationStates.ATTENDING,
        "Good work! Let me thank you on behalf of the people of Ados!",
        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

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

    });
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.FINISH_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                 new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,0)),
        ConversationStates.ATTENDING,
        null,
        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 don't seem to have [item]"
            + " with you. Please get it and say #complete only then."));
   
View Full Code Here

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

            "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.");
              }
        });

        // too low level
        add(ConversationStates.ATTENDING,
              ITEMS,
              new LevelLessThanCondition(6),
              ConversationStates.ATTENDING,
              "Sorry, as you have little experience in this world I can't trust you with my tools.",
              null);
       
        // currently has borrowed an item
        add(ConversationStates.ATTENDING,
              ITEMS,
              new QuestActiveCondition(QUEST_SLOT),
              ConversationStates.ATTENDING,
              "You can't borrow from me again till you #return the last tool I lent you.",
              null);
       
        // haven't done pizza
        add(ConversationStates.ATTENDING,
              ITEMS,
              new QuestNotCompletedCondition("pizza_delivery"),
              ConversationStates.ATTENDING,
              "Only pizza deliverers can borrow tools, please deliver one for Leander and then ask me again.",
              null);
       
        // player asks about pay from attending state
        add(ConversationStates.ATTENDING, "pay",
            new QuestActiveCondition(QUEST_SLOT)
            ConversationStates.QUESTION_1,
            "If you lost what I lent you, you can pay " + COST + " money. Do you want to pay now?",
            null);
        
        // player asks about return from attending state
        add(ConversationStates.ATTENDING, "return",
            new AndCondition(new QuestActiveCondition(QUEST_SLOT), new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT))
            ConversationStates.QUESTION_2,
            "Do you want to return what you borrowed now?",
            null);
       
        // player asks about return from attending state
        add(ConversationStates.ATTENDING, "return",
            new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT)))
            ConversationStates.QUESTION_1,
            "You don't have it with you! Do you want to pay " + COST + " money for it now?",
            null);
       
      }};
View Full Code Here

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

    actions.add(new SetQuestToTimeStampAction(QUEST_SLOT, 1));
    actions.add(new IncreaseXPAction(200));
 
    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,1),
      ConversationStates.ATTENDING, "Thank you! You have rescued our rare animals.",
      new MultipleActions(actions));

        npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
            ConversationPhrases.YES_MESSAGES,
            new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,1)),
            ConversationStates.ATTENDING, null,
            new SayRequiredItemAction(QUEST_SLOT, 1, "*sigh* I SPECIFICALLY said that we need [item]!")
            );

    npc.add(ConversationStates.QUEST_ITEM_BROUGHT, ConversationPhrases.NO_MESSAGES, null,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.