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

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


    // player returns and doesn't need fabric and sacs not being made
    npc.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new NotCondition(
              new OrCondition(
                   new QuestInStateCondition(mithrilcloak.getQuestSlot(), "need_fabric"),
                   new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "makingthread;")
              )
          )),
      ConversationStates.IDLE, "Ha ha he he woo hoo!!!",
View Full Code Here


    // player returns and hasn't got thread yet/got thread already and
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new NotCondition(
                 new OrCondition(
                         new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_thread"),
                         new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "fusingthread;")
                         )
            )),
        ConversationStates.ATTENDING, "Greetings. What an interesting place this is.",
View Full Code Here

    // player's quest state is in nothing to do with the letter, thread or weaving.
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("weave", "fabric", "magical", "mithril fabric", "ida", "mithril", "cloak", "mithril cloak", "pedinghaus", "task", "quest"),
        new NotCondition(
                 new OrCondition(new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_mithril_thread"),
                         new QuestInStateCondition(mithrilcloak.getQuestSlot(), "taking_letter"),
                         new QuestInStateCondition(mithrilcloak.getQuestSlot(), "took_letter"),
                         new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "weavingfabric;")
                         )
                 ),
View Full Code Here

    // remind about fabric. there are so many steps to getting fabric
    // that the player could be in many quest states and she still is just waiting for fabric
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("fabric", "mithril", "cloak", "mithril cloak", "task", "quest"),
        new OrCondition(
                new QuestInStateCondition(mithrilcloak.getQuestSlot(), "need_fabric"),
                new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "makingthread;"),
                new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_thread"),
                new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "fusingthread;"),
                new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_mithril_thread"),
View Full Code Here

        );

    // remind about getting clasp
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("clasp", "mithril clasp", "cloak", "mithril cloak", "task", "quest"),
        new OrCondition(
                new QuestInStateCondition(mithrilcloak.getQuestSlot(), "need_clasp"),
                new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "forgingclasp;"),
                new AndCondition(new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_clasp"),
                         new NotCondition(new PlayerHasItemWithHimCondition("mithril clasp")))
                ),
View Full Code Here

      "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

    SpeakerNPC npc = npcs.get(QUEST_NPC);

    // quest can be given
    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,
View Full Code Here

   

    // player asks about quest, they haven't started it yet
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new OrCondition(new QuestNotStartedCondition(mithrilcloak.getQuestSlot()), new QuestInStateCondition(mithrilcloak.getQuestSlot(), "rejected")),       
        ConversationStates.QUEST_OFFERED,
        "My sewing machine is broken, will you help me fix it?",
        null);
   
    final Map<String,Integer> items = new HashMap<String, Integer>();
    items.put("leather armor",1);
    items.put("oil",1);
    items.put("bobbin",1);

    // Player says yes they want to help
    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.ATTENDING,
      null,     
      new MultipleActions(new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "machine;", 15.0),
                new StartRecordingRandomItemCollectionAction(mithrilcloak.getQuestSlot(), 1, items, "Thank you! To fix it, it needs [#item]. I'm ever so grateful for your help.")));
   
    // player said no they didn't want to help
    npc.add(
      ConversationStates.QUEST_OFFERED,
      ConversationPhrases.NO_MESSAGES,
      null,
      ConversationStates.IDLE,
      "Oh dear, I don't know what I can do without a decent sewing machine. But don't worry I won't bother you any longer!",
      new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "rejected", -5.0));


    // 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?",
        null);
View Full Code Here

        );

    // remind about scissors
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("scissors", "magical", "magical scissors", "mithril", "cloak", "mithril cloak", "task", "quest"),
        new OrCondition(
                new QuestInStateCondition(mithrilcloak.getQuestSlot(), "need_scissors"),
                new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "need_eggshells;"),
                new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "makingscissors;"),
                new AndCondition(new QuestInStateCondition(mithrilcloak.getQuestSlot(), "got_scissors"),
                         new NotCondition(new PlayerHasItemWithHimCondition("magical scissors")))
View Full Code Here

        );

    // remind about needle
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("needle", "magical needle", "magical", "mithril", "cloak", "mithril cloak", "task", "quest"),
        new OrCondition(new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "need_needle"),
                new AndCondition(
                  new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "told_joke"),
                  new NotCondition(new PlayerHasItemWithHimCondition("magical needle"))
                )
            ),
View Full Code Here

TOP

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

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.