NO

[shovel] Abrindo Buraco

Por Northon, 01 de jul. de 2008 em Actions e Talkactions

script
3
3.2k
01 de julho de 2008 às 17:22

[shovel] Abrindo Buraco

 

Status:

Buraco aberto: abertonc2.png

Buraco fechado: fechadovs6.png

 

Iniciando:

 

  • Abra o seguinte arquivo: data/actions/scripts/shovel.lua
  • Substitue tudo o que há dentro desse arquivo por isso:
     
    function onUse(cid, item, frompos, item2, topos)
    pos = getPlayerPosition(cid)
    if item2.itemid == 0 then
    	return 0
    end
    
    if item2.itemid == 468 then
    	doTransformItem(item2.uid,469)
    	doDecayItem(item2.uid)
    elseif item2.itemid == 481 then
    	doTransformItem(item2.uid,482)
    	doDecayItem(item2.uid)
    elseif item2.itemid == 293 then
    	doTransformItem(item2.uid,294)
    	doDecayItem(item2.uid)
    elseif item2.itemid == 483 then
    	doTransformItem(item2.uid,484)
    	doDecayItem(item2.uid)
    elseif item2.itemid == 231 then
    	rand = math.random(1,30)
    
    	if rand < 6 then
    		doSummonCreature("Scarab", topos)
    		doTeleportThing(cid,topos)
    		doTeleportThing(cid,pos)
    	elseif rand == 6 then
    		doSummonCreature("Crab", topos)
    		doTeleportThing(cid,topos)
    		doTeleportThing(cid,pos)
    	elseif rand == 15 then
    		doPlayerAddItem(cid,2159,1)
    	else
    		doSendMagicEffect(topos,2)
    	end
    else
    	return 0
    end
    
    return 1
    end


     

  • Vá a arquivo -> salvar.
  • Acesse o arquivo indicado a seguir: data/actions/actions.xml
  • Abra-o e adicione isso:
     
    <action itemid="2554" script="shovel.lua"  />
    <action itemid="5710" script="shovel.lua"  />


     

  • Pronto, salve e feche-o.

01 de julho de 2008 às 19:42

ficaria melhor se você fizesse esse por move actions para fica igual do tibia rl se você quiser eu fasso e te mando o code.

noobinhuN
01 de julho de 2008 às 21:04

Erhm, esse buraco já está aberto, quando você pisa nele que você cai, só isso. Tanto que em POH muita gente morre num buraco desses que tem lá por trappers/lurers. Faz por movements...

 

function onStepIn(.....)

 

if isPlayer(cid) then

doTeleportThing...

doDecay...

doTransform...

end

end

 

Mas, a script de shovel é um bom script para aprender doDecay e doTransform :D (Assim como mana potions, e seus fluídos)