darkmu
Well-Known Member
Could someone help me, I need to adapt this script so that the person needs to kill the bosses in increasing order to release the chest.
Being that if she tries to kill the boss who will give status 4 for example and she is in status 2, she still won't change to 4 and will continue in 2.
Being that if she tries to kill the boss who will give status 4 for example and she is in status 2, she still won't change to 4 and will continue in 2.
Lua:
local bosses = {
['shadowpelt'] = {status = 1, storage = 15422},
['black vixen'] = {status = 2, storage = 15422},
['sharpclaw'] = {status = 3, storage = 15422},
['bloodback'] = {status = 4, storage = 15422},
}
function onKill(creature, target)
local targetMonster = target:getMonster()
if not targetMonster then
return true
end
local bossConfig = bosses[targetMonster:getName():lower()]
if not bossConfig then
return true
end
for pid, _ in pairs(targetMonster:getDamageMap()) do
local attackerPlayer = Player(pid)
if attackerPlayer then
attackerPlayer:setStorageValue(15422, bossConfig.status)
end
end
end