diff --git a/build.ant.properties b/build.ant.properties index 943f1c3356..4a22ff62fb 100644 --- a/build.ant.properties +++ b/build.ant.properties @@ -73,7 +73,7 @@ version_server = http://arianne.sourceforge.net/stendhal.version # current version of stendhal version.old = 0.88 -version = 0.88.5 +version = 0.89 # javac options javac.deprecation = true diff --git a/data/conf/items/containers.xml b/data/conf/items/containers.xml index 6ac8f3a919..452620266b 100644 --- a/data/conf/items/containers.xml +++ b/data/conf/items/containers.xml @@ -32,7 +32,7 @@ - You see a bottle. It is empty, someone drank the contents + You see a bottle. It is empty, someone drank the contents. @@ -60,7 +60,7 @@ - You see a eared bottle. It is empty, someone drank the contents + You see an eared bottle. It is empty, someone drank the contents. @@ -74,7 +74,7 @@ - You see a fat bottle. It is empty, someone drank the contents + You see a fat bottle. It is empty, someone drank the contents. @@ -88,7 +88,7 @@ - You see a short rounded bottle. It is empty, someone drank the contents + You see a short rounded bottle. It is empty, someone drank the contents. @@ -102,7 +102,7 @@ - You see a short triangular bottle. It is empty, someone drank the contents + You see a short triangular bottle. It is empty, someone drank the contents. @@ -116,7 +116,7 @@ - You see a slim bottle. It is empty, someone drank the contents + You see a slim bottle. It is empty, someone drank the contents. @@ -130,7 +130,7 @@ - You see a squared bottle. It is empty, someone drank the contents + You see a squared bottle. It is empty, someone drank the contents. @@ -144,7 +144,7 @@ - You see a tall bottle. It is empty, someone drank the contents + You see a tall bottle. It is empty, someone drank the contents. @@ -158,7 +158,7 @@ - You see a triangular bottle. It is empty, someone drank the contents + You see a triangular bottle. It is empty, someone drank the contents. diff --git a/data/conf/items/drinks.xml b/data/conf/items/drinks.xml index d50562bb1a..3cc0ae5510 100644 --- a/data/conf/items/drinks.xml +++ b/data/conf/items/drinks.xml @@ -61,7 +61,7 @@ - You see a bottle of VSOP koboldish torcibud, expecially aged in oak kegs wrapped by the darkness of a dungeon cellar. It will help you recover when you're all bruised and battered. + You see a bottle of VSOP koboldish torcibud, specially aged in oak casks wrapped by the darkness of a dungeon cellar. It will help you recover when you're all bruised and battered. @@ -80,7 +80,7 @@ - You see apple juice. On a hot summer day, it would taste great. + You see apple juice. On a hot summer day, it would taste great. @@ -99,7 +99,7 @@ - You see a beer. On a hot summer day, it would taste great. + You see a beer. On a hot summer day, it would taste great. @@ -137,7 +137,7 @@ - You see a pina colada. It looks delicious but tastes dangerously strong!. + You see a pina colada. It looks delicious but tastes dangerously strong!. @@ -443,7 +443,7 @@ - You see a mega potion. It strengthens greatly. + You see a mega potion. It strengthens greatly. diff --git a/data/conf/items/flowers.xml b/data/conf/items/flowers.xml index 68190120cf..8e622d34fb 100644 --- a/data/conf/items/flowers.xml +++ b/data/conf/items/flowers.xml @@ -69,7 +69,7 @@ - You see a pansy, so colorfull and beautifull. + You see a pansy, so colorful and beautiful. diff --git a/data/conf/items/food.xml b/data/conf/items/food.xml index 32b3b0146b..cc522b3195 100644 --- a/data/conf/items/food.xml +++ b/data/conf/items/food.xml @@ -119,7 +119,7 @@ - You see a artichoke. It can be an ingredient, or you can eat it. + You see an artichoke. It can be an ingredient, or you can eat it. diff --git a/data/conf/items/resources.xml b/data/conf/items/resources.xml index b9fd61995d..2d852411af 100644 --- a/data/conf/items/resources.xml +++ b/data/conf/items/resources.xml @@ -17,8 +17,8 @@ - - + + You see a sugar cane. You can grind it for raw sugar. diff --git a/data/conf/zones/ados.xml b/data/conf/zones/ados.xml index 6b549ee3cf..42a39c2b3f 100644 --- a/data/conf/zones/ados.xml +++ b/data/conf/zones/ados.xml @@ -979,6 +979,7 @@ Under new management. Chests to the right are still held by Semos Bank Merchants + @@ -1031,6 +1032,7 @@ in roaches. + @@ -1307,6 +1309,7 @@ in roaches. + @@ -1321,10 +1324,11 @@ in roaches. + - + - + diff --git a/data/conf/zones/amazon.xml b/data/conf/zones/amazon.xml index 0c507c7930..97bc91644a 100644 --- a/data/conf/zones/amazon.xml +++ b/data/conf/zones/amazon.xml @@ -44,13 +44,13 @@ - red_lionfish + red lionfish - red_lionfish + red lionfish @@ -71,7 +71,7 @@ - red_lionfish + red lionfish @@ -84,7 +84,7 @@ - red_lionfish + red lionfish @@ -97,7 +97,7 @@ - red_lionfish + red lionfish diff --git a/data/conf/zones/fado.xml b/data/conf/zones/fado.xml index 33be230cde..c0e747d3cc 100644 --- a/data/conf/zones/fado.xml +++ b/data/conf/zones/fado.xml @@ -149,6 +149,7 @@ You'll definitely need a wedding ring. Come here to get yours cast once you are + @@ -727,6 +728,7 @@ For example say: 11 if you want the room called Water of Love. + diff --git a/data/conf/zones/kirdneh.xml b/data/conf/zones/kirdneh.xml index 26285de334..bfeea2a1ad 100644 --- a/data/conf/zones/kirdneh.xml +++ b/data/conf/zones/kirdneh.xml @@ -744,6 +744,7 @@ + diff --git a/data/conf/zones/orril.xml b/data/conf/zones/orril.xml index 6e2c18acca..01fbc655ab 100644 --- a/data/conf/zones/orril.xml +++ b/data/conf/zones/orril.xml @@ -748,7 +748,7 @@ - + diff --git a/data/conf/zones/semos.xml b/data/conf/zones/semos.xml index 3d07796dd8..3a7006540f 100644 --- a/data/conf/zones/semos.xml +++ b/data/conf/zones/semos.xml @@ -2069,6 +2069,7 @@ Holy mackerel! These chips are tasty. + @@ -2733,6 +2734,7 @@ Mature sheep wanted: please speak to Sato + diff --git a/data/sprites/items/resource/cane.png b/data/sprites/items/resource/sugarcane.png similarity index 100% rename from data/sprites/items/resource/cane.png rename to data/sprites/items/resource/sugarcane.png diff --git a/data/sprites/cane_field.png b/data/sprites/sugar_cane_field.png similarity index 100% rename from data/sprites/cane_field.png rename to data/sprites/sugar_cane_field.png diff --git a/doc/CHANGES.txt b/doc/CHANGES.txt index 28d4f05682..bc946f5591 100644 --- a/doc/CHANGES.txt +++ b/doc/CHANGES.txt @@ -7,6 +7,7 @@ Changelog - corpses have resistance - scrolls can be labelled with /markscroll command - cancel client download if the user closes the progress bar window and confirms the dialog +- corpses have loot protection to anyone but the defender of the hits for a short time after death *world* - Eheneumniranin, a half-elf that lost his memories. He harvests the grain field in ados forest farm area @@ -14,9 +15,8 @@ Changelog - Wrviliza, a kobold barmaid in Wo'fol bar, she also provide new drinks (mild and strong koboldish torcibud) - Kormic, a kobold regular in Wo'fol bar - Uncle Dag in Ados market, he runs a distillery stand there and produces fierywater -- Gaston, a Rat chef in Rat City bakery that will prepare the best crepes suzette au chocolate in town +- Gaston, a Rat chef in Rat City bakery - quest in Wo'fol (the reward is V.S.O.P. koboldish torcibud) -- quest for Ortiv Milquetoast in Kirdneh River House - artichoke, garlic, mandragora (a magical herb) and zantedeschia (a flower) and cane fields are growing in Faiumoni - hen nests spawn eggs - new types of empty bottles diff --git a/libs/marauroa.jar b/libs/marauroa.jar index 480b923194..a15dbc2398 100644 Binary files a/libs/marauroa.jar and b/libs/marauroa.jar differ diff --git a/runserver.bat b/runserver.bat index 441481e724..6f914b0ec8 100644 --- a/runserver.bat +++ b/runserver.bat @@ -1,3 +1,3 @@ -set STENDHAL_VERSION=0.88.5 +set STENDHAL_VERSION=0.89 set LOCALCLASSPATH=.;data\script;data\conf;stendhal-server-%STENDHAL_VERSION%.jar;marauroa.jar;mysql-connector.jar;log4j.jar;commons-lang.jar;h2.jar java -Xmx400m -cp "%LOCALCLASSPATH%" marauroa.server.marauroad -c server.ini -l diff --git a/runserver.sh b/runserver.sh index cb2125a4ab..a3d6efdc47 100644 --- a/runserver.sh +++ b/runserver.sh @@ -1,5 +1,5 @@ #!/bin/sh -STENDHAL_VERSION="0.88.5" +STENDHAL_VERSION="0.89" LOCALCLASSPATH=.:data/script/:data/conf/:stendhal-server-$STENDHAL_VERSION.jar:marauroa.jar:mysql-connector.jar:log4j.jar:commons-lang.jar:h2.jar diff --git a/src/games/stendhal/client/entity/ActiveEntity.java b/src/games/stendhal/client/entity/ActiveEntity.java index 5f793fbacf..fe1926fd24 100644 --- a/src/games/stendhal/client/entity/ActiveEntity.java +++ b/src/games/stendhal/client/entity/ActiveEntity.java @@ -20,6 +20,8 @@ import marauroa.common.game.RPObject; * An entity that has movement and direction. */ public abstract class ActiveEntity extends Entity { + /** Epsilon value used for coordinate change checks. */ + private static final double EPSILON = 0.001; /** * Direction property. */ @@ -163,8 +165,15 @@ public abstract class ActiveEntity extends Entity { this.y = y; } - // Call onPosition only if the entity actually moved - if (!compareDouble(this.x, oldx, 0.001) || !compareDouble(this.y, oldy, 0.001)) { + // Call onPosition only if the entity actually moved. Also always call + // on partial coordinates - those are always predicted rather than real + // and thus should always be a result of prediction. However, the + // client collision detection does not always agree with that of the + // server, so relying on just the coordinate change checks can miss + // entities stopping when they collide with each other. + if (!compareDouble(this.x, oldx, EPSILON) || !compareDouble(this.y, oldy, EPSILON) + || !compareDouble(oldx, (int) oldx, EPSILON) + || !compareDouble(oldy, (int) oldy, EPSILON)) { onPosition(x, y); } } diff --git a/src/games/stendhal/client/gui/ProgressBar.java b/src/games/stendhal/client/gui/ProgressBar.java index f09deabb72..61ae4cb5fe 100644 --- a/src/games/stendhal/client/gui/ProgressBar.java +++ b/src/games/stendhal/client/gui/ProgressBar.java @@ -140,7 +140,9 @@ public class ProgressBar extends JFrame { m_stepCounter = 20; m_stepSizeMultiplier = 2; m_sleepTime = 15; + cancel(); } + /** * Exits quickly. */ diff --git a/src/games/stendhal/client/gui/j2d/entity/EntityViewFactory.java b/src/games/stendhal/client/gui/j2d/entity/EntityViewFactory.java index ff457dbeda..02a6f27a93 100644 --- a/src/games/stendhal/client/gui/j2d/entity/EntityViewFactory.java +++ b/src/games/stendhal/client/gui/j2d/entity/EntityViewFactory.java @@ -201,6 +201,7 @@ public class EntityViewFactory { register("sign", null, null, Sign2DView.class); register("blackboard", null, null, Sign2DView.class); register("shop_sign", null, null, ShopSign2DView.class); + register("rented_sign", null, null, Sign2DView.class); register("tradecentersign", null, null, TradeCenterSign2DView.class); register("item", "jewellery", null, StackableItem2DView.class); diff --git a/src/games/stendhal/client/update/Version.java b/src/games/stendhal/client/update/Version.java index 0a3df7c7b5..1b07865923 100644 --- a/src/games/stendhal/client/update/Version.java +++ b/src/games/stendhal/client/update/Version.java @@ -10,7 +10,7 @@ package games.stendhal.client.update; public class Version { /** Version Number. */ - private static final String VERSION = "0.88.5"; + private static final String VERSION = "0.89"; /** * Extract the specified number of parts from a version-string. diff --git a/src/games/stendhal/common/Debug.java b/src/games/stendhal/common/Debug.java index 98be3fb759..22d575ac01 100644 --- a/src/games/stendhal/common/Debug.java +++ b/src/games/stendhal/common/Debug.java @@ -26,7 +26,7 @@ public class Debug { /** version. */ // Note: This line is updated by build.xml using a regexp so be sure to adjust it in case you modify this line. - public static final String VERSION = "0.88.5"; + public static final String VERSION = "0.89"; public static final String PRE_RELEASE_VERSION = null; diff --git a/src/games/stendhal/server/actions/UseAction.java b/src/games/stendhal/server/actions/UseAction.java index 72fb17e1b7..d1f7a891a9 100644 --- a/src/games/stendhal/server/actions/UseAction.java +++ b/src/games/stendhal/server/actions/UseAction.java @@ -22,7 +22,6 @@ import games.stendhal.server.core.events.UseListener; import games.stendhal.server.entity.Entity; import games.stendhal.server.entity.item.Corpse; import games.stendhal.server.entity.item.Item; -import games.stendhal.server.entity.item.RaidCreatureCorpse; import games.stendhal.server.entity.mapstuff.chest.Chest; import games.stendhal.server.entity.player.Player; import games.stendhal.server.entity.slot.EntitySlot; diff --git a/src/games/stendhal/server/actions/equip/SourceObject.java b/src/games/stendhal/server/actions/equip/SourceObject.java index 018585c451..32a6bc8887 100644 --- a/src/games/stendhal/server/actions/equip/SourceObject.java +++ b/src/games/stendhal/server/actions/equip/SourceObject.java @@ -19,7 +19,6 @@ import games.stendhal.server.core.events.EquipListener; import games.stendhal.server.entity.Entity; import games.stendhal.server.entity.item.Corpse; import games.stendhal.server.entity.item.Item; -import games.stendhal.server.entity.item.RaidCreatureCorpse; import games.stendhal.server.entity.item.Stackable; import games.stendhal.server.entity.item.StackableItem; import games.stendhal.server.entity.player.Player; diff --git a/src/games/stendhal/server/core/engine/GenerateINI.java b/src/games/stendhal/server/core/engine/GenerateINI.java index bdef4323af..626fe1efc6 100644 --- a/src/games/stendhal/server/core/engine/GenerateINI.java +++ b/src/games/stendhal/server/core/engine/GenerateINI.java @@ -246,7 +246,7 @@ public class GenerateINI { out.println(); out.println("server_typeGame=" + gameName); out.println("server_name=" + gameName + " Marauroa server"); - out.println("server_version=0.88.5"); + out.println("server_version=0.89"); out.println("server_contact=https://sourceforge.net/tracker/?atid=514826&group_id=66537&func=browse"); out.println(); out.println("# Extensions configured on the server. Enable at will."); diff --git a/src/games/stendhal/server/core/engine/StendhalRPZone.java b/src/games/stendhal/server/core/engine/StendhalRPZone.java index 9dacad088b..fadb60d935 100644 --- a/src/games/stendhal/server/core/engine/StendhalRPZone.java +++ b/src/games/stendhal/server/core/engine/StendhalRPZone.java @@ -123,7 +123,7 @@ public class StendhalRPZone extends MarauroaRPZone { public CollisionDetection protectionMap; /** Position of this zone in the world map. */ - private boolean interior; + private boolean interior = true; private int level; diff --git a/src/games/stendhal/server/core/rp/StendhalQuestSystem.java b/src/games/stendhal/server/core/rp/StendhalQuestSystem.java index 29d2348d4c..f90a913a1e 100644 --- a/src/games/stendhal/server/core/rp/StendhalQuestSystem.java +++ b/src/games/stendhal/server/core/rp/StendhalQuestSystem.java @@ -77,7 +77,6 @@ import games.stendhal.server.maps.quests.MeetMonogenes; import games.stendhal.server.maps.quests.MeetSanta; import games.stendhal.server.maps.quests.MeetZynn; import games.stendhal.server.maps.quests.MithrilCloak; -import games.stendhal.server.maps.quests.MixtureForOrtiv; import games.stendhal.server.maps.quests.NewsFromHackim; import games.stendhal.server.maps.quests.ObsidianKnife; import games.stendhal.server.maps.quests.PaperChase; @@ -206,7 +205,7 @@ public class StendhalQuestSystem { loadQuest(new MeetSanta()); loadQuest(new MeetZynn()); loadQuest(new MithrilCloak()); - loadQuest(new MixtureForOrtiv()); +// loadQuest(new MixtureForOrtiv()); loadQuest(new NewsFromHackim()); loadQuest(new ObsidianKnife()); loadQuest(new PizzaDelivery()); diff --git a/src/games/stendhal/server/entity/item/FoodMill.java b/src/games/stendhal/server/entity/item/FoodMill.java index bb18988304..918e4847bc 100644 --- a/src/games/stendhal/server/entity/item/FoodMill.java +++ b/src/games/stendhal/server/entity/item/FoodMill.java @@ -48,10 +48,10 @@ public class FoodMill extends Item implements UseListener { * the player needs to equip at least a sugar cane in his other hand * and have an empty sack in his inventory */ - if ("cane".equals(first.get("name"))) { + if ("sugar cane".equals(first.get("name"))) { if (user.isEquipped("empty sack")) { final Item item = SingletonRepository.getEntityManager().getItem("sugar"); - user.drop("cane"); + user.drop("sugar cane"); user.drop("empty sack"); user.equipOrPutOnGround(item); } else { @@ -62,7 +62,7 @@ public class FoodMill extends Item implements UseListener { } } else { /** - * the player needs to equip at least a sugar cane in his other hand + * the player needs to equip at least an apple in his other hand * and have an empty flask in his inventory */ if ("apple".equals(first.get("name"))) { diff --git a/src/games/stendhal/server/entity/mapstuff/spawner/PassiveEntityRespawnPointFactory.java b/src/games/stendhal/server/entity/mapstuff/spawner/PassiveEntityRespawnPointFactory.java index 018cf692cc..1f91ae05c9 100644 --- a/src/games/stendhal/server/entity/mapstuff/spawner/PassiveEntityRespawnPointFactory.java +++ b/src/games/stendhal/server/entity/mapstuff/spawner/PassiveEntityRespawnPointFactory.java @@ -308,7 +308,7 @@ public class PassiveEntityRespawnPointFactory { break; case 1: - passiveEntityrespawnPoint = new GrainField("cane", Arrays.asList("sickle")); + passiveEntityrespawnPoint = new GrainField("sugar cane", Arrays.asList("sickle")); break; default: passiveEntityrespawnPoint = null; diff --git a/src/games/stendhal/server/maps/ados/bakery/ItemsOnTable.java b/src/games/stendhal/server/maps/ados/bakery/ItemsOnTable.java index 87545f1a57..f3524322c1 100644 --- a/src/games/stendhal/server/maps/ados/bakery/ItemsOnTable.java +++ b/src/games/stendhal/server/maps/ados/bakery/ItemsOnTable.java @@ -31,7 +31,7 @@ public class ItemsOnTable implements ZoneConfigurator { // grower for an empty eared bottle (24h) final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("eared bottle", 288000); bottleGrower1.setPosition(8, 13); - bottleGrower1.setDescription("This seems a good spot were a bottle could stand."); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); zone.add(bottleGrower1); bottleGrower1.setToFullGrowth(); diff --git a/src/games/stendhal/server/maps/ados/bar/ItemsOnTable.java b/src/games/stendhal/server/maps/ados/bar/ItemsOnTable.java new file mode 100644 index 0000000000..96c4a57be1 --- /dev/null +++ b/src/games/stendhal/server/maps/ados/bar/ItemsOnTable.java @@ -0,0 +1,47 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.ados.bar; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates bottles in Ados bar + */ +public class ItemsOnTable implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildBarArea(zone); + } + + private void buildBarArea(final StendhalRPZone zone) { + + // grower for an empty slim bottle (24h) + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower1.setPosition(5, 15); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + + // grower for an empty eared bottle (24h) + final PassiveEntityRespawnPoint bottleGrower2 = new PassiveEntityRespawnPoint("eared bottle", 288000); + bottleGrower2.setPosition(22, 4); + bottleGrower2.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower2); + + bottleGrower2.setToFullGrowth(); + } + +} diff --git a/src/games/stendhal/server/maps/ados/bar/ItemsOnTableUpstairs.java b/src/games/stendhal/server/maps/ados/bar/ItemsOnTableUpstairs.java new file mode 100644 index 0000000000..d4c054aa61 --- /dev/null +++ b/src/games/stendhal/server/maps/ados/bar/ItemsOnTableUpstairs.java @@ -0,0 +1,54 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.ados.bar; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates bottles in Ados bar 1st floor (Upstairs) + */ +public class ItemsOnTableUpstairs implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildBarUpstairsArea(zone); + } + + private void buildBarUpstairsArea(final StendhalRPZone zone) { + + // grower for an empty slim bottle (24h) + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower1.setPosition(7, 4); + bottleGrower1.setDescription("This seems a good spot were a bottle could be standing."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + + // grower for an empty slim bottle (24h) + final PassiveEntityRespawnPoint bottleGrower2 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower2.setPosition(8, 25); + bottleGrower2.setDescription("This seems a good spot were a bottle could be standing."); + zone.add(bottleGrower2); + + bottleGrower2.setToFullGrowth(); + + // grower for an empty eared bottle (24h) + final PassiveEntityRespawnPoint bottleGrower3 = new PassiveEntityRespawnPoint("eared bottle", 288000); + bottleGrower3.setPosition(19, 9); + bottleGrower3.setDescription("This seems a good spot were a bottle could be standing."); + zone.add(bottleGrower3); + + bottleGrower3.setToFullGrowth(); + } +} diff --git a/src/games/stendhal/server/maps/ados/magician_house/ItemsOnTable.java b/src/games/stendhal/server/maps/ados/magician_house/ItemsOnTable.java index 4a8a69de93..9361e27cc1 100644 --- a/src/games/stendhal/server/maps/ados/magician_house/ItemsOnTable.java +++ b/src/games/stendhal/server/maps/ados/magician_house/ItemsOnTable.java @@ -43,12 +43,12 @@ public class ItemsOnTable implements ZoneConfigurator { plantGrower.setToFullGrowth(); // grower for an empty slim bottle (see Koboldish Torcibud quest) - final PassiveEntityRespawnPoint bottleGrower = new PassiveEntityRespawnPoint("slim bottle", 1500); - bottleGrower.setPosition(10, 5); - bottleGrower.setDescription("A spot where a bottle could be standing."); - zone.add(bottleGrower); + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 1500); + bottleGrower1.setPosition(10, 5); + bottleGrower1.setDescription("This is a likely spot where a bottle could be found."); + zone.add(bottleGrower1); - bottleGrower.setToFullGrowth(); + bottleGrower1.setToFullGrowth(); } diff --git a/src/games/stendhal/server/maps/ados/market/FierywaterDistillerNPC.java b/src/games/stendhal/server/maps/ados/market/FierywaterDistillerNPC.java index 76f56c69ac..42f0215c6d 100644 --- a/src/games/stendhal/server/maps/ados/market/FierywaterDistillerNPC.java +++ b/src/games/stendhal/server/maps/ados/market/FierywaterDistillerNPC.java @@ -25,7 +25,7 @@ import java.util.TreeMap; /** * Provides Uncle Dag NPC, in Ados Market. - * He will produce fierywater bottles if he is given canes (from cane fields) + * He will produce fierywater bottles if he is given sugar canes (from cane fields) * * @author omero */ @@ -48,15 +48,15 @@ public class FierywaterDistillerNPC implements ZoneConfigurator { addGreeting("Yo!"); addHelp("I'm quite new to this area myself. I cannot help you much, sorry!"); addQuest("Oh, well... I'm not much into those kind of things... I'm a simple man with simple needs, but thank you for asking."); - addJob("I can #brew #fierywater for you, if you bring to me enough #canes and #wood!"); + addJob("I can #brew #fierywater for you, if you bring to me enough #sugar #canes and #wood!"); addOffer("If you need #fierywater, just ask me to #brew some for you!"); addReply("fierywater", - "That's my specialty! Mix that with other ingredients and you'll have an execellent beverage." + "That's my speciality! Mix that with other ingredients and you'll have an excellent beverage." + " Gulp that down 100% pure and most likely you will not survive to tell the experience!"); - addReply(Arrays.asList("cane", "canes"), - "I get all my canes imported directly from Athor island."); + addReply(Arrays.asList("sugar", "cane", "canes", "sugar cane"), + "I get all my sugar canes imported directly from Athor island."); addReply("wood", - "You find plenty of wood logs near trees and forests are the best place to look for those!"); + "You find plenty of wood logs near trees, and forests are the best place to look for those!"); addGoodbye("Enjoy the market!"); } @@ -67,13 +67,13 @@ public class FierywaterDistillerNPC implements ZoneConfigurator { }; final Map requiredResources = new TreeMap(); - requiredResources.put("cane", 5); + requiredResources.put("sugar cane", 5); requiredResources.put("wood", 1); final ProducerBehaviour behaviour = new ProducerBehaviour("uncle_dag_brew_fierywater", "brew", "fierywater", requiredResources, 20 * 60); new ProducerAdder().addProducer(npc, behaviour, - "Yo! I'm Uncle Dag, the distillery man! If you bring me #canes, I could #brew #fierywater for you."); + "Yo! I'm Uncle Dag, the distillery man! If you bring me #sugar #canes, I could #brew #fierywater for you."); npc.setDescription("You see Uncle Dag. He runs the distillery stand in Ados market."); npc.setEntityClass("fierywaterdistillernpc"); diff --git a/src/games/stendhal/server/maps/ados/tavern/ItemsOnTable.java b/src/games/stendhal/server/maps/ados/tavern/ItemsOnTable.java new file mode 100644 index 0000000000..29bbe343ba --- /dev/null +++ b/src/games/stendhal/server/maps/ados/tavern/ItemsOnTable.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.ados.tavern; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates bottles in Ados tavern + */ +public class ItemsOnTable implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildTavernArea(zone); + } + + private void buildTavernArea(final StendhalRPZone zone) { + + // grower for an empty eared bottle (24h) + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("eared bottle", 288000); + bottleGrower1.setPosition(9, 10); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + + // grower for another empty eared bottle (24h) + final PassiveEntityRespawnPoint bottleGrower2 = new PassiveEntityRespawnPoint("eared bottle", 288000); + bottleGrower2.setPosition(28, 3); + bottleGrower2.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower2); + + bottleGrower2.setToFullGrowth(); + } +} diff --git a/src/games/stendhal/server/maps/fado/city/SmallBoyNPC.java b/src/games/stendhal/server/maps/fado/city/SmallBoyNPC.java index ab5e8c866e..bfebe9fe43 100644 --- a/src/games/stendhal/server/maps/fado/city/SmallBoyNPC.java +++ b/src/games/stendhal/server/maps/fado/city/SmallBoyNPC.java @@ -22,6 +22,7 @@ import games.stendhal.server.entity.npc.SpeakerNPC; import games.stendhal.server.entity.player.Player; import games.stendhal.server.entity.Outfit; +import java.util.Arrays; import java.util.Map; @@ -64,6 +65,9 @@ public class SmallBoyNPC implements ZoneConfigurator { + " then I can get my own :)"); addHelp("I wonder if a #balloon could fly high enough to touch the clouds"); addJob("A Job? Is that something you can eat?"); + addReply("balloon", "One day, i will have enough balloons to fly away!"); + addReply(Arrays.asList("xkcd", "tables", "sql", "student", "drop", "table"), + "Oh, yes, my full name is Robert'); DROP TABLE students;-- but I'm called Bobby Tables."); addGoodbye("Good bye."); } diff --git a/src/games/stendhal/server/maps/fado/forest/ItemsOnTable.java b/src/games/stendhal/server/maps/fado/forest/ItemsOnTable.java new file mode 100644 index 0000000000..87baa2032f --- /dev/null +++ b/src/games/stendhal/server/maps/fado/forest/ItemsOnTable.java @@ -0,0 +1,45 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.fado.forest; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates a slim and an eared bottle on the counter in front of the small hut. + */ +public class ItemsOnTable implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildOutsideHutArea(zone); + } + + private void buildOutsideHutArea(final StendhalRPZone zone) { + + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 100); + bottleGrower1.setPosition(48, 28); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + + final PassiveEntityRespawnPoint bottleGrower2 = new PassiveEntityRespawnPoint("eared bottle", 100); + bottleGrower2.setPosition(49, 31); + bottleGrower2.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower2); + + bottleGrower2.setToFullGrowth(); + + } +} diff --git a/src/games/stendhal/server/maps/fado/tavern/ItemsOnTable.java b/src/games/stendhal/server/maps/fado/tavern/ItemsOnTable.java new file mode 100644 index 0000000000..a921e183cf --- /dev/null +++ b/src/games/stendhal/server/maps/fado/tavern/ItemsOnTable.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.fado.tavern; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates bottles in Fado tavern + */ +public class ItemsOnTable implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildInnArea(zone); + } + + private void buildInnArea(final StendhalRPZone zone) { + + // grower for an empty slim bottle (24h) + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower1.setPosition(3, 7); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + + // grower for an empty eared bottle (24h) + final PassiveEntityRespawnPoint bottleGrower2 = new PassiveEntityRespawnPoint("eared bottle", 288000); + bottleGrower2.setPosition(30, 5); + bottleGrower2.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower2); + + bottleGrower2.setToFullGrowth(); + } +} diff --git a/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerApplePieNPC.java b/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerApplePieNPC.java index 24782501d6..5c115e116a 100644 --- a/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerApplePieNPC.java +++ b/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerApplePieNPC.java @@ -58,7 +58,7 @@ public class ConfectionerApplePieNPC implements ZoneConfigurator { addReply("gertha", "She's my twin sister and we live here together... Like me, she also likes to #bake fruit pies!"); addReply("honey", - "You should look for the local beekeper somewhat north and then west of here..."); + "You should look for the local beekeeper a little north and then west of here..."); addReply("milk", "Perhaps you should visit some farm where you see they have cows..."); addReply("flour", @@ -66,16 +66,17 @@ public class ConfectionerApplePieNPC implements ZoneConfigurator { addReply("egg", "Find some hens and you'll easily find some eggs too!"); addReply("apple", - "Mmm... When once in a while I travel from Semos to Ados, I always stop at the orchard near one farm along the road..."); + "Mmm... When once in a while I travel from Semos to Ados, I always stop at the orchard near a farm along the road..."); - addHelp("If that can help, I could #bake an apple pie for you!"); + addHelp("If it would help, I could #bake an apple pie for you!"); addOffer("I'd love to #bake a delicious apple pie for you. Just ask me!"); - addQuest("You can bring me all the recipes you can find on baking pies with exotic fruits!"); + /** this is a teaser for a quest not yet available */ + addQuest("Right now I'm perfecting my apple pie recipe. But in future I might want to try something new - I'll let you know."); - addGoodbye("Be carefull out there!"); + addGoodbye("Be careful out there!"); // (uses sorted TreeMap instead of HashMap) final Map requiredResources = new TreeMap(); @@ -89,7 +90,7 @@ public class ConfectionerApplePieNPC implements ZoneConfigurator { requiredResources, 15 * 60); new ProducerAdder().addProducer(this, behaviour, - "Hello! Did you come for tasting one my delicious apple pies? I could #bake one right away!"); + "Hello! Did you come to taste one my delicious apple pies? I could #bake one for you right away!"); } }; @@ -97,8 +98,7 @@ public class ConfectionerApplePieNPC implements ZoneConfigurator { npc.setDirection(Direction.DOWN); npc.setPosition(4, 3); npc.initHP(100); - npc.setDescription("You see Martha"); + npc.setDescription("You see Martha. She loves to bake apple pies for her guests."); zone.add(npc); } - } diff --git a/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerCherryPieNPC.java b/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerCherryPieNPC.java index 2f8b5d4869..75c47132e9 100644 --- a/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerCherryPieNPC.java +++ b/src/games/stendhal/server/maps/kalavan/cottage_2/ConfectionerCherryPieNPC.java @@ -65,10 +65,10 @@ public class ConfectionerCherryPieNPC implements ZoneConfigurator { addReply("cherry", "Mmm... Those are sometimes hard to get. Did you already ask in some tavern if they can offer any?"); - addHelp("If that can help, I could #bake a cherry pie for you!"); + addHelp("If it would help, I could #bake a cherry pie for you!"); addOffer("I'd be happy to #bake a cherry pie for you. Why don't you just ask me?!"); - addQuest("I'd love to try and bake a strawberry pie once in a while... But Alas! Strawberries are nowhere to be found..."); + addQuest("I'd love to try and bake a strawberry pie once in a while... But alas! Strawberries are nowhere to be found..."); addGoodbye("Take care!"); @@ -84,7 +84,7 @@ public class ConfectionerCherryPieNPC implements ZoneConfigurator { requiredResources, 15 * 60); new ProducerAdder().addProducer(this, behaviour, - "Hello! Did you come for tasting one my fabulous cherry pies? I could #bake one for you happily!"); + "Hello! Did you come to taste one of my fabulous cherry pies? I could #bake one for you happily!"); } }; @@ -92,8 +92,7 @@ public class ConfectionerCherryPieNPC implements ZoneConfigurator { npc.setDirection(Direction.DOWN); npc.setPosition(10, 6); npc.initHP(100); - npc.setDescription("You see Gertha"); + npc.setDescription("You see Gertha. She loves baking cherry pies for her guests."); zone.add(npc); } - } diff --git a/src/games/stendhal/server/maps/kirdneh/inn/ItemsOnTable.java b/src/games/stendhal/server/maps/kirdneh/inn/ItemsOnTable.java new file mode 100644 index 0000000000..02f9a827e6 --- /dev/null +++ b/src/games/stendhal/server/maps/kirdneh/inn/ItemsOnTable.java @@ -0,0 +1,38 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.kirdneh.inn; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates bottles in Kirdneh inn + */ +public class ItemsOnTable implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildInnArea(zone); + } + + private void buildInnArea(final StendhalRPZone zone) { + + // grower for an empty slim bottle (24h) + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower1.setPosition(31, 6); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + } +} diff --git a/src/games/stendhal/server/maps/kirdneh/river/RetiredTeacherNPC.java b/src/games/stendhal/server/maps/kirdneh/river/RetiredTeacherNPC.java index ee1e1b2bd3..56380e470f 100644 --- a/src/games/stendhal/server/maps/kirdneh/river/RetiredTeacherNPC.java +++ b/src/games/stendhal/server/maps/kirdneh/river/RetiredTeacherNPC.java @@ -78,7 +78,7 @@ public class RetiredTeacherNPC implements ZoneConfigurator { addHelp("Never ever get into trouble with assassins when they are stronger than you! They will come to get you otherwise! And some of them are waiting downstairs under my basement!"); addJob("I was a teacher for alchemy once but some of my students turned into ugly bandits and assassins... I don't know what happens in Faiumoni at the moment, though, as I just stay in my safe house the whole day long..."); addOffer("Sorry, but I can't offer you anything... I have some major problems in my basement at the moment..."); - addQuest("I want to prepare a mixture for keeping the assassins and bandits in my cellar. I could need some #ingredients for that..."); + addQuest("I want to prepare a mixture for keeping the assassins and bandits in my cellar. I currently try to find the recipe in one of my books and maybe I will need your help soon with that..."); addGoodbye("Take care of yourself and please return soon to visit me again, I'm scared alone!"); } diff --git a/src/games/stendhal/server/maps/orril/dungeon/RatChefNPC.java b/src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java similarity index 72% rename from src/games/stendhal/server/maps/orril/dungeon/RatChefNPC.java rename to src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java index fcb8ffd6cf..dc64638a83 100644 --- a/src/games/stendhal/server/maps/orril/dungeon/RatChefNPC.java +++ b/src/games/stendhal/server/maps/ratcity/bakery/RatChefNPC.java @@ -9,7 +9,7 @@ * (at your option) any later version. * * * ***************************************************************************/ -package games.stendhal.server.maps.orril.dungeon; +package games.stendhal.server.maps.ratcity.bakery; import games.stendhal.common.Direction; import games.stendhal.server.core.config.ZoneConfigurator; @@ -17,17 +17,17 @@ import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.core.pathfinder.FixedPath; import games.stendhal.server.core.pathfinder.Node; import games.stendhal.server.entity.npc.SpeakerNPC; -import games.stendhal.server.entity.npc.behaviour.adder.ProducerAdder; -import games.stendhal.server.entity.npc.behaviour.impl.ProducerBehaviour; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.TreeMap; /** * Provides a Ratman chef running the Rat City bakery. + * NOTE: the producing code inhibited because + * one required ingredient for crepes suzette au chocolate + * is 'sugar' which is not available unless summoned. * * @author omero */ @@ -61,9 +61,12 @@ public class RatChefNPC implements ZoneConfigurator { @Override protected void createDialog() { - addJob("I'm the best #crepes suzette au chocolate chef in town. Ask me to #bake one for you!"); + addGreeting("Hi there. I hope you haven't come to taste my #crepes suzette au chocolate because I'm still setting up my bakery for that!"); + //addJob("I'm the best #crepes suzette au chocolate chef in town. Ask me to #bake one for you!"); + addJob("I'm busy with the preparations for opening this bakery." + + " Soon you may taste the finest #crepes suzette au chocolate in town!"); addReply("crepes", - "Ah le dessert for a prince... A taste of which, I really believe, would reform a cannibal into a civilized gentleman"); + "Ah le dessert for a prince... A taste of which, I really believe, would reform a cannibal into a civilized gentleman."); addReply(Arrays.asList("chocolate","chocolate bar"), "A rarity. It seems only very nasty and murderous folks carry some in their pockets."); addReply("flour", @@ -73,11 +76,17 @@ public class RatChefNPC implements ZoneConfigurator { addReply(Arrays.asList("butter","milk"), "A farm would be a good place where one could find that ingredient."); addReply("sugar", - "That comes by grinding sugar canes, wich you could harvest yourself in cane fields."); - addOffer("I will serve you crepes suzette au chocolate if you ask me to #bake one!"); - addHelp("Ask me to #bake you my special #chocolate #crepes suzette, that's what I offer."); - addGoodbye("Au revoire voyageur... And come back visiting me anytime you like!"); + "That comes from grinding sugar canes, which you could harvest yourself in cane fields."); + //addOffer("I will serve you crepes suzette au chocolate if you ask me to #bake one!"); + addOffer("Alas, this bakery shop still needs some finishing touches before I can offer you my #crepes suzette au chocolate!"); + //addHelp("Ask me to #bake you my special #chocolate #crepes suzette, that's what I offer."); + addHelp("My apologies but I'm rather busy making this bakery shop ready, so I cannot be very helpful to you at the moment."); + addGoodbye("Au revoire voyageur... And come back to visit me anytime you like!"); + /* + * the sugar ingredient cannot be obtained at the moment + * the producer code is therefore disabled until sugar is made available to players + * final Map requiredResources = new TreeMap(); requiredResources.put("flour", 1); requiredResources.put("egg", 1); @@ -92,6 +101,7 @@ public class RatChefNPC implements ZoneConfigurator { new ProducerAdder().addProducer(this, behaviour, "Hi there. I bet you've come to taste my #crepes suzette au chocolate! I can #bake some for you if you like."); + */ } }; diff --git a/src/games/stendhal/server/maps/semos/bakery/ItemsOnTable.java b/src/games/stendhal/server/maps/semos/bakery/ItemsOnTable.java new file mode 100644 index 0000000000..e9acd83263 --- /dev/null +++ b/src/games/stendhal/server/maps/semos/bakery/ItemsOnTable.java @@ -0,0 +1,47 @@ +/*************************************************************************** + * (C) Copyright 2003-2010 - Stendhal * + *************************************************************************** + *************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +package games.stendhal.server.maps.semos.bakery; + +import games.stendhal.server.core.config.ZoneConfigurator; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.entity.mapstuff.spawner.PassiveEntityRespawnPoint; + +import java.util.Map; + +/** + * Creates bottles in Semos bakery + */ +public class ItemsOnTable implements ZoneConfigurator { + public void configureZone(final StendhalRPZone zone, final Map attributes) { + buildBakeryArea(zone); + } + + private void buildBakeryArea(final StendhalRPZone zone) { + + // grower for an empty slim bottle that cannot be taken (out of reach) + final PassiveEntityRespawnPoint bottleGrower1 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower1.setPosition(4, 1); + bottleGrower1.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower1); + + bottleGrower1.setToFullGrowth(); + + // grower for an empty slim bottle (24h) + final PassiveEntityRespawnPoint bottleGrower2 = new PassiveEntityRespawnPoint("slim bottle", 288000); + bottleGrower2.setPosition(22, 2); + bottleGrower2.setDescription("This seems a likely spot where a bottle could be found."); + zone.add(bottleGrower2); + + bottleGrower2.setToFullGrowth(); + + } +} diff --git a/src/games/stendhal/server/maps/wofol/bar/KoboldBarmaidNPC.java b/src/games/stendhal/server/maps/wofol/bar/KoboldBarmaidNPC.java index e4ff3208ec..f184a35f6b 100644 --- a/src/games/stendhal/server/maps/wofol/bar/KoboldBarmaidNPC.java +++ b/src/games/stendhal/server/maps/wofol/bar/KoboldBarmaidNPC.java @@ -17,6 +17,7 @@ import games.stendhal.server.core.engine.StendhalRPZone; import games.stendhal.server.core.pathfinder.FixedPath; import games.stendhal.server.core.pathfinder.Node; import games.stendhal.server.entity.item.Item; +import games.stendhal.server.entity.item.StackableItem; import games.stendhal.server.entity.npc.EventRaiser; import games.stendhal.server.entity.npc.SpeakerNPC; import games.stendhal.server.entity.npc.behaviour.adder.SellerAdder; @@ -76,10 +77,10 @@ public class KoboldBarmaidNPC implements ZoneConfigurator { } /** - * Wrviliza will sell her mild or strong koboldish torcibud - * only when the player can afford the price and carries as many empty bottles - * as the requested amount in his inventory. - */ + * Wrviliza will sell her mild or strong koboldish torcibud + * only when the player can afford the price and carries as many empty bottles + * as the requested amount in his inventory. + */ @Override public boolean transactAgreedDeal(final EventRaiser seller, final Player player) { final Item item = getAskedItem(chosenItemName); @@ -92,43 +93,54 @@ public class KoboldBarmaidNPC implements ZoneConfigurator { } int price = getCharge(player); - + if (player.isBadBoy()) { - price = (int) (BAD_BOY_BUYING_PENALTY * price); + price = (int) (BAD_BOY_BUYING_PENALTY * price); } - + if ("slim bottle".equals(requiredContainer) || "eared bottle".equals(requiredContainer)) { - if (!player.isEquipped(requiredContainer, amount) || !player.isEquipped("money", price)) { + if (!player.isEquipped(requiredContainer, getAmount()) || !player.isEquipped("money", price)) { seller.say("Wrauff! I can only sell you " - + Grammar.plnoun(getAmount(), getChosenItemName()) - + " if you meet the price of " + price + " and have " + amount + " empty " - + Grammar.plnoun(getAmount(), requiredContainer)); - return false; + + Grammar.plnoun(getAmount(), getChosenItemName()) + + " if you meet the price of " + price + " and have " + getAmount() + " empty " + + Grammar.plnoun(getAmount(), requiredContainer) + "."); + return false; } } else if (!player.isEquipped("money", price)) { - seller.say("Wruff! I can only sell you " + seller.say("Wruff! I can only sell you " + Grammar.plnoun(getAmount(), getChosenItemName()) - + " when you will have enough money"); - return false; + + " if you have enough money."); + return false; } - + + /** + * If the user tries to buy several of a non-stackable item, + * he is forced to buy only one. + */ + if (item instanceof StackableItem) { + ((StackableItem) item).setQuantity(getAmount()); + } else { + setAmount(1); + } + if (player.equipToInventoryOnly(item)) { player.drop("money", price); - if (requiredContainer != "") { - player.drop(requiredContainer, amount); + if (!"".equals(requiredContainer)) { + player.drop(requiredContainer, amount); } - + + seller.say("Wroff! Here " + Grammar.isare(getAmount()) + " your " + Grammar.plnoun(getAmount(), getChosenItemName()) + "!"); return true; - } else { - seller.say("Wruff.. You cannot carry any " - + Grammar.plnoun(getAmount(), getChosenItemName()) + } else { + seller.say("Wruff.. You cannot carry any " + + Grammar.plnoun(getAmount(), getChosenItemName()) + " in your bag now."); - return false; - } + return false; + } } } @@ -149,7 +161,7 @@ public class KoboldBarmaidNPC implements ZoneConfigurator { "Wroff! Welcome into the Kobold's Den bar wanderer!" + " I'm Wrviliza, wife of #Wrvil." + " If you want me to #offer you some beverages, just say so!"); - addJob("Wroff! I offer wine, beer and my famous #mild or #strong koboldish #torcibud"); + addJob("Wroff! I offer wine, beer and my famous #mild or #strong koboldish #torcibud."); addHelp("Wruff... If you are thirsty I can #offer you some beverage. If you didn't notice, this is a bar!"); addGoodbye("Wroff... Goodbye and good luck!"); diff --git a/src/games/stendhal/server/script/DeepInspect.java b/src/games/stendhal/server/script/DeepInspect.java index 2e12edaf06..5ad9c53b07 100644 --- a/src/games/stendhal/server/script/DeepInspect.java +++ b/src/games/stendhal/server/script/DeepInspect.java @@ -54,7 +54,7 @@ public class DeepInspect extends ScriptImpl { * inspect an online character * * @param admin Inspector - * @param character name of online character to inspect + * @param charname name of online character to inspect */ private void inspectOnline(final Player admin, final String charname) { Player player = SingletonRepository.getRuleProcessor().getPlayer(charname); diff --git a/stendhal.jnlp b/stendhal.jnlp index b019ecdea3..079d4c9fa7 100644 --- a/stendhal.jnlp +++ b/stendhal.jnlp @@ -22,7 +22,7 @@ Some of these people are NPC, they will give you tasks to accomplish and hints t - +