Date: 2014/02/10 12:09:22 UTC-08: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
# Testing out making a one use scroll to summon a wolf that will attack your target.
"wolfscroll":
type: item
material: 339
display name: <red> Scroll of Summon wolf
lore:
- This scroll can be used
- to Summon a wolf monster
- that will attack other
- nearby monsters.
# This links up with wolfscroll
"summon_wolf":
type: world
events:
on player right clicks entity with i@wolfscroll:
- run wolf_attack "def:<context.entity.location.x>:<context.entity.location.y>:<context.entity.location.z>:<context.entity.location.world.name>"
# this is the wolf actually coming into being and choosing a target based off the "def:"
"wolf_attack":
type: task
script:
- ^execute as_server "npc create wolf --type wolf --at %1%"
- execute as_server "npc assign --set wolf_assign"
- take i@wolfscroll qty:1
# here is the assignment that gets fired from the previous task and will start his death timer.
"wolf_assign":
type: assignment
actions:
on assignment:
- attack <npc> target:<npc.location.find.living_entities.within[10].exclude[<npc>].exclude[<player>].get[1]>
- run kill_wolf delay:10s
"wolf_damage":
type: world
events:
on npc damages entity:
- if <npc.script.replace[s@]> == wolf_assign determine <context.damage.mul[5]>
# this script will remove the wolf after 10 seconds if it has not been killed
"kill_wolf":
type: task
script:
- remove <npc>