Examples of QuestStateStartsWithCondition


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

         new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)).fire(player,null, null);
  }
 
  @Override
  public boolean isCompleted(final Player player) {
    return new QuestStateStartsWithCondition(QUEST_SLOT,"drinking;").fire(player, null, null);
  }
View Full Code Here

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

  private void offerKnifeStep() {
    final SpeakerNPC npc = npcs.get("Alrak");
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "reading;"),
            new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_DAYS * MINUTES_IN_DAYS))),
        ConversationStates.IDLE,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, REQUIRED_DAYS * MINUTES_IN_DAYS, "I haven't finished reading that book. Maybe I'll be done in"));
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestStateStartsWithCondition(QUEST_SLOT, "reading;"),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_DAYS * MINUTES_IN_DAYS)),
        ConversationStates.QUEST_2_OFFERED,
        "I've finished reading! That was really interesting. I learned how to make a special #knife from #obsidian.",
        new SetQuestAction(QUEST_SLOT, "book_read"));
           

    npc.add(ConversationStates.QUEST_2_OFFERED,
        "obsidian",
        new LevelGreaterThanCondition(REQUIRED_LEVEL),
        ConversationStates.QUEST_2_OFFERED,
        "That book says that the black gem, obsidian, can be used to make a very sharp cutting edge. Fascinating! If you slay a black dragon to bring it, I'll make a #knife for you.",
        new SetQuestAction(QUEST_SLOT, "knife_offered"));

    npc.add(ConversationStates.QUEST_2_OFFERED,
        "knife",
        new LevelGreaterThanCondition(REQUIRED_LEVEL),
        ConversationStates.QUEST_2_OFFERED,
        "I'll make an obsidian knife if you can slay a black dragon and get the gem which makes the blade. Bring a "
            + FISH
            + " so that I can make the bone handle, too.",
        new SetQuestAction(QUEST_SLOT, "knife_offered"));
   
    npc.add(ConversationStates.QUEST_2_OFFERED,
        Arrays.asList("obsidian", "knife"),
        new NotCondition(new LevelGreaterThanCondition(REQUIRED_LEVEL)),
        ConversationStates.ATTENDING,
        "Well, I don't think you're quite ready for such a dangerous weapon yet. How about you come back when you're above level " + Integer.toString(REQUIRED_LEVEL) + "?",
        null);
   
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "book_read")),
        ConversationStates.QUEST_2_OFFERED,
        "Hi! Perhaps you have come to ask about that #knife again ... ",
        null);
           
    // player says hi to NPC when equipped with the fish and the gem and
    // he's killed a black dragon
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
            new KilledCondition("black dragon"),
            new PlayerHasItemWithHimCondition("obsidian"),
            new PlayerHasItemWithHimCondition(FISH)),
        ConversationStates.IDLE,
        "You found the gem for the blade and the fish bone to make the handle! I'll start work right away. Come back in "
        + REQUIRED_MINUTES + " minutes.",
        new MultipleActions(
        new DropItemAction("obsidian"),
        new DropItemAction(FISH),
        new SetQuestAction(QUEST_SLOT, "forging;"),
        new SetQuestToTimeStampAction(QUEST_SLOT, 1)));

    // player says hi to NPC when equipped with the fish and the gem and
    // he's not killed a black dragon
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
            new NotCondition(new KilledCondition("black dragon")),
            new PlayerHasItemWithHimCondition("obsidian"),
            new PlayerHasItemWithHimCondition(FISH)),
        ConversationStates.ATTENDING,
        "Didn't you hear me properly? I told you to go slay a black dragon for the obsidian, not buy it! How do I know this isn't a fake gem? *grumble* I'm not making a special knife for someone who is scared to face a dragon.",
        null);

    // player says hi to NPC when not equipped with the fish and the gem
    npc.add(ConversationStates.IDLE,
        ConversationPhrases.GREETING_MESSAGES,
        new AndCondition(new GreetingMatchesNameCondition(npc.getName()),
            new QuestInStateCondition(QUEST_SLOT, "knife_offered"),
            new NotCondition(
                new AndCondition(
                    new PlayerHasItemWithHimCondition("obsidian"),
                    new PlayerHasItemWithHimCondition(FISH)))),
        ConversationStates.ATTENDING,
        "Hello again. Don't forget I offered to make that obsidian knife, if you bring me a "
          + FISH
          + " and a piece of obsidian from a black dragon you killed. In the meantime if I can #help you, just say the word.",
        null);

    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 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;"),
            new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.IDLE,
        "The knife is ready! You know, that was enjoyable. I think I'll start making things again. Thanks!",
        new MultipleActions(reward));   
  }
