Difference between revisions of "LUA:Quests"
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | {{PageHeaderChild|LUA|Quest Scripts}} | ||
| + | |||
Quest scripts are what makes quests work, there are only 4 core functions however custom functions are needed for a quest to work properly. These custom functions can be declared with [[LUA:AddQuestStepCompleteAction|AddQuestStepCompleteAction()]] and [[LUA:SetQuestCompleteAction|SetQuestCompleteAction()]], in both cases the first parameter is the quest the second is the player. | Quest scripts are what makes quests work, there are only 4 core functions however custom functions are needed for a quest to work properly. These custom functions can be declared with [[LUA:AddQuestStepCompleteAction|AddQuestStepCompleteAction()]] and [[LUA:SetQuestCompleteAction|SetQuestCompleteAction()]], in both cases the first parameter is the quest the second is the player. | ||
| − | + | {{Header|Accepted|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Accepted is called when the player accepts the quest | Accepted is called when the player accepts the quest | ||
| Line 8: | Line 10: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Declined|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Declined is called when the player declines the quest | Declined is called when the player declines the quest | ||
| Line 15: | Line 17: | ||
end | end | ||
</pre> | </pre> | ||
| − | + | {{Header|Deleted|BackgroundColor=3d78b4|FontColor=ffffff}} | |
Deleted is called when a player deletes a quest | Deleted is called when a player deletes a quest | ||
| Line 22: | Line 24: | ||
end | end | ||
</pre> | </pre> | ||
| − | == Reload == | + | {{Header|Init|BackgroundColor=3d78b4|FontColor=ffffff}} |
| + | Init sets up the quest, this must be included in all quest scripts | ||
| + | |||
| + | <pre> | ||
| + | function Init(Quest) | ||
| + | end | ||
| + | </pre> | ||
| + | {{Header|Reload|BackgroundColor=3d78b4|FontColor=ffffff}} | ||
Reload is called when a player logs in with an incomplete quest, the third parameter is the step id the player is on | Reload is called when a player logs in with an incomplete quest, the third parameter is the step id the player is on | ||
Latest revision as of 16:30, 14 June 2016
LUA - Quest Scripts
Return to: LUA | Tutorials | Portal | Forum | Project Manager | Bug Tracker
Quest scripts are what makes quests work, there are only 4 core functions however custom functions are needed for a quest to work properly. These custom functions can be declared with AddQuestStepCompleteAction() and SetQuestCompleteAction(), in both cases the first parameter is the quest the second is the player.
Accepted is called when the player accepts the quest
function Accepted(Quest, Spawn) end
Declined is called when the player declines the quest
function Declined(Quest, Spawn) end
Deleted is called when a player deletes a quest
function Deleted(Quest, Spawn) end
Init sets up the quest, this must be included in all quest scripts
function Init(Quest) end
Reload is called when a player logs in with an incomplete quest, the third parameter is the step id the player is on
function Reload(Quest, Spawn, int32) end