Fiz um aqui ta bem feio o script porém funciona.
Creaturescripts.xml
Coloca isso:
<event type="kill" name="kill_for_boss" event="script" value="kill_for_boss.lua"/>
Creaturescripts/login.lua
Coloca antes do ultimo return true
registerCreatureEvent(cid, "kill_for_boss")
creaturescripts\scripts
Cria um arquivo .lua com o nome de "kill_for_boss" e cola isso
Ali vc pode mudar o nome do "monstro" a "storage" e a posição "from" para o "to" tem tbm que configurar a pos_mon = posição do monstro do boss no caso
local Configs ={
monster = 'Rabbit',
storage = 2439,
}
local pos = { x=0, y=0, z=0}
local from = { x=94, y=122, z=7 }
local to = { x=96, y=125, z=7}
local pos_mon = { x=94, y=126, z=7}
function onKill(cid, target, lastHit)
if isMonster(target) and getCreatureName(target) == Configs.monster then
for t = from.x, to.x do
for f = from.y, to.y do
pos = {x=t,y=f,z=7}
mpos = getCreatureLastPosition(target)
if mpos.y == pos.y and mpos.x == pos.x then
local get = getPlayerStorageValue(cid, Configs.storage)
if get >=0 and get <=5 then
setPlayerStorageValue(cid, Configs.storage, (get+1))
local gett = getPlayerStorageValue(cid, Configs.storage)
doCreatureSay(cid, 'Voce matou '..gett..' Rabbits ate agora.', TALKTYPE_ORANGE_1)
if gett == 5 then
doPlayerSendTextMessage(cid, 19,"Kill the mini boss!")
doCreateMonster("Troll", pos_mon)
setPlayerStorageValue(cid, Configs.storage, 10)
return true
end
return true
elseif get <=0 then
setPlayerStorageValue(cid, Configs.storage, 1)
local gett = getPlayerStorageValue(cid, Configs.storage)
doCreatureSay(cid, 'Voce matou '..gett..' Rabbits ate agora.', TALKTYPE_ORANGE_1)
return true
end
end
end
end
end
return true
end