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

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


    // Player says yes they want to help
    npc.add(ConversationStates.QUEST_OFFERED,
        ConversationPhrases.YES_MESSAGES, null,
        ConversationStates.ATTENDING,
        "Wonderful! I'm so relieved! Please take this note to Pedinghaus, you will find him in Ados goldsmiths. Tell him you have a #letter for him.",     
        new MultipleActions(new EquipItemAction("sealed envelope", 1, true),
                  new SetQuestAction(mithrilcloak.getQuestSlot(), "taking_letter"))
        );
   
    // player said no they didn't want to help
    npc.add(
View Full Code Here


        ConversationStates.ATTENDING,
        "Wow, Pedinghaus really outdid himself this time. It looks wonderful on your new cloak! Wear it with pride.",
        new MultipleActions(
                   new DropItemAction("mithril clasp"),
                   new SetQuestAndModifyKarmaAction(mithrilcloak.getQuestSlot(), "done", 10.0),
                   new EquipItemAction("mithril cloak", 1, true),
                   new IncreaseXPAction(1000)
                   )
        );

    // remind about getting clasp
View Full Code Here

      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start")),
      ConversationStates.ATTENDING,
      "Oh, Ceryl's looking for that book back? My goodness! I completely forgot about it... here you go!",
      new MultipleActions(new EquipItemAction("black book", 1, true), new SetQuestAction(QUEST_SLOT, "jynath")));

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

    final SpeakerNPC npc = npcs.get("Ceryl");

    /** Complete the quest */
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("black book"));
    reward.add(new EquipItemAction("money", 50));
    reward.add(new IncreaseXPAction(100));
    reward.add(new IncreaseKarmaAction(10.0));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));

    npc.add(
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("disease poison", required * REQUIRED_POISONS)) {
              npc.say("Ok, here's your " + Integer.toString(required) + " eggshells. Enjoy!");
              new EquipItemAction("magical eggshells", required, true).fire(player, sentence, npc);
            } else {
              npc.say("Ok, ask me again when you have " + Integer.toString(required * REQUIRED_POISONS) + " disease poisons with you.");
            }           
          }
        });
View Full Code Here

                    player.setQuest(mithrilcloak.getQuestSlot(), "told_joke;" + Integer.toString(i));
                  }
                  // this might have been his favourite joke, which is determined randomly
                  if (Rand.randUniform(1, 8) == i) {
                    npc.say("That's the funniest joke I ever heard! I think it's my favourite of the moment. Here, have your needle for free... and then get out of here, You've been here far too long already.");
                    new EquipItemAction("magical needle", 1, true).fire(player, sentence, npc);
                    npc.setCurrentState(ConversationStates.IDLE);
//                    // stop looking through the joke list
                    return;
                  } else {
                    npc.say("*guffaws* Alright, lets get on with business. A magical needle costs "
                      + Integer.toString(NEEDLE_COST) + " pieces of money. Do you want to buy one now?");
                    // stop looking through the joke list
                    npc.setCurrentState(ConversationStates.QUEST_ITEM_QUESTION);
                    return;
                   }
                }
              }
              if (ConversationPhrases.GOODBYE_MESSAGES.contains(sentence.getTriggerExpression().getNormalized())) {
                  npc.say("Ok, bye then.");
                  npc.setCurrentState(ConversationStates.IDLE);
              } else if (sentence.getTriggerExpression().getNormalized().equals("none")) {
                npc.say("Ok, bye.");
                npc.setCurrentState(ConversationStates.IDLE);
              } else {
                npc.say("Sorry, that joke just isn't funny. go back to Nalwor library and get another.");
                npc.setCurrentState(ConversationStates.IDLE);
              }
      }
    });
   
   
    // offer needle when prompted if they already told a joke
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("needle", "magical", "magical needle", "ida", "cloak", "mithril cloak", "specials"),
        new QuestStateStartsWithCondition(mithrilcloak.getQuestSlot(), "told_joke"),
        ConversationStates.QUEST_ITEM_QUESTION,
        "I have some magical needles but they cost a pretty penny, "
        + Integer.toString(NEEDLE_COST) + " pieces of money to be precise. Do you want to buy one?",
        null);

    // agrees to buy 1 needle
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
        ConversationPhrases.YES_MESSAGES,
        new PlayerHasItemWithHimCondition("money", NEEDLE_COST),
        ConversationStates.IDLE,
        "Ok, here you are. Be careful with them, they break easy. Now, get lost, you have hung around here far too long already.",       
        new MultipleActions(
          new DropItemAction("money", NEEDLE_COST),
          new EquipItemAction("magical needle", 1, true)
          ));

    // said he had money but he didn't
    npc.add(ConversationStates.QUEST_ITEM_QUESTION,
        ConversationPhrases.YES_MESSAGES,
View Full Code Here

        new AndCondition(new QuestInStateCondition(QUEST_SLOT,"hair"),
                new NotCondition (new PlayerHasItemWithHimCondition("horse hair",1))),
        ConversationStates.ATTENDING,
        "Hello, hello! Ouchit needs more horse hairs from my horses? " +
        "No problem, here you are. Send Ouchit greetings from me.",
        new EquipItemAction("horse hair"));

  }
View Full Code Here

    /*
     * These actions are part of the reward
     */
    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new EquipItemAction("scale armor", 1, true));
    reward.add(new EquipItemAction("chain legs", 1, true));
    reward.add(new IncreaseXPAction(100));
    reward.add(new DropItemAction("horse hair"));
    reward.add(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "done", 10.0));
   
    /*
 
View Full Code Here

        "I know that the #'suntan cream' is hard to get, but I hope that you didn't forget my painful problem...",
        null);

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("suntan cream"));
    reward.add(new EquipItemAction("small key", 1, true));
    reward.add(new IncreaseXPAction(1000));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(15));
   
    zara.add(
View Full Code Here

    final List<ChatAction> actions = new LinkedList<ChatAction>();
    actions.add(new IncreaseXPAction(5000));
    actions.add(new DropInfostringItemAction("map","Henry"));
    actions.add(new SetQuestAndModifyKarmaAction(QUEST_SLOT, "done", 15.0))
    actions.add(new EquipItemAction("steel boots", 1, true));
   
    james.add(ConversationStates.ATTENDING,
        Arrays.asList("map", "henry"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "map"),
                new PlayerHasInfostringItemWithHimCondition("map", "henry")),
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.