com.planet_ink.coffee_mud.Common
Class DefaultQuest

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultQuest
All Implemented Interfaces:
CMCommon, Quest, CMModifiable, CMObject, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultQuest
extends java.lang.Object
implements Quest, Tickable, CMObject


Nested Class Summary
protected static class DefaultQuest.JScriptQuest
           
static class DefaultQuest.MysteryData
           
static class DefaultQuest.QuestState
           
 
Field Summary
protected  java.lang.String displayName
           
protected  boolean durable
           
protected  int duration
           
 DVector internalFiles
           
protected  long lastStartDateTime
           
protected  int maxWait
           
protected  int minPlayers
           
protected  int minWait
           
protected  java.lang.String name
           
protected  java.lang.String playerMask
           
protected  java.lang.String rawScriptParameter
           
protected  int runLevel
           
protected  int spawn
           
protected  java.lang.String startDate
           
protected  int ticksRemaining
           
protected  int waitRemaining
           
protected  java.util.Vector winners
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Quest
MYSTERY_QCODES, QCODES, QOBJS, ROOM_REFERENCE_QCODES, SPAWN_ANY, SPAWN_DESCS, SPAWN_FIRST, SPAWN_NO
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MOB, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SPELL_AFFECT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET, TICKMASK_SOLITARY, TICKS_PER_RLMIN, TIME_MILIS_PER_MUDHOUR, TIME_TICK, TIME_TICK_DOUBLE
 
Constructor Summary
DefaultQuest()
           
 
Method Summary
 void autostartup()
          After a quest is added to the list of quests, this method is called to put the quest into its initial wait state, and get it thread time.
 void cleanQuestStep()
           
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 void declareWinner(java.lang.String name)
          Registers the given player name as having won this quest.
 java.lang.String displayName()
          Returns the friendly display name of the quest
 int duration()
          Returns the duration, in ticks of this quest.
 boolean enterDormantState()
          A dormant state is the state where a quest is no longer running, but is not, or has not yet, been scheduled to wait for another run time.
 void enterRunningState()
           
protected  void errorOccurred(DefaultQuest.QuestState q, boolean quietFlag, java.lang.String msg)
           
protected  int getCodeNum(java.lang.String code)
           
 java.lang.Object getDesignatedObject(java.lang.String named)
          From the given official quest variable name, it derives either an object or a vector of objects that reflect it.
 Quest getMainQuestObject()
           
 int getObjectInUseIndex(java.lang.String name)
          Returns the index of a room, mob, or item of the given name in use by this quest.
 Item getQuestItem(int i)
          Returns the item in use by this quest at the given index
 int getQuestItemIndex(java.lang.String name)
          Returns the index of a item of the given name in use by this quest
 java.lang.String getQuestItemName(int i)
          Returns the name of the item in use by this quest at the given index
 MOB getQuestMob(int i)
          Returns the mob in use by this quest at the given index
 int getQuestMobIndex(java.lang.String name)
          Returns the index of a mob of the given name in use by this quest
 java.lang.String getQuestMobName(int i)
          Returns the name of the mob in use by this quest at the given index
 Room getQuestRoom(int i)
          Returns the room in use by this quest at the given index
 java.lang.String getQuestRoomID(int i)
          Returns the id of the room in use by this quest at the given index
 int getQuestRoomIndex(java.lang.String roomID)
          Returns the index of a room of the given id in use by this quest
 Environmental getQuestThing(java.util.Vector V, int dex, int type, int[] num)
           
 int getQuestThingIndex(java.util.Vector V, java.lang.String name, int type, int[] num)
           
 java.lang.StringBuffer getResourceFileData(java.lang.String named)
          Quest scripts can have files of various sorts embedded in them.
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 int getSpawn()
          Returns the flag denoting whether this quest spawns new ones from its several steps and if so, by what method.
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 long getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 java.util.Vector getWinners()
          Returns the names of all the winners of this quest
 java.lang.String getWinnerStr()
          Returns a semicolon delimited string of all the winners of this quest
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 void internalQuestDelete()
          If any files are embedded and cached inside this quest script, this method will clear them from resources and memory.
 boolean isCopy()
          Returns whether this quest object is a spawned copy
 boolean isObjectInUse(Environmental E)
          Returns whether the exact given object is in use by this quest.
 boolean isStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 int minPlayers()
          The minimum number of players matching player criteria required before this quest will start
 int minsRemaining()
          Returns the number of minutes before this quest will go from a running state to a stopped state.
 int minWait()
          Returns the minimum number of ticks between attempts to run this quest.
 java.lang.String name()
          Returns the unique name of the quest
 CMObject newInstance()
          Returns a new instance of this class.
 java.util.Vector parseLoadScripts(java.lang.String text, java.util.Vector oldArgs, java.util.Vector args)
           
 void parseQuestScript(java.util.Vector script, java.util.Vector args, int startLine)
           
 void parseQuestScriptWArgs(java.util.Vector script, java.util.Vector args)
           
 java.lang.String playerMask()
          Returns the zappermask that determines who counts as an elligible player for the purposes of the minPlayer setting.
 void resetQuest(int firstPauseTicks)
          this will stop executing of the quest script.
 boolean resetWaitRemaining(long ellapsedTime)
          Sets the number of ticks before this quest will attempt to start.
 int runLevel()
          Returns the run level.
 boolean running()
          Returns whether this quest is in a running state
 void runtimeRegisterAbility(MOB mob, java.lang.String abilityID, java.lang.String parms, boolean give)
          they are called when you want the quest engine to be aware of a a quest-specific object thats being added to the map, so that it can be cleaned up later.
 void runtimeRegisterBehavior(Environmental behaving, java.lang.String behaviorID, java.lang.String parms, boolean give)
          Called when you want the quest engine to be aware of a quest specific object that is being added to the map, so that it can be cleaned up later.
 void runtimeRegisterEffect(Environmental affected, java.lang.String abilityID, java.lang.String parms, boolean give)
          Called when you want the quest engine to be aware of a quest specific object that is being added to the map, so that it can be cleaned up later.
 void runtimeRegisterObject(Environmental object)
          Called when you want the quest engine to be aware of a quest specific object that is being added to the map, so that it can be cleaned up later.
 void runtimeRegisterStat(Environmental E, java.lang.String stat, java.lang.String parms, boolean give)
           
 boolean sameAs(DefaultQuest E)
           
 java.lang.String script()
          Returns the unparsed quest script as a single happy string.
 void setCopy(boolean truefalse)
          Sets whether this quest object is a spawned copy
 void setDisplayName(java.lang.String newName)
          Sets the friendly display name of the quest
 void setDuration(int newTicks)
          Sets the duration, in ticks of this quest.
 void setMinPlayers(int players)
          Sets minimum number of players matching player criteria required before this quest will start
 void setMinWait(int wait)
          Sets the minimum number of ticks between attempts to run this quest.
 void setName(java.lang.String newName)
          Sets the unique name of the quest
 void setPlayerMask(java.lang.String mask)
          Sets the zappermask that determines who counts as an elligible player for the purposes of the minPlayer setting.
 void setRunLevel(int level)
          Sets the run level.
 void setScript(java.lang.String parm)
          Sets the quest script.
 void setSpawn(int spawnFlag)
          Sets the flag denoting whether this quest spawns new ones from its several steps and if so, by what method.
 void setStartDate(java.lang.String newDate)
          Sets the real-life start date of this quest.
 void setStartMudDate(java.lang.String newDate)
          Sets the in-game mud start date of this quest.
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 void setSuspended(boolean truefalse)
          Sets whether this quest object is suspended.
 void setVars(java.util.Vector script, int startAtLine)
          Accepts a pre-parsed quest script and extracts certain non-iterative variables, such as the quest name and similar variables.
 void setWaitInterval(int wait)
          Sets the maximum ticks, above the minimum wait, that must go by before an attempt to run a quest.
 void setWinners(java.lang.String list)
          Sets the list of player names that have won this quest
 boolean spawnQuest(java.lang.String script, java.util.Vector baseVars, boolean reTime)
           
 java.lang.String startDate()
          Returns the unique start date of the quest.
 boolean startQuest()
          This will execute the quest script.
 boolean startQuestOnTime()
          This method is called every tick to check and see if the wait is completed and its time to actually start the quest.
 boolean stepQuest()
          This method is called when a quest is done with a particular step in a multi-step quest.
 boolean stopping()
          Returns whether this quest is in a midway stopping state
 void stopQuest()
          this will stop executing of the quest script.
 boolean suspended()
          Returns whether this quest object is suspended.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 int ticksRemaining()
          Returns the number of ticks before this quest will go from a running state to a stopped state.
 boolean waiting()
          Returns whether this quest is in a wait state between runs
 int waitInterval()
          Returns the maximum ticks, above the minimum wait, that must go by before an attempt to run a quest.
 int waitRemaining()
          Returns the number of ticks before this quest will attempt to start.
 boolean wasWinner(java.lang.String name)
          Returns whether a player of the given name has won this quest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

