- 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








The script repo is an archive of historical scripts. For modern scripts, or to post your own, please use the Scripts forum section.





Staff Pick: Custom Arrow Types


By mcmonkey
Created: 2014/12/04 22:25:49 UTC-08:00 (9 years and 144 days ago)
Edited: 2015/10/13 18:35:21 UTC-07:00 (8 years and 196 days ago)
Likes: 2

Staff pick as of: 2014/12/04 22:25:57 UTC-08:00 (9 years and 144 days ago)
Denizen Version: 0.9.7
Script Version: 1.1
Description:

Adds custom arrow types to your server. View the video:
http://www.youtube.com/watch?v=ZkfoFTEZWYE


Download script | View raw script
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
27300

firework_arrow:
    type: item
    debug: false
    material: arrow
    display name: Firework Arrow
    lore:
    - <&a>Fire this arrow
    - <&b>for magic funtime
    - <&d>surprise!
    - <&c>(Requires BPG Launcher)
    recipe:
    - i@arrow|i@tnt|i@tnt
    - i@firework|i@air|i@air
    - i@air|i@air|i@air

sharp_arrow:
    type: item
    debug: false
    material: arrow
    display name: Sharpened Arrow
    lore:
    - <&c>This arrow is
    - <&c>extra sharp!
    recipe:
    - i@arrow|i@arrow|i@arrow
    - i@air|i@air|i@air
    - i@air|i@air|i@air

shotblast_arrow:
    type: item
    debug: false
    material: arrow
    display name: Bundle Of Arrow
    lore:
    - <&c>Launches 3 arrows
    - <&c>all at once!
    recipe:
    - i@arrow|i@arrow|i@arrow
    - i@string|i@string|i@string
    - i@air|i@air|i@air

fast_arrow:
    type: item
    debug: false
    material: arrow
    display name: Faster Arrow
    lore:
    - <&c>This arrow moves
    - <&c>extra fast!
    recipe:
    - i@arrow|i@arrow|i@redstone
    - i@air|i@air|i@air
    - i@air|i@air|i@air

weak_arrow:
    type: item
    debug: false
    material: arrow
    display name: Weakened Arrow
    lore:
    - <&c>This arrow is
    - <&c>damaged.

bpg_bow:
    type: item
    debug: false
    material: bow
    display name: BPG Launcher
    lore:
    - <&c>Bow Propelled Grenade
    - <&c>Launcher.
    - <&c>(Requires BPG Arrows)
    recipe:
    - i@bow|i@tnt|i@tnt
    - i@diamond_block|i@tnt|i@tnt
    - i@iron_block|i@iron_block|i@iron_block

weak_bpg_arrow:
    type: item
    debug: false
    material: arrow
    display name: Weak BPG Arrow
    lore:
    - <&c>This arrow explodes
    - <&c>weakly on impact.
    - <&c>(Requires BPG Launcher)
    recipe:
    - i@arrow|i@tnt|i@air
    - i@air|i@air|i@air
    - i@air|i@air|i@air

strong_bpg_arrow:
    type: item
    debug: false
    material: arrow
    display name: Strong BPG Arrow
    lore:
    - <&c>This arrow explodes
    - <&c>strongly on impact.
    - <&c>(Requires BPG Launcher)
    recipe:
    - i@arrow|i@tnt|i@tnt
    - i@air|i@air|i@air
    - i@air|i@air|i@air

superior_bpg_arrow:
    type: item
    debug: false
    material: arrow
    display name: Superior BPG Arrow
    lore:
    - <&c>This arrow explodes for
    - <&c>massive damage on impact.
    - <&c>(Requires BPG Launcher)

mininuke_bpg_arrow:
    type: item
    debug: false
    material: arrow
    display name: Mininuke BPG Arrow
    lore:
    - <&c>This arrow explodes
    - <&c>with nuclear force on impact.
    - <&c>(Requires BPG Launcher)
    recipe:
    - i@tnt|i@arrow|i@tnt
    - i@tnt|i@tnt|i@tnt
    - i@air|i@air|i@air

firework_arrow_determine_type:
    type: task
    debug: false
    script:
    - if <entry[myitem].result.scriptname||null> == firework_arrow {
      - flag player arrowtype:firework
      }
      else if <entry[myitem].result.scriptname||null> == weak_bpg_arrow {
      - flag player arrowtype:weak_bpg
      }
      else if <entry[myitem].result.scriptname||null> == strong_bpg_arrow {
      - flag player arrowtype:strong_bpg
      }
      else if <entry[myitem].result.scriptname||null> == superior_bpg_arrow {
      - flag player arrowtype:superior_bpg
      }
      else if <entry[myitem].result.scriptname||null> == mininuke_bpg_arrow {
      - flag player arrowtype:mininuke_bpg
      }
      else {
      - narrate "<&c>You've loaded the wrong arrow type. Must load an explosive round!"
      - determine cancelled
      }
    - flag player arrows:|:<context.projectile.eid> duration:10s
    - flag player arrows:|:<context.projectile.eid> duration:10s

