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

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


  private void prepareCowardSoldier() {
    final SpeakerNPC henry = npcs.get("Henry");

    henry.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT),
               new QuestNotInStateCondition(QUEST_SLOT,"map")),
      ConversationStates.QUEST_OFFERED,
      "Find my #group, Peter, Tom, and Charles, prove it and I will reward you. Will you do it?",
      null);
   
    henry.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(new QuestCompletedCondition(QUEST_SLOT),
                 new QuestInStateCondition(QUEST_SLOT,"map")),
        ConversationStates.ATTENDING,
        "I'm so sad that most of my friends are dead.",
        null);
   
    henry.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.ATTENDING,
      "Thank you! I'll be waiting for your return.",
      new SetQuestAndModifyKarmaAction(QUEST_SLOT, "start", 5.0));

    henry.add(
      ConversationStates.QUEST_OFFERED,
      "group",
      null,
      ConversationStates.QUEST_OFFERED,
      "The General sent five of us to explore this area in search for #treasure. So, will you help me find them?",
      null);

        henry.add(
        ConversationStates.QUEST_OFFERED,
        "treasure",
        null,
        ConversationStates.QUEST_OFFERED,
        "A big treasure is rumored to be #somewhere in this dungeon. Will you help me find my group?",
        null);

    henry.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES, null,
        ConversationStates.ATTENDING,
        "OK. I understand. I'm scared of the #dwarves myself.",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0));
   
    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new IncreaseXPAction(2500));
    actions.add(new DropInfostringItemAction("leather legs","tom"));
    actions.add(new DropInfostringItemAction("scale armor","peter"));
    actions.add(new IncreaseKarmaAction(15.0))
    actions.add(new GiveMapAction(false));
   
    henry.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(henry.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasInfostringItemWithHimCondition("leather legs", "tom"),
            new PlayerHasInfostringItemWithHimCondition("note", "charles"),
            new PlayerHasInfostringItemWithHimCondition("scale armor", "peter")),
        ConversationStates.ATTENDING,
        "Oh my! Peter, Tom, and Charles are all dead? *cries*. Anyway, here is your reward. And keep the IOU.",
        new MultipleActions(actions));

    henry.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(henry.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(
                new AndCondition(
                    new PlayerHasInfostringItemWithHimCondition("leather legs", "tom"),
                    new PlayerHasInfostringItemWithHimCondition("note", "charles"),
                    new PlayerHasInfostringItemWithHimCondition("scale armor", "peter")))),
        ConversationStates.ATTENDING,
        "You didn't prove that you have found them all!",
        null);

    henry.add(ConversationStates.ATTENDING, Arrays.asList("map", "group", "help"),
        new OrCondition(
          new  QuestCompletedCondition(QUEST_SLOT),
          new AndCondition(new HenryQuestCompletedCondition(),
          new PlayerOwnsItemIncludingBankCondition("map"))),
        ConversationStates.ATTENDING,
        "I'm so sad that most of my friends are dead.", null);

    henry.add(ConversationStates.ATTENDING, Arrays.asList("map"),
        new AndCondition(
          new  QuestNotCompletedCondition(QUEST_SLOT),
          new HenryQuestCompletedCondition(),
          new NotCondition(new PlayerOwnsItemIncludingBankCondition("map"))),
        ConversationStates.ATTENDING,
        "Luckily I drew a copy of the map, but please don't lose this one.",
        new GiveMapAction(true));
View Full Code Here


        // used for any other purpose
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(
            new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotCompletedCondition("Monogenes")),
        ConversationStates.INFORMATION_1,
        "Hello there, stranger! Don't be too intimidated if people are quiet and reserved... " +
        "the fear of Blordrough and his forces has spread all over the country, and we're all " +
        "a bit concerned. I can offer a few tips on socializing though, would you like to hear them?",
        new SetQuestAction("Monogenes", "done"));
View Full Code Here

    final SpeakerNPC npc = npcs.get("McPegleg");

    npc.add(ConversationStates.ATTENDING,
      Arrays.asList("iou", "henry", "charles", "note"),
      new QuestNotCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING, null,
      new ChatAction() {

        public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
          // from all notes that the player is carrying, try to
View Full Code Here

            }
        );
        add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(super.getName()),
              new QuestNotCompletedCondition(QUEST_SLOT)),
          ConversationStates.IDLE,
          "Merry Christmas! I have a present and a hat for you. Good bye, and remember to behave if you want a present next year!",
          new MultipleActions(reward));
      }
    };
View Full Code Here

          new SayTextWithPlayerNameAction("Hi again, [name]. I remember that you solved this problem already. You can do it again, of course."));
     
      add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(getName()),
              new QuestNotCompletedCondition(QUEST_SLOT)),
          ConversationStates.ATTENDING,
          "Hi, welcome to our small game. Your task is to let this arrow point upwards, by moving up to three tokens.",
          null);
     
      addHelp("You have to stand next to a token in order to move it.");
