Skip to content
Snippets Groups Projects
Commit daed93e6 authored by DarkGod's avatar DarkGod
Browse files

Added two new hooks "Quest:init" and "Quest:setStatus"

parent 93b597c8
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -42,6 +42,7 @@ function _M:init(q, who)
self.status = PENDING
self.objectives = {}
if self:check("on_grant", who) then self.do_not_gain = true end
self:triggerHook{"Quest:init"}
end
--- Checks if the quest (or sub-objective) is complete
......@@ -88,6 +89,10 @@ end
-- @param[opt] sub sub-objective
-- @param who who did this??
function _M:setStatus(status, sub, who)
local hk = {"Quest:setStatus", status=status, sub=sub, who=who, ret=false}
if self:triggerHook(hk) then
return hk.ret
end
if sub then
if self.objectives[sub] and self.objectives[sub] == status then return false end
self.objectives[sub] = status
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment