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

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


  private void buildConditions() {
    noFriends = new QuestNotStartedCondition("susi");
    anyFriends = new QuestStartedCondition("susi");
    oldFriends = new OrCondition(
        new QuestInStateCondition("susi", "friends"),
        new QuestSmallerThanCondition("susi", Calendar.getInstance().get(Calendar.YEAR)));
    currentFriends = new QuestInStateCondition("susi", Integer.toString(Calendar.getInstance().get(Calendar.YEAR)));
  }
View Full Code Here


      null);

    // friends
    npc.add(
      ConversationStates.ATTENDING, Arrays.asList("friend", "friends", "friendship"),
      new QuestInStateCondition("susi", Integer.toString(Calendar.getInstance().get(Calendar.YEAR))),
      ConversationStates.ATTENDING,
      "Thanks for being a friend.", null);

    addFirstQuest();
    addSecondQuest();
View Full Code Here

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
      new AndCondition(
          new LevelGreaterThanCondition(2),
          new QuestNotStartedCondition(QUEST_SLOT),
          new NotCondition(new QuestInStateCondition(QUEST_SLOT,"rejected"))),
      ConversationStates.QUESTION_1,
      "Hm, Do you know what I do for a living?", null);

    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestInStateCondition(QUEST_SLOT,"rejected"),
      ConversationStates.QUEST_OFFERED,
      "Hey, are you going to help me yet?", null);

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

   
    // says hi - got the snow yeti asked for
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasItemWithHimCondition("snowball", REQUIRED_SNOWBALLS)),
        ConversationStates.QUEST_ITEM_BROUGHT,
        "Greetings stranger! I see you have the snow I asked for. Are these snowballs for me?",
        null);

    // says hi - didn't get the snow yeti asked for
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(new PlayerHasItemWithHimCondition("snowball", REQUIRED_SNOWBALLS))),
        ConversationStates.ATTENDING,
        "You're back already? Don't forget that you promised to collect a bunch of snowballs for me!",
        null);
   
    // says hi - quest was done before and is now repeatable
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "start"),
            new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES)),
        ConversationStates.ATTENDING,
        "Greetings again! Have you seen my latest snow sculptures? I need a #favor again ...",
        null);
   
    // says hi - quest was done before and is not yet repeatable
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, REQUIRED_MINUTES, "I have enough snow for my new sculpture. Thank you for helping! "
            + "I might start a new one in" ));

    // asks about quest - has never started it
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestNotStartedCondition(QUEST_SLOT),
        ConversationStates.QUEST_OFFERED,
        "I like to make snow sculptures, but the snow in this cavern is not good enough. Would you help me and get some snowballs? I need twenty five of them.",
        null);
   
    // asks about quest but already on it
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "start"),
        ConversationStates.ATTENDING,
        "You already promised me to bring some snowballs! Twenty five pieces, remember ...",
        null);
   
    // asks about quest - has done it but it's repeatable now
View Full Code Here

        null);

    /** Remind player about the quest */
    npc.add(ConversationStates.ATTENDING,
        "flask",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new NotCondition(new PlayerHasItemWithHimCondition("flask"))),
        ConversationStates.ATTENDING,
        "*cough* Oh dear... I really need this medicine! Please hurry back with the #flask from #Margaret.",
        null);

        /** Remind player about the quest */
        npc.add(ConversationStates.ATTENDING,
                ConversationPhrases.QUEST_MESSAGES,
                new QuestInStateCondition(QUEST_SLOT, "start"),
                ConversationStates.ATTENDING,
                "*cough* Oh dear... I really need this medicine! Please hurry back with the #flask from #Margaret.",
                null);

    npc.add(ConversationStates.ATTENDING, "margaret", null,
View Full Code Here

    // 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);

    // another reminder incase player says task again
        npc.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
                new QuestInStateCondition(QUEST_SLOT, "ilisa"),
                ConversationStates.ATTENDING,
                "I need you to take a flask to #ilisa... she'll know what to do next.",
                null);

    npc.add(ConversationStates.ATTENDING, "ilisa", null,
View Full Code Here

    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

  private void offerQuestStep() {
    final SpeakerNPC npc = npcs.get("Tywysoga");

    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new OrCondition(new QuestNotStartedCondition(QUEST_SLOT), new QuestInStateCondition(QUEST_SLOT, 0, "rejected")),
      ConversationStates.QUEST_OFFERED,
      "Will you find the wandering flower seller, Rose Leigh, and get from her my favourite flower, the Rhosyd?",
      null);

        // shouldn't happen: is a repeatable quest
    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestCompletedCondition("QUEST_SLOT"),
      ConversationStates.ATTENDING,
      "I have plenty of blooms now thank you.", null);
   
    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestInStateCondition(QUEST_SLOT, 0, "flower_brought"),
      ConversationStates.QUEST_OFFERED,
      "The last Rhosyd you brought me was so lovely. Will you find me another from Rose Leigh?",
      null);

    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new OrCondition(new QuestInStateCondition(QUEST_SLOT, 0, "start"), new QuestInStateCondition(QUEST_SLOT, 0, "got_flower")),
      ConversationStates.ATTENDING,
      "I do so love those pretty flowers from Rose Leigh ...",
      null);

    // Player agrees to collect flower
View Full Code Here

        // give the flower if it's at least 5 minutes since the flower was last given, and set the time slot again
    rose.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
               new QuestInStateCondition(QUEST_SLOT, 0, "start"),
               new PlayerCanEquipItemCondition("rhosyd"),
                             new TimePassedCondition(QUEST_SLOT, 1, DELAY)),
      ConversationStates.IDLE,
      "Hello dearie. My far sight tells me you need a pretty flower for some fair maiden. Here ye arr, bye now.",
      new MultipleActions(new EquipItemAction("rhosyd", 1, true),
                                new SetQuestAction(QUEST_SLOT, 0, "got_flower"),
                                new SetQuestToTimeStampAction(QUEST_SLOT, 1)));

    // don't put the flower on the ground - if player has no space, tell them
    rose.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
                 new QuestInStateCondition(QUEST_SLOT, 0, "start"),
                                 new TimePassedCondition(QUEST_SLOT, 1, DELAY),
                 new NotCondition(new PlayerCanEquipItemCondition("rhosyd"))),
        ConversationStates.IDLE,
        "Shame you don't have space to take a pretty flower from me. Come back when you can carry my precious blooms without damaging a petal.",
        null);
   
        // don't give the flower if one was given within the last 5 minutes
        rose.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
                 new QuestInStateCondition(QUEST_SLOT, 0, "start"),
                                 new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, DELAY))),
        ConversationStates.IDLE,
        "I gave you a flower not five minutes past! Her Royal Highness can enjoy that one for a while.",
        null);
     
      final ChatCondition lostFlowerCondition = new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
         // had got the flower before and was supposed to take it to the princess next
           new QuestInStateCondition(QUEST_SLOT, 0, "got_flower"),
         // check chest and so on first - maybe the player does still have it (though we can't check house chests or the floor)
         new ChatCondition() {
             public boolean fire(final Player player, final Sentence sentence, final Entity entity) {
               return player.getTotalNumberOf("rhosyd") == 0;
             }
View Full Code Here

        npc.say("Thank you! Take these " + Integer.toString(goldamount) + " gold bars, I have plenty. And, listen: If you'd ever like to get me another, be sure to ask me first. Rose Leigh is superstitious, she won't give the bloom unless she senses you need it.");
      }
    };
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("flower", "Rhosyd"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "got_flower"), new PlayerHasItemWithHimCondition("rhosyd")),
        ConversationStates.ATTENDING, null,
        new MultipleActions(new DropItemAction("rhosyd"),
                                    new IncreaseXPAction(5000),
                                    new IncreaseKarmaAction(15),
                  addRandomNumberOfItemsAction,
View Full Code Here

TOP

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

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.