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

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


    reward.add(new IncreaseXPAction(1000));
    reward.add(new SetQuestAction(QUEST_SLOT, "capture"));
    reward.add(new IncreaseKarmaAction(10));
   
    npc.add(ConversationStates.ATTENDING, "scythe",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"),
        new PlayerHasItemWithHimCondition("scythe")),
        ConversationStates.ATTENDING,
        "Thank you!! First part is done! Now I can cut all flowers down! Now please ask Princess Esclara why I am here! I think saying my name should tell her something...",
        new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING, "scythe",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new NotCondition(new PlayerHasItemWithHimCondition("scythe"))),
      ConversationStates.ATTENDING,
      "You don't have a scythe yet! Go and get one and hurry up!",
      null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "start"),
        ConversationStates.ATTENDING,
        "I already asked you to bring me a #scythe to cut the flowers down!",
        null);
  }
View Full Code Here


 
  private void step3() {
  final SpeakerNPC npc = npcs.get("Princess Esclara");
 
    npc.add(ConversationStates.ATTENDING, "Lorenz",
        new QuestInStateCondition(QUEST_SLOT, "capture"),
        ConversationStates.ATTENDING,
        "You want to know why he is in there? He and his ugly friends dug the #tunnel to our sweet Island! That's why he got jailed!",
        new SetQuestAction(QUEST_SLOT, "princess"));
   
    npc.add(ConversationStates.ATTENDING, "tunnel",
        new QuestInStateCondition(QUEST_SLOT, "princess"),
        ConversationStates.ATTENDING, "I am angry now and won't speak any more of it! If you want to learn more you'll have to ask him about the #tunnel!",
        null)

  }
View Full Code Here

 
  private void step4() {
  final SpeakerNPC npc = npcs.get("Lorenz");
 
    npc.add(ConversationStates.ATTENDING, "tunnel",
        new QuestInStateCondition(QUEST_SLOT, "princess"),
        ConversationStates.ATTENDING,
        "What she drives me nuts, like all the flowers! This makes me hungry, go and get an #egg for me! Just let me know, you got one.",
        new SetQuestAction(QUEST_SLOT, "egg"))
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "capture"),
        ConversationStates.ATTENDING,
        "Please go ask Princess Esclara why I am here! I think saying my name should prompt her to tell you",
        null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "princess"),
        ConversationStates.ATTENDING,
        "I bet Princess Esclara said I was imprisoned because of the #tunnel ... ",
        null);
  }
View Full Code Here

    reward.add(new IncreaseXPAction(1000));
    reward.add(new SetQuestAction(QUEST_SLOT, "jailed"));
    reward.add(new IncreaseKarmaAction(10));
   
    npc.add(ConversationStates.ATTENDING, "egg",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "egg"),
            new PlayerHasItemWithHimCondition("egg")),
            ConversationStates.ATTENDING,
            "Thank you again my friend. Now you have to tell Princess Ylflia, in Kalavan Castle, that I am #jailed here. Please hurry up!",
            new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING, "egg",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "egg"), new NotCondition(new PlayerHasItemWithHimCondition("egg"))),
      ConversationStates.ATTENDING,
      "I cannot see an egg!",
      null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "egg"),
        ConversationStates.ATTENDING,
        "I asked you to fetch an #egg for me!",
        null);
   
    npc.add(ConversationStates.ATTENDING, "jailed",
        new QuestInStateCondition(QUEST_SLOT, "jailed"),
        ConversationStates.ATTENDING, "I know that *I'm* jailed! I need you to go tell Princess Ylflia that I am here!",
        null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "jailed"),
        ConversationStates.ATTENDING,
        "I need you to go tell Princess Ylflia that I am #jailed here.",
        null);
  }
View Full Code Here

 
  private void step6() {
  final SpeakerNPC npc = npcs.get("Princess Ylflia");
 
    npc.add(ConversationStates.ATTENDING, Arrays.asList("jailed", "Lorenz"),
        new QuestInStateCondition(QUEST_SLOT, "jailed"),
        ConversationStates.ATTENDING,
        "Oh my dear. My father should not know it. Hope he is fine! Thanks for this message! Send him #greetings! You better return to him, he could need more help.",
        new SetQuestAction(QUEST_SLOT, "spoken"));

    npc.add(ConversationStates.ATTENDING, "greetings",
        new QuestInStateCondition(QUEST_SLOT, "spoken"),
        ConversationStates.ATTENDING, "Please, go and give Lorenz my #greetings.",
        null);

  }
View Full Code Here

  private void step7() {
  final SpeakerNPC npc = npcs.get("Lorenz");
 
    npc.add(ConversationStates.ATTENDING, "greetings",
        new QuestInStateCondition(QUEST_SLOT, "spoken"),
        ConversationStates.ATTENDING,
        "Thanks my friend. Now a final task for you! Bring me a barbarian armor. Without this I cannot escape from here! Go! Go! And let me know when you have the #armor !",
        new SetQuestAction(QUEST_SLOT, "armor"));
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "greetings"),
        ConversationStates.ATTENDING,
        "I suppose you must have spoken with Princess Ylflia by now ... I do hope she sent her warmest #greetings to me...",
        null);
  }
View Full Code Here

    reward.add(new EquipItemAction("gold bar", 20));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(15));
   
    npc.add(ConversationStates.ATTENDING, "armor",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "armor"),
            new PlayerHasItemWithHimCondition("barbarian armor")),
            ConversationStates.ATTENDING,
            "Thats all! Now I am prepared for my escape! Here is something I have stolen from Princess Esclara! Do not let her know. And now leave me!",
            new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING, "armor",
      new AndCondition(new QuestInStateCondition(QUEST_SLOT, "armor"), new NotCondition(new PlayerHasItemWithHimCondition("barbarian armor"))),
      ConversationStates.ATTENDING,
      "You have no barbarian armor with you! Go get one!",
      null);
   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestInStateCondition(QUEST_SLOT, "armor"),
        ConversationStates.ATTENDING,
        "I am waiting for you to bring me a barbarian #armor so I am strong enough to escape.",
        null);
  }
View Full Code Here

    // the player returns to Eonna after having started the quest.
    // Eonna checks if the player has killed one of each animal race.
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, 0, "start"), new KilledForQuestCondition(QUEST_SLOT,1)),
        ConversationStates.ATTENDING, "A hero at last! Thank you!",
        new MultipleActions(reward));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, 0, "start"), new NotCondition(new KilledForQuestCondition(QUEST_SLOT, 1))),
        ConversationStates.QUEST_STARTED,
        "Don't you remember promising to clean out the rats from my #basement?",
        null);

    npc.add(
View Full Code Here

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new LevelGreaterThanCondition(2),
          new QuestNotStartedCondition(QUEST_SLOT),
          new NotCondition(new QuestInStateCondition(QUEST_SLOT,"rejected"))),
      ConversationStates.QUESTION_1,
      "Ohh a stranger found my hidden house, welcome! Maybe you can help me with something?", null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"rejected")),
      ConversationStates.QUEST_OFFERED,
      "Hey, did you think about helping me again? Will you do it?", null);

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

  private void step_3() {
    final SpeakerNPC npc = npcs.get("Morgrin");
    // support for old-style quests
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start")),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            if (player.hasKilled("spider")
                && player.hasKilled("poisonous spider")
                && player.hasKilled("giant spider")) {
              raiser.say("Oh thank you my friend. Here you have something special, I got it from a Magican. Who he was I do not know. What the egg's good for, I do not know. I only know, it could be useful for you.");
              final Item mythegg = SingletonRepository.getEntityManager()
                  .getItem("mythical egg");
              mythegg.setBoundTo(player.getName());
              player.equipOrPutOnGround(mythegg);
              player.addKarma(5.0);
              player.addXP(5000);
              player.setQuest(QUEST_SLOT, "killed;" + System.currentTimeMillis());
            } else {
              raiser.say("Go down and kill the creatures, no time left.");
            }
           }
        });
   
    // support for new quests.
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, 0, "started")),
        ConversationStates.ATTENDING,
        null,
        new ChatAction() {
          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            if (player.getQuest(QUEST_SLOT, 1).equals("spider") &&
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.