TFS 1.2
Basically this is onKill creaturescript and for some reason it adds the item to a player and not a monster corpse. How can i prevent it and add the item to a creature corpse?
Basically this is onKill creaturescript and for some reason it adds the item to a player and not a monster corpse. How can i prevent it and add the item to a creature corpse?
Lua:
for _, boss in ipairs(bosses) do
if playerLevel >= boss.minLevel and playerLevel <= boss.maxLevel and isInArray(boss.monsters, monsterName) then
local drop = boss.chances[math.random(1, #boss.chances)]
if drop and math.random() <= drop.chance then
local itemCount = drop.count or 1
player:addItem(drop.itemId, itemCount)
monsterPosition:sendMagicEffect(CONST_ME_MAGIC_GREEN)
end