NpcGuideAssignment:
type: assignment
interact scripts:
- 10 NpcGuideInteract
NpcGuideInteract:
type: interact
steps:
1:
click trigger:
script:
- chat "So you want a tour? Great"
- wait 2
- adjust <player> hide_entity:<npc>
- create player Guide <npc.location> save:p_guide
- run NpcGuideScript npc:<entry[p_guide].created_npc> def:<npc>
NpcGuideScript:
type: task
definitions: masternpc
script:
- define wpts '<yaml[npc].list_keys[npc.nguide.waypoints].alphanumeric>'
- foreach %wpts% {
- ~walk <npc> <yaml[npc].read[npc.nguide.waypoints.%value%.location]>
- - if <player.is_online.not> {
- - remove <npc>
- - wait 1t
- - queue clear
- }
- inject NpcGuideTryPause
- narrate <parse:<yaml[npc].read[npc.nguide.waypoints.%value%.message]>>
- wait <yaml[npc].read[npc.nguide.waypoints.%value%.delay]>
}
- remove <npc>
- adjust <player> show_entity:<def[masternpc]>
NpcGuideTryPause:
type: task
script:
- while <npc.location.distance[<player.location>].is[OR_MORE].than[5]||false> {
+ - if <player.is_online.not> {
+ - remove <npc>
+ - wait 1t
+ - queue clear
+ }
- narrate "Try to keep up!"
- wait 1
}