/*

filename    newbie
password    release
changedby   Darg
EmailAdd    Mark Pringle darg@valhalla.com
request     compile
version     42
END HEADER*/




#include

#define NEWBIE_ONGOING  "Newbie Quest Ongoing"
#define NEWBIE_COMPLETE "Newbie Quest Complete"

%zone newbie

lifespan 10
reset RESET_ANYHOW
creators {"whistler","palio","icculus","papi"}

notes
"This is the newbie guide that will guide newbies around the Udgaard area
and surrounding zones. &l

&fThe orignal idea and code for this came from Icculus (Andrew Cowan)
and has gone through many generations of dil and upgrades.  Papi (Sceifert)
first seperated the newbie guide into functions once functions were introduced.
Whistler (Ken Perry) cleaned up the newbie guides logic and made it possible
to have multiplenewbie guides in the game at once, he also added the protection
from spells using the new SFB_PRE.  Palio (Kathy Perry)  fixed up the acts and
continues to work on the acts as rules and laws of Valhalla changes.  This is
an on going project and if you make major changes and want them distributed
feel free to send a copy of your newbie guide to:&l

whistler@valhalla.com"

%dil

/*
This function asks the pc if he/she has time to continue the quest.
*/
dilbegin integer stop_test (pc:unitptr,i:integer);
code
{
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc #= null)
     goto stop;
  secure(pc, lost_pc);

on i goto zero,one,two,three,four;
:zero:
:one:
act ("$1n says 'You have now finished the first phase of your training.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
goto there;
:two:
act ("$1n says 'You have now finished the second phase of your training.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
goto there;
:three:
act ("$1n says 'You have now finished the third phase of your training.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
goto there;
:four:
act ("$1n says 'You have now finished the fourth phase of your training.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;

:there:
act ("$1n says 'If you don't have time to continue we can stop now and continue later.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
:again:
act ("$1n says 'Just 'nod' if you want to continue or ''shake' otherwise''",
A_ALWAYS,self,null,pc,TO_VICT);

wait (SFB_DONE,TRUE);
if (cmdstr=="nod")
 {
 act ("$1n says 'Very well lets continue.'",
A_ALWAYS,self,null,pc,TO_VICT);
 pause;
  return (TRUE);
  }
else if (cmdstr=="shake")
 {
 :lost_pc:
 act ("$1n says 'Very well then I will go help other newbies.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says ' if you ever need me just say 'help me Newbie Guide''",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
 exec ("wave",self);
 pause;
 :stop:

return (FALSE);
}
else goto again;
}
dilend

/*
This functions stops spells from damaging the pour helpless newbie guide
*/
dilbegin newbie_nospl ();
var
 pc:unitptr;
code
{

:start:
wait (SFB_PRE, ((command("cast")) and
(self== target)));
pc:=activator;
secure (pc,start);
power:=-1;
block;
pause;

act ("$1n glows brightly.",
A_ALWAYS,self,null,pc,TO_ALL);
act ("$1n's Newbie magic protects him and you are thrown to the ground stunned.",
A_ALWAYS,self,null,pc,TO_VICT);
act ("$1n's Newbie magic protects him and $3n is thrown to the ground stunned.",
A_ALWAYS,self,null,pc,TO_NOTVICT);
pc.position:=POSITION_STUNNED;
self.position:=POSITION_STANDING;
pc.hp:=0;
unsecure (pc);
goto start;

}
dilend




/*
This dil protects our pour newbie guide from other types of damage.
*/
dilbegin newbie_nokill ();
var
code
{

:start:
wait (SFB_PRE, command (CMD_AUTO_DAMAGE) and
(self==target));
power:=0;
block;

act ("Magic Newbie guardians knock you unconcious.",
A_ALWAYS,self,null,activator,TO_VICT);
activator.position:=POSITION_STUNNED;
self.position:=POSITION_STANDING;
activator.hp:=0;
goto start;
}
dilend




/* newbie guide tour part one basic commands*/
dilbegin integer newbie_part1(pc : unitptr);
var
  i : integer;
  u:unitptr;
  h:integer;
  s:string;
  qst:extraptr;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc #= null)
     goto stop;
  secure(pc, stop);

  :quest_accepted:
act ("$1n says 'Ok now, here we are, this is our Newbie Guide Chat room," +
" just perfect for this little talk.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  goto stage1;

  :no_quest:
  pause;
  exec("tell "+pc.name+" I wish thee well then, make use of the help "+
"files frequently as they will be your only source of " +
"information.",self);
  pause;
  exec("tell "+pc.name+" If you wish to get my help later, just go "+
       "to the temple and "+
"say 'help me newbie guide'. You must do this before reaching "+
"level six!", self);
  pause;
  goto stop;

  :stage1:
  pause;
act ("$1n says 'If we get separated during the course " +
"of your training one of two things may accur.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'If another newbie logs in before we can find each " +
"other again I will most likely be helping them.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'If I am not you can just say help me newbie guide and I will "+
  "find you and bring you back to Udgaard to finish your training.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'If I am busy, one of the other many newbie guides will come "+
"and help you.",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'Now, it would probably be best if you turned off " +
"your shout and tell.'",
 A_ALWAYS, self,null,pc,TO_VICT);
act ("$1n says 'Otherwise it may be hard to follow what I say " +
"during the course of training.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'To do this, type 'change shout' and 'change tell'. Please" +
"do this now.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says you can toggle many different things with the change command."+
       "When we are finished our tour you can type change to see them all'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'Remember to turn them back on again after training " +
"by typing each command again.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'The first thing I will talk about are basic mud commands.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'If you have played other muds, you can skip this part by saying "+
"'go on' and I will move on to more Valhalla specific topics.'",
 A_ALWAYS, self,null,pc,TO_VICT);
h:=interrupt (SFB_DONE, command ("say") and
(pc==activator) and
(argument =="go on"), hurry);
pause;
act ("$1n says 'Before we start I would like to mention that most commands "+
       " can me abbreviated. For example 'l' will work for 'look' and "+
       "'inv' will work for 'inventory''",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'You must first learn the 'look' command - try to type: "+
"'look' (do not type the ' around look).'",
 A_ALWAYS, self,null,pc,TO_VICT);
  i := TRUE;
  while (i)
  {
     wait(SFB_DONE | SFB_TICK, activator == pc);
     if (not command("look"))
     {
act ("$1n says 'You must type 'look' before we can go on.'",
 A_ALWAYS, self,null,pc,TO_VICT);
     }
     else
i := FALSE;
  }
act ("$1n says 'Very good! What you see is the description of the location "+
"in which we are standing as well as any objects and/or "+
"people that are here.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'If you would like to see a list of the people that are currently "+
"playing Valhalla you may do so with the 'who' command.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'The 'who' command will show you all the players visible to "+
        "you that are currently playing.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'Please type 'who' now.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  wait(SFB_CMD | SFB_TICK, command("who") and (activator == pc));
  pause;
act ("$1n says 'Great.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'You may notice that some people on the who list have "+
       "(GOD) after their names. These are the people that help "+
        "run the game.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'If you have a 'game' related question you can talk to "+
       "any god on line and ask for help. Remember however that "+
       "immortals are not allowed to interfere with game play.'",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'You can also get a list of gods and emails by typing "+
       "'wizlist''",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'Next I would like to talk to you about communicating. "+
"The say command will allow you to speak to others in the same "+
"room as you. Try this now. type: 'say hello''",
 A_ALWAYS, self,null,pc,TO_VICT);
  wait(SFB_DONE | SFB_TICK, command("say") and (activator == pc));
 pause;
act ("$1n says 'Very good.'",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'There may be times when you want to communicate with someone "+
       "that is not in the same room as you. Or you wish to communicate "+
       "privately with someone. This can be done with the 'tell' command.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'You use tell command like this 'tell '. Try "+
       "this now, type: 'tell newbie guide hello''",
 A_ALWAYS, self,null,pc,TO_VICT);
  wait(SFB_DONE | SFB_TICK, command("tell")
and (activator == pc) and
(target== self));
  pause;
act ("$1n says 'Perfect.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'You are bound to come across a time you would like to speak "+
"to everyone in the game. This can be done with the 'shout' "+
       "command. It works the same as the say command but everyone will "+
        "hear you.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'I would like to remind you that this is a family game and there "+
    "are often young children playing so you are expected to keep your "+
    "language on the shout channel clean.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'One last form of communication we have on Valhalla is channels.'",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'You can create as many or as few channels as you like. Type "+
       "'comm help' to get information on how to do this.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'For now however it would be a good idea to add the newbie "+
      "comm channel in case you need ever need help.'",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'To do this type 'comm add newbie' do this now please.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
pause;
act ("$1n says 'There will be questions you have that I do not cover in the "+
       "course of our chat. You can usually find helps for such times in "+
       "our help files.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'To get a listing of help topics you simply type 'help help'.  "+
       "Do this now please.'",
 A_ALWAYS, self,null,pc,TO_VICT);

  wait(SFB_CMD | SFB_TICK, command("help") and ("help" in argument));
  pause;
  pause;
act ("$1n says 'Very good. Now we will now discuss manipulation of objects.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
  u := load("silverring@midgaard");
  u.height := pc.height;
  exec("give "+u.name+" to "+pc.name, self);
  pause;
act ("$1n says 'I just gave you a silver ring, to see the ring you must check "+
       " your 'inventory'. You can do this by typing the word 'inventory', "+
"please try this now.'",
 A_ALWAYS, self,null,pc,TO_VICT);

  wait(SFB_CMD | SFB_TICK, command("inventory") and (activator == pc));
  pause;
act ("$1n says 'Good! Notice that the ring I just gave you is listed "+
"in your inventory.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
  pause;
act ("$1n says 'Now, please wear the ring on your finger by typing 'wear ring'.'",
 A_ALWAYS, self,null,pc,TO_VICT);

  wait(SFB_DONE | SFB_TICK, command("wear") and (activator == pc) and
  ((medium.nameidx+"@"+medium.zoneidx)=="silverring@midgaard"));
  pause;
  pause;
act ("$1n says 'The ring you just wore is no longer in your 'inventory', "+
"because you are wearing it. To see the things you are wearing, use "+
"the 'equipment' command, try this now.'",
 A_ALWAYS, self,null,pc,TO_VICT);

  wait(SFB_CMD | SFB_TICK, command("equipment") and (activator == pc));
  pause;
act ("$1n says 'To remove the things you are wearing, you can use the "+
"'remove' command, for example 'remove ring'.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'Now onto movement.'",
 A_ALWAYS, self,null,pc,TO_VICT);
  pause;
act ("$1n says 'In order to move around the game you must first know "+
       "which direction you can go.'",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'You can type 'exits' or you can type 'direction'. Give this  "+
       "a try now. type 'exits''",
 A_ALWAYS, self,null,pc,TO_VICT);
  wait(SFB_CMD | SFB_TICK, command("exit") and (activator == pc));

  pause;
act ("$1n says 'What you see is the obvious directions you can leave in. "+
"There are six directions, 'north', 'east', 'south', 'west', 'up' "+
"and 'down''",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'To move in a specific direction you simple type the direction. "+
     "You can also use just the first letter of the direction. Most find "+
     "this to be easiest.'",
 A_ALWAYS, self,null,pc,TO_VICT);
 pause;
act ("$1n says 'One last command I would like to tell you about before we move "+
      "on  is 'commands'. This will give you a list of every command in "+
       "the game.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
qst:=NEWBIE_ONGOING in pc.quests;
qst.descr:="part 1 done";
return (TRUE);
:hurry:
pause;
act ("$1n says 'Ah!  So your some what familiar with muds.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'Then all I will tell you in this phase of training is to get a "+
"list of commands on this mud just type 'commands''",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'Being the expert you are you know that you can get info on each "+
"command by typing 'help '.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'It would be a good idea to add the newbie "+
      "comm channel in case you ever need help.'",
 A_ALWAYS, self,null,pc,TO_VICT);
pause;
act ("$1n says 'To do this type 'comm add newbie'.'",
 A_ALWAYS, self,null,pc,TO_VICT);

  addextra (pc.quests,{NEWBIE_ONGOING},"");

qst:=NEWBIE_ONGOING in pc.quests;
qst.descr:="part 1 done";
  return (TRUE);
  :stop:
  return (FALSE);
}
dilend


/* newbie guide part 2 law system and rules
You might want to update this to your systems laws and rules.
*/
dilbegin integer newbie_part2(pc : unitptr);
var
  i : integer;
  qst:extraptr;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc #= null)
     goto stop;
  secure(pc, stop);
pause;
act ("$1n says 'Now lets talk about some more important matters.'",
A_ALWAYS,self,null,pc,TO_VICT);
  :next1:
  pause;
  pause;
  act ("$1n says 'When something is wrong and the game does something that "+
       "it should not, it's called a 'bug'.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Sometimes bugs hinder play, other times  they benefit play.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'For this reason we insist that every player " +
"use the bug command (syntax: bug )" +
" to report all bugs.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'We will take appropriate action if a player is found " +
"to have been taking advantage of bugs.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now we must discuss our rules of multi-playing.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Valhalla allows a max of 2 characters owned by the same "+
       "player on line at the same time. If you are caught with more "+
       "on you will be asked to log the extras off.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Also I would like to mention that you must be in full control "+
       "of your characters at all time. We do not allow scripts to run "+
       "players.'",
A_ALWAYS,self,null,pc,TO_VICT);
  exec("emote glances at the rule book to refresh his memory.",self);
  pause;
  act ("$1n says 'Player killing is another area that may concern you.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'We have an arena, a special area for players wishing to kill "+
       "each other without suffering the usual consequences of death.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'As a newbie you will not be able to choose to PK till you have "+
  "reached level 05. Before you get to level 50 you should take "+
  "time to read 'help bob' and 'help pk''",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now, hard as it is to believe, some people actually " +
"find they must leave the game for real life occasionaly.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'To do this you use the 'quit' command. You may quit in any "+
      "room in the game. But remember if you quit in a dangerous area you "+
      "may find yourself in trouble when you log back into the game.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'One important thing you need to know about quitting is that "+
"while you are gone, you are charged 'rent' for storing your items.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'The system will tell you how much rent you will be charged "+
"whenever you type 'save' (which you should get in the " +
"habit of doing frequently).'",
A_ALWAYS,self,null,pc,TO_VICT);
  act ("$1n says 'You can also use the 'rent' command to get an " +
"item by item readout of your renting fee. I suggest " +
"using this anytime you find something new that you would " +
"like to keep.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Before you leave the game make sure you have enough money ON "+
       "YOU to pay your rent or your items will be taken from you.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'rent will NOT be taken from money you have in the bank.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'next we will move onto our tour of Udgaard.'",
A_ALWAYS,self,null,pc,TO_VICT);
qst:=NEWBIE_ONGOING in pc.quests;
qst.descr:="part 2 done";
  return (TRUE);

  :stop:
  return (FALSE);
}
dilend


/* newbie guide tour part 3 Udgaard tour */
dilbegin integer newbie_part3(pc : unitptr);
var
       i       :       integer;
       npc:unitptr;
  qst:extraptr;
code
{
:init:
heartbeat := PULSE_SEC*6;
on_activation(self.position <= POSITION_SLEEPING, skip);

:start:
if (pc == null)
 goto stop;
secure(pc, stop);
pc.endurance:=pc.max_endurance;
self.endurance:=self.max_endurance;
act ("$1n says 'We can tour Udgaard now...'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;
  if (not(pc.position == POSITION_STANDING))
  {
     act ("$1n says 'Please stand up now so we may begin.'",
A_ALWAYS , self, null , pc ,TO_VICT);
     :try_again:
     wait(SFB_CMD, activator #= pc);
     if (not command("stand"))
     {
 pause;
 act ("$1n says 'Please STAND up.'",
A_ALWAYS , self, null , pc ,TO_VICT);
 goto try_again;
     }
  }
  pause;
  exec("stand", self);
  :rdy_fol:
  act ("$1n says 'Now for our tour it is important that you don't get lost.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'So you must follow me...'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  if (not(pc.master.name $= self.name))
 {
 act ("$1n says 'Please type 'fol newbie guide' now.'",
A_ALWAYS , self, null , pc ,TO_VICT);
 :try_again2:
 wait (SFB_DONE, activator==pc);
 if (not(command  ("follow")) or
   (target!=self))
   {
   act ("$1n says 'Please follow me now by typing 'fol newbie" +
     " guide' now.'",
A_ALWAYS , self, null , pc ,TO_VICT);
   goto try_again2;
   }
 }
pause;
  act ("$1n says 'We will visit some important parts of Udgaard now.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'You can always bring up a map of Udgaard by typing 'help'" +
"in the city.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'There is a great little food store just down this street to " + "the west. Lets check it out...'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
npc:=findsymbolic ("rosanne@udgaard");
if (npc==null)
 {
 npc:=load ("rosanne@udgaard");
 link (npc,findroom ("food_store@udgaard"));  }
if (npc.outside!=findroom ("food_store@udgaard"))  link (npc,findroom ("food_store@udgaard"));npc.position:=POSITION_STANDING;
  walkto(findroom("udgaard/food_store"));   act ("$1n says 'Rosanne makes some delicious bread and pastries! " +
"Type help list if you want to see what food you can buy here.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  exec ("emote buys a loaf of bread.",self);
 link (load ("bread@midgaard"), self);
  pause;
  exec("give bread to "+pc.name, self);
  exec("give bread to "+pc.name, self);
  pause;
  act ("$1n says 'Eat that when you get hungry later.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'Let's  visit the Chicken's Rest next, there is a " +
"bulletin board there with the latest news and such.'",

A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  walkto(findroom("udgaard/inn"));
  pause;
  act ("$1n says 'Here we are. It's a good idea to check the board here on a "+
"regular basis. It will contain game updates and bugs as well "+
        "as many other topics you will need to know about.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'There is another board just through the door here but you can  "+
       "check that out later yourself. Its for player chit chat.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  act ("$1n says 'To get instruction on how to use a board simply "+
"look at the board.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'The post office is just a short ways off and that is a place "+
         "you will defiantly want to go.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
npc:=findsymbolic ("hansen@udgaard");
if (npc==null)
 {
 npc:=load ("hansen@udgaard");
 link (npc,findroom ("postoffice@udgaard"));
 }
if (npc.outside!=findroom ("postoffice@udgaard"))
link (npc,findroom ("postoffice@udgaard"));
npc.position:=POSITION_STANDING;
  walkto(findroom("postoffice@udgaard"));

act ("$1n says 'Here we are at our neighborhood mail man Hansen.'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;
act ("$1n says 'Sending mail to anyone on line is very simple.'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;
act ("$1n says 'Since many players have trouble with the mail first time around I will "+
"give you a writing assignment to start you off.'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;
act ("$1n says 'Malice is our god who makes sure our newbies don't have problems "+
"and I am sure he would love to hear from you.'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;
act ("$1n says 'type 'write paper' now and write a note saying Hi and "+
"introducing yourself to Malice.  When you are done with your note you can exit the editor by "+
     "typing '@' on a blank line and hitting .'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;

act ("$1n says 'When your done writing just say 'DONE' and I will tell you what to do next.'",
A_ALWAYS , self, null , pc ,TO_VICT);
pause;
act ("$1n says 'I will not respond again until you tell me you are done.'",
A_ALWAYS , self, null , pc ,TO_VICT);
wait (SFB_DONE, command ("say" ) and
(pc==activator) and
("done" in argument));

act ("$1n says 'Great!  Now just type 'mail PAPER malice''",
A_ALWAYS , self, null , pc ,TO_VICT);
act ("$1n says 'I will wait till you have sent the letter.'",
A_ALWAYS , self, null , pc ,TO_VICT);
wait (SFB_CMD,command ("mail") and (pc==activator) and
(argument=="paper malice"));
pause;
pause;
pause;
act ("$1n says 'Great!  Now on with the tour.'",
A_ALWAYS , self, null , pc ,TO_VICT);
                                               pause;
  act ("$1n says 'The last shop to visit is Harold's, he is the local " +
"Ironmonger and can sell you many items you may need.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
npc:=findsymbolic ("harold@udgaard");
if (npc==null)
 {
 npc:=load ("harold@udgaard");
 link (npc,findroom ("Ironmonger@udgaard"));
 }
if (npc.outside!=findroom ("ironmonger@udgaard"))
 link (npc,findroom ("ironmonger@udgaard"));
npc.position:=POSITION_STANDING;
  walkto(findroom("udgaard/ironmonger"));
  pause;
  exec("emote buys a lantern", self);
  link (load ("lantern@midgaard"),self);
  pause;
  exec("give lantern to "+pc.name, self);
  pause;
  act ("$1n says 'To see how to use the lantern type 'help light'.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'If you follow the main road to the east you will find the " +
" bank and jail house as well as an armorer and weapon shop.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'You can visit them after our tour.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'Ok. This concludes our tour of the Udgaard shops.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'Next I would like to introduce you to someone that will be "+
       "of some help to you during your time in Valhalla. Your very own "+
       "healer.'",
A_ALWAYS , self, null , pc ,TO_VICT);
 pause;
 npc:=findsymbolic ("healer@g_q");
if (npc==null)
 {
 npc:=load ("healer@g_q");
 link (npc,findroom ("heal_room@udgaard"));
 }
if (npc.outside!=findroom ("heal_room@udgaard"))
link (npc,findroom ("heal_room@udgaard"));
npc.position:=POSITION_STANDING;
  walkto(findroom("heal_room@udgaard"));
   pause;
   act ("$1n says 'If you find you need some helping spells come and sit here for "+
        "a bit and the healer will be more then willing to help you.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'I will finish by taking you back to the Temple where we started and "+
  "explain one more nice thing.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  walkto(findroom("temple@udgaard"));
  act ("$1n says 'If you ever find yourself with out equipment you can worship "+
        "this statue of Odin and it will grant you some very basic "+
         "equipment.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'This will only work while your a newbie so you better learn "+
        "to remember where you died so you can return and get your "+
         "stuff from your corpse.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
  act ("$1n says 'Well that about covers Udgaard.'",
A_ALWAYS , self, null , pc ,TO_VICT);
  pause;
qst:=NEWBIE_ONGOING in pc.quests;
qst.descr:="part 3 done";
  return (TRUE);

  :stop:
  return (FALSE);
}
dilend


/* newbie guide part 4 combat training */
dilbegin integer newbie_part4(pc : unitptr);
var
npc : unitptr;
       i       :       integer;
  qst:extraptr;
code
{
:init:
heartbeat := PULSE_SEC*5;
on_activation(self.position <= POSITION_SLEEPING, skip);
:start:
if (pc == null)
 goto stop;
secure(pc, stop);


pause;
act ("$1n says 'Ok now for some very important information, this is the stuff "+
"you will need to know to stay alive and to level.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;

act ("$1n says 'I will now take you to some of our newbie hunting grounds and "+
"give you a chance to make your first kill.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  if (not(pc.position == POSITION_STANDING))
  {
     act ("$1n says 'Please stand up now so we may begin.'",
A_ALWAYS,self,null,pc,TO_VICT);
     :try_again:
     wait(SFB_CMD, activator #= pc);
     if (not command("stand"))
     {
 pause;
 act ("$1n says 'Please Just STAND up.'",
A_ALWAYS,self,null,pc,TO_VICT);
 goto try_again;
     }
  }
  if (not(pc.master.name $= self.name))
 {
 act ("$1n says 'Please type 'fol newbie guide' now.'",
A_ALWAYS,self,null,pc,TO_VICT);
 :try_again2:
 wait (SFB_DONE, activator==pc);
 if (not(command  ("follow")) or
   (target!=self))
   {
   act ("$1n says 'Please follow me now by typing 'fol newbie" +
     " guide' now.'",
A_ALWAYS,self,null,pc,TO_VICT);
   goto try_again2;
   }
 }
  pause;
  walkto(findroom("cypress/hill"));
  act ("$1n says 'This is the Cypress forest.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'Skunks, Badgers and Boar live here and in a level " +
"or so you will be able to hunt them all.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'The Badgers and Skunks you may be able to hunt " +
"at your current level but the Boar I would wait for.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'There is also another forest very nearby, with " +
"other assorted animals for newbies to hunt.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Lets visit it now so you know how to get there.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  walkto(findroom("haon_dor/forest_edge"));
  act ("$1n says 'Here we stand at the entrance to the legendary " +
"forest of Haon-Dor.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'There are a plethora of rabbits and such for you to " +
"hunt here and I am sure you will spend some time here " +
"for the next few levels.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'A word of warning however do not wander to far west until "+
       "You have gained a few levels. The wolves are very mean.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'As you might know there is only one way to learn " +
"how to fight and that is just to do it.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Lets see if I can find something suitable " +
"for your first kill.'",
A_ALWAYS,self,null,pc,TO_VICT);
  exec("ponder", self); pause;
  act ("$1n says 'Ahhhh yes. This will do.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  npc := load("ferret@newbie");
  link(npc, findroom("haon_dor/forest_edge"));
  act("The ferret appears suddenly.",
      A_ALWAYS, self, null, null, TO_ALL);
  exec("chuckle", self); pause;
  exec("point ferret", self); pause;
  act ("$1n says 'This little guy should cause you no trouble, " +
"an easy kill I'd say.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'Now. To find suitable opponents you must use the " +
"'consider' command. Try 'con ferret' now and see what " +
"it says.'",
A_ALWAYS,self,null,pc,TO_VICT);
  act ("$1n says 'It most likely tells you will have no problems " +
"with it, I can assure you this ferret won't be able " +
"to harm you so the result of the con command would " +
"tell you that, perhaps in a roundabout fashion though.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
 act ("$1n says 'Just to see the difference between an easy animal and a hard "+
 "opponent try 'con newbie guide''",
A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 act ("$1n says 'You only need to type kill the first time. After that you "+
      "will continue to fight till the animal is dead or mortally "+
       "wounded or incapacitated.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says 'If is it mortally wounded or incapacitated you will need to "+
      "type the kill a second time to finish it off.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'Ok then, you are ready for your first kill! " +
"Type 'kill ferret'. When you are done, type " +
"'poke newbie guide'.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'I will wait until he is dead.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n exclaims 'REMEMBER! Type 'poke newbie guide' after the battle!!!'",
A_ALWAYS,self,null,pc,TO_VICT);
  :wait_here:
  wait(SFB_DONE, activator #= pc);
  if (not(command("poke")) or
      (self!=target))
  {
     goto wait_here;
  }
  exec("clap", self); pause;
  act ("$1n says 'Very good, you have made your first kill.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'The last thing you want to do is 'loot' the corpse " +
"for any goodies he might have had when he was alive.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'To do this now, type 'get all from corpse'.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'Be careful however, if you are in a room with more than " +
"one corpse, you may have to be specific.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
  act ("$1n says 'That is, if the corpse you want to loot is the third " +
"in the room, type 'get all from 3.corpse'.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
 act ("$1n says 'You might want to look in the corpse first to make sure it is the "+
 "correct corpse by typing 'look in corpse'  or 'look in 2.corpse''",
A_ALWAYS,self,null,pc,TO_VICT);
 pause;
qst:=NEWBIE_ONGOING in pc.quests;
qst.descr:="part 4 done";

  return (TRUE);

  :stop:
  return (FALSE);
}
dilend

/* newbie guide part 5 Guild training and reward*/
/*healer*/
dilbegin integer newbie_part5c(pc : unitptr);
var
nroom : unitptr;
       i       :       integer;
       item:unitptr;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc == null)
     goto stop;
  secure(pc, stop);

pause;
  act ("$1n says 'I notice you have an affinity for nature.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Well that is grand! I would love to show you " +
"around your guild, you'll find it helpful I think.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now it will be important that you stay close by " +
"so you don't get lost.'",
A_ALWAYS,self,null,pc,TO_VICT);
  pause;
  if (not(pc.position == POSITION_STANDING))
  {
     act ("$1n says 'Please stand up now so we may begin.'",
A_ALWAYS,self,null,pc,TO_VICT);
     :try_again:
     wait(SFB_CMD, activator #= pc);
     if (not command("stand"))
     {
 pause;
 act ("$1n says 'Please STAND up.'", A_ALWAYS, self, null,pc,TO_VICT);
 goto try_again;
     }
  }
  if (not(pc.master.name $= self.name))
 {
 act ("$1n says 'Please type 'fol newbie guide' now.'", A_ALWAYS, self, null,pc,TO_VICT);
 :try_again2:
 wait (SFB_DONE, activator==pc);
 if (not(command  ("follow")) or
   (target!=self))
   {
   act ("$1n says 'Please follow me now by typing 'fol newbie" +
     " guide' now.'", A_ALWAYS, self, null,pc,TO_VICT);
   goto try_again2;
   }
 }
  pause;
  act ("$1n says 'Let us visit your guild master now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Remember how to get to your guild because you will need to" +
"in the future quite frequently.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("clericguild/entrance"));
  pause;
  act ("$1n says 'This is the entrance, and to the west is your guild.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'These guards are meant to keep any non-Healers " +
"out and so I will have to teleport in.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("emote is not a Healer.",self);
  pause;
  act ("$1n says 'I will teleport you to your guild master now, and then " +
"I will teleport to you.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you disappear for transportation.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" disappears before your eyes.'",
      A_ALWAYS, pc, null, null, TO_REST);
  link(pc, findroom("clericguild/sanctuary"));
  link(self, findroom("clericguild/sanctuary"));
  act("A portal opens, the Newbie Guide exits and stands before you.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you re-appear in a new location.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" appears before your eyes.'",
      A_ALWAYS, self.outside, null, null, TO_REST);
  exec("look", pc);
  pause;

  act ("$1n says 'Here we are, and this is your Guild Master Tuck!'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Chances are that you will not always be a healer."+
        " Many players leave their respective " +
       "guilds and search out further knowledge in other guilds. "+
        "once they become proficient in their chosen path.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  act ("$1n says 'This is where you join and leave the guild. To get more "+
        "information on this when we are not so busy you can type "+
         "'help join' and 'help insult' '", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'I will give you a little hint. You will only get ability "+
      "practice points until level 50. It might be a good idea to '",A_ALWAYS, self, null,pc,TO_VICT);
pause;
 act ("$1n says 'save some of these for the next guild you join. Ask a high "+
     "level player for some pointers on this.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'I will introduce you to one of your teachers now, " +
"but you will have to find the rest of them after our " +
"tour.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'For the Udgaard Healers, there is an abilities " +
"teacher, a skills teacher, a weapons teacher, and " +
"a spells teacher'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Let's visit your magic teacher, he's " +
"very close by, as are all of the teachers here.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("clericguild/garden7"));
  act ("$1n says 'Tick here will teach you all about " +
"Healer spells.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'When you type 'info' with no arguments " +
"your teacher will display all of the categories in which " +
"you may train.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'Once you get a list of categories you can type " +
       " the category after the word info for help on that "+
       "specific category. For instance 'info div' "+
"all of the divine-sphere spells that you can train.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'And finally to actually practice a spell once you have " +
"decided on one to train just use 'practice '.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'The info command will show you useful information " +
"regarding training costs and your existing spell or " +
"skill knowledges.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'You will use it at every level so it would be best " +
"to learn it now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'Well, I think I have shown you all you need to know to get started.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now let me give you some things for your patients in completing "+
  "this newbie training.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
    item := load("udgaard/newbie_mace");
  item.height := pc.height;
  link(item, pc);
  act("The newbie guide gives you a better weapon.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  pause;
  addextra(pc.quests, {NEWBIE_COMPLETE}, "");
  pause;
  pause;
  subextra(pc.quests, NEWBIE_ONGOING);
  pause;
  act ("$1n says 'Also I will give  you 2000 experience which should be enough to "+
  "give you a level.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
   experience (2000,pc);
  pause;
  act ("$1n says 'To level just type 'level', then you can go practice.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("bow "+pc.name, self);
  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
                       destroy (self);
  return (TRUE);

  :stop:
  return (FALSE);
}
dilend


/* Part 4f of dil for newbie guide. Guild tour for Fighters. */
/*fighter*/
dilbegin integer newbie_part5f(pc : unitptr);
var
       nroom   :       unitptr;
       item:unitptr;
       i       :       integer;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc == null)
     goto stop;
  secure(pc, stop);

pause;
  act ("$1n says 'I notice you have a way with combat.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Well now, you could say I am rather a buff in battle " +
"myself! Allow me to show you around your guild.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'Now it will be important that you stay close by " +
"so you don't get lost.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  if (not(pc.position == POSITION_STANDING))
  {
     act ("$1n says 'Please stand up now so we may begin.'", A_ALWAYS, self, null,pc,TO_VICT);
     :try_again:
     wait(SFB_CMD, activator #= pc);
     if (not command("stand"))
     {
 pause;
 act ("$1n says 'Please Just STAND up!'", A_ALWAYS, self, null,pc,TO_VICT);
 goto try_again;
     }
  }
  if (not(pc.master.name $= self.name))
 {
 act ("$1n says 'Please type 'fol newbie guide' now.'", A_ALWAYS, self, null,pc,TO_VICT);
 :try_again2:
 wait (SFB_DONE, activator==pc);
 if (not(command  ("follow")) or
   (target!=self))
   {
   act ("$1n says 'Please follow me now by typing 'fol newbie" +
     " guide' now!'", A_ALWAYS, self, null,pc,TO_VICT);
   goto try_again2;
   }
 }
  pause;
  act ("$1n says 'Let us visit your guild master now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Remember how to get to your guild because you will need to "+
"in the future quite frequently.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("fightersguild/entrance"));
  pause;
  act ("$1n says 'This is the entrance, and to the east is your guild.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'These guards are meant to keep any non-fighters " +
"out and so I will have to teleport in.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("emote is not technically a fighter.",self);
  pause;
  act ("$1n says 'I will teleport you to your guild master now, and then " +
"teleport to you.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you disappear for transportation.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" disappears before your eyes.'",
      A_ALWAYS, pc, null, null, TO_REST);

  link(self, findroom("fightersguild/outlook"));
  link(pc, findroom("fightersguild/outlook"));

  act("A portal opens, the Newbie Guide exits and stands before you.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you re-appear in a new location.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" appears before your eyes.'",
      A_ALWAYS, self.outside, null, null, TO_REST);
  exec("look", pc);
  pause;

  act ("$1n says 'Here we are, and this is your Guild Master Arthur!'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Chances are that you will not always be a fighter."+
        " Many players leave their respective " +
       "guilds and search out further knowledge in other guilds. "+
        "once they become proficient in their chosen path.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  act ("$1n says 'This is where you join and leave the guild. To get more "+
        "information on this when we are not so busy you can type "+
         "'help join' and 'help insult' '", A_ALWAYS, self, null,pc,TO_VICT);

  pause;

  act ("$1n says 'I will give you a little hint. You will only get ability "+
      "practice points until level 50. It might be a good idea to '",A_ALWAYS, self, null,pc,TO_VICT);
pause;
 act ("$1n says 'save some of these for the next guild you join. Ask a high "+
     "level player for some pointers on this.'",A_ALWAYS, self, null,pc,TO_VICT);

  pause;
act ("$1n says 'I will introduce you to one of your teachers now, " +
"but you will have to find the rest of them after our " +
"tour.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'For the Udgaard Fighters, there is an abilities " +
"teacher, a skills teacher, and a weapons teacher.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Let's visit your abilities teacher, he's " +
"very close by, as are all of the teachers here.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("fightersguild/smithy"));
  act ("$1n says 'Jones here will train your abilities to a suitable" +
"level.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'When you enter 'info' with no arguments " +
"your teacher will display all of the categories in which " +
"you may train, i.e. str, dex, con, etc....'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'And to actually train an ability once you have " +
"decided on one to train just use 'practice '.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'The info command will show you useful information " +
"regarding training costs and your existing skill and " +
"abilities knowledge.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'You will use it at every level so it would be best " +
"to learn it now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Well, I think I have shown you all you need to know to get started.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now let me give you some things for your patients in completing "+
  "this newbie training.'", A_ALWAYS, self, null,pc,TO_VICT);
    item := load("udgaard/newbie_sword");
  item.height := pc.height;
  link(item, pc);
  pause;
  act("The newbie guide gives you a better weapon.'",
            A_ALWAYS, pc, null, null, TO_CHAR);

  pause;
   experience (2000,pc);
  act ("$1n says 'Also I have given you 2000 experience which should be enough to "+
  "give you a level.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'To level just type 'level', then you can go practice.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("bow "+pc.name, self);
  subextra(pc.quests, NEWBIE_ONGOING);
  addextra(pc.quests, {NEWBIE_COMPLETE}, "");
  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
                       destroy (self);
  return (TRUE);

  :stop:
  return (FALSE);
}
dilend




/* Part 4m of dil for newbie guide. Guild tour for Mages. */

/*conjurer*/
dilbegin integer newbie_part5m(pc : unitptr);
var
       i       :       integer;
       item:unitptr;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc == null)
     goto stop;
  secure(pc, stop);

pause;
  act ("$1n says 'I notice you are bound to the ways of magic.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Well, magic is a wonderful power source and I would "+
"love to show you around your guild, you'll find it " +
"helpful I think.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'Now it will be important that you stay close by " +
"so you don't get lost.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  if (not(pc.position == POSITION_STANDING))
  {
     act ("$1n says 'Please stand up now so we may begin.'", A_ALWAYS, self, null,pc,TO_VICT);
     :try_again:
     wait(SFB_CMD, activator #= pc);
     if (not command("stand"))
     {
 pause;
 act ("$1n says 'Please Just STAND up!'", A_ALWAYS, self, null,pc,TO_VICT);
 goto try_again;
     }
  }
  if (not(pc.master.name $= self.name))
 {
 act ("$1n says 'Please type 'fol newbie guide' now.'", A_ALWAYS, self, null,pc,TO_VICT);
 :try_again2:
 wait (SFB_DONE, activator==pc);
 if (not(command  ("follow")) or
   (target!=self))
   {
   act ("$1n says 'Please follow me now by typing 'fol newbie" +
     " guide' now!'", A_ALWAYS, self, null,pc,TO_VICT);
   goto try_again2;
   }
 }
  pause;
  act ("$1n says 'Let us visit your guild master now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Remember how to get to your guild because you will need to "+
"in the future quite frequently.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("mageguild/entrance"));
  pause;
  act ("$1n says 'This is the entrance, and to the east is your guild.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'These guards are meant to keep any non-Conjurers " +
"out and so I will have to teleport in.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("emote is not quite a Conjurer.", self);
  pause;
  exec("sigh", self);
  pause;
  act ("$1n says 'I will teleport you to your guild master now, and then " +
"teleport to you.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you disappear for transportation.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" disappears before your eyes.'",
      A_ALWAYS, pc, null, null, TO_REST);
  link(self, findroom("chan_office@mageguild"));
  link(pc, findroom("chan_office@mageguild"));
  act("A portal opens, the Newbie Guide exits and stands before you.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you re-appear in a new location.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" appears before your eyes.'",
      A_ALWAYS, self.outside, null, null, TO_REST);
  exec("look", pc);
  pause;
  act ("$1n says 'Here we are, and this is your Guild Master Rafizir!'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Chances are that you will not always be a conjurer."+
        " Many players leave their respective " +
       "guilds and search out further knowledge in other guilds. "+
        "once they become proficient in their chosen path.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  act ("$1n says 'This is where you join and leave the guild. To get more "+
        "information on this when we are not so busy you can type "+
         "'help join' and 'help insult' '", A_ALWAYS, self, null,pc,TO_VICT);

  pause;

  act ("$1n says 'I will give you a little hint. You will only get ability "+
      "practice points until level 50. It might be a good idea to '",A_ALWAYS, self, null,pc,TO_VICT);
pause;

 act ("$1n says 'save some of these for the next guild you join. Ask a high "+
     "level player for some pointers on this.'",A_ALWAYS, self, null,pc,TO_VICT);
     pause;
  act ("$1n says 'I will introduce you to one of your teachers now, " +
"but you will have to find the rest of them after our " +
"tour.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'For the Udgaard Conjurers, there is an abilities " +
"teacher, a skills teacher, a weapons teacher, and " +
"a spells teacher.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Let's visit your spells teacher, he's " +
"very close by, as are all of the teachers here.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("arcane_ground@mageguild"));
 act ("$1n says 'Zofax here will teach you all about " +
"Conjurer spells.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'When you enter 'info' with no arguments " +
"your teacher will display all of the categories in which " +
"you may train.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'If you type a category after the work 'info' you will "+
       "get information on that specific category. Try typing 'info "+
        "mind', you will see " +
"all of the mind-sphere spells that you can train.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'And finally to actually practice a spell once you have " +
"decided on one to train just use 'practice '.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'The info command will show you useful information " +
"regarding training costs and your existing spell or " +
"skill knowledges.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'You will use it at every level so it would be best " +
"to learn it now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'Well, I think I have shown you all you need to know to get started.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now let me give you some things for your patients in completing "+
  "this newbie training.'", A_ALWAYS, self, null,pc,TO_VICT);
    item := load("udgaard/newbie_dagger");
  item.height := pc.height;
  link(item, pc);

  pause;
  act("The newbie guide gives you a better weapon.'",
             A_ALWAYS, pc, null, null, TO_CHAR);

  pause;
  pause;
   experience (2000,pc);
  act ("$1n says 'Also I have given you 2000 experience which should be enough to "+
  "give you a level.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'To level just type 'level', then you can go practice.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("bow "+pc.name, self);
  subextra(pc.quests, NEWBIE_ONGOING);
  addextra(pc.quests, {NEWBIE_COMPLETE}, "");
  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
                       destroy (self);
  return (TRUE);

  :stop:
  return (FALSE);
}
dilend




/* Part 4t of dil for newbie guide. Guild tour for thieves. */

/*thief*/
dilbegin integer newbie_part5t(pc : unitptr);
var
       nroom   :       unitptr;
       item:unitptr;
       i       :       integer;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc == null)
     goto stop;
  secure(pc, stop);
pause;
  act ("$1n says 'I notice you are sly in the ways of deception.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Well that is great! I would love to show you " +
"around your guild, you'll find it helpful I think.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'Now it will be important that you stay close by " +
"so you don't get lost.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  if (not(pc.position == POSITION_STANDING))
  {
     act ("$1n says 'Please stand up now so we may begin.'", A_ALWAYS, self, null,pc,TO_VICT);
     :try_again:
     wait(SFB_CMD, activator #= pc);
     if (not command("stand"))
     {
 pause;
 act ("$1n says 'Please Just STAND up!'", A_ALWAYS, self, null,pc,TO_VICT);
 goto try_again;
     }
  }
  if (not(pc.master.name $= self.name))
 {
 act ("$1n says 'Please type 'fol newbie guide' now.'", A_ALWAYS, self, null,pc,TO_VICT);
 :try_again2:
 wait (SFB_DONE, activator==pc);
 if (not(command  ("follow")) or
   (target!=self))
   {
   act ("$1n says 'Please follow me now by typing 'fol newbie" +
     " guide' now!'", A_ALWAYS, self, null,pc,TO_VICT);
   goto try_again2;
   }
 }
  pause;
  act ("$1n says 'Let us visit your guild master now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Remember how to get here because you will need to " +
"in the future quite frequently.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("thievesguild/entrance"));
  pause;
  act ("$1n says 'This is the entrance, and to the west is your guild.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'These guards are meant to keep any non-thieves " +
"out and so I will have to teleport in.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("emote is not a thief (yet).", self);
  pause;
  act ("$1n says 'I will teleport you to your guild master now, and then " +
"teleport to you.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you disappear for transportation.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" disappears before your eyes.'",
      A_ALWAYS, pc, null, null, TO_REST);
  link(pc, findroom("thievesguild/study"));
  link(self, findroom("thievesguild/study"));
  act("A portal opens, the Newbie Guide exits and stands before you.'",
      A_ALWAYS, self, null, null, TO_ALL);
  act("Suddenly you re-appear in a new location.'",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" appears before your eyes.'",
      A_ALWAYS, self.outside, null, null, TO_REST);
  exec("look", pc);

  act ("$1n says 'Here we are, and this is your Guild Master Oliver!'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Chances are that you will not always be a thief."+
        " Many players leave their respective " +
       "guilds and search out further knowledge in other guilds. "+
        "once they become proficient in their chosen path.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  act ("$1n says 'This is where you join and leave the guild. To get more "+
        "information on this when we are not so busy you can type "+
         "'help join' and 'help insult' '", A_ALWAYS, self, null,pc,TO_VICT);

  pause;

  act ("$1n says 'I will introduce you to one of your teachers now, " +
"but you will have to find the rest of them after our " +
"tour.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'For the Udgaard Thieves, there is an abilities " +
"teacher, a skills teacher, and a weapons teacher.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Let's visit your abilities teacher, he's " +
"very close by, as are all of the teachers here.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  walkto(findroom("thievesguild/storage_room"));
  act ("$1n says 'Bisse here will train your abilities to a suitable " +
"degree so that you may be a decent thief.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'You have already looked at help info, so you should " +
"have an idea what the 'info' command does.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'When you enter 'info' with no arguments " +
"your teacher will display all of the categories in which " +
"you may train such as dex, str, con.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  pause;
  act ("$1n says 'And to actually train an ability once you have " +
"decided on one to train just use 'practice '."+
        "to train your dex you would type: 'train dex'.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'The info command will show you useful information " +
"regarding training costs and your existing skill or " +
"abilities knowledge.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'You will use it at every level so it would be best " +
"to learn it now.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("pat "+pc.name, self);
  pause;
  act ("$1n says 'Well, I think I have shown you all you need to know to get started.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'Now let me give you some things for your patients in completing "+
  "this newbie training.'", A_ALWAYS, self, null,pc,TO_VICT);
    item := load("udgaard/newbie_short");
  item.height := pc.height;
  link(item, pc);

  pause;
  act("The newbie guide gives you a better weapon.'",
             A_ALWAYS, pc, null, null, TO_CHAR);

  pause;
  pause;
   experience (2000,pc);
  act ("$1n says 'Also I have given you 2000 experience which should be enough to "+
  "give you a level.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'To level just type 'level', then you can go practice.'",A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  exec("bow "+pc.name, self);
  subextra(pc.quests, NEWBIE_ONGOING);
  addextra(pc.quests, {NEWBIE_COMPLETE}, "");
  act("A portal opens, the Newbie Guide steps through and disappears.'",
      A_ALWAYS, self, null, null, TO_ALL);
                       destroy (self);

  return (TRUE);

  :stop:
  return (FALSE);
}
dilend


/* Part 4u of dil for newbie guide. Unknown guild! */

/*unknown guild*/
dilbegin integer newbie_part5u(pc : unitptr);
var
       nroom   :       unitptr;
       i       :       integer;
code
{
  :init:
  heartbeat := PULSE_SEC*6;
  on_activation(self.position <= POSITION_SLEEPING, skip);

  :start:
  if (pc == null)
     goto stop;
  secure(pc, lost_pc);

pause;
  act ("$1n says 'This is very strange, you are not a member of any "+
"Udgaard guild.'",
A_ALWAYS, self, null,pc,TO_VICT);
  pause;
  act ("$1n says 'If you think this is an error, please get hold of a God.'",
  A_ALWAYS, self, null,pc,TO_VICT);
  log("NEWBIE GUIDE: No known guild for "+pc.name+", tell Papi please.");
  pause;
  pause;
  return (TRUE);

  :lost_pc:
  act ("$1n says '*sigh* Never stay when they should.'", A_ALWAYS, self, null,pc,TO_VICT);
  pause;

  :stop:
  return (FALSE);
}
dilend


dilbegin integer quest_parse (pc:unitptr);
var
 count:integer;
 act_str:string;
qst:extraptr;
/*
This function returns the following values.

-1 if the function errors won't happen grin.
0 if player hasn't started quest
1 If player is done with part 1
2 3 4 Like one if the player is done.
5 if player wants help with corpse or is lost.
*/
code
{
secure (pc,lostpc);

if ((NEWBIE_COMPLETE in pc.quests))
return (5);

qst:=NEWBIE_ONGOING in pc.quests;
if (qst==null)
 {
act ("$1n says 'I notice that you have not done the newbie guide tour.'",
A_ALWAYS,self,null,pc,TO_VICT);
 pause;
act ("$1n asks 'Would you like to do the tour or do you need more help?  Just say "+
 "'tour' for the quest and 'help' for assistance from me.",
 A_ALWAYS,self,null,pc,TO_VICT);
 :tick:
 wait (SFB_DONE|SFB_TICK, command ("say") and
 (pc==activator) and
 (("tour" in argument ) or
 ("help" in argument)));
 if (command (CMD_AUTO_TICK) and
 (self.outside.idx==pc.outside.idx)) goto tick;
 if ("tour" in argument)
 return (0);
else
return (5);
 }
else if (qst.descr=="part 1 done")
 {
 count:=1;
 act_str:="four parts";
 }
else if (qst.descr=="part 2 done")
 {
 count:=2;
 act_str:="three parts";
 }
else if (qst.descr=="part 3 done")
 {
 count:=3;
 act_str:="two parts";
 }
else if (qst.descr=="part 4 done")
 {
 count:=4;
 act_str:="one part";
 }

act ("$1n says 'I notice although you have started the newbie guide tour you still have "+
 act_str+" to complete it.",
 A_ALWAYS,self,null,pc,TO_VICT);
 pause;
act ("$1n asks 'Would you like to complete the tour or do you need more help?  Just say "+
 "'complete' for the quest or 'help' for assistance from me.'",
 A_ALWAYS,self,null,pc,TO_VICT);

 wait (SFB_DONE, command ("say") and
 (pc==activator) and
 (("complete" in argument ) or
 ("help" in argument)));
 if ("complete" in argument)
 return (count);
else
return (5);

:lostpc:
return (-1);


}
dilend


/*
change this define when you add or  subtract names
*/
#define AMOUNT_NAMES     11
dilbegin string newbie_names (i:integer);
var
new_names:stringlist;
 code
 {
 new_names:={"Melvin", "Andy", "Trent", "Bill","Arthur",
 "Lance","Steven","Richard","Lewi", "david","Neil"};
 return (new_names.[i]);
 }
 dilend


dilbegin integer newbie_help (pc:unitptr);
external
  integer walk_room@function (s:string,i:integer);
var
 n : integer;
 crp:unitptr;
 crp_string:string;
 tf:integer;

 code
 {
  heartbeat := PULSE_SEC*6;
 secure (pc,stop);

act ("$1n asks 'So you need my help do you?'",
 A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says 'There are two things I can help you with.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says 'I can help you find your corpse or I can help you find your way "+
"back to Udgaard.  Just say 'corpse' if you have lost your corpse or 'udgaard' "+
"if you have just got yourself lost.'",
 A_ALWAYS,self,null,pc,TO_VICT);
wait (SFB_DONE, command ("say") and
 (activator==pc) and
 (("udgaard" in argument) or
 ("corpse" in argument)));

if ("corpse" in argument )
 {
 act ("$1n says 'Oh I hope it was an honorable death.'",
   A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 crp:=findunit (self,"corpse of "+pc.name,FIND_UNIT_WORLD, null);
 if (crp.name=="corpse of "+pc.name)
   {
   act ("$1n says 'Well for safety reasons I will just get your corpse and give "+
     "it to you.'",
       A_ALWAYS,self,null,pc,TO_VICT);
   act ("$1n says 'We wouldn't want whatever killed you to try again.'",
     A_ALWAYS,self,null,pc,TO_VICT);
   exec ("wink "+pc.name,self);
   act ("A portal opens up in front of you.",
     A_ALWAYS,self,null,null,TO_REST);
   act ("$1n reaches through the portal and grabs $3n's corpse.",
     A_ALWAYS,self,null,pc,TO_NOTVICT);
   act ("$1n reaches through the portal and grabs your corpse.",
     A_ALWAYS,self,null,pc,TO_VICT);
   pause;
   crp:=findunit (self,"corpse of "+pc.name,FIND_UNIT_WORLD, null);
   link (crp, pc);
   act ("$1n gives your corpse to you.",
     A_ALWAYS,self,null,pc,TO_VICT);
   act ("$1n gives $3n'S corpse $3n.",
     A_ALWAYS,self,null,pc,TO_NOTVICT);
   pause;
   act ("$1n says 'There you go just type 'get all from corpse''",
     A_ALWAYS,self,null,pc,TO_VICT);
   pause;
   act ("$1n says 'Well I really must run more newbies await.'",
     A_ALWAYS,self,null,pc,TO_VICT);
   pause;
   exec ("ditch "+pc.name,self);
   exec ("wave",self);
   return (0);
   }
 else
   {
   exec ("sigh",self);
   pause;
   act ("$1n says 'Your corpse is not to be found anywhere.'",
       A_ALWAYS,self,null,pc,TO_VICT);
   pause;
   act ("$1n says 'I am sorry I can not help.'",
     A_ALWAYS,self,null,pc,TO_VICT);
   exec ("ditch "+pc.name,self);
   pause;
   exec ("wave "+pc.name,self);
   return(0);
   }
 }
else
 {
 act ("$1n says 'Yes I used to get lost all the time when I was new.'",
   A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 act ("$1n says 'Well just type 'follow newbie guide' and we will be off.'",
   A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 :fl2:
 wait (SFB_DONE,command ("follow") and
   (self==target));
 if (pc.master!=self) goto fl2;
 pc.endurance:=pc.max_endurance;
 if ((self.zone=="haon_dor") or
   (self.zone=="udgaard") or
   (self.zone =="cypress") or
   (self.zone=="midgaard") or
   (self.zone=="goblin") or
   (self.zone=="halfzon") or
   (self.zone =="ratswarf") or
   (self.zone=="hobgob") or
   (self.zone=="urland") or
   (self.zone =="moor"))
   {
   tf:=walk_room@function ("temple@udgaard",3);
   pause;
   exec ("wave "+pc.name,self);
   return(0);
   }
 else
   goto to_long2;

 if (tf==FALSE)
   {
   :to_long2:
   act ("$1n says 'I just realize we have a real long way to go.'",
     A_ALWAYS,self,null,pc,TO_VICT);
   pause;
   act ("$1n says 'I am sure you won't mind if I cheat a bit.'",
       A_ALWAYS,self,null,pc,TO_VICT);
     pause;
   act ("$1n says 'I will teleport to the temple "+
 "and then summon you there.'",
     A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 act("A portal opens, the Newbie Guide steps through and disappears.",
   A_ALWAYS, self, null, null, TO_ALL);
 link(self, findroom("temple@udgaard"));
 act("Suddenly you disappear and begin transportation.",
   A_ALWAYS, pc, null, null, TO_CHAR);
 act("Suddenly $1n  disappears before your eyes.",
   A_ALWAYS, pc, null, null, TO_REST);
 act("A portal opens, the Newbie Guide exits and stands before you.",
   A_ALWAYS, self, null, null, TO_ALL);
 link(pc, findroom("temple@udgaard"));
 act("Suddenly you re-appear in a new location.",
   A_ALWAYS, pc, null, null, TO_CHAR);
 act("Suddenly $2n appears before your eyes.",
   A_ALWAYS, self.outside, pc, null, TO_REST);
 }
pause;
act ("$1n says 'Well I really must run more newbies await.",
 A_ALWAYS,self,null,pc,TO_VICT);
pause;
exec ("ditch "+pc.name,self);
exec ("wave",self);
   return(0);
}

:stop:
   return(0);
}
dilend


dilbegin newbie_brain(new_pc:string);
external
 integer quest_parse (pc:unitptr);/*checks what part the pc is on the quest*/
  integer newbie_part1(u : unitptr);
  integer newbie_part2(u : unitptr);
  integer newbie_part3(u : unitptr);
  integer newbie_part4(u : unitptr);
  integer newbie_part5c(u : unitptr);
  integer newbie_part5f(u : unitptr);
  integer newbie_part5m(u : unitptr);
  integer newbie_part5t(u : unitptr);
  integer newbie_part5u(u : unitptr);
  integer newbie_help (u:unitptr);
  integer stop_test (pc:unitptr,i:integer);
var
 pc : unitptr;
 pc_name:string;
 n:integer;
code
{
pc:=findunit (self,new_pc,FIND_UNIT_WORLD, null);
if (pc==null) destroy (self);
 link (self,pc.outside);
  secure(pc, stop);
  pc_name:=pc.name;
act ("A portal opens in front of you.",
A_ALWAYS,pc,null,null,TO_ALL);
act ("$2n steps out of the portal and it vanishes.",
A_ALWAYS,pc,self,null,TO_ALL);
  pause;
  exec("handshake "+pc.name, self);
  pause;
act ("$1n says 'I heard your call for help and came as soon as I could.'",
A_ALWAYS,self,null,pc,TO_VICT);

n:=quest_parse@newbie (pc);
if (n==-1 ) goto stop;

on n goto part1,part2,part3,part4,part5,complete ;
goto stop;  /*incase on goto fails*/

:part1:
  if (self.outside!=findroom("newbie_chat@udgaard"))
   {
act ("$1n says 'I will take you some place quiet so we can start your Valhalla tour.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says 'I will teleport to the Newbie chat room and then summon "+
   "you there.",
A_ALWAYS,self,null,pc,TO_VICT);
   pause;
act("A portal opens, the Newbie Guide steps through and disappears.",
      A_ALWAYS, self, null, null, TO_ALL);
  link(self, findroom("newbie_chat@udgaard"));
  act("Suddenly you disappear and begin transportation.",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly $1n  disappears before your eyes.",
      A_ALWAYS, pc, null, null, TO_REST);
  act("A portal opens, the Newbie Guide exits and stands before you.",
      A_ALWAYS, self, null, null, TO_ALL);

  link(pc, findroom("newbie_chat@udgaard"));
  act("Suddenly you re-appear in a new location.",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" appears before your eyes.",
      A_ALWAYS, self.outside, null, null, TO_REST);
  exec ("look",pc);
      }

  n := newbie_part1@newbie(pc);
  if (n == FALSE)
    goto stop;
n:=stop_test (pc,1);
  if (n == FALSE)
    goto stop;

:part2:
if (self.outside!=findroom("newbie_chat@udgaard"))
 {
 act ("$1n says 'I will take you some place quiet so we can continue from "+
   "where we left off last time.'",
A_ALWAYS,self,null,pc,TO_VICT);
   pause;
 act ("$1n says 'I will teleport to the Newbie chat room and then summon "+
   "you there.'",
 A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 act("A portal opens, the Newbie Guide steps through and disappears.",
   A_ALWAYS, self, null, null, TO_ALL);
 link(self, findroom("newbie_chat@udgaard"));
 act("Suddenly you disappear and begin transportation.",
   A_ALWAYS, pc, null, null, TO_CHAR);
 act("Suddenly $1n  disappears before your eyes.",
   A_ALWAYS, pc, null, null, TO_REST);
 act("A portal opens, the Newbie Guide exits and stands before you.",
   A_ALWAYS, self, null, null, TO_ALL);

  link(pc, findroom("newbie_chat@udgaard"));
  act("Suddenly you re-appear in a new location.",
      A_ALWAYS, pc, null, null, TO_CHAR);
  act("Suddenly "+pc.name+" appears before your eyes.",
      A_ALWAYS, self.outside, null, null, TO_REST);
 exec ("look",pc);
      }

  n := newbie_part2@newbie(pc);
  if (n == FALSE)
    goto stop;

n:=stop_test (pc,2);
  if (n == FALSE)
    goto stop;


:part3:
if (self.outside==findroom ("newbie_chat@udgaard")) goto newbie_ch;
if (self.outside==findroom ("temple@udgaard")) goto newbie_te;

act ("$1n says 'I will take you to the Temple in Udgaard so we can continue from "+
"where we left off last time.'",
A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says 'I will teleport to the Temple and then summon "+
"you there.",
 A_ALWAYS,self,null,pc,TO_VICT);
pause;
act("A portal opens, the Newbie Guide steps through and disappears.",
A_ALWAYS, self, null, null, TO_ALL); link(self,
findroom("temple@udgaard"));
act("Suddenly you disappear and begin transportation.",
 A_ALWAYS, pc, null, null, TO_CHAR);
act("Suddenly $1n disappears before your eyes.",
 A_ALWAYS, pc, null, null,TO_REST);
act("A portal opens, the Newbie Guide exits and standsbefore you.",
 A_ALWAYS, self, null, null, TO_ALL);
link(pc, findroom("temple@udgaard"));
act("Suddenly you re-appear in a new location.",
 A_ALWAYS, pc, null, null, TO_CHAR);
act("Suddenly $2n appears before your eyes.",
 A_ALWAYS, self.outside,pc, null, TO_REST);
exec ("look",pc);

goto newbie_te;
:newbie_ch:
act ("$1n says 'I will take you to the Temple in Udgaard so we can continue "+
"your training.'",
 A_ALWAYS,self,null,pc,TO_VICT);
pause;
act ("$1n says 'I will teleport to the Temple and then summon "+
"you there.'",
 A_ALWAYS,self,null,pc,TO_VICT);
pause;
act("A portal opens, the Newbie Guide steps through and disappears.",
 A_ALWAYS, self, null, null, TO_ALL);
link(self,findroom("temple@udgaard"));
act("Suddenly you disappear and begin transportation.",
 A_ALWAYS, pc, null, null, TO_CHAR);
act("Suddenly $1n disappears before your eyes.",
 A_ALWAYS, pc, null, null, TO_REST);
act("A portal opens, the Newbie Guide exits and stands before you.",
 A_ALWAYS, self, null, null, TO_ALL);
link(pc, findroom("temple@udgaard"));
act("Suddenly you re-appear in a new location.",
 A_ALWAYS, pc, null, null, TO_CHAR);
act("Suddenly $2n appears before your eyes.",
 A_ALWAYS, self.outside,pc, null, TO_REST);
exec ("look",pc);

:newbie_te:

n := newbie_part3@newbie(pc);
if (n == FALSE) goto stop;
n:=stop_test (pc,3);
if (n == FALSE) goto stop;

:part4:
if (self.outside!=findroom("temple@udgaard"))
 {
 act ("$1n says 'Well we need to get back to a good starting place so you know "+
 "where you are going.'",
   A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 act ("$1n says 'I will teleport back to the temple of udgaard and then summon "+
   "you there.'",
   A_ALWAYS,self,null,pc,TO_VICT);
 pause;
 act("A portal opens, the Newbie Guide steps through and disappears.",
   A_ALWAYS, self, null, null,TO_ALL);
 link(self, findroom("temple@udgaard"));
 act("Suddenly you disappear and begin transportation.",
   A_ALWAYS, pc, null,null, TO_CHAR);
 act("Suddenly $1n disappears before your eyes.",
   A_ALWAYS, pc, null, null, TO_REST);
 act("A portal opens, the Newbie Guide exits and stands before you.",
   A_ALWAYS, self, null,null, TO_ALL);

 link(pc, findroom("temple@udgaard"));
 act("Suddenly you re-appear in a new location.",
   A_ALWAYS, pc, null, null, TO_CHAR);
 act("Suddenly $2n appears before your eyes.",
   A_ALWAYS,self.outside,pc, null, TO_REST); }

  n := newbie_part4@newbie(pc);
  if (n == FALSE)
    goto stop;
n:=stop_test (pc,4);
  if (n == FALSE)
    goto stop;

:part5:
if (pc.guild == GUILD_UDG_CLERIC)
 goto part5c;
else if (pc.guild == GUILD_UDG_FIGHTER)
 goto part5f;
else if (pc.guild == GUILD_UDG_MAGE)
 goto part5m;
else if (pc.guild == GUILD_UDG_THIEF)
 goto part5t;
else
 goto part5u;

:part5c:
 n := newbie_part5c@newbie(pc);
 goto stop;

:part5f:
 n := newbie_part5f@newbie(pc);
 goto stop;

:part5m:
 n := newbie_part5m@newbie(pc);
 goto stop;

:part5t:
 n := newbie_part5t@newbie(pc);
 goto stop;

:part5u:
 n := newbie_part5u@newbie(pc);
 goto stop;

:complete:
n:=newbie_help@newbie (pc);

:stop:
act("A portal opens, the Newbie Guide steps through and disappears.",
 A_ALWAYS, self, null, null, TO_ALL);
pc:=findunit (self,pc_name,FIND_UNIT_WORLD, null);
 subextra (pc.quests,"$newbie guide is helping");
 destroy (self);

}
dilend


%rooms
   newbie_hangout
names {"newbie room", "hangout"}
title "The Newbie Guide Hangout"
descr
"   You have entered the 'newbie zone'. This is where the tired newbie
guides go when they are sick and tired of dealing with whiney 'Wahh'
newbies."

movement SECT_INSIDE
ALWAYS_LIGHT

/*
This keeps track of the newbie guides names and how many are in the game
*/dilbegin control();
external
 string newbie_names (i:integer);
var
 pc : unitptr;
 npc:unitptr;
 i:integer;
 name_str:string;
 count:integer;
 code
 {
 i:=0;
:start:
wait(SFB_MSG,argument =="stillnewbie");
if ("$newbie guide is helping" in activator.quests) goto start;
if (i==AMOUNT_NAMES) i:=0;
pc:=activator;
addextra (pc.quests,{"$newbie guide is helping"},"");
npc:=load ("newbie_guide@newbie");
name_str:=newbie_names(i);
substring (npc.names,"newbie guide");
addstring (npc.names,name_str);
addstring (npc.names,name_str+"the newbie guide");
addstring (npc.names,"newbie guide");
addstring (npc.names,"guide");
npc.title:=name_str;
name_str:=name_str+" the Newbie Guide is here helping "+pc.name;
npc.outside_descr:=name_str;

dilcopy ("newbie_brain@newbie("+pc.name+")" , npc);
I:=i+1;
goto start;
}
dilend

end


%mobiles
   ferret
names {"ferret"}
title "a sniveling little ferret"
descr "A sniveling little ferret snarls at you."
extra {}
"This tiny creature looks vicious for something about the size
of a sock. You immediately want nothing more than to kill it."
level 1
alignment -500
race RACE_FERRET
sex SEX_MALE
height 8
weight 5
NATURAL_DEF(WPN_BITE, ARM_CLOTHES)
exp 160
MSET_ABILITY(5,10,5,5,5,70,0,0)
MSET_WEAPON(6,6,6,6,6,6)
MSET_SPELL(4,6,6,6,6,6,6,6,6,6,6)
money 1 COPPER_PIECE
end
   newbie_guide

names {"newbie guide"}
title "the newbie guide"
descr "The newbie guide is here awaiting your training."
extra {}
"This guide will perform a series of valuable lessons with you
in order to teach you the basics of Valhalla. He will cover
everything from the 'laws of the land' to actual combat and he
will reward your progress accordingly."
alignment 0
level 199
bright 4
sex SEX_MALE
weight 665
height 175
race RACE_HUMAN
NATURAL_DEF(WPN_FIST, ARM_PLATE)
MSET_ABILITY(30,30,10,10,5,5,10,0)
MSET_WEAPON(0,10,0,0,0,0)
MSET_SPELL(0,0,0,90,0,0,0,0,0,0,0)
ATTACK_DEFENSE(+500, +500)
position POSITION_STANDING
default POSITION_STANDING
dilcopy newbie_nokill@newbie();
dilcopy newbie_nospl@newbie();
end


%objects


                             newbie_sword

names {"newbie sword"}
title "a Newbie Sword"
descr
"A great Newbie Sword is here."
extra {}
"It looks like a simple one-handed sword."
manipulate {MANIPULATE_TAKE, MANIPULATE_WIELD}
WEAPON_DEF(WPN_LONG_SWORD, 2, 0)
rent 2 PLATINUM_PIECE
end


                               signal_box
names {"signal box", "box"}
title "a signal box"
descr "A signal box is mounted to the wall."
extra {}
"Its just a black box. The label says :-&n&n
&s10'Forever a friend to the newbies of Valhalla'"
weight 1
end

   newbie_sign

names {"newbie sign", "sign"}
title "a sign for newbies"
descr "A Sign for Newbies is here."
extra {}
"&l
                            &c+wAttention Newbies&cw
     ---------------------

&fValhalla offers an automated Newbie Guide to help you on your journeys
through the early years! The guide will take you on a tour of Udgaard
and show you some places you might find of interest, after which he will
reward you with some starter equipment for your progress. At any time
while you are level 3, 4 or 5 and have not completed the Newbie Quest, just
simply say 'help me newbie guide' wherever you are.&n
The guide will respond if he is not busy helping others, otherwise try again
a few minutes later. Please report any problems on the bulletin board.&n
&n
If you are a newbie that has been on before the current newbie guide you
might have to worship the statue before the newbie guide will help you."
weight 1
end
%reset

load newbie_sign into udgaard/temple max 1

%end