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

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


        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new PlayerHasInfostringItemWithHimCondition("water", CLEAN_WATER_INFOSTRING)),
        ConversationStates.ATTENDING,
        "Thank you ever so much! That's just what I wanted! Here, take these potions that Sarzina gave me - I hardly have use for them here.",
        new MultipleActions(reward));
   
        // player returns with no water at all.
    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"),
View Full Code Here

    npc.add(ConversationStates.INFORMATION_3,
        Arrays.asList("buy", "sell", "offer", "sell studded shield"),
        new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.IDLE,
        answer + "If anybody asks, you don't know me!",
        new MultipleActions(reward));

    npc.add(ConversationStates.INFORMATION_3,
        Arrays.asList("buy", "sell", "offer", "sell studded shield"),
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.IDLE,
View Full Code Here

   
        // 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."))
    );

View Full Code Here

 
    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,1),
      ConversationStates.ATTENDING, "Thank you! You have rescued our rare animals.",
      new MultipleActions(actions));

        npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
            ConversationPhrases.YES_MESSAGES,
            new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT,1)),
            ConversationStates.ATTENDING, null,
View Full Code Here

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

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

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

        ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Oh, thank you! I'll wait up here, and if any try to escape I'll hit them with the broom!",
        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));
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.