canary/data/scripts/actions/items/vessels.lua
Marco f34cb83845
enhance and refactor: multiple scripts for better functionality (#3007)
1. Fixes a minor issue where, when emptying the balloons, they were
transformed into 255 instead of being reset to 1.
2. Adjusts the usage of the "bathtub" in datapacks, in addition to the
RLMap, ensuring better compatibility.
3. Makes minor aesthetic changes to enhance the code's readability.

Resolves #2923
2024-11-13 00:38:54 -03:00

26 lines
528 B
Lua

local config = {
[37572] = CONST_ME_GAZHARAGOTH,
[37573] = CONST_ME_FERUMBRAS_1,
[37574] = CONST_ME_MAD_MAGE,
[37575] = CONST_ME_HORESTIS,
[37576] = CONST_ME_DEVOVORGA,
}
local vessels = Action()
function vessels.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local vessel = config[item.itemid]
if not vessel or not target:isPlayer() then
return true
end
toPosition:sendMagicEffect(vessel)
item:remove(1)
return true
end
for index in pairs(config) do
vessels:id(index)
end
vessels:register()