Examples of PlayerHasItemWithHimCondition


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

        null);

    /** Remind player about the quest */
    npc.add(ConversationStates.ATTENDING,
        "flask",
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new NotCondition(new PlayerHasItemWithHimCondition("flask"))),
        ConversationStates.ATTENDING,
        "*cough* Oh dear... I really need this medicine! Please hurry back with the #flask from #Margaret.",
        null);

        /** Remind player about the quest */
 
View Full Code Here

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

    // note Ilisa is spelled with a small i here because I
    // and l cannot be told apart in game
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "start"),
            new PlayerHasItemWithHimCondition("flask")),
        ConversationStates.ATTENDING,
        "Ok, you got the flask! Here take this money to cover your expense. Now, I need you to take it to #ilisa... she'll know what to do next.",
        new MultipleActions(processStep));

    // player said hi with flask on ground then picked it up and said flask
    npc.add(ConversationStates.ATTENDING, "flask",
                new AndCondition(new QuestInStateCondition(QUEST_SLOT, "start"), new PlayerHasItemWithHimCondition("flask")),
                ConversationStates.ATTENDING,
                "Ok, you got the flask! Here take this money to cover your expense. Now, I need you to take it to #ilisa... she'll know what to do next.",
                new MultipleActions(processStep));


    // remind the player to take the flask to ilisa.
    // note Ilisa is spelled with a small i here because I
    // and l cannot be told apart in game
    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new PlayerHasItemWithHimCondition("flask")),
        ConversationStates.ATTENDING,
        "Ok, you got the flask! Now, I need you to take it to #ilisa... she'll know what to do next.",
        null);

    // another reminder incase player says task again
View Full Code Here

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

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

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new NotCondition(new PlayerHasItemWithHimCondition("flask"))),
        ConversationStates.ATTENDING,
        "Medicine for #Tad? Didn't he tell you to bring a flask?", null);

    final List<ChatAction> processStep = new LinkedList<ChatAction>();
    processStep.add(new DropItemAction("flask"));
    processStep.add(new IncreaseXPAction(10));
    processStep.add(new SetQuestAction(QUEST_SLOT, "corpse&herbs"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "ilisa"),
            new PlayerHasItemWithHimCondition("flask")),
        ConversationStates.ATTENDING,
        "Ah, I see you have that flask. #Tad needs medicine, right? Hmm... I'll need a #herb. Can you help?",
        new MultipleActions(processStep));

    npc.add(
View Full Code Here

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

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

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "corpse&herbs"),
            new NotCondition(new PlayerHasItemWithHimCondition("arandula"))),
        ConversationStates.ATTENDING,
        "Can you fetch those #herbs for the #medicine?", null);

    final List<ChatAction> processStep = new LinkedList<ChatAction>();
    processStep.add(new DropItemAction("arandula"));
    processStep.add(new IncreaseXPAction(50));
    processStep.add(new SetQuestAction(QUEST_SLOT, "potion"));

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "corpse&herbs"),
            new PlayerHasItemWithHimCondition("arandula")),
        ConversationStates.ATTENDING,
        "Okay! Thank you. Now I will just mix these... a pinch of this... and a few drops... there! Can you ask #Tad to stop by and collect it? I want to see how he's doing.",
        new MultipleActions(processStep));

    npc.add(ConversationStates.ATTENDING, Arrays.asList("potion",
View Full Code Here

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

    monogenes.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(monogenes.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"),
          new PlayerHasItemWithHimCondition("leather helmet")),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Hey! Is that leather hat for me?", null);

    monogenes.add(ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(monogenes.getName()),
          new QuestInStateCondition(QUEST_SLOT, "start"),
          new NotCondition(new PlayerHasItemWithHimCondition("leather helmet"))),
      ConversationStates.ATTENDING,
      "Hey, my good friend, remember that leather hat I asked you about before? It's still pretty chilly here...",
      null);

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("leather helmet"));
    reward.add(new IncreaseXPAction(50));
    reward.add(new IncreaseKarmaAction(10));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));

    // make sure the player isn't cheating by putting the
    // helmet away and then saying "yes"
    monogenes.add(
      ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasItemWithHimCondition("leather helmet"),
      ConversationStates.ATTENDING,
      "Bless you, my good friend! Now my head will stay nice and warm.",
      new MultipleActions(reward));

    monogenes.add(
View Full Code Here

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

    npc.add(
      ConversationStates.IDLE,
      ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestNotCompletedCondition(QUEST_SLOT),
          new NotCondition(new PlayerHasItemWithHimCondition("teddy"))),
      ConversationStates.QUEST_OFFERED,
      "*cries* There were wolves in the #park! *sniff* I ran away, but I dropped my #teddy! Please will you get it for me? *sniff* Please?",
      null);

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

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

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
              new OrCondition(
                  new QuestNotStartedCondition(QUEST_SLOT),
                  new QuestNotCompletedCondition(QUEST_SLOT)),
              new PlayerHasItemWithHimCondition("teddy")),
      ConversationStates.ATTENDING,
      "You found him! *hugs teddy* Thank you, thank you! *smile*",
      new MultipleActions(reward));

    npc.add(
      ConversationStates.ATTENDING,
      "teddy",
      new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("teddy"))),
      ConversationStates.ATTENDING,
      "I lost my teddy in the #park over east, where all those #wolves are hanging about.",
      null);

    npc.add(ConversationStates.ATTENDING, "teddy",
      new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new PlayerHasItemWithHimCondition("teddy")),
      ConversationStates.ATTENDING,
      "That's not my teddy, I've got him right here! Remember, you found him for me!",
      null);
  }
