From 453205546a893531790fbc54dabcd47817a42327 Mon Sep 17 00:00:00 2001 From: Katie Russell Date: Sat, 1 Jan 2011 21:27:28 +0000 Subject: [PATCH 01/10] update version number on branch to 0.90.6 --- README.txt | 4 ++-- build.ant.properties | 4 ++-- runserver.bat | 2 +- runserver.sh | 2 +- src/games/stendhal/client/update/Version.java | 2 +- src/games/stendhal/common/Debug.java | 2 +- src/games/stendhal/server/core/engine/GenerateINI.java | 2 +- stendhal.jnlp | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.txt b/README.txt index bac11b9a7e..ec54688b4e 100644 --- a/README.txt +++ b/README.txt @@ -39,12 +39,12 @@ Java is included in most Linux distributions. Both Sun Java and OpenJDK are supp Please download Stendhal from http://arianne.sourceforge.net Then unzip the client zip into a new folder. -You can double click on stendhal-0.90.5.jar and the client will run. +You can double click on stendhal-0.90.6.jar and the client will run. If you prefer to run from command line, then just execute this command in the stendhal folder: - java -jar stendhal-0.90.5.jar + java -jar stendhal-0.90.6.jar Alternatively you can run it using Java Webstart technology at: diff --git a/build.ant.properties b/build.ant.properties index a482b67441..caedf8d021 100644 --- a/build.ant.properties +++ b/build.ant.properties @@ -72,8 +72,8 @@ updates_server = http://arianne.sourceforge.net/stendhal/updates version_server = http://arianne.sourceforge.net/stendhal.version # current version of stendhal -version.old = 0.89.7 -version = 0.90.5 +version.old = 0.90 +version = 0.90.6 # javac options javac.deprecation = true diff --git a/runserver.bat b/runserver.bat index 4ba3c9ffd8..d31dd5e5ea 100644 --- a/runserver.bat +++ b/runserver.bat @@ -1,3 +1,3 @@ -set STENDHAL_VERSION=0.90.5 +set STENDHAL_VERSION=0.90.6 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 adb59c2394..cb8b4a8789 100644 --- a/runserver.sh +++ b/runserver.sh @@ -1,5 +1,5 @@ #!/bin/sh -STENDHAL_VERSION="0.90.5" +STENDHAL_VERSION="0.90.6" 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/update/Version.java b/src/games/stendhal/client/update/Version.java index 09bf15d5c0..cdad93ef89 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.90.5"; + private static final String VERSION = "0.90.6"; /** * 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 b80a7c02d5..1485d59606 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.90.5"; + public static final String VERSION = "0.90.6"; public static final String PRE_RELEASE_VERSION = null; diff --git a/src/games/stendhal/server/core/engine/GenerateINI.java b/src/games/stendhal/server/core/engine/GenerateINI.java index ad281c4bec..a0c70b9bbe 100644 --- a/src/games/stendhal/server/core/engine/GenerateINI.java +++ b/src/games/stendhal/server/core/engine/GenerateINI.java @@ -271,7 +271,7 @@ public class GenerateINI { out.println(); out.println("server_typeGame=" + gameName); out.println("server_name=" + gameName + " Marauroa server"); - out.println("server_version=0.90.5"); + out.println("server_version=0.90.6"); 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/stendhal.jnlp b/stendhal.jnlp index 6169bd0ca2..d143b02182 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 - + From d2504c485294259bd6f98b5f4081c5cc8985e5d0 Mon Sep 17 00:00:00 2001 From: Katie Russell Date: Sat, 1 Jan 2011 21:47:16 +0000 Subject: [PATCH 02/10] backport fix [Stendhal] Mixture for Ortiv quest history-show items needed - ID: 3148660 --- .../stendhal/server/maps/quests/MixtureForOrtiv.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/games/stendhal/server/maps/quests/MixtureForOrtiv.java b/src/games/stendhal/server/maps/quests/MixtureForOrtiv.java index 96361a4efa..fa5dbabf5d 100644 --- a/src/games/stendhal/server/maps/quests/MixtureForOrtiv.java +++ b/src/games/stendhal/server/maps/quests/MixtureForOrtiv.java @@ -12,6 +12,7 @@ ***************************************************************************/ package games.stendhal.server.maps.quests; +import games.stendhal.common.Grammar; import games.stendhal.server.entity.npc.ChatAction; import games.stendhal.server.entity.npc.ConversationPhrases; import games.stendhal.server.entity.npc.ConversationStates; @@ -26,13 +27,13 @@ import games.stendhal.server.entity.npc.action.SayTextAction; import games.stendhal.server.entity.npc.action.SetQuestAction; import games.stendhal.server.entity.npc.action.SetQuestAndModifyKarmaAction; import games.stendhal.server.entity.npc.condition.AndCondition; +import games.stendhal.server.entity.npc.condition.GreetingMatchesNameCondition; import games.stendhal.server.entity.npc.condition.LevelGreaterThanCondition; import games.stendhal.server.entity.npc.condition.NotCondition; import games.stendhal.server.entity.npc.condition.QuestActiveCondition; import games.stendhal.server.entity.npc.condition.QuestCompletedCondition; import games.stendhal.server.entity.npc.condition.QuestInStateCondition; import games.stendhal.server.entity.npc.condition.QuestNotStartedCondition; -import games.stendhal.server.entity.npc.condition.GreetingMatchesNameCondition; import games.stendhal.server.entity.player.Player; import games.stendhal.server.util.ItemCollection; @@ -90,8 +91,11 @@ public class MixtureForOrtiv extends AbstractQuest { final String questState = player.getQuest(QUEST_SLOT); if ("rejected".equals(questState)) { res.add("I don't want to help Ortiv at the moment. He should go out and take the ingredients by himself."); - } - if ("done".equals(questState)) { + } else if (!"done".equals(questState)) { + final ItemCollection missingItems = new ItemCollection(); + missingItems.addFromQuestStateString(questState); + res.add("I still need to bring Ortiv " + Grammar.enumerateCollection(missingItems.toStringList()) + "."); + } else { res.add("I helped Ortiv. Now he can sleep safe again in his bed. He rewarded me with some XP and an assassin dagger for my use."); } return res; From 94711681f28d2f9621eb59395db3877e780aabdf Mon Sep 17 00:00:00 2001 From: Katie Russell Date: Sat, 1 Jan 2011 21:47:37 +0000 Subject: [PATCH 03/10] backport fix [Stendhal] MithrilCloak quest history rejected state - ID: 3149362 --- src/games/stendhal/server/maps/quests/MithrilCloak.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/games/stendhal/server/maps/quests/MithrilCloak.java b/src/games/stendhal/server/maps/quests/MithrilCloak.java index 3e59797a72..11568f81dc 100644 --- a/src/games/stendhal/server/maps/quests/MithrilCloak.java +++ b/src/games/stendhal/server/maps/quests/MithrilCloak.java @@ -117,7 +117,10 @@ public class MithrilCloak extends AbstractQuest { } final String questState = player.getQuest(QUEST_SLOT); res.add("I met Ida in her sewing room in Ados."); - + if (questState.equals("rejected")) { + res.add("I am not interested in helping Ida."); + return res; + } res.add("Ida's sewing machine is broken and she has asked me to find the missing part."); if (questState.startsWith("machine")) { // optionally could fetch item name from quest slot From df6feb5dcb0d0663c2c809090e748fbc6c9aac08 Mon Sep 17 00:00:00 2001 From: Hendrik Brummermann Date: Sun, 2 Jan 2011 16:41:52 +0000 Subject: [PATCH 04/10] updated version number --- README.txt | 4 ++-- build.ant.properties | 2 +- runserver.bat | 2 +- runserver.sh | 2 +- src/games/stendhal/client/update/Version.java | 2 +- src/games/stendhal/common/Debug.java | 2 +- src/games/stendhal/server/core/engine/GenerateINI.java | 2 +- stendhal.jnlp | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.txt b/README.txt index ec54688b4e..9bb05857f3 100644 --- a/README.txt +++ b/README.txt @@ -39,12 +39,12 @@ Java is included in most Linux distributions. Both Sun Java and OpenJDK are supp Please download Stendhal from http://arianne.sourceforge.net Then unzip the client zip into a new folder. -You can double click on stendhal-0.90.6.jar and the client will run. +You can double click on stendhal-0.91.jar and the client will run. If you prefer to run from command line, then just execute this command in the stendhal folder: - java -jar stendhal-0.90.6.jar + java -jar stendhal-0.91.jar Alternatively you can run it using Java Webstart technology at: diff --git a/build.ant.properties b/build.ant.properties index caedf8d021..c7b8148057 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.90 -version = 0.90.6 +version = 0.91 # javac options javac.deprecation = true diff --git a/runserver.bat b/runserver.bat index d31dd5e5ea..8bd491bad8 100644 --- a/runserver.bat +++ b/runserver.bat @@ -1,3 +1,3 @@ -set STENDHAL_VERSION=0.90.6 +set STENDHAL_VERSION=0.91 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 cb8b4a8789..eb4572f2e3 100644 --- a/runserver.sh +++ b/runserver.sh @@ -1,5 +1,5 @@ #!/bin/sh -STENDHAL_VERSION="0.90.6" +STENDHAL_VERSION="0.91" 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/update/Version.java b/src/games/stendhal/client/update/Version.java index cdad93ef89..19a74db3d0 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.90.6"; + private static final String VERSION = "0.91"; /** * 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 1485d59606..a7a24d89e3 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.90.6"; + public static final String VERSION = "0.91"; public static final String PRE_RELEASE_VERSION = null; diff --git a/src/games/stendhal/server/core/engine/GenerateINI.java b/src/games/stendhal/server/core/engine/GenerateINI.java index a0c70b9bbe..b4c3b2c5dc 100644 --- a/src/games/stendhal/server/core/engine/GenerateINI.java +++ b/src/games/stendhal/server/core/engine/GenerateINI.java @@ -271,7 +271,7 @@ public class GenerateINI { out.println(); out.println("server_typeGame=" + gameName); out.println("server_name=" + gameName + " Marauroa server"); - out.println("server_version=0.90.6"); + out.println("server_version=0.91"); 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/stendhal.jnlp b/stendhal.jnlp index d143b02182..1209ce8640 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 - + From d7fe3de44e9eaf430f70786a51cc991e4a18ef66 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Sun, 2 Jan 2011 21:04:36 +0000 Subject: [PATCH 05/10] backport fix for bug #3149878: avoid NullPointer exception for adding of the first buddy --- src/games/stendhal/server/entity/player/Player.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/games/stendhal/server/entity/player/Player.java b/src/games/stendhal/server/entity/player/Player.java index 9f13ca61f6..c059db81c3 100644 --- a/src/games/stendhal/server/entity/player/Player.java +++ b/src/games/stendhal/server/entity/player/Player.java @@ -2004,7 +2004,7 @@ public class Player extends RPEntity { * @return true if the buddy has been added */ public boolean addBuddy(String name, boolean online) { - boolean isNew = !getMap("buddies").containsKey(name); + boolean isNew = !hasMap("buddies") || !getMap("buddies").containsKey(name); put("buddies", name, online); From 42cbb952e2ef336ec84fba75bd1266a914e12042 Mon Sep 17 00:00:00 2001 From: Katie Russell Date: Sun, 2 Jan 2011 21:13:23 +0000 Subject: [PATCH 06/10] backport fix for [Stendhal] Obsidian knife History doesn't have a matching quest state for book_read - ID: 3149860 --- src/games/stendhal/server/maps/quests/ObsidianKnife.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/games/stendhal/server/maps/quests/ObsidianKnife.java b/src/games/stendhal/server/maps/quests/ObsidianKnife.java index c90569b2b6..6008cb2a8d 100644 --- a/src/games/stendhal/server/maps/quests/ObsidianKnife.java +++ b/src/games/stendhal/server/maps/quests/ObsidianKnife.java @@ -153,7 +153,11 @@ public class ObsidianKnife extends AbstractQuest { if (questState.startsWith("reading")) { return res; } - res.add("Alrak says if I kill a black dragon and find a cod and an obsidian he will make me a knife."); + res.add("Alrak said that the book had taught him how to make a knife, it sounded pretty good."); + if (questState.equals("book_read")) { + return res; + } + res.add("Alrak says if I kill a black dragon and find a cod and an obsidian he will make me the knife."); if (questState.equals("knife_offered") && !player.hasKilled("black dragon")) { return res; From 1aeb5ee64706721b65c31f6a57beb491cf37d4e9 Mon Sep 17 00:00:00 2001 From: Hendrik Brummermann Date: Sun, 2 Jan 2011 23:10:42 +0000 Subject: [PATCH 07/10] fixed creatures attacking cats; even after they have been killed (fixes #3149889) --- .../stendhal/server/entity/creature/Cat.java | 12 ++++ .../entity/creature/DomesticAnimal.java | 11 +++- .../stendhal/server/script/SaveTheCats.java | 63 +++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/games/stendhal/server/script/SaveTheCats.java diff --git a/src/games/stendhal/server/entity/creature/Cat.java b/src/games/stendhal/server/entity/creature/Cat.java index 1f62df56ff..eb61302981 100644 --- a/src/games/stendhal/server/entity/creature/Cat.java +++ b/src/games/stendhal/server/entity/creature/Cat.java @@ -125,4 +125,16 @@ public class Cat extends Pet { return Arrays.asList("chicken", "trout", "cod", "mackerel", "char", "perch", "roach", "surgeonfish", "clownfish"); } + + /** + * Does this domestic animal take part in combat? + * + * @return true, if it can be attacked by creatures, false otherwise + */ + @Override + protected boolean takesPartInCombat() { + return false; + } + + } diff --git a/src/games/stendhal/server/entity/creature/DomesticAnimal.java b/src/games/stendhal/server/entity/creature/DomesticAnimal.java index 8d272e803c..f703c3f927 100644 --- a/src/games/stendhal/server/entity/creature/DomesticAnimal.java +++ b/src/games/stendhal/server/entity/creature/DomesticAnimal.java @@ -89,12 +89,21 @@ public abstract class DomesticAnimal extends Creature { this.owner = owner; if (owner != null) { wasOwned = true; - if (getZone() != null) { + if (takesPartInCombat() && getZone() != null) { getZone().addToPlayersAndFriends(this); } } } + /** + * Does this domestic animal take part in combat? + * + * @return true, if it can be attacked by creatures, false otherwise + */ + protected boolean takesPartInCombat() { + return true; + } + public Player getOwner() { return owner; } diff --git a/src/games/stendhal/server/script/SaveTheCats.java b/src/games/stendhal/server/script/SaveTheCats.java new file mode 100644 index 0000000000..387ea288f4 --- /dev/null +++ b/src/games/stendhal/server/script/SaveTheCats.java @@ -0,0 +1,63 @@ +/* $Id$ */ +/*************************************************************************** + * (C) Copyright 2003 - Marauroa * + *************************************************************************** + *************************************************************************** + * * + * 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.script; + +import games.stendhal.server.core.engine.StendhalRPWorld; +import games.stendhal.server.core.engine.StendhalRPZone; +import games.stendhal.server.core.events.TurnListener; +import games.stendhal.server.core.events.TurnNotifier; +import games.stendhal.server.core.scripting.ScriptImpl; +import games.stendhal.server.entity.RPEntity; +import games.stendhal.server.entity.creature.Cat; +import games.stendhal.server.entity.player.Player; + +import java.util.Iterator; +import java.util.List; + +import marauroa.common.game.IRPZone; + +/** + * saves cats (workaround for https://sourceforge.net/support/tracker.php?aid=3149889 ) + * + * @author hendrik + */ +public class SaveTheCats extends ScriptImpl implements TurnListener { + + @Override + public void execute(Player admin, List args) { + TurnNotifier.get().notifyInTurns(1, this); + } + + public void onTurnReached(int currentTurn) { + TurnNotifier.get().notifyInTurns(1, this); + StendhalRPWorld world = StendhalRPWorld.get(); + for (IRPZone zone : world) { + List friends = ((StendhalRPZone) zone).getPlayerAndFriends(); + Iterator itr = friends.iterator(); + while (itr.hasNext()) { + RPEntity entity = itr.next(); + if (entity instanceof Cat) { + itr.remove(); + } + } + } + } + + @Override + public void unload(Player admin, List args) { + super.unload(admin, args); + TurnNotifier.get().dontNotify(this); + } + + +} From d7180433cf3387ae0171b167bb9b7ef87ab57909 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Mon, 3 Jan 2011 22:58:55 +0000 Subject: [PATCH 08/10] backport fix for 3150568: avoid parser NullPointerExceptions --- .../server/entity/npc/parser/SentenceImplementation.java | 2 +- src/games/stendhal/server/entity/npc/parser/WordList.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/games/stendhal/server/entity/npc/parser/SentenceImplementation.java b/src/games/stendhal/server/entity/npc/parser/SentenceImplementation.java index d92bbd5bd7..357cd1e88c 100644 --- a/src/games/stendhal/server/entity/npc/parser/SentenceImplementation.java +++ b/src/games/stendhal/server/entity/npc/parser/SentenceImplementation.java @@ -167,7 +167,7 @@ public final class SentenceImplementation extends Sentence { if (verb.isGerund) { w.setType(new ExpressionType(verb.entry.getTypeString() + ExpressionType.SUFFIX_GERUND)); wordFound = true; - } else if (verb.entry.getType().isVerb()) { + } else if ((verb.entry.getType() != null) && verb.entry.getType().isVerb()) { w.setType(verb.entry.getType()); wordFound = true; } else if (!verb.isPast) { // avoid cases like "rounded" diff --git a/src/games/stendhal/server/entity/npc/parser/WordList.java b/src/games/stendhal/server/entity/npc/parser/WordList.java index b74d6f742d..b5846c5f1f 100644 --- a/src/games/stendhal/server/entity/npc/parser/WordList.java +++ b/src/games/stendhal/server/entity/npc/parser/WordList.java @@ -786,6 +786,7 @@ final public class WordList { if (entry == null) { entry = new WordEntry(); + entry.setType(new ExpressionType("")); // add the new entry entry.setNormalized(key); From 331a11efa2e04c6bae17f9db08b3ac02ae777be2 Mon Sep 17 00:00:00 2001 From: Katie Russell Date: Tue, 4 Jan 2011 20:33:20 +0000 Subject: [PATCH 09/10] Backport fix [Stendhal] Daily monster quest completes twice - ID: 3151245 there was a standard condition and also a 'non standard version doing the same thing in another action called at the same time. remove all non standard stuff related to that action. --- .../server/maps/quests/DailyMonsterQuest.java | 40 +++++-------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/src/games/stendhal/server/maps/quests/DailyMonsterQuest.java b/src/games/stendhal/server/maps/quests/DailyMonsterQuest.java index cc153e234c..950b8c5707 100644 --- a/src/games/stendhal/server/maps/quests/DailyMonsterQuest.java +++ b/src/games/stendhal/server/maps/quests/DailyMonsterQuest.java @@ -22,11 +22,14 @@ import games.stendhal.server.entity.npc.ConversationPhrases; import games.stendhal.server.entity.npc.ConversationStates; import games.stendhal.server.entity.npc.EventRaiser; import games.stendhal.server.entity.npc.SpeakerNPC; -import games.stendhal.server.entity.npc.action.IncrementQuestAction; -import games.stendhal.server.entity.npc.action.ProcessReachedQuestAchievementsAction; +import games.stendhal.server.entity.npc.action.IncreaseKarmaAction; import games.stendhal.server.entity.npc.action.IncreaseXPDependentOnLevelAction; +import games.stendhal.server.entity.npc.action.IncrementQuestAction; import games.stendhal.server.entity.npc.action.MultipleActions; +import games.stendhal.server.entity.npc.action.ProcessReachedQuestAchievementsAction; import games.stendhal.server.entity.npc.action.SayTimeRemainingAction; +import games.stendhal.server.entity.npc.action.SetQuestAction; +import games.stendhal.server.entity.npc.action.SetQuestToTimeStampAction; import games.stendhal.server.entity.npc.condition.AndCondition; import games.stendhal.server.entity.npc.condition.KilledForQuestCondition; import games.stendhal.server.entity.npc.condition.NotCondition; @@ -241,30 +244,6 @@ public class DailyMonsterQuest extends AbstractQuest { */ } - static class DailyQuestCompleteAction implements ChatAction { - - public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) { - final String questInfo = player.getQuest(QUEST_SLOT); - String questCount = null; - String questLast = null; - - //logger.info("Inside DailyQuestCompleteAction"); - final String[] tokens = (questInfo + ";0;0").split(";"); - //questLast = tokens[1]; - questCount = tokens[2]; - if (questCount.equals("null")) { - questCount = "0"; - } - - new IncreaseXPDependentOnLevelAction(5, 95.0).fire(player, sentence, raiser); - raiser.say("Good work! Let me thank you in the name of the people of Semos!"); - player.addKarma(5.0); - questCount = "" + (Integer.valueOf(questCount) + 1); - questLast = "" + (new Date()).getTime(); - player.setQuest(QUEST_SLOT, "done" + ";" + questLast + ";" + questCount); - } - } - static class DailyQuestAbortAction implements ChatAction { public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) { @@ -469,11 +448,14 @@ public class DailyMonsterQuest extends AbstractQuest { new QuestNotCompletedCondition(QUEST_SLOT), new KilledForQuestCondition(QUEST_SLOT, 0)), ConversationStates.ATTENDING, - null, + "Good work! Let me thank you in the name of the people of Semos!", new MultipleActions( - new DailyQuestCompleteAction(), + new IncreaseXPDependentOnLevelAction(5, 95.0), + new IncreaseKarmaAction(5.0), new ProcessReachedQuestAchievementsAction(), - new IncrementQuestAction(QUEST_SLOT, 2, 1) + new IncrementQuestAction(QUEST_SLOT, 2, 1), + new SetQuestToTimeStampAction(QUEST_SLOT,1), + new SetQuestAction(QUEST_SLOT,0,"done") )); } From 0490610ef5d0f9d6ff2a4082c1422a6850c3a796 Mon Sep 17 00:00:00 2001 From: Martin Fuchs Date: Thu, 6 Jan 2011 14:23:58 +0000 Subject: [PATCH 10/10] backport the fix for bug ID 3152393: [Stendhal] IndexOutOfBoundsException for parser --- src/games/stendhal/server/entity/npc/parser/CompoundName.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/games/stendhal/server/entity/npc/parser/CompoundName.java b/src/games/stendhal/server/entity/npc/parser/CompoundName.java index 6ef6ba1191..fc0242ac14 100644 --- a/src/games/stendhal/server/entity/npc/parser/CompoundName.java +++ b/src/games/stendhal/server/entity/npc/parser/CompoundName.java @@ -52,6 +52,10 @@ public class CompoundName extends ArrayList { */ public boolean matches(AbstractList expressions, int idx) { for(int i=0; i= expressions.size()) { + return false; + } + Expression curr = expressions.get(idx); String word = get(i);