Date: 2014/07/08 21:45:08 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
Sam:
type: Assignment
actions:
on assignment:
- flag npc mobprox_range:20
- flag npc SamDamage
Events:
on <npc> damages entity:
- if <context.damager.flag[SamDamage]> == true {
- determine 100
}
interact scripts:
- 10 SamAI
SamAI:
type: Interact
steps:
1:
chat trigger:
1:
trigger: /Come/!
script:
- follow target:<player>
2:
trigger: /Stay/!
script:
- follow stop
3:
trigger: /Attack/!
script:
- define target <npc.location.find.living_entities.within[10].exclude[<n@1>|<npc.owner>|chicken|cow|sheep|pig].get[1]||false>
- attack <t[<def[target].is[!EQUALS].to[false]>]:target<&co>%target%||cancel>
4:
trigger: /Sit boy/!
script:
- Narrate "Sam has stopped guarding."
- attack stop