Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/quests
In directory vz-cvs-4.sog:/tmp/cvs-serv3707/src/games/stendhal/server/maps/quests
Modified Files:
GuessKills.java
Log Message:
Excluded rare creatures. Fixes [3495012] "Crearid guessing quest: twilight slime"
Index: GuessKills.java
===================================================================
RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/maps/quests/GuessKills.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GuessKills.java 28 Nov 2011 13:44:41 -0000 1.3
--- GuessKills.java 27 Feb 2012 22:56:49 -0000 1.4
***************
*** 18,22 ****
import games.stendhal.common.parser.Sentence;
import games.stendhal.server.core.engine.SingletonRepository;
- import games.stendhal.server.core.rule.defaultruleset.DefaultEntityManager;
import games.stendhal.server.entity.Entity;
import games.stendhal.server.entity.creature.Creature;
--- 18,21 ----
***************
*** 84,97 ****
*/
public class GuessKills extends AbstractQuest {
! public static final String QUEST_SLOT = "guess_kills";
! private static final double ACCURACY = 0.02;
! private static final int MIN_KILLS_REQUIRED = 1000;
! private static final int EXACT_REWARD = 150;
! private static final int CLOSE_REWARD = 90;
! private static final int INTERVAL_BETWEEN_TRIES = MathHelper.MINUTES_IN_ONE_WEEK;
!
! private String CREATURE = "rat";
@Override
--- 83,108 ----
*/
public class GuessKills extends AbstractQuest {
+ public static final String QUEST_SLOT = "guess_kills";
! private static final double ACCURACY = 0.02;
! private static final int MIN_KILLS_REQUIRED = 1000;
! private static final int EXACT_REWARD = 150;
! private static final int CLOSE_REWARD = 90;
! private static final int INTERVAL_BETWEEN_TRIES = MathHelper.MINUTES_IN_ONE_WEEK;
! /** List of existing creatures that may be asked about. */
! private static final List<Creature> POSSIBLE_CREATURES = new ArrayList<Creature>();
! private String CREATURE = "rat";
!
! /**
! * Create new quest instance.
! */
! public GuessKills() {
! for (Creature creature : SingletonRepository.getEntityManager().getCreatures()) {
! if (!creature.isRare()) {
! POSSIBLE_CREATURES.add(creature);
! }
! }
! }
@Override
***************
*** 166,171 ****
final SpeakerNPC npc = npcs.get("Crearid");
- final DefaultEntityManager manager = (DefaultEntityManager) SingletonRepository.getEntityManager();
-
final ChatCondition requirement = new MinTotalCreaturesKilledCondition(MIN_KILLS_REQUIRED);
final ChatCondition isNumber = new TextHasNumberCondition(Integer.MIN_VALUE, Integer.MAX_VALUE);
--- 177,180 ----
***************
*** 300,304 ****
public void fire(Player player, Sentence sentence, EventRaiser npc) {
do {
! CREATURE = ((Creature) Rand.rand(manager.getCreatures().toArray())).getName();
} while(!player.hasKilled(CREATURE));
--- 309,313 ----
public void fire(Player player, Sentence sentence, EventRaiser npc) {
do {
! CREATURE = Rand.rand(POSSIBLE_CREATURES).getName();
} while(!player.hasKilled(CREATURE));
|