1 /***************************************************************************
2  *                   (C) Copyright 2003-2010 - Stendhal                    *
3  ***************************************************************************
4  ***************************************************************************
5  *                                                                         *
6  *   This program is free software; you can redistribute it and/or modify  *
7  *   it under the terms of the GNU General Public License as published by  *
8  *   the Free Software Foundation; either version 2 of the License, or     *
9  *   (at your option) any later version.                                   *
10  *                                                                         *
11  ***************************************************************************/
12 
13 package games.stendhal.server.maps.ados.forest;
14 
15 import java.util.LinkedList;
16 import java.util.List;
17 import java.util.Map;
18 
19 import games.stendhal.server.core.config.ZoneConfigurator;
20 import games.stendhal.server.core.engine.StendhalRPZone;
21 import games.stendhal.server.core.pathfinder.FixedPath;
22 import games.stendhal.server.core.pathfinder.Node;
23 import games.stendhal.server.entity.CollisionAction;
24 import games.stendhal.server.entity.npc.SpeakerNPC;
25 
26 /**
27  * Provides Eheneumniranin
28  *
29  * @author omero
30  */
31 public class SickleingHalfelfNPC implements ZoneConfigurator {
32 
33 	@Override
configureZone(StendhalRPZone zone, Map<String, String> attributes)34 	public void configureZone(StendhalRPZone zone, Map<String, String> attributes) {
35 		buildNPC(zone);
36 	}
37 
buildNPC(StendhalRPZone zone)38 	private void buildNPC(StendhalRPZone zone) {
39 		SpeakerNPC npc = new SpeakerNPC("Eheneumniranin") {
40 
41 			@Override
42 			protected void createPath() {
43 				final List<Node> nodes = new LinkedList<Node>();
44 				nodes.add(new Node(77, 96));
45 				nodes.add(new Node(77, 98));
46 				nodes.add(new Node(81, 98));
47 				nodes.add(new Node(81, 100));
48 				nodes.add(new Node(85, 100));
49 				nodes.add(new Node(85, 107));
50 				nodes.add(new Node(75, 107));
51 				nodes.add(new Node(75, 96));
52 
53 				setPath(new FixedPath(nodes, true));
54 			}
55 
56 			@Override
57 			public void createDialog() {
58 				addGreeting("Salve straniero...");
59 				addJob( "To gather the sheaves of grain... With a #sickle... Maybe I should use a #scythe!");
60 				addReply(
61 						"sickle",
62 						"A usefull farming tool indeed."+
63 						" To some blacksmith one should ask to if he offers any such sharp utensil.");
64 				addReply(
65 						"scythe",
66 						"A usefull farming tool indeed."+
67 						" To some blacksmith one should ask to if he offers any such sharp utensil.");
68 				addGoodbye("In bocca al lupo...");
69 			}
70 		};
71 
72 		npc.setEntityClass("sickleinghalfelfnpc");
73 		npc.setPosition(76,97);
74 		npc.initHP(100);
75 		npc.setCollisionAction(CollisionAction.REVERSE); // So does not block straw carts
76 		npc.setDescription("You see Eheneumniranin");
77 		zone.add(npc);
78 	}
79 }
80