Date: 2015/07/28 18:08:53 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
rpg_arrow:
type: item
debug: false
material: arrow
display name: RPG AMMO
lore:
- <&a>Explodes on hit
- <&b>Youll love it!
- <&c>Requires RPG LAUNCHER
recipe:
- i@tnt|i@arrow|i@tnt
- i@air|i@air|i@air
- i@air|i@air|i@air
rpg_bow:
type: item
debug: false
material: bow
display name: RPG
lore:
- <&c>Shoots explosive rounds!
- <&b>Requiresrpg ammo!
recipe:
- i@air|i@bow|i@air
- i@air|i@tnt|i@air
- i@diamond|i@iron|i@gold
sharp_arrow:
type: item
debug: false
material: bow
display name: SHARP ARROW
lore:
- <&c>Sharper then any other arrow hehe
- <&B>Requires RPG LAUNCHER
recipe:
- i@air|i@air|i@air
- i@arrow|i@tnt|i@tnt
- i@air|i@air|i@air
rpg_arrow_dertmine_type:
type: task
debug: false
script:
- if <entry[myitem].result.scriptname||null> == rpg_arrow {
- flag player arrowtype:rpg
}
else if <entry[myitem].result.scriptname||null == sharp_arrow {
- flag player arrowtype:sharp
}
else {
- narrate "<&c>You've loaded the wrong arrow type. Must load explosive round!"
- determine cancelled
}
- flag player arrows:|:<context.projectile.eid> duration:10s
- flag player arrows:|:<context.projectile.eid> duration:10s
rpg_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> == rpg_bow {
- inject rpg_arrow_determine_type
}
- if <entry[myitem].result.scriptname||null> == rpg_arrow {
- flag arrowtype:rpg
- shoot arrow[arrow]arrow o:<player> speed:<context.force.mul[1.5]> spread:20
- take <entry[myitem].result> qty:1
- playsound sound:shoot_arrow <player.location>
- determine cancelled
}
else if <entry[myitem].result.scriptname||null> == sharp_arrow {
- flag player arrowtype:sharp
- flag player arrows:|:<context.projectile.eid> duration:10s
}
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>]> queue clear
- run rpg_handler_internal def:<context.projectile.location>|<context.projectile> as:<context.shooter>
}
on arrow damages entity:
- if <context.damager.is._player> {
- if !<context.damager.as_player.flag[arrows].contains[<context.projectile.eid>]> queue clear
- if <context.damager.as_player.flag[arrowtype]> == sharp determine <context.damage.mul[2]>
- run rpg_arrow_handler_internal def:<context.entity.location>|null as:<context.damager>
}
rpg_arrow_handler_internal:
type: task
debug: false
speed: 2t
script:
- ^if <player.flag[arrowtype]> == rpg {
- 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 %4% power:4
- spawn %1% rpg[rpg_item=i@rpg[rpg=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% rpg[rpg_item=i@rpg[rpg=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:myrpg
- if %2% != null remove %2%
- wait 5t
- adjust <entry[myfirework].spawned_entities> detonate
}
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
}