home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / d / d-linux.zip / dm-dist / act.wizard.c < prev    next >
C/C++ Source or Header  |  1991-03-01  |  37KB  |  1,506 lines

  1. /* ************************************************************************
  2. *  file: actwiz.c , Implementation of commands.           Part of DIKUMUD *
  3. *  Usage : Wizard Commands.                                               *
  4. *  Copyright (C) 1990, 1991 - see 'license.doc' for complete information. *
  5. ************************************************************************* */
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include <ctype.h>
  10.  
  11. #include "structs.h"
  12. #include "utils.h"
  13. #include "comm.h"
  14. #include "interpreter.h"
  15. #include "handler.h"
  16. #include "db.h"
  17. #include "spells.h"
  18. #include "limits.h"
  19.  
  20. /*   external vars  */
  21.  
  22. extern struct room_data *world;
  23. extern struct char_data *character_list;
  24. extern struct descriptor_data *descriptor_list;
  25. extern struct title_type titles[4][25];
  26. extern struct index_data *mob_index;
  27. extern struct index_data *obj_index;
  28. extern struct int_app_type int_app[26];
  29. extern struct wis_app_type wis_app[26];
  30.  
  31. /* external functs */
  32.  
  33. void set_title(struct char_data *ch);
  34. int str_cmp(char *arg1, char *arg2);
  35. struct time_info_data age(struct char_data *ch);
  36. void sprinttype(int type, char *names[], char *result);
  37. void sprintbit(long vektor, char *names[], char *result);
  38. int mana_limit(struct char_data *ch);
  39. int hit_limit(struct char_data *ch);
  40. int move_limit(struct char_data *ch);
  41. int mana_gain(struct char_data *ch);
  42. int hit_gain(struct char_data *ch);
  43. int move_gain(struct char_data *ch);
  44.  
  45.  
  46.  
  47. do_emote(struct char_data *ch, char *argument, int cmd)
  48. {
  49.     int i;
  50.     static char buf[MAX_STRING_LENGTH];
  51.  
  52.     if (IS_NPC(ch))
  53.         return;
  54.  
  55.     for (i = 0; *(argument + i) == ' '; i++);
  56.  
  57.     if (!*(argument + i))
  58.         send_to_char("Yes.. But what?\n\r", ch);
  59.     else
  60.     {
  61.         sprintf(buf,"$n %s", argument + i);
  62.         act(buf,FALSE,ch,0,0,TO_ROOM);
  63.         send_to_char("Ok.\n\r", ch);
  64.     }
  65. }
  66.  
  67.  
  68.  
  69. void do_echo(struct char_data *ch, char *argument, int cmd)
  70. {
  71.     int i;
  72.     static char buf[MAX_STRING_LENGTH];
  73.     
  74.     if (IS_NPC(ch))
  75.         return;
  76.  
  77.     for (i = 0; *(argument + i) == ' '; i++);
  78.  
  79.     if (!*(argument + i))
  80.         send_to_char("That must be a mistake...\n\r", ch);
  81.     else
  82.     {
  83.         sprintf(buf,"%s\n\r", argument + i);
  84.         send_to_room_except(buf, ch->in_room, ch);
  85.         send_to_char("Ok.\n\r", ch);
  86.     }
  87. }
  88.  
  89.  
  90.  
  91. void do_trans(struct char_data *ch, char *argument, int cmd)
  92. {
  93.   struct descriptor_data *i;
  94.     struct char_data *victim;
  95.     char buf[100];
  96.     sh_int target;
  97.  
  98.     if (IS_NPC(ch))
  99.         return;
  100.  
  101.     one_argument(argument,buf);
  102.     if (!*buf)
  103.         send_to_char("Who do you wich to transfer?\n\r",ch);
  104.     else if (str_cmp("all", buf)) {
  105.         if (!(victim = get_char_vis(ch,buf)))
  106.             send_to_char("No-one by that name around.\n\r",ch);
  107.         else {
  108.             act("$n disappears in a mushroom cloud.", FALSE, victim, 0, 0, TO_ROOM);
  109.             target = ch->in_room;
  110.             char_from_room(victim);
  111.             char_to_room(victim,target);
  112.             act("$n arrives from a puff of smoke.", FALSE, victim, 0, 0, TO_ROOM);
  113.             act("$n has transferred you!",FALSE,ch,0,victim,TO_VICT);
  114.             do_look(victim,"",15);
  115.             send_to_char("Ok.\n\r",ch);
  116.         }
  117.     } else { /* Trans All */
  118.     for (i = descriptor_list; i; i = i->next)
  119.             if (i->character != ch && !i->connected) {
  120.                 victim = i->character;
  121.                 act("$n disappears in a mushroom cloud.", FALSE, victim, 0, 0, TO_ROOM);
  122.                 target = ch->in_room;
  123.                 char_from_room(victim);
  124.                 char_to_room(victim,target);
  125.                 act("$n arrives from a puff of smoke.", FALSE, victim, 0, 0, TO_ROOM);
  126.                 act("$n has transferred you!",FALSE,ch,0,victim,TO_VICT);
  127.                 do_look(victim,"",15);
  128.             }
  129.  
  130.         send_to_char("Ok.\n\r",ch);
  131.     }
  132. }
  133.  
  134.  
  135.  
  136. void do_at(struct char_data *ch, char *argument, int cmd)
  137. {
  138.     char command[MAX_INPUT_LENGTH], loc_str[MAX_INPUT_LENGTH];
  139.     int loc_nr, location, original_loc;
  140.     struct char_data *target_mob;
  141.     struct obj_data *target_obj;
  142.     extern int top_of_world;
  143.     
  144.     if (IS_NPC(ch))
  145.         return;
  146.  
  147.     half_chop(argument, loc_str, command);
  148.     if (!*loc_str)
  149.     {
  150.         send_to_char("You must supply a room number or a name.\n\r", ch);
  151.         return;
  152.     }
  153.  
  154.     
  155.     if (isdigit(*loc_str))
  156.     {
  157.         loc_nr = atoi(loc_str);
  158.         for (location = 0; location <= top_of_world; location++)
  159.             if (world[location].number == loc_nr)
  160.                 break;
  161.             else if (location == top_of_world)
  162.             {
  163.                 send_to_char("No room exists with that number.\n\r", ch);
  164.                 return;
  165.             }
  166.     }
  167.     else if (target_mob = get_char_vis(ch, loc_str))
  168.         location = target_mob->in_room;
  169.     else if (target_obj = get_obj_vis(ch, loc_str))
  170.         if (target_obj->in_room != NOWHERE)
  171.             location = target_obj->in_room;
  172.         else
  173.         {
  174.             send_to_char("The object is not available.\n\r", ch);
  175.             return;
  176.         }
  177.     else
  178.     {
  179.         send_to_char("No such creature or object around.\n\r", ch);
  180.         return;
  181.     }
  182.  
  183.     /* a location has been found. */
  184.  
  185.     original_loc = ch->in_room;
  186.     char_from_room(ch);
  187.     char_to_room(ch, location);
  188.     command_interpreter(ch, command);
  189.  
  190.     /* check if the guy's still there */
  191.     for (target_mob = world[location].people; target_mob; target_mob =
  192.         target_mob->next_in_room)
  193.         if (ch == target_mob)
  194.         {
  195.             char_from_room(ch);
  196.             char_to_room(ch, original_loc);
  197.         }
  198. }
  199.  
  200.  
  201.  
  202. void do_goto(struct char_data *ch, char *argument, int cmd)
  203. {
  204.     char buf[MAX_INPUT_LENGTH];
  205.     int loc_nr, location, i;
  206.     struct char_data *target_mob, *pers;
  207.     struct obj_data *target_obj;
  208.     extern int top_of_world;
  209.  
  210.     void do_look(struct char_data *ch, char *argument, int cmd);
  211.  
  212.     if (IS_NPC(ch))
  213.         return;
  214.     
  215.     one_argument(argument, buf);
  216.     if (!*buf)
  217.     {
  218.         send_to_char("You must supply a room number or a name.\n\r", ch);
  219.         return;
  220.     }
  221.  
  222.     
  223.     if (isdigit(*buf))
  224.     {
  225.         loc_nr = atoi(buf);
  226.         for (location = 0; location <= top_of_world; location++)
  227.             if (world[location].number == loc_nr)
  228.                 break;
  229.             else if (location == top_of_world)
  230.             {
  231.                 send_to_char("No room exists with that number.\n\r", ch);
  232.                 return;
  233.             }
  234.     }
  235.     else if (target_mob = get_char_vis(ch, buf))
  236.         location = target_mob->in_room;
  237.     else if (target_obj = get_obj_vis(ch, buf))
  238.         if (target_obj->in_room != NOWHERE)
  239.             location = target_obj->in_room;
  240.         else
  241.         {
  242.             send_to_char("The object is not available.\n\r", ch);
  243.             return;
  244.         }
  245.     else
  246.     {
  247.         send_to_char("No such creature or object around.\n\r", ch);
  248.         return;
  249.     }
  250.  
  251.     /* a location has been found. */
  252.  
  253.     if (IS_SET(world[location].room_flags, PRIVATE))
  254.     {
  255.         for (i = 0, pers = world[location].people; pers; pers =
  256.             pers->next_in_room, i++);
  257.         if (i > 1)
  258.         {
  259.             send_to_char(
  260.                 "There's a private conversation going on in that room.\n\r", ch);
  261.             return;
  262.         }
  263.     }
  264.  
  265.     act("$n disappears in a puff of smoke.", FALSE, ch, 0, 0, TO_ROOM);
  266.     char_from_room(ch);
  267.     char_to_room(ch, location);
  268.     act("$n appears with an ear-splitting bang.", FALSE, ch, 0,0,TO_ROOM);
  269.     do_look(ch, "",15);
  270. }
  271.  
  272.  
  273.  
  274. void do_stat(struct char_data *ch, char *argument, int cmd)
  275. {
  276.     extern char *spells[];
  277.     struct affected_type *aff;
  278.     char arg1[MAX_STRING_LENGTH];
  279.     char buf[MAX_STRING_LENGTH];
  280.     char buf2[MAX_STRING_LENGTH];
  281.     struct char_data *victim=0;
  282.     struct room_data *rm=0;
  283.     struct char_data *k=0;
  284.     struct obj_data  *j=0;
  285.     struct obj_data  *j2=0;
  286.     struct extra_descr_data *desc;
  287.     struct follow_type *fol;
  288.     int i, virtual;
  289.     int i2;
  290.     bool found;
  291.  
  292.     /* for objects */
  293.     extern char *item_types[];
  294.     extern char *wear_bits[];
  295.     extern char *extra_bits[];
  296.     extern char *drinks[];
  297.  
  298.     /* for rooms */
  299.     extern char *dirs[];
  300.     extern char *room_bits[];
  301.     extern char *exit_bits[];
  302.     extern char *sector_types[];
  303.  
  304.     /* for chars */
  305.     extern char *equipment_types[];
  306.     extern char *affected_bits[];
  307.     extern char *apply_types[];
  308.     extern char *pc_class_types[];
  309.     extern char *npc_class_types[];
  310.     extern char *action_bits[];
  311.     extern char *player_bits[];
  312.     extern char *position_types[];
  313.     extern char *connected_types[];
  314.  
  315.     if (IS_NPC(ch))
  316.         return;
  317.  
  318.     argument = one_argument(argument, arg1);
  319.  
  320.     /* no argument */
  321.     if (!*arg1) {
  322.         send_to_char("Stats on who or what?\n\r",ch);
  323.         return;
  324.     } else {
  325.         /* stats on room */
  326.         if (!str_cmp("room", arg1)) {
  327.             rm = &world[ch->in_room];
  328.             sprintf(buf, "Room name: %s, Of zone : %d. V-Number : %d, R-number : %d\n\r",
  329.                     rm->name, rm->zone, rm->number, ch->in_room);
  330.             send_to_char(buf, ch);
  331.  
  332.             sprinttype(rm->sector_type,sector_types,buf2);
  333.             sprintf(buf, "Sector type : %s", buf2);
  334.             send_to_char(buf, ch);
  335.             
  336.             strcpy(buf,"Special procedure : ");
  337.             strcat(buf,(rm->funct) ? "Exists\n\r" : "No\n\r");
  338.             send_to_char(buf, ch);
  339.  
  340.             send_to_char("Room flags: ", ch);
  341.             sprintbit((long) rm->room_flags,room_bits,buf);
  342.             strcat(buf,"\n\r");
  343.             send_to_char(buf,ch);
  344.  
  345.             send_to_char("Description:\n\r", ch);
  346.             send_to_char(rm->description, ch);
  347.             
  348.             strcpy(buf, "Extra description keywords(s): ");
  349.             if(rm->ex_description) {
  350.                 strcat(buf, "\n\r");
  351.                 for (desc = rm->ex_description; desc; desc = desc->next) {
  352.                     strcat(buf, desc->keyword);
  353.                     strcat(buf, "\n\r");
  354.                 }
  355.                 strcat(buf, "\n\r");
  356.                 send_to_char(buf, ch);
  357.             } else {
  358.                 strcat(buf, "None\n\r");
  359.                 send_to_char(buf, ch);
  360.             }
  361.  
  362.             strcpy(buf, "------- Chars present -------\n\r");
  363.             for (k = rm->people; k; k = k->next_in_room)
  364.             {
  365.                 strcat(buf, GET_NAME(k));
  366.                 strcat(buf,(!IS_NPC(k) ? "(PC)\n\r" : (!IS_MOB(k) ? "(NPC)\n\r" : "(MOB)\n\r")));
  367.             }
  368.             strcat(buf, "\n\r");
  369.             send_to_char(buf, ch);
  370.  
  371.             strcpy(buf, "--------- Contents ---------\n\r");
  372.             for (j = rm->contents; j; j = j->next_content)
  373.             {
  374.                 strcat(buf, j->name);
  375.                 strcat(buf, "\n\r");
  376.             }
  377.             strcat(buf, "\n\r");
  378.             send_to_char(buf, ch);
  379.         
  380.             send_to_char("------- Exits defined -------\n\r", ch);
  381.             for (i = 0; i <= 5; i++) {
  382.                 if (rm->dir_option[i]) {
  383.                     sprintf(buf,"Direction %s . Keyword : %s\n\r",
  384.                             dirs[i], rm->dir_option[i]->keyword);
  385.                     send_to_char(buf, ch);
  386.                     strcpy(buf, "Description:\n\r  ");
  387.                     if(rm->dir_option[i]->general_description)
  388.                       strcat(buf, rm->dir_option[i]->general_description);
  389.                     else
  390.                         strcat(buf,"UNDEFINED\n\r");
  391.                     send_to_char(buf, ch);
  392.                     sprintbit(rm->dir_option[i]->exit_info,exit_bits,buf2);
  393.                     sprintf(buf, "Exit flag: %s \n\rKey no: %d\n\rTo room (R-Number): %d\n\r",
  394.                             buf2, rm->dir_option[i]->key,
  395.                             rm->dir_option[i]->to_room);
  396.                     send_to_char(buf, ch);
  397.                 }
  398.             }
  399.             return;
  400.         }
  401.  
  402.         /* stat on object */
  403.         if (j = get_obj_vis(ch, arg1)) {
  404.             virtual = (j->item_number >= 0) ? obj_index[j->item_number].virtual : 0;
  405.             sprintf(buf, "Object name: [%s], R-number: [%d], V-number: [%d] Item type: ",
  406.                j->name, j->item_number, virtual);
  407.             sprinttype(GET_ITEM_TYPE(j),item_types,buf2);
  408.             strcat(buf,buf2); strcat(buf,"\n\r");
  409.             send_to_char(buf, ch);
  410.             sprintf(buf, "Short description: %s\n\rLong description:\n\r%s\n\r",
  411.                     ((j->short_description) ? j->short_description : "None"),
  412.                     ((j->description) ? j->description : "None") );
  413.             send_to_char(buf, ch);
  414.             if(j->ex_description){
  415.                 strcpy(buf, "Extra description keyword(s):\n\r----------\n\r");
  416.                 for (desc = j->ex_description; desc; desc = desc->next) {
  417.                     strcat(buf, desc->keyword);
  418.                     strcat(buf, "\n\r");
  419.                 }
  420.                 strcat(buf, "----------\n\r");
  421.                 send_to_char(buf, ch);
  422.             } else {
  423.                 strcpy(buf,"Extra description keyword(s): None\n\r");
  424.                 send_to_char(buf, ch);
  425.             }
  426.  
  427.             send_to_char("Can be worn on :", ch);
  428.             sprintbit(j->obj_flags.wear_flags,wear_bits,buf);
  429.             strcat(buf,"\n\r");
  430.             send_to_char(buf, ch);
  431.  
  432.             send_to_char("Set char bits  :", ch);
  433.             sprintbit(j->obj_flags.bitvector,affected_bits,buf);
  434.             strcat(buf,"\n\r");
  435.             send_to_char(buf, ch);
  436.  
  437.             send_to_char("Extra flags: ", ch);
  438.             sprintbit(j->obj_flags.extra_flags,extra_bits,buf);
  439.             strcat(buf,"\n\r");
  440.             send_to_char(buf,ch);
  441.  
  442.             sprintf(buf,"Weight: %d, Value: %d, Cost/day: %d, Timer: %d\n\r",
  443.                    j->obj_flags.weight,j->obj_flags.cost,
  444.                    j->obj_flags.cost_per_day,  j->obj_flags.timer);
  445.             send_to_char(buf, ch);
  446.  
  447.             strcpy(buf,"In room: ");
  448.             if (j->in_room == NOWHERE)
  449.                 strcat(buf,"Nowhere");
  450.             else {
  451.                 sprintf(buf2,"%d",world[j->in_room].number);
  452.                 strcat(buf,buf2);
  453.             }
  454.             strcat(buf," ,In object: ");
  455.             strcat(buf, (!j->in_obj ? "None" : fname(j->in_obj->name)));
  456.             strcat(buf," ,Carried by:");
  457.             strcat(buf, (!j->carried_by) ? "Nobody" : GET_NAME(j->carried_by));
  458.             strcat(buf,"\n\r");
  459.             send_to_char(buf, ch);
  460.  
  461.             switch (j->obj_flags.type_flag) {
  462.                 case ITEM_LIGHT : 
  463.                     sprintf(buf, "Colour : [%d]\n\rType : [%d]\n\rHours : [%d]",
  464.                         j->obj_flags.value[0],
  465.                         j->obj_flags.value[1],
  466.                         j->obj_flags.value[2]);
  467.                     break;
  468.                 case ITEM_SCROLL : 
  469.                     sprintf(buf, "Spells : %d, %d, %d, %d",
  470.                         j->obj_flags.value[0],
  471.                          j->obj_flags.value[1],
  472.                          j->obj_flags.value[2],
  473.                          j->obj_flags.value[3] );
  474.                     break;
  475.                 case ITEM_WAND : 
  476.                     sprintf(buf, "Spell : %d\n\rMana : %d",
  477.                         j->obj_flags.value[0],
  478.                         j->obj_flags.value[1]);
  479.                     break;
  480.                 case ITEM_STAFF : 
  481.                     sprintf(buf, "Spell : %d\n\rMana : %d",
  482.                         j->obj_flags.value[0],
  483.                         j->obj_flags.value[1]);
  484.                     break;
  485.                 case ITEM_WEAPON :
  486.                     sprintf(buf, "Tohit : %d\n\rTodam : %dD%d\n\rType : %d",
  487.                         j->obj_flags.value[0],
  488.                     j->obj_flags.value[1],
  489.                     j->obj_flags.value[2],
  490.                     j->obj_flags.value[3]);
  491.                     break;
  492.                 case ITEM_FIREWEAPON : 
  493.                     sprintf(buf, "Tohit : %d\n\rTodam : %dD%d\n\rType : %d",
  494.                         j->obj_flags.value[0],
  495.                     j->obj_flags.value[1],
  496.                     j->obj_flags.value[2],
  497.                     j->obj_flags.value[3]);
  498.                     break;
  499.                 case ITEM_MISSILE : 
  500.                     sprintf(buf, "Tohit : %d\n\rTodam : %d\n\rType : %d",
  501.                         j->obj_flags.value[0],
  502.                         j->obj_flags.value[1],
  503.                         j->obj_flags.value[3]);
  504.                     break;
  505.                 case ITEM_ARMOR :
  506.                     sprintf(buf, "AC-apply : [%d]",
  507.                         j->obj_flags.value[0]);
  508.                     break;
  509.                 case ITEM_POTION : 
  510.                     sprintf(buf, "Spells : %d, %d, %d, %d",
  511.                         j->obj_flags.value[0],
  512.                         j->obj_flags.value[1],
  513.                         j->obj_flags.value[2],
  514.                         j->obj_flags.value[3]); 
  515.                     break;
  516.                 case ITEM_TRAP :
  517.                     sprintf(buf, "Spell : %d\n\r- Hitpoints : %d",
  518.                         j->obj_flags.value[0],
  519.                         j->obj_flags.value[1]);
  520.                     break;
  521.                 case ITEM_CONTAINER :
  522.                     sprintf(buf, "Max-contains : %d\n\rLocktype : %d\n\rCorpse : %s",
  523.                         j->obj_flags.value[0],
  524.                         j->obj_flags.value[1],
  525.                         j->obj_flags.value[3]?"Yes":"No");
  526.                     break;
  527.                 case ITEM_DRINKCON :
  528.                     sprinttype(j->obj_flags.value[2],drinks,buf2);
  529.                     sprintf(buf, "Max-contains : %d\n\rContains : %d\n\rPoisoned : %d\n\rLiquid : %s",
  530.                         j->obj_flags.value[0],
  531.                         j->obj_flags.value[1],
  532.                         j->obj_flags.value[3],
  533.                         buf2);
  534.                     break;
  535.                 case ITEM_NOTE :
  536.                     sprintf(buf, "Tounge : %d",
  537.                         j->obj_flags.value[0]);
  538.                     break;
  539.                 case ITEM_KEY :
  540.                     sprintf(buf, "Keytype : %d",
  541.                         j->obj_flags.value[0]);
  542.                     break;
  543.                 case ITEM_FOOD :
  544.                     sprintf(buf, "Makes full : %d\n\rPoisoned : %d",
  545.                         j->obj_flags.value[0],
  546.                         j->obj_flags.value[3]);
  547.                     break;
  548.                 default :
  549.                     sprintf(buf,"Values 0-3 : [%d] [%d] [%d] [%d]",
  550.                         j->obj_flags.value[0],
  551.                         j->obj_flags.value[1],
  552.                         j->obj_flags.value[2],
  553.                         j->obj_flags.value[3]);
  554.                     break;
  555.             }
  556.             send_to_char(buf, ch);
  557.  
  558.             strcpy(buf,"\n\rEquipment Status: ");
  559.             if (!j->carried_by)
  560.                 strcat(buf,"NONE");
  561.             else {
  562.                 found = FALSE;
  563.                 for (i=0;i < MAX_WEAR;i++) {
  564.                     if (j->carried_by->equipment[i] == j) {
  565.                         sprinttype(i,equipment_types,buf2);
  566.                         strcat(buf,buf2);
  567.                         found = TRUE;
  568.                     }
  569.                 }
  570.                 if (!found)
  571.                     strcat(buf,"Inventory");
  572.             }
  573.             send_to_char(buf, ch);
  574.  
  575.             strcpy(buf, "\n\rSpecial procedure : ");
  576.             if (j->item_number >= 0)
  577.                 strcat(buf, (obj_index[j->item_number].func ? "exists\n\r" : "No\n\r"));
  578.             else
  579.                 strcat(buf, "No\n\r");
  580.             send_to_char(buf, ch);
  581.  
  582.             strcpy(buf, "Contains :\n\r");
  583.             found = FALSE;
  584.             for(j2=j->contains;j2;j2 = j2->next_content) {
  585.                 strcat(buf,fname(j2->name));
  586.                 strcat(buf,"\n\r");
  587.                 found == TRUE;
  588.             }
  589.             if (!found)
  590.                 strcpy(buf,"Contains : Nothing\n\r");
  591.             send_to_char(buf, ch);
  592.  
  593.             send_to_char("Can affect char :\n\r", ch);
  594.             for (i=0;i<MAX_OBJ_AFFECT;i++) {
  595.                 sprinttype(j->affected[i].location,apply_types,buf2);
  596.                 sprintf(buf,"    Affects : %s By %d\n\r", buf2,j->affected[i].modifier);
  597.                 send_to_char(buf, ch);
  598.             }            
  599.             return;
  600.         }
  601.  
  602.         /* mobile in world */
  603.         if (k = get_char_vis(ch, arg1)){
  604.  
  605.             switch(k->player.sex) {
  606.                 case SEX_NEUTRAL : 
  607.                     strcpy(buf,"NEUTRAL-SEX"); 
  608.                     break;
  609.                 case SEX_MALE :
  610.                     strcpy(buf,"MALE");
  611.                     break;
  612.                 case SEX_FEMALE :
  613.                     strcpy(buf,"FEMALE");
  614.                     break;
  615.                 default : 
  616.                     strcpy(buf,"ILLEGAL-SEX!!");
  617.                     break;
  618.             }
  619.  
  620.             sprintf(buf2, " %s - Name : %s [R-Number%d], In room [%d]\n\r",
  621.                (!IS_NPC(k) ? "PC" : (!IS_MOB(k) ? "NPC" : "MOB")),
  622.                     GET_NAME(k), k->nr, world[k->in_room].number);
  623.             strcat(buf, buf2);
  624.             send_to_char(buf, ch);
  625.             if (IS_MOB(k)) {
  626.                 sprintf(buf, "V-Number [%d]\n\r", mob_index[k->nr].virtual);
  627.                 send_to_char(buf, ch);
  628.             }
  629.  
  630.             strcpy(buf,"Short description: ");
  631.             strcat(buf, (k->player.short_descr ? k->player.short_descr : "None"));
  632.             strcat(buf,"\n\r");
  633.             send_to_char(buf,ch);
  634.  
  635.             strcpy(buf,"Title: ");
  636.             strcat(buf, (k->player.title ? k->player.title : "None"));
  637.             strcat(buf,"\n\r");
  638.             send_to_char(buf,ch);
  639.  
  640.             send_to_char("Long description: ", ch);
  641.             if (k->player.long_descr)
  642.                 send_to_char(k->player.long_descr, ch);
  643.             else
  644.                 send_to_char("None", ch);
  645.             send_to_char("\n\r", ch);
  646.  
  647.             if (IS_NPC(k)) {
  648.                 strcpy(buf,"Monster Class: ");
  649.                 sprinttype(k->player.class,npc_class_types,buf2);
  650.             } else {
  651.                 strcpy(buf,"Class: ");
  652.                 sprinttype(k->player.class,pc_class_types,buf2);
  653.             }
  654.             strcat(buf, buf2);
  655.  
  656.             sprintf(buf2,"   Level [%d] Alignment[%d]\n\r",k->player.level,
  657.                           k->specials.alignment);
  658.             strcat(buf, buf2);
  659.             send_to_char(buf, ch);
  660.  
  661.             sprintf(buf,"Birth : [%ld]secs, Logon[%ld]secs, Played[%ld]secs\n\r", 
  662.                     k->player.time.birth,
  663.                     k->player.time.logon,
  664.                     k->player.time.played);
  665.  
  666.             send_to_char(buf, ch);
  667.  
  668.             sprintf(buf,"Age: [%d] Years,  [%d] Months,  [%d] Days,  [%d] Hours\n\r",
  669.                     age(k).year, age(k).month, age(k).day, age(k).hours);
  670.             send_to_char(buf,ch);
  671.  
  672.             sprintf(buf,"Height [%d]cm  Weight [%d]pounds \n\r", GET_HEIGHT(k), GET_WEIGHT(k));
  673.             send_to_char(buf,ch);
  674.  
  675.             sprintf(buf,"Hometown[%d], Speaks[%d/%d/%d], (STL[%d]/per[%d]/NSTL[%d])\n\r",
  676.                 k->player.hometown,
  677.                 k->player.talks[0],
  678.                 k->player.talks[1],
  679.                 k->player.talks[2],
  680.                 k->specials.spells_to_learn,
  681.                 int_app[GET_INT(k)].learn,
  682.                 wis_app[GET_WIS(k)].bonus);
  683.             send_to_char(buf, ch);
  684.  
  685.             sprintf(buf,"Str:[%d/%d]  Int:[%d]  Wis:[%d]  Dex:[%d]  Con:[%d]\n\r",
  686.                 GET_STR(k), GET_ADD(k),
  687.                 GET_INT(k),
  688.                 GET_WIS(k),
  689.                 GET_DEX(k),
  690.                 GET_CON(k) );
  691.             send_to_char(buf,ch);
  692.  
  693.             sprintf(buf,"Mana p.:[%d/%d+%d]  Hit p.:[%d/%d+%d]  Move p.:[%d/%d+%d]\n\r",
  694.                 GET_MANA(k),mana_limit(k),mana_gain(k),
  695.                 GET_HIT(k),hit_limit(k),hit_gain(k),
  696.                 GET_MOVE(k),move_limit(k),move_gain(k) );
  697.             send_to_char(buf,ch);
  698.  
  699.             sprintf(buf,"AC:[%d/10], Coins: [%d], Exp: [%d], Hitroll: [%d], Damroll: [%d]\n\r",
  700.                 GET_AC(k),
  701.                 GET_GOLD(k),
  702.                 GET_EXP(k),
  703.                 k->points.hitroll,
  704.                 k->points.damroll );
  705.             send_to_char(buf,ch);
  706.  
  707.             sprinttype(GET_POS(k),position_types,buf2);
  708.             sprintf(buf,"Position: %s, Fighting: %s",buf2,
  709.                     ((k->specials.fighting) ? GET_NAME(k->specials.fighting) : "Nobody") );
  710.             if (k->desc) {
  711.                 sprinttype(k->desc->connected,connected_types,buf2);
  712.                 strcat(buf,", Connected: ");
  713.                 strcat(buf,buf2);
  714.             }
  715.             strcat(buf,"\n\r");
  716.             send_to_char(buf, ch);
  717.  
  718.             strcpy(buf,"Default position: ");
  719.             sprinttype((k->specials.default_pos),position_types,buf2);
  720.             strcat(buf, buf2);
  721.             if (IS_NPC(k))
  722.             {
  723.                 strcat(buf,",NPC flags: ");
  724.                 sprintbit(k->specials.act,action_bits,buf2);
  725.             }
  726.             else
  727.             {
  728.                 strcat(buf,",PC flags: ");
  729.                 sprintbit(k->specials.act,player_bits,buf2);
  730.             }
  731.  
  732.             strcat(buf, buf2);
  733.  
  734.             sprintf(buf2,",Timer [%d] \n\r", k->specials.timer);
  735.             strcat(buf, buf2);
  736.             send_to_char(buf, ch);
  737.  
  738.             if (IS_MOB(k)) {
  739.                 strcpy(buf, "\n\rMobile Special procedure : ");
  740.                 strcat(buf, (mob_index[k->nr].func ? "Exists\n\r" : "None\n\r"));
  741.                 send_to_char(buf, ch);
  742.             }
  743.  
  744.             if (IS_NPC(k)) {
  745.                 sprintf(buf, "NPC Bare Hand Damage %dd%d.\n\r",
  746.                     k->specials.damnodice, k->specials.damsizedice);
  747.                 send_to_char(buf, ch);
  748.             }
  749.  
  750.             sprintf(buf,"Carried weight: %d   Carried items: %d\n\r",
  751.                 IS_CARRYING_W(k),
  752.                 IS_CARRYING_N(k) );
  753.             send_to_char(buf,ch);
  754.  
  755.             for(i=0,j=k->carrying;j;j=j->next_content,i++);
  756.             sprintf(buf,"Items in inventory: %d, ",i);
  757.  
  758.             for(i=0,i2=0;i<MAX_WEAR;i++)
  759.                 if (k->equipment[i]) i2++;
  760.             sprintf(buf2,"Items in equipment: %d\n\r", i2);
  761.             strcat(buf,buf2);
  762.             send_to_char(buf, ch);
  763.  
  764.             sprintf(buf,"Apply saving throws: [%d] [%d] [%d] [%d] [%d]\n\r",
  765.                     k->specials.apply_saving_throw[0],
  766.                     k->specials.apply_saving_throw[1],
  767.                     k->specials.apply_saving_throw[2],
  768.                     k->specials.apply_saving_throw[3],
  769.                     k->specials.apply_saving_throw[4]);
  770.             send_to_char(buf, ch);
  771.  
  772.             sprintf(buf, "Thirst: %d, Hunger: %d, Drunk: %d\n\r",
  773.                     k->specials.conditions[THIRST],
  774.                     k->specials.conditions[FULL],
  775.                     k->specials.conditions[DRUNK]);
  776.             send_to_char(buf, ch);
  777.  
  778.             sprintf(buf, "Master is '%s'\n\r",
  779.                 ((k->master) ? GET_NAME(k->master) : "NOBODY"));
  780.             send_to_char(buf, ch);
  781.             send_to_char("Followers are:\n\r", ch);
  782.             for(fol=k->followers; fol; fol = fol->next)
  783.                 act("    $N", FALSE, ch, 0, fol->follower, TO_CHAR);
  784.  
  785.             /* Showing the bitvector */
  786.             sprintbit(k->specials.affected_by,affected_bits,buf);
  787.             send_to_char("Affected by: ", ch);
  788.             strcat(buf,"\n\r");
  789.             send_to_char(buf, ch);
  790.  
  791.             /* Routine to show what spells a char is affected by */
  792.             if (k->affected) {
  793.                 send_to_char("\n\rAffecting Spells:\n\r--------------\n\r", ch);
  794.                 for(aff = k->affected; aff; aff = aff->next) {
  795.                     sprintf(buf, "Spell : '%s'\n\r",spells[aff->type-1]);
  796.                     send_to_char(buf, ch);
  797.                     sprintf(buf,"     Modifies %s by %d points\n\r",
  798.                         apply_types[aff->location], aff->modifier);
  799.                     send_to_char(buf, ch);
  800.                     sprintf(buf,"     Expires in %3d hours, Bits set ",
  801.                         aff->duration);
  802.                     send_to_char(buf, ch);
  803.                     sprintbit(aff->bitvector,affected_bits,buf);
  804.                     strcat(buf,"\n\r");
  805.                     send_to_char(buf, ch);
  806.                 }
  807.             }
  808.             return;
  809.         } else {
  810.             send_to_char("No mobile or object by that name in the world\n\r", ch);
  811.         }
  812.     }
  813. }
  814.  
  815.  
  816.  
  817. void do_shutdow(struct char_data *ch, char *argument, int cmd)
  818. {
  819.     send_to_char("If you want to shut something down - say so!\n\r", ch);
  820. }
  821.  
  822.  
  823.  
  824. void do_shutdown(struct char_data *ch, char *argument, int cmd)
  825. {
  826.     extern int shutdown, reboot;
  827.     char buf[100], arg[MAX_INPUT_LENGTH];
  828.  
  829.     if (IS_NPC(ch))
  830.         return;
  831.  
  832.     one_argument(argument, arg);
  833.  
  834.     if (!*arg)
  835.     {
  836.         sprintf(buf, "Shutdown by %s.", GET_NAME(ch) );
  837.         send_to_all(buf);
  838.         log(buf);
  839.         shutdown = 1;
  840.     }
  841.     else if (!str_cmp(arg, "reboot"))
  842.     {
  843.         sprintf(buf, "Reboot by %s.", GET_NAME(ch));
  844.         send_to_all(buf);
  845.         log(buf);
  846.         shutdown = reboot = 1;
  847.     }
  848.     else
  849.         send_to_char("Go shut down someone your own size.\n\r", ch);
  850. }
  851.  
  852.  
  853. void do_snoop(struct char_data *ch, char *argument, int cmd)
  854. {
  855.     static char arg[MAX_STRING_LENGTH];
  856.     struct char_data *victim;
  857.  
  858.     if (!ch->desc)
  859.         return;
  860.  
  861.     one_argument(argument, arg);
  862.  
  863.     if(!*arg)
  864.     {
  865.         send_to_char("Snoop who ?\n\r",ch);
  866.         return;
  867.     }
  868.  
  869.     if(!(victim=get_char_vis(ch, arg)))
  870.     {
  871.         send_to_char("No such person around.\n\r",ch);
  872.         return;
  873.     }
  874.  
  875.     if(!victim->desc)
  876.     {
  877.         send_to_char("There's no link.. nothing to snoop.\n\r",ch);
  878.         return;
  879.     }
  880.  
  881.     if(victim == ch)
  882.     {
  883.         send_to_char("Ok, you just snoop yourself.\n\r",ch);
  884.         if(ch->desc->snoop.snooping)
  885.             {
  886.                 ch->desc->snoop.snooping->desc->snoop.snoop_by = 0;
  887.                 ch->desc->snoop.snooping = 0;
  888.             }
  889.         return;
  890.     }
  891.  
  892.     if(victim->desc->snoop.snoop_by)    
  893.     {
  894.         send_to_char("Busy already. \n\r",ch);
  895.         return;
  896.     }
  897.  
  898.     if(GET_LEVEL(victim)>=GET_LEVEL(ch))
  899.     {
  900.         send_to_char("You failed.\n\r",ch);
  901.         return;
  902.     }
  903.  
  904.     send_to_char("Ok. \n\r",ch);
  905.  
  906.     if(ch->desc->snoop.snooping)
  907.         ch->desc->snoop.snooping->desc->snoop.snoop_by = 0;
  908.  
  909.     ch->desc->snoop.snooping = victim;
  910.     victim->desc->snoop.snoop_by = ch;
  911.     return;
  912. }
  913.  
  914.  
  915.  
  916. void do_switch(struct char_data *ch, char *argument, int cmd)
  917. {
  918.     static char arg[MAX_STRING_LENGTH];
  919.     char buf[70];
  920.     struct char_data *victim;
  921.  
  922.     if (IS_NPC(ch))
  923.         return;
  924.  
  925.     one_argument(argument, arg);
  926.     
  927.     if (!*arg)
  928.     {
  929.         send_to_char("Switch with who?\n\r", ch);
  930.     }
  931.     else
  932.     {
  933.         if (!(victim = get_char(arg)))
  934.              send_to_char("They aren't here.\n\r", ch);
  935.         else
  936.         {
  937.             if (ch == victim)
  938.             {
  939.                 send_to_char("He he he... We are jolly funny today, eh?\n\r", ch);
  940.                 return;
  941.             }
  942.  
  943.             if (!ch->desc || ch->desc->snoop.snoop_by || ch->desc->snoop.snooping)
  944.             {
  945.                 send_to_char("Mixing snoop & switch is bad for your health.\n\r", ch);
  946.                 return;
  947.             }
  948.  
  949.             if(victim->desc || (!IS_NPC(victim))) 
  950.       {
  951.                 send_to_char(
  952.            "You can't do that, the body is already in use!\n\r",ch);
  953.             }
  954.             else
  955.             {
  956.                 send_to_char("Ok.\n\r", ch);
  957.                 
  958.                 ch->desc->character = victim;
  959.                 ch->desc->original = ch;
  960.  
  961.                 victim->desc = ch->desc;
  962.                 ch->desc = 0;
  963.             }
  964.         }
  965.     }
  966. }
  967.  
  968.  
  969.  
  970. void do_return(struct char_data *ch, char *argument, int cmd)
  971. {
  972.     static char arg[MAX_STRING_LENGTH];
  973.     char buf[70];
  974.  
  975.     if(!ch->desc)
  976.         return;
  977.  
  978.     if(!ch->desc->original)
  979.    { 
  980.         send_to_char("Arglebargle, glop-glyf!?!\n\r", ch);
  981.         return;
  982.     }
  983.     else
  984.     {
  985.         send_to_char("You return to your originaly body.\n\r",ch);
  986.  
  987.         ch->desc->character = ch->desc->original;
  988.         ch->desc->original = 0;
  989.  
  990.         ch->desc->character->desc = ch->desc; 
  991.         ch->desc = 0;
  992.     }
  993. }
  994.  
  995.  
  996. void do_force(struct char_data *ch, char *argument, int cmd)
  997. {
  998.   struct descriptor_data *i;
  999.     struct char_data *vict;
  1000.     char name[100], to_force[100],buf[100]; 
  1001.  
  1002.     if (IS_NPC(ch))
  1003.         return;
  1004.  
  1005.     half_chop(argument, name, to_force);
  1006.  
  1007.     if (!*name || !*to_force)
  1008.          send_to_char("Who do you wish to force to do what?\n\r", ch);
  1009.     else if (str_cmp("all", name)) {
  1010.         if (!(vict = get_char_vis(ch, name)))
  1011.             send_to_char("No-one by that name here..\n\r", ch);
  1012.         else
  1013.         {
  1014.             if (GET_LEVEL(ch) < GET_LEVEL(vict))
  1015.                 send_to_char("Oh no you don't!!\n\r", ch);
  1016.             else {
  1017.                 sprintf(buf, "$n has forced you to '%s'.", to_force);
  1018.                 act(buf, FALSE, ch, 0, vict, TO_VICT);
  1019.                 send_to_char("Ok.\n\r", ch);
  1020.                 command_interpreter(vict, to_force);
  1021.             }
  1022.         }
  1023.     } else { /* force all */
  1024.     for (i = descriptor_list; i; i = i->next)
  1025.             if (i->character != ch && !i->connected) {
  1026.                 vict = i->character;
  1027.                 if (GET_LEVEL(ch) < GET_LEVEL(vict))
  1028.                     send_to_char("Oh no you don't!!\n\r", ch);
  1029.                 else {
  1030.                     sprintf(buf, "$n has forced you to '%s'.", to_force);
  1031.                     act(buf, FALSE, ch, 0, vict, TO_VICT);
  1032.                     command_interpreter(vict, to_force);
  1033.                 }
  1034.             }
  1035.             send_to_char("Ok.\n\r", ch);
  1036.     }
  1037. }
  1038.  
  1039.  
  1040.  
  1041. void do_load(struct char_data *ch, char *argument, int cmd)
  1042. {
  1043.     struct char_data *mob;
  1044.     struct obj_data *obj;
  1045.     char type[100], num[100], buf[100];
  1046.     int number, r_num;
  1047.  
  1048.     extern int top_of_mobt;
  1049.     extern int top_of_objt;
  1050.  
  1051.     if (IS_NPC(ch))
  1052.         return;
  1053.  
  1054.     argument_interpreter(argument, type, num);
  1055.  
  1056.     if (!*type || !*num || !isdigit(*num))
  1057.     {
  1058.         send_to_char("Syntax:\n\rload <'char' | 'obj'> <number>.\n\r", ch);
  1059.         return;
  1060.     }
  1061.  
  1062.     if ((number = atoi(num)) < 0)
  1063.     {
  1064.         send_to_char("A NEGATIVE number??\n\r", ch);
  1065.         return;
  1066.     }
  1067.     if (is_abbrev(type, "char"))
  1068.     {
  1069.         if ((r_num = real_mobile(number)) < 0)
  1070.         {
  1071.             send_to_char("There is no monster with that number.\n\r", ch);
  1072.             return;
  1073.          }
  1074.         mob = read_mobile(r_num, REAL);
  1075.         char_to_room(mob, ch->in_room);
  1076.  
  1077.         act("$n makes a quaint, magical gesture with one hand.", TRUE, ch,
  1078.             0, 0, TO_ROOM);
  1079.         act("$n has created $N!", FALSE, ch, 0, mob, TO_ROOM);
  1080.         send_to_char("Done.\n\r", ch);
  1081.     }
  1082.     else if (is_abbrev(type, "obj"))
  1083.     {
  1084.         if ((r_num = real_object(number)) < 0)
  1085.         {
  1086.             send_to_char("There is no object with that number.\n\r", ch);
  1087.             return;
  1088.         }
  1089.         obj = read_object(r_num, REAL);
  1090.         obj_to_room(obj, ch->in_room);
  1091.         act("$n makes a strange magical gesture.", TRUE, ch, 0, 0, TO_ROOM);
  1092.         act("$n has created $p!", FALSE, ch, obj, 0, TO_ROOM);
  1093.         send_to_char("Ok.\n\r", ch);
  1094.     }
  1095.     else
  1096.         send_to_char("That'll have to be either 'char' or 'obj'.\n\r", ch);
  1097. }
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103. /* clean a room of all mobiles and objects */
  1104. void do_purge(struct char_data *ch, char *argument, int cmd)
  1105. {
  1106.     struct char_data *vict, *next_v;
  1107.     struct obj_data *obj, *next_o;
  1108.  
  1109.     char name[100], buf[100];
  1110.  
  1111.     if (IS_NPC(ch))
  1112.         return;
  1113.  
  1114.     one_argument(argument, name);
  1115.  
  1116.     if (*name)  /* argument supplied. destroy single object or char */
  1117.     {
  1118.         if (vict = get_char_room_vis(ch, name))
  1119.         {
  1120.             if (!IS_NPC(vict) && (GET_LEVEL(ch)<24)) {
  1121.                 send_to_char("Fuuuuuuuuu!\n\r", ch);
  1122.                 return;
  1123.             }
  1124.  
  1125.             act("$n disintegrates $N.", FALSE, ch, 0, vict, TO_NOTVICT);
  1126.  
  1127.             if (IS_NPC(vict)) {
  1128.                 extract_char(vict);
  1129.             } else {
  1130.                 if (vict->desc) 
  1131.                 {
  1132.                     close_socket(vict->desc);
  1133.                     vict->desc = 0;
  1134.                     extract_char(vict);
  1135.                 }
  1136.                 else 
  1137.                 {
  1138.                     extract_char(vict);
  1139.                 }
  1140.             }
  1141.         }
  1142.         else if (obj = get_obj_in_list_vis(ch, name,
  1143.             world[ch->in_room].contents))
  1144.         {
  1145.             act("$n destroys $p.", FALSE, ch, obj, 0, TO_ROOM);
  1146.             extract_obj(obj);
  1147.         }
  1148.         else
  1149.         {
  1150.             send_to_char("I don't know anyone or anything by that name.\n\r", ch);
  1151.             return;
  1152.         }
  1153.  
  1154.         send_to_char("Ok.\n\r", ch);
  1155.     }
  1156.     else   /* no argument. clean out the room */
  1157.     {
  1158.         if (IS_NPC(ch))
  1159.         {
  1160.             send_to_char("Don't... You would only kill yourself..\n\r", ch);
  1161.             return;
  1162.         }
  1163.  
  1164.         act("$n gestures... You are surrounded by scorching flames!", 
  1165.             FALSE, ch, 0, 0, TO_ROOM);
  1166.         send_to_room("The world seems a little cleaner.\n\r", ch->in_room);
  1167.  
  1168.         for (vict = world[ch->in_room].people; vict; vict = next_v)
  1169.         {
  1170.             next_v = vict->next_in_room;
  1171.             if (IS_NPC(vict))
  1172.                 extract_char(vict);
  1173.         }
  1174.  
  1175.         for (obj = world[ch->in_room].contents; obj; obj = next_o)
  1176.         {
  1177.             next_o = obj->next_content;
  1178.             extract_obj(obj);
  1179.         }
  1180.     }
  1181. }
  1182.  
  1183.  
  1184.  
  1185. /* Give pointers to the five abilities */
  1186. void roll_abilities(struct char_data *ch)
  1187. {
  1188.     int i, j, k, temp;
  1189.     ubyte table[5];
  1190.     ubyte rools[4];
  1191.  
  1192.     for(i=0; i<5; table[i++]=0)  ;
  1193.  
  1194.     for(i=0; i<5; i++) {
  1195.  
  1196.         for(j=0; j<4; j++)
  1197.             rools[j] = number(1,6);
  1198.         
  1199.         temp = rools[0]+rools[1]+rools[2]+rools[3] -
  1200.                    MIN(rools[0], MIN(rools[1], MIN(rools[2],rools[3])));
  1201.  
  1202.         for(k=0; k<5; k++)
  1203.             if (table[k] < temp)
  1204.                 SWITCH(temp, table[k]);
  1205.     }
  1206.  
  1207.     ch->abilities.str_add = 0;
  1208.  
  1209.     switch (GET_CLASS(ch)) {
  1210.         case CLASS_MAGIC_USER: {
  1211.             ch->abilities.intel = table[0];
  1212.             ch->abilities.wis = table[1];
  1213.             ch->abilities.dex = table[2];
  1214.             ch->abilities.str = table[3];
  1215.             ch->abilities.con = table[4];
  1216.         }    break;
  1217.         case CLASS_CLERIC: {
  1218.             ch->abilities.wis = table[0];
  1219.             ch->abilities.intel = table[1];
  1220.             ch->abilities.str = table[2];
  1221.             ch->abilities.dex = table[3];
  1222.             ch->abilities.con = table[4];
  1223.         } break;
  1224.         case CLASS_THIEF: {
  1225.             ch->abilities.dex = table[0];
  1226.             ch->abilities.str = table[1];
  1227.             ch->abilities.con = table[2];
  1228.             ch->abilities.intel = table[3];
  1229.             ch->abilities.wis = table[4];
  1230.         } break;
  1231.         case CLASS_WARRIOR: {
  1232.             ch->abilities.str = table[0];
  1233.             ch->abilities.dex = table[1];
  1234.             ch->abilities.con = table[2];
  1235.             ch->abilities.wis = table[3];
  1236.             ch->abilities.intel = table[4];
  1237.             if (ch->abilities.str == 18)
  1238.                 ch->abilities.str_add = number(0,100);
  1239.         } break;
  1240.     }
  1241.     ch->tmpabilities = ch->abilities;
  1242. }
  1243.  
  1244.  
  1245.  
  1246. void do_start(struct char_data *ch)
  1247. {
  1248.     int i, j;
  1249.     byte table[5];
  1250.     byte rools[4];
  1251.  
  1252.     extern struct dex_skill_type dex_app_skill[];
  1253.     void advance_level(struct char_data *ch);
  1254.  
  1255.     send_to_char("Welcome. This is now you character in DikuMud,\n\rYou can now earn XP, and lots more...\n\r", ch);
  1256.  
  1257.     GET_LEVEL(ch) = 1;
  1258.     GET_EXP(ch) = 1;
  1259.  
  1260.     set_title(ch);
  1261.  
  1262.     roll_abilities(ch);
  1263.  
  1264.     ch->points.max_hit  = 10;  /* These are BASE numbers   */
  1265.  
  1266.     switch (GET_CLASS(ch)) {
  1267.  
  1268.         case CLASS_MAGIC_USER : {
  1269.         } break;
  1270.  
  1271.         case CLASS_CLERIC : {
  1272.         } break;
  1273.  
  1274.         case CLASS_THIEF : {
  1275.             ch->skills[SKILL_SNEAK].learned = 10;
  1276.             ch->skills[SKILL_HIDE].learned =  5;
  1277.             ch->skills[SKILL_STEAL].learned = 15;
  1278.             ch->skills[SKILL_BACKSTAB].learned = 10;
  1279.             ch->skills[SKILL_PICK_LOCK].learned = 10;
  1280.         } break;
  1281.  
  1282.         case CLASS_WARRIOR: {
  1283.         } break;
  1284.     }
  1285.  
  1286.     advance_level(ch);
  1287.  
  1288.     GET_HIT(ch) = hit_limit(ch);
  1289.     GET_MANA(ch) = mana_limit(ch);
  1290.     GET_MOVE(ch) = move_limit(ch);
  1291.  
  1292.     GET_COND(ch,THIRST) = 24;
  1293.     GET_COND(ch,FULL) = 24;
  1294.     GET_COND(ch,DRUNK) = 0;
  1295.  
  1296.   ch->player.time.played = 0;
  1297.   ch->player.time.logon = time(0);
  1298.  
  1299. }
  1300.  
  1301.  
  1302. void do_advance(struct char_data *ch, char *argument, int cmd)
  1303. {
  1304.     struct char_data *victim;
  1305.     char name[100], level[100], buf[240];
  1306.     int adv, newlevel;
  1307.  
  1308.     void gain_exp(struct char_data *ch, int gain);
  1309.  
  1310.     if (IS_NPC(ch))
  1311.         return;
  1312.  
  1313.     argument_interpreter(argument, name, level);
  1314.  
  1315.     if (*name)
  1316.     {
  1317.         if (!(victim = get_char_room_vis(ch, name)))
  1318.         {
  1319.             send_to_char("That player is not here.\n\r", ch);
  1320.             return;
  1321.         }
  1322.     } else {
  1323.         send_to_char("Advance who?\n\r", ch);
  1324.         return;
  1325.     }
  1326.  
  1327.     if (IS_NPC(victim)) {
  1328.         send_to_char("NO! Not on NPC's.\n\r", ch);
  1329.         return;
  1330.     }
  1331.  
  1332.     if (GET_LEVEL(victim) == 0)
  1333.         adv = 1;
  1334.     else if (!*level) {
  1335.         send_to_char("You must supply a level number.\n\r", ch);
  1336.         return;
  1337.     } else {
  1338.         if (!isdigit(*level))
  1339.         {
  1340.             send_to_char("Second argument must be a positive integer.\n\r",ch);
  1341.             return;
  1342.         }
  1343.         if ((newlevel = atoi(level)) <= GET_LEVEL(victim))
  1344.         {
  1345.             send_to_char("Can't dimish a players status (yet).\n\r", ch);
  1346.             return;
  1347.         }
  1348.         adv = newlevel - GET_LEVEL(victim);
  1349.     }
  1350.  
  1351.     if (((adv + GET_LEVEL(victim)) > 1) && (GET_LEVEL(ch) < 24))
  1352.     {
  1353.         send_to_char("Thou art not godly enough.\n\r", ch);
  1354.         return;
  1355.     }
  1356.  
  1357.     if ((adv + GET_LEVEL(victim)) > 24)
  1358.     {
  1359.         send_to_char("24 is the highest possible level.\n\r", ch);
  1360.         return;
  1361.     }
  1362.  
  1363.     if (((adv + GET_LEVEL(victim)) < 21)&&((adv + GET_LEVEL(victim)) != 1))
  1364.     {
  1365.         send_to_char("21 is the lowest possible level.\n\r", ch);
  1366.         return;
  1367.     }
  1368.  
  1369.     send_to_char("You feel generous.\n\r", ch);
  1370.   act("$n makes some strange gestures.\n\rA strange feeling comes uppon you,"
  1371.             "\n\rLike a giant hand, light comes down from\n\rabove, grabbing your "
  1372.             "body, that begins\n\rto pulse with coloured lights from inside.\n\rYo"
  1373.             "ur head seems to be filled with deamons\n\rfrom another plane as your"
  1374.             " body dissolves\n\rto the elements of time and space itself.\n\rSudde"
  1375.             "nly a silent explosion of light snaps\n\ryou back to reality. You fee"
  1376.             "l slightly\n\rdifferent.",FALSE,ch,0,victim,TO_VICT);
  1377.  
  1378.  
  1379.     if (GET_LEVEL(victim) == 0) {
  1380.         do_start(victim);
  1381.     } else {
  1382.         if (GET_LEVEL(victim) < 24) {
  1383.             gain_exp_regardless(victim, (titles[GET_CLASS(victim)-1][
  1384.                 GET_LEVEL(victim)+adv].exp)-GET_EXP(victim));
  1385.             send_to_char("WARNING! Was not level 0.\n\r", ch);
  1386.         } else {
  1387.             send_to_char("Some idiot just tried to advance your level.\n\r",
  1388.                 victim);
  1389.             send_to_char("IMPOSSIBLE! IDIOTIC!\n\r", ch);
  1390.         }
  1391.     }
  1392. }
  1393.  
  1394.  
  1395. void do_reroll(struct char_data *ch, char *argument, int cmd)
  1396. {
  1397.     struct char_data *victim;
  1398.     char buf[100];
  1399.     sh_int target;
  1400.  
  1401.     if (IS_NPC(ch))
  1402.         return;
  1403.  
  1404.     one_argument(argument,buf);
  1405.     if (!*buf)
  1406.         send_to_char("Who do you wich to reroll?\n\r",ch);
  1407.     else
  1408.         if(!(victim = get_char(buf)))
  1409.             send_to_char("No-one by that name in the world.\n\r",ch);
  1410.         else {
  1411.             send_to_char("Rerolled...\n\r", ch);
  1412.             roll_abilities(victim);
  1413.         }
  1414. }
  1415.  
  1416.  
  1417. void do_restore(struct char_data *ch, char *argument, int cmd)
  1418. {
  1419.     struct char_data *victim;
  1420.     char buf[100];
  1421.     int i;
  1422.  
  1423.     void update_pos( struct char_data *victim );
  1424.  
  1425.     if (IS_NPC(ch))
  1426.         return;
  1427.  
  1428.     one_argument(argument,buf);
  1429.     if (!*buf)
  1430.         send_to_char("Who do you wich to restore?\n\r",ch);
  1431.     else
  1432.         if(!(victim = get_char(buf)))
  1433.             send_to_char("No-one by that name in the world.\n\r",ch);
  1434.         else {
  1435.             GET_MANA(victim) = GET_MAX_MANA(victim);
  1436.             GET_HIT(victim) = GET_MAX_HIT(victim);
  1437.             GET_MOVE(victim) = GET_MAX_MOVE(victim);
  1438.  
  1439.             if (GET_LEVEL(victim) >= 21) {
  1440.                 for (i = 0; i < MAX_SKILLS; i++) {
  1441.                     victim->skills[i].learned = 100;
  1442.                     victim->skills[i].recognise = TRUE;
  1443.                 }
  1444.  
  1445.                 if (GET_LEVEL(victim) >= 23) {
  1446.                     victim->abilities.str_add = 100;
  1447.                     victim->abilities.intel = 25;
  1448.                     victim->abilities.wis = 25;
  1449.                     victim->abilities.dex = 25;
  1450.                     victim->abilities.str = 25;
  1451.                     victim->abilities.con = 25;
  1452.                 }
  1453.                 victim->tmpabilities = victim->abilities;
  1454.  
  1455.             }
  1456.             update_pos( victim );
  1457.             send_to_char("Done.\n\r", ch);
  1458.             act("You have been fully healed by $N!", FALSE, victim, 0, ch, TO_CHAR);
  1459.         }
  1460. }
  1461.  
  1462.  
  1463.  
  1464.  
  1465. do_noshout(struct char_data *ch, char *argument, int cmd)
  1466. {
  1467.     struct char_data *vict;
  1468.     struct obj_data *dummy;
  1469.     char buf[MAX_INPUT_LENGTH];
  1470.  
  1471.     if (IS_NPC(ch))
  1472.         return;
  1473.  
  1474.     one_argument(argument, buf);
  1475.  
  1476.     if (!*buf)
  1477.         if (IS_SET(ch->specials.act, PLR_NOSHOUT))
  1478.         {
  1479.             send_to_char("You can now hear shouts again.\n\r", ch);
  1480.             REMOVE_BIT(ch->specials.act, PLR_NOSHOUT);
  1481.         }
  1482.         else
  1483.         {
  1484.             send_to_char("From now on, you won't hear shouts.\n\r", ch);
  1485.             SET_BIT(ch->specials.act, PLR_NOSHOUT);
  1486.         }
  1487.     else if (!generic_find(argument, FIND_CHAR_WORLD, ch, &vict, &dummy))
  1488.         send_to_char("Couldn't find any such creature.\n\r", ch);
  1489.     else if (IS_NPC(vict))
  1490.         send_to_char("Can't do that to a beast.\n\r", ch);
  1491.     else if (GET_LEVEL(vict) > GET_LEVEL(ch))
  1492.         act("$E might object to that.. better not.", 0, ch, 0, vict, TO_CHAR);
  1493.     else if (IS_SET(vict->specials.act, PLR_NOSHOUT))
  1494.     {
  1495.         send_to_char("You can shout again.\n\r", vict);
  1496.         send_to_char("NOSHOUT removed.\n\r", ch);
  1497.         REMOVE_BIT(vict->specials.act, PLR_NOSHOUT);
  1498.     }
  1499.     else
  1500.     {
  1501.         send_to_char("The gods take away your ability to shout!\n\r", vict);
  1502.         send_to_char("NOSHOUT set.\n\r", ch);
  1503.         SET_BIT(vict->specials.act, PLR_NOSHOUT);
  1504.     }
  1505. }
  1506.