local function doRemoveItemFromPos(position, itemid, count)
local item = getTileItemById(position, itemid)
if(item.uid ~= 0)then
return doRemoveItem(item.uid, count or -1)
end
return false
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local pokes = {
['Bulbasaur'] = {1},
['Ivysaur'] = {1},
['Venusaur'] = {1},
['Bellsprout'] = {1},
['Charmeleon'] = {1},
['Sandshrew'] = {1},
['Sandslash'] = {1},
['Gloom'] = {1},
['Vileplume'] = {1},
['Paras'] = {1},
['Parasect'] = {1},
['Meowth'] = {1},
['Persian'] = {1},
['Weepinbell'] = {1},
['Victreebel'] = {1},
['Farfetchd'] = {1},
['Exeggutor'] = {1},
['Cubone'] = {1},
['Marowak'] = {1},
['Scyther'] = {1},
['Jynx'] = {1},
['Tangela'] = {1},
['Pinsir'] = {1},
['Tangela'] = {1},
}
local summons = getCreatureSummons(cid)
if #summons < 1 then
return doPlayerSendCancel(cid, 'You need a plant pokemon to use cut')
end
local pokemon = pokes[getCreatureName(getCreatureSummons(cid)[1])]
local name = getCreatureName(getCreatureSummons(cid)[1])
if not pokes[name] then
return doPlayerSendCancel(cid, "This pokemon can not use cut.")
end
if itemEx.itemid == 2767 then
local pos = getThingPos(itemEx.uid)
doRemoveItem(itemEx.uid,1)
doCreateItem(6216,1,toPosition)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
doCreatureSay(cid, "Cut it, "..getCreatureName(getCreatureSummons(cid)[1]), 1)
addEvent(doRemoveItemFromPos, 5000, toPosition, 6216)
addEvent(doCreateItem,5005,2767,1,pos)
return true
end
return false
end
<action itemid="2767" event="script" value="cut.lua" allowfaruse="1"/>
entao ta ae arumado com todos os pokes e a tag certa