View Full Code Here

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

        npc.say("Thank you! Take these " + Integer.toString(goldamount) + " gold bars, I have plenty. And, listen: If you'd ever like to get me another, be sure to ask me first. Rose Leigh is superstitious, she won't give the bloom unless she senses you need it.");
      }
    };
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("flower", "Rhosyd"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "got_flower"), new PlayerHasItemWithHimCondition("rhosyd")),
        ConversationStates.ATTENDING, null,
        new MultipleActions(new DropItemAction("rhosyd"),
                                    new IncreaseXPAction(5000),
                                    new IncreaseKarmaAction(15),
                  addRandomNumberOfItemsAction,
                  new SetQuestAction(QUEST_SLOT, 0, "flower_brought"),
                  new IncrementQuestAction(QUEST_SLOT, 2, 1)));

    npc.add(ConversationStates.ATTENDING,
      Arrays.asList("flower", "Rhosyd"),
      new NotCondition(new PlayerHasItemWithHimCondition("rhosyd")),
      ConversationStates.ATTENDING,
      "You don't seem to have a rhosyd bloom with you. But Rose Leigh wanders all over the island, I'm sure you'll find her one day!",
      null);

  }
View Full Code Here

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

    final SpeakerNPC npc = npcs.get("Hayunn Naratha");

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestActiveCondition(QUEST_SLOT),
          new PlayerHasItemWithHimCondition("beer")),
      ConversationStates.QUEST_ITEM_BROUGHT,
      "Hey! Is that beer for me?", null);

    npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES,
      new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
          new QuestActiveCondition(QUEST_SLOT),
          new NotCondition(new PlayerHasItemWithHimCondition("beer"))),
      ConversationStates.ATTENDING,
      "Hey, I'm still waiting for that beer, remember? Anyway, what can I do for you?",
      null);

    final List<ChatAction> reward = new LinkedList<ChatAction>();
    reward.add(new DropItemAction("beer"));
    reward.add(new EquipItemAction("money", 20));
    reward.add(new IncreaseXPAction(50));
    reward.add(new SetQuestAction(QUEST_SLOT, "done"));
    reward.add(new IncreaseKarmaAction(10));
    npc.add(
      ConversationStates.QUEST_ITEM_BROUGHT,
      ConversationPhrases.YES_MESSAGES,
      new PlayerHasItemWithHimCondition("beer"),
      ConversationStates.ATTENDING,
      "*glug glug* Ah! That hit the spot. Let me know if you need anything, ok?",
      new MultipleActions(reward));

    npc.add(
View Full Code Here

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

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

    // says quest or ice and doesn't have an ice sword and hasn't brought one before
    npc.add(ConversationStates.ATTENDING,
      questTrigger,
      new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("ice sword"))),
      ConversationStates.ATTENDING,
      "my ice? ice plz", null);

    // says quest or ice and doesn't have an ice sword and has brought one in the past
    npc.add(ConversationStates.ATTENDING,
      questTrigger,
      new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new NotCondition(new PlayerHasItemWithHimCondition("ice sword"))),
      ConversationStates.ATTENDING,
      "where is my ice?", null);

    // says quest or ice and has ice sword with him (first time)
    // player gets a karma bonus and some xp
    npc.add(ConversationStates.ATTENDING,
      questTrigger,
      new AndCondition(new QuestNotCompletedCondition(QUEST_SLOT), new PlayerHasItemWithHimCondition("ice sword")),
      ConversationStates.ATTENDING,
      "my ice :)",
      new MultipleActions(new DropItemAction("ice sword"), new IncreaseXPAction(1000), new IncreaseKarmaAction(30.0), new SetQuestAction(QUEST_SLOT, "done;1")));
   
    // says quest or ice and has ice sword with him (second+ time)
    // player gets a karma bonus and some xp
    npc.add(ConversationStates.ATTENDING,
      questTrigger,
      new AndCondition(new QuestCompletedCondition(QUEST_SLOT), new PlayerHasItemWithHimCondition("ice sword")),
      ConversationStates.ATTENDING,
      null,
      new ChatAction() {
        // we are storing the number of times the player has done the quest in the quest slot like
        // done;N. We reward based on this number. If the quest slot isn't split like this and only 'done'
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.