CMObject, Tickable, CMLibrary, QuestManager, java.lang.Cloneable, java.lang.Comparable<CMObject>public class Quests extends StdLibrary implements QuestManager
QuestManager.HolidayData, QuestManager.QMCommand| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.String |
holidayDefinition |
|
protected java.lang.String |
holidayFilename |
|
protected SVector<Quest> |
quests |
idConverterQM_COMMAND_MASK, QM_COMMAND_OPTIONALisDebugging, name, serviceClient, tickStatusSTATUS_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_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET| Constructor | Description |
|---|---|
Quests() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addQuest(Quest Q) |
Given a Quest object, this will add the
object to the cache, auto-starting it
if necessary.
|
protected java.lang.String |
addXMLQuestItem(MOB mob,
int showFlag,
DVector pageDV,
java.lang.String showValue,
java.lang.String parm1Fixed,
java.lang.String lastLabel,
boolean optionalEntry,
int step,
int showNumber) |
|
protected java.lang.String |
addXMLQuestMob(MOB mob,
int showFlag,
DVector pageDV,
java.lang.String showValue,
java.lang.String parm1Fixed,
java.lang.String lastLabel,
boolean optionalEntry,
int step,
int showNumber) |
|
java.lang.String |
alterHoliday(java.lang.String oldName,
QuestManager.HolidayData newData) |
Given the official name of an existing holiday, and a
HolidayData data structure that was possibly altered,
this will modify the existing holiday to reflect the
new data.
|
java.util.List<java.util.List<java.lang.String>> |
breakOutMudChatVs(java.lang.String MUDCHAT,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> behaviors) |
Given a list of variables and their values, and the name of a variable,
this will find the variable value that matches the variable name,
and then return the list of definitions.
|
java.lang.String |
createHoliday(java.lang.String named,
java.lang.String areaName,
boolean save) |
Attempts to create and possibly save a holiday quest script
where the holiday has the given name, and applies to the given
area (or ANY).
|
java.lang.String |
deleteHoliday(int holidayNumber) |
Given an index, this deletes the associated holiday
from the official holiday file completely.
|
void |
delQuest(Quest Q) |
Given an existing Quest in the cache, this
will stop it if necesssary, and remove it.
|
java.util.Enumeration<Quest> |
enumQuests() |
Returns an enumeration of all cached
Quest objects.
|
Quest |
fetchQuest(int i) |
Given a 0-based index into the Quest
object cache, this will return the
corresponding Quest.
|
Quest |
fetchQuest(java.lang.String qname) |
Returns the cached Quest with the given
unique name.
|
Quest |
findQuest(java.lang.String qname) |
Given a unique quest name, or partial name,
this will return the closest matching Quest
from the internal cache.
|
protected int |
genBehaviors(MOB mob,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> behaviors,
int showNumber,
int showFlag) |
|
protected int |
genMudChat(MOB mob,
java.lang.String var,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> behaviors,
int showNumber,
int showFlag) |
|
protected int |
genPricing(MOB mob,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> stats,
int showNumber,
int showFlag) |
|
protected int |
genProperties(MOB mob,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> properties,
int showNumber,
int showFlag) |
|
java.lang.StringBuffer |
getDefaultHoliData(java.lang.String named,
java.lang.String area) |
Generates a default Holiday quest script.
|
QuestManager.HolidayData |
getEncodedHolidayData(java.lang.String dataFromStepsFile) |
Given a quest script representing a Holiday, this will parse the script
and generate a HolidayData object, usually for editing.
|
java.util.List<JournalEntry> |
getHolidayEntries(boolean datedOnly) |
Returns the various holidays as journal entries, where
update is the start time, expiration is the end time,
from is the creator (usually Holidays), to is the
area list (unparsed) or ALL or "".
|
java.util.List<java.lang.String> |
getHolidayFile() |
Loads the official Holiday Quest Script, and parses it into
its constituent steps, returning the list of sub-scripts.
|
int |
getHolidayIndex(java.lang.String named) |
Given a unique holiday name, this will return
its index.
|
java.lang.String |
getHolidayName(int index) |
Given an index, this returns the unique name of the
holiday at that index.
|
java.util.List<java.util.List<java.lang.String>> |
getNextQuestScriptCommands(java.util.List<?> script,
java.lang.String cmdOnly,
int startLine) |
Given a semi-parsed quest script and a starting line, this will return all lines, minus any
JavaScript, between the startLine and the next STEP command, parsed into bits.
|
java.util.List<Quest> |
getPlayerPersistentQuests(MOB player) |
Given a player mob, this will return the list of quests
that the player has accepted and not yet completed.
|
GenericEditor.CMEval |
getQuestCommandEval(QuestManager.QMCommand command) |
This is part of the QuestMaker.
|
DVector |
getQuestTemplate(MOB mob,
java.lang.String fileToGet) |
Parses a Quest Template file into a data structure which no
human, not even me, will ever fully unravel again.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
java.lang.String |
listHolidays(java.lang.String areaName) |
Returns a nice displayable formatted list of
all holidays and their associated areas.
|
void |
modifyHoliday(MOB mob,
int holidayNumber) |
Given a player mob and a holiday number, this allows
the given user to modify the holiday using the standard
menu system.
|
int |
numQuests() |
Returns the number of Quest objects in the
cache.
|
Quest |
objectInUse(Environmental E) |
Scans every Quest and returns the first one that is using
the given MOB, Item, Area, Room, whatever.
|
protected long |
parseMudDay(java.lang.String str) |
|
java.util.List<java.lang.String> |
parseQuestSteps(java.util.List<java.lang.String> script,
int startLine,
boolean rawLineInput) |
Given a final quest script parsed into lines, and a starting line, this will return
a list of mini-scripts broken by STEPs.
|
protected long |
parseRLDate(java.lang.String str) |
|
protected int |
promptDuration(MOB mob,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> settings,
int showNumber,
int showFlag) |
|
protected void |
promptText(MOB mob,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> sets,
java.lang.String var,
int showNumber,
int showFlag,
java.lang.String prompt,
java.lang.String help,
boolean emptyOK) |
|
Quest |
questMakerCommandLine(MOB mob) |
Runs the Quest Maker Wizard process command line
version for the given mob, returning the resulting
Quest.
|
void |
save() |
Re-saves every quest in this manager to the database
|
boolean |
shutdown() |
Shuts down the library.
|
int |
startLineIndex(java.util.List<java.lang.String> V,
java.lang.String start) |
|
static java.lang.String |
toStringList(java.util.Enumeration<?> e) |
activate, getServiceClient, L, propertiesLoadedcopyOf, initializeClass, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitactivate, checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus, tickprotected java.lang.String holidayFilename
protected java.lang.String holidayDefinition
public java.lang.String ID()
CMObjectID in interface CMObjectID in class StdLibrarypublic Quest objectInUse(Environmental E)
QuestManagerobjectInUse in interface QuestManagerE - the object to find the Quest user ofpublic int numQuests()
QuestManagernumQuests in interface QuestManagerQuestManager.fetchQuest(int)public Quest fetchQuest(int i)
QuestManagerfetchQuest in interface QuestManageri - the indexQuestManager.numQuests()public Quest fetchQuest(java.lang.String qname)
QuestManagerfetchQuest in interface QuestManagerqname - the quest nameQuestManager.findQuest(String),
QuestManager.fetchQuest(int),
QuestManager.enumQuests()public Quest findQuest(java.lang.String qname)
QuestManagerfindQuest in interface QuestManagerqname - the name of a questQuestManager.fetchQuest(String),
QuestManager.fetchQuest(int),
QuestManager.enumQuests()public void addQuest(Quest Q)
QuestManageraddQuest in interface QuestManagerQ - the Quest to deleteQuestManager.delQuest(Quest),
QuestManager.enumQuests(),
QuestManager.fetchQuest(String)public boolean shutdown()
CMLibraryshutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.activate()public void delQuest(Quest Q)
QuestManagerdelQuest in interface QuestManagerQ - the Quest to deleteQuestManager.addQuest(Quest),
QuestManager.enumQuests(),
QuestManager.fetchQuest(String)public void save()
QuestManagersave in interface QuestManagerpublic java.util.Enumeration<Quest> enumQuests()
QuestManagerenumQuests in interface QuestManagerQuestManager.delQuest(Quest),
QuestManager.addQuest(Quest),
QuestManager.fetchQuest(String)public java.util.List<java.lang.String> getHolidayFile()
throws CMException
QuestManagergetHolidayFile in interface QuestManagerCMException - a parsing error occurredQuestManager.getEncodedHolidayData(String),
QuestManager.getHolidayEntries(boolean)public java.util.List<JournalEntry> getHolidayEntries(boolean datedOnly)
QuestManagergetHolidayEntries in interface QuestManagerdatedOnly - true to only return dated/muddate entriesQuestManager.getEncodedHolidayData(String),
QuestManager.getHolidayFile()protected long parseRLDate(java.lang.String str)
protected long parseMudDay(java.lang.String str)
public java.lang.String listHolidays(java.lang.String areaName)
QuestManagerlistHolidays in interface QuestManagerareaName - null or all, or area nameprotected void promptText(MOB mob, TriadList<java.lang.String,java.lang.String,java.lang.Integer> sets, java.lang.String var, int showNumber, int showFlag, java.lang.String prompt, java.lang.String help, boolean emptyOK) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String createHoliday(java.lang.String named,
java.lang.String areaName,
boolean save)
QuestManagercreateHoliday in interface QuestManagernamed - the name of the holiday, unique plzareaName - the name of the area (or ANY) the holiday occurs insave - true to append to the official holiday fileQuestManager.getDefaultHoliData(String, String)public java.lang.StringBuffer getDefaultHoliData(java.lang.String named,
java.lang.String area)
QuestManagergetDefaultHoliData in interface QuestManagernamed - the name of the holiday, unique plzarea - the name of the area (or ANY) the holiday occurs inQuestManager.createHoliday(String, String, boolean)public java.lang.String deleteHoliday(int holidayNumber)
QuestManagerdeleteHoliday in interface QuestManagerholidayNumber - the 0-based indexQuestManager.getHolidayIndex(String)public java.lang.String getHolidayName(int index)
QuestManagergetHolidayName in interface QuestManagerindex - the 0-based indexQuestManager.getHolidayIndex(String),
QuestManager.listHolidays(String)public int getHolidayIndex(java.lang.String named)
QuestManagergetHolidayIndex in interface QuestManagernamed - the unique name of the holidayQuestManager.modifyHoliday(MOB, int),
QuestManager.getHolidayName(int),
QuestManager.deleteHoliday(int),
QuestManager.listHolidays(String)public int startLineIndex(java.util.List<java.lang.String> V,
java.lang.String start)
public QuestManager.HolidayData getEncodedHolidayData(java.lang.String dataFromStepsFile)
QuestManagergetEncodedHolidayData in interface QuestManagerdataFromStepsFile - the holiday quest scriptQuestManager.HolidayData,
QuestManager.getHolidayFile(),
QuestManager.alterHoliday(String, HolidayData),
QuestManager.getHolidayEntries(boolean)public void modifyHoliday(MOB mob, int holidayNumber)
QuestManagermodifyHoliday in interface QuestManagermob - the player mob to do the editingholidayNumber - the holiday number (0 based)QuestManager.getHolidayIndex(String),
QuestManager.alterHoliday(String, HolidayData),
QuestManager.deleteHoliday(int)public java.lang.String alterHoliday(java.lang.String oldName,
QuestManager.HolidayData newData)
QuestManageralterHoliday in interface QuestManageroldName - the name of the existing holiday to modifynewData - the modified holiday dataQuestManager.HolidayData,
QuestManager.getHolidayFile(),
QuestManager.modifyHoliday(MOB, int)protected int promptDuration(MOB mob, TriadList<java.lang.String,java.lang.String,java.lang.Integer> settings, int showNumber, int showFlag) throws java.io.IOException
java.io.IOExceptionprotected int genBehaviors(MOB mob, TriadList<java.lang.String,java.lang.String,java.lang.Integer> behaviors, int showNumber, int showFlag) throws java.io.IOException
java.io.IOExceptionprotected int genProperties(MOB mob, TriadList<java.lang.String,java.lang.String,java.lang.Integer> properties, int showNumber, int showFlag) throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String toStringList(java.util.Enumeration<?> e)
protected int genPricing(MOB mob, TriadList<java.lang.String,java.lang.String,java.lang.Integer> stats, int showNumber, int showFlag) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.util.List<java.lang.String>> breakOutMudChatVs(java.lang.String MUDCHAT,
TriadList<java.lang.String,java.lang.String,java.lang.Integer> behaviors)
QuestManagerbreakOutMudChatVs in interface QuestManagerMUDCHAT - the mudchat variable name, usually "MUDCHAT"behaviors - list of behavior variables, name, value, an integerprotected int genMudChat(MOB mob, java.lang.String var, TriadList<java.lang.String,java.lang.String,java.lang.Integer> behaviors, int showNumber, int showFlag) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.util.List<java.lang.String>> getNextQuestScriptCommands(java.util.List<?> script,
java.lang.String cmdOnly,
int startLine)
QuestManagergetNextQuestScriptCommands in interface QuestManagerscript - the complete quest script parsedcmdOnly - null, or a command to filter the script bystartLine - 0 - the line in the given script to start withpublic java.util.List<java.lang.String> parseQuestSteps(java.util.List<java.lang.String> script,
int startLine,
boolean rawLineInput)
QuestManagerparseQuestSteps in interface QuestManagerscript - the final lines of the entire quest scriptstartLine - the line to start breaking atrawLineInput - false to manage ; line endings, true to leave rawpublic DVector getQuestTemplate(MOB mob, java.lang.String fileToGet)
QuestManagergetQuestTemplate in interface QuestManagermob - player mob, for file permission reasonsfileToGet - the template filename to loadQuestManager.getQuestTemplate(MOB, String),
QuestManager.questMakerCommandLine(MOB),
QuestManager.getQuestCommandEval(QMCommand)protected java.lang.String addXMLQuestMob(MOB mob, int showFlag, DVector pageDV, java.lang.String showValue, java.lang.String parm1Fixed, java.lang.String lastLabel, boolean optionalEntry, int step, int showNumber) throws java.io.IOException
java.io.IOExceptionprotected java.lang.String addXMLQuestItem(MOB mob, int showFlag, DVector pageDV, java.lang.String showValue, java.lang.String parm1Fixed, java.lang.String lastLabel, boolean optionalEntry, int step, int showNumber) throws java.io.IOException
java.io.IOExceptionpublic java.util.List<Quest> getPlayerPersistentQuests(MOB player)
QuestManagergetPlayerPersistentQuests in interface QuestManagerplayer - the player mobpublic Quest questMakerCommandLine(MOB mob)
QuestManagerquestMakerCommandLine in interface QuestManagermob - the player who wants to create a QuestQuestManager.getQuestTemplate(MOB, String),
QuestManager.questMakerCommandLine(MOB),
QuestManager.getQuestCommandEval(QMCommand)public GenericEditor.CMEval getQuestCommandEval(QuestManager.QMCommand command)
QuestManagergetQuestCommandEval in interface QuestManagercommand - the quest maker variable typeQuestManager.getQuestTemplate(MOB, String),
QuestManager.questMakerCommandLine(MOB),
QuestManager.getQuestCommandEval(QMCommand),
QuestManager.QMCommand,
GenericEditor.CMEval