Class QuestState?
Class Quest (net.sf.l2j.gameserver.model.quest.QuestState) may be imported in quest scripts as
from net.sf.l2j.gameserver.model.quest import QuestState
And has following members to be used from Jython quest scripts:
Quest getQuest() - returns the quest instance of this QuestState, call it as QuestState.getQuest(self) or self.getQuest(), where self is an instance of jython QuestState.
L2PcInstance getPlayer() - returns the player instance of this QuestState, call it as QuestState.getPlayer(self) or self.getPlayer(), where self is an instance of QuestState.
State getState() - returns the current state of this QuestState, call it as QuestState.getState(self) or self.getState(), where self is an instance of QuestState.
State setState(State state) - transact to next state, call it as QuestState.setState(self, STATE) or self.setState(STATE), where self is an instance of QuestState. It returns the newly setted state.
String getStateId() - get string ID of current state, same as self.getState().getName().
String set(String var, String val) - set value val to variable with name var. The variables of quest are persistant, i.e. are stored in the DB until they are unset, or the quest is completed. This method returns the value being set. Call it as QuestState.set(self, "var","value") or self.set("var","value").
String get(String var) - get the of variable with name var. If the variable was not setted yet, the returned value is None. Call it as QuestState.get(self, "var") or self.get("var").
String unSet(String var) - unset (forget) the of variable with name var. The variable will be removed from DB. Returns the value of removed variable. If the variable was not setted, the returned value is None. Call it as QuestState.unset(self, "var") or self.unset("var").
int getQuestItemsCount(int itemId) - returns count of items with ID itemId of current player. Call it as QuestState.getQuestItemsCount(self,N) or as self.getQuestItemsCount(N), where self is an instance of jython QuestState.
void giveItems(int itemId, int count) - create and give items to player. Call it as QuestState.giveItems(self,ID,N) or as self.giveItems(ID,N), where self is an instance of QuestState.
void takeItems(int itemId, int count) - take and delete item from player. Call it as QuestState.takeItems(self,ID,N) or as self.takeItems(ID,N), where self is an instance of QuestState. Note: if count is negative - all items wih this ID will be taken.
QuestState exitQuest(boolean repeatable) - exit the quest, cleanup it in DB. If repeatable is True the quest will be completly removed from DB (and may be repeated). If repeatable is False - the quest's final state will be preserved in DB (but all variables will be cleaned), to let l2j server know, that the quest cannot be repeated.
boolean getBusy() - returns true/false if npc is busy. Call it as QuestState.getBusy() or as self.getBusy(), where self is an instance of jython QuestState.
void setBusy(boolean isBusy) - set the busy status of npc. Call it as QuestState.setBusy(boolean) or as self.setBusy(boolean), where self is an instance of jython QuestState.
String getBusyMessage() - returns the additional message npc will display in the busy html. Call it as QuestState.getBusy() or as self.getBusy(), where self is an instance of jython QuestState.
void setBusyMessage(String message) - set the additional message npc will display in the busy html. Call it as QuestState.setBusyMessage(String) or as self.setBusyMessage(String), where self is an instance of jython QuestState.
void startQuestTimer(String name, long time) - start a timer for the quest. Call it as QuestState.startQuestTimer(String, long) or as self.startQuestTimer(String, long), where self is an instance of jython QuestState. Cannot starting a timer with a name of a timer that already exist unless it has completed its task or was canceled (QuestState.getQuestTimer(String).cancel()).
QuestTimer getQuestTimer(String name) - returns the QuestTimer with the given name. Call it as QuestState.getQuestTimer(String) or as self.getQuestTimer(String), where self is an instance of jython QuestState.
ArrayList?<QuestTimer?> getQuestTimers() - returns an arraylist of QuestTimer. Call it as QuestState.getQuestTimers() or as self.getQuestTimers(), where self is an instance of jython QuestState.
