Examples of GreetingMatchesNameCondition


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

    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,
View Full Code Here

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

    final SpeakerNPC rose = npcs.get("Rose Leigh");

        // 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;
             }
         },
        // just to check there is space
        new PlayerCanEquipItemCondition("rhosyd"),
        // note: older quest slots will pass this automatically, but they are old now.
                new TimePassedCondition(QUEST_SLOT, 1, 12*MathHelper.MINUTES_IN_ONE_WEEK));
          
      // if the player never had a timestamp stored (older quest) we have now added timestamp 1.
      // but that was a while ago that we changed it (November 2010?)
    rose.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      lostFlowerCondition,
      ConversationStates.QUESTION_1,
      "Hello dearie. Did you lose the flower I gave you last? If you need another say #yes but it's bad luck for me to have to give you it again, so you better be sure!",
      null);
   
    rose.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        lostFlowerCondition,
        ConversationStates.IDLE,
        "Heres a new flower to take the pretty lady, but mind you don't lose that one.",
        new MultipleActions(new EquipItemAction("rhosyd", 1, true),
                        new SetQuestAction(QUEST_SLOT, 0, "got_flower"),
                        // dock some karma for losing the flower
                        new IncreaseKarmaAction(-20.0),
                        new SetQuestToTimeStampAction(QUEST_SLOT, 1)));
   
    rose.add(ConversationStates.QUESTION_1,
        ConversationPhrases.NO_MESSAGES,
        lostFlowerCondition,
        ConversationStates.IDLE,
        "No worries dearie, you probably got it somewhere!",
        null);
   
        // don't give the flower if the quest state isn't start
        // unless it's been over 12 weeks and are in state got_flower?
      rose.add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(rose.getName()),
                   new QuestNotInStateCondition(QUEST_SLOT, 0, "start"),
                   new NotCondition(lostFlowerCondition)),
          ConversationStates.IDLE,
          "I've got nothing for you today, sorry dearie. I'll be on my way now, bye.",
          null);
View Full Code Here

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

  private void prepareBringingStep() {
    final SpeakerNPC npc = npcs.get("Hayunn Naratha");

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestActiveCondition(QUEST_SLOT),
          new PlayerHasItemWithHimCondition("beer")),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Hey! Is that beer for me?", null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestActiveCondition(QUEST_SLOT),
          new NotCondition(new PlayerHasItemWithHimCondition("beer"))),
      ConversationStates.ATTENDING,
      "Hey, I'm still waiting for that beer, remember? Anyway, what can I do for you?",
      null);
View Full Code Here

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

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

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

  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

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

  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

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

    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

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

    playerReturnsAfterCompletingQuest(scientistNpc);
  }

  private void playerReturnsToFetchReward(SpeakerNPC npc) {
    // time has passed
    final ChatCondition condition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT,"decorating"),
            new TimePassedCondition(QUEST_SLOT, 1, 5)
          );
    final ChatAction action = new MultipleActions(
                      new SetQuestAction(QUEST_SLOT,"done"),
                      new IncreaseKarmaAction(20),
                      new IncreaseXPAction(10000),
                      // here, true = bind them to player
                      new EquipItemAction("black legs", 1, true)
                    );
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        condition,
        ConversationStates.IDLE,
        "Here are the black legs. Now I beg you to wear them. The symbol of my pain is done. Fare thee well.",
        action);
   
    // time has not yet passed
    final ChatCondition notCondition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestStateStartsWithCondition(QUEST_SLOT,"decorating"),
        new NotCondition( new TimePassedCondition(QUEST_SLOT, 1, 5))
      );
    ChatAction reply = new SayTimeRemainingAction(QUEST_SLOT, 1, 5, "I did not finish decorating the legs. " +
            "Please check back in");
View Full Code Here

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

                    new SetQuestAction(QUEST_SLOT, "decorating;"),
                    new SetQuestToTimeStampAction(QUEST_SLOT, 1),
                    new DropItemAction("goblet",1)
                    );
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()), condition),
        ConversationStates.ATTENDING,
        "Ha, ha, ha! I will cover those jewelled legs with this blood and they will transform " +
        "into a #symbol of pain.",
        null);
   
View Full Code Here

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


  private void playerReturnsWithoutKillingTheImperialScientistOrWithoutGoblet(
      SpeakerNPC npc) {
    final ChatCondition condition = new AndCondition(
        new GreetingMatchesNameCondition(npc.getName()),
        new QuestStateStartsWithCondition(QUEST_SLOT, "kill_scientist"),
        new NotCondition(
            new AndCondition(
                    new KilledForQuestCondition(QUEST_SLOT, 1),
                    new PlayerHasItemWithHimCondition("goblet")))
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.