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 entity
entity
The entity that you want to listen to
YaCharacterQuest YaQuestAPI.CharacterQuest(YaEntity character)¶
DEPRECATED
Returnsthe API handle
An API handle for managing a character's quests
character
character 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.
character
The character entityrequester
The requester entity
YaQuestConfig YaQuestAPI.GetQuestConfig(number questID)¶
DEPRECATED
Returnsquest configuration
Gets quest configuration using quest ID
questID
The unique identifier of the quest
void YaQuestAPI.AddQuestCompletedEvent(function callback<YaEntity, YaQuestData>)¶
SERVER ONLY DEPRECATED
Fired when any quest is finished
callback
A callback with the character who takes the quest and quest informationcharacterEntity
The character entityquestData
Includes information about quest
YaQuestConfig YaQuestAPI.GetQuestConfigByName(string name)¶
Returnsquest configuration
Gets the quest configuration by its name
name
The name of quest configuration
void YaQuestAPI.AddQuest(YaEntity characterEntity, YaQuestData questData)¶
SERVER ONLY
Adds a quest to the current character from the requester.
characterEntity
The entity of the player's characterquestData
The quest data
Array<YaQuestData> YaQuestAPI.GetQuests(YaEntity characterEntity)¶
Returnsarray of quests
Gets quests on the character
characterEntity
The 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 giver
characterEntity
The entity of the player's characterquestData
The 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 giver
characterEntity
The entity of the player's characterquestData
The 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
characterEntity
The 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 character
characterEntity
The entity of the player's characterquestData
The quest datatargetInfo
The info of the target to updatecount
The 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 character
characterEntity
the entity of the player's characterquestData
the 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 accomplished
characterEntity
The entity of the player's characterquestData
The quest data
void YaQuestAPI.CompleteQuest(YaEntity characterEntity, YaQuestData questData)¶
Returnsthe completed quest
Completes a quest.
Will fire "OnCompleteQuest" if all the progresses are accomplished.
characterEntity
The entity of the player's characterquestData
The quest data
CancelToken YaQuestAPI.OnAddQuest(YaEntity characterEntity, function callback<YaQuestData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a new quest added to the character
characterEntity
The player character entity to listen tocallback
A callback with quest informationquestData
Data of the quest
CancelToken YaQuestAPI.OnRemoveQuest(YaEntity characterEntity, function callback<YaQuestData>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when a new quest removed from the character
characterEntity
The player character entity to listen tocallback
A callback with quest informationquestData
YaQuestData of the quest
CancelToken YaQuestAPI.OnUpdateQuestProgress(YaEntity characterEntity, function callback<YaQuestProgress>)¶
Returnsa CancelToken object that can be used to cancel the process associated with the dialogue
Fired when update the progress of the quest
characterEntity
The player character entity or NPC requester to listen tocallback
A callback with quest informationquestData
Data of the quest
CancelToken YaQuestAPI.OnCompleteQuest(YaEntity entity, function callback<YaEntity, 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.
entity
The player character entity or NPC requester to listen tocallback
A callback with quest informationcharacterEntity
The character entityquestData
Data of the quest
CancelToken YaQuestAPI.OnCompleteAnyQuest(function callback<YaEntity, 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.
callback
A callback with quest informationcharacterEntity
The character entityquestData
Data of the quest