Examples of GreetingMatchesNameCondition


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

    final SpeakerNPC npc = npcs.get("Annie Jones");
   
    // first conversation with annie. be like [strike]every good child[/strike] kymara was when she was little and advertise name and age.
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotStartedCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "rejected")),
        ConversationStates.ATTENDING,
        "Hello, my name is Annie. I am five years old.",
        null);
   
    // player is supposed to speak to mummy now
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasItemWithHimCondition("icecream")),
        ConversationStates.IDLE,
        "Mummy says I mustn't talk to you any more. You're a stranger.",
        null);
   
    // player didn't get ice cream, meanie
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(new PlayerHasItemWithHimCondition("icecream"))),
        ConversationStates.ATTENDING,
        "Hello. I'm hungry.",
        null);
   
    // player got ice cream and spoke to mummy
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "mummy"),
            new PlayerHasItemWithHimCondition("icecream")),
        ConversationStates.QUESTION_1,
        "Yummy! Is that ice cream for me?",
        null);
   
    // player spoke to mummy and hasn't got ice cream
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "mummy"),
            new NotCondition(new PlayerHasItemWithHimCondition("icecream"))),
        ConversationStates.ATTENDING,
        "Hello. I'm hungry.",
        null);
   
    // player is in another state like eating
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotInStateCondition(QUEST_SLOT, "start"),
            new QuestNotInStateCondition(QUEST_SLOT, "mummy")),
        ConversationStates.ATTENDING,
        "Hello.",
        null);
   
    // player rejected quest
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "rejected")),
        ConversationStates.ATTENDING,
        "Hello.",
        null);
   
View Full Code Here

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

    final SpeakerNPC mummyNPC = npcs.get("Mrs Jones");

    // player speaks to mummy before annie
    mummyNPC.add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(mummyNPC.getName()),
              new QuestNotStartedCondition(QUEST_SLOT)),
          ConversationStates.ATTENDING, "Hello, nice to meet you.",
          null);

    // player is supposed to begetting ice cream
    mummyNPC.add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(mummyNPC.getName()),
              new QuestInStateCondition(QUEST_SLOT, "start")),
          ConversationStates.ATTENDING,
          "Hello, I see you've met my daughter Annie. I hope she wasn't too demanding. You seem like a nice person.",
          new SetQuestAction(QUEST_SLOT, "mummy"));

    // any other state
    mummyNPC.add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new GreetingMatchesNameCondition(mummyNPC.getName()), true,
          ConversationStates.ATTENDING, "Hello again.", null);
  }
View Full Code Here

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

  protected abstract void createPath();

  @Override
  protected void createDialog() {
    add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new GreetingMatchesNameCondition(getName()), true,
        ConversationStates.IDLE, null, new GhostGreetingAction());
  }
View Full Code Here

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

   * @param text
   * @param action
   */
  public void addGreeting(final String text, final ChatAction action) {
    add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new GreetingMatchesNameCondition(getName()), true,
        ConversationStates.ATTENDING, text, action);

    addWaitMessage(null, new ChatAction() {
      public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
        npc.say("Please wait, " + player.getTitle()
View Full Code Here

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

  protected abstract void createPath();

  @Override
  protected void createDialog() {
    add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new GreetingMatchesNameCondition(getName()), true,
        ConversationStates.IDLE, null, new RatKidGreetingAction());
  }
View Full Code Here

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

        "Do it!",
        null);
  }
 
  private void playerReturnsWithoutLetter(final SpeakerNPC npc) {
    final ChatCondition condition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestStateStartsWithCondition(QUEST_SLOT, "find_vera"),
        new NotCondition(new PlayerHasItemWithHimCondition("note"))
      );
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        condition,
View Full Code Here

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

        new QuestStateStartsWithCondition(QUEST_SLOT, "making;"),
        new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)
      );
    final ChatAction action = new SetQuestAction(QUEST_SLOT,"find_vera");
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()), condition),
        ConversationStates.INFORMATION_1,
        "I finished the legs. But I cannot trust you. Before I give the" +
        " jewelled legs to you, I need a message from my darling. Ask Mayor" +
        " Sakhs for Vera. Can you do that for me?",
        null);
View Full Code Here

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

        "Pah! Bye!",
        null);
  }

  private void playerReturnsAfterGivingTooEarly(final SpeakerNPC npc) {
    final ChatCondition condition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestStateStartsWithCondition(QUEST_SLOT, "making;"),
        new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))
      );
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        condition,
View Full Code Here

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

    //condition for quest being active and in item collection phase
    ChatCondition itemPhaseCondition = getConditionForBeingInCollectionPhase();
   
    //player returns during item collection phase
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            itemPhaseCondition),
        ConversationStates.QUESTION_1,
        "Hello. Do you have any #items I need for the jewelled legs?",
        null);
   
View Full Code Here

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

                              );
  }
 
  private void playerReturnsAfterRequestForLegs(final SpeakerNPC npc) {
  //player returns without legs
  final AndCondition nolegscondition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
                  new QuestInStateCondition(QUEST_SLOT, "legs"),
                  new NotCondition(new PlayerHasItemWithHimCondition("shadow legs"))
                  );
  npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      nolegscondition,
      ConversationStates.IDLE,
      "Hello again. Please return when you have the shadow legs, a base for me to add jewels to make jewelled legs for Vera.",
      null);   
   
  //player returns with legs
  final AndCondition legscondition = new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
                new QuestInStateCondition(QUEST_SLOT, "legs"),
                new PlayerHasItemWithHimCondition("shadow legs")
                );
  final ChatAction action = new MultipleActions(
  new SetQuestAction(QUEST_SLOT,"making;"),
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.