Jump to content
×
×
  • Create New...
  • 0

Recompensa por Level


Question

Versão do Servidor: TFS - 0.4
Tipo de Script: creaturescript
Código:
 

    

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!

Edited by Kobrakt
Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 1
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

 

Link to post
Share on other sites
  • 0
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?

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now