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.ados.market; 14 15 import java.util.LinkedList; 16 import java.util.List; 17 import java.util.Map; 18 19 import games.stendhal.common.Direction; 20 import games.stendhal.server.core.config.ZoneConfigurator; 21 import games.stendhal.server.core.engine.StendhalRPZone; 22 import games.stendhal.server.core.pathfinder.FixedPath; 23 import games.stendhal.server.core.pathfinder.Node; 24 import games.stendhal.server.entity.CollisionAction; 25 import games.stendhal.server.entity.npc.SpeakerNPC; 26 27 /** 28 * Builds a npc in Ados (name:Florence Boullabaisse) who is a fish soup maker on the market 29 * 30 * @author Krupi (fish soup idea) Vanessa Julius (implemented) 31 * 32 */ 33 public class FishSoupMakerNPC implements ZoneConfigurator { 34 35 @Override configureZone(final StendhalRPZone zone, final Map<String, String> attributes)36 public void configureZone(final StendhalRPZone zone, final Map<String, String> attributes) { 37 buildNPC(zone); 38 } 39 buildNPC(final StendhalRPZone zone)40 private void buildNPC(final StendhalRPZone zone) { 41 final SpeakerNPC npc = new SpeakerNPC("Florence Boullabaisse") { 42 43 @Override 44 protected void createPath() { 45 final List<Node> nodes = new LinkedList<Node>(); 46 nodes.add(new Node(63, 14)); 47 nodes.add(new Node(70, 14)); 48 nodes.add(new Node(70, 10)); 49 nodes.add(new Node(67, 10)); 50 nodes.add(new Node(67, 14)); 51 nodes.add(new Node(64, 14)); 52 nodes.add(new Node(64, 10)); 53 nodes.add(new Node(63, 10)); 54 setPath(new FixedPath(nodes, true)); 55 56 } 57 58 @Override 59 protected void createDialog() { 60 //addGreeting(); 61 addHelp("I can cook a really tasty fish soup for you but if you are not into fish, I can suggest a good friend of mine to you, Old Mother Helena in Fado. She makes the best vegetable soup in the whole of Faiumoni!"); 62 63 addQuest("I don't have any quests for you, but I can offer you some fresh made fish soup for your travels."); 64 addJob("I am a trained cook but specialized into soups. My most favourite soup is a fish soup but I also like normal ones..."); 65 addOffer("If you are really hungry or need some food for your travels, I can cook a really tasty fish soup for you after a selfmade receipe."); 66 addGoodbye("Have a nice stay and day on Ados market!"); 67 addEmotionReply("cuddle", "cuddle"); 68 } 69 }; 70 71 npc.setDescription("You see Florence Boullabaisse. She is an excellent soup chef."); 72 npc.setEntityClass("fishsoupmakernpc"); 73 npc.setPosition(63, 14); 74 npc.setCollisionAction(CollisionAction.STOP); 75 npc.setDirection(Direction.RIGHT); 76 npc.initHP(100); 77 zone.add(npc); 78 } 79 } 80