tinha erros no script sim... faltava um "end" e em outro estava sobrando uma ")"
function onUse(cid, item, fromPosition, itemEx, toPosition) -- part's of DrakyLukas
local _ = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824,4825}
local slot = getPlayerSlotItem(cid, CONST_SLOTARROW)
local water = getWater(slot.uid)
local refil = 2 -- % of reffil
local add = water == 99 and 1 or refil
if getWater(slot.uid) ~= 100 then
if isInArray(_, itemEx.itemid) then
setWaterPouchPercent(slot.uid, add)
end
else
doPlayerSendCancel(cid, "Your pouch is full")
end
return true
end
function onCastSpell(cid, var)
local water_pounch = 2184
local slot = getPlayerSlotItem(cid, CONST_SLOTARROW)
local waters = {4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}
local water = true
local p = 2 -- quantos porcentos de agua vai usar
if getPlayerStorageValue(cid, 372872) < 1 then
setWaterPouchPercent(slot.uid, 100)
setPlayerStorageValue(cid, 372872, 1)
end
if slot.uid < 1 then
return true
end
if getWaterInArea(waters, getThingPos(cid), 5, 5) then
water = false
end
if getWater(slot.uid) < p then
doPlayerSendTextMessage(cid, 27, "Sorry, you don't have any water") return true
end
if water then
setWaterPouchPercent(slot.uid, getWater(slot.uid) - p)
doPlayerSendTextMessage(cid, 27, "You use " .. p .. "% of your pouch now have" .. getWater(slot.uid))
else
doPlayerSendTextMessage(cid, 27, "Using ambient water.")
end
return doCombat(cid, var)
end