View Full Code Here

   
    // player is old enough and hasn't got a house but has not done required quest
    add(ConversationStates.ATTENDING,
         Arrays.asList("cost", "house", "buy", "purchase"),
         new AndCondition(new AgeGreaterThanCondition(HouseSellerNPCBase.REQUIRED_AGE),
                  new QuestNotCompletedCondition(KirdnehHouseSeller.KIRDNEH_QUEST_SLOT),
                   new QuestNotStartedCondition(HouseSellerNPCBase.QUEST_SLOT)),
         ConversationStates.ATTENDING,
         "The cost of a new house in Kirdneh is "
         + getCost()
         + " money. But my principle is never to sell a house without establishing first the good #reputation of the prospective buyer.",
View Full Code Here

   
    // player is old enough and hasn't got a house but has not done required quest
    add(ConversationStates.ATTENDING,
         Arrays.asList("cost", "house", "buy", "purchase", "apartment"),
         new AndCondition(new AgeGreaterThanCondition(HouseSellerNPCBase.REQUIRED_AGE),
                  new QuestNotCompletedCondition(AthorHouseSeller.FISHLICENSE2_QUEST_SLOT),
                  new QuestNotStartedCondition(HouseSellerNPCBase.QUEST_SLOT)),
         ConversationStates.ATTENDING,
         "What do you want with an apartment on Athor when you're not even a good #fisherman? We are trying to attract owners who will spend time on the island. Come back when you have proved yourself a better fisherman.",
         null);
   
View Full Code Here

  private void specialStuff() {
    getNPC().add(
        ConversationStates.ATTENDING,
        ConversationPhrases.NO_MESSAGES,
        new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.IDLE,
        "Then you should go away before I get in trouble for talking to you. Bye.",
        null);
  }
View Full Code Here

  private void createRequestingStep() {
    final SpeakerNPC monogenes = npcs.get("Monogenes");

    monogenes.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestNotCompletedCondition(QUEST_SLOT),
      ConversationStates.QUEST_OFFERED,
      "Could you bring me a #hat to cover my bald head? Brrrrr! The days here in Semos are really getting colder...",
      null);

    monogenes.add(ConversationStates.ATTENDING,
View Full Code Here

    npc.add(ConversationStates.ATTENDING,
      "challenge",
      new AndCondition(new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
           new QuestNotStartedCondition(QUEST_SLOT),
           new OrCondition(new QuestNotCompletedCondition(CLUB_THORNS_QUEST_SLOT),
               new QuestNotCompletedCondition(IMMORTAL_SWORD_QUEST_SLOT))),
      ConversationStates.ATTENDING,
      "There is still a quest in the Kotoch area which you have not completed. Explore thoroughly and you will be on your way to becoming the ultimate collector!",
      null);


    npc.add(ConversationStates.ATTENDING,
      "challenge",
      new AndCondition(new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
           new QuestNotStartedCondition(QUEST_SLOT),
           new OrCondition(new QuestNotCompletedCondition(MITHRIL_CLOAK_QUEST_SLOT),
               new QuestNotCompletedCondition(MITHRIL_SHIELD_QUEST_SLOT))),
      ConversationStates.ATTENDING,
      "You are missing a special mithril item which you can win if you help the right person, you cannot be an ultimate collector without it.",
      null);

    npc.add(ConversationStates.ATTENDING,
      "challenge",
      new AndCondition(new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
           new QuestNotStartedCondition(QUEST_SLOT),
           new OrCondition(new QuestNotCompletedCondition(OBSIDIAN_KNIFE_QUEST_SLOT),
               new QuestNotCompletedCondition(VAMPIRE_SWORD_QUEST_SLOT))),
      ConversationStates.ATTENDING,
      "There is a dwarf blacksmith living alone deep underground who would forge a special weapon for you, you cannot be an ultimate collector without this.",
      null);

    npc.add(ConversationStates.ATTENDING,
      "challenge",
      new AndCondition(new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
           new QuestNotStartedCondition(QUEST_SLOT),
           new OrCondition(new QuestNotCompletedCondition(CLOAKSCOLLECTOR2_QUEST_SLOT),
               new QuestNotCompletedCondition(CLOAKS_FOR_BARIO_QUEST_SLOT))),
      ConversationStates.ATTENDING,
      "A special item will be yours if you collect many cloaks, whether to fulfil another's vanity or keep them warm, it's a task you must complete.",
      null);

    npc.add(ConversationStates.ATTENDING,
      "challenge",
      new AndCondition(new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
           new QuestNotStartedCondition(QUEST_SLOT),
           new QuestNotCompletedCondition(ELVISH_ARMOR_QUEST_SLOT)),
      ConversationStates.ATTENDING,
      "Another collector of items still needs your help. You'd find him in Fado Forest, and until you have completed that favour for him, you cannot be the ultimate collector.",
      null);

    npc.add(ConversationStates.ATTENDING,
      "challenge",
      new AndCondition(new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
           new QuestNotStartedCondition(QUEST_SLOT),
           new QuestNotCompletedCondition(KANMARARN_QUEST_SLOT)),
      ConversationStates.ATTENDING,
      "You've collected so many special items, but you have never helped those down in Kanmararn city. You should complete a task there.",
      null);
   
  }
View Full Code Here

TOP

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

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.