landsandboat/scripts/items/return_ring.lua

29 lines
772 B
Lua
Raw Permalink Normal View History

2021-01-18 12:51:02 -05:00
-----------------------------------
-- ID: 15542
-- Teleport Return Ring
-- Enchantment: "Outpost Warp"
2021-01-18 12:51:02 -05:00
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, item, caster)
local result = 0
local region = target:getCurrentRegion()
if
2025-01-21 17:29:55 +01:00
not xi.conquest.canTeleportToOutpost(target, region) or
GetRegionOwner(region) ~= target:getNation()
then
2021-04-01 15:10:15 -04:00
result = xi.msg.basic.CANT_BE_USED_IN_AREA
end
return result
end
2026-02-19 22:48:02 -07:00
itemObject.onItemUse = function(target, user)
local region = target:getCurrentRegion()
2026-02-19 22:48:02 -07:00
target:addStatusEffect(xi.effect.TELEPORT, { power = xi.teleport.id.OUTPOST, duration = 4, origin = user, icon = 0, subPower = region })
end
2021-01-17 11:55:03 -05:00
return itemObject