1 /***************************************************************************
2  *                   (C) Copyright 2003-2019 - 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.semos.mountain;
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 //import games.stendhal.server.entity.npc.action.StoreMessageAction;
26 
27 /**
28  * Provides Brosoklelo
29  *
30  * @author omero
31  */
32 public class BefuddledSorcerorNPC implements ZoneConfigurator {
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(final StendhalRPZone zone)38 	private SpeakerNPC buildNPC(final StendhalRPZone zone) {
39 		final SpeakerNPC npc = new SpeakerNPC("Brosoklelo") {
40 
41 			@Override
42 			protected void createPath() {
43 				final List<Node> nodes = new LinkedList<Node>();
44 				nodes.add(new Node(75, 124));
45 				nodes.add(new Node(79, 124));
46 				nodes.add(new Node(79, 122));
47 				nodes.add(new Node(75, 122));
48 				setPath(new FixedPath(nodes, true));
49 			}
50 
51 			@Override
52 			public void createDialog() {
53 				addGreeting(
54 						"Ave");
55 				addGoodbye(
56 						"Fortvna");
57 				addJob(
58                         "I like dueling in magical duels..." + " " +
59                         "Oh... My poor #memory..." + " " +
60                         "I am confused... Look, I have a purple apple!");
61 				addHelp(
62 						"I can not help you with anything..." + " " +
63 						"My #memory is nagging at me..." + " " +
64 						"All I have is a purple apple!");
65 				addOffer(
66 						"I can not offer you anything..." + " " +
67 						"My #memory seems in disarray..." + " " +
68 						"I can offer you a purple apple!");
69 				addReply(
70 	                    "Kirdneh",
71 	                    "My #memory... A purple #apple... #Kirdneh... Ah, that is place!",
72 	                    null
73 	            );
74 				addReply(
75 	                    "Vlamyklela",
76 	                    "My #memory... A purple #apple... #Vlamyklela... Ah, beloved stepsister!",
77 	                    null
78 	            );
79 				addReply(
80 	                    "apple",
81 	                    "You would not think about an apple..." + " " +
82 	                    "Unless you are bestowed a special kind of an apple!" + " " +
83 	                    "My #memory... Vlamyklela... Kirdneh...",
84 	                    null
85 	            );
86 
87 				/**
88 				 * additional behavior defined in AdMemoriaInPortfolio quest
89 				 */
90 			}
91 		};
92 
93 		// Finalize Brosoklelo
94 		npc.setEntityClass("brownwizardnpc");
95 		npc.setPosition(77,127);
96 		npc.initHP(100);
97 		npc.setCollisionAction(CollisionAction.REROUTE);
98 		npc.setDescription("You see Brosoklelo... He seems somewhat confused!");
99 		zone.add(npc);
100 		return npc;
101 	}
102 }
103