2x para sempre? Ou 50 cargas?
Arrumar script stone life/stone mana
By luccagomes, 23 de set. de 2013 in Scripts
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

Acho que ele não quis dizer cargas, mas sim usos mesmo. Tipo só poder usar 50 vezes a de vida. Só podendo adicionar 10*50 = 500 um total de 500 de vida a mais.
info
Group: Campones
Joined: 16/09/12
Posts: 88
Reputation: +21

Fiz o script com contagem, quando o player usa a pedra mostra uma msg de mais quantas vezes ele pode usar, testei aqui e ta funcionando perfeitamente. Com esse script se o player usar 50 vezes a pedra e depois adquirir ela novamente, ele poderá usar mais 50 vezes e assim infinitamente. Se você quiser que seja impossivel usar a pedra depois que acabar a primeira, é só falar que eu edito o script.
lifestone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de life o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8085) == -1 then doPlayerSetStorageValue(cid, 8085, 0) end if getPlayerStorageValue(cid, 8085) >= 0 and getPlayerStorageValue(cid, 8085) < cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vezes.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) elseif getPlayerStorageValue(cid, 8085) == cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vez.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) else setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) doPlayerSetStorageValue(cid, 8085, 0) end end
manastone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de mana o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8086) == -1 then doPlayerSetStorageValue(cid, 8086, 0) end if getPlayerStorageValue(cid, 8086) >= 0 and getPlayerStorageValue(cid, 8086) < cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vezes.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) elseif getPlayerStorageValue(cid, 8086) == cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vez.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) else setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) doPlayerSetStorageValue(cid, 8086, 0) end end
Edited Setembro 24 by WillOliveira
Eu gostaria que fosse FINITO, tirando isso ta perfeito e vai se encaixar perfeitamente onde preciso!
Desde já obrigado e reputado
Cara é só uma carga, e como se fosse uma pedra de evoluir pokemon. Usa uma vez e acaba....
Edited Setembro 24 by Seagull
info
Group: Campones
Joined: 16/09/12
Posts: 88
Reputation: +21

@Seagull
Scripts das pedras finitas:
lifestone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de life o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8085) >= cargas then doPlayerSendTextMessage(cid,26,"Você não pode mais usar este item.") return true end if getPlayerStorageValue(cid, 8085) == -1 then doPlayerSetStorageValue(cid, 8085, 0) end if getPlayerStorageValue(cid, 8085) >= 0 and getPlayerStorageValue(cid, 8085) < cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vezes.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) elseif getPlayerStorageValue(cid, 8085) == cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vez.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) else doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) end end
manastone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de mana o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8086) >= cargas then doPlayerSendTextMessage(cid,26,"Você não pode mais usar este item.") return true end if getPlayerStorageValue(cid, 8086) == -1 then doPlayerSetStorageValue(cid, 8086, 0) end if getPlayerStorageValue(cid, 8086) >= 0 and getPlayerStorageValue(cid, 8086) < cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vezes.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) elseif getPlayerStorageValue(cid, 8086) == cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vez.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) else doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) end end
Edited Setembro 24 by WillOliveira
Obrigado cara, ainda não tive tempo de testa porque to no curso. Mas vendo assim, parece estar funcional. Que droga cara, consigo interpretar tudo intender a logica, mas na hora de fazer empaco.
info
Group: Campones
Joined: 10/06/13
Posts: 62
Reputation: +2

Ta funfando, mas ela só é removida dps de usar 50x eu queria q cada vez q fosse usada ela fosse removida.
info
Group: Campones
Joined: 16/09/12
Posts: 88
Reputation: +21

