Recompensa por Level

Kobrakt
em Scripts

Kobrakt

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/07/07Posts: 8

Prezados, boa noite.

Estou criando um servidor customizado e gostaria de colocar o avanço de skills junto com o up de Level.
Quando o jogador upar ele ganhará pontos e pode escolher qual skill quer upar, mas não tenho ideia de como fazer isso. 

Alguém teria algum script ou alguma idéia alternativa?

 

Grato pela atenção!

bilet

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 09/08/07Posts: 11
function onAdvance(cid, skill, oldLevel, newLevel)

local config = {
[10] = {item = 2160, count = 1},
[100] = {item = 2160, count = 2},
[150] = {item = 2160, count = 3},
[200] = {item = 2160, count = 4},
}

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

 

Shynnes123

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 20/07/20Posts: 5
Em 17/05/2020 em 19:35, bilet disse:
function onAdvance(cid, skill, oldLevel, newLevel)

local config = {
[10] = {item = 2160, count = 1},
[100] = {item = 2160, count = 2},
[150] = {item = 2160, count = 3},
[200] = {item = 2160, count = 4},
}

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

 

na onde coloco essa?

underewarr

C++,C#,JavaS,Json,Jq,Java,CSS,HTML,PHP,LUA
avatar
Banidos
Banidos

INFOS

Grupo: BanidosRegistrado: 25/01/13Posts: 114Gênero: MasculinoChar no Tibia: Tiuzao Doidao
4 horas atrás, Shynnes123 disse:

na onde coloco essa?

Em creaturescript adicione este código como Onleveladvance param

Caso não consiga crie um post pedindo o sistema