View Full Code Here

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

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

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

        null);
   
    // player can repeat quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "eating;"), new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)),
        ConversationStates.QUEST_OFFERED,
        "I hope another ice cream wouldn't be greedy. Can you get me one?",
        null)
   
    // player can't repeat quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "eating;"), new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES))),
        ConversationStates.ATTENDING,
        "I've had too much ice cream. I feel sick.",
        null)
   
    // player should be bringing ice cream not asking about the quest
    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new QuestStateStartsWithCondition(QUEST_SLOT, "eating;"))),
        ConversationStates.ATTENDING, 
        "Waaaaaaaa! Where is my ice cream ....",
        null);
   
    // Player agrees to get the ice cream
View Full Code Here

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

    return 10;
  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"eating;"),
         new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)).fire(player,null, null);
  }
View Full Code Here

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

         new TimePassedCondition(QUEST_SLOT, 1, REQUIRED_MINUTES)).fire(player,null, null);
  }
 
  @Override
  public boolean isCompleted(final Player player) {
    return new QuestStateStartsWithCondition(QUEST_SLOT,"eating;").fire(player, null, null);
  }
View Full Code Here

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

        "My lovely wife was killed when she went to Wo'fol to order some freshmade pizza by Kroip. Some monks stepped into her way and she had no chance. Now I want revenge! May you help me?",
        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"killed"),
             new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES*2)),
        ConversationStates.QUEST_OFFERED,
        "Those monks are cruel and I still didn't get my revenge. May you help me again please?",
        null);

    npc.add(ConversationStates.ATTENDING,
        ConversationPhrases.QUEST_MESSAGES,
        new AndCondition(new NotCondition(new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES*2)), new QuestStateStartsWithCondition(QUEST_SLOT, "killed")),
        ConversationStates.ATTENDING,
        null,
        new SayTimeRemainingAction(QUEST_SLOT, 1, WEEK_IN_MINUTES*2, "These monks learned their lesson for now but I could need your help again in"));
 

View Full Code Here

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

  }
 
  @Override
  public boolean isRepeatable(final Player player) {
    return new AndCondition(new QuestStateStartsWithCondition(QUEST_SLOT,"killed"),
         new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES*2)).fire(player,null, null);
  }
View Full Code Here

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

         new TimePassedCondition(QUEST_SLOT, 1, WEEK_IN_MINUTES*2)).fire(player,null, null);
  }
 
  @Override
  public boolean isCompleted(final Player player) {
    return new QuestStateStartsWithCondition(QUEST_SLOT,"killed").fire(player, null, null);
  }
View Full Code Here

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

    // grilled steak is made using quest code and not production code so we add an extra condition, and it doesn't adhere to standard completion guidelines
    achievements.add(createAchievement("production.class.food", "Gourmet", "Order all food types available from Faiumoni's cooks",
        Achievement.MEDIUM_BASE_SCORE, true,
        new AndCondition(
            new PlayerProducedNumberOfItemsCondition(1, foods),
            new QuestStateStartsWithCondition("coal_for_haunchy","waiting;"))));


      final List<String> drinklist = producerRegister.getProducedItemNames("drink");
    final String[] drinks = drinklist.toArray(new String[drinklist.size()]);
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.