- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleUntitled Paste
TypeDenizen Script
Date2014/01/01 18:12:50 UTC-08:00
ByGuest
Other
Paste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2500
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>"

"Stick":
   type: item
   material: stick


RawRaw



Pastes made: 59206