displayName

protected java.lang.String displayName

startDate

protected java.lang.String startDate

duration

protected int duration

rawScriptParameter

protected java.lang.String rawScriptParameter

winners

protected java.util.Vector winners

durable

protected boolean durable

minWait

protected int minWait

minPlayers

protected int minPlayers

playerMask

protected java.lang.String playerMask

runLevel

protected int runLevel

maxWait

protected int maxWait

waitRemaining

protected int waitRemaining

ticksRemaining

protected int ticksRemaining

lastStartDateTime

protected long lastStartDateTime

spawn

protected int spawn

internalFiles

public DVector internalFiles
Constructor Detail

DefaultQuest

public DefaultQuest()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

name

public java.lang.String name()
Description copied from interface: Quest
Returns the unique name of the quest

Specified by:
name in interface Quest
Specified by:
name in interface Tickable
Returns:
the unique name of the quest
See Also:
Quest.setName(String)

setName

public void setName(java.lang.String newName)
Description copied from interface: Quest
Sets the unique name of the quest

Specified by:
setName in interface Quest
Parameters:
newName - the unique name of the quest
See Also:
Quest.name()

displayName

public java.lang.String displayName()
Description copied from interface: Quest
Returns the friendly display name of the quest

Specified by:
displayName in interface Quest
Returns:
the friendly display name of the quest
See Also:
Quest.setDisplayName(String)

setDisplayName

public void setDisplayName(java.lang.String newName)
Description copied from interface: Quest
Sets the friendly display name of the quest

Specified by:
setDisplayName in interface Quest
Parameters:
newName - the friendly display name of the quest
See Also:
Quest.displayName()

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

suspended

public boolean suspended()
Description copied from interface: Quest
Returns whether this quest object is suspended. A suspended quest is always in a stopped state.

Specified by:
suspended in interface Quest
Returns:
true if this quest object is suspended
See Also:
Quest.setSuspended(boolean)

setSuspended

public void setSuspended(boolean truefalse)
Description copied from interface: Quest
Sets whether this quest object is suspended. A suspended quest should always in a stopped state.

Specified by:
setSuspended in interface Quest
Parameters:
truefalse - true if this quest object is suspended
See Also:
Quest.suspended()

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

getDesignatedObject

public java.lang.Object getDesignatedObject(java.lang.String named)
Description copied from interface: Quest
From the given official quest variable name, it derives either an object or a vector of objects that reflect it.

Specified by:
getDesignatedObject in interface Quest
Parameters:
named - the code to return a string, object, or vector for
Returns:
a string, mob, item, room, vector, etc..
See Also:
Quest.QOBJS

internalQuestDelete

public void internalQuestDelete()
Description copied from interface: Quest
If any files are embedded and cached inside this quest script, this method will clear them from resources and memory.

Specified by:
internalQuestDelete in interface Quest

startDate

public java.lang.String startDate()
Description copied from interface: Quest
Returns the unique start date of the quest. The format is either MONTH-DAY for real life dates, or MUDDAY MONTH-DAY for mudday based dates.

Specified by:
startDate in interface Quest
Returns:
the unique formatted start date of the quest
See Also:
Quest.setStartDate(String), Quest.setStartMudDate(String)

setStartDate

public void setStartDate(java.lang.String newDate)
Description copied from interface: Quest
Sets the real-life start date of this quest. The format is MONTH-DAY.

Specified by:
setStartDate in interface Quest
Parameters:
newDate - the real-life start date of this quest
See Also:
Quest.startDate(), Quest.setStartMudDate(String)

setStartMudDate

public void setStartMudDate(java.lang.String newDate)
Description copied from interface: Quest
Sets the in-game mud start date of this quest. The format is MONTH-DAY.

