Date: 2014/01/01 18:13:51 UTC-08:00
Type: Denizen Script
NPCLoot:
type: assignment
actions:
on damage:
- flag npc attackers:->:<player>
on death:
- foreach <npc.flag[attackers].aslist> {
- give <player[<npc.flag[attackers]>].inventory>" i@<proc:Determine Loot>"
}
"Determine Loot":
type: procedure
script:
- define roll <util.random.int[1].to[100]>
- if %roll% >= 0 && %roll% < 25 define quality "Common"
else if %roll% >= 25 && %roll% < 40 define quality "Uncommon"
- if %quality% == Common
determine "<li@Stick|Coal|torch.random>"
else if %quality% == Uncommon
determine "<li@Iron_Sword|Iron_Spade|Iron_Pickaxe|Diamond.random>"