Felipe Monteiro
Webmaster
This system work so fine in tfs 0.3, but i need it to 0.2, someone can help me to convert it ?
Taming System
Thanks anyway
Taming System
Thanks anyway
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerMount(cid, 13) then
doCreatureSay(cid, "You have already tamed a donkey.", TALKTYPE_ORANGE_1)
return true
end
if getCreatureName(itemEx.uid):lower() == "donkey" then
local chance = math.random(1, 100)
if chance <= 50 then -- 1-50
doCreatureSay(cid, "You did not manage to feed the donkey enough apple slices.", TALKTYPE_ORANGE_1)
elseif chance > 51 and chance <= 85 then -- 51-85
doCreatureSay(cid, "The donkey ran away.", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(itemEx.uid), CONST_ME_POFF)
doRemoveCreature(itemEx.uid)
elseif chance > 85 and chance <= 90 then -- 86-90
doCreatureSay(cid, "Oh no! The donkey ate all of the apple slices.", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_BLOCKHIT)
doRemoveItem(item.uid, 1)
else -- 91-100
setPlayerStorageValue(cid, item.itemid, 1)
doPlayerAddMount(cid, 13)
doCreatureSay(cid, "Munching a large pile of apple slices tamed the donkey.", TALKTYPE_ORANGE_1)
doSendMagicEffect(getCreaturePosition(itemEx.uid), CONST_ME_POFF)
doRemoveItem(item.uid, 1)
doRemoveCreature(itemEx.uid)
end
end
return true
end