Ta funfando, mas ela só é removida dps de usar 50x eu queria q cada vez q fosse usada ela fosse removida.
Ta ai:
lifestone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de life o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8085) >= cargas then doPlayerSendTextMessage(cid,26,"Você não pode mais usar este item.") return true end if getPlayerStorageValue(cid, 8085) == -1 then doPlayerSetStorageValue(cid, 8085, 0) end if getPlayerStorageValue(cid, 8085) >= 0 and getPlayerStorageValue(cid, 8085) < cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vezes.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) elseif getPlayerStorageValue(cid, 8085) == cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vez.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) else doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) end end
manastone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de mana o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8086) >= cargas then doPlayerSendTextMessage(cid,26,"Você não pode mais usar este item.") return true end if getPlayerStorageValue(cid, 8086) == -1 then doPlayerSetStorageValue(cid, 8086, 0) end if getPlayerStorageValue(cid, 8086) >= 0 and getPlayerStorageValue(cid, 8086) < cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vezes.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) elseif getPlayerStorageValue(cid, 8086) == cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vez.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) else doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) end end
Da proxima vez detalhe melhor seu pedido... Espero ter ajudado ![]()
info
Group: Campones
Joined: 10/06/13
Posts: 62
Reputation: +2

Ta funfando, mas ela só é removida dps de usar 50x eu queria q cada vez q fosse usada ela fosse removida.
Ta ai:
lifestone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de life o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8085) >= cargas then doPlayerSendTextMessage(cid,26,"Você não pode mais usar este item.") return true end if getPlayerStorageValue(cid, 8085) == -1 then doPlayerSetStorageValue(cid, 8085, 0) end if getPlayerStorageValue(cid, 8085) >= 0 and getPlayerStorageValue(cid, 8085) < cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vezes.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) elseif getPlayerStorageValue(cid, 8085) == cargas-2 then doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8085)-cargas).." vez.") setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) else doPlayerSetStorageValue(cid, 8085, getPlayerStorageValue(cid, 8085)+1) setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de vida.") doSendMagicEffect(topos,35) doRemoveItem(item.uid) end endmanastone.lua:
function onUse(cid, item, frompos, item2, topos) local cargas = 50 -- Aqui você coloca quantas vezes o player pode usar a pedra local bonus = 10 -- Aqui você coloca quanto de mana o player vai ter a mais quando usar a pedra if getPlayerStorageValue(cid, 8086) >= cargas then doPlayerSendTextMessage(cid,26,"Você não pode mais usar este item.") return true end if getPlayerStorageValue(cid, 8086) == -1 then doPlayerSetStorageValue(cid, 8086, 0) end if getPlayerStorageValue(cid, 8086) >= 0 and getPlayerStorageValue(cid, 8086) < cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vezes.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) elseif getPlayerStorageValue(cid, 8086) == cargas-2 then doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) doPlayerSendTextMessage(cid, 22, "Você pode usar este item mais "..math.abs(getPlayerStorageValue(cid, 8086)-cargas).." vez.") setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) else doPlayerSetStorageValue(cid, 8086, getPlayerStorageValue(cid, 8086)+1) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+bonus) doPlayerSendTextMessage(cid,22,"Você ganhou mais "..bonus.." de mana.") doSendMagicEffect(topos,1) doRemoveItem(item.uid) end endDa proxima vez detalhe melhor seu pedido... Espero ter ajudado
PERFEITO amanha te dou 2 reps, e se n for pedir mt faz uma pra mim q da 100 de life e 100 de mana com o id 2153 e q só pode ser usado 3x?
info
Group: Marquês
Joined: 16/06/07
Posts: 1.2k
Reputation: +377
Gender: Masculino
Tibia Character: Nenhum

Tópico movido para a seção de dúvidas e pedidos resolvidos.
O tópico foi fechado e movido para lixeira por estar inativo a mais de 30 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe.




info
Group: Campones
Joined: 10/06/13
Posts: 62
Reputation: +2
Alguem me ajuda, gostei do script, mas queria q tive-se um maximo de 50 vezes pra usar essas duas pedras aqui, alguem sabe colocar?
http://www.xtibia.com/forum/topic/215444-life-stone-e-mana-stone/