Specified by:
setStartMudDate in interface Quest
Parameters:
newDate - the in-game mud start date of this quest
See Also:
Quest.startDate(), Quest.setStartDate(String)

duration

public int duration()
Description copied from interface: Quest
Returns the duration, in ticks of this quest. A value of 0 means the quest runs indefinitely.

Specified by:
duration in interface Quest
Returns:
the duration, in ticks, of this quest
See Also:
Quest.setDuration(int)

setDuration

public void setDuration(int newTicks)
Description copied from interface: Quest
Sets the duration, in ticks of this quest. A value of 0 means the quest runs indefinitely.

Specified by:
setDuration in interface Quest
Parameters:
newTicks - the duration, in ticks, of this quest
See Also:
Quest.duration()

setCopy

public void setCopy(boolean truefalse)
Description copied from interface: Quest
Sets whether this quest object is a spawned copy

Specified by:
setCopy in interface Quest
Parameters:
truefalse - true if this quest object is a spawned copy
See Also:
Quest.isCopy()

isCopy

public boolean isCopy()
Description copied from interface: Quest
Returns whether this quest object is a spawned copy

Specified by:
isCopy in interface Quest
Returns:
whether this quest object is a spawned copy
See Also:
Quest.setCopy(boolean)

setSpawn

public void setSpawn(int spawnFlag)
Description copied from interface: Quest
Sets the flag denoting whether this quest spawns new ones from its several steps and if so, by what method.

Specified by:
setSpawn in interface Quest
Parameters:
spawnFlag - the quest spawn flag info
See Also:
Quest.SPAWN_ANY, Quest.SPAWN_FIRST, Quest.SPAWN_NO, Quest.SPAWN_DESCS, Quest.getSpawn()

getSpawn

public int getSpawn()
Description copied from interface: Quest
Returns the flag denoting whether this quest spawns new ones from its several steps and if so, by what method.

Specified by:
getSpawn in interface Quest
Returns:
the quest spawn flag info
See Also:
Quest.SPAWN_ANY, Quest.SPAWN_FIRST, Quest.SPAWN_NO, Quest.SPAWN_DESCS, Quest.setSpawn(int)

minPlayers

public int minPlayers()
Description copied from interface: Quest
The minimum number of players matching player criteria required before this quest will start

Specified by:
minPlayers in interface Quest
Returns:
minimum number of players matching player criteria required
See Also:
Quest.setMinPlayers(int), Quest.playerMask(), Quest.setPlayerMask(String)

setMinPlayers

public void setMinPlayers(int players)
Description copied from interface: Quest
Sets minimum number of players matching player criteria required before this quest will start

Specified by:
setMinPlayers in interface Quest
Parameters:
players - minimum number of players matching player criteria required
See Also:
Quest.minPlayers(), Quest.playerMask(), Quest.setPlayerMask(String)

runLevel

public int runLevel()
Description copied from interface: Quest
Returns the run level. -1 means runs always, otherwise, this quest will always defer to running quests of equal or lower run level. Higher, therefore, is weaker.

Specified by:
runLevel in interface Quest
Returns:
the run level. -1 means runs always
See Also:
Quest.setRunLevel(int)

setRunLevel

public void setRunLevel(int level)
Description copied from interface: Quest
Sets the run level. -1 means runs always, otherwise, this quest will always defer to running quests of equal or lower run level. Higher, therefore, is weaker.

Specified by:
setRunLevel in interface Quest
Parameters:
level - the run level. -1 means runs always
See Also:
Quest.runLevel()

playerMask

public java.lang.String playerMask()
Description copied from interface: Quest
Returns the zappermask that determines who counts as an elligible player for the purposes of the minPlayer setting.

Specified by:
playerMask in interface Quest
Returns:
the zappermask that determines who counts as a player
See Also:
MaskingLibrary, Quest.setMinPlayers(int), Quest.minPlayers(), Quest.setPlayerMask(String)

setPlayerMask

public void setPlayerMask(java.lang.String mask)
Description copied from interface: Quest
Sets the zappermask that determines who counts as an elligible player for the purposes of the minPlayer setting.

Specified by:
setPlayerMask in interface Quest
Parameters:
mask - the zappermask that determines who counts as a player
See Also:
MaskingLibrary, Quest.setMinPlayers(int), Quest.minPlayers(), Quest.playerMask()

