Date: 2015/11/28 12:17:12 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
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
#this script was originally posted as a video by mcmonkey at
# http://mcmonkey.org/denizen/vids/Putting%20It%20Together:%20NPC%20Guides
#my only real addition to the script was the guide now walks back to the
#start position instead of just disappearing.
#format chat for the NPC
cchat:
type: format
format: "<&b><npc.name><&f> <&co> <&a><text>"
#my npc greeter, no need to be 65 or work at walmart.
greeter:
type: assignment
actions:
on assignment:
- trigger name:click state:true
- trigger name:chat state:true
interact scripts:
- 10 greet_em
#now the actual scripts
greet_em:
type: interact
steps:
1:
click trigger:
script:
- narrate format:cchat "Hello I am <npc.name>, would you care for a tour?"
- narrate "Type /yes/ or /no/"
chat trigger:
1:
trigger: /Yes/ sure
script:
- narrate format:cchat "Ok then follow me"
#creater an NPC named greeter and saves it for later use in the script.
- ^create player NPCGreeter <npc.location> save:greeter
- ^adjust <player> hide_entity:<npc>
# Now to make the npc not be in the list of online players.
- ^adjust <server.list.online_players.exclude[<player>]> hide_entity:<entry[greeter].created_npc>
#now run the greeter_path and greeter_talk tasks
- ^run greeter_path npc:<entry[greeter].created_npc> def:<^npc>
- ^run greeter_talk npc:<entry[greeter].created_npc>
- zap 2
2:
trigger: /No/ thanks
script:
- narrate format:cchat "Ok then enjoy your time here"
#now taks scrips for path
greeter_path:
type: task
definitions: masternpc
script:
#ok i need to remember the start location of the npc so we can walk there at the end
#hide_entity is a mechanism
- ^flag <npc> startlocation:<npc.location>
- ^narrate "Start location = <npc.flag[startlocation]>"
#just the stops on the tour
- ^flag <npc> step:1
- ~walk <def[masternpc].anchor[tourstop1]> auto_range
- ^inject greeter_waits
- ^flag <npc> step:2
- ~walk <def[masternpc].anchor[tourstop2]> auto_range
- ^inject greeter_waits
- ^flag <npc> step:3
- ~walk <def[masternpc].anchor[tourstop3]> auto_range
- ^inject greeter_waits
- wait 1
#Now we want the NPC to walk back to the start location
# -wait 2
- ~walk <npc.flag[startlocation]> auto_range
- remove <npc>
- adjust <player> show_entity:<def[masternpc]>
- zap 1 script:greet_em
#the greeter waits for player to catch up
greeter_waits:
type: task
script:
- ^while <npc.location.distance[<player.location>].is[OR_MORE].than[5]> {
- narrate format:cchat "Come along, please try and keep up"
- wait 1
}
#now the taks script for talking points on the path
#is still some errors and timing definately sucks
#as to the location and speech.
#also the - while <npc.flag[step].is[OR_LESS].than[3]> causes some problems
#script tailings are left in the denizens save file it always leaves
#the step as 1
# current spot is saves as 1 - suspect it
#is related to the while statements?
greeter_talk:
type: task
script:
- narrate format:cchat "We are glad you joined the Chapel Perilous"
- narrate format:cchat "A modded survival server"
- wait 5
- while <npc.flag[step].is[OR_LESS].than[1]> {
- wait 4
}
- narrate "step= <npc.flag[step]>"
- narrate format:cchat "Here we have the Erisian Temple of Dealey Plaza"
- narrate format:cchat "Here you can get promoted as well as get"
- narrate format:cchat "healing from the High Priest Hagbard Celine"
- while <npc.flag[step].is[OR_LESS].than[2]> {
- wait 4
}
- narrate "step= <npc.flag[step]>"
- narrate format:cchat "Here we have the JFK Inn of Dealey Plaza"
- narrate format:cchat "The inn keeper is DealyLlama the Mayor of Dealey Plaza"
- narrate format:cchat "Room rentals are for 30 days right click a sign to rent a room"
- while <npc.flag[step].is[OR_LESS].than[3]> {
- wait 4
}
- narrate "step= <npc.flag[step]>"
- narrate format:cchat "Here we have the DealeyLlama's Deal o'Rama"
- narrate format:cchat "you can buy or sell items here"
- narrate format:cchat "left click checks. right click does the deal"
- narrate format:cchat "That ends the tour"