Date: 2014/07/05 08:31:47 UTC-07:00
Type: Denizen 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
firework_arrow:
type: item
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
fire_arrow:
type: item
material: arrow[quantity=15]
display name: "<&4>Flaming Arrow"
lore:
- <&a>Fire this arrow
recipe:
- i@arrow|i@arrow|i@air
- i@air|i@air|i@air
- i@air|i@air|i@arrow
sharp_arrow:
type: item
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
material: arrow
display name: Bundle Of Arrow
lore:
- <&c>Launches 3 arrows
- <&c>all at once!
recipe:
- i@air|i@air|i@air
- i@arrow|i@arrow|i@arrow
- i@string|i@string|i@string
fast_arrow:
type: item
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
material: arrow
display name: Weakened Arrow
lore:
- <&c>This arrow is
- <&c>damaged.
recipe:
- i@feather|i@stick|i@77
- i@air|i@air|i@air
- i@air|i@air|i@air
bpg_bow:
type: item
material: bow
display name: BPG Launcher
lore:
- <&c>Bow Propelled Grenade
- <&c>Launcher.
- <&c>(Requires BPG Arrows)
recipe:
- i@tnt|i@air|i@tnt
- i@air|i@bow|i@air
- i@tnt|i@air|i@tnt
weak_bpg_arrow:
type: item
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
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
material: arrow
display name: Superior BPG Arrow
lore:
- <&c>This arrow explodes for
- <&c>massive damage on impact.
- <&c>(Requires BPG Launcher)
recipe:
- i@air|i@tnt|i@air
- i@arrow|i@arrow|i@arrow
- i@air|i@tnt|i@air
#firework_arrow_determine_type:
# type: task
# script:
# - if <entry[myitem].result> == i@firework_arrow {
# - flag player arrowtype:firework
# }
# else if <entry[myitem].result> == i@weak_bpg_arrow {
# - flag player arrowtype:weak_bpg
# }
# else if <entry[myitem].result> == i@strong_bpg_arrow {
# - flag player arrowtype:strong_bpg
# }
# else if <entry[myitem].result> == i@superior_bpg_arrow {
# - flag player arrowtype:superior_bpg
# }
# else {
# - narrate "<&c>You've loaded the wrong arrow type. Must load an explosive round!"
# - determine cancelled
# }
firework_arrow_world:
type: world
debug: false
events:
on player shoots bow:
- define item <player.inventory.slot[<player.inventory.find.material[arrow]>]>
- adjust %item% quantity:1 save:myitem
# - if <context.bow> == i@bpg_bow {
# - inject firework_arrow_determine_type
# }
- if <entry[myitem].result> == i@sharp_arrow {
- flag player arrowtype:sharp
}
else if<entry[myitem].result> == i@firework_arrow {
- flag player arrowtype:firework
}
else if <entry[myitem].result> == i@weak_bpg_arrow {
- flag player arrowtype:weak_bpg
}
else if <entry[myitem].result> == i@strong_bpg_arrow {
- flag player arrowtype:strong_bpg
}
else if <entry[myitem].result> == i@superior_bpg_arrow {
- flag player arrowtype:superior_bpg
}
else if <entry[myitem].result> == i@weak_arrow {
- flag player arrowtype:damaged
}
else if <entry[myitem].result> == i@fast_arrow {
- flag player arrowtype:!
- 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> == i@shotblast_arrow {
- flag player arrowtype:!
- 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
}
else if <entry[myitem].result> == i@fire_arrow {
- flag player arrowtype:!
- shoot arrow|arrow|arrow|arrow|arrow|arrow|arrow| o:<player> speed:<context.force> spread:10
- take <entry[myitem].result> qty:1
- playsound sound:shoot_arrow <player.location>
- determine cancelled
}
on projectile hits block:
- if <context.shooter> matches player {
- run firework_arrow_handler_internal def:<context.projectile.location> as:<context.shooter>
- flag <context.shooter> arrowtype:!
}
- flag player arrowtype:!
on arrow damages entity:
- if <context.damager> matches player {
- 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> as:<context.damager>
- flag <context.damager> arrowtype:!
}
firework_arrow_handler_internal:
type: task
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
- wait 5t
- adjust <entry[myfirework].spawned_entities> detonate
}
else if <player.flag[arrowtype]> == weak_bpg {
- explode %1% power:1
- foreach <player.location.cursor_on.find.living_entities.within[5].exclude[<server.list_online_players>]> {
- hurt <el@val[5].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
else if <player.flag[arrowtype]> == strong_bpg {
- explode %1% power:2
- foreach <player.location.cursor_on.find.living_entities.within[5].exclude[<server.list_online_players>]> {
- hurt <el@val[10].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
else if <player.flag[arrowtype]> == superior_bpg {
- explode %1% power:3 fire
- foreach <player.location.cursor_on.find.living_entities.within[5].exclude[<server.list_online_players>]> {
- hurt <el@val[15].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}