Ir para conteúdo

Posts Recomendados

Como fazer um present box?!?!?!

 

Tem verios items que server de present o mais usado eh o 2331 pois nunca cai em lado nenhum...

 

data->actions->scrpints->cria aqui um xml novo com o nome de--> presente_box.xml

 

function onUse(cid, item, frompos)

 

local presente = math.random(1,9000)

 

if item.itemid == 2331 then

doRemoveItem(item.uid,1)

doSendMagicEffect(frompos,13)

 

if presente >1 and presente <2 then

doPlayerAddItem(cid,6528,1)

 

 

elseif presente >3 and presente <4 then

doPlayerAddItem(cid,7414,1)

 

 

elseif presente >5 and presente <6 then

doPlayerAddItem(cid,8926,1)

 

 

elseif presente >7 and presente <8 then

doPlayerAddItem(cid,7429,1)

 

 

elseif presente >10 and presente <20 then

doPlayerAddItem(cid,8932,1)

 

 

elseif presente >21 and presente <30 then

doPlayerAddItem(cid,8929,1)

 

 

elseif presente >31 and presente <30 then

doPlayerAddItem(cid,8903,1)

 

 

elseif presente >41 and presente <50 then

doPlayerAddItem(cid,8924,1)

 

 

elseif presente >51 and presente <60 then

doPlayerAddItem(cid,2496,1)

 

 

elseif presente >61 and presente <70 then

doPlayerAddItem(cid,5670,1)

 

 

elseif presente >71 and presente <80 then

doPlayerAddItem(cid,2640,1)

 

 

elseif presente >81 and presente <90 then

doPlayerAddItem(cid,9777,1)

 

 

elseif presente >91 and presente <100 then

doPlayerAddItem(cid,9776,1)

 

 

elseif presente >1100 and presente <2000 then

doPlayerAddExp(cid,10000000)

 

 

elseif presente >2100 and presente <3000 then

doPlayerAddItem(cid,2159,31)

 

 

elseif presente >3100 and presente <4000 then

doPlayerAddItem(cid,2159,12)

 

 

elseif presente >4100 and presente <5000 then

doPlayerAddItem(cid,10518,1)

 

 

elseif presente >5100 and presente <6000 then

doPlayerAddItem(cid,6502,31)

 

 

elseif presente >6100 and presente <7000 then

doPlayerAddItem(cid,6504,12)

 

 

elseif presente >7100 and presente <8000 then

doPlayerAddItem(cid,6505,1)

 

 

elseif presente >8100 and presente <9000 then

doPlayerAddItem(cid,6512,1)

 

 

end

end

end

 

2331 ->> id do present

Probabilidade de sair ->> neste caso sera 2/5000

Probabilidade dos items ->> quanto mais distance voce pozer mais dificil é sair

Item muito facil de sair ->> Probabilidade 1000/5000

 

Items a sua escolha

 

 

agora no ficheiro actions.xml

 

<action itemid="2331" script="pres.lua"/>

 

 

Id so seu present

 

 

Espero ajuda alguem com isto!!

 

Se gostar movam ele para outra secçao flw

 

 

Editado por tavax
Link para o comentário
https://xtibia.com/forum/topic/123766-resolvido/
Compartilhar em outros sites

function onUse(cid, item, frompos, item2, topos)

if item.itemid == 6508 then

doRemoveItem(item.uid,1)

 

rand = math.random(1,2000)

doPlayerAddItem(cid,6528,1)

 

if rand >5 and rand <50 then

doPlayerAddItem(cid,7414,1)

elseif rand >5 and rand <50 then

doPlayerAddItem(cid,8626,1)

elseif rand >5 and rand <50 then

doPlayerAddItem(cid,2496,1)

elseif rand >50 and rand <100 then

doPlayerAddItem(cid,2160,1)

elseif rand >200 and rand <400 then

doPlayerAddItem(cid,2160,1)

elseif rand >500 and rand <800 then

doPlayerAddItem(cid,2640,1)

elseif rand >800 and rand <1150 then

doPlayerAddItem(cid,2159,51)

elseif rand >1100 and rand <1400 then

doPlayerAddItem(cid,10518,1)

elseif rand >1500 and rand <2000 then

-- Ele não faz nada nessa parte, adicione um doPlayerAddItem.

end

 

end

return 1

end

Editado por lucasjockey
Link para o comentário
https://xtibia.com/forum/topic/123766-resolvido/#findComment-817735
Compartilhar em outros sites

Eu nao quero fazer flood ou algo assim do genrero mas é queeu respondi ao a cara e hoje de manha consegui resolver o problema.. por isso pos ai um mini utorial ja que nao encontrei nada na secçao de actions

 

 

flw

Editado por tavax
Link para o comentário
https://xtibia.com/forum/topic/123766-resolvido/#findComment-817741
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...