key.c

./lib/room/city/pub/key.c · 1.0 KB

From the archive h7v3.0a.tar.gz

Download the archive   « Back to the archive contents

/* KEY.c
 * This key serves as a special key to open the doors at the inn
 * at Skandles Downfall. Each key is auto loading, but will not
 * be available to the players if there is a mud reboot.
 * v2.01, (c) Angel, Feb 1995.
 */

#include <mudlib.h>
inherit TREASURE;

int number;
string name;

void reset(status arg) {
  if(arg) return;
  set_name("key");
  set_alt_name("skandles");
  set_weight(1);
  set_short("A small key");
  set_long(
     "This is a small tarnished bronze key, with the \n"+
     "name 'Skandle's Downfall' across its middle.\n");
}

void long(status wiz) {
  ::long(wiz);
  write("It has the number "+number+" in the centre.\n");
}


string query_auto_load() {
  return "room/city/pub/key:"+ query_alias(1) +", "+number;
}

void init_arg(string str) {
  sscanf(str, "%s, %d", name, number);
  this_object()->set_alias(name);  /* who owns the key */
  this_object()->set_alt_name(number);
}

int set_number(int i)    { 
  this_object()->set_alt_name(i);
  return number = i;
}
status drop(status wiz) {  return 1;           }

Site Stats

Snippets: 1791
Codebases: 571