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

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


      ConversationStates.ATTENDING, "I'm worried about my brother who lives in Ados. I need someone to take some #food to him.",
      null);
   
    /** In case quest is completed */
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
      new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "My brother has enough food now, many thanks.", null);

    /** In case quest is completed */
    npc.add(ConversationStates.ATTENDING, "food",
      new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "My brother has enough sandwiches now, thank you.", null);

    /** If quest is not started yet, start it. */
    npc.add(
 
View Full Code Here


      ConversationStates.QUEST_OFFERED,
      "Are you someone who likes to help others?", null);

    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "If you want to get good #karma all you have to do is be helpful to others. I know a hunter girl called Sally who needs wood, and "
      + "I know another girl called Annie who loves icecream, well, I know many people who needs tasks doing for them regularly and I'm sure if you help them you will be rewarded, that's how karma works after all.", null);

    // player is willing to help other people
View Full Code Here

                null);
       
        add(ConversationStates.IDLE,
            ConversationPhrases.GREETING_MESSAGES,
            new AndCondition(new GreetingMatchesNameCondition(getName()),
                new QuestCompletedCondition("introduce_players")),
                ConversationStates.ATTENDING,
                null,
                new SayTextWithPlayerNameAction("Hi again, [name]! Thanks again, I'm feeling much better now."));
       
        addGoodbye();
View Full Code Here

        addReply("safety", "When you are standing at a chest to organise your items, any other people or animals will not be able to come near you. A magical aura stops others from using scrolls to arrive near you. You will need to walk out. Lastly let me tell you about safe #trading.");
        addReply("trading", "To start a trade with another player, right-click on them and select 'Trade'. If they also want to trade with you, you'll see a window pop up where you can drag items to offer, and see what is being offered to you. Both click Offer, and then you both need to Accept the offer to complete the trade.");
        addJob("I'm the Customer Advisor here at Semos Bank.");
        addOffer("If you wish to access your personal chest in solitude, I can give you access to a private #vault. A guidebook inside will explain how it works.");   
        addGoodbye("It was a pleasure to serve you.");
        add(ConversationStates.ANY, "vault", new QuestCompletedCondition("armor_dagobert"), ConversationStates.IDLE, null,
            new MultipleActions(new PlaySoundAction("keys-1", true), new VaultChatAction()));
       
        add(ConversationStates.ANY, "vault", new QuestNotCompletedCondition("armor_dagobert"), ConversationStates.ATTENDING, "Perhaps you could do a #favour for me, and then I will tell you more about the private banking vaults.", null);
       
        // remaining behaviour defined in games.stendhal.server.maps.quests.ArmorForDagobert 
View Full Code Here

            new MultipleActions(actions));

           add(ConversationStates.IDLE,
            ConversationPhrases.GREETING_MESSAGES,
            new AndCondition(new GreetingMatchesNameCondition(getName()),
                new QuestCompletedCondition(QUEST_SLOT),
                new NotCondition(new QuestActiveCondition(BeerForHayunn.QUEST_SLOT))),
            ConversationStates.ATTENDING,
            "Hi again, how can I #help you this time?",
            null);
            
View Full Code Here

        null);
   
    // player can repeat quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "My throat is dry again from all this talking, could you fetch me a little more water?",
        null)
   
    // player can't repeat quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        "Thank you, I don't need anything right now.",
        null)
   
    // if the quest is active we deal with the response to quest/water in a following step
View Full Code Here

    return 5;
  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
         new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)).fire(player,null, null);
  }
View Full Code Here

        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,
        answer + "Where did you get those weapons? A toy shop?",
        null);

    npc.add(new ConversationStates[] {
View Full Code Here

    );

        // Player returns within one week of completing quest
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
        ConversationStates.ATTENDING, "Welcome back to the Ados Wildlife Refuge! Thanks again for rescuing our animals!",
        null
    );

        // Player returns and longer than a week has passed, ask to help again
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new TimePassedCondition(QUEST_SLOT, 1, DELAY)),
        ConversationStates.QUEST_OFFERED, "Welcome back to the Ados Wildlife "
                + "Refuge! Our animals are hungry again, can you bring some more food please?",
                null);


        // Player has never done the zoo quest, player asks what the task was
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED, "Our animals are hungry. We need " +
            "more food to feed them. Can you help us?",
        null);

      final Map<String,Integer> items = new HashMap<String, Integer>();   
    items.put("ham",10);
    items.put("meat",15);
    items.put("grain",20);
    items.put("salad",10);
    items.put("button mushroom",5);
    items.put("carrot",5);
    items.put("spinach",5);
    items.put("apple",5);
    items.put("roach",3);
   
        // 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."))
    );


    // player is not willing to help
    npc.add(ConversationStates.QUEST_OFFERED, ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.ATTENDING, "Oh dear... I guess we're going to have to feed them with the deer...",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0)
    );
   
        // Player returns within one week of completing quest
    npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
                                 new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
        ConversationStates.ATTENDING, null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, DELAY, "Thanks, we have enough food to feed the animals here for another"));

  }
View Full Code Here

    final SpeakerNPC npc = npcs.get("Dr. Feelgood");

    // player returns while quest is still active
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
      ConversationStates.ATTENDING, "Hello! Now that the animals have enough food, they don't get sick that easily, and I have time for other things. How can I help you?",
        null
    );

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new OrCondition(new QuestNotCompletedCondition(QUEST_SLOT),
                new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new TimePassedCondition(QUEST_SLOT, 1, DELAY))
            )),
        ConversationStates.IDLE, "Sorry, can't stop to chat. The animals are all sick because they don't have enough food. See yourself out, won't you?",
        null
    );
  }
View Full Code Here

TOP

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

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.