ralke
(҂ ͠❛ ෴ ͡❛)ᕤ
Hi again! I wanted to ask something related to this script
How can I add this extra loot specifically to one vocation?. I'm planing to have one file for each vocation with this extra loot thing, if it doesn't has any issue. The goal is to give potions as extra loot for each vocation, to avoid urgent refills and boost resources without raising the loot rate directly or the profit earning of all the creature's loot.
Thanks a lot in advance!
Regards
RevScripts - ❤ ℱ𝓇𝑒𝑒 𝒮𝒸𝓇𝒾𝓅𝓉𝒾𝓃𝑔 𝒮𝑒𝓇𝓋𝒾𝒸𝑒 𝒯ℱ𝒮 𝟷.𝟻+ ❤
❤ 𝐅𝐫𝐞𝐞 𝐒𝐜𝐫𝐢𝐩𝐭𝐢𝐧𝐠 𝐒𝐞𝐫𝐯𝐢𝐜𝐞 𝟏.𝟓+ ❤ 📚 (っ◔◡◔)っ ℐ𝓃𝒻𝑜𝓇𝓂𝒶𝓉𝒾𝑜𝓃 📚 ❤ ℰ𝓃𝑔𝒾𝓃𝑒: 𝒯ℱ𝒮 𝒪𝒻𝒾𝒸𝒾𝒶𝓁 ❤ ℰ𝓃𝑔𝒾𝓃𝑒 𝒱𝑒𝓇𝓈𝒾𝑜𝓃: 𝟷.𝟻+ ⚙🔧ℋ𝑜𝓌 𝓉𝑜 𝓇𝑒𝓆𝓊𝑒𝓈𝓉 𝒶 𝓈𝒸𝓇𝒾𝓅𝓉? ❤ ℳ𝒶𝓀𝑒 𝓈𝓊𝓇𝑒 𝓎𝑜𝓊 𝓂𝑒𝑒𝓉 𝓉𝒽𝑒 𝒸𝑜𝓇𝓇𝑒𝒸𝓉 𝓋𝑒𝓇𝓈𝒾𝑜𝓃 𝒶𝓃𝒹 𝑒𝓃𝑔𝒾𝓃𝑒. ❤ 𝒯𝓇𝓎 𝓃𝑜𝓉 𝓉𝑜 𝓂𝒶𝓀𝑒 𝓎𝑜𝓊𝓇 𝓇𝑒𝓆𝓊𝑒𝓈𝓉 𝓉𝑜𝑜 𝒸𝑜𝓂𝓅𝓁𝑒𝓍, 𝒶𝓈 𝓉𝒽𝑒 𝓈𝒾𝓂𝓅𝓁𝑒𝓈𝓉 𝑜𝓃𝑒𝓈 𝓌𝒾𝓁𝓁 𝒷𝑒 𝓉𝒶𝓀𝑒𝓃 𝒸𝒶𝓇𝑒 𝑜𝒻 𝒻𝒾𝓇𝓈𝓉. ❤ 𝒴𝑜𝓊 𝒶𝑔𝓇𝑒𝑒 𝓃𝑜𝓉 𝓉𝑜...
otland.net
Lua:
local monsters = {
-- all monsters
all = {
loot = {
{ itemId=2152, count=100, chance=20 },
{ itemId=2160, count=10, chance=20 },
{ itemId=2160, minCount=10, maxCount=20, chance=20 }
}
},
["rotworm"] = {
loot = {
{ itemId=2398, count=10, chance=20 }
}
},
["dragon"] = {
loot = {
{ itemId=2152, minCount=10, maxCount=20, chance=20 },
{ itemId=2160, minCount=10, maxCount=20, chance=20 }
}
}
}
local ec = EventCallback
function ec.onDropLoot(monster, corpse)
if not corpse or not corpse:getType():isContainer() then
return
end
local m = monsters[monster:getName():lower()] or monsters.all
local loot = m.loot
if #loot == 0 then
return
end
local showText = false
for _, lootItem in pairs(loot) do
if math.random(100) <= lootItem.chance then
local it = ItemType(lootItem.itemId)
if lootItem.count then
if corpse:addItem(lootItem.itemId, it:isStackable() and lootItem.count or 1) then
showText = true
end
elseif corpse:addItem(lootItem.itemId, it:isStackable() and math.random(lootItem.minCount or 1, lootItem.maxCount or 100) or 1) then
showText = true
end
end
end
if showText then
monster:say("You found something.", TALKTYPE_MONSTER_SAY)
end
end
ec:register(777)
How can I add this extra loot specifically to one vocation?. I'm planing to have one file for each vocation with this extra loot thing, if it doesn't has any issue. The goal is to give potions as extra loot for each vocation, to avoid urgent refills and boost resources without raising the loot rate directly or the profit earning of all the creature's loot.
Thanks a lot in advance!
Regards