local config = {
["dragon"] = {chance = 10, itemid = 2160, count = 1},
["dragon lord"] = {chance = 3, itemid = 2195, count = 1}
}
function onDeath(cid, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
local monster = Monster(cid)
local targetName = config[monster:getName():lower()]
if not targetName then
return true
end
local rand = math.random(100)
if rand <= targetName["chance"] then
Container(corpse):addItem(targetName["itemid"], targetName["count"])
end
end