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

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


   
    henry.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(henry.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasInfostringItemWithHimCondition("leather legs", "tom"),
            new PlayerHasInfostringItemWithHimCondition("note", "charles"),
            new PlayerHasInfostringItemWithHimCondition("scale armor", "peter")),
        ConversationStates.ATTENDING,
        "Oh my! Peter, Tom, and Charles are all dead? *cries*. Anyway, here is your reward. And keep the IOU.",
        new MultipleActions(actions));

    henry.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(henry.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new NotCondition(
                new AndCondition(
                    new PlayerHasInfostringItemWithHimCondition("leather legs", "tom"),
                    new PlayerHasInfostringItemWithHimCondition("note", "charles"),
                    new PlayerHasInfostringItemWithHimCondition("scale armor", "peter")))),
        ConversationStates.ATTENDING,
        "You didn't prove that you have found them all!",
        null);

    henry.add(ConversationStates.ATTENDING, Arrays.asList("map", "group", "help"),
View Full Code Here


    actions.add(new EquipItemAction("steel boots", 1, true));
   
    james.add(ConversationStates.ATTENDING,
        Arrays.asList("map", "henry"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "map"),
                new PlayerHasInfostringItemWithHimCondition("map", "henry")),
        ConversationStates.ATTENDING,
        "The map! Wonderful! Thank you. And here is your reward.",
        new MultipleActions(actions));
   
    james.add(ConversationStates.ATTENDING,
        Arrays.asList("map", "henry"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "map"),
                new NotCondition(new PlayerHasInfostringItemWithHimCondition("map", "henry"))),
        ConversationStates.ATTENDING,
        "Well, where is the map?",
        null);
   
    james.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
View Full Code Here

   
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new PlayerHasInfostringItemWithHimCondition("water", CLEAN_WATER_INFOSTRING)),
        ConversationStates.ATTENDING,
        "Thank you ever so much! That's just what I wanted! Here, take these potions that Sarzina gave me - I hardly have use for them here.",
        new MultipleActions(reward));
   
        // player returns with no water at all.
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new NotCondition(new PlayerHasItemWithHimCondition("water"))),
        ConversationStates.ATTENDING,
        "I'm waiting for you to bring me some drinking water, this sun is so hot.",
        null);
   
        // add the other possibilities
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.combine(ConversationPhrases.QUEST_MESSAGES, EXTRA_TRIGGER),
        new AndCondition(
            new QuestActiveCondition(QUEST_SLOT),
            new PlayerHasItemWithHimCondition("water"),
            new NotCondition(new PlayerHasInfostringItemWithHimCondition("water", CLEAN_WATER_INFOSTRING))),
        ConversationStates.ATTENDING,
        "Hmm... it's not that I don't trust you, but I'm not sure that water is okay to drink. Could you go and ask #Stefan to #check it please?",
        null);
   
    npc.addReply("Stefan", "Stefan is a chef over in the restaurant at Fado Hotel. I'd trust him to check if anything is safe to eat or drink, he's a professional.");
View Full Code Here

      res.add("I told Xhiphin Zohos I didn't want to fetch water for him.");
    }
    if (player.isQuestInState(QUEST_SLOT, "start") || isCompleted(player)) {
      res.add("I agreed to fetch some water to quench Xhiphin Zohos's thirst.");
    }
    if (player.isQuestInState(QUEST_SLOT, "start") && player.isEquipped("water") && new NotCondition(new PlayerHasInfostringItemWithHimCondition("water", CLEAN_WATER_INFOSTRING)).fire(player, null, null) || isCompleted(player)) {
      res.add("I found a source of fresh water, but I can't be completely sure it's safe for Xhiphin to drink.");
    }
    if (new PlayerHasInfostringItemWithHimCondition("water", CLEAN_WATER_INFOSTRING).fire(player, null, null) || isCompleted(player)) {
      res.add("Stefan, the chef in Fado hotel, checked the water I collected and it is clean and safe to drink.");
    }
    // checked water was clean?
        if (isCompleted(player)) {
            if (isRepeatable(player)) {
View Full Code Here

    actions.add(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "done", 5.0))
    actions.add(new EquipItemAction("dwarvish armor", 1, true));
   
    npc.add(ConversationStates.ATTENDING, "clothes",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),
        new PlayerHasInfostringItemWithHimCondition("golden armor","Phalk"),
        new PlayerHasInfostringItemWithHimCondition("dwarf cloak","Phalk")),
        ConversationStates.ATTENDING,
        "Oh yeah! Thank you so much! Payment?? Erm... *cough* I will give you my old armor as a reward.",
        new MultipleActions(actions));

    npc.add(ConversationStates.ATTENDING, "clothes",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "clothes"),
        new NotCondition(
            new AndCondition(
                new PlayerHasInfostringItemWithHimCondition("golden armor","Phalk"),
                new PlayerHasInfostringItemWithHimCondition("dwarf cloak","Phalk")))),
        ConversationStates.ATTENDING,
        "Hm, I want the special golden #armor from Mrotho and the dwarf #cloak from Wrvil. Tell them my name and they will give you what they made me.",
        null);
   
    npc.add(ConversationStates.ATTENDING,
View Full Code Here

TOP

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

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.