Ajuda Nessse Escript Erro

leandroskt8
em Scripts

leandroskt8

A humildade é a única base sólida de todas as virtudes.
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/07/10Posts: 53Char no Tibia: druid

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

PostadorHunter

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 10/12/11Posts: 962Gênero: Masculino

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

Newtonnotwen

Só quero saber o porque, o resto são detalhes.
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 04/08/12Posts: 762

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

b5feb15da83eca8bd379039567f3992860f398f765aea98c57dcd2a1ffb0d35ca20603caaf7d9f03da39a3ee5e6b4b0d3255bfef95601890afd807098c4de7dfec2a3351efcdaa9ed8451e6c.gif

leandroskt8

A humildade é a única base sólida de todas as virtudes.
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 05/07/10Posts: 53Char no Tibia: druid

vlw rep +

Newtonnotwen

Só quero saber o porque, o resto são detalhes.
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 04/08/12Posts: 762

De nada.

 

Duvida sanada.

b5feb15da83eca8bd379039567f3992860f398f765aea98c57dcd2a1ffb0d35ca20603caaf7d9f03da39a3ee5e6b4b0d3255bfef95601890afd807098c4de7dfec2a3351efcdaa9ed8451e6c.gif