Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by katie ( 19 years ago )
//At the very top of the file outside this current class, but inside the overall class, is set
private String food;
//then here is the code:
// Player asks what supplies he needs, and a random choice of what he wants is made.
npc.add(ConversationStates.QUEST_OFFERED,
"supplies",
null,
ConversationStates.QUEST_OFFERED,
null,
new SpeakerNPC.ChatAction() {
@Override
public void fire(Player player, String text, SpeakerNPC npc) {
food = Rand.rand(FOOD_LIST);
npc.say("If you could get me " + REQUIRED_FOOD + " pieces of " + food + ", I'd be in your debt. Will you help me?");
}
});
/* Player agrees to collect the food asked for. his quest slot gets set with it
*so that later when he returns and says the food name, Alrak can check if that
*was the food type he was asked to bring. */
npc.add(ConversationStates.QUEST_OFFERED,
ConversationPhrases.YES_MESSAGES,
null,
ConversationStates.ATTENDING,
"Thank you! I hope it doesn't take too long to collect. Don't forget to say '" + food + "' when you have it.",
new SpeakerNPC.ChatAction() {
@Override
public void fire(Player player, String text, SpeakerNPC engine) {
player.setQuest(QUEST_SLOT, food);
player.addKarma(5.0);
}
});
Revise this Paste