Date: 2015/07/01 08:04: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
BBender:
type: assignment
Interact Scripts:
- 1 NPC_Bender
NPC_Bender:
type: interact
actions:
on assignment:
- trigger name:damage state:true
steps:
1:
click trigger:
script:
- chat Hello, say what your bending type is and I will demonstrate my skills
chat trigger:
1:
trigger: /fire/
script:
- flag <npc> bender_type:fire
- define bender_type <npc.flag[bender_type]>
# ^^^
# Make sure you set this flag somewhere
#
- if %bender_type% == fire {
- define blocks li@m@netherrack|m@fire|m@lava
# ^^^
# Blocks to bend
} else if %bender_type% == water {
# etc - define blocks li@m@water|m@ice
} else if %bender_type% == earth {
# etc
} else if %bender_type% == air {
# etc
}
- define lift_blocks <npc.location.find.blocks[%blocks%].within[7]>
# ^^^
# set the range
- flag <npc> remaining_blocks:|:%lift_blocks%
- run s@BenderBlocks def:<npc>
BenderBlocks:
type: task
script:
- define npc <%1%.as_npc>
- if <%npc%.flag[remaining_blocks].as_list.size.as_int> > 0 {
- define location <%npc%.flag[remaining_blocks].as_list.random>
- define block <%location%.material.id>
- if %bender_type% == fire {
- modifyblock %location% m@water
}
- spawn e@falling_block,%block%[velocity=<%npc%.location.block.add[0,2,0]>] %location% save:%location%_block
- look <npc> <entry[%location%_block].spawned_entities.location> duration:1
- push <entry[%location%_block].spawned_entities> destination:<%npc%.location.block.add[0,2,0]> speed:0.1
- if %bender_type% == fire { - repeat 5 {
- animate <npc> SNEAK
- playeffect <entry[%location%_block].spawned_entities> FLAME
- playeffect <entry[%location%_block].spawned_entities> LAVA
- animate <npc> ARM_SWING
}
}
- flag %npc% remaining_blocks:<-:%location%
- wait d@1.5s
- run s@BenderBlocks def:%npc%
}