LE

Ajuda Nessse Escript Erro

Por leandroskt8, 15 de ago. de 2012 em Scripts

otserv
tibia
script
5
1.5k
leandroskt8L
15 de agosto de 2012 às 10:53

quero quando player upar x level ganhar x iten conforme esta no script só que n sei que ta de errado nele alguem me ajuda ai pf valendo rep+

 

local configuracao = {
efeito = {27,28, 29,79}, -- Efeito que vai mandar ao avançar de level.
}
function onAdvance(cid, skill, oldLevel, newLevel)
if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then return true end
if (getPlayerLevel(cid) == 150) then
doPlayerAddItem(cid, 7424, 1)
doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )
setPlayerStorageValue(cid, 25686, 1)
elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 4, 8, 12 then -- vocações
doPlayerAddItem(cid, 115, 1)
doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )
setPlayerStorageValue(cid, 25687, 1)
elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 3, 7, 11 then -- vocações
doPlayerAddItem(cid, 2352, 1)
doPlayerAddItem(cid, 7438, 1)
doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )
setPlayerStorageValue(cid, 25687, 1)
elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 2, 10, 6 then -- vocações
doPlayerAddItem(cid, 7424, 1)
doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )
setPlayerStorageValue(cid, 25687, 1)
elseif (getPlayerLevel(cid) == 150) and getPlayerVocation(cid) == 1, 5, 9 then -- vocações
doPlayerAddItem(cid, 7424, 1)
doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )
setPlayerStorageValue(cid, 25687, 1)
end
return true
end

 

preciso para essas vocações e esses itens .

 

Obg
happy.png

Editado Agosto 15 por godleandro

15 de agosto de 2012 às 17:15

na area de sprites ???

reportado para moverem

 

na area de sprites ???

reportado para moverem

ali en cima tem um return true end na mesma linha

tenta dakela linha la botar assim

normal

 

function onAdvance(cid, skill, oldLevel, newLevel)

if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then return true end

if (getPlayerLevel(cid) == 150) then

doPlayerAddItem(cid, 7424, 1)

doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])

doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )

setPlayerStorageValue(cid, 25686, 1)

editado

 

function onAdvance(cid, skill, oldLevel, newLevel)

if getPlayerStorageValue(cid, 25686) >= 1 or getPlayerStorageValue(cid, 25687) >= 1 then

if (getPlayerLevel(cid) == 150) then

doPlayerAddItem(cid, 7424, 1)

doSendMagicEffect(getThingPos(cid), configuracao.efeito[math.random(#configuracao.efeito)])

doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, )

setPlayerStorageValue(cid, 25686, 1)

se n der bota

return true

end

 

dps disso

Editado Agosto 15 por PostadorHunter

NewtonnotwenN
16 de agosto de 2012 às 17:04

Em data/creaturescripts/scripts crie um arquivo.lua nomeie para upgain e adicione:

local vocationsItem = {

[1] = 7759,

[2] = 7760,

[3] = 7761,

[4] = 7762

}

 

local lvlGain = 20

 

function onAdvance(cid, skill, oldLevel, newLevel)

 

if (getPlayerLevel(cid) == lvlGain and getPlayerStorageValue(cid, 403245) ~= 1) then

doPlayerAddItem(cid, vocationsItem[getPlayerVocation(cid)])

setPlayerStorageValue(cid, 403245, 1)

end

return true

end

Editando:

 

-Vermelho: Id da vocação

-Laranja: Id do item

-Verde: Level para ganhar o item

 

Em creaturescripts.xml adicione:

<event type="advance" name="upgain" event="script" value="upgain.lua"/>

Para adicionar mais itens faça o seguinte:

 

Copie o arquivo em roxo:

[1] = 7759,

[2] = 7760,

[3] = 7761,

[4] = 7762

}

Duplique no seguinte lugar (em marrom):

[1] = 7759,

[2] = 7760,

[2] = 7760,

[3] = 7761,

[4] = 7762

}

 

E depois apenas edite o id da vocação e do item.

 

Ex:

[1] = 7759,

[2] = 7760,

[5] = 8595,

[3] = 7761,

[4] = 7762

-Verde: O que foi editado

Editado Agosto 16 por Newtonnotwen

leandroskt8L
17 de agosto de 2012 às 00:27

vlw rep +

NewtonnotwenN
17 de agosto de 2012 às 00:35

De nada.

 

Duvida sanada.