Examples of GreetingMatchesNameCondition


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

    }

    @Override
    protected void createDialog() {
      add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new GreetingMatchesNameCondition(getName()), true,
        ConversationStates.IDLE, null,
        new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            if (!player.hasQuest(QUEST_SLOT)) {
              player.setQuest(QUEST_SLOT, "");
View Full Code Here

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

        // NPC_name quest doesn't exist anywhere else neither is
        // used for any other purpose
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(
            new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotCompletedCondition("Monogenes")),
        ConversationStates.INFORMATION_1,
        "Hello there, stranger! Don't be too intimidated if people are quiet and reserved... " +
        "the fear of Blordrough and his forces has spread all over the country, and we're all " +
        "a bit concerned. I can offer a few tips on socializing though, would you like to hear them?",
View Full Code Here

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

    // support for old-style quest
   
    // the player returns to Maerion after having started the quest.
    // Maerion checks if the player has killed one of enough dark elf types
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(new KilledCondition("dark elf archer", "dark elf captain", "thing"))),
        ConversationStates.QUEST_STARTED,
        "Don't you remember promising to sort out my dark elf problem? Kill every dark elf in the #secret room below - especially the snivelling dark elf captain and any evil dark elf archers you find! And bring me the amulet from the mutant thing.",
        null);
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new KilledCondition("dark elf archer", "dark elf captain", "thing"),
            new NotCondition(new PlayerHasItemWithHimCondition("amulet")))
        , ConversationStates.QUEST_STARTED
        , "What happened to the amulet? Remember I need it back!"
        , null);
 
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new KilledCondition("dark elf archer", "dark elf captain", "thing"),
            new PlayerHasItemWithHimCondition("amulet"))
        , ConversationStates.ATTENDING
        , "Many, many thanks. I am relieved to have that back. Here, take this ring. It can revive the powers of the dead.",
        new MultipleActions(new DropItemAction("amulet"),
            new EquipItemAction("emerald ring", 1, true),
            new IncreaseXPAction(10000),
            new IncreaseKarmaAction(5.0),
            new SetQuestAction(QUEST_SLOT, "done")));
   
   
    // support for new-style quest
   
    // building string for completed quest state
    StringBuilder sb = new StringBuilder("started");
    for(int i=0;i<creatures.size();i++) {
      sb.append(";");
      sb.append(creatures.get(i));
    }
    final String completedQuestState = sb.toString();
   
    // the player returns to Maerion after having started the quest.
    // Maerion checks if the player has killed one of enough dark elf types
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT,0,"started"),
            new NotCondition(
                new QuestInStateCondition(QUEST_SLOT, completedQuestState))),
        ConversationStates.QUEST_STARTED,
        "Don't you remember promising to sort out my dark elf problem?"+
        " Kill every dark elf in the #secret room below - especially"+
        " the ones who command, do magic or are archers." +
        "  Don't forget the evil matronmother too."+
        " And bring me the amulet from the mutant thing.",
        new ExamineChatAction("dark-elves-wanted.png", "Wanted!", ""));
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, completedQuestState),
            new NotCondition(
                new PlayerHasItemWithHimCondition("amulet")))
        , ConversationStates.QUEST_STARTED
        , "What happened to the amulet? Remember I need it back!"
        , null);
 
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, completedQuestState),                  
            new PlayerHasItemWithHimCondition("amulet"))
        , ConversationStates.ATTENDING
        , "Many, many thanks. I am relieved to have that back. Here, take this ring. It can revive the powers of the dead.",
        new MultipleActions(new DropItemAction("amulet"),
View Full Code Here

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

    final SpeakerNPC npc = npcs.get("Sally");

    // player returns with the promised wood
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"), new PlayerHasItemWithHimCondition("wood", REQUIRED_WOOD)),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Hi again! You've got wood, I see; do you have those 10 pieces of wood I asked about earlier?",
      null);

    //player returns without promised wood
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"), new NotCondition(new PlayerHasItemWithHimCondition("wood", REQUIRED_WOOD))),
      ConversationStates.ATTENDING,
      "You're back already? Don't forget that you promised to collect ten pieces of wood for me!",
      null);

    // first chat of player with sally
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotStartedCondition(QUEST_SLOT)),
      ConversationStates.ATTENDING, "Hi! I need a little #favor ... ",
      null);

    // player who is rejected or 'done' but waiting to start again, returns
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotInStateCondition(QUEST_SLOT, "start"),
          new QuestStartedCondition(QUEST_SLOT)),
      ConversationStates.ATTENDING,
      "Hi again!",
      null);
View Full Code Here

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

      @Override
      protected void createDialog() {
        add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(super.getName()),
              new QuestCompletedCondition(QUEST_SLOT)),
          ConversationStates.IDLE,
          "Hi again! Good bye, and remember to behave if you want a present next year!",
            new ChatAction() {
              public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
                addHat(player);     
              }
          }
        );

        final List<ChatAction> reward = new LinkedList<ChatAction>();
        reward.add(new EquipItemAction("stocking"));
        reward.add(new SetQuestAction(QUEST_SLOT, "done"));
        reward.add(new ChatAction() {
                public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
                addHat(player);
            }
            }
        );
        add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(super.getName()),
              new QuestNotCompletedCondition(QUEST_SLOT)),
          ConversationStates.IDLE,
          "Merry Christmas! I have a present and a hat for you. Good bye, and remember to behave if you want a present next year!",
          new MultipleActions(reward));
      }
View Full Code Here

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

    // hence they need different names according to engine, but name will look the same on client
    final SpeakerNPC npc2 = npcs.get("lda");

    npc2.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc2.getName()),
            new QuestInStateCondition(mithrilcloak.getQuestSlot(), "twilight_zone"),
            new NotCondition(new PlayerHasItemWithHimCondition("twilight elixir"))),
        ConversationStates.IDLE,   
        "I'm sick .. so sick .. only some powerful medicine will fix me.",       
        null);

    npc2.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc2.getName()),
            new QuestInStateCondition(mithrilcloak.getQuestSlot(), "twilight_zone"),
            new PlayerHasItemWithHimCondition("twilight elixir")),
        ConversationStates.QUEST_ITEM_QUESTION,   
        "Is that elixir for me? If #yes I will take it immediately. You must return to see me again in my normal state.",       
         null);
View Full Code Here

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

    @Override
    protected void createDialog() {
      add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(getName()),
              new QuestCompletedCondition(QUEST_SLOT)),
          ConversationStates.ATTENDING,
          null,
          new SayTextWithPlayerNameAction("Hi again, [name]. I remember that you solved this problem already. You can do it again, of course."));
     
      add(ConversationStates.IDLE,
          ConversationPhrases.GREETING_MESSAGES,
          new AndCondition(new GreetingMatchesNameCondition(getName()),
              new QuestNotCompletedCondition(QUEST_SLOT)),
          ConversationStates.ATTENDING,
          "Hi, welcome to our small game. Your task is to let this arrow point upwards, by moving up to three tokens.",
          null);
     
View Full Code Here

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

  }

  private void bringBookStep() {
    final SpeakerNPC npc = npcs.get("Alrak");
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "got_book"),
            new PlayerHasItemWithHimCondition("blue book")),
        ConversationStates.IDLE,
        "Great! I think I'll read this for a while. Bye!",
        new MultipleActions(
            new DropItemAction("blue book"),
            new IncreaseXPAction(500),
            new SetQuestAction(QUEST_SLOT, "reading;"),
            new SetQuestToTimeStampAction(QUEST_SLOT, 1)));

    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new OrCondition(new QuestInStateCondition(QUEST_SLOT,"seeking_book"), new QuestInStateCondition(QUEST_SLOT, "got_book")),
            new NotCondition(new PlayerHasItemWithHimCondition("blue book"))),
        ConversationStates.ATTENDING,
        "Hello again. I hope you haven't forgotten about the gem book I wanted.",
        null);
View Full Code Here

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

  private void offerKnifeStep() {
    final SpeakerNPC npc = npcs.get("Alrak");
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "reading;"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_DAYS * MINUTES_IN_DAYS))),
        ConversationStates.IDLE,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_DAYS * MINUTES_IN_DAYS, "I haven't finished reading that book. Maybe I'll be done in"));
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "reading;"),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_DAYS * MINUTES_IN_DAYS)),
        ConversationStates.QUEST_2_OFFERED,
        "I've finished reading! That was really interesting. I learned how to make a special #knife from #obsidian.",
        new SetQuestAction(QUEST_SLOT, "book_read"));
           

    npc.add(ConversationStates.QUEST_2_OFFERED,
        "obsidian",
        new LevelGreaterThanCondition(REQUIRED_LEVEL),
        ConversationStates.QUEST_2_OFFERED,
        "That book says that the black gem, obsidian, can be used to make a very sharp cutting edge. Fascinating! If you slay a black dragon to bring it, I'll make a #knife for you.",
        new SetQuestAction(QUEST_SLOT, "knife_offered"));

    npc.add(ConversationStates.QUEST_2_OFFERED,
        "knife",
        new LevelGreaterThanCondition(REQUIRED_LEVEL),
        ConversationStates.QUEST_2_OFFERED,
        "I'll make an obsidian knife if you can slay a black dragon and get the gem which makes the blade. Bring a "
            + FISH
            + " so that I can make the bone handle, too.",
        new SetQuestAction(QUEST_SLOT, "knife_offered"));
   
    npc.add(ConversationStates.QUEST_2_OFFERED,
        Arrays.asList("obsidian", "knife"),
        new NotCondition(new LevelGreaterThanCondition(REQUIRED_LEVEL)),
        ConversationStates.ATTENDING,
        "Well, I don't think you're quite ready for such a dangerous weapon yet. How about you come back when you're above level " + Integer.toString(REQUIRED_LEVEL) + "?",
        null);
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "book_read")),
        ConversationStates.QUEST_2_OFFERED,
        "Hi! Perhaps you have come to ask about that #knife again ... ",
        null);
           
    // player says hi to NPC when equipped with the fish and the gem and
    // he's killed a black dragon
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
            new KilledCondition("black dragon"),
            new PlayerHasItemWithHimCondition("obsidian"),
            new PlayerHasItemWithHimCondition(FISH)),
        ConversationStates.IDLE,
        "You found the gem for the blade and the fish bone to make the handle! I'll start work right away. Come back in "
        + REQUIRED_MINUTES + " minutes.",
        new MultipleActions(
        new DropItemAction("obsidian"),
        new DropItemAction(FISH),
        new SetQuestAction(QUEST_SLOT, "forging;"),
        new SetQuestToTimeStampAction(QUEST_SLOT, 1)));

    // player says hi to NPC when equipped with the fish and the gem and
    // he's not killed a black dragon
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
            new NotCondition(new KilledCondition("black dragon")),
            new PlayerHasItemWithHimCondition("obsidian"),
            new PlayerHasItemWithHimCondition(FISH)),
        ConversationStates.ATTENDING,
        "Didn't you hear me properly? I told you to go slay a black dragon for the obsidian, not buy it! How do I know this isn't a fake gem? *grumble* I'm not making a special knife for someone who is scared to face a dragon.",
        null);

    // player says hi to NPC when not equipped with the fish and the gem
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
            new NotCondition(
                new AndCondition(
                    new PlayerHasItemWithHimCondition("obsidian"),
                    new PlayerHasItemWithHimCondition(FISH)))),
        ConversationStates.ATTENDING,
        "Hello again. Don't forget I offered to make that obsidian knife, if you bring me a "
          + FISH
          + " and a piece of obsidian from a black dragon you killed. In the meantime if I can #help you, just say the word.",
        null);

    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.IDLE,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I haven't finished making the knife. Please check back in"));
   
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new IncreaseXPAction(10000));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new EquipItemAction("obsidian knife", 1, true));
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.IDLE,
        "The knife is ready! You know, that was enjoyable. I think I'll start making things again. Thanks!",
        new MultipleActions(reward));   
View Full Code Here

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

    startforging.add(new SetQuestAction(QUEST_SLOT, "forging;"));
    startforging.add(new SetQuestToTimeStampAction(QUEST_SLOT, 1));
   
    // Player returned with goblet and had killed the vampire lord, and has iron, so offer to forge the sword.
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT,"start"),
          new PlayerHasItemWithHimCondition("goblet"),
          new KilledCondition("vampire lord"),
          new PlayerHasItemWithHimCondition("iron", REQUIRED_IRON)),
      ConversationStates.IDLE,
      "You've brought everything I need to make the vampire sword. Come back in "
      + REQUIRED_MINUTES
      + " minutes and it will be ready",
      new MultipleActions(startforging));

    // Player returned with goblet and had killed the vampire lord, so offer to forge the sword if iron is brought
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"start"),
            new PlayerHasItemWithHimCondition("goblet"),
            new KilledCondition("vampire lord"),
            new NotCondition(new PlayerHasItemWithHimCondition("iron", REQUIRED_IRON))),
    ConversationStates.QUEST_ITEM_BROUGHT,
    "You have battled hard to bring that goblet. I will use it to #forge the vampire sword",
    null);
   
    // Player has only an empty goblet currently, remind to go to Catacombs
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT,"start"),
          new PlayerHasItemWithHimCondition("empty goblet"),
          new NotCondition(new PlayerHasItemWithHimCondition("goblet"))),
      ConversationStates.IDLE,
      "Did you lose your way? The Catacombs are in North Semos. Don't come back without a " +
      "full goblet! Bye!",
      null);
   
    // Player has a goblet (somehow) but did not kill a vampire lord
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"start"),
            new PlayerHasItemWithHimCondition("goblet"),
            new NotCondition(new KilledCondition("vampire lord"))),
    ConversationStates.IDLE,
    "Hm, that goblet is not filled with vampire blood; it can't be, you have not killed the vampire lord. You must slay him.",
    null);
   
    // Player lost the empty goblet?
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"start"),
            new NotCondition(new PlayerHasItemWithHimCondition("empty goblet")),
            new NotCondition(new PlayerHasItemWithHimCondition("goblet"))),
      ConversationStates.QUESTION_1,
      "I hope you didn't lose your goblet! Do you need another?",
      null);

    // Player lost the empty goblet, wants another
    npc.add(ConversationStates.QUESTION_1,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.IDLE, "You stupid ..... Be more careful next time. Bye!",
      new EquipItemAction("empty goblet"));
   
    // Player doesn't have the empty goblet but claims they don't need another.
    npc.add(
      ConversationStates.QUESTION_1,
      ConversationPhrases.NO_MESSAGES,
      null,
      ConversationStates.IDLE,
      "Then why are you back here? Go slay some vampires! Bye!",
      null);
   
    // Returned too early; still forging
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.IDLE, null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I haven't finished forging the sword. Please check back in" +
                ""));
   
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new IncreaseXPAction(5000));
    reward.add(new IncreaseKarmaAction(15.0));
    // here true means: yes, bound to player, in which case we also have to speciy the amount: 1
    reward.add(new EquipItemAction("vampire sword", 1, true));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
      ConversationStates.IDLE,
      "I have finished forging the mighty Vampire Sword. You deserve this. Now i'm going back to work, goodbye!",
      new MultipleActions(reward));
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.