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

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


    reward.add(new SetQuestAction(QUEST_SLOT, "capture"));
    reward.add(new IncreaseKarmaAction(10));
   
    npc.add(ConversationStates.ATTENDING, "scythe",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"),
        new PlayerHasItemWithHimCondition("scythe")),
        ConversationStates.ATTENDING,
        "Thank you!! First part is done! Now I can cut all flowers down! Now please ask Princess Esclara why I am here! I think saying my name should tell her something...",
        new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING, "scythe",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new NotCondition(new PlayerHasItemWithHimCondition("scythe"))),
      ConversationStates.ATTENDING,
      "You don't have a scythe yet! Go and get one and hurry up!",
      null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here


    reward.add(new SetQuestAction(QUEST_SLOT, "jailed"));
    reward.add(new IncreaseKarmaAction(10));
   
    npc.add(ConversationStates.ATTENDING, "egg",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "egg"),
            new PlayerHasItemWithHimCondition("egg")),
            ConversationStates.ATTENDING,
            "Thank you again my friend. Now you have to tell Princess Ylflia, in Kalavan Castle, that I am #jailed here. Please hurry up!",
            new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING, "egg",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "egg"), new NotCondition(new PlayerHasItemWithHimCondition("egg"))),
      ConversationStates.ATTENDING,
      "I cannot see an egg!",
      null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(15));
   
    npc.add(ConversationStates.ATTENDING, "armor",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "armor"),
            new PlayerHasItemWithHimCondition("barbarian armor")),
            ConversationStates.ATTENDING,
            "Thats all! Now I am prepared for my escape! Here is something I have stolen from Princess Esclara! Do not let her know. And now leave me!",
            new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING, "armor",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "armor"), new NotCondition(new PlayerHasItemWithHimCondition("barbarian armor"))),
      ConversationStates.ATTENDING,
      "You have no barbarian armor with you! Go get one!",
      null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

        "In order to play, you have to stake " + STAKE
            + " gold. Do you want to pay?", null);

    ricardo.add(ConversationStates.QUESTION_1,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasItemWithHimCondition("money", STAKE),
      ConversationStates.ATTENDING,
      "OK, here are the dice. Just throw them when you're ready. Good luck!",
      new ChatAction() {
        public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
          player.drop("money", STAKE);
          final Dice dice = (Dice) SingletonRepository.getEntityManager()
              .getItem("dice");
          dice.setCroupierNPC((CroupierNPC) npc.getEntity());
          player.equipOrPutOnGround(dice);
        }
      });
   
    ricardo.add(ConversationStates.QUESTION_1,
      ConversationPhrases.YES_MESSAGES,
      new NotCondition(new PlayerHasItemWithHimCondition("money", STAKE)),
      ConversationStates.ATTENDING,
      "Hey! You don't have enough money!", null);

    ricardo.add(
      ConversationStates.QUESTION_1,
View Full Code Here

      "You need to go to Hackim Easso and ask him about a magic knife for #salva before I can help you.",
      null);

      npc.add(ConversationStates.ATTENDING,  Arrays.asList("salva","knife","potion"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "knife"),
        new PlayerHasItemWithHimCondition("knife")),
        ConversationStates.ATTENDING, "Very good! Now I need the items to make the love #potion. I need 3 lilia flowers, 1 sprig of kokuda, 1 glass of wine and 1 black pearl. Please bring them all together at once and then ask me to make the #potion.",
        new MultipleActions(new SetQuestAction(QUEST_SLOT, "potion"), new DropItemAction("knife")));

      npc.add(ConversationStates.ATTENDING,  Arrays.asList("salva","knife","potion"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "knife"),
        new NotCondition(new PlayerHasItemWithHimCondition("knife"))),
        ConversationStates.ATTENDING, "I see you have been to Hackim, but where is the magic knife?",
        null);

    final List<ChatAction> potionactions = new LinkedList<ChatAction>();
    potionactions.add(new DropItemAction("lilia",3));
    potionactions.add(new DropItemAction("kokuda"));
    potionactions.add(new DropItemAction("wine"));
    potionactions.add(new DropItemAction("black pearl"));
    potionactions.add(new EquipItemAction("love potion"));
    potionactions.add(new IncreaseXPAction(100));
    potionactions.add(new SetQuestAction(QUEST_SLOT, "gotpotion"));

    // don't make player wait for potion - could add this in later if wanted
    npc.add(ConversationStates.ATTENDING,  Arrays.asList("salva","potion"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "potion"),
                 new PlayerHasItemWithHimCondition("lilia",3),
                 new PlayerHasItemWithHimCondition("kokuda"),
                 new PlayerHasItemWithHimCondition("wine"),
                 new PlayerHasItemWithHimCondition("black pearl")),
        ConversationStates.ATTENDING, "I see you have all the items for the potion. *mutters magic words* And now, ta da! You have the love potion. Wish Mrs Yeti good luck from me!",
        new MultipleActions(potionactions));

    npc.add(ConversationStates.ATTENDING,  Arrays.asList("salva","potion"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "potion"),
                 new NotCondition(
                          new AndCondition(new PlayerHasItemWithHimCondition("lilia",3),
                                   new PlayerHasItemWithHimCondition("kokuda"),
                                   new PlayerHasItemWithHimCondition("wine"),
                                   new PlayerHasItemWithHimCondition("black pearl")))),
        ConversationStates.ATTENDING, "I need 3 lilia flowers, 1 sprig of kokuda, 1 glass of wine and 1 black pearl to make the love potion. Please bring them all together at once. Thanks!", null);
       

  }
View Full Code Here

        + "I need food! Bring me 5 #pies and I will help you!",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "pies", 1.0));

      npc.add(ConversationStates.ATTENDING, Arrays.asList("salva", "pies"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "pies"),
        new PlayerHasItemWithHimCondition("pie",5)),
        ConversationStates.ATTENDING, "Ah, thank you very much! Now I will tell you a little secret of mine. I am not a blacksmith, "
        + "only an assistant. I can't make knives at all! But I sell Salva a normal knife and is happy enough with that! So just take her "
        + "a plain knife like you could buy from Xin Blanca in Semos Tavern. I'll tell her I made it! Oh and thanks for the pies!!!",
        new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "knife", 1.0), new DropItemAction("pie",5)));

      npc.add(ConversationStates.ATTENDING, Arrays.asList("salva", "pies"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "pies"),
        new NotCondition(new PlayerHasItemWithHimCondition("pie",5))),
        ConversationStates.ATTENDING, "Arlindo from Ados makes the best meat and vegetable pies. Please remember to bring me 5, I am hungry!",
        null);

  }
View Full Code Here

    tookpotionactions.add(new IncreaseXPAction(1000));
    tookpotionactions.add(new SetQuestAction(QUEST_SLOT, "dragon"));

    npc.add(ConversationStates.ATTENDING, questTrigger,
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "gotpotion"),
        new PlayerHasItemWithHimCondition("love potion")),
        ConversationStates.ATTENDING, "Thank you! That looks so powerful I almost love you from smelling it! But don't worry I will save it for my husband. But he won't take it without some other temptation. I think he'd like a baby #dragon, if you'd be so kind as to bring one.",
        new MultipleActions(tookpotionactions));

    npc.add(
      ConversationStates.ATTENDING, questTrigger,
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "gotpotion"), new NotCondition(new PlayerHasItemWithHimCondition("love potion"))),
      ConversationStates.ATTENDING,
      "What did you do with the love potion?",
      null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

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

      null);

    // player wants to take the beans but hasn't the money
    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES,
      new NotCondition(new PlayerHasItemWithHimCondition("money", REQUIRED_MONEY)),
      ConversationStates.ATTENDING,
      "Scammer! You don't have the cash.",
      null);

    // player wants to take the beans
    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        new PlayerHasItemWithHimCondition("money", REQUIRED_MONEY),
        ConversationStates.ATTENDING,
        "Alright, here's the beans. Once you take them, you come down in about 30 minutes. And if you get nervous up there, hit one of the green panic squares to take you back here.",
        new MultipleActions(
            new DropItemAction("money", REQUIRED_MONEY),
            new EquipItemAction("rainbow beans", 1, true),
View Full Code Here

            public boolean fire(final Player player, final Sentence sentence, final Entity npc) {
              return (player.isQuestCompleted(marriage.getQuestSlot()) ||
                  (player.hasQuest(marriage.getQuestSlot()) && player.getQuest(marriage.getQuestSlot()).equals("just_married")));
            }
          },
          new NotCondition(new PlayerHasItemWithHimCondition("wedding ring"))),
        ConversationStates.ATTENDING,
        "I apologise, but I need your wedding ring in order to divorce you. If you have lost yours, you can go to Ognir to make another.",
        null);

    // If they say no
View Full Code Here

TOP

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

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.