- 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
Date2015/02/21 15:42:57 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
26
27
28
29
30
31
32
33
3300
    on player damages entity:
#-------------------------------------NORMAL MOBS---------------------------------------------
    - ^if <proc[CustomItemCheck].context[<player.item_in_hand>|<player>]> {
       - ^determine <proc[CustomItemDamage].context[<player.item_in_hand>|<player>|<context.entity>|<context.cause>]> }
       else {
         - ^inject 's@NarrateDamage'
         - ^determine fulfilled }

CustomItemCheck:
  type: procedure
  debug: true
  definitions: item|player
  script:
  #UNCOMMON ITEMS
  - ^if "li@i@StaffofBountifulHarvest|i@WandofFire|i@YewBow" contains %item% ^determine true
  #RARE ITEMS
  - ^if "li@i@cryptstalkersword|i@heartburn|i@MerryGoRound|i@WandofCombustion" contains %item% ^determine true
  #EPIC ITEMS
  - ^if "li@i@BloodSucker|i@SunFlare|i@TrailofEmbers" contains %item% ^determine true


CustomItemDamage:
  type: procedure
  debug: true
  definitions: item|player|npc|cause
  script:
  - ^define mindamage <%item%.lore.get[2].strip_color.split[-].get[1]>
  - ^define maxdamage <%item%.lore.get[2].strip_color.split[-].get[2].split.get[1]>
  - ^if <%item%.material> == m@bow && %cause% == ENTITY_ATTACK ^define damage 1
     else ^define damage <util.random.int[%mindamage%].to[%maxdamage%]>
  - ^inject 's@NarrateCustomDamage'
  - ^determine %damage%



RawRaw



Pastes made: 57250