1 /* $Id$ */
2 /***************************************************************************
3  *                   (C) Copyright 2003-2010 - Stendhal                    *
4  ***************************************************************************
5  ***************************************************************************
6  *                                                                         *
7  *   This program is free software; you can redistribute it and/or modify  *
8  *   it under the terms of the GNU General Public License as published by  *
9  *   the Free Software Foundation; either version 2 of the License, or     *
10  *   (at your option) any later version.                                   *
11  *                                                                         *
12  ***************************************************************************/
13 package games.stendhal.server.maps.semos.house;
14 
15 import java.util.Map;
16 
17 import games.stendhal.server.core.config.ZoneConfigurator;
18 import games.stendhal.server.core.engine.SingletonRepository;
19 import games.stendhal.server.core.engine.StendhalRPZone;
20 import games.stendhal.server.entity.CollisionAction;
21 import games.stendhal.server.entity.npc.SpeakerNPC;
22 import games.stendhal.server.entity.npc.behaviour.impl.TeleporterBehaviour;
23 
24 /**
25  * Builds a Flower Seller NPC for the Elf Princess quest.
26  *
27  * @author kymara
28  */
29 public class FlowerSellerNPC implements ZoneConfigurator {
30 	@Override
configureZone(final StendhalRPZone zone, final Map<String, String> attributes)31 	public void configureZone(final StendhalRPZone zone, final Map<String, String> attributes) {
32 
33         	new TeleporterBehaviour(buildSemosHouseArea(), null, "0", "Flowers! Get your fresh flowers here!");
34 	}
35 
buildSemosHouseArea()36 	private SpeakerNPC buildSemosHouseArea() {
37 
38 	    final SpeakerNPC rose = new SpeakerNPC("Rose Leigh") {
39 	                @Override
40 			protected void createPath() {
41 				// npc does not move
42 				setPath(null);
43 			}
44 	                @Override
45 			protected void createDialog() {
46 			    addJob("I'm a wandering flower woman.");
47 			    addGoodbye("Everything's coming up roses ... bye ...");
48 			    // the rest is in the ElfPrincess quest
49 			}
50 		};
51 
52 		rose.setEntityClass("gypsywomannpc");
53 		rose.initHP(100);
54 		rose.setCollisionAction(CollisionAction.REVERSE);
55 		rose.setDescription("You see Rose Leigh. She jumps from place to place with a basket filled with lovely rhosyds.");
56 
57 		// start in int_semos_house
58 		final StendhalRPZone	zone = SingletonRepository.getRPWorld().getZone("int_semos_house");
59 		rose.setPosition(5, 6);
60 		zone.add(rose);
61 
62 		return rose;
63 	}
64 }
65