info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

info
Grupo: Campones
Registrado: 18/10/12
Posts: 70
Reputação: 0
Char no Tibia: -

Pode me dizer como faço como pedi? Tipo lvl x até lvl y receber o item?
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

se intendi bem... em todos os lvls o player vai ganhar o item neh? entao..
creaturescripts/scripts/
function onAdvance(cid, skill, oldLevel, newLevel)
local lvls = {
--{lvl, item, qnt}
{lvl = {5, 9}, item = 1000, qnt = 1}, --arruma o id do item aki...
{lvl = {10, 19}, item = 1000, qnt = 2},
{lvl = {20, 39}, item = 1000, qnt = 3},
{lvl = {40, 99}, item = 1000, qnt = 4},
}
for i, table in ipairs(lvls) do
if newLevel >= table.lvl[1] and newLevel <= table.lvl[2] then
doPlayerAddItem(cid, table.item, table.qnt)
return true
end
end
doPlayerAddItem(cid, 1000, 5) --arruma o id do item aki...
return true
end
creaturescripts/creaturescripts.xml
<event type="advance" name="onLevelUp" event="script" value="NOME DO ARQUIVO.lua"/>
creaturescripts/scripts/login.lua
registerCreatureEvent(cid, "onLevelUp")
info
Grupo: Campones
Registrado: 18/10/12
Posts: 70
Reputação: 0
Char no Tibia: -

Dúvida: se o player morrer e upar dnovo, ele recebe novamente? ç-ç
info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata

Dúvida: se o player morrer e upar dnovo, ele recebe novamente? ç-ç
O do slicer sim, agora o que o skylight passo não ..
info
Grupo: Campones
Registrado: 18/10/12
Posts: 70
Reputação: 0
Char no Tibia: -

Preciso que não receba novamente, tipo , só receba a cada novo LVL. ><
info
Grupo: Lorde
Registrado: 17/01/09
Posts: 2.1k
Reputação: +395
Char no Tibia: Adra Sata

Preciso que não receba novamente, tipo , só receba a cada novo LVL. ><
Então cara é que o do skylight passo
function onAdvance(cid, skill, oldLevel, newLevel)
local config = {
[50] = {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, 27, "Parabéns Guerreiro 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
[50] = {item = 2160, count = 50},
[50] = level
item = o item que vai receber
count = quantidade
ai e só adicionando
[20] = {item = 2212, count = 1},
Editado Novembro 8 por SkyDangerous
info
Grupo: Campones
Registrado: 18/10/12
Posts: 70
Reputação: 0
Char no Tibia: -

Ok, quando for testar edito pra ver se foi ;D



info
Grupo: Campones
Registrado: 18/10/12
Posts: 70
Reputação: 0
Char no Tibia: -
Olá galera do Xtibia
Queria um script que quando o player upasse 1 lvl ele ganhasse 2 itens (o mesmo só que a quantidade = 2 )
E com tal level até um Level ganhasse outra quantia ex:
1 - 4 = Nada
5 - 10 = 1 item
10 - 20 = 2
20 - 40 = 3
40 - 100 = 4
100+ = 5
Agradeço desde já.