na lib tenta deixar assim:
monsters_boosteds = { -- Configuracao dos monstros que irão ter exp e loot aumentados
[1] = {monster_name = "Dwarf", exp = 0.05, loot = 7},
[2] = {monster_name = "Goblin", exp = 0.05, loot = 5},
[3] = {monster_name = "Orc", exp = 0.25, loot = 15},
[4] = {monster_name = "Dwarf Soldier", exp = 0.35, loot = 10},
--[5] = {monster_name = "NOME DO MONSTRO", exp = "PORCENTAGEM DE EXP", loot = "PORCENTAGEM DO LOOT"},
}
o onKill
function onKill(cid, target, damage, flags)
if not (isMonster(target)) then
return true
end
if (string.lower(getCreatureName(target)) == string.lower(getGlobalStorageValue(monster_name_backup))) then
local percent = tonumber(getGlobalStorageValue(74813))
local exp = getExperienceStage(getPlayerLevel(cid), getVocationInfo(getPlayerVocation(cid)).experienceMultiplier)
local amount = math.floor(((getMonsterInfo(string.lower(getCreatureName(target))).experience*exp)*percent))
doPlayerAddExperience(cid, amount)
addLoot(getCreaturePosition(target), getCreatureName(target), {})
end
return true
end
function addLoot(position, name, ignoredList)
local check = false
for i = 0, 255 do
position.stackpos = i
corpse = getTileThingByPos(position)
if corpse.uid > 0 and isCorpse(corpse.uid) then
check = true
break
end
end
if check == true then
local newRate = (1 + (getGlobalStorageValue(monster_loot_backup)/100)) * getConfigValue("rateLoot")
local mainbp = doCreateItemEx(1987, 1)
local monsterLoot = getMonsterLootList(name)
for i, loot in pairs(monsterLoot) do
if math.random(1, 100000) <= newRate * loot.chance then
if #ignoredList > 0 then
if (not isInArray(ignoredList, loot.id)) then
doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
end
else
doAddContainerItem(mainbp, loot.id, loot.countmax and math.random(1, loot.countmax) or 1)
end
end
end
doAddContainerItemEx(corpse.uid, mainbp)
end
end
OBS: O EVENTO TEM QUE SER COMEÇADO DE NOVO PARA ATUALIZAR A EXP NA STORAGE, ou seja, testa só depois que dar o boost exp