Date: 2014/07/02 19:28:15 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
'Bomable Arrow':
type: item
material: arrow
display name: Bombable Arrow
recipe:
- i@air|i@77|i@air
- i@air|i@46|i@air
- i@air|i@262|i@air
bound: true
lore:
- Explosive
'Emerald Arrow':
type: item
material: arrow
display name: Emerald Arrow
recipe:
- i@air|i@77|i@air
- i@air|i@388|i@air
- i@air|i@262|i@air
bound: true
lore:
- Strong
Firework Arrow:
type: item
material: arrow
display name: Firework Arrow
recipe:
- i@air|i@77|i@air
- i@air|i@401|i@air
- i@air|i@262|i@air
lore:
- <&a>Fire this arrow
- <&b>for magic funtime
- <&c>surprise!
'Arrow Power':
type: world
events:
on entity shoots bow:
- define consumed_arrow <player.inventory.slot[<player.inventory.find.material[arrow]>]>
- if %consumed_arrow% == i@Bomable Arrow {
- flag server <context.projectile>:bomablearrow duration:30s
}
else if %consumed_arrow% == i@Emerald Arrow {
- flag server <context.projectile>:Emerald Arrow duration:30s
}
else if %consumed_arrow% == i@Firework Arrow {
- flag server <context.projectile>:Firework Arrow duration:30s
}
on projectile hits block:
- define consumed_arrow <server.flag[<context.projectile>]||none>
- if %consumed_arrow% == Bomable Arrow {
- explode power:4 <context.location>
- foreach <player.location.cursor_on.find.living_entities.within[5].exclude[<server.list_online_players>]>
- hurt <el@val[20].sub[<%value%.location.distance[<context.location>]>]> %value%
}
else if %consumed_arrow% == 'Emerald Arrow' {
- foreach <player.location.cursor_on.find.living_entities.within[1].exclude[<server.list_online_players>]>
- hurt <el@val[20].sub[<%value%.location.distance[<context.location>]>]> %value%
}
else if %consumed_arrow% == 'Firework Arrow' {
- foreach <player.location.cursor_on.find.living_entities.within[10].exclude[<server.list_online_players>]>
- run firework_arrow_handler_internal def:<context.entity.location> as:<context.damager>
- hurt <el@val[20].sub[<%value%.location.distance[<context.location>]>]> %value%
}
firework_arrow_handler_internal:
type: task
debug: false
speed: 2t
script:
- if <player.flag[firework_arrow]> {
- flag player firework_arrow:!
- 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 breakblocks fire
- 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
}