Ir para conteúdo

(Resolvido)[Resolvido] ao-pegar-tal-level-player-ganha-algum-item

Featured Replies

  • 8 months later...
  • Respostas 10
  • Visualizações 2.6k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • 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

  • function onAdvance(cid, skill, oldLevel, newLevel) local config = { [50] = {item = 2160, count = 50}, [100] = {item = 2160, count = 50}, [150] = {item = 2160, count = 50}, [200] = {item = 2160, count

Postado

@JuniorCesaaar

 

Coloque seu login.lua aqui, que coloco para você.

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

Em creaturescripts.xml adicione: 

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

Creaturescripts/scripts/login.lua 
 

registerCreatureEvent(cid, "upgain") 

 

créditos: Newtonnotwen

Como faz pra o player ganha tipo 50 gold 

Postado

 

Como faz pra o player ganha tipo 50 gold 

function onAdvance(cid, skill, oldLevel, newLevel)

local config = {
[50] = {item = 2160, count = 50},
[100] = {item = 2160, count = 50},
[150] = {item = 2160, count = 50},
[200] = {item = 2160, count = 50},
[250] = {item = 2160, count = 50},
[300] = {item = 2160, count = 50},
[350] = {item = 2160, count = 50},
[400] = {item = 2160, count = 50},
}

if skill == 8 then
for level, info in pairs(config) do
if newLevel >= level and (getPlayerStorageValue(cid, 30700) == -1 or not (string.find(getPlayerStorageValue(cid, 30700), "'" .. level .. "'"))) then
doPlayerAddItem(cid, info.item, info.count)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Parabéns, você atingiu o level "..newLevel.." e ganhou "..info.count.." "..getItemNameById(info.item)..".")
local sat = getPlayerStorageValue(cid, 30700) == -1 and "Values: '" .. level .. "'" or getPlayerStorageValue(cid, 30700) .. ",'" .. level .. "'" 
setPlayerStorageValue(cid, 30700, sat)
end
end
end

return TRUE
end

Use este script, porém o item = 2160 é o ID da moeda Crystal Coin e a count é a quantia, no caso 50.

Veja mais em: http://www.tibiaking.com/forum/forums/topic/36453-up-level-recompensa-ao-subir-de-level/

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo