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

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


    /* player says yes */
    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.QUESTION_1, null,
        new MultipleActions(new SetQuestAndModifyKarmaAction(QUEST_SLOT, NEEDED_ITEMS, 5),
                    new SayRequiredItemsFromCollectionAction(QUEST_SLOT, "I want my crown to be beautiful and shiny. I need [items]. " +
                        "Do you have some of those now with you?")));
       

    /* player is not willing to help */
 
View Full Code Here


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

    ChatAction completeAction = new MultipleActions(
                      new SetQuestAction(QUEST_SLOT, "reward"),
                      new SayTextAction("You have served me well, my crown will be the mightiest of them all!"
                      + " Go to see "+ REWARD_NPC_NAME+ " in the Wizard City to get your #reward."),
                      new IncreaseXPAction(XP_REWARD)
                      );
View Full Code Here

    // could also have used GreaterThanCondition for Quest State but this is okay, note we can only get to question 1 if we were active
    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestNotInStateCondition(QUEST_SLOT, "1"), new PlayerHasItemWithHimCondition("blue elf cloak")),
        ConversationStates.QUESTION_1, null,
        new MultipleActions(
            new DropItemAction("blue elf cloak"),
            new ChatAction() {
              public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
                // find out how many cloaks the player still has to
                // bring. incase something has gone wrong and we can't parse the slot, assume it was just started
                final int toBring = MathHelper.parseIntDefault(player.getQuest(QUEST_SLOT),  REQUIRED_CLOAKS) -1;

                player.setQuest(QUEST_SLOT,
                    Integer.toString(toBring));
                raiser.say("Thank you very much! Do you have another one? I still need "
                    + Grammar.quantityplnoun(toBring,
                        "cloak", "one") + ".");

              }
            }));
   
    // player says he has a blue elf cloak with him and it's the last one
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("blue elf cloak"));
    reward.add(new EquipItemAction("golden shield", 1, true));
    reward.add(new IncreaseXPAction(15000));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(25));
    npc.add(ConversationStates.QUESTION_1,
        ConversationPhrases.YES_MESSAGES,
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "1"), new PlayerHasItemWithHimCondition("blue elf cloak")),
        ConversationStates.ATTENDING,
        "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,
View Full Code Here

              player.removeQuest("solve_riddles");
            }
            player.sendPrivateText(NotificationType.NEGATIVE, "The Reaper took 10000 XP and gave you bad karma.");
          }
        });
        add(ConversationStates.QUESTION_1, Arrays.asList("yes", "sey", "ok", "ko"), null, ConversationStates.IDLE, "!ahahahaH", new MultipleActions(processStep));
        add(ConversationStates.QUESTION_1, Arrays.asList(ConversationPhrases.NO_EXPRESSION, "on"), null, ConversationStates.ATTENDING, ".eniF", null);
        addReply("elddir", ".rorrim ym ksA");
        addJob(".gnivil eht fo sluos eht tsevrah I");
        addHelp("#evael ot hsiw uoy dluohs ,lleh fo setag eht ot syek eht dloh I");
        addOffer("... luos ruoy ekat ot em hsiw uoy sselnU");
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Great! Please find them somewhere in this level of the keep and make them pay for their tresspassing!",
        new MultipleActions(actions));

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

      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(getName()),
          new QuestInStateCondition(QUEST_SLOT, "start")),
      ConversationStates.ATTENDING,
      "I'm so glad you're here! I'll be much happier when this gold is safely in the bank.",
      new MultipleActions(givegold));

    /** If player keep asking for book, just tell him to hurry up */
    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
 
View Full Code Here

        new AndCondition(new GreetingMatchesNameCondition(getName()),
            new QuestInStateCondition(QUEST_SLOT, "lorithien"),
            new PlayerHasItemWithHimCondition("gold bar", GOLD_AMOUNT)),
        ConversationStates.ATTENDING,
        "Oh, you brought the gold! Wonderful, I knew I could rely on you. Please, have this key to our customer room.",
        new MultipleActions(reward));
   
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(getName()),
            new QuestInStateCondition(QUEST_SLOT, "lorithien"),
            new NotCondition(new PlayerHasItemWithHimCondition("gold bar", GOLD_AMOUNT))),
View Full Code Here

            new QuestStartedCondition(QUEST_SLOT),
            new QuestNotCompletedCondition(QUEST_SLOT),
                new KilledForQuestCondition(QUEST_SLOT, 0)),
        ConversationStates.ATTENDING,
        "Good work! Let me thank you in the name of the people of Semos!",
        new MultipleActions(
            new IncreaseXPDependentOnLevelAction(5, 95.0),
            new IncreaseKarmaAction(5.0),
            new IncrementQuestAction(QUEST_SLOT, 2, 1),
            new SetQuestToTimeStampAction(QUEST_SLOT,1),
            new SetQuestAction(QUEST_SLOT,0,"done")
View Full Code Here

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT, "recommended")),
      ConversationStates.IDLE,
      "Greetings! My wonderful daughter requests that I grant you citizenship of Kalavan City. Consider it done. Now, forgive me while I go back to my meal. Goodbye.",
      new MultipleActions(new IncreaseXPAction(500), new SetQuestAction(QUEST_SLOT, "done")));

    /** If you aren't in the condition to speak to him (not completed quest, or already spoke) the King will dismiss you */
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotInStateCondition(QUEST_SLOT, "recommended")),
View Full Code Here

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES,
        null,
        ConversationStates.ATTENDING,
        "Fantastic! We can't wait for your return. Please kill one of each creature you can find in the underground of Athor island. I bet you'll get them all!",
        new MultipleActions(actions));

    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.NO_MESSAGES,
        null,
        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.