Examples of QuestNotStartedCondition


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

    // player says hi before starting the quest
    npc.add(
        ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotStartedCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "Hey! How did you get down here? You did what? Huh. Well, I'm Bario. I don't suppose you could do a #task for me?",
        null);

    // player is willing to help
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED,
        "I don't dare go upstairs anymore because I stole a beer barrel from the dwarves. But it is so cold down here... Can you help me?",
        null);

    // player should already be getting cloaks
View Full Code Here

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

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestCompletedCondition(FishermansLicenseQuiz.QUEST_SLOT),
          new QuestNotStartedCondition(QUEST_SLOT)),
      ConversationStates.ATTENDING,
      "Hello again! The second part of your #exam is waiting for you!",
      null);

    // player is willing to help
View Full Code Here

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

  public void testQuestOfferedToQuestion1() throws Exception {
    for (final String playerSays : ConversationPhrases.YES_MESSAGES) {
      final Player bob = PlayerTestHelper.createPlayer("bob");
      final double oldkarma = bob.getKarma();
      npcEngine.setCurrentState(ConversationStates.QUEST_OFFERED);
      assertTrue(new QuestNotStartedCondition(QUEST_SLOT).fire(bob, null, npc));

      npcEngine.step(bob, playerSays);
      assertThat(playerSays, npcEngine.getCurrentState(), is(ConversationStates.QUESTION_1));
      assertThat(playerSays, bob.hasQuest(QUEST_SLOT), is(true));
      assertThat(playerSays, bob.getKarma(), greaterThan(oldkarma));
View Full Code Here

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

    /** If quest is not started yet, start it. */
    npc.add(
      ConversationStates.ATTENDING,
      "gold",
      new QuestNotStartedCondition(QUEST_SLOT),
      ConversationStates.QUEST_OFFERED,
      "One of our customers needs to bank their gold bars here for safety. It's #Lorithien, she cannot close the Post Office so she never has time.",
      null);

    npc.add(
View Full Code Here

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

    /** Finally if player didn't start the quest, just ignore him/her */
    npc.add(
      ConversationStates.ATTENDING,
      "gold",
      new QuestNotStartedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "Sorry, I have so many things to remember ... I didn't understand you.",
      null);
  }
View Full Code Here

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

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new NotCondition(
                new OrCondition(
                    new QuestNotStartedCondition(QUEST_SLOT),
                    new QuestCompletedCondition(QUEST_SLOT))),
            new NotCondition(
                new TimePassedCondition(QUEST_SLOT, 1, expireDelay))),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(Player player, Sentence sentence, EventRaiser npc) {
            npc.say("You're already on a quest to slay " +
                Grammar.a_noun(player.getQuest(QUEST_SLOT,0).split(",")[0]) +
                ". Say #complete if you're done with it!");
          }     
        });
   
    // player have expired quest time
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new NotCondition(
                new OrCondition(
                    new QuestNotStartedCondition(QUEST_SLOT),
                    new QuestCompletedCondition(QUEST_SLOT))),
            new TimePassedCondition(QUEST_SLOT, 1, expireDelay)),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(Player player, Sentence sentence, EventRaiser npc) {
            if(player.getQuest(QUEST_SLOT, 0)!=null) {
                npc.say("You're already on a quest to slay " +
                    Grammar.a_noun(player.getQuest(QUEST_SLOT, 0).split(",")[0]) +
                    ". Say #complete if you're done with it!" +
                    " If you can't find one, perhaps it won't bother Semos either. You could kill #another creature if you like.");
            }
          }
        });
   
    // player asking for quest before allowed time interval
    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, "I can only give you a new quest once a day. Please check back in"));

    // player asked for quest first time or repeat it after passed proper time
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(
            new QuestNotStartedCondition(QUEST_SLOT),
            new AndCondition(
                new QuestCompletedCondition(QUEST_SLOT),
                new TimePassedCondition(QUEST_SLOT, 1, delay))),
        ConversationStates.ATTENDING,
        null,
View Full Code Here

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

   */
  private void step_3() {
    // player never asked for this quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.FINISH_MESSAGES,
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I'm afraid I didn't send you on a #quest yet.",
        null);

    // player already completed this quest
View Full Code Here

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

  private void step_4() {
    // player have no active quest and trying to get another
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.ABORT_MESSAGES,
        new OrCondition(
            new QuestNotStartedCondition(QUEST_SLOT),
            new QuestCompletedCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "I'm afraid I didn't send you on a #quest yet.",
        null);
   
View Full Code Here

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

    final SpeakerNPC npc = npcs.get("Princess Ylflia");
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I cannot free the captives in the basement but I could do one thing: ease their pain. " +
        "I need #herbs for this.",
        null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT,"recommended"),
        ConversationStates.ATTENDING,
        "Speak to my father, the King. I have asked him to grant you citizenship of Kalavan, " +
        "to express my gratitude to you.",
        null)
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new NotCondition(new QuestInStateCondition(QUEST_SLOT,"recommended"))),
        ConversationStates.ATTENDING,
        "I'm sure I asked you to do something for me, already.",
        null)

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "The trapped creatures looked much better last time I dared venture down to the basement, thank you!",
        null);

    /** If quest is not started yet, start it.
     * The amount of each item that the player must collect depends on their level when they started the quest.
     */
    npc.add(ConversationStates.ATTENDING, "herbs",
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED, null,
        new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            raiser.say("I need "
                + Integer.toString(1 + player.getLevel()
View Full Code Here

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

  private void step_1() {
    final SpeakerNPC npc = npcs.get("John");

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED,
        "My wife Jane and me are on vacation here on Athor island. #Unfortunately we can't explore the whole island because some ugly #creatures step in our way each time. Can you help us by killing some of them to turn our vacation into a good one?",
        null);

    npc.add(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.