#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><&f> <&co> <&a>" #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 , 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 save:greeter - ^adjust hide_entity: # Now to make the npc not be in the list of online players. - ^adjust ]> hide_entity: #now run the greeter_path and greeter_talk tasks - ^run greeter_path npc: def:<^npc> - ^run greeter_talk 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 startlocation: - ^narrate "Start location = " #just the stops on the tour - ^flag step:1 - ~walk auto_range - ^inject greeter_waits - ^flag step:2 - ~walk auto_range - ^inject greeter_waits - ^flag step:3 - ~walk auto_range - ^inject greeter_waits - wait 1 #Now we want the NPC to walk back to the start location # -wait 2 - ~walk auto_range - remove - adjust show_entity: - zap 1 script:greet_em #the greeter waits for player to catch up greeter_waits: type: task script: - ^while ].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 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 { - wait 4 } - narrate "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 { - wait 4 } - narrate "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 { - wait 4 } - narrate "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"