From: MadMetzger <mad...@us...> - 2010-06-15 20:22:50
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/semos/city In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32071/src/games/stendhal/server/maps/semos/city Modified Files: GreeterNPC.java Log Message: configure greeter npc via zone configurator Index: GreeterNPC.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/semos/city/GreeterNPC.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** GreeterNPC.java 25 May 2010 20:29:04 -0000 1.12 --- GreeterNPC.java 15 Jun 2010 20:22:42 -0000 1.13 *************** *** 1,4 **** --- 1,9 ---- package games.stendhal.server.maps.semos.city; + import java.util.Map; + + import games.stendhal.common.Direction; + import games.stendhal.server.core.config.ZoneConfigurator; + import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.entity.npc.SpeakerNPC; import games.stendhal.server.entity.npc.SpeakerNPCFactory; *************** *** 11,22 **** * @see games.stendhal.server.maps.quests.HatForMonogenes */ ! //TODO: take NPC definition elements which are currently in XML and include here ! public class GreeterNPC extends SpeakerNPCFactory { ! @Override ! public void createDialog(final SpeakerNPC npc) { ! npc.addJob("I'm Diogenes' older brother and I don't actually remember what I used to do... I'm retired now."); ! npc.addOffer("I give directions to #buildings in Semos, to newcomers settle in. When I'm in a bad mood I sometimes give misleading directions to amuse myself... hee hee hee! Of course, sometimes I get my wrong directions wrong and they end up being right after all! Ha ha!"); ! // All further behaviour is defined in quest classes. } ! } --- 16,40 ---- * @see games.stendhal.server.maps.quests.HatForMonogenes */ ! public class GreeterNPC implements ZoneConfigurator { ! public void configureZone(StendhalRPZone zone, ! Map<String, String> attributes) { ! buildNPC(zone); } ! ! private void buildNPC(final StendhalRPZone zone) { ! final SpeakerNPC npc = new SpeakerNPC("Monogenes") { ! @Override ! public void createDialog() { ! addJob("I'm Diogenes' older brother and I don't actually remember what I used to do... I'm retired now."); ! addOffer("I give directions to #buildings in Semos, to newcomers settle in. When I'm in a bad mood I sometimes give misleading directions to amuse myself... hee hee hee! Of course, sometimes I get my wrong directions wrong and they end up being right after all! Ha ha!"); ! // All further behaviour is defined in quest classes. ! } ! }; ! npc.setPosition(26, 22); ! npc.setEntityClass("oldmannpc"); ! npc.setDirection(Direction.LEFT); ! zone.add(npc); ! } ! ! } \ No newline at end of file |