Quando você clica em 1 elixir ele automaticamente lhe dará 1 tanto de xp, eu queria 1 script que ele da em torno de 100.000 e 200.000 de EXP e que a EXP que ele desse aparecesse subindo em cima do player tipo como se ele tivesse matando 1 bixo e upando a xp subindo em azul.
Vá em data/actions/scripts, e copiei qualquer arquivo la dentro e Renomeie para elixir.lua
e cole isso dentro:
--MarcelloMkez and Vodkart__ function onUse(cid, pos, item, topos, item2) exp = math.random(100000,200000) --[[Exp que irá receber, variando entre 100000 e 200000]] pos = getPlayerPosition(cid) --[[Nao mude]] if doPlayerAddExp(cid, exp) then doSendAnimatedText(pos, exp, 59) end return TRUE end
tag Em data/actions/actions.xml adicione isso: <action itemid="2349" script="elixir.lua"/>
Em Vermelho: Id do item a ser usado como item da Exp.
Teste ai, to no trabalho e fiz correndo..
me avise se funcinou.
abraço
~MarcelloMkez'~
Msn: marcello_dirt@hotmail.com
~ Awaken Tibia Server ® ~
- * Meus Trabalhos:
@UP
nesse caso só adicionar um math.random porque iria variar de 100000 a 200000
xd
local exp = math.random(100000,200000) if doPlayerAddExp(cid, exp) then doSendAnimatedText(pos, exp, 59) ...
Aee funcionou, agora o elixir ficou infinito eu to clicando ele dando EXP e não ta acabando, queria saber se pode ajudar a fazer ele voltar ao normal, e se puder quando clicar nele o player receber 1 mensagem em verde tipo essa: Você recebeu 104000 de experience!
--- EDIT ---
Ah queria saber tambem, onde eu mudo a cor queria 1 azul mais claro bem claro mesmo.
local config = { animationColor = TEXTCOLOR_LIGHTBLUE, --[[Cor da animação | Padrão = Azul Claro]] textType = MESSAGE_INFO_DESCR, --[[Cor do Texto | Padrão = Verde]] expGain = {100000, 200000} --[[Ganho aleatório de experiência]] removeOnUse = true --[[Remover no uso?]] } function onUse(cid, item, fromPosition, itemEx, toPosition) local gain = math.random(config.expGain[1], config.expGain[2]) doPlayerAddExp(cid, gain) doSendAnimatedText(getThingPosition(cid), gain, config.animationColor) doPlayerSendTextMessage(cid, config.textType, "You received ".. gain .." experience from the Elixir") if removeOnUse == true then doRemoveItem(item.uid, 1) end return true end
Pronto, fiz de um modo que a configuração do script fique bem mais versátil,
As cores de texto animado e seus respectivos valores são:
TEXTCOLOR_BLUE = 5 TEXTCOLOR_GREEN = 18 TEXTCOLOR_TEAL = 35 TEXTCOLOR_LIGHTGREEN = 66 TEXTCOLOR_DARKBROWN = 78 TEXTCOLOR_LIGHTBLUE = 89 TEXTCOLOR_DARKPURPLE = 112 TEXTCOLOR_BROWN = 120 TEXTCOLOR_GREY = 129 TEXTCOLOR_DARKRED = 144 TEXTCOLOR_DARKPINK = 152 TEXTCOLOR_PURPLE = 154 TEXTCOLOR_DARKORANGE = 156 TEXTCOLOR_RED = 180 TEXTCOLOR_PINK = 190 TEXTCOLOR_ORANGE = 192 TEXTCOLOR_DARKYELLOW = 205 TEXTCOLOR_YELLOW = 210 TEXTCOLOR_WHITE = 215 TEXTCOLOR_NONE = 255
Abraços.
Tenta ae:
local config = { animationColor = TEXTCOLOR_LIGHTBLUE, --[[Cor da animação | Padrão = Azul Claro]] textType = MESSAGE_INFO_DESCR, --[[Cor do Texto | Padrão = Verde]] expGain = {100000, 200000}, --[[Ganho aleatório de experiência]] removeOnUse = true --[[Remover no uso?]] } function onUse(cid, item, fromPosition, itemEx, toPosition) local gain = math.random(config.expGain[1], config.expGain[2]) doPlayerAddExp(cid, gain) doSendAnimatedText(getThingPosition(cid), gain, config.animationColor) doPlayerSendTextMessage(cid, config.textType, "You received ".. gain .." experience from the Elixir") if removeOnUse == true then doRemoveItem(item.uid, 1) end return true end
É o do Oneshot, mas ele esqueceu de colocar uma vírgula.
flw
@apocarai
No script não deu mas error, mais quando eu clico no Elixir no OT dá "You can not use this object."
local config = {
animationColor = TEXTCOLOR_LIGHTBLUE, --[[Cor da animação | Padrão = Azul Claro]]
textType = MESSAGE_INFO_DESCR, --[[Cor do Texto | Padrão = Verde]]
expGain = {100000, 200000}, --[[Ganho aleatório de experiência]]
removeOnUse = true --[[Remover no uso?]]
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local gain = math.random(config.expGain[1], config.expGain[2])
doPlayerAddExp(cid, gain)
doSendAnimatedText(getThingPosition(cid), gain, config.animationColor)
doPlayerSendTextMessage(cid, config.textType, "You received ".. gain .." experience from the Elixir")
if(config.removeOnUse == true) then
doRemoveItem(item.uid, 1)
end
return TRUE
end
FLW
eu testei aqui e funciono perfeitamente,se não está funcionando ai é porque vc fez algo errado.
cara vc tem que colocar no actions.xml
<action itemid="ID DO ITEM EXILIR" script="NOME DO SCRIPT.lua" />
qualquer coisa add ai
thiagoredlife@hotmail.com
Duvida Sanada por: Vodkart
Pode Fexar o Tópico.