Action Simple porem bem legalzinha ^^
Vamos la:
Primeiramente copie e cole um arquivo da pasta data/actions/scripts e renomeie-o para Stuffed Dragon e coloque isto dentro dele:
--Stuffed Dragon action by Pokus-- function onUse(cid, item, frompos, item2, topos) sorte = math.random(1,5) pos = getPlayerPosition(cid) if item.itemid == 5791 and sorte == 1 then doCreatureSay(cid, "Fchhhhhh!", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 2 then doCreatureSay(cid, "Zchhhhhh!", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 3 then doCreatureSay(cid, "Grooaaaaar", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 4 then doCreatureSay(cid, "Aaa... CHOO!", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 5 then doSendMagicEffect(pos,6) doCreatureAddHealth(cid,-1) doCreatureSay(cid, "You... will.... burn!!", TALKTYPE_ORANGE_1) end return TRUE end
Agora no arquivo actions.xml coloque isto
<action itemid="5791" script="stuffed dragon.lua"/>
é isso ai galera action simples porem legalzinha ^^
PS: eu tava com um probleminha nesta parte:
doCreatureAddHealth(cid,-1)
esta é a parte que o player sofre o dano de -1 no seu hp
se esta funçao nao funcionar em seu OT subistua o arquivo por este:
--Stuffed Dragon action by Pokus-- function onUse(cid, item, frompos, item2, topos) sorte = math.random(1,5) pos = getPlayerPosition(cid) if item.itemid == 5791 and sorte == 1 then doCreatureSay(cid, "Fchhhhhh!", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 2 then doCreatureSay(cid, "Zchhhhhh!", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 3 then doCreatureSay(cid, "Grooaaaaar", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 4 then doCreatureSay(cid, "Aaa... CHOO!", TALKTYPE_ORANGE_1) elseif item.itemid == 5791 and sorte == 5 then doSendMagicEffect(pos,6) doPlayerAddHealth(cid,-1) doCreatureSay(cid, "You... will.... burn!!", TALKTYPE_ORANGE_1) end return TRUE end
Espero que gostem