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

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


   
    // starting the conversation the first time after getting a flask.
    // note Ilisa is spelled with a small i here because I
    // and l cannot be told apart in game
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasItemWithHimCondition("flask")),
        ConversationStates.ATTENDING,
        "Ok, you got the flask! Here take this money to cover your expense. Now, I need you to take it to #ilisa... she'll know what to do next.",
        new MultipleActions(processStep));

    // player said hi with flask on ground then picked it up and said flask
    npc.add(ConversationStates.ATTENDING, "flask",
                new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new PlayerHasItemWithHimCondition("flask")),
                ConversationStates.ATTENDING,
                "Ok, you got the flask! Here take this money to cover your expense. Now, I need you to take it to #ilisa... she'll know what to do next.",
                new MultipleActions(processStep));


    // remind the player to take the flask to ilisa.
    // note Ilisa is spelled with a small i here because I
    // and l cannot be told apart in game
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new PlayerHasItemWithHimCondition("flask")),
        ConversationStates.ATTENDING,
        "Ok, you got the flask! Now, I need you to take it to #ilisa... she'll know what to do next.",
        null);
View Full Code Here


  private void step_4() {
    final SpeakerNPC npc = npcs.get("Ilisa");

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new NotCondition(new PlayerHasItemWithHimCondition("flask"))),
        ConversationStates.ATTENDING,
        "Medicine for #Tad? Didn't he tell you to bring a flask?", null);

    final List<ChatAction> processStep = new LinkedList<ChatAction>();
    processStep.add(new DropItemAction("flask"));
    processStep.add(new IncreaseXPAction(10));
    processStep.add(new SetQuestAction(QUEST_SLOT, "corpse&herbs"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new PlayerHasItemWithHimCondition("flask")),
        ConversationStates.ATTENDING,
        "Ah, I see you have that flask. #Tad needs medicine, right? Hmm... I'll need a #herb. Can you help?",
        new MultipleActions(processStep));
View Full Code Here

  private void step_5() {
    final SpeakerNPC npc = npcs.get("Ilisa");

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "corpse&herbs"),
            new NotCondition(new PlayerHasItemWithHimCondition("arandula"))),
        ConversationStates.ATTENDING,
        "Can you fetch those #herbs for the #medicine?", null);

    final List<ChatAction> processStep = new LinkedList<ChatAction>();
    processStep.add(new DropItemAction("arandula"));
    processStep.add(new IncreaseXPAction(50));
    processStep.add(new SetQuestAction(QUEST_SLOT, "potion"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "corpse&herbs"),
            new PlayerHasItemWithHimCondition("arandula")),
        ConversationStates.ATTENDING,
        "Okay! Thank you. Now I will just mix these... a pinch of this... and a few drops... there! Can you ask #Tad to stop by and collect it? I want to see how he's doing.",
        new MultipleActions(processStep));
View Full Code Here

    processStep.add(new SetQuestAction(QUEST_SLOT, "done"));
   
    // note Ilisa is spelled with a small i here because I
    // and l cannot be told apart in game
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "potion")),
        ConversationStates.ATTENDING, "Thanks! I will go talk with #ilisa as soon as possible.",
        new MultipleActions(processStep));
  }
View Full Code Here

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

    monogenes.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(monogenes.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"),
          new PlayerHasItemWithHimCondition("leather helmet")),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Hey! Is that leather hat for me?", null);

    monogenes.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(monogenes.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"),
          new NotCondition(new PlayerHasItemWithHimCondition("leather helmet"))),
      ConversationStates.ATTENDING,
      "Hey, my good friend, remember that leather hat I asked you about before? It's still pretty chilly here...",
      null);
View Full Code Here


    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
          new QuestNotStartedCondition(QUEST_SLOT)),
      ConversationStates.ATTENDING,
      "Greetings old friend. I have another collecting #challenge for you.",
      null);

    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

    items.put("black sword",1); // 6285
   
    // If all quests are completed, ask for an item
    npc.add(ConversationStates.ATTENDING,
        "challenge",
        new AndCondition(
            new QuestCompletedCondition(WEAPONSCOLLECTOR2_QUEST_SLOT),
            new QuestNotStartedCondition(QUEST_SLOT),
            new QuestCompletedCondition(KANMARARN_QUEST_SLOT),
            new QuestCompletedCondition(ELVISH_ARMOR_QUEST_SLOT),
            new QuestCompletedCondition(CLOAKSCOLLECTOR2_QUEST_SLOT),
View Full Code Here

   
    final SpeakerNPC npc = npcs.get("Balduin");
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestActiveCondition(QUEST_SLOT)),
        ConversationStates.QUEST_ITEM_QUESTION,
        "Did you bring me that very rare item I asked you for?",
        null);
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                new NotCondition(new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT))),
        ConversationStates.ATTENDING,
        null,
        new SayRequiredItemAction(QUEST_SLOT, "Hm, no, you don't have [item], don't try to fool me!"));
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT),
                new PlayerHasRecordedItemWithHimCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "Wow, it's incredible to see this close up! Many thanks. Now, perhaps we can #deal together.",
        new MultipleActions(new DropRecordedItemAction(QUEST_SLOT),
                  new SetQuestAction(QUEST_SLOT, "done"),
View Full Code Here

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

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotCompletedCondition(QUEST_SLOT),
          new NotCondition(new PlayerHasItemWithHimCondition("teddy"))),
      ConversationStates.QUEST_OFFERED,
      "*cries* There were wolves in the #park! *sniff* I ran away, but I dropped my #teddy! Please will you get it for me? *sniff* Please?",
      null);
 
View Full Code Here

    reward.add(new IncreaseXPAction(20));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(10));
   
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
              new OrCondition(
                  new QuestNotStartedCondition(QUEST_SLOT),
                  new QuestNotCompletedCondition(QUEST_SLOT)),
              new PlayerHasItemWithHimCondition("teddy")),
      ConversationStates.ATTENDING,
      "You found him! *hugs teddy* Thank you, thank you! *smile*",
      new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING,
      "teddy",
      new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("teddy"))),
      ConversationStates.ATTENDING,
      "I lost my teddy in the #park over east, where all those #wolves are hanging about.",
      null);

    npc.add(ConversationStates.ATTENDING, "teddy",
      new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new PlayerHasItemWithHimCondition("teddy")),
      ConversationStates.ATTENDING,
      "That's not my teddy, I've got him right here! Remember, you found him for me!",
      null);
  }
View Full Code Here

TOP

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

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.