Mm you could have a table of potential loot, and randomly give players items from that, or send to their depot
creature:getDamageMap() (in this case it's self:getDamageMap() as we are in Monster script) to get list of players and monsters who did damage to monster that generate loot.