Crie um arquivo na pasta do seu servidor data/creaturescripts/scripts/ com o nome doubleloot.lua e coloque o seguinte codigo:
local storage = 7718 local serverDropRate = 1000 -- VOCÊ DEVE EDITAR AQUI PARA O DROP RATE DO SEU SERVIDOR local bonusLoot = 2 -- VOCÊ DEVE EDITAR AQUI PARA O BONUS LOOT QUE DESEJA function getMonsterLootList(monsterName) local monster = getMonsterInfo(name) return monster and monster.loot or false end function doubleCreatureLoot(pos, monsterName) local corpse = getTileThingByPos(pos) if not isCorpse(corpse.uid) then return false end doAddContainerItem(corpse.uid, 1988, 1) local bp = getContainerItem(corpse.uid, getContainerItem(corpse.uid, getContainerSize(corpse.uid))) local lootList = getMonsterLootList(monsterName) for _, loot in pairs(lootList) do local randomizedChance = math.random (1, 100000) if randomizedChance <= bonusLoot * loot.chance * serverDropRate then doAddContainerItem(bp.uid, loot.id, loot.countmax and math.random(1,loot.countmax) or 1) end end end function onDeath(cid, corpse, deathList) if not isMonster(cid) then return true end if getPlayerStorageValue(cid, storage) ~= -1 then addEvent(doubleCreatureLoot, 100, getCreaturePosition(cid), getCreatureName(cid)) end end
No arquivo data/creaturescripts/creaturescripts.xml coloque a seguinte tag:
<event type="death" name="DoubleLoot" event="script" value="doubleloot.lua"/>
E no arquivo data/creaturescripts/script/login.lua coloque o seguinte codigo:
registerCreatureEvent(cid, "DoubleLoot")
Agora é só fazer assim, toda vez que o player equipar o item você seta uma storage com o codigo: setPlayerStorageValue(cid, 7718, 1)
Lembrando que se o player desequipar o item você seta a storage -1 setPlayerStorageValue(cid, 7718, -1) para ele não ter o double loot novamente.
Espero que tenha entendido e tenha ajudado.






info
Grupo: Campones
Registrado: 23/08/18
Posts: 48
Reputação: 0
-- Credits: Slawkens & Barker
local config = {
rate = 2.0, -- 2.0 = 2x faster than normal
}
function onDeEquip(cid, item, slot)
if(item.itemid == 7968) then
doPlayerSetExperienceRate(cid, 1.0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has ended.")
doTransformItem(item.uid, 7967)
end
end
function onEquip(cid, item, slot)
if(item.itemid == 7967) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your extra experience rate has been activated! It is now: " .. config.rate .. "x doubled your former experience rate.")
doPlayerSetExperienceRate(cid, config.rate)
doTransformItem(item.uid, 7968)
return true
end
end