setScript

public void setScript(java.lang.String parm)
Description copied from interface: Quest
Sets the quest script. This may be semicolon-separated instructions, or a LOAD command followed by the quest script path.

Specified by:
setScript in interface Quest
Parameters:
parm - the actual quest script
See Also:
Quest.script()

script

public java.lang.String script()
Description copied from interface: Quest
Returns the unparsed quest script as a single happy string.

Specified by:
script in interface Quest
Returns:
the unparsed quest script as a single happy string.
See Also:
Quest.setScript(String)

autostartup

public void autostartup()
Description copied from interface: Quest
After a quest is added to the list of quests, this method is called to put the quest into its initial wait state, and get it thread time.

Specified by:
autostartup in interface Quest

setVars

public void setVars(java.util.Vector script,
                    int startAtLine)
Description copied from interface: Quest
Accepts a pre-parsed quest script and extracts certain non-iterative variables, such as the quest name and similar variables.

Specified by:
setVars in interface Quest
Parameters:
script - the parsed quest script
startAtLine - which line of the script to start at
See Also:
Quest

getResourceFileData

public java.lang.StringBuffer getResourceFileData(java.lang.String named)
Description copied from interface: Quest
Quest scripts can have files of various sorts embedded in them. This method will return the text of any such files of the given name, if they were embedded, or if not, it will attempt to open the file in the filesystem and return that one instead.

Specified by:
getResourceFileData in interface Quest
Parameters:
named - the name of the resource path file to return
Returns:
the text of the file, if found.
See Also:
Quest

parseQuestScriptWArgs

public void parseQuestScriptWArgs(java.util.Vector script,
                                  java.util.Vector args)

errorOccurred

protected void errorOccurred(DefaultQuest.QuestState q,
                             boolean quietFlag,
                             java.lang.String msg)

parseQuestScript

public void parseQuestScript(java.util.Vector script,
                             java.util.Vector args,
                             int startLine)

spawnQuest

public boolean spawnQuest(java.lang.String script,
                          java.util.Vector baseVars,
                          boolean reTime)

startQuest

public boolean startQuest()
Description copied from interface: Quest
This will execute the quest script. If the quest is running, it will call stopQuest first to shut it down. It will spawn its subquests and subsections if necessary.

Specified by:
startQuest in interface Quest
Returns:
whether the quest was successfully started
See Also:
Quest.startQuestOnTime(), Quest.resetQuest(int), Quest.stepQuest(), Quest.stopQuest()

enterRunningState

public void enterRunningState()

cleanQuestStep

public void cleanQuestStep()

stepQuest

public boolean stepQuest()
Description copied from interface: Quest
This method is called when a quest is done with a particular step in a multi-step quest. This method will clean up any objects from the current step or previous steps and attempt to start up the next step in the quest. If there are no more steps, or the quest is only 1 step, stopQuest() will be called.

Specified by:
stepQuest in interface Quest
Returns:
true if another step was started, false otherwise
See Also:
Quest.startQuest(), Quest.stopQuest(), Quest.startQuestOnTime()

resetQuest

public void resetQuest(int firstPauseTicks)
Description copied from interface: Quest
this will stop executing of the quest script. It will clean up any objects or mobs which may have been loaded, restoring map mobs to their previous state. It will then enter a stopped-paused state for the given ticks. Any start failures after that will cause the pause time to be doubled before the next try.

Specified by:
resetQuest in interface Quest
Parameters:
firstPauseTicks - ticks to remain in stopped state before restarting
See Also:
Quest.startQuest(), Quest.stepQuest(), Quest.stopQuest(), Quest.startQuestOnTime()

stopQuest

public void stopQuest()
Description copied from interface: Quest
this will stop executing of the quest script. It will clean up any objects or mobs which may have been loaded, restoring map mobs to their previous state. If the quest is autorandom, it will restart the waiting process

Specified by:
stopQuest in interface Quest
See Also:
Quest.startQuest(), Quest.stepQuest(), Quest.resetQuest(int), Quest.startQuestOnTime()

enterDormantState

public boolean enterDormantState()
Description copied from interface: Quest
A dormant state is the state where a quest is no longer running, but is not, or has not yet, been scheduled to wait for another run time. This may result in a quest being deleted if it was a spawned temporary quest.

