E
Evil Puncker
Guest
Hello everyone, its me again, I have a table with monsters names, and one of them get selected on startUp and set its name into a variable, now I want to edit the monsters.lua OnDrop function so that specific creature gets twice the chance to drop loot, but I don't know how, can you guys help me?
or maybe this file is not where I should mess with? I've found this function but I don't know how/where to use it, any help is welcome, thanks for reading
Lua:
-- here is where I set the creature from a table with monsters name
local boostedMonster = boostedMonstersList[Game.getStorageValue(1232)]
-- here is the piece of code from data\events\scripts\monsters.lua that I think is needed to change:
local monsterLoot = mType:getLoot()
for i = 1, #monsterLoot do
local item = corpse:createLootItem(monsterLoot[i])
if not item then
print('[Warning] DropLoot:', 'Could not add loot item to corpse.')
end
-- autoloot
if item > 0 then
local tmpItem = Item(item)
if player and player:getAutoLootItem(tmpItem:getId()) then
if tmpItem:moveTo(player) then
autolooted = string.format("%s, %s", autolooted, tmpItem:getNameDescription())
end
end
end
end
or maybe this file is not where I should mess with? I've found this function but I don't know how/where to use it, any help is welcome, thanks for reading