Date: 2014/07/19 19:38:28 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
copper_bullet:
type: item
material: arrow[quantity=8]
display name: "<&f>Copper Bullets"
recipe:
- i@air|i@air|i@air
- i@air|i@336|i@336|
- i@air|i@air|i@air
bronze_bullet:
type: item
material: arrow[quantity=8]
display name: "<&2>Bronze Bullets"
lore:
- <&e>Requires level X
recipe:
- i@air|i@air|i@air
- i@air|i@266|i@266|
- i@air|i@air|i@air
iron_bullet:
type: item
material: arrow[quantity=8]
display name: "<&3>Iron Bullets"
lore:
- <&e>Requires level X
recipe:
- i@air|i@air|i@air
- i@air|i@265|i@265
- i@air|i@air|i@air
mithril_bullet:
type: item
material: arrow[quantity=8]
display name: "<&d>Mithril Bullets"
lore:
- <&e>Requires level X
recipe:
- i@air|i@air|i@air
- i@air|i@351:4|i@351:4
- i@air|i@air|i@air
titanium_bullet:
type: item
material: arrow[quantity=8]
display name: "<&6>Titanium Bullets"
lore:
- <&e>Requires level X
recipe:
- i@air|i@air|i@air
- i@air|i@264|i@264
- i@air|i@air|i@air
flameI_bullet:
type: item
material: arrow[quantity=8]
display name: "<&4>Ruby Bullets"
lore:
- <&e>Requires level X
- <&e>careful where you aim.
recipe:
- i@air|i@air|i@air
- i@262|i@262|i@331
- i@air|i@air|i@air
repeating_arrow:
type: item
material: arrow
display name: "<&9>Repeating Arrow"
lore:
- <&a>careful where you aim.
recipe:
- i@air|i@air|i@arrow
- i@arrow|i@arrow|i@arrow
- i@air|i@air|i@arrow
Player_Shoots_Gun:
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 <entry[myitem].result> == i@copper_bullet {
- flag player arrowtype:copper_bullet
- shoot snowball| o:<player> gravity:0 speed:4 spread:0
- take <entry[myitem].result> qty:1
- playsound sound:explode <player.location> volume:1.0 pitch:1.5
- determine cancelled
}
else if <entry[myitem].result> == i@repeating_arrow {
- flag player arrowtype:repeating_arrow
- shoot snowball o:<player> gravity:0 speed:4 spread:0
- take <entry[myitem].result> qty:0
- playsound sound:explode <player.location> volume:1.0 pitch:1.5
- determine cancelled
}
on snowball damages entity:
- if <context.damager> matches player {
- if <context.damager.as_player.flag[arrowtype]> == copper_bullet {
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<1>].to[<5>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
- if <context.damager.as_player.flag[arrowtype]> == bronze_bullet {
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<3>].to[<7>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
- if <context.damager.as_player.flag[arrowtype]> == iron_bullet {
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<5>].to[<10>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
- if <context.damager.as_player.flag[arrowtype]> == mithril_bullet {
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<8>].to[<12>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
- if <context.damager.as_player.flag[arrowtype]> == titanium_bullet {
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<12>].to[<25>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
- if <context.damager.as_player.flag[arrowtype]> == repeating_arrow {
- cast slow duration:4s power:3 <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]>
- playeffect def:<context.entity.location> flame visibility:100 qty:30 offset:2
- explode %1% power:1
- foreach <context.entity.location.find.living_entities.within[1].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<1>].to[<5>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
}
- if <context.damager.as_player.flag[arrowtype]> == copper_arrow_renamethis {
- cast slow duration:4s power:3 <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]>
- playeffect def:<context.entity.location> Lava visibility:100 qty:50 offset:2
- foreach <context.entity.location.find.living_entities.within[1].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<1>].to[<5>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
- random 6
- run tnt_handler_internal
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:0.5
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:1
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:1.5
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:2
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:2.5
}
- if <context.damager.as_player.flag[arrowtype]> == iunno2 {
- cast slow duration:4s power:3 <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]>
- playeffect def:<context.entity.location> Random visibility:100 qty:300 offset:1
- playeffect def:<context.entity.location> Random visibility:100 qty:300 offset:2
- playeffect def:<context.entity.location> Random visibility:100 qty:300 offset:4
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<1>].to[<5>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
- random 6
- run Potion_handler_internal
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:0.5
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:1
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:1.5
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:2
- playsound def:<context.entity.location> sound:explode volume:1.0 pitch:2.5
}
- flag <context.damager> arrowtype:!
}
tnt_handler_internal:
type: task
speed: 2t
script:
- playeffect def:<context.entity.location> ANGRY_VILLAGER visibility:100 qty:5 offset:2
- playeffect def:<context.entity.location> Large_Explode visibility:100 qty:10 offset:2
- foreach <context.entity.location.find.living_entities.within[0].exclude[<server.list_online_players>]> {
- hurt <el@val[<util.random.int[<10>].to[<20>]>].sub[<%value%.location.distance[<context.location>]>]> %value%
}
Potion_handler_internal:
type: task
speed: 2t
script:
- cast ABSORPTION duration:4s power:3
- playsound <player> LEVEL_UP
- playeffect ENDER_SIGNAL visibility:100 qty:2 offset:2