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

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


      null);
   
    // player is not eligible to resell a house
    add(ConversationStates.ATTENDING,
      Arrays.asList("resell", "sell"),
      new NotCondition(new PlayerOwnsHouseCondition()),
      ConversationStates.ATTENDING,
      "You don't own any house at the moment. If you want to buy one please ask about the #cost.",
      null);
   
    add(ConversationStates.QUESTION_3,
      ConversationPhrases.YES_MESSAGES,
      null,
        ConversationStates.ATTENDING,
      null,
      new ResellHouseAction(getCost(), QUEST_SLOT, DEPRECIATION_PERCENTAGE, houseTax));
   
    // refused offer to resell a house
    add(ConversationStates.QUESTION_3,
      ConversationPhrases.NO_MESSAGES,
      null,
      ConversationStates.ATTENDING,
      "Well, I'm glad you changed your mind.",
      null);
   
    // player is eligible to change locks
    add(ConversationStates.ATTENDING,
      "change",
      new PlayerOwnsHouseCondition(),
      ConversationStates.SERVICE_OFFERED,
      "If you are at all worried about the security of your house or, don't trust anyone you gave a spare key to, "
      + "it is wise to change your locks. Do you want me to change your house lock and give you a new key now?",
      null);

    // player is not eligible to change locks
    add(ConversationStates.ATTENDING,
      "change",
      new NotCondition(new PlayerOwnsHouseCondition()),
      ConversationStates.ATTENDING,
      "You don't own any house at the moment. If you want to buy one please ask about the #cost.",
      null);

    // accepted offer to change locks
View Full Code Here


// (don't need to check if they have a house, they can't as they're not old enough)
add(ConversationStates.ATTENDING,
    Arrays.asList("cost", "house", "buy", "purchase"),
    new AndCondition(
               new QuestCompletedCondition(KalavanHouseseller.PRINCESS_QUEST_SLOT),
               new NotCondition(new AgeGreaterThanCondition(HouseSellerNPCBase.REQUIRED_AGE))),
    ConversationStates.ATTENDING,
    "The cost of a new house is "
    + getCost()
    + " money. But I am afraid I cannot trust you with house ownership just yet, come back when you have spent at least "
    + Integer.toString((HouseSellerNPCBase.REQUIRED_AGE / 60)) + " hours on Faiumoni.",
View Full Code Here

    // So then the NPC doesn't have to choose which reason to reject the player for (appears as a WARN from engine if he has to choose)
   
    // player is not old enough
    add(ConversationStates.ATTENDING,
         Arrays.asList("cost", "house", "buy", "purchase"),
         new NotCondition(new AgeGreaterThanCondition(HouseSellerNPCBase.REQUIRED_AGE)),
         ConversationStates.ATTENDING,
         "The cost of a new house in Ados is "
         + getCost()
         + " money. But I am afraid I cannot trust you with house ownership just yet, come back when you have spent at least "
         + Integer.toString((HouseSellerNPCBase.REQUIRED_AGE / 60)) + " hours on Faiumoni.",
          null);
   
   
    // player doesn't have a house and is old enough but has not done required quests
    add(ConversationStates.ATTENDING,
         Arrays.asList("cost", "house", "buy", "purchase"),
         new AndCondition(new AgeGreaterThanCondition(HouseSellerNPCBase.REQUIRED_AGE),
                  new QuestNotStartedCondition(HouseSellerNPCBase.QUEST_SLOT),
                  new NotCondition(
                            new AndCondition(
                                     new QuestCompletedCondition(AdosHouseSeller.DAILY_ITEM_QUEST_SLOT),
                                     new QuestCompletedCondition(AdosHouseSeller.ANNA_QUEST_SLOT),
                                     new QuestCompletedCondition(AdosHouseSeller.KEYRING_QUEST_SLOT),
                                     new QuestCompletedCondition(AdosHouseSeller.FISHROD_QUEST_SLOT),
View Full Code Here

    // player says something which isn't in the needed spirits list.
    npc.add(
      ConversationStates.QUESTION_1,
      "",
      new NotCondition(new TriggerInListCondition(NEEDED_SPIRITS)),
      ConversationStates.QUESTION_1,
      "Sorry, I don't understand you. What name are you trying to say?",
      null);

    npc.add(
      ConversationStates.QUESTION_1,
      Arrays.asList("spirits", "spirit"),
      null,
      ConversationStates.QUESTION_1,
      "I seek to know more about other spirits who are dead but stalk the earthly world as ghosts. Please tell me any names you know.",
      null);

    // the player goes to Carena and says hi, and has no quest or is completed.
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new NotCondition(new QuestActiveCondition(QUEST_SLOT))),
        ConversationStates.ATTENDING, "Wooouhhhhhh!",
        null);
  }
View Full Code Here

        null);

    // player asks about quest but time didn't pass yet
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new NotCondition(new TimePassedCondition(QUEST_SLOT, 1,REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I don't want to disturb my mum at the moment, it seems like she needs some time on herself, so you don't have to look out for her currently. You can ask me again in"));

View Full Code Here

   

    // don't put the flower on the ground - if player has no space, tell them
    amber.add(ConversationStates.ATTENDING, "Jef",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "start"),
                 new NotCondition(new PlayerCanEquipItemCondition("zantedeschia"))),
        ConversationStates.IDLE,
        "Oh, I wanted to give you a flower for my son to show him that I'm fine, but as I see now, you don't have enough space for equipping it. Please return to me when you will have made some space in your bags!",
        null);

        // don't give the flower if the quest state isn't start
View Full Code Here

        null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestNotCompletedCondition(QUEST_SLOT),
            new NotCondition(new PlayerHasItemWithHimCondition("kanmararn prison key"))),
        ConversationStates.IDLE,
        "Help! The duergars have raided the prison and locked me up! I'm supposed to be the Guard! It's a shambles.",
        new SetQuestAction(QUEST_SLOT, "start"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
View Full Code Here

    //player returns to Hayunn not having killed a rat
    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.ATTENDING,
        "I see you haven't managed to kill a rat yet. Do you need me to tell you how to fight them?",
        null);

    //player returns to Hayunn having killed a rat
    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new IncreaseXPAction(10));
    actions.add(new SetQuestAction(QUEST_SLOT, "killed"));

    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.INFORMATION_1,
        "You killed the rat! Now, I guess you want to explore. Do you want to know the way to Semos?",
        new MultipleActions(actions));


       // The player has had enough info for now. Send them to semos. When they come back they can learn some more tips.

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new EquipItemAction("money", 5));
    reward.add(new IncreaseXPAction(10));
    reward.add(new SetQuestAction(QUEST_SLOT, "taught"));
    reward.add(new ExamineChatAction("monogenes.png", "Monogenes", "North part of Semos city."));

    npc.add(
      ConversationStates.INFORMATION_1,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.IDLE,
      "Follow the path through this village to the east, and you can't miss Semos. If you go and speak to Monogenes, the old man in this picture, he will give you a map. Here's 5 money to get you started. Bye bye!",
      new MultipleActions(reward));

       // incase player didn't finish learning everything when he came after killing the rat, he must have another chance. Here it is.
    // 'little tip' is a pun as he gives some money, that is a tip, too.
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "killed")),
        ConversationStates.INFORMATION_1,
            "You ran off pretty fast after coming to tell me you killed that rat! I was about to give you a little tip. Do you want it?",
        null);
   
    // Player has returned to say hi again.
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "taught")),
        ConversationStates.INFORMATION_2,
            "Hello again. Have you come to learn more from me?",
        null);

    npc.add(
      ConversationStates.INFORMATION_2,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.INFORMATION_3,
      "Perhaps you have found Semos dungeons by now. The corridors are pretty narrow down there, so there's a trick to moving quickly and accurately, if you'd like to hear it. #Yes?",
      null);

    npc.add(
      ConversationStates.INFORMATION_3,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.INFORMATION_4,
      "Simple, really; just click the place you want to move to. There's a lot more information than I can relate just off the top of my head... do you want to know where to read more?",
      null);

    final String epilog = "You can find answers to frequently asked questions by typing #/faq \nYou can read about some of the currently most powerful and successful warriors at #http://stendhalgame.org\n ";
   
      //This is used if the player returns, asks for #help and then say #yes
      npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.YES_MESSAGES, new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      epilog + "You know, you remind me of my younger self...",
      null);

    final List<ChatAction> reward2 = new LinkedList<ChatAction>();
    reward2.add(new EquipItemAction("studded shield"));
    reward2.add(new IncreaseXPAction(20));
    reward2.add(new SetQuestAction(QUEST_SLOT, "done"));

    npc.add(ConversationStates.INFORMATION_4,
        ConversationPhrases.YES_MESSAGES, new QuestNotCompletedCondition(QUEST_SLOT),
        ConversationStates.IDLE,
        epilog + "Well, good luck in the dungeons! This shield should help you. Here's hoping you find fame and glory, and keep watch for monsters!",
        new MultipleActions(reward2));

    npc.add(new ConversationStates[] { ConversationStates.ATTENDING,
          ConversationStates.INFORMATION_1,
          ConversationStates.INFORMATION_2,
          ConversationStates.INFORMATION_3,
          ConversationStates.INFORMATION_4},
        ConversationPhrases.NO_MESSAGES, new NotCondition(new QuestInStateCondition(QUEST_SLOT, "start")), ConversationStates.IDLE,
        "Oh well, I'm sure someone else will stop by for a chat soon. Bye...",
        null);

    npc.setPlayerChatTimeout(TIME_OUT);
  }
View Full Code Here

        // Player has done the quest already but it's too early to get another
        npc.add(ConversationStates.ATTENDING,
            ConversationPhrases.QUEST_MESSAGES,
            new AndCondition(
                new QuestCompletedCondition(QUEST_SLOT),
                new NotCondition(new TimeReachedCondition(QUEST_SLOT, 1))),
            ConversationStates.ATTENDING, null,
            new SayTimeRemainingUntilTimeReachedAction(QUEST_SLOT, 1,
                "Wrof! Thank you but my stock of supplies for making good #torcibud will be fine for"));

        // Player is curious about torcibud when offered the quest
View Full Code Here

        "Thank you very much! Now I have enough cloaks to survive the winter. Here, take this golden shield as a reward.",
        new MultipleActions(reward));
   
    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new NotCondition(new PlayerHasItemWithHimCondition("blue elf cloak")),
        ConversationStates.ATTENDING,
        "Really? I don't see any...",
        null);
  }
View Full Code Here

TOP

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

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.