- 0
1 resposta a esta questão
Recommended Posts
Este tópico está impedido de receber novos posts.
Entre para seguir isso
Seguidores
0
-
Quem Está Navegando 0 membros estão online
Nenhum usuário registrado visualizando esta página.
Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo:
https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/
https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/
Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).
Ex: The Forgotten Server 1.3, Versão: 10.98.
Base:
otservbr, 12x, myaac
Qual é a sua pergunta?
Como faço para adicionar umas recompensas quando o player passar de level? ex: pegou nv 20 ganhou 20 crystal coins, nivel 50 ganhou 30..
eu adicionei essa linha no creatureScripts.xml
e criei um arquivo chamado LevelUpReward.lua dentro da pasta scripts com esse codigo:
local table = { -- [level] = type = "item", id = {ITEM_ID, QUANTIDADE}, msg = "MENSAGEM"}, -- [level] = type = "bank", id = {QUANTIDADE, 0}, msg = "MENSAGEM"}, -- [level] = type = "addon", id = {ID_ADDON_FEMALE, ID_ADDON_MALE}, msg = "MENSAGEM"}, -- [level] = type = "mount", id = {ID_MOUNT, 0}, msg = "MENSAGEM"}, [20] = {type = "item", id = {2160, 2}, msg = "Voce ganhou 2 crystal coins por alcancar o level 20!"}, [100] = {type = "bank", id = {200000, 0}, msg = "Foi depositado em seu bank 200000 gold coints!"}, [150] = {type = "addon", id = {136, 128}, msg = "Voce ganhou o addon citizen full por alcancar o level 40!"}, [150] = {type = "mount", id = {13, 0}, msg = "Voce ganhou a montaria Donkey por alcançar o level 150!"}, } local storage = 15000 function onAdvance(player, skill, oldLevel, newLevel) if skill ~= SKILL_LEVEL or newLevel <= oldLevel then return true end for level, _ in pairs(table) do if newLevel >= level and player:getStorageValue(storage) < level then if table[level].type == "item" then player:addItem(table[level].id[1], table[level].id[2]) elseif table[level].type == "bank" then player:setBankBalance(player:getBankBalance() + table[level].id[1]) elseif table[level].type == "addon" then player:addOutfitAddon(table[level].id[1], 3) player:addOutfitAddon(table[level].id[2], 3) elseif table[level].type == "mount" then player:addMount(table[level].id[1]) else return false end player:sendTextMessage(MESSAGE_EVENT_ADVANCE, table[level].msg) player:setStorageValue(storage, level) end end player:save() return true end
mas ainda assim nada aconteceu ao atingir um novo nivel.
Compartilhar este post
Link para o post
Compartilhar em outros sites