From: Hendrik B. <nh...@us...> - 2006-08-15 06:38:23
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/npc In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv1933/src/games/stendhal/server/entity/npc Modified Files: StandardInteraction.java Log Message: hasQuest and !hasQuest Index: StandardInteraction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/npc/StandardInteraction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** StandardInteraction.java 20 Jul 2006 05:14:27 -0000 1.7 --- StandardInteraction.java 15 Aug 2006 06:38:20 -0000 1.8 *************** *** 17,21 **** --- 17,35 ---- */ public class StandardInteraction { + + /** + * ScriptActions which are registered with ReqisterScriptAction can + * implement this interface to get additional data. + */ public interface ChatInfoReceiver { + + /** + * before the ScriptAction is registered this method is called + * to provide additonal data. + * + * @param player the player talking to the NPC + * @param text the text he said + * @param engine the NPC + */ public void setChatInfo(Player player, String text, SpeakerNPC engine); } *************** *** 41,44 **** --- 55,88 ---- /** + * Was this quest started? + */ + public static class QuestStartedCondition extends SpeakerNPC.ChatCondition { + private String questname = null; + + public QuestStartedCondition(String questname) { + this.questname = questname; + } + + public boolean fire(Player player, SpeakerNPC engine) { + return (player.has(questname)); + } + } + + /** + * Was this quest not started yet? + */ + public static class QuestNotStartedCondition extends SpeakerNPC.ChatCondition { + private String questname = null; + + public QuestNotStartedCondition(String questname) { + this.questname = questname; + } + + public boolean fire(Player player, SpeakerNPC engine) { + return (!player.hasQuest(questname)); + } + } + + /** * Was this quest completed? */ |