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

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


   
        // Player has done quest before and agrees to help again
    npc.add(ConversationStates.QUEST_OFFERED, ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING, null,
                new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "start;", 2.0),
        new StartRecordingRandomItemCollectionAction(QUEST_SLOT, 1, items, "Oh, thank you! Please help us by"
                + " bringing [item] as soon as you can."))
    );


    // player is not willing to help
    npc.add(ConversationStates.QUEST_OFFERED, ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.ATTENDING, "Oh dear... I guess we're going to have to feed them with the deer...",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0)
    );
   
        // Player returns within one week of completing quest
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
View Full Code Here


        null,
        new SayRequiredItemAction(QUEST_SLOT, 1, "Welcome back! Have you brought the [item]?"));

    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new DropRecordedItemAction(QUEST_SLOT,1));
    actions.add(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "done;1", 5.0));
    actions.add(new SetQuestToTimeStampAction(QUEST_SLOT, 1));
    actions.add(new IncreaseXPAction(200));
 
    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.ATTENDING,
        "Thank you! First I need a #scythe to cut down these ugly flowers. And beware of bringing me an old one! Let me know if you have one!",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "start", 10.0));

    // Player says no, they've lost karma.
    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES, null, ConversationStates.IDLE,
        "So go away and someone who can help me!",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -10.0));
  }
View Full Code Here

        new MultipleActions(start));

    npc.add(ConversationStates.QUEST_OFFERED, ConversationPhrases.NO_MESSAGES, null,
        ConversationStates.ATTENDING,
        "*sigh* Oh well, maybe someone else will be my hero...",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -2.0));

    npc.add(
        ConversationStates.QUEST_OFFERED,
        Arrays.asList("basement", "storage space"),
        null,
View Full Code Here

      ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.ATTENDING,
      null,
      new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, NEEDED_ITEMS, 5.0),
                  new SayRequiredItemsFromCollectionAction(QUEST_SLOT, "Oh that would be wonderful, stranger! You might save my life! Please bring me [items].")));

    npc.add(
      ConversationStates.QUEST_OFFERED,
      ConversationPhrases.NO_MESSAGES,
      null,
      ConversationStates.ATTENDING,
      "I thought you would maybe help me... But I was wrong, obviously... So wrong as with my students while I was a teacher...",
      new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0));

    npc.addReply("apple", "Apples are the favourite food of assassins. I saw some apple trees on the east " +
        "of semos and near to Orril and Nalwor river.");

      npc.addReply("flask", "I've heard of a young woman in Semos who sells them.");
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Ok, I have to find someone else to do this 'little' job!",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0));
  }
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "That's so nice of you. Good luck searching for them.",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "looking:said", 5.0));

    npc.add(
        ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Oh. Never mind. I'm sure someone else would be glad to help me.",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -15.0));

    npc.add(
        ConversationStates.QUEST_OFFERED,
        "children",
        null,
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.NO_MESSAGES, null,
      ConversationStates.ATTENDING,
      "Ugg! i want hooman make #task, kill!",
      new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -6.0));
  }
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.ATTENDING,
        "Thank you for your help! You need to go to Salva Mattori in the magic city for the #potion.",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "start", 10.0));

    // Player says no, they've lost karma.
    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES, null, ConversationStates.IDLE,
        "Oh, you are so heartless.",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -10.0));
  }
View Full Code Here

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

TOP

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

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.