landsandboat/scripts/items/flask_of_silencing_potion.lua

21 lines
569 B
Lua

-----------------------------------
-- ID: 4162
-- Item: Silencing Potion
-- Item Effect: This potion induces silence.
-----------------------------------
---@type TItem
local itemObject = {}
itemObject.onItemCheck = function(target, item, caster)
return 0
end
itemObject.onItemUse = function(target, user)
if not target:hasStatusEffect(xi.effect.SILENCE) then
target:addStatusEffect(xi.effect.SILENCE, { power = 1, duration = 180, origin = user, tick = 3 })
else
target:messageBasic(xi.msg.basic.NO_EFFECT)
end
end
return itemObject