Specified by:
enterDormantState in interface Quest
Returns:
true if it is in a dormant state, or false if quest was deleted

resetWaitRemaining

public boolean resetWaitRemaining(long ellapsedTime)
Description copied from interface: Quest
Sets the number of ticks before this quest will attempt to start. A number >=0 means the quest is currently in a stopped state.

Specified by:
resetWaitRemaining in interface Quest
Parameters:
ellapsedTime - the number of miliseconds already ellapsed before wait began
Returns:
true if the quest is successfully put into a non-running wait state
See Also:
Quest.waitRemaining()

minWait

public int minWait()
Description copied from interface: Quest
Returns the minimum number of ticks between attempts to run this quest.

Specified by:
minWait in interface Quest
Returns:
the minimum number of ticks between attempts to run this quest.
See Also:
Quest.setMinWait(int), Quest.waitInterval(), Quest.setWaitInterval(int)

setMinWait

public void setMinWait(int wait)
Description copied from interface: Quest
Sets the minimum number of ticks between attempts to run this quest.

Specified by:
setMinWait in interface Quest
Parameters:
wait - the minimum number of ticks between attempts to run this quest.
See Also:
Quest.minWait(), Quest.waitInterval(), Quest.setWaitInterval(int)

waitInterval

public int waitInterval()
Description copied from interface: Quest
Returns the maximum ticks, above the minimum wait, that must go by before an attempt to run a quest. This is therefore, the random part.

Specified by:
waitInterval in interface Quest
Returns:
the maximum ticks, above the minimum wait, that must go by
See Also:
Quest.setMinWait(int), Quest.minWait(), Quest.setWaitInterval(int)

setWaitInterval

public void setWaitInterval(int wait)
Description copied from interface: Quest
Sets the maximum ticks, above the minimum wait, that must go by before an attempt to run a quest. This is therefore, the random part.

Specified by:
setWaitInterval in interface Quest
Parameters:
wait - the maximum ticks, above the minimum wait, that must go by
See Also:
Quest.setMinWait(int), Quest.minWait(), Quest.waitInterval()

waitRemaining

public int waitRemaining()
Description copied from interface: Quest
Returns the number of ticks before this quest will attempt to start. A number >=0 means the quest is currently in a stopped state.

Specified by:
waitRemaining in interface Quest
Returns:
the number of ticks before this quest will attempt to start.
See Also:
Quest.resetWaitRemaining(long)

getMainQuestObject

public Quest getMainQuestObject()

declareWinner

public void declareWinner(java.lang.String name)
Description copied from interface: Quest
Registers the given player name as having won this quest.

Specified by:
declareWinner in interface Quest
Parameters:
name - the player name
See Also:
Quest.getWinners(), Quest.getWinnerStr(), Quest.wasWinner(String), Quest.setWinners(String)

getWinnerStr

public java.lang.String getWinnerStr()
Description copied from interface: Quest
Returns a semicolon delimited string of all the winners of this quest

Specified by:
getWinnerStr in interface Quest
Returns:
a semicolon delimited string of all the winners of this quest
See Also:
Quest.declareWinner(String), Quest.getWinners(), Quest.wasWinner(String), Quest.setWinners(String)

setWinners

public void setWinners(java.lang.String list)
Description copied from interface: Quest
Sets the list of player names that have won this quest

Specified by:
setWinners in interface Quest
Parameters:
list - a semicolon delimtied list of player names
See Also:
Quest.declareWinner(String), Quest.getWinners(), Quest.getWinnerStr(), Quest.wasWinner(String)

getWinners

public java.util.Vector getWinners()
Description copied from interface: Quest
Returns the names of all the winners of this quest

Specified by:
getWinners in interface Quest
Returns:
the names of all the winners of this quest
See Also:
Quest.declareWinner(String), Quest.getWinnerStr(), Quest.wasWinner(String), Quest.setWinners(String)

wasWinner

public boolean wasWinner(java.lang.String name)
Description copied from interface: Quest
Returns whether a player of the given name has won this quest

Specified by:
wasWinner in interface Quest
Parameters:
name - the player name
Returns:
true if a player of the given name has won this quest
See Also:
Quest.declar