PDA

View Full Version : Tour Guide NPC


trevius
05-01-2009, 04:28 PM
This is an example of a city tour guide I made for the new custom Crescent Reach zone I am working on.

Basically, you just create a few grids and edit this quest with your new grid numbers. Then, you would also want to adjust the waypoints so that he announces when he is done.

#Crescent City Tour Guide

#Store which route the guide is on
$route = undef;

#Store if he is in route or not
$in_route = 0;

sub EVENT_SPAWN {

quest::start(118);
$in_route = 0;

}

sub EVENT_SAY {

if ($text && $in_route == 1)
{
quest::say("Sorry, $name, but I can only take requests when I am at my home point.");
}


if ($text=~/Hail/i && $in_route == 0)
{
quest::say("Hello, $name. I am the tour guide for this part of the city. Would you like me to [show] you around?");
}

if ($text=~/show/i && $in_route == 0)
{
quest::say("I can take you to the Class [Trainers] Section, Beginner [Merchant], Augment Distiller [Pool], or the [Forge] Area. Please make your selection.");
}

if ($text=~/Trainers/i && $in_route == 0)
{
quest::say("To the Class Trainers Section it is. Please follow me.");
$route = "Trainers";
$in_route = 1;
quest::start(118);
}

if ($text=~/Merchant/i && $in_route == 0)
{
quest::say("To the Beginner Merchant it is. Please follow me.");
$route = "Merchant";
$in_route = 1;
quest::start(119);
}

if ($text=~/Pool/i && $in_route == 0)
{
quest::say("To the Augment Distiller Pool it is. Please follow me.");
$route = "Pool";
$in_route = 1;
quest::start(120);
}

if ($text=~/Forge/i && $in_route == 0)
{
quest::say("To the Forge Area it is. Please follow me.");
$route = "Forge";
$in_route = 1;
quest::start(121);
}

}

sub EVENT_WAYPOINT {



if ($wp == 0)
{
quest::stop();
$in_route = 0;
}

if ($wp == 11 && $route eq "Trainers")
{
quest::say("Destination Class Trainers Section completed. Returning home now.");
}

if ($wp == 3 && $route eq "Merchant")
{
quest::say("Destination Beginner Merchant completed. Returning home now.");
}

if ($wp == 8 && $route eq "Pool")
{
quest::say("Destination Augment Distiller Pool completed. Distiller Merchant nearby as well. Returning home now.");
}

if ($wp == 5 && $route eq "Forge")
{
quest::say("Destination Forge Area completed. Returning home now.");
}

}

When creating the grids, you will want to use this grid setting:

#grid add XXX 3 1

Then, I always do a #goto, so I am on top of the mob for the first waypoint.

Then, simply do something like:

#wp add XXX 1

Note: You no longer need to set the WP number. It will start at 0 and increment from there. This saves time because you can just repeat the same unmodified command over and over. The only thing you might change is the pause time at the end.

Also, a hint for creating a tour guide is to create their first WP, facing the direction you want them to face. Then, step back 1 or 2 steps and create the second WP with a pause delay of 0 seconds. Then, continue to where ever you were wanting them to go to. The reason I say to step back like that is so when he returns to his home location, he will be facing the right direction you want him facing.

Bristlebane[nj]
05-17-2009, 11:52 AM
Really really nice Trevius!

Would of used if I still had my server :P

Lillu
05-20-2009, 04:55 AM
This is great idea Trev, thank you for sharing it. I'm gonna give it a shot in my custom starting city. :)

trevius
05-20-2009, 07:52 PM
Thanks, glad you 2 liked it :)

Also, if anyone has Secrets of Faydwer and would like to see this in action, feel free to log into Storm Haven and create a new character and you will start in Crescent Reach. I have a few other interesting scripts going on in there that I might share at some point as well. I think the temporary mounts I have right by where you start at is a pretty fun little feature.