Competitibia
Pain & Glory WHole
- Joined
- Apr 1, 2021
- Messages
- 545
- Solutions
- 3
- Reaction score
- 210
Lua:
local useWorms = FALSE
local waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray(waterIds, itemEx.itemid) == TRUE then
if itemEx.itemid ~= 493 then
if math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) <= getPlayerSkill(cid, SKILL_FISHING) then
if useWorms == TRUE then
if getPlayerItemCount(cid, ITEM_WORM) > 0 then
doPlayerRemoveItem(cid, ITEM_WORM, 1)
doPlayerAddItem(cid, ITEM_FISH, 1)
end
else
doPlayerAddItem(cid, ITEM_FISH, 1)
end
end
doPlayerAddSkillTry(cid, SKILL_FISHING, 1)
end
doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
return TRUE
elseif (toPosition.x ~= CONTAINER_POSITION) and isSightClear(getPlayerPosition(cid), toPosition, floorCheck) and not getTileInfo(toPosition).house and not getTileInfo(toPosition).depot and not getTileInfo(toPosition).protection and not getTileInfo(getPlayerPosition(cid)).protection then
doRelocate(toPosition, getPlayerPosition(cid),false, false)
--moveitem getTileItemById
else
doSendAnimatedText(toPosition, "THIEF!", TEXTCOLOR_YELLOW)
doSendAnimatedText(getPlayerPosition(cid), "THIEF!", TEXTCOLOR_YELLOW)
doSendMagicEffect(toPosition, 83)
end
return FALSE
end
Last edited: