2021-10-18 14:50:04 -05:00
|
|
|
-----------------------------------
|
|
|
|
|
-- func: checkinstance
|
|
|
|
|
-- desc: Displays Progress and Stage inside instance
|
|
|
|
|
-----------------------------------
|
2024-08-25 10:54:45 -04:00
|
|
|
---@type TCommand
|
2023-09-02 07:01:35 -04:00
|
|
|
local commandObj = {}
|
2021-10-18 14:50:04 -05:00
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.cmdprops =
|
2021-10-18 14:50:04 -05:00
|
|
|
{
|
|
|
|
|
permission = 1,
|
2023-08-28 21:02:28 -04:00
|
|
|
parameters = ''
|
2021-10-18 14:50:04 -05:00
|
|
|
}
|
|
|
|
|
|
2023-09-02 07:01:35 -04:00
|
|
|
commandObj.onTrigger = function(player)
|
2021-10-18 14:50:04 -05:00
|
|
|
local zone = player:getZone()
|
2024-08-25 12:01:53 -04:00
|
|
|
if not zone then
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-10-18 14:50:04 -05:00
|
|
|
|
2023-08-15 12:40:21 -04:00
|
|
|
if zone:getTypeMask() == xi.zoneType.INSTANCED then
|
2021-10-18 14:50:04 -05:00
|
|
|
local instance = player:getInstance()
|
2024-08-25 12:01:53 -04:00
|
|
|
|
|
|
|
|
if not instance then
|
|
|
|
|
player:printToPlayer('Must be in an Instanced zone')
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
2021-10-18 14:50:04 -05:00
|
|
|
local progress = instance:getProgress()
|
|
|
|
|
local stage = instance:getStage()
|
|
|
|
|
|
2023-12-09 23:54:00 +00:00
|
|
|
player:printToPlayer(string.format('Progress: %i Stage: %i', progress, stage))
|
2021-10-18 14:50:04 -05:00
|
|
|
else
|
2023-12-09 23:54:00 +00:00
|
|
|
player:printToPlayer('Must be in an Instanced zone')
|
2021-10-18 14:50:04 -05:00
|
|
|
end
|
|
|
|
|
end
|
2023-09-02 07:01:35 -04:00
|
|
|
|
|
|
|
|
return commandObj
|