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

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


      "Find my #group, Peter, Tom, and Charles, prove it and I will reward you. Will you do it?",
      null);
   
    henry.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(new QuestCompletedCondition(QUEST_SLOT),
                 new QuestInStateCondition(QUEST_SLOT,"map")),
        ConversationStates.ATTENDING,
        "I'm so sad that most of my friends are dead.",
        null);
   
    henry.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.ATTENDING,
      "Thank you! I'll be waiting for your return.",
      new SetQuestAndModifyKarmaAction(QUEST_SLOT, "start", 5.0));

    henry.add(
      ConversationStates.QUEST_OFFERED,
      "group",
      null,
      ConversationStates.QUEST_OFFERED,
      "The General sent five of us to explore this area in search for #treasure. So, will you help me find them?",
      null);

        henry.add(
        ConversationStates.QUEST_OFFERED,
        "treasure",
        null,
        ConversationStates.QUEST_OFFERED,
        "A big treasure is rumored to be #somewhere in this dungeon. Will you help me find my group?",
        null);

    henry.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES, null,
        ConversationStates.ATTENDING,
        "OK. I understand. I'm scared of the #dwarves myself.",
        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0));
   
    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new IncreaseXPAction(2500));
    actions.add(new DropInfostringItemAction("leather legs","tom"));
    actions.add(new DropInfostringItemAction("scale armor","peter"));
    actions.add(new IncreaseKarmaAction(15.0))
    actions.add(new GiveMapAction(false));
   
    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"),
        new OrCondition(
          new  QuestCompletedCondition(QUEST_SLOT),
          new AndCondition(new HenryQuestCompletedCondition(),
          new PlayerOwnsItemIncludingBankCondition("map"))),
        ConversationStates.ATTENDING,
        "I'm so sad that most of my friends are dead.", null);

View Full Code Here


        ConversationStates.ATTENDING,
        "Well, where is the map?",
        null);
   
    james.add(ConversationStates.ATTENDING, ConversationPhrases.QUEST_MESSAGES,
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Thanks again for bringing me the map!", null);
   
    james.add(ConversationStates.ATTENDING, ConversationPhrases.HELP_MESSAGES,
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Thanks again for bringing me the map!", null);
   
    james.add(ConversationStates.ATTENDING, Arrays.asList("map", "henry",
       "group", "one"),
      new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "Thanks again for bringing me the map!", null);
  }
View Full Code Here

    // player returns after finishing the quest and says offer
    npc.add(
        ConversationStates.ATTENDING,
        ConversationPhrases.OFFER_MESSAGES,
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "If you have found any more elvish items, I'd be glad if you would #sell them to me. I would buy elvish armor, shield, legs, boots, cloak or sword. I would also buy a drow sword if you have one.",
        null);

View Full Code Here

      ConversationStates.ATTENDING,
      "I am looking for a very special #book.", null);

    npc.add(ConversationStates.ATTENDING,
      ConversationPhrases.QUEST_MESSAGES,
      new QuestCompletedCondition(QUEST_SLOT),
      ConversationStates.ATTENDING,
      "I have nothing for you now.", null);

    /** Other conditions not met e.g. quest completed */
    npc.addReply("book","If you want to learn more, chat to my friend Wikipedian in Ados library.", null);
View Full Code Here

        null);
   
    // shouldn't happen
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "I still enjoy the last chocolate bar you brought me, thanks!",
        null);
   
    // player can repeat quest
View Full Code Here

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(
          new QuestNotStartedCondition(QUEST_SLOT),
          new AndCondition(
            new QuestCompletedCondition(QUEST_SLOT),
            new TimePassedCondition(QUEST_SLOT, 1, delay))),
        ConversationStates.ATTENDING,
        null,
        new GiveQuestAction());

    // time is not over
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
            new QuestCompletedCondition(QUEST_SLOT),
            new NotCondition(
                new TimePassedCondition(QUEST_SLOT, 1, delay))),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, delay, "You have to check again in"));
View Full Code Here

    return 80;
 
 
  @Override
  public boolean isRepeatable(final Player player) {
    return  new AndCondition(new QuestCompletedCondition(QUEST_SLOT),
             new TimePassedCondition(QUEST_SLOT,1,delay)).fire(player, null, null);
  }
View Full Code Here


    // player asks for quest but they already did it 
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestCompletedCondition(mithrilcloak.getQuestSlot()),
        ConversationStates.ATTENDING,
        "You've already completed the only quest that I have for you.",
        null);
   
    //player fixed the machine but hadn't got mithril shield.
    // they return and ask for quest but they still haven't got mithril shield
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new NotCondition(new QuestCompletedCondition(mithrilcloak.getShieldQuestSlot())),
                 new OrCondition(new QuestInStateCondition(mithrilcloak.getQuestSlot(), "need_mithril_shield"),
                         new QuestInStateCondition(mithrilcloak.getQuestSlot(), "fixed_machine"))
                 ),
        ConversationStates.ATTENDING,
                 "I don't have anything for you until you have proved yourself worthy of carrying mithril items, by getting the mithril shield.",
        null);


    // player fixed the machine but hadn't got mithril shield at time or didn't ask to hear more about the cloak.
    // when they have got it and return to ask for quest she offers the cloak
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(
                 new QuestCompletedCondition(mithrilcloak.getShieldQuestSlot()),
                 new OrCondition(new QuestInStateCondition(mithrilcloak.getQuestSlot(), "need_mithril_shield"),
                         new QuestInStateCondition(mithrilcloak.getQuestSlot(), "fixed_machine"))
                 ),
        ConversationStates.QUEST_2_OFFERED,
        "Congratulations, you completed the quest for the mithril shield! Now, I have another quest for you, do you want to hear it?",
View Full Code Here

           new SayRequiredItemAction(mithrilcloak.getQuestSlot(),1,"Ok, well if there's anything else I can help you with just say. Don't forget to bring [the item] next time though!"));

       //offer cloak
       npc.add(ConversationStates.QUEST_2_OFFERED,
           ConversationPhrases.YES_MESSAGES,
           new QuestCompletedCondition(mithrilcloak.getShieldQuestSlot()),
           ConversationStates.ATTENDING,      
           "I will make you the most amazing cloak of mithril. You just need to get me the fabric and any tools I need! First please bring me a couple yards of " + mithrilcloak.getFabricName() + ". The expert on fabrics is the wizard #Kampusch.",
           new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "need_fabric", 10.0));
         

      // player asks for quest but they haven't completed mithril shield quest
      npc.add(ConversationStates.QUEST_2_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(
                 new NotCondition(new QuestCompletedCondition(mithrilcloak.getShieldQuestSlot())),
                 new QuestStartedCondition(mithrilcloak.getShieldQuestSlot())
                 ),
        ConversationStates.ATTENDING,
        "Oh, I see you are already on a quest to obtain a mithril shield. You see, I was going to offer you a mithril cloak. But you should finish that first. Come back when you've finished the mithril shield quest and we will speak again.",
        new SetQuestAction(mithrilcloak.getQuestSlot(), "need_mithril_shield"));
View Full Code Here

    /*
     * Player asks about quest, and it is finished
     */
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new QuestCompletedCondition(QUEST_SLOT),
        ConversationStates.ATTENDING,
        "Thanks for your help. If I can #offer you anything just ask.",
        null);
   
  }
View Full Code Here

TOP

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

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.