firework_arrow_world:
    type: world
    debug: false
    events:
        on player shoots bow:
        - flag player arrowtype:!
        - define item <player.inventory.slot[<player.inventory.find.material[arrow]>]>
        - adjust %item% quantity:1 save:myitem
        - if <context.bow.scriptname||null> == bpg_bow {
          - inject firework_arrow_determine_type
          }
        - if <entry[myitem].result.scriptname||null> == sharp_arrow {
          - flag player arrowtype:sharp
          - flag player arrows:|:<context.projectile.eid> duration:10s
          }
          else if <entry[myitem].result.scriptname||null> == weak_arrow {
          - flag player arrowtype:damaged
          - flag player arrows:|:<context.projectile.eid> duration:10s
          }
          else if <entry[myitem].result.scriptname||null> == fast_arrow {
          - shoot arrow[critical=true] o:<player> speed:<context.force.mul[1.5]>
          - take <entry[myitem].result> qty:1
          - playsound sound:shoot_arrow <player.location>
          - determine cancelled
          }
          else if <entry[myitem].result.scriptname||null> == shotblast_arrow {
          - shoot arrow|arrow|arrow o:<player> speed:<context.force> spread:20
          - take <entry[myitem].result> qty:1
          - playsound sound:shoot_arrow <player.location>
          - determine cancelled
          }
        on projectile hits block:
        - if <context.shooter||null> == null queue clear
        - if <context.shooter.is_player> {
        
          - if !<context.shooter.as_player.flag[arrows].contains[<context.projectile.eid>]||false> queue clear
          - run firework_arrow_handler_internal def:<context.projectile.location>|<context.projectile> player:<context.shooter>
          }
        on arrow damages entity:
        - if <context.damager.is_player> {
          - if !<context.damager.as_player.flag[arrows].contains[<context.projectile.eid>]||false> queue clear
          - if <context.damager.as_player.flag[arrowtype]> == sharp determine <context.damage.mul[2]>
          - if <context.damager.as_player.flag[arrowtype]> == damaged determine <context.damage.div[1.5]>
          - run firework_arrow_handler_internal def:<context.entity.location>|null player:<context.damager>
          }

firework_arrow_handler_internal:
    type: task
    debug: false
    speed: 2t
    script:
    - ^if <player.flag[arrowtype]> == firework {
      - define t1 <li@ball|creeper.random>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>
      - explode %1% power:2
      - spawn %1% firework[firework_item=i@firework[firework=true,false,%t1%,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>|0];velocity=0,0,0,<def[1].world.name>]
      - spawn %1% firework[firework_item=i@firework[firework=true,false,%t1%,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>|0];velocity=0,0,0,<def[1].world.name>] save:myfirework
      - if %2% != null remove %2%
      - wait 5t
      - adjust <entry[myfirework].spawned_entities> detonate
      }
      else if <player.flag[arrowtype]> == weak_bpg {
      - explode %1% power:1
      - if %2% != null remove %2%
      }
      else if <player.flag[arrowtype]> == strong_bpg {
      - if <def[1].world.name.ends_with[nether]> explode %1% power:1 fire breakblocks
      - explode %1% power:2
      - if %2% != null remove %2%
      }
      else if <player.flag[arrowtype]> == superior_bpg {
      - define t1 <li@ball|creeper.random>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>
      - explode %1% power:2 fire breakblocks
      - spawn %1% firework[firework_item=i@firework[firework=true,false,%t1%,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>|0];velocity=0,0,0,<def[1].world.name>]
      - spawn %1% firework[firework_item=i@firework[firework=true,false,%t1%,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>,<util.random.int[1].to[255]>|0];velocity=0,0,0,<def[1].world.name>] save:myfirework
      - if %2% != null remove %2%
      - wait 5t
      - adjust <entry[myfirework].spawned_entities> detonate
      }
      else if <player.flag[arrowtype]> == mininuke_bpg {
      - if <def[1].world.name.ends_with[nether]> explode %1% power:3 fire breakblocks
      - explode %1% power:5
      - run mininuke_bpg_shroomcloud def:%1%
      - if %2% != null remove %2%
      }

mininuke_bpg_shroomcloud:
    type: task
    speed: 1t
    definitions: center
    script:
    - ^playeffect %center% effect:huge_explosion visibility:100
    # draw the tall cloud
    - ^repeat 6 {
      - define center <def[center].add[0,2,0]>
      - ^playeffect effect:flame %center% offset:1 qty:50 visibility:100
      - ^playeffect effect:explode %center% offset:1 qty:15 visibility:100
      - ^playeffect effect:large_explode %center% visibility:100
      - playsound %center% enderdragon_growl pitch:0
      - wait 1t
      }
    # straight lines  x+    z+    y+    x-     y-     z-
    - ^define vecs li@1,0,0|0,0,1|0,1,0|-1,0,0|0,0,-1|0,-1,0
    # Angles   y=0        x- z-       x+ z+     x+ z-      x- z+
    - ^define vecs %vecs%|-0.7,0,-0.7|0.7,0,0.7|0.7,0,-0.7|-0.7,0,0.7
    # Raised lines: y+    x+        z+        x-         z-
    - ^define vecs %vecs%|0.7,0.7,0|0,0.7,0.7|-0.7,0.7,0|0,0.7,-0.7
    # draw the top shroom
    - ^repeat 8 {
      - ^define offset %value%
      - ^foreach %vecs% {
        - ^playeffect effect:explode <def[center].add[%value%].add[<util.random.int[-%offset%].to[%offset%]>,0,<util.random.int[-%offset%].to[%offset%]>]> offset:<def[offset].div[5]> qty:<def[offset].mul[10].as_int> visibility:100
        - ^playeffect effect:large_explode <def[center].add[%value%].add[<util.random.int[-%offset%].to[%offset%]>,0,<util.random.int[-%offset%].to[%offset%]>]> offset:<def[offset].div[5]> qty:%offset% visibility:100
        }
      - ^wait 3t
      }







View History