* Separated Cruor Prospector tables with different data structures * Remove unnecessary bit.bor call with missing parameter * Nil check manaclipper nextEvent variable * Nil check Lower Jeuno Treasure Coffer 'prize' variable * Add LLS exception for __eq and new for missions and hidden quests * Nil check dynamis 'te' variable * Change default table data type for caskets timeTable * Nil check logInfo in setMissionStatus GM Command * Define variables on need, remove debug print in avatar code * Add TODOs and exceptions for remaining LLS errors and warnings
37 lines
928 B
Lua
37 lines
928 B
Lua
-----------------------------------
|
|
-- HiddenQuest class
|
|
-----------------------------------
|
|
require('scripts/globals/interaction/container')
|
|
-----------------------------------
|
|
|
|
HiddenQuest = setmetatable({ area = {} }, { __index = Container })
|
|
HiddenQuest.__index = HiddenQuest
|
|
|
|
---@diagnostic disable-next-line: duplicate-set-field
|
|
HiddenQuest.__eq = function(q1, q2)
|
|
return q1.name == q2.name
|
|
end
|
|
|
|
HiddenQuest.reward = {}
|
|
|
|
---@diagnostic disable-next-line: duplicate-set-field
|
|
function HiddenQuest:new(name)
|
|
local obj = Container:new('HQuest[' .. name .. ']')
|
|
setmetatable(obj, self)
|
|
|
|
obj.name = name
|
|
return obj
|
|
end
|
|
|
|
-----------------------------------
|
|
-- HiddenQuest operations
|
|
-----------------------------------
|
|
|
|
function HiddenQuest:complete(player)
|
|
local gaveReward = npcUtil.giveReward(player, self.reward)
|
|
if gaveReward then
|
|
self:cleanup(player)
|
|
end
|
|
|
|
return gaveReward
|
|
end
|