Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/creature
In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv13889/src/games/stendhal/server/entity/creature
Modified Files:
ItemGuardCreature.java
Log Message:
added constructor for using extra parameter for quest index
Index: ItemGuardCreature.java
===================================================================
RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/entity/creature/ItemGuardCreature.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** ItemGuardCreature.java 27 Mar 2010 13:46:18 -0000 1.26
--- ItemGuardCreature.java 3 May 2010 21:49:03 -0000 1.27
***************
*** 39,42 ****
--- 39,44 ----
private final String questState;
+
+ private final int questIndex;
/**
***************
*** 48,54 ****
*/
public ItemGuardCreature(final Creature copy, final String itemType) {
! this(copy, itemType, null, null);
}
!
/**
* Creates an ItemGuardCreature.
--- 50,56 ----
*/
public ItemGuardCreature(final Creature copy, final String itemType) {
! this(copy, itemType, null, null, 0);
}
!
/**
* Creates an ItemGuardCreature.
***************
*** 64,67 ****
--- 66,86 ----
*/
public ItemGuardCreature(final Creature copy, final String itemType, final String questSlot, final String questState) {
+ this(copy, itemType, questSlot, questState, 0);
+ }
+
+
+ /**
+ * Creates an ItemGuardCreature.
+ *
+ * @param copy
+ * base creature
+ * @param itemType
+ * the quest item to drop on death
+ * @param questSlot
+ * the quest slot for the active quest
+ * @param questState
+ * the state of the quest to check on dead for
+ */
+ public ItemGuardCreature(final Creature copy, final String itemType, final String questSlot, final String questState, final int questIndex) {
super(copy);
***************
*** 69,72 ****
--- 88,92 ----
this.questSlot = questSlot;
this.questState = questState;
+ this.questIndex = questIndex;
noises = new LinkedHashMap<String, LinkedList<String>>(noises);
***************
*** 86,90 ****
@Override
public Creature getNewInstance() {
! return new ItemGuardCreature(this, itemType, questSlot, questState);
}
--- 106,110 ----
@Override
public Creature getNewInstance() {
! return new ItemGuardCreature(this, itemType, questSlot, questState, questIndex);
}
***************
*** 96,100 ****
if (!killerPlayer.isEquipped(itemType) && !killerPlayer.isQuestCompleted(questSlot)) {
if(questState != null) {
! if (killerPlayer.isQuestInState(questSlot,questState)) {
equipPlayerWithGuardedItem(killerPlayer);
}
--- 116,120 ----
if (!killerPlayer.isEquipped(itemType) && !killerPlayer.isQuestCompleted(questSlot)) {
if(questState != null) {
! if (killerPlayer.isQuestInState(questSlot, questIndex, questState)) {
equipPlayerWithGuardedItem(killerPlayer);
}
|