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

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


   *            index of way point
   */
  private void addTaskToNPC(final int idx) {
    final String state = points.get(idx);
    final SpeakerNPC npc = npcs.get(state);
    npc.add(ConversationStates.ATTENDING, Arrays.asList("paper", "chase"), new SystemPropertyCondition("stendhal.minetown"),
        ConversationStates.ATTENDING, null, new PaperChasePoint(idx));
    if (NPC_IDLE.contains(state)) {
      npc.add(ConversationStates.ANY, Arrays.asList("paper", "chase"), new SystemPropertyCondition("stendhal.minetown"),
          ConversationStates.ANY, null, new PaperChasePoint(idx));
    }
  }
View Full Code Here


    // 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"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "Fidorea"), new SystemPropertyCondition("stendhal.minetown")),
      ConversationStates.ATTENDING,
      "Very good. You did the complete quest, talking to all those people around the world. I will add you name to the sign for everyone to see. And here are some magic scrolls as reward. They will help you on further travels.",
      reward);
  }
View Full Code Here

        ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(
            new GreetingMatchesNameCondition(npc.getName()),
            new NotCondition(
                new SystemPropertyCondition("stendhal.minetown")),
            new OrCondition(
                new PlayerIsWearingOutfitCondition(balloonList[0]),
                new PlayerIsWearingOutfitCondition(balloonList[1]),
                new PlayerIsWearingOutfitCondition(balloonList[2]),
                new PlayerIsWearingOutfitCondition(balloonList[3]))),
View Full Code Here

    npc.add(
        ConversationStates.ATTENDING,
        "balloon",
        new AndCondition(
            new NotCondition(
                new SystemPropertyCondition("stendhal.minetown")),
            new OrCondition(
                new PlayerIsWearingOutfitCondition(balloonList[0]),
                new PlayerIsWearingOutfitCondition(balloonList[1]),
                new PlayerIsWearingOutfitCondition(balloonList[2]),
                new PlayerIsWearingOutfitCondition(balloonList[3]))),
        ConversationStates.QUEST_ITEM_QUESTION,
        "Is that balloon for me?",
        null);

    npc.add(
        ConversationStates.ATTENDING,
        "balloon",
        new AndCondition(
            new NotCondition(
                new SystemPropertyCondition("stendhal.minetown")),
            new NotCondition(
                new OrCondition(
                    new PlayerIsWearingOutfitCondition(balloonList[0]),
                    new PlayerIsWearingOutfitCondition(balloonList[1]),
                    new PlayerIsWearingOutfitCondition(balloonList[2]),
                    new PlayerIsWearingOutfitCondition(balloonList[3])))),
        ConversationStates.ATTENDING,
        "You don't even have a balloon for me :(",
        null);

    npc.add(
        ConversationStates.ATTENDING,
        "balloon",
        new SystemPropertyCondition("stendhal.minetown"),
        ConversationStates.ATTENDING,
        "The clouds told me that the mine town weeks are still going -"
        + " I can get my own balloons."
        + " Come back when mine town weeks are over :)",
        null);
View Full Code Here

TOP

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

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.