From: MadMetzger <mad...@us...> - 2010-02-03 18:23:45
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/quests In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv17035/src/games/stendhal/server/maps/quests Modified Files: SadScientist.java Log Message: added new quest step Index: SadScientist.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/quests/SadScientist.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SadScientist.java 28 Jan 2010 18:42:12 -0000 1.2 --- SadScientist.java 3 Feb 2010 18:23:11 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- import games.stendhal.server.entity.npc.action.MultipleActions; import games.stendhal.server.entity.npc.action.SetQuestAction; + import games.stendhal.server.entity.npc.action.StateTimeRemainingAction; import games.stendhal.server.entity.npc.condition.AndCondition; import games.stendhal.server.entity.npc.condition.NotCondition; *************** *** 15,18 **** --- 16,21 ---- import games.stendhal.server.entity.npc.condition.QuestNotActiveCondition; import games.stendhal.server.entity.npc.condition.QuestNotStartedCondition; + import games.stendhal.server.entity.npc.condition.QuestStateStartsWithCondition; + import games.stendhal.server.entity.npc.condition.TimePassedCondition; import java.util.Arrays; *************** *** 21,24 **** --- 24,28 ---- public static final String QUEST_SLOT = "sad_scientist"; + private static final int REQUIRED_MINUTES = 20; *************** *** 52,70 **** playerReturnsAfterStartWithItems(npc); playerReturnsAfterStartWithoutItems(npc); } private void playerReturnsAfterStartWithoutItems(SpeakerNPC npc) { ! ChatCondition condition = new NotCondition( ! new AndCondition( new QuestInStateCondition(QUEST_SLOT, "start"), ! new PlayerHasItemWithHimCondition("emerald"), ! new PlayerHasItemWithHimCondition("obsidian"), ! new PlayerHasItemWithHimCondition("sapphire"), ! new PlayerHasItemWithHimCondition("carbuncle",2), ! new PlayerHasItemWithHimCondition("gold bar",20), ! new PlayerHasItemWithHimCondition("mithril bar"), ! new PlayerHasItemWithHimCondition("shadow legs"), new QuestNotActiveCondition("mithril_cloak") - ) ); npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES, --- 56,92 ---- playerReturnsAfterStartWithItems(npc); playerReturnsAfterStartWithoutItems(npc); + playerReturnsAfterGivingTooEarly(npc); + playerReturnsAfterGivingWhenFinished(npc); + } + + private void playerReturnsAfterGivingWhenFinished(SpeakerNPC npc) { + // TODO Auto-generated method stub + + } + + private void playerReturnsAfterGivingTooEarly(SpeakerNPC npc) { + ChatCondition condition = new AndCondition( + new QuestStateStartsWithCondition(QUEST_SLOT, "making;"), + new NotCondition(new TimePassedCondition(QUEST_SLOT, REQUIRED_MINUTES, 1)), + new QuestNotActiveCondition("mithril_cloak") + ); + npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES, + condition, + ConversationStates.IDLE, + "Hello. Please return when you have everything what I need for the jewelled legs.", + new StateTimeRemainingAction(QUEST_SLOT, "Do you think I can work that fast? Go away. Come back in", REQUIRED_MINUTES, 1)); } private void playerReturnsAfterStartWithoutItems(SpeakerNPC npc) { ! ChatCondition condition = new AndCondition( new QuestInStateCondition(QUEST_SLOT, "start"), ! new NotCondition( new PlayerHasItemWithHimCondition("emerald")), ! new NotCondition( new PlayerHasItemWithHimCondition("obsidian")), ! new NotCondition( new PlayerHasItemWithHimCondition("sapphire")), ! new NotCondition( new PlayerHasItemWithHimCondition("carbuncle",2)), ! new NotCondition( new PlayerHasItemWithHimCondition("gold bar",20)), ! new NotCondition( new PlayerHasItemWithHimCondition("mithril bar")), ! new NotCondition( new PlayerHasItemWithHimCondition("shadow legs")), new QuestNotActiveCondition("mithril_cloak") ); npc.add(ConversationStates.IDLE, ConversationPhrases.GREETING_MESSAGES, *************** *** 73,77 **** "Hello. Please return when you have everything what I need for the jewelled legs.", null); - } --- 95,98 ---- |