YaQuestAPI
YaQuestAPI is a class for managing quests.Functions
YaQuestListener YaQuestAPI.StateListener(YaEntity entity)
DEPRECATED
Returnsthe listener
A listener to events about the quest for the specified entityentityThe entity that you want to listen to
YaCharacterQuest YaQuestAPI.CharacterQuest(YaEntity character)
DEPRECATED
Returnsthe API handle
An API handle for managing a character's questscharactercharacter entity
YaCharacterQuestByRequester YaQuestAPI.CharacterQuestByRequester(YaEntity character, YaEntity requester)
DEPRECATED
Returnsthe API handle
An API handle for managing a character's quests associated with the requester.characterThe character entityrequesterThe requester entity
YaQuestConfig YaQuestAPI.GetQuestConfig(number questID)
DEPRECATED
Returnsquest configuration
Gets quest configuration using quest IDquestIDThe unique identifier of the quest
void YaQuestAPI.AddQuestCompletedEvent(function callbackYaEntity, YaQuestData)
SERVER ONLY DEPRECATED
Fired when any quest is finished
callbackA callback with the character who takes the quest and quest informationcharacterEntityThe character entityquestDataIncludes information about quest
YaQuestConfig YaQuestAPI.GetQuestConfigByName(string name)
Returnsquest configuration
Gets the quest configuration by its namenameThe name of quest configuration
void YaQuestAPI.AddQuest(YaEntity characterEntity, YaQuestData questData)
SERVER ONLY
Adds a quest to the current character from the requester.
characterEntityThe entity of the player's characterquestDataThe quest data
Array<YaQuestData> YaQuestAPI.GetQuests(YaEntity characterEntity)
Returnsarray of quests
Gets quests on the charactercharacterEntityThe entity of the player's character
boolean YaQuestAPI.ContainsQuest(YaEntity characterEntity, YaQuestData questData)
Returnstrue if the queried quest exists, or false if not
Checks whether a character has active quests and with the option to limit the search to quests from a certain quest givercharacterEntityThe entity of the player's characterquestDataThe quest data, including the quest configuration to query for and the optional quest giver entity
boolean YaQuestAPI.RemoveQuest(YaEntity characterEntity, YaQuestData questData)
SERVER ONLY
Returnstrue if the Remove operation is completed, or false if not
Remove quest and its progress on the character and with the option to limit the Remove operation to quests from a specifc quest givercharacterEntityThe entity of the player's characterquestDataThe quest data, including the quests to query for and the optional quest giver entity
void YaQuestAPI.ClearQuests(YaEntity characterEntity)
SERVER ONLY
Clears quests on the character
characterEntityThe entity of the player's character
YaQuestProgress YaQuestAPI.UpdateQuestProgress(YaEntity characterEntity, YaQuestData questData, string targetInfo, [number count])
SERVER ONLY
Returnsquest progress of the current quest item (invalid if the update fails)
Updates the progress of the quest on the current charactercharacterEntityThe entity of the player's characterquestDataThe quest datatargetInfoThe info of the target to updatecountThe progress to update, default 1
Array<YaQuestProgress> YaQuestAPI.GetQuestProgresses(YaEntity characterEntity, YaQuestData questData)
Returnsarray of quest progress
Gets the progresses of a quest for the charactercharacterEntitythe entity of the player's characterquestDatathe quest data
boolean YaQuestAPI.IsQuestProgressesAccomplished(YaEntity characterEntity, YaQuestData questData)
Returnstrue if the quest progresses are completed, false if not
Checks if the all progresses of the quest are accomplishedcharacterEntityThe entity of the player's characterquestDataThe quest data
void YaQuestAPI.CompleteQuest(YaEntity characterEntity, YaQuestData questData)
Returnsthe completed quest
Completes a quest.
Will fire "OnCompleteQuest" if all the progresses are accomplished.characterEntityThe entity of the player's characterquestDataThe quest data
CancelToken YaQuestAPI.OnAddQuest(YaEntity characterEntity, function callbackYaQuestData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a new quest added to the charactercharacterEntityThe player character entity to listen tocallbackA callback with quest informationquestDataData of the quest
CancelToken YaQuestAPI.OnRemoveQuest(YaEntity characterEntity, function callbackYaQuestData)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a new quest removed from the charactercharacterEntityThe player character entity to listen tocallbackA callback with quest informationquestDataYaQuestData of the quest
CancelToken YaQuestAPI.OnUpdateQuestProgress(YaEntity characterEntity, function callbackYaQuestProgress)
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when update the progress of the questcharacterEntityThe player character entity or NPC requester to listen tocallbackA callback with quest informationquestDataData of the quest
CancelToken YaQuestAPI.OnCompleteQuest(YaEntity entity, function callbackYaEntity, YaQuestData)
SERVER ONLY
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a character claims to complete the quest. The progresses of the quest are already checked by API.
The quest giver should ensure this event is handled only once, e.g. by deleting the quest immediately.entityThe player character entity or NPC requester to listen tocallbackA callback with quest informationcharacterEntityThe character entityquestDataData of the quest
CancelToken YaQuestAPI.OnCompleteAnyQuest(function callbackYaEntity, YaQuestData)
SERVER ONLY
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a character claims to complete the quest. The progresses of the quest are already checked by API
The requester should ensure this event is handled only once, e.g. by deleting the quest immediately.callbackA callback with quest informationcharacterEntityThe character entityquestDataData of the quest