The random part of my script don't are working:
Code:
---by BomBa---
--------------
function onStepOut(cid, item, position, fromPosition)
if getPlayerStorageValue(cid, 60010) == -1 then
if getPlayerVocation(cid) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Wand of Vortex.")
doPlayerAddItem(cid, 2190, 1)
setPlayerStorageValue(cid, 60010, 1)
elseif getPlayerVocation(cid) == 2 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Snakebite rod.")
doPlayerAddItem(cid, 2182, 1)
setPlayerStorageValue(cid, 60010, 1)
elseif getPlayerVocation(cid) == 3 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Spear.")
doPlayerAddItem(cid, 2389, 3)
setPlayerStorageValue(cid, 60010, 1)
elseif getPlayerVocation(cid) == 4 then
if math.random(1, 3) == 1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Steel Axe.")
doPlayerAddItem(cid, 8601, 1)
setPlayerStorageValue(cid, 60010, 1)
elseif math.random(1, 3) == 2 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Jagged Sword.")
doPlayerAddItem(cid, 8602, 1)
setPlayerStorageValue(cid, 60010, 1)
elseif math.random(1, 3) == 3 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found a Daramanian Mace.")
doPlayerAddItem(cid, 2439, 1)
setPlayerStorageValue(cid, 60010, 1)
end
end
end
return TRUE
end