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

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


            new ChatAction() {
              public void fire(final Player player,
                  final Sentence sentence,
                  final EventRaiser npc) {
                int pieAmount = Rand.roll1D6() + 1;
                new EquipItemAction("fish pie", pieAmount, true).fire(player, sentence, npc);
                npc.say("Thank you!! Take " +
                    Grammar.thisthese(pieAmount) + " " +
                    Grammar.quantityplnoun(pieAmount, "fish pie", "") +
                    " from my cook, and this kiss, from me.");
                new SetQuestAndModifyKarmaAction(getSlotName(), "drinking;"
View Full Code Here


            new KilledCondition("dark elf archer", "dark elf captain", "thing"),
            new PlayerHasItemWithHimCondition("amulet"))
        , ConversationStates.ATTENDING
        , "Many, many thanks. I am relieved to have that back. Here, take this ring. It can revive the powers of the dead.",
        new MultipleActions(new DropItemAction("amulet"),
            new EquipItemAction("emerald ring", 1, true),
            new IncreaseXPAction(10000),
            new IncreaseKarmaAction(5.0),
            new SetQuestAction(QUEST_SLOT, "done")));
   
   
    // support for new-style quest
   
    // building string for completed quest state
    StringBuilder sb = new StringBuilder("started");
    for(int i=0;i<creatures.size();i++) {
      sb.append(";");
      sb.append(creatures.get(i));
    }
    final String completedQuestState = sb.toString();
   
    // the player returns to Maerion after having started the quest.
    // Maerion checks if the player has killed one of enough dark elf types
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(
            new QuestInStateCondition(QUEST_SLOT,0,"started"),
            new NotCondition(
                new QuestInStateCondition(QUEST_SLOT, completedQuestState))),
        ConversationStates.QUEST_STARTED,
        "Don't you remember promising to sort out my dark elf problem?"+
        " Kill every dark elf in the #secret room below - especially"+
        " the ones who command, do magic or are archers." +
        "  Don't forget the evil matronmother too."+
        " And bring me the amulet from the mutant thing.",
        new ExamineChatAction("dark-elves-wanted.png", "Wanted!", ""));
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, completedQuestState),
            new NotCondition(
                new PlayerHasItemWithHimCondition("amulet")))
        , ConversationStates.QUEST_STARTED
        , "What happened to the amulet? Remember I need it back!"
        , null);
 
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, completedQuestState),                  
            new PlayerHasItemWithHimCondition("amulet"))
        , ConversationStates.ATTENDING
        , "Many, many thanks. I am relieved to have that back. Here, take this ring. It can revive the powers of the dead.",
        new MultipleActions(new DropItemAction("amulet"),
            new EquipItemAction("emerald ring", 1, true),
            new IncreaseXPAction(10000),
            new IncreaseKarmaAction(5.0),
            new SetQuestAction(QUEST_SLOT, "done")));
   
    npc.add(
View Full Code Here

              }
          }
        );

        final List<ChatAction> reward = new LinkedList<ChatAction>();
        reward.add(new EquipItemAction("stocking"));
        reward.add(new SetQuestAction(QUEST_SLOT, "done"));
        reward.add(new ChatAction() {
                public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {
                addHat(player);
            }
View Full Code Here

          public void fire(final Player player, final Sentence sentence, final EventRaiser npc) {

                        final int required = (sentence.getNumeral().getAmount());
            if (player.drop("money" , required * MOSS_COST)) {
              npc.say("Ok, here's your " + Integer.toString(required) + " pieces of twilight moss. Don't take too much at once.");
              new EquipItemAction("twilight moss", required, true).fire(player, sentence, npc);
            } else {
              npc.say("Ok, ask me again when you have enough money.");
            }           
          }
        });
View Full Code Here

    npc.add(ConversationStates.QUESTION_1,
        NAME,
        null,
        ConversationStates.ATTENDING,
        "Ah, the mountain dwarf! Hope he enjoys the gem book.",
        new MultipleActions(new EquipItemAction("blue book", 1, true),
        new SetQuestAction(QUEST_SLOT, "got_book")));

    // allow to say goodbye while Ceryl is listening for the dwarf's name
    npc.add(ConversationStates.QUESTION_1, ConversationPhrases.GOODBYE_MESSAGES,
        null,
View Full Code Here

        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_MINUTES, "I haven't finished making the knife. Please check back in"));
   
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new IncreaseXPAction(10000));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new EquipItemAction("obsidian knife", 1, true));
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "forging;"),
View Full Code Here

        ConversationStates.ATTENDING,
        "Why are you bothering me when you haven't completed your quest yet?",
        null);

    final List<ChatAction> gobletactions = new LinkedList<ChatAction>();
    gobletactions.add(new EquipItemAction("empty goblet"));
    gobletactions.add(new IncreaseKarmaAction(5.0));
    gobletactions.add(new SetQuestAction(QUEST_SLOT, "start"));
    // Player wants to do the quest
    npc.add(ConversationStates.QUEST_OFFERED,
      ConversationPhrases.YES_MESSAGES, null,
View Full Code Here

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

        new SetQuestAndModifyKarmaAction(QUEST_SLOT, "rejected", -5.0));
   
    // Player has got ice cream and spoken to mummy
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("icecream"));
    reward.add(new EquipItemAction("present"));
    reward.add(new IncreaseXPAction(500));
    reward.add(new SetQuestAction(QUEST_SLOT, "eating;"));
    reward.add(new SetQuestToTimeStampAction(QUEST_SLOT,1));
    reward.add(new IncreaseKarmaAction(10.0));
   
View Full Code Here

        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))),
View Full Code Here

TOP

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

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.