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

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


        null);

    // response to wedding ring enquiry when you're already married
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("wedding ring", "wedding"),
        new AndCondition(new QuestCompletedCondition(marriage.getQuestSlot()), new PlayerHasItemWithHimCondition("wedding ring")),
        ConversationStates.ATTENDING,
        "I hope you're still happily married! If you are having trouble and want a divorce, speak to the clerk in Ados Town Hall.",
        null);

    // response to wedding ring enquiry when you're already married and not wearing ring
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("wedding ring", "wedding"),
        new AndCondition(new QuestCompletedCondition(marriage.getQuestSlot()), new NotCondition(new PlayerHasItemWithHimCondition("wedding ring"))),
        ConversationStates.QUEST_ITEM_QUESTION,
        "Uh oh! You haven't got your wedding ring on! I can forge you another for " + REQUIRED_GOLD
                  + " gold bars and a fee of "
                  + REQUIRED_MONEY
                  + " money, do you want another?",
View Full Code Here


    // player returns while quest is still active
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestInStateCondition(QUEST_SLOT, "start"),
        new OrCondition(
          new PlayerHasItemWithHimCondition("leather cuirass"),
          new PlayerHasItemWithHimCondition("pauldroned leather cuirass"))),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Excuse me, please! I have noticed the leather cuirass you're carrying. Is it for me?",
      null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
        new QuestInStateCondition(QUEST_SLOT, "start"),
        new NotCondition(new OrCondition(
          new PlayerHasItemWithHimCondition("leather cuirass"),
          new PlayerHasItemWithHimCondition("pauldroned leather cuirass")))),
      ConversationStates.ATTENDING,
      "Luckily I haven't been robbed while you were away. I would be glad to receive a leather cuirass. Anyway, how can I #help you?",
      null);

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new EquipItemAction("money", 80));
    reward.add(new IncreaseXPAction(50));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(10));

    final List<ChatAction> reward1 = new LinkedList<ChatAction>(reward);
    reward1.add(new DropItemAction("leather cuirass"));

    npc.add(
      ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      // make sure the player isn't cheating by putting the armor
      // away and then saying "yes"
      new PlayerHasItemWithHimCondition("leather cuirass"),
      ConversationStates.ATTENDING, "Oh, I am so thankful! Here is some gold I found ... ehm ... somewhere. Now that you have proven yourself a trusted customer, you may have access to your own private banking #vault any time you like.",
      new MultipleActions(reward1));

    final List<ChatAction> reward2 = new LinkedList<ChatAction>(reward);
    reward2.add(new DropItemAction("pauldroned leather cuirass"));
    npc.add(
      ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      // make sure the player isn't cheating by putting the armor
      // away and then saying "yes"
      new AndCondition(
        new NotCondition(new PlayerHasItemWithHimCondition("leather cuirass")),
        new PlayerHasItemWithHimCondition("pauldroned leather cuirass")),
      ConversationStates.ATTENDING, "Oh, I am so thankful! Here is some gold I found ... ehm ... somewhere. Now that you have proven yourself a trusted customer, you may have access to your own private banking #vault any time you like.",
      new MultipleActions(reward2));

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

    // player returns with the promised fish soup
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"), new PlayerHasItemWithHimCondition("fish soup")),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Hi, you've got fish soup, I see, is that for Hughie?",
      null);

    //player returns without promised fish soup
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"), new NotCondition(new PlayerHasItemWithHimCondition("fish soup"))),
      ConversationStates.ATTENDING,
      "You're back already? Hughie is getting sicker! Don't forget the fish soup for him, please. I promise to reward you.",
      null);

    // first chat of player with Anastasia
View Full Code Here

      }
    });
   
    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasItemWithHimCondition("fish soup"),
      ConversationStates.ATTENDING, "Thank you! I will always be in your favour. I will feed it to Hughie when he wakes. Please take these potions, they did nothing for him.",
      new MultipleActions(reward));

    //player said the fish soup was for her but has dropped it from his bag or hands
    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new NotCondition(new PlayerHasItemWithHimCondition("fish soup")),
      ConversationStates.ATTENDING,
      "Oh! Where did you put the fish soup?",
      null);

    // player had fish soup but said it is not for Hughie
View Full Code Here

    actions.add(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "clothes;none;none", 2.0));   
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION, ConversationPhrases.YES_MESSAGES,
        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasItemWithHimCondition("sandwich",3),
            new PlayerHasItemWithHimCondition("beer",3),
            new PlayerHasItemWithHimCondition("wine",3)),
        ConversationStates.ATTENDING,
        "Yay, thank you!!! There is another thing you could do for me: my clothes are old and dirty and I need a new #cloak and a new #armor. Please bring them to me and say #clothes.",
        new MultipleActions(actions)
    );
   
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION, ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"),
        new NotCondition(
            new AndCondition(
                new PlayerHasItemWithHimCondition("sandwich",3),
                new PlayerHasItemWithHimCondition("beer",3),
                new PlayerHasItemWithHimCondition("wine",3)))),
        ConversationStates.ATTENDING,
        "I've been around a long time and what's more I am really hungry. You can't trick me.",
        null);
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
View Full Code Here

    actions.add(new SetQuestAction(QUEST_SLOT, 1, "cloak"));
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION, ConversationPhrases.YES_MESSAGES,
        new AndCondition(
            new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),new QuestInStateCondition(QUEST_SLOT, 1, "none")),
            new PlayerHasItemWithHimCondition("steel arrow",20)),
        ConversationStates.ATTENDING,
        "Ok, here you are.",
        new MultipleActions(actions)
    );
   
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION, ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),new QuestInStateCondition(QUEST_SLOT, 1, "none"),
        new NotCondition(new PlayerHasItemWithHimCondition("steel arrow",20))),
        ConversationStates.ATTENDING,
        "Your type are all liars, aren't they? Come back when you have the payment.",
        null);

  }
View Full Code Here

    actions.add(new SetQuestAction(QUEST_SLOT, 2, "armor"));
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION, ConversationPhrases.YES_MESSAGES,
        new AndCondition(
            new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),new QuestInStateCondition(QUEST_SLOT, 2, "none")),
            new PlayerHasItemWithHimCondition("gold bar",20)),
        ConversationStates.ATTENDING,
        "Ok, here you are.",
        new MultipleActions(actions)
    );
   
    npc.add(ConversationStates.QUEST_ITEM_QUESTION, ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),new QuestInStateCondition(QUEST_SLOT, 2, "none"),
        new NotCondition(new PlayerHasItemWithHimCondition("gold bar",20))),
        ConversationStates.ATTENDING,
        "Army disciplinary actions are pretty serious, so don't lie to me.",
        null);
   
  }
View Full Code Here

    // player returns with iron but no beeswax
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(
          new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT,"start"),
          new NotCondition(new PlayerHasItemWithHimCondition("beeswax",REQUIRED_BEESWAX)),
          new PlayerHasItemWithHimCondition("iron",REQUIRED_IRON)),
      ConversationStates.ATTENDING,
      "Greetings, I see you have the iron, but I still need six pieces of beeswax. Please come back when you " +
      "have all #ingredients with you.",
      null);

    // player returns with beeswax but no iron
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(
          new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT,"start"),
          new NotCondition(new PlayerHasItemWithHimCondition("iron",REQUIRED_IRON)),
          new PlayerHasItemWithHimCondition("beeswax",REQUIRED_BEESWAX)),
      ConversationStates.ATTENDING,
      "Greetings, I see you have the beeswax, but I still need two pieces of iron. Please come back when you " +
      "have all #ingredients with you.",
      null);
   
    //player returns with beeswax and iron
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(
          new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT,"start"),
          new PlayerHasItemWithHimCondition("iron",REQUIRED_IRON),
          new PlayerHasItemWithHimCondition("beeswax",REQUIRED_BEESWAX)),
      ConversationStates.ATTENDING,
      "Greetings, finally you have brought me all ingredients that I need to summon the magic candles. Now you " +
      "can #start with the practical test.",
      new MultipleActions(
          new SetQuestAction(QUEST_SLOT,"candles_done"),
View Full Code Here

    // incase the player still has candles, remove them from him
    npc.add(ConversationStates.ATTENDING,
      "send",
      new AndCondition(
          new QuestInStateCondition(QUEST_SLOT,"candles_done"),
          new PlayerHasItemWithHimCondition("candle")),
      ConversationStates.ATTENDING,
      "Before I can send you on the first step, you have to drop any candles you are carrying.",
      null);

    // send the player, so long as he doesn't not have candles, and record which step he is on
    npc.add(ConversationStates.ATTENDING,
      "send",
      new AndCondition(
          new QuestInStateCondition(QUEST_SLOT,"candles_done"),
          new NotCondition(new PlayerHasItemWithHimCondition("candle"))),
      ConversationStates.IDLE,
      null,
      new MultipleActions(
          new SetQuestAction(QUEST_SLOT, "first_step"),
          new TeleportAction("int_semos_wizards_tower_1", 15, 16, Direction.DOWN)));
View Full Code Here

TOP

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

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.