Package games.stendhal.server.entity.npc.action

Examples of games.stendhal.server.entity.npc.action.MultipleActions


          new PlayerHasItemWithHimCondition("iron", REQUIRED_IRON)),
      ConversationStates.IDLE,
      "You've brought everything I need to make the vampire sword. Come back in "
      + REQUIRED_MINUTES
      + " minutes and it will be ready",
      new MultipleActions(startforging));

    // Player returned with goblet and had killed the vampire lord, so offer to forge the sword if iron is brought
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"start"),
            new PlayerHasItemWithHimCondition("goblet"),
            new KilledCondition("vampire lord"),
            new NotCondition(new PlayerHasItemWithHimCondition("iron", REQUIRED_IRON))),
    ConversationStates.QUEST_ITEM_BROUGHT,
    "You have battled hard to bring that goblet. I will use it to #forge the vampire sword",
    null);
   
    // Player has only an empty goblet currently, remind to go to Catacombs
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT,"start"),
          new PlayerHasItemWithHimCondition("empty goblet"),
          new NotCondition(new PlayerHasItemWithHimCondition("goblet"))),
      ConversationStates.IDLE,
      "Did you lose your way? The Catacombs are in North Semos. Don't come back without a " +
      "full goblet! Bye!",
      null);
   
    // Player has a goblet (somehow) but did not kill a vampire lord
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"start"),
            new PlayerHasItemWithHimCondition("goblet"),
            new NotCondition(new KilledCondition("vampire lord"))),
    ConversationStates.IDLE,
    "Hm, that goblet is not filled with vampire blood; it can't be, you have not killed the vampire lord. You must slay him.",
    null);
   
    // Player lost the empty goblet?
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT,"start"),
            new NotCondition(new PlayerHasItemWithHimCondition("empty goblet")),
            new NotCondition(new PlayerHasItemWithHimCondition("goblet"))),
      ConversationStates.QUESTION_1,
      "I hope you didn't lose your goblet! Do you need another?",
      null);

    // Player lost the empty goblet, wants another
    npc.add(ConversationStates.QUESTION_1,
      ConversationPhrases.YES_MESSAGES, null,
      ConversationStates.IDLE, "You stupid ..... Be more careful next time. Bye!",
      new EquipItemAction("empty goblet"));
   
    // Player doesn't have the empty goblet but claims they don't need another.
    npc.add(
      ConversationStates.QUESTION_1,
      ConversationPhrases.NO_MESSAGES,
      null,
      ConversationStates.IDLE,
      "Then why are you back here? Go slay some vampires! Bye!",
      null);
   
    // Returned too early; still forging
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.IDLE, null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I haven't finished forging the sword. Please check back in" +
                ""));
   
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new IncreaseXPAction(5000));
    reward.add(new IncreaseKarmaAction(15.0));
    // here true means: yes, bound to player, in which case we also have to speciy the amount: 1
    reward.add(new EquipItemAction("vampire sword", 1, true));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
      ConversationStates.IDLE,
      "I have finished forging the mighty Vampire Sword. You deserve this. Now i'm going back to work, goodbye!",
      new MultipleActions(reward));

    npc.add(
      ConversationStates.QUEST_ITEM_BROUGHT,
      "forge",
      null,
View Full Code Here


    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new PlayerHasItemWithHimCondition("icecream"),
        ConversationStates.ATTENDING,
        "Thank you EVER so much! You are very kind. Here, take this present.",
        new MultipleActions(reward));
   
    // player did have ice cream but put it on ground after question?
    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new NotCondition(new PlayerHasItemWithHimCondition("icecream")),
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Thank you! Please kill 25 monks and 25 darkmonks in the name of my beloved wife.",
        new MultipleActions(actions));

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES,
        null,
        ConversationStates.ATTENDING,
View Full Code Here

        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT, 0, "start"),
            new KilledForQuestCondition(QUEST_SLOT, 1)),
        ConversationStates.ATTENDING,
        "Thank you so much! Now I can sleep a bit better. Please take some soup.",
        new MultipleActions(actions));

    npc.add(ConversationStates.ATTENDING,
        triggers,
        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT, 0, "start"),
View Full Code Here

        "That's how long,", "That's how long",
        "Thats how long,", "Thats how long"),
      ConversationStates.INFORMATION_4,
      "\"I will be your friend.\"", null);

    ChatAction reward = new MultipleActions(new IncreaseKarmaAction(10), new IncreaseXPAction(25), new SetQuestToYearAction("susi"));
    npc.add(ConversationStates.INFORMATION_4,
      "",
      new TriggerExactlyInListCondition("I will be your friend.", "I will be your friend"),
      ConversationStates.ATTENDING,
      "Yay! We are friends now.",
View Full Code Here

        new TriggerExactlyInListCondition("One is silver,", "One is silver"),
        ConversationStates.INFORMATION_8, "\"And the other gold.\"",
        null);

    // lowercase "and" is ignored, even in full match mode
    ChatAction reward = new MultipleActions(new IncreaseKarmaAction(15), new IncreaseXPAction(50), new SetQuestToYearAction("susi"));
    npc.add(ConversationStates.INFORMATION_8, "",
        new TriggerExactlyInListCondition("And the other gold.", "And the other gold", "the other gold.", "the other gold"),
        ConversationStates.ATTENDING,
        "Yay! We are even better friends now.",
        reward);
View Full Code Here

        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, FORGING),
            new NotCondition(new QuestStateStartsWithCondition(QUEST_SLOT, FORGING + "unbound")),
            new TimePassedCondition(QUEST_SLOT,1,REQUIRED_MINUTES)),
        ConversationStates.ATTENDING,
        "I'm pleased to say, your ring of life is fixed! It's good as new now.",
        new MultipleActions(
            new IncreaseXPAction(500),
            new SetQuestAction(QUEST_SLOT, "done"),
            new EquipItemAction("emerald ring", 1, true)));
   
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("emerald ring", "life", "emerald"),
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, FORGING),
            new QuestStateStartsWithCondition(QUEST_SLOT, FORGING + "unbound"),
            new TimePassedCondition(QUEST_SLOT,1,REQUIRED_MINUTES)),
        ConversationStates.ATTENDING,
        "I'm pleased to say, your ring of life is fixed! It's good as new now.",
        new MultipleActions(
            new IncreaseXPAction(500),
            new SetQuestAction(QUEST_SLOT, "done"),
            new EquipItemAction("emerald ring", 1, false)));

    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("emerald ring", "life", "emerald"),
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, FORGING),
            new NotCondition(new TimePassedCondition(QUEST_SLOT,1,REQUIRED_MINUTES))),
        ConversationStates.IDLE, null,
        new SayTimeRemainingAction(QUEST_SLOT,1, REQUIRED_MINUTES,"I haven't finished fixing your ring of life. Please check back in"));
   
   
    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
        "price",
        null,
        ConversationStates.QUEST_ITEM_BROUGHT,
        "The charge for my service is " + REQUIRED_MONEY
          + " money, and I need " + REQUIRED_GOLD
          + " gold bars and " + REQUIRED_GEM
          + " emerald to fix the ring. Do you want to pay now?",
        null);

    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(
            new PlayerHasItemWithHimCondition("gold bar", REQUIRED_GOLD),
            new PlayerHasItemWithHimCondition("money", REQUIRED_MONEY),
            new PlayerHasItemWithHimCondition("emerald", REQUIRED_GEM)),
        ConversationStates.IDLE,
        "Okay, that's all I need to fix the ring. Come back in "
            + REQUIRED_MINUTES
            + " minutes and it will be ready. Bye for now.",
        new MultipleActions(
            new DropItemAction("gold bar", REQUIRED_GOLD),
            new DropItemAction("emerald", REQUIRED_GEM),
            new DropItemAction("money", REQUIRED_MONEY),
            new ChatAction() {
              public void fire(final Player player,
View Full Code Here

      ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES,
      null,
      ConversationStates.ATTENDING,
      null,
      new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, NEEDED_ITEMS, 5.0),
                new SayRequiredItemsFromCollectionAction(QUEST_SLOT, "Oh how nice. Please bring me those ingredients: [items].")));

    npc.add(
      ConversationStates.QUEST_OFFERED,
      ConversationPhrases.NO_MESSAGES,
View Full Code Here

    npc.add(ConversationStates.QUESTION_2,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.QUESTION_2, "Great, what did you bring?",
        null);

    ChatAction completeAction = new  MultipleActions(
        new SetQuestAction(QUEST_SLOT, "done"),
        new SayTextAction("Great! Now I can heal many people for free. Thanks a lot. Take this for your work."),
        new IncreaseXPAction(50),
        new IncreaseKarmaAction(5),
        new EquipItemAction("minor potion", 5)
View Full Code Here

    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasItemWithHimCondition("snowball", REQUIRED_SNOWBALLS),
      ConversationStates.ATTENDING,
      null,
      new MultipleActions(reward));

    npc.add(ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new NotCondition(new PlayerHasItemWithHimCondition("snowball", REQUIRED_SNOWBALLS)),
      ConversationStates.ATTENDING,
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.npc.action.MultipleActions

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.