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

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


    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Thank you! Natural spring water is best, the river that runs from Fado to Nal'wor might provide a source.",
        new SetQuestAction(QUEST_SLOT, 0, "start"));
   
    // Player says no, they've lost karma
    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.IDLE,
        "Well, that's not very charitable.",
        new MultipleActions(
            new SetQuestAction(QUEST_SLOT, 0, "rejected"),
            new DecreaseKarmaAction(5.0)));
  }
View Full Code Here


    reward.add(new DropInfostringItemAction("water", CLEAN_WATER_INFOSTRING));
    reward.add(new EquipItemAction("potion", 3));
    reward.add(new IncreaseXPAction(100));
    reward.add(new IncrementQuestAction(QUEST_SLOT, 2, 1) );
    reward.add(new SetQuestToTimeStampAction(QUEST_SLOT,1));
    reward.add(new SetQuestAction(QUEST_SLOT, 0, "done"));
    reward.add(new IncreaseKarmaAction(5.0));
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(
View Full Code Here

        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "done")),
        ConversationStates.ATTENDING,
        "Oh! I didn't reward you for helping me again! Here, take these boots. I think they're gorgeous but they don't fit me :(",
        new MultipleActions(new EquipItemAction("killer boots", 1, true), new SetQuestAction(QUEST_SLOT, "done;rewarded")));
 
    //     player returns after finishing the quest and was rewarded
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
View Full Code Here

  public void addToStarterNPCs() {
    SpeakerNPC npc = npcs.get("Fidorea");

    ChatAction startAction = new MultipleActions(
      new SetQuestAction(QUEST_SLOT, 0, points.get(0)),
      new SetQuestToPlayerAgeAction(QUEST_SLOT, 1),
      new SetQuestToYearAction(QUEST_SLOT, 2));

    // Fidorea introduces the quests
    npc.add(
      ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new AndCondition(new QuestStartedCondition(QUEST_SLOT), new SystemPropertyCondition("stendhal.minetown")),
      ConversationStates.ATTENDING,
      "I have nothing to do for you. But thanks for asking",
      null);
    npc.add(
      ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new AndCondition(new QuestNotStartedCondition(QUEST_SLOT), new SystemPropertyCondition("stendhal.minetown")),
      ConversationStates.QUEST_OFFERED,
      "Those who had to stay at home because of their duties, have prepared a #paper #chase.",
      null);
    npc.add(
      ConversationStates.QUEST_OFFERED,
      Arrays.asList("paper", "chase"),
      new SystemPropertyCondition("stendhal.minetown"),
      ConversationStates.ATTENDING,
      "You must ask every person on the trail about the #paper #chase. First you must find the beer-loving author of KNOW HOW TO KILL CREATURES.",
      startAction);


    // add normal way points (without first and last)
    for (int i = 0; i < points.size() - 1; i++) {
      addTaskToNPC(i);
    }

    // Fidorea does the post processing of this quest
    npc.add(ConversationStates.ATTENDING, Arrays.asList("paper", "chase"),
        new AndCondition(new QuestNotStartedCondition(QUEST_SLOT), new SystemPropertyCondition("stendhal.minetown")),
      ConversationStates.ATTENDING, "Oh, that is a nice #quest.", null);
    npc.add(ConversationStates.ATTENDING, Arrays.asList("paper", "chase"),
      new AndCondition(
          new QuestStartedCondition(QUEST_SLOT),
          new QuestNotInStateCondition(QUEST_SLOT, 0, "Fidorea"),
          new QuestNotInStateCondition(QUEST_SLOT, 0, "done"),
          new SystemPropertyCondition("stendhal.minetown")),
      ConversationStates.ATTENDING, "I guess you still have to talk to some people.", null);

    ChatAction reward = new MultipleActions(
      new IncreaseKarmaAction(15),
      new IncreaseXPAction(400),
      new SetQuestAction(QUEST_SLOT, 0, "done"),
      new EquipItemAction("empty scroll", 5),
      new SetHallOfFameToAgeDiffAction(QUEST_SLOT, 1, "P"),
      loadSignFromHallOfFame);
 
    npc.add(ConversationStates.ATTENDING, Arrays.asList("paper", "chase"),
View Full Code Here

    final String answer = "Guessed who supplies Xin Blanca with the weapons he sells? Well, it's me! I have to avoid raising suspicion, though, so I can only smuggle him small weapons. If you want something more powerful, you'll have to venture into the dungeons and kill some of the creatures there for items.\n";

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new EquipItemAction("money", 5));
    reward.add(new IncreaseXPAction(10));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
   
    npc.add(ConversationStates.INFORMATION_3,
        Arrays.asList("buy", "sell", "offer", "sell studded shield"),
        new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.IDLE,
View Full Code Here

        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start")),
        ConversationStates.QUEST_ITEM_BROUGHT,
        "Welcome back! Have you brought the "
            + Grammar.quantityplnoun(REQUIRED_HAM, "ham", "") + "?",
      new SetQuestAction(QUEST_SLOT,"start;ham=10"));

    // player returns while quest is active
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "start;")),
View Full Code Here

  final SpeakerNPC npc = npcs.get("Lorenz")
 
      final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("scythe"));
    reward.add(new IncreaseXPAction(1000));
    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")),
View Full Code Here

 
    npc.add(ConversationStates.ATTENDING, "Lorenz",
        new QuestInStateCondition(QUEST_SLOT, "capture"),
        ConversationStates.ATTENDING,
        "You want to know why he is in there? He and his ugly friends dug the #tunnel to our sweet Island! That's why he got jailed!",
        new SetQuestAction(QUEST_SLOT, "princess"));
   
    npc.add(ConversationStates.ATTENDING, "tunnel",
        new QuestInStateCondition(QUEST_SLOT, "princess"),
        ConversationStates.ATTENDING, "I am angry now and won't speak any more of it! If you want to learn more you'll have to ask him about the #tunnel!",
        null)
View Full Code Here

 
    npc.add(ConversationStates.ATTENDING, "tunnel",
        new QuestInStateCondition(QUEST_SLOT, "princess"),
        ConversationStates.ATTENDING,
        "What she drives me nuts, like all the flowers! This makes me hungry, go and get an #egg for me! Just let me know, you got one.",
        new SetQuestAction(QUEST_SLOT, "egg"))
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "capture"),
        ConversationStates.ATTENDING,
View Full Code Here

    final SpeakerNPC npc = npcs.get("Lorenz")
   
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("egg"));
    reward.add(new IncreaseXPAction(1000));
    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")),
View Full Code Here

TOP

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

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.