Date: 2015/07/26 19:31:07 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
rpg_arrow:
type: item
debug: false
material: arrow
display name: RPG Ammo
lore:
- <&a>Fire this
- <&b>If you like explosions
- <&c>(Requires RPG Launcher)
recipe:
- i@arrow|i@tnt|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 LAUNCHER
lore:
- <&c>Launches missles
- <&c>(Requires RPG ammo)
recipe:
- i@bow|i@tnt|i@tnt
- i@tnt|i@diamond_block|i@tnt
- i@air|i@air|i@air
rpg_arrow_determine_type:
type: task
debug: false
script:
- if <entry[myitem].result> == i@rpg_arrow {
- flag player arrowtype:rpg
}
else {
- narrate "<&c>You've loaded the wrong arrow type, most load an 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> == i@rpg_bow {
- inject rpg_arrow_determine_type
}
on projectile hits block:
- if <context.shooter||null> == null queue clear
- if <context.shooter> matches player {
- if !<context.shooter.as_player.flag[arrows].contains[<context.projectile.eid>]>
- run rpg_arrow_handler_internal def:<context.projectile.location>|<context.projectile> as:<context.shooter>
}
on arrow damages entity:
- if <context.damage> matches 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]>
- if <context.damager.as_player.flag[arrowtype]> == damaged determine <context.damager.div[1.5]>
- 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 %50% power:10
- spawn %1% rpg[rpg_item=i@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@firework[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[myrpg].spawned_entities> detonate
}