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

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


  private void askingStep() {
    final SpeakerNPC npc = npcs.get("Agnus");

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(new QuestNotStartedCondition(QUEST_SLOT), new QuestInStateCondition(QUEST_SLOT, "rejected")),
        ConversationStates.QUEST_OFFERED,
        "I feel so worried. If I only knew my #children were safe I would feel better.",
        null);

    npc.add(
View Full Code Here


    reward.add(new SetQuestAction(QUEST_SLOT, "done"));

    // the player returns after having started the quest.
    // Saman checks if kill was made
    npc.add(ConversationStates.ATTENDING, "kill",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "start"), new KilledForQuestCondition(QUEST_SLOT, 1)),
      ConversationStates.ATTENDING,
      "Revenge! Good! Take club of hooman blud.",
      new MultipleActions(reward));

    npc.add(ConversationStates.ATTENDING, "kill",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "start"), new NotCondition(new KilledForQuestCondition(QUEST_SLOT, 1))),
      ConversationStates.ATTENDING,
      "kill Mountain Orc Chief! Kotoch orcs nid revenge!",
      null);
  }
View Full Code Here

    actions.add(new DropInfostringItemAction("dwarf cloak","Phalk"));
    actions.add(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "done", 5.0))
    actions.add(new EquipItemAction("dwarvish armor", 1, true));
   
    npc.add(ConversationStates.ATTENDING, "clothes",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),
        new PlayerHasInfostringItemWithHimCondition("golden armor","Phalk"),
        new PlayerHasInfostringItemWithHimCondition("dwarf cloak","Phalk")),
        ConversationStates.ATTENDING,
        "Oh yeah! Thank you so much! Payment?? Erm... *cough* I will give you my old armor as a reward.",
        new MultipleActions(actions));

    npc.add(ConversationStates.ATTENDING, "clothes",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),
        new NotCondition(
            new AndCondition(
                new PlayerHasInfostringItemWithHimCondition("golden armor","Phalk"),
                new PlayerHasInfostringItemWithHimCondition("dwarf cloak","Phalk")))),
        ConversationStates.ATTENDING,
        "Hm, I want the special golden #armor from Mrotho and the dwarf #cloak from Wrvil. Tell them my name and they will give you what they made me.",
        null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),
        ConversationStates.ATTENDING,
        "I am waiting for you to bring me new #clothes from Wrvil and Mrotho.",
        null);
  }
View Full Code Here

        }
        return res;
      }
      res.add("Now Phalk needs me to collect a cloak from Wrvil and some armor from Mrotho.");
      if (questState.startsWith("clothes")) {
        if(new QuestInStateCondition(QUEST_SLOT, 1, "cloak").fire(player,null, null)){
          res.add("I have collected the cloak and had to pay for it!");
        }
        if(new QuestInStateCondition(QUEST_SLOT, 2, "armor").fire(player,null, null)){
          res.add("Mrotho gave me Phalk's golden armor but I had to cover his debt.");
        }
        return res;
      }
      res.add("I collected Phalk's equipment and he gave me his dwarvish armor in return!");
View Full Code Here

  // wine
  // black pearl
  final SpeakerNPC npc = npcs.get("Salva Mattori");
 
      npc.add(ConversationStates.ATTENDING, "potion",
        new QuestInStateCondition(QUEST_SLOT, "start"),
          ConversationStates.ATTENDING, "I will help you make this potion, Mrs Yeti is an old friend of mine. But the blade on "
        + "my magic knife has snapped yet again. I need another. I get mine from Hackim Easso of Semos City, will you go to him and "
        + "ask him to make another knife? Just say my name: #salva",
        new SetQuestAction(QUEST_SLOT, "hackim"));

    npc.add(
      ConversationStates.ATTENDING, Arrays.asList("salva","knife"),
      new NotCondition(new QuestInStateCondition(QUEST_SLOT, "knife")),
      ConversationStates.ATTENDING,
      "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")))),
View Full Code Here

  private void makeMagicKnife() {
    // although the player does end up just taking an ordinary knife to salva, this step must be completed
    // (must be in quest state 'knife' when they take the knife)
  final SpeakerNPC npc = npcs.get("Hackim Easso");
    npc.add(ConversationStates.ATTENDING, "salva",
        new QuestInStateCondition(QUEST_SLOT, "hackim"),
          ConversationStates.ATTENDING, "Salva needs another magic knife does she? Ok, I can help you but not while I am so hungry. "
        + "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 IncreaseKarmaAction(10.0));
    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,
        questTrigger,
        new OrCondition(new QuestInStateCondition(QUEST_SLOT, "start"),
                new QuestInStateCondition(QUEST_SLOT, "pies"),
                new QuestInStateCondition(QUEST_SLOT, "knife")),
        ConversationStates.ATTENDING,
        "I am waiting for you to return with a love potion. Please ask Salva Mattori in the magic city about: #potion.",
        null);
  }
View Full Code Here

    questTrigger.add(extraTrigger);

    // easy to check if they have a pet or sheep at all
      npc.add(
      ConversationStates.ATTENDING, questTrigger,
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "dragon"),
               new NotCondition(new PlayerHasPetOrSheepCondition())),
      ConversationStates.ATTENDING,
      "You can get a baby dragon only if you have a mythical egg. Those, you must get from Morgrin at the wizard school. "
      + "Then Terry in Semos caves will hatch it.",
      null);

    // if they have any pet or sheep, then check if it's a baby dragon
    npc.add(
      ConversationStates.ATTENDING, questTrigger,
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "dragon"),
               new PlayerHasPetOrSheepCondition()),
      ConversationStates.ATTENDING,
      null,
      new ChatAction() {
        public void fire(final Player player, final Sentence sentence,
View Full Code Here

    triggers.addAll(ConversationPhrases.FINISH_MESSAGES);
    triggers.addAll(ConversationPhrases.QUEST_MESSAGES);   
    npc.add(ConversationStates.ATTENDING,
        triggers,
        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT, 0, "start"),
            new KilledForQuestCondition(QUEST_SLOT, 1)),
        ConversationStates.ATTENDING,
        "I see you have killed the gnomes as I asked. I hope they will stay away from the carrots for a while! "
        + "Please take these potions as a reward.",
        new MultipleActions(actions));

    npc.add(ConversationStates.ATTENDING,
        triggers,
        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT, 0, "start"),
            new NotCondition(new KilledForQuestCondition(QUEST_SLOT, 1))),
        ConversationStates.ATTENDING,
        "You need to teach those pesky gnomes a lesson, by killing some as an example! "
        + "Make sure you get the leaders, too, at least one infantryman and one cavalryman.",
        null);
View Full Code Here

        null);

    // response to wedding ring enquiry when you're married but not taken honeymoon
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("wedding ring", "wedding"),
        new QuestInStateCondition(marriage.getQuestSlot(), "just_married"),
        ConversationStates.ATTENDING,
        "Congratulations on your recent wedding! Don't forget to ask Linda in Fado Hotel about your honeymoon.",
        null);

    // Here the behaviour is defined for if you make a wedding ring enquiry to Ognir and your
View Full Code Here

TOP

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

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.