Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function drop(self)
- local typ
- if dropList[self] ~= nil then
- if dropList[self].typ ~= "drop" then
- typ = "drop"
- elseif dropList[self].typ ~= "limit" then
- typ = "limit"
- end
- end
- if typ == "limit" then
- if dropList[self].min_level ~= nil or dropList[self].max_level ~= nil then
- return
- end
- if dropList[self].min_level > pc.level or dropList[self].max_level < pc.level then
- return
- end
- local chance,count
- table.foreach(dropList[self].dropps, function(i)
- if dropList[self].dropps[i][3] ~= nil then
- chance = dropList[self].dropps[i][3]
- else
- chance = 100
- end
- if dropList[self].dropps[i][2] ~= nil then
- count = dropList[self].dropps[i][2]
- else
- count = 1
- end
- if math.random(1, 100) < chance then
- game.drop_item_with_ownership(dropList[self].dropps[i][1], count)
- end
- end)
- elseif typ == "drop" then
- local chance,count
- table.foreach(dropList[self].dropps, function(i)
- if dropList[self].dropps[i][3] ~= nil then
- chance = dropList[self].dropps[i][3]
- else
- chance = 100
- end
- if dropList[self].dropps[i][2] ~= nil then
- count = dropList[self].dropps[i][2]
- else
- count = 1
- end
- if math.random(1, 100) < chance then
- --pc.give_item2(dropList[self].dropps[i][1], count)
- game.drop_item_with_ownership(dropList[self].dropps[i][1], count)
- end
- end)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement