Codeing quests isn't an easy task. You have to be sensible with your quest.
But this ain't the place for designing, but for technical reference. For
design reference, look in /doc/rules or somewhere else.

A quest depends on quest items. There have been many bugs in the last, which
made it possible to cheat with quests in a very simple way. E.g., have a
designable weapon and don't call it "My favourite slayer" :-), but
"A raw lump of adamite", you could have Ted's smith make a dragon slayer for
you. I call this the "name" bug.
It is also possible to have other wizzies code similar items for you. Of
couse this is a way of cheating which will lead to removement of the resp. wiz,
but it is also possible to prevent this. See below. Another silly bug is having
an emoter and doing something like "me gives a raw lump of adamite to you",
which again would solve a players quest. I call this the "echo" bug.


a) the echo bug

  There now is an extension in player.c, which call's a lfun in the target
  object. It is called, whenever a player gives something to a monster or
  even to a non-living item. The lfun is called only when coded. You have
  to supply it in your target object ! Have a look at in the following file:

  /doc/lfun/enter_inventory      for a detailed description how this works.

  Note also, that enter_inventory is called AFTER the move_object to the
  target_object has been completed, so you can move the object back if
  your target-monster/item does not accept it. This can be usefull, coz
  monsters don't have unlimited carry-capability, and once they can't carry
  anymore, a player would have to kill it and wait for the next reset.


b) the name bug

  You should supply a lfun in your quest-objects. By convention, we now will
  call this routine id_quest(). Code it the following way:

    id_quest(str) { return str==THE_QUEST_ITEMS_UNIQUE_ID; }

  Within your target objects, which are given the quest-objects, you should
  not check for ob->id("blah") any longer, but for ob->id_quest("blah").
  Note also, that THE_QUEST_ITEMS_PRIVATE_ID should be unique in the whole
  mud. When installing a quest, you must ask an administrator to get it
  approved, and get a unique THE_QUEST_ITEMS_PRIVATE_ID for all your quest
  items assigned.


c) the cheat bug

  To prevent yourself from other wizzies cheating with your quest, ask for
  the creator() the quest-item. If it isn't your own wizard-id, then someone
  is cheating ! You would do the best to refuse the offer of the quest-item,
  and report this state in an logfile called "QUESTS.CHEAT".
  You have to code this in the enter_inventory() routine of your accepting
  monster/item, do it the following way:

  enter_inventory(ob) {

  /* here come the identification stuff of the item like: */
     if (!(ob->id_quest(THE_QUEST_ITEMS_UNIQUE_ID))) {
	write(name+" says: Ugh, thanks. But I don't need it.\n");
	/* either: move item back, or destruct, or just keep it. */
	/* or throw it to the ground, or whatsoever ... */
	transfer(ob,this_player());	/* transfer vs. move_object */
     }
     if (creator(ob)!=MY_WIZ_ID) {
        log_file("QUESTS.CHEAT",this_player()->query_real_name()+" "+
		 file_name(ob)+" "+ctime(time())+"\n");
	destruct(ob);
	return;
     }

  /* here follows the rest of the code */

  }


d) experience
  when u are giving away experience for a quest, dont't do so if the player
  has the quest already set! you can check this by calling:

    this_player()->query_quests(QUEST_ID), which will return 1 if the quest

  has already been done.

920929 Herp.
