How do I edit this script so that when the player level up, he earns Outfit according to his vocation? Example: EK = Warrior Outfit, Sorcerer = Wizard ...
No need to earn the Addon. Outfit Only
No need to earn the Addon. Outfit Only
local tabela =
{
-- [level] = type = "item", id = ITEM_ID, id2 = QUANTIDADE, msg = "MENSAGEM"},
-- [level] = type = "addon", id = ID_ADDON_FEMALE, id2 = ID_ADDON_MALE, msg = "MENSAGEM"},
-- [level] = type = "mount", id = ID_MOUNT, id2 = 0, msg = "MENSAGEM"},
[20] = {type = "promote", id = 2160, id2 = 2, msg = "Parabens! Voce foi promovido e ganhou 2 Crystal Coins"},
[40] = {type = "addon", id = 136, id2 = 128, msg = "Voce ganhou o addon citizen full por alcancar o level 40!"},
[50] = {type = "item", id = 2160, id2 = 5, msg = "Voce ganhou 5 crystal coins por alcancar o level 50!"},
[60] = {type = "mount", id = 2, id2 = 0, msg = "Voce ganhou uma montaria!"},
[100] = {type = "item", id = 2160, id2 = 10, msg = "Voce ganhou 10 crystal coins por alcancar o level 100!"},
[150] = {type = "item", id = 2160, id2 = 15, msg = "Voce ganhou 15 crystal coins por alcancar o level 150!"},
[200] = {type = "item", id = 2160, id2 = 20, msg = "Voce ganhou 20 crystal coins por alcancar o level 200!"},
[250] = {type = "item", id = 2160, id2 = 25, msg = "Voce ganhou 25 crystal coins por alcancar o level 250!"},
[300] = {type = "item", id = 2160, id2 = 30, msg = "Voce ganhou 30 crystal coins por alcancar o level 300!"},
}
local storage = 15000
function onAdvance(player, skill, oldLevel, newLevel)
if (skill == 8) then
for level, _ in pairs(tabela) do
if player:getLevel() >= level and player:getStorageValue(storage) < level then
if tabela[level].type == "item" then
player:addItem(tabela[level].id, tabela[level].id2)
elseif tabela[level].type == "addon" then
player:addOutfitAddon(tabela[level].id, 3)
player:addOutfitAddon(tabela[level].id2, 3)
elseif tabela[level].type == "mount" then
player:addMount(tabela[level].id)
elseif tabela[level].type == "promote" then
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
player:setVocation(promotion)
player:addItem(tabela[level].id, tabela[level].id2)
else
return false
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, tabela[level].msg)
player:setStorageValue(storage, level)
end
end
end
player:save() -- salvando player
return true
end
{
-- [level] = type = "item", id = ITEM_ID, id2 = QUANTIDADE, msg = "MENSAGEM"},
-- [level] = type = "addon", id = ID_ADDON_FEMALE, id2 = ID_ADDON_MALE, msg = "MENSAGEM"},
-- [level] = type = "mount", id = ID_MOUNT, id2 = 0, msg = "MENSAGEM"},
[20] = {type = "promote", id = 2160, id2 = 2, msg = "Parabens! Voce foi promovido e ganhou 2 Crystal Coins"},
[40] = {type = "addon", id = 136, id2 = 128, msg = "Voce ganhou o addon citizen full por alcancar o level 40!"},
[50] = {type = "item", id = 2160, id2 = 5, msg = "Voce ganhou 5 crystal coins por alcancar o level 50!"},
[60] = {type = "mount", id = 2, id2 = 0, msg = "Voce ganhou uma montaria!"},
[100] = {type = "item", id = 2160, id2 = 10, msg = "Voce ganhou 10 crystal coins por alcancar o level 100!"},
[150] = {type = "item", id = 2160, id2 = 15, msg = "Voce ganhou 15 crystal coins por alcancar o level 150!"},
[200] = {type = "item", id = 2160, id2 = 20, msg = "Voce ganhou 20 crystal coins por alcancar o level 200!"},
[250] = {type = "item", id = 2160, id2 = 25, msg = "Voce ganhou 25 crystal coins por alcancar o level 250!"},
[300] = {type = "item", id = 2160, id2 = 30, msg = "Voce ganhou 30 crystal coins por alcancar o level 300!"},
}
local storage = 15000
function onAdvance(player, skill, oldLevel, newLevel)
if (skill == 8) then
for level, _ in pairs(tabela) do
if player:getLevel() >= level and player:getStorageValue(storage) < level then
if tabela[level].type == "item" then
player:addItem(tabela[level].id, tabela[level].id2)
elseif tabela[level].type == "addon" then
player:addOutfitAddon(tabela[level].id, 3)
player:addOutfitAddon(tabela[level].id2, 3)
elseif tabela[level].type == "mount" then
player:addMount(tabela[level].id)
elseif tabela[level].type == "promote" then
local vocation = player:getVocation()
local promotion = vocation:getPromotion()
player:setVocation(promotion)
player:addItem(tabela[level].id, tabela[level].id2)
else
return false
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, tabela[level].msg)
player:setStorageValue(storage, level)
end
end
end
player:save() -- salvando player
return true
end