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

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


        null,
        reply);
  }
 
  private void playerReturnsAfterKillingTheImperialScientist(SpeakerNPC npc) {
    final ChatCondition condition = new AndCondition(
        new QuestStateStartsWithCondition(QUEST_SLOT, "kill_scientist"),
        new KilledForQuestCondition(QUEST_SLOT, 1),
        new PlayerHasItemWithHimCondition("goblet")
      );
    ChatAction action = new MultipleActions(
                    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


  }


  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")))
      );
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        condition, ConversationStates.IDLE,
View Full Code Here

        "I am only in pain. Kill my brother and bring me his blood. It's all I want now.",
        null);
  }
 
  private void playerReturnsWithLetter(final SpeakerNPC npc) {
    final ChatCondition condition = new AndCondition(
        new QuestStateStartsWithCondition(QUEST_SLOT, "find_vera"),
        new PlayerHasItemWithHimCondition("note")
      );
   
    final ChatAction action = new MultipleActions(
          new SetQuestAction(QUEST_SLOT, 0, "kill_scientist"),
          new StartRecordingKillsAction(QUEST_SLOT, 1, "Sergej Elos", 0, 1),
          new DropItemAction("note")
        );
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()), condition),
        ConversationStates.INFORMATION_2,
        "Hello! Do you have anything for me?",
        null);
   
    npc.add(ConversationStates.INFORMATION_2, Arrays.asList("letter", "yes", "note"),
View Full Code Here

        "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

        "I think he is in Kalavan." ,
        action);
  }

  private void playerReturnsAfterGivingWhenFinished(final SpeakerNPC npc) {
    final ChatCondition condition = new AndCondition(
        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

        "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

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

  /**
   * Creates a condition for quest being active and in item collection phase
   * @return the condition
   */
  private AndCondition getConditionForBeingInCollectionPhase() {
    return new AndCondition(
                          new QuestActiveCondition(QUEST_SLOT),
                          new NotCondition(
                              new QuestStateStartsWithCondition(QUEST_SLOT,"making;")
                                  ),
                          new NotCondition(
View Full Code Here

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

  }

  private void startOfQuest(final SpeakerNPC npc) {
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotStartedCondition(QUEST_SLOT)),
        ConversationStates.ATTENDING,
        "Go away!",null);

    //offer the quest
View Full Code Here

TOP

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

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.