terra = {1285}
levels = {
[-1] = 2148
}
local config = {
storage = 19333,
chance = 50, --- chance de achar um item ou não
k = 50, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante)
experience = 19334
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local drops = {}
function getDrops(cid)
for i = -1, getPlayerStorageValue(cid, config.storage) do
if levels[i] then
table.insert(drops, levels[i])
end
end
return true
end
if isInArray(terra, itemEx.itemid) then
getDrops(cid)
doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience) + 1)
local experience = getPlayerStorageValue(cid, config.experience)
if experience >= (8 + (getPlayerStorageValue(cid, config.storage) ^ 2)) / config.k then
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) + 1)
doPlayerSendTextMessage(cid, 27, "Parabens, voce subiu de nivel! Seu nivel atual e " .. getPlayerStorageValue(cid, config.storage) .. ".")
if getPlayerStorageValue(cid, config.storage) == 1000 then
-- Aqui, o ouro (gold) é adicionado diretamente ao banco
doPlayerAddBankBalance(cid, 100 * 10000) -- 100 golds convertidos para gp (cada gold = 10000 gp)
end
end
if config.chance >= math.random(1, 150) then
if #drops >= 1 then
local item = drops[math.random(1, #drops)]
doPlayerSendTextMessage(cid, 27, "Voce encontrou um gold")
doSendAnimatedText(toPosition, "gold", 210)
-- Aqui, o ouro (gold) é adicionado diretamente ao banco
doPlayerAddBankBalance(cid, 1 * 10000) -- 1 gold convertido para gp (cada gold = 10000 gp)
end
doSendMagicEffect(toPosition, 3)
else
doSendAnimatedText(toPosition, "batebate", 180)
doSendMagicEffect(toPosition, 2)
end
elseif itemEx.itemid == item.itemid then
doPlayerSendTextMessage(cid, 27, "Voce esta atualmente no nivel " .. getPlayerStorageValue(cid, config.storage) .. ".")
else
return false
end
return true
end


info
Grupo: Campones
Registrado: 03/05/21
Posts: 33
Reputação: +1
Gênero: Masculino
Como o titulo diz, queria q ao catar o gold ele fosse direto para o bank, pois esta indo para a bp
desde de ja, agradeço ! *-*