Skrypt do otsów rpg. Pozwala rozpruć rybę za pomocą obisadian knife'a i wyjąć z niej:
- na 1-4 gp jest 30% szans
- na 1-3 worms jest 50% szans
- na 1 burnt scroll jest 10% szans
- na to ze nic nie wypadnie jest 10% szans
Pomocne gdy mamy 2-3 ryby a chcemy jeszcze połowić, jest duża szansa że z ryby wypadną robaki.
w actions tworzymy plik ryby.lua
Kod:
-- Rozpruwanie ryb 8.1 by MTK
function onUse(cid, item, frompos, item2, topos)
n = math.random(1,10)
gp = math.random(1,4)
worm = math.random(1,3)
local tekstgp = 'You have found ' .. gp .. ' gold coins.'
local tekstworm = 'You have found ' .. worm .. ' worms.'
if item2.itemid == 2667 and n <= 3 then
doPlayerAddItem(cid,2148,gp)
doRemoveItem(item2.uid, 1)
if gp == 1 then
doPlayerSendCancel(cid, "You have found 1 gold coin.")
else
doPlayerSendCancel(cid, tekstgp)
end
elseif item2.itemid == 2667 and n >= 4 and n <= 8 then
doPlayerAddItem(cid,3976,worm)
doRemoveItem(item2.uid, 1)
if worm == 1 then
doPlayerSendCancel(cid, "You have found 1 worm.")
else
doPlayerSendCancel(cid, tekstworm)
end
elseif item2.itemid == 2667 and n == 9 then
doPlayerAddItem(cid,2239,1)
doRemoveItem(item2.uid, 1)
doPlayerSendCancel(cid, "You have found a scroll.")
else
doPlayerSendCancel(cid, "It is empty.")
doRemoveItem(item2.uid, 1)
end
return 1
end
Kod:
<action itemid="5908" script="ryby.lua" />
Zakładki