landsandboat/scripts/globals/interaction/hidden_quest.lua
claywar d066a186a3
Fix or Ignore remaining Lua Language Server warnings and errors
* 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
2024-08-20 14:11:00 -04:00

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