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

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


  private void prepareBringingStep() {
    final SpeakerNPC npc = npcs.get("Ortiv Milquetoast");
 
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestActiveCondition(QUEST_SLOT)),
        ConversationStates.QUESTION_2,
        "Hello again! I'm glad to see you. Did you bring me any #ingredients for my mixture?",
        null);
   
    /* player asks what exactly is missing (says ingredients) */
    npc.add(ConversationStates.QUESTION_2, "ingredients", null,
        ConversationStates.QUESTION_2, null,
        new SayRequiredItemsFromCollectionAction(QUEST_SLOT, "I need [items]. Did you bring something?"));

    /* player says he has a required item with him (says yes) */
    npc.add(ConversationStates.QUESTION_2,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.QUESTION_2, "Awesome, what did you bring?",
        null);

    ChatAction completeAction = new  MultipleActions(
        new SetQuestAction(QUEST_SLOT, "done"),
        new SayTextAction("Thank you so much! Now I can start mixing the mixture which will hopefully keep me safe inside of my own house without the assassins and bandits comming up from downstairs. Here is an assassin dagger for you. I had to take it away from one of my students in the class once and now you can maybe fight and win against them."),
        new IncreaseXPAction(5000),
        new IncreaseKarmaAction(25),
        new EquipItemAction("assassin dagger", 1 ,true)
        );
    /* add triggers for the item names */
    final ItemCollection items = new ItemCollection();
    items.addFromQuestStateString(NEEDED_ITEMS);
    for (final Map.Entry<String, Integer> item : items.entrySet()) {
      npc.add(ConversationStates.QUESTION_2, item.getKey(), null,
          ConversationStates.QUESTION_2, null,
          new CollectRequestedItemsAction(
              item.getKey(), QUEST_SLOT,
              "Wonderful! Did you bring anything else with you?", "You brought me that ingredient already.",
              completeAction, ConversationStates.ATTENDING));
    }

    /* player says he didn't bring any items (says no) */
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.NO_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Ok, well I have to be a bit more patient then. Just let me know if I can #help you somehow instead.",
        null);

    /* player says he didn't bring any items to different question */
    npc.add(ConversationStates.QUESTION_2,
        ConversationPhrases.NO_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Ok, well I have to be a bit more patient then. Just let me know if I can #help you somehow instead.", null);

    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
View Full Code Here


        "Do you think you could find my children again?",
        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestActiveCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Why must my children stay out so long? Please find them and tell me who is ok.",
        null);

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

    // the player returns to Agnus after having started the quest, or found
    // some kids.
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestActiveCondition(QUEST_SLOT)),
        ConversationStates.QUESTION_1,
        "If you found any of my #children, please tell me their name.", null);

    for(final String name : NEEDED_KIDS) {
      npc.add(ConversationStates.QUESTION_1, name, null,
View Full Code Here

      "Make revenge! Kill de Mountain Orc Chief! unnerstand? ok?",
      null);

    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestActiveCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "Make revenge! #Kill Mountain Orc Chief!",
      null);

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

        add(ConversationStates.IDLE,
            ConversationPhrases.GREETING_MESSAGES,
            new AndCondition(new GreetingMatchesNameCondition(super.getName()),
                new QuestCompletedCondition(GRAFINDLE_QUEST_SLOT),
                new QuestCompletedCondition(ZARA_QUEST_SLOT),
                new QuestActiveCondition(QUEST_SLOT)),
              ConversationStates.ATTENDING,
              null,
              new SayTextWithPlayerNameAction("Welcome to the Wizard's Bank, [name]. You may #leave sooner, if required."));
       
        // hasn't got access to all banks yet
        add(ConversationStates.IDLE,
            ConversationPhrases.GREETING_MESSAGES,
            new AndCondition(new GreetingMatchesNameCondition(super.getName()),
              new OrCondition(
                  new QuestNotCompletedCondition(GRAFINDLE_QUEST_SLOT),
                  new QuestNotCompletedCondition(ZARA_QUEST_SLOT))),
            ConversationStates.IDLE,
            "You may not use this bank if you have not gained the right to use the chests at Nalwor, nor if you have not earned the trust of a certain young woman. Goodbye!",
            null);
       
        add(ConversationStates.ATTENDING,
            Arrays.asList("fee", "enter"),
            new QuestNotActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "The fee is " + COST
            + " money. Do you want to pay?",
            null);
       
        add(ConversationStates.ATTENDING,
            Arrays.asList("fee", "enter"),
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "As you already know, the fee is "
            + COST + " money.",
            null);
       
        add(ConversationStates.ATTENDING,
            ConversationPhrases.YES_MESSAGES,
            new AndCondition(
                new PlayerHasItemWithHimCondition("money", COST),
                new QuestNotActiveCondition(QUEST_SLOT)),
                ConversationStates.ATTENDING,
                "Semos, Nalwor and Fado bank chests are to my right. The chests owned by Ados Bank Merchants and your friend Zara are to my left. If you are finished before your time here is done, please say #leave.",
                new MultipleActions(
                    new DropItemAction("money", COST),
                    new TeleportAction(ZONE_NAME, 10, 10, Direction.DOWN),
                    new SetQuestAction(QUEST_SLOT, "start"),
                    new ChatAction() {
                      public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
                        SingletonRepository.getTurnNotifier().notifyInTurns(0, new Timer(player));
                      }}));
       
        add(ConversationStates.ATTENDING,
            ConversationPhrases.YES_MESSAGES,
            new AndCondition(
                new NotCondition(new PlayerHasItemWithHimCondition("money", COST)),
                new QuestNotActiveCondition(QUEST_SLOT)),
            ConversationStates.ATTENDING,
            "You do not have enough money!",
            null);
       
        add(ConversationStates.ATTENDING,
            ConversationPhrases.YES_MESSAGES,
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Hm, I do not understand you. If you wish to #leave, just say",
            null);

        add(ConversationStates.ATTENDING,
            ConversationPhrases.NO_MESSAGES,
            new QuestNotActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Very well.",
            null);

        add(ConversationStates.ATTENDING,
            ConversationPhrases.NO_MESSAGES,
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Hm, I do not understand you. If you wish to #leave, just say",
            null);

        add(ConversationStates.ATTENDING,
            "leave",
            new QuestNotActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Leave where?",
            null);


        add(ConversationStates.ATTENDING,
            "leave",
            new QuestActiveCondition(QUEST_SLOT),
            ConversationStates.ATTENDING,
            "Thank you for using the Wizard's Bank",
            // we used to use teleportAway() here
            new MultipleActions(
                new TeleportAction(ZONE_NAME, 15, 16, Direction.DOWN),
View Full Code Here

      states = new ConversationStates[] {ConversationStates.ATTENDING};
    }

    concreteQuest.getNPC().add(states,
      concreteQuest.getTriggerPhraseToEnumerateMissingItems(),
      new QuestActiveCondition(concreteQuest.getSlotName()),
      ConversationStates.QUESTION_1, null,
      new ChatAction() {
        public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
          final List<String> missingItems = getListOfStillMissingItems(player, true);
          raiser.say(concreteQuest.askForMissingItems(missingItems));
View Full Code Here

   */
  protected void playerWantsToGiveItems() {
    final ConversationStates[] states = new ConversationStates[] {ConversationStates.ATTENDING, ConversationStates.QUESTION_1};
    concreteQuest.getNPC().add(states,
      ConversationPhrases.YES_MESSAGES,
      new QuestActiveCondition(concreteQuest.getSlotName()),
      ConversationStates.QUESTION_1, concreteQuest.askForItemsAfterPlayerSaidHeHasItems(),
      null);
  }
View Full Code Here

  protected void welcomeKnownPlayer() {
    concreteQuest.getNPC().add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(concreteQuest.getNPC().getName()),
          new QuestActiveCondition(concreteQuest.getSlotName())),
      ConversationStates.ATTENDING,
      concreteQuest.welcomeDuringActiveQuest(),
      null);
  }
View Full Code Here

        // If quest is still active but not handed over do not give an other sheep to the player
        npc.add(
                ConversationStates.ATTENDING,
                ConversationPhrases.QUEST_MESSAGES,
                new AndCondition(
                    new QuestActiveCondition(QUEST_SLOT),
                    new NotCondition(new QuestInStateCondition(QUEST_SLOT, "asked")),
                    new NotCondition(new QuestInStateCondition(QUEST_SLOT, "handed_over"))),
                ConversationStates.ATTENDING,
                "I already gave you one of my sheep. " +
                "If you left it on its own I can sell you a new one. Just say #buy #sheep.",
View Full Code Here

TOP

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

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.