Package games.stendhal.server.entity.npc.action

Examples of games.stendhal.server.entity.npc.action.MultipleActions


    // Player says yes they want to help
    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.ATTENDING,
      null,     
      new MultipleActions(new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "machine;", 15.0),
                new StartRecordingRandomItemCollectionAction(mithrilcloak.getQuestSlot(), 1, items, "Thank you! To fix it, it needs [#item]. I'm ever so grateful for your help.")));
   
    // player said no they didn't want to help
    npc.add(
      ConversationStates.QUEST_OFFERED,
View Full Code Here


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

    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("scissors", "magical", "magical scissors", "mithril", "cloak", "mithril cloak", "task", "quest"),
        new AndCondition(new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_scissors"), new PlayerHasItemWithHimCondition("magical scissors")),
        ConversationStates.ATTENDING,
        "You brought those magical scissors! Excellent! Now that I can cut the fabric I need a magical needle. You can buy one from a trader in the abandoned keep of Ados mountains, #Ritati Dragon something or other. Just go to him and ask for his 'specials'.",
        new MultipleActions(
                   new DropItemAction("magical scissors"),
                   new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "need_needle;", 10.0),
                   new IncreaseXPAction(100)
                   )
        );
View Full Code Here

    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
        ConversationPhrases.YES_MESSAGES,
        new PlayerHasItemWithHimCondition("money", NEEDLE_COST),
        ConversationStates.IDLE,
        "Ok, here you are. Be careful with them, they break easy. Now, get lost, you have hung around here far too long already.",       
        new MultipleActions(
          new DropItemAction("money", NEEDLE_COST),
          new EquipItemAction("magical needle", 1, true)
          ));

    // said he had money but he didn't
View Full Code Here

    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("needle", "magical needle", "magical", "mithril", "cloak", "mithril cloak", "task", "quest"),
        new AndCondition(new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "told_joke"), new PlayerHasItemWithHimCondition("magical needle")),
        ConversationStates.ATTENDING,
        null,
        new MultipleActions(
          new ChatAction() {
            public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
              final String[] questslot = player.getQuest(mithrilcloak.getQuestSlot()).split(";");   
              int needles = 1;
              int saidjoke = 1;
View Full Code Here

                new PlayerHasItemWithHimCondition("wood",10)),
        ConversationStates.ATTENDING,
        "Great, now I can make new arrows. But for the bows I need " +
        "bowstrings. Please go to #Karl. I know he has horses and if " +
        "you tell him my name he will give you  #'horse hairs' from a horsetail.",
        new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "hair", 2.0), new DropItemAction("wood", 10)));

    /*
     * For simplicity, respond to 'Karl' at any time.
     */
    npc.addReply("Karl", "Karl is a farmer, east of Semos. He has many pets on his farm.");
View Full Code Here

        new AndCondition(new QuestInStateCondition(QUEST_SLOT,"hair"),
                new PlayerHasItemWithHimCondition("horse hair")),
        ConversationStates.ATTENDING,
        "Yay, you got the horse hairs. Thanks a lot. Karl is really nice. Here, " +
        "take this for your work. Someone left it here and I don't need those things.",
        new MultipleActions(reward));
   
    /*
     * Player asks about quest, and it is finished
     */
    npc.add(ConversationStates.ATTENDING,
 
View Full Code Here

      // make sure the player isn't cheating by putting the
      // cream away and then saying "yes"
      new PlayerHasItemWithHimCondition("suntan cream"),
      ConversationStates.ATTENDING,
      "Thank you! I feel much better immediately! Here, take this key to my row house in Ados. Feel at home as long as I'm still here!",
      new MultipleActions(reward));

    zara.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.NO_MESSAGES, null,
      ConversationStates.ATTENDING,
      "No? Look at me! I cannot believe that you're so selfish!",
View Full Code Here

    npc.add(
      ConversationStates.ATTENDING, triggers,
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new PlayerHasItemWithHimCondition("pina colada")),
      ConversationStates.ATTENDING,
      null,
      new MultipleActions(
            new DropItemAction("pina colada"),
            new ChatAction() {
              public void fire(final Player player,
                  final Sentence sentence,
                  final EventRaiser npc) {
View Full Code Here

      ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.ATTENDING,
      "Good. Please kill every dark elf down there and get the amulet from the mutant thing.",
      new MultipleActions(actions));

    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.NO_MESSAGES,
      null,
      ConversationStates.ATTENDING,
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.action.MultipleActions

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.