Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

act_wiz.c

Go to the documentation of this file.
00001 /***************************************************************************
00002  *  Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,        *
00003  *  Michael Seifert, Hans Henrik Strfeldt, Tom Madsen, and Katja Nyboe.    *
00004  *                                                                         *
00005  *  Merc Diku Mud improvments copyright (C) 1992, 1993 by Michael          *
00006  *  Chastain, Michael Quan, and Mitchell Tse.                              *
00007  *                                                                         *
00008  *  In order to use any part of this Merc Diku Mud, you must comply with   *
00009  *  both the original Diku license in 'license.doc' as well the Merc       *
00010  *  license in 'license.txt'.  In particular, you may not remove either of *
00011  *  these copyright notices.                                               *
00012  *                                                                         *
00013  *  Much time and thought has gone into this software and you are          *
00014  *  benefitting.  We hope that you share your changes too.  What goes      *
00015  *  around, comes around.                                                  *
00016  **************************************************************************/
00017 
00018 /***************************************************************************
00019  *   ROM 2.4 is copyright 1993-1998 Russ Taylor                            *
00020  *   ROM has been brought to you by the ROM consortium                     *
00021  *       Russ Taylor (rtaylor@hypercube.org)                               *
00022  *       Gabrielle Taylor (gtaylor@hypercube.org)                          *
00023  *       Brian Moore (zump@rom.org)                                        *
00024  *   By using this code, you have agreed to follow the terms of the        *
00025  *   ROM license, in the file Rom24/doc/rom.license                        *
00026  **************************************************************************/
00027 
00028 /*   QuickMUD - The Lazy Man's ROM - $Id: act_wiz.c,v 1.3 2000/12/01 10:48:33 ring0 Exp $ */
00029 
00030 #if defined(macintosh)
00031 #include <types.h>
00032 #include <time.h>
00033 #else
00034 #include <sys/types.h>
00035 #include <sys/time.h>
00036 #endif
00037 #include <stdio.h>
00038 #include <string.h>
00039 #include <stdlib.h>
00040 #include <unistd.h>                /* For execl in copyover() */
00041 #include "merc.h"
00042 #include "interp.h"
00043 #include "recycle.h"
00044 #include "tables.h"
00045 #include "lookup.h"
00046 
00047 /*
00048  * Stolen from save.c for reading in QuickMUD config stuff
00049  */
00050 #if defined(KEY)
00051 #undef KEY
00052 #endif
00053 
00054 #define KEY( literal, field, value )            \
00055                 if ( !str_cmp( word, literal ) )    \
00056         {                   \
00057             field  = value;         \
00058             fMatch = TRUE;          \
00059             break;              \
00060         }
00061 
00062 /*
00063  * Local functions.
00064  */
00065 ROOM_INDEX_DATA *find_location args ((CHAR_DATA * ch, char *arg));
00066 
00067 
00068 void do_wiznet (CHAR_DATA * ch, char *argument)
00069 {
00070     int flag;
00071     char buf[MAX_STRING_LENGTH];
00072 
00073     if (argument[0] == '\0')
00074     {
00075         if (IS_SET (ch->wiznet, WIZ_ON))
00076         {
00077             send_to_char ("Signing off of Wiznet.\n\r", ch);
00078             REMOVE_BIT (ch->wiznet, WIZ_ON);
00079         }
00080         else
00081         {
00082             send_to_char ("Welcome to Wiznet!\n\r", ch);
00083             SET_BIT (ch->wiznet, WIZ_ON);
00084         }
00085         return;
00086     }
00087 
00088     if (!str_prefix (argument, "on"))
00089     {
00090         send_to_char ("Welcome to Wiznet!\n\r", ch);
00091         SET_BIT (ch->wiznet, WIZ_ON);
00092         return;
00093     }
00094 
00095     if (!str_prefix (argument, "off"))
00096     {
00097         send_to_char ("Signing off of Wiznet.\n\r", ch);
00098         REMOVE_BIT (ch->wiznet, WIZ_ON);
00099         return;
00100     }
00101 
00102     /* show wiznet status */
00103     if (!str_prefix (argument, "status"))
00104     {
00105         buf[0] = '\0';
00106 
00107         if (!IS_SET (ch->wiznet, WIZ_ON))
00108             strcat (buf, "off ");
00109 
00110         for (flag = 0; wiznet_table[flag].name != NULL; flag++)
00111             if (IS_SET (ch->wiznet, wiznet_table[flag].flag))
00112             {
00113                 strcat (buf, wiznet_table[flag].name);
00114                 strcat (buf, " ");
00115             }
00116 
00117         strcat (buf, "\n\r");
00118 
00119         send_to_char ("Wiznet status:\n\r", ch);
00120         send_to_char (buf, ch);
00121         return;
00122     }
00123 
00124     if (!str_prefix (argument, "show"))
00125         /* list of all wiznet options */
00126     {
00127         buf[0] = '\0';
00128     int col;
00129     col = 0;
00130     send_to_char("Wiznet options available for you, are:\n\r",ch);
00131 
00132         for (flag = 0; wiznet_table[flag].name != NULL; flag++)
00133         {
00134             if (wiznet_table[flag].level <= get_trust (ch))
00135             {
00136                 sprintf(buf, "{c%-10s{x[%-7s{x]%-3s{x", wiznet_table[flag].name, IS_SET(ch->wiznet, wiznet_table[flag].flag) ? "{RON{x" : "{DOFF{x", "");
00137         //strcat (buf, " ");
00138         send_to_char(buf,ch);
00139         if (++col % 3 == 0)
00140             send_to_char("\n\r",ch);
00141         
00142         }
00143         }
00144 
00145  //       send_to_char ("Wiznet options available to you are:\n\r", ch);
00146 //  send_to_char(buf_string(buffer),ch);
00148         return;
00149     }
00150 
00151     flag = wiznet_lookup (argument);
00152 
00153     if (flag == -1 || get_trust (ch) < wiznet_table[flag].level)
00154     {
00155         send_to_char ("No such option.\n\r", ch);
00156         return;
00157     }
00158 
00159     if (IS_SET (ch->wiznet, wiznet_table[flag].flag))
00160     {
00161         sprintf (buf, "You will no longer see %s on wiznet.\n\r",
00162                  wiznet_table[flag].name);
00163         send_to_char (buf, ch);
00164         REMOVE_BIT (ch->wiznet, wiznet_table[flag].flag);
00165         return;
00166     }
00167     else
00168     {
00169         sprintf (buf, "You will now see %s on wiznet.\n\r",
00170                  wiznet_table[flag].name);
00171         send_to_char (buf, ch);
00172         SET_BIT (ch->wiznet, wiznet_table[flag].flag);
00173         return;
00174     }
00175 
00176 }
00177 
00178 void wiznet (char *string, CHAR_DATA * ch, OBJ_DATA * obj,
00179              long flag, long flag_skip, int min_level)
00180 {
00181     DESCRIPTOR_DATA *d;
00182     if (string == NULL || string[0] == '\0')
00183         return;
00184 
00185     for (d = descriptor_list; d != NULL; d = d->next)
00186     {
00187         if (d->connected == CON_PLAYING && IS_IMMORTAL (d->character)
00188             && IS_SET (d->character->wiznet, WIZ_ON)
00189             && (!flag || IS_SET (d->character->wiznet, flag))
00190             && (!flag_skip || !IS_SET (d->character->wiznet, flag_skip))
00191             && get_trust (d->character) >= min_level && d->character != ch)
00192         {
00193             if (IS_SET (d->character->wiznet, WIZ_PREFIX))
00194                 send_to_char ("{RWIZNET{x ", d->character);
00195             else
00196                 send_to_char ("{x", d->character);
00197             act_new (string, d->character, obj, ch, TO_CHAR, POS_DEAD);
00198             send_to_char ("{x", d->character);
00199         }
00200     }
00201 
00202     return;
00203 }
00204 void do_gstat (CHAR_DATA *ch, char *argument)
00205 {
00206     extern unsigned long int r_count;
00207     extern unsigned long int s_count;
00208     extern unsigned long int m_count;
00209     extern unsigned long int o_count;
00210     extern unsigned long int reset_count;
00211     extern unsigned long int h_count;
00212     extern unsigned long int so_count;
00213     extern unsigned long int v_count;
00214 
00215     send_to_char("{cGame Stats:\n\r-------------------------{x\n\r",ch);
00216     printf_to_char(ch, "{cRooms    {R[{c%d{R]{x\n\r",r_count);
00217     printf_to_char(ch, "{cMobs     {R[{c%d{R]{x\n\r", m_count);
00218     printf_to_char(ch, "{cObjects  {R[{c%d{R]{x\n\r",o_count);
00219     printf_to_char(ch, "{cResets   {R[{c%d{R]{x\n\r",reset_count);
00220     printf_to_char(ch, "{cShops    {R[{c%d{R]{x\n\r",s_count);
00221     printf_to_char(ch, "{cHelps    {R[{c%d{R]{x\n\r", h_count);
00222     printf_to_char(ch, "{cSocials  {R[{c%d{R]{x\n\r", so_count);
00223     printf_to_char(ch, "{cVehicles {R[{c%d{R]{x\n\r",v_count);
00224     send_to_char("{c-------------------------{x\n\r",ch);
00225     return;
00226 }
00227 
00228 
00229 /* lag a player :) */
00230 void do_lag (CHAR_DATA *ch, char *argument)
00231 {
00232     
00233     CHAR_DATA *victim;
00234     char arg1[MAX_STRING_LENGTH]; /* overkill!*/
00235 
00236     argument = one_argument(argument, arg1);
00237 
00238     if (argument[0] == '\0' || arg1 == '\0')
00239     {
00240         send_to_char("Lag <who> <harshness>\n\r",ch);
00241         return;
00242     }
00243 
00244     if ((victim = get_char_world(ch, arg1)) == NULL)
00245     {
00246         send_to_char("They arn't here.\n\r",ch);
00247         return;
00248     }
00249 
00250     if (victim == ch)
00251     {
00252         send_to_char("Now why on earth would you lag yourself?\n\r",ch);
00253         return;
00254     }
00255     if (victim->level >= ch->level)
00256     {
00257         send_to_char ("That isn't right! You know that gets logged, right?\n\r",ch);
00258         return;
00259     }
00260 
00261 
00262     if (!is_number(argument))
00263     {
00264         send_to_char("<hardness> must be a number.\n\r",ch);
00265         return;
00266     }
00267 
00268     if (atoi(argument) > 50)
00269     {
00270         send_to_char ("Thats a little much, don't you think?\n\r",ch);
00271         return;
00272     }
00273 
00274     send_to_char("AIEEEEEE!!! The lag monster has attacked you!\n\r",victim);
00275     WAIT_STATE (victim, atoi(argument));
00276     send_to_char("You are really mean, you know that, right?\n\r",ch);
00277     return;
00278 }
00279 /* Set an immtitle */
00280 void do_immtitle (CHAR_DATA *ch, char * argument)
00281 {
00282     CHAR_DATA *victim;
00283     char arg[MAX_STRING_LENGTH];
00284     char buf[MAX_STRING_LENGTH];
00285     
00286     argument = one_argument(argument, arg);
00287 
00288     if (arg[0] == '\0' || argument[0] == '\0')
00289     {
00290         send_to_char("Syntax: immtitle <person> <title>\n\r",ch);
00291         return;
00292     }
00293 
00294     if ((victim = get_char_world(ch, arg)) == NULL)
00295     {
00296         send_to_char("They are currently not playing.\n\r",ch);
00297         return;
00298     }
00299     if (IS_NPC(victim))
00300     {
00301         send_to_char("Not on NPCs!\n\r",ch);
00302         return;
00303     }
00304     if (victim->level < LEVEL_IMMORTAL)
00305     {
00306         sprintf(buf, "%s must be atleast level %d\n\r", victim->name, LEVEL_IMMORTAL);
00307         send_to_char(buf,ch);
00308         return;
00309     }
00310     victim->pcdata->imm_title = NULL;
00311     victim->pcdata->imm_title = str_dup(argument);
00312     if (victim == ch)
00313     {
00314         sprintf(buf, "Your immtitle has been set to %s.\n\r", str_dup(argument));
00315         send_to_char(buf, ch);
00316         return;
00317     }
00318     else
00319     {
00320         sprintf(buf, "%s's immtitle has been set to %s.\n\r", victim->name, str_dup(argument));
00321         send_to_char(buf,ch);
00322         sprintf(buf, "Your immtitle has been set to %s.\n\r", str_dup(argument));
00323         send_to_char(buf,victim);
00324         return;
00325     }
00326     send_to_char("Error.\n\r",ch);
00327     return;
00328 }
00329 
00330     
00331 /* Set a player's look stuff */
00332 void do_cset (CHAR_DATA *ch, char *argument)
00333 {
00334     CHAR_DATA *victim;
00335     char arg[MAX_STRING_LENGTH];
00336     char arg2[MAX_STRING_LENGTH];
00337     char buf[MAX_STRING_LENGTH];
00338     bool same;
00339     same = FALSE;  /* to shut the compiler the hell up! */
00340     
00341     argument = one_argument(argument, arg);
00342     argument = one_argument(argument, arg2);
00343 
00344     if (arg[0] == '\0' || arg2[0] == '\0' || argument[0] == '\0')
00345     {
00346         send_to_char("Syntax - cset <person> <field> <info>\n\r"
00347                 "Field - eyes, hairlength, hairtype, haircolor, bodytype, facialhair\n\r",ch);
00348         return;
00349     }
00350     if ((victim = get_char_world(ch, arg)) == NULL)
00351     {
00352         send_to_char("They are currently not playing.\n\r",ch);
00353         return;
00354     }
00355     if (IS_NPC(victim))
00356     {
00357         send_to_char("Not on NPCs!\n\r",ch);
00358         return;
00359     }
00360     if (victim == ch)
00361         same = TRUE;
00362     
00363     /*if (str_prefix(arg2, "eyes") || str_prefix(arg2, "hairlength") 
00364             || str_prefix(arg2, "hairtype") || str_prefix(arg2, "haircolor")
00365             || str_prefix(arg2, "bodytype") || str_prefix(arg2, "facialhair"))
00366     {
00367         send_to_char("Invalid field. Valid fields:\n\r"
00368                 "eyes, hairlength, hairtype, haircolor, bodytype, facialhair\n\r",ch);
00369         return;
00370     }
00371     */
00372     if (!str_prefix(arg2, "eyes"))
00373     {
00374         free_string(victim->pcdata->eyecolor);
00375         victim->pcdata->eyecolor = str_dup(argument);
00376         if (!same)
00377         {
00378             sprintf(buf, "%s's eye color set to %s\n\r", victim->name, argument);
00379             send_to_char(buf,ch);
00380         }
00381         sprintf(buf, "Your eye color has been set to %s\n\r", argument);
00382         send_to_char(buf,victim);
00383         return;
00384     
00385     }
00386     if (!str_prefix(arg2, "hairlength"))
00387     {
00388         free_string(victim->pcdata->hairlength);
00389         victim->pcdata->hairlength = str_dup(argument);
00390         if (!same)
00391         {
00392             sprintf(buf, "%s's hairlength has been set to %s\n\r", victim->name, argument);
00393             send_to_char(buf,ch);
00394         }
00395         sprintf(buf, "Your hair length has been set to %s\n\r",argument);
00396         send_to_char(buf,victim);
00397         return;
00398     }
00399     if (!str_prefix(arg2, "hairtype"))
00400     {
00401         free_string(victim->pcdata->hairtype);
00402         victim->pcdata->hairtype = str_dup(argument);
00403         if (!same)
00404         {
00405             sprintf(buf, "%s's hair type set to %s\n\r", victim->name, argument);
00406             send_to_char(buf,ch);
00407         }
00408         sprintf(buf, "Your hair type has been set to %s\n\r",argument);
00409         send_to_char(buf,victim);
00410         return;
00411     }
00412     if (!str_prefix(arg2, "haircolor"))
00413     {
00414         free_string(victim->pcdata->haircolor);
00415         victim->pcdata->haircolor = str_dup(argument);
00416         if (!same)
00417         {
00418             sprintf(buf, "%s's hair color set to %s\n\r", victim->name, argument);
00419             send_to_char(buf,ch);
00420         }
00421         
00422         sprintf(buf, "Your hair color has been set to %s\n\r", argument);
00423         send_to_char(buf, victim);
00424         return;
00425     }
00426     if (!str_prefix(arg2, "bodytype"))
00427     {
00428         free_string(victim->pcdata->bodytype);
00429         victim->pcdata->bodytype = str_dup(argument);
00430         if (!same)
00431         {
00432             sprintf(buf, "%s's body type set to %s\n\r", victim->name, argument);
00433             send_to_char(buf,ch);
00434         }
00435         
00436         sprintf(buf, "Your boy type set to %s\n\r", argument);
00437         send_to_char(buf, victim);
00438         return;
00439     }
00440     if (!str_prefix(arg2, "facialhair"))
00441     {
00442         free_string(victim->pcdata->facialhair);
00443         victim->pcdata->facialhair = str_dup(argument);
00444         if (!same)
00445         {
00446             sprintf(buf, "%s's facial hair set to %s\n\r", victim->name, argument);
00447             send_to_char(buf,ch);
00448         }
00449         sprintf(buf, "Your facial hair set to %s\n\r", argument);
00450         send_to_char(buf, victim);
00451         return;
00452     }
00453     send_to_char("Invalid Field.\n\r",ch);
00454     return;
00455 }
00456 
00457         
00458 
00459 
00460 /*
00461 void do_nogoto (CHAR_DATA *ch, char *argument)
00462 {
00463     if (argument[0] == '\0')
00464     {
00465         if (IS_SET(ch->chann,WIZ_NOGOTO))
00466         {
00467             send_to_char("You are now allow people to 'goto' you.\n\r",ch);
00468             REMOVE_BIT(ch->chann, WIZ_NOGOTO);
00469         }
00470         else
00471         {
00472             send_to_char ("You will no longer be able to 'goto' to.\n\r", ch);
00473             SET_BIT (ch->chann, WIZ_NOGOTO);
00474         }
00475         return;
00476     }
00477     REMOVE_BIT (ch->chann, WIZ_NOGOTO);
00478     return;
00479 }
00480 */
00481 
00482 
00483 void do_notrans (CHAR_DATA *ch, char *argument)
00484 {
00485 //DESCRIPTOR_DATA *d;
00486 
00487 //char arg1[MAX_INPUT_LENGTH];
00488 //char arg2[MAX_INPUT_LENGTH];
00489 //ROOM_INDEX_DATA *location;
00490 //DESCRIPTOR_DATA *d;
00491 CHAR_DATA *victim;
00492 //argument = one_argument (argument, arg1);
00493 //argument = one_argument (argument, arg2);
00494 //if (argument[0] == '\0')
00495   //  {
00496   if (argument[0] == '\0')
00497   {  
00498 
00499     if (IS_SET (ch->comm, WIZ_NOTRANS))
00500         {
00501             send_to_char ("You are now able to be transed from other IMMs.\n\r", ch);
00502             REMOVE_BIT (ch->comm, WIZ_NOTRANS);
00503         }
00504         else
00505         {
00506             send_to_char ("You will no longer be able to be transed from IMMs.\n\r", ch);
00507             SET_BIT (ch->comm, WIZ_NOTRANS);
00508         }
00509         return;
00510     }
00511   
00512   
00513 //  if((victim = get_char_world(ch,argument)) == NULL)
00514     if((victim = get_char_world (ch, argument)) == NULL)
00515     {
00516         send_to_char("they arn't here.\n\r",ch);
00517         return;
00518     }
00519     
00520         if(ch->level < 60)
00521         {
00522             send_to_char ("Invalid use.\n\r",ch);
00523         return;
00524         }
00525     
00526         if(IS_SET(victim->comm, WIZ_NOTRANS))
00527         {
00528             send_to_char("Their notrans bit has been removed.\n\r",ch);
00529             REMOVE_BIT(victim->comm, WIZ_NOTRANS);
00530             return;
00531         }
00532         if (!IS_SET(victim->comm, WIZ_NOTRANS))
00533         {
00534             send_to_char("They are currently able to be transed. Bit not removed. \n\r",ch);
00535             return;
00536         }
00537   
00538 
00539 
00540 
00541         
00542    
00543  // REMOVE_BIT (ch->comm, WIZ_NOTRANS);
00544 return;
00545 }    
00546 
00547 void do_kcshow (CHAR_DATA *ch, char *argument)
00548 {
00549     BUFFER *buffer;
00550     char buf[MAX_STRING_LENGTH];
00551     int runner,col=0;
00552     buffer = new_buf();
00553     add_buf(buffer, "\n\r{xKingdoms:{x\n\r");
00554 
00555     for (runner = 1; runner < MAX_KINGDOM; runner++)
00556     {
00557         
00558         sprintf(buf, "{c%-2d{x) {W%-15.15s{x", runner, kingdom_table[runner].name);
00559         add_buf(buffer, buf);
00560         if (++col % 3 == 0)
00561             add_buf(buffer, "\n\r");
00562     }
00563     add_buf(buffer, "\n\r{xClans:\n\r");
00564     col=0;
00565     for (runner = 1; runner < MAX_CLAN; runner++)
00566     {
00567         sprintf(buf, "{c%-2d{x) {W%-15.15s{x", runner, clan_table[runner].name);
00568         add_buf(buffer, buf);
00569         if (++col % 3 == 0)
00570             add_buf(buffer, "\n\r");
00571     }
00572     page_to_char(buf_string(buffer), ch);
00573     free_buf(buffer);
00574     return;
00575 }
00576 
00577 
00578 
00579 
00580 void do_port (CHAR_DATA *ch, char *argument)
00581 {
00582     if (IS_SET (ch->pcdata->immortal, IMMORTAL_PORT))
00583     {
00584         send_to_char("You will no longer see the port in your prompt.\n\r",ch);
00585         REMOVE_BIT(ch->pcdata->immortal, IMMORTAL_PORT);
00586         return;
00587     }
00588     send_to_char("You will now see the port in your prompt.\n\r",ch);
00589     SET_BIT(ch->pcdata->immortal, IMMORTAL_PORT);
00590     return;
00591 }
00592 
00593 
00594 
00595 void show_classes (CHAR_DATA *ch, char *argument)
00596 {
00597     char buf[MSL];
00598     BUFFER *buffer;
00599     int runner=0;
00600     int col=0;
00601 
00602     buffer=new_buf();
00603 
00604     add_buf(buffer, "\n\r{xClasses:{x\n\r");
00605 
00606     for (runner=0;runner < MAX_CLASS;runner++)
00607     {
00608         sprintf(buf, "{x[{c%-3d{x] {W%-10s{x ", runner, class_table[runner].name);
00609         add_buf(buffer,buf);
00610         if (++col % 4 == 0)
00611             add_buf(buffer, "\n\r");
00612     }
00613 
00614     page_to_char(buf_string(buffer),ch);
00615 }
00616 
00617     
00618 
00619 void do_cshow (CHAR_DATA *ch, char *argument)
00620 {
00621     BUFFER *buffer;
00622     char buf[MAX_STRING_LENGTH];
00623     int runner,col=0;
00624     buffer = new_buf();
00625     add_buf(buffer, "\n\r{xContinents:{x\n\r");
00626 
00627     for (runner =1;runner < MAX_CONT; runner++)
00628     {
00629         sprintf(buf, "{c%-2d{x) {W%-15.15s{x", runner, conts_table[runner].name);
00630         add_buf(buffer,buf);
00631         if (++col % 2 == 0)
00632             add_buf(buffer, "\n\r");
00633     }
00634     add_buf(buffer, "\n\r");
00635     page_to_char(buf_string(buffer),ch);
00636     free_buf(buffer);
00637     return;
00638 }
00639 
00640         
00641     
00642 
00643     
00644 
00645     
00646 
00647     void do_show_skill(CHAR_DATA *ch, char *argument)
00648     {
00649         BUFFER *buf;
00650         char buf2[MAX_STRING_LENGTH];
00651         char buf3[MAX_STRING_LENGTH];
00652         int i,result=0;
00653         int class,rCol=0;
00654         if (argument[0] == '\0')
00655         {
00656             send_to_char("Syntax - Showskill <class>\n\r",ch);
00657             return;
00658         }
00659         if ((class = class_lookup(argument)) == -1)
00660         {
00661             send_to_char("That is not a valid class.\n\r",ch);
00662             return;
00663         }
00664         
00665         buf = new_buf();
00666         for (i = 0; i < MAX_SKILL; i++)
00667         {
00668             if (skill_table[i].name == NULL)
00669                 break;
00670             sprintf(buf2, "{C%s{x - {R%-15.15s{x level[{c%-2d{x] ", class_table[class].name, skill_table[i].name,
00671                     skill_table[i].skill_level[class]);
00672             if (++rCol % 2 == 0)
00673                 strcat(buf2, "\n\r");
00674             
00675         add_buf(buf, buf2);
00676         result ++;
00677             
00678             
00679         }
00680         sprintf(buf3, "%d skills/spells found.\n\r", result);
00681 
00682         add_buf(buf, buf3);
00683         page_to_char(buf_string(buf),ch);
00684         free_buf(buf);
00685         //free_string(buf2);
00686         //free_string(buf3);
00687         /*for (fleh = 0 ; fleh < 100 ; fleh++)
00688         {
00689             sprintf (buf2, "\e[1;47r %d", fleh);
00690             send_to_char(buf2,ch);
00691         }*/
00692 
00693         return;
00694     }
00695     void null_class (CHAR_DATA *ch, char *argument)
00696     {
00697     //  char arg1[MAX_STRING_LENGTH];
00698         int iClassLookup, i;
00699     //argument = one_argument(argument, arg1);
00700 
00701         if (argument[0]== '\0')
00702         {
00703             send_to_char("Syntax - nullclass <class>\n\r",ch);
00704             return;
00705         }
00706         if ((iClassLookup = class_lookup(argument)) == -1)
00707         {
00708             send_to_char("That is not a valid class.\n\r",ch);
00709             return;
00710         }
00711         for (i = 0; i < MAX_SKILL; i++)
00712         {
00713             if (skill_table[i].name == NULL)
00714                 break;
00715             skill_table[i].skill_level[iClassLookup] = 52;
00716         }
00717             do_function(ch,do_save_class,"");
00718 
00719         do_function(ch, do_show_skill, class_table[iClassLookup].name);
00720     
00721     return;
00722 }
00723 
00724     
00725 
00726 
00736 void do_pload( CHAR_DATA *ch, char *argument )
00737 {
00738   DESCRIPTOR_DATA d;
00739   bool isChar = FALSE;
00740   char name[MAX_INPUT_LENGTH];
00741 
00742   if (argument[0] == '\0')
00743   {
00744     send_to_char("Load who?\n\r", ch);
00745     return;
00746   }
00747 
00748   argument[0] = UPPER(argument[0]);
00749   argument = one_argument(argument, name);
00750 
00751   /* Dont want to load a second copy of a player who's allready online! */
00752   if ( get_char_world( ch, name ) != NULL )
00753   {
00754     send_to_char( "That person is allready connected!\n\r", ch );
00755     return;
00756   }
00757 
00758   isChar = load_char_obj(&d, name); /* char pfile exists? */
00759 
00760   if (!isChar)
00761   {
00762     send_to_char("Load Who? Are you sure? I cant seem to find them.\n\r", ch);
00763     return;
00764   }
00765 
00766   d.character->desc     = NULL;
00767   d.character->next     = char_list;
00768   char_list             = d.character;
00769   d.connected           = CON_PLAYING;
00770   reset_char(d.character);
00771 
00772   /* bring player to imm */
00773   if ( d.character->in_room != NULL )
00774   {
00775     char_to_room( d.character, ch->in_room); /* put in room imm is in */
00776   }
00777 
00778   act( "$n has pulled $N from the pattern!",
00779         ch, NULL, d.character, TO_ROOM );
00780 
00781   if (d.character->pet != NULL)
00782    {
00783      char_to_room(d.character->pet,d.character->in_room);
00784      act("$n has entered the game.",d.character->pet,NULL,NULL,TO_ROOM);
00785    }
00786 
00787 }
00788 
00798 void do_punload( CHAR_DATA *ch, char *argument )
00799 {
00800   CHAR_DATA *victim;
00801   char who[MAX_INPUT_LENGTH];
00802 
00803   argument = one_argument(argument, who);
00804 
00805   if ( ( victim = get_char_world( ch, who ) ) == NULL )
00806   {
00807     send_to_char( "They aren't here.\n\r", ch );
00808     return;
00809   }
00810 
00813   if (victim->desc != NULL)
00814   {
00815     send_to_char("I dont think that would be a good idea...\n\r", ch);
00816     return;
00817   }
00818 
00819   if (victim->was_in_room != NULL) /* return player and pet to orig room */
00820   {
00821     char_to_room(victim, victim->was_in_room);
00822     if (victim->pet != NULL)
00823       char_to_room(victim->pet, victim->was_in_room);
00824   }
00825 
00826   save_char_obj(victim);
00827   do_quit(victim,"");
00828 
00829   act("$n has released $N back to the Pattern.",
00830        ch, NULL, victim, TO_ROOM);
00831 }
00832 
00833 
00834 void do_guild (CHAR_DATA * ch, char *argument)
00835 {
00836     char arg1[MAX_INPUT_LENGTH], arg2[MAX_INPUT_LENGTH];
00837     char buf[MAX_STRING_LENGTH];
00838     CHAR_DATA *victim;
00839     int clan;
00840 
00841     argument = one_argument (argument, arg1);
00842     argument = one_argument (argument, arg2);
00843 
00844     if (arg1[0] == '\0' || arg2[0] == '\0')
00845     {
00846         send_to_char ("Syntax: guild <char> <cln name>\n\r", ch);
00847         return;
00848     }
00849     if ((victim = get_char_world (ch, arg1)) == NULL)
00850     {
00851         send_to_char ("They aren't playing.\n\r", ch);
00852         return;
00853     }
00854 
00855     if (!str_prefix (arg2, "none"))
00856     {
00857         send_to_char ("They are now clanless.\n\r", ch);
00858         send_to_char ("You are now a member of no clan!\n\r", victim);
00859         victim->clan = 0;
00860         REMOVE_BIT (victim->comm, CLAN_LEADER);
00861     REMOVE_BIT (victim->comm, CLAN_REC);
00862 
00863     return;
00864     }
00865 
00866     if ((clan = clan_lookup (arg2)) == 0)
00867     {
00868         send_to_char ("No such clan exists.\n\r", ch);
00869         return;
00870     }
00871 
00872     if (clan_table[clan].independent)
00873     {
00874         sprintf (buf, "They are now a %s.\n\r", clan_table[clan].name);
00875         send_to_char (buf, ch);
00876         sprintf (buf, "You are now a %s.\n\r", clan_table[clan].name);
00877         send_to_char (buf, victim);
00878     }
00879     else
00880     {
00881         sprintf (buf, "They are now a member of clan %s.\n\r",
00882                  capitalize (clan_table[clan].name));
00883         send_to_char (buf, ch);
00884         sprintf (buf, "You are now a member of clan %s.\n\r",
00885                  capitalize (clan_table[clan].name));
00886     }
00887 
00888     victim->clan = clan;
00889 }
00890 
00891 /* equips a character */
00892 void do_outfit (CHAR_DATA * ch, char *argument)
00893 {
00894     OBJ_DATA *obj;
00895     int i, sn, vnum;
00896 
00897     if (ch->level > 5 || IS_NPC (ch))
00898     {
00899         send_to_char ("Find it yourself!\n\r", ch);
00900         return;
00901     }
00902 
00903     if ((obj = get_eq_char (ch, WEAR_LIGHT)) == NULL)
00904     {
00905         obj = create_object (get_obj_index (OBJ_VNUM_SCHOOL_BANNER), 0);
00906         obj->cost = 0;
00907         obj_to_char (obj, ch);
00908         equip_char (ch, obj, WEAR_LIGHT);
00909     }
00910 
00911     if ((obj = get_eq_char (ch, WEAR_BODY)) == NULL)
00912     {
00913         obj = create_object (get_obj_index (OBJ_VNUM_SCHOOL_VEST), 0);
00914         obj->cost = 0;
00915         obj_to_char (obj, ch);
00916         equip_char (ch, obj, WEAR_BODY);
00917     }
00918 
00919     /* do the weapon thing */
00920     if ((obj = get_eq_char (ch, WEAR_WIELD)) == NULL)
00921     {
00922         sn = 0;
00923         vnum = OBJ_VNUM_SCHOOL_SWORD;    /* just in case! */
00924 
00925         for (i = 0; weapon_table[i].name != NULL; i++)
00926         {
00927             if (ch->pcdata->learned[sn] <
00928                 ch->pcdata->learned[*weapon_table[i].gsn])
00929             {
00930                 sn = *weapon_table[i].gsn;
00931                 vnum = weapon_table[i].vnum;
00932             }
00933         }
00934 
00935         obj = create_object (get_obj_index (vnum), 0);
00936         obj_to_char (obj, ch);
00937         equip_char (ch, obj, WEAR_WIELD);
00938     }
00939 
00940     if (((obj = get_eq_char (ch, WEAR_WIELD)) == NULL
00941          || !IS_WEAPON_STAT (obj, WEAPON_TWO_HANDS))
00942         && (obj = get_eq_char (ch, WEAR_SHIELD)) == NULL)
00943     {
00944         obj = create_object (get_obj_index (OBJ_VNUM_SCHOOL_SHIELD), 0);
00945         obj->cost = 0;
00946         obj_to_char (obj, ch);
00947         equip_char (ch, obj, WEAR_SHIELD);
00948     }
00949 
00950     send_to_char ("You have been equipped by the Gods.\n\r", ch);
00951 }
00952 
00953 
00954 /* RT nochannels command, for those spammers */
00955 void do_nochannels (CHAR_DATA * ch, char *argument)
00956 {
00957     char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
00958     CHAR_DATA *victim;
00959 
00960     one_argument (argument, arg);
00961 
00962     if (arg[0] == '\0')
00963     {
00964         send_to_char ("Nochannel whom?", ch);
00965         return;
00966     }
00967 
00968     if ((victim = get_char_world (ch, arg)) == NULL)
00969     {
00970         send_to_char ("They aren't here.\n\r", ch);
00971         return;
00972     }
00973 
00974     if (get_trust (victim) >= get_trust (ch))
00975     {
00976         send_to_char ("You failed.\n\r", ch);
00977         return;
00978     }
00979 
00980     if (IS_SET (victim->comm, COMM_NOCHANNELS))
00981     {
00982         REMOVE_BIT (victim->comm, COMM_NOCHANNELS);
00983         send_to_char ("The gods have restored your channel priviliges.\n\r",
00984                       victim);
00985         send_to_char ("NOCHANNELS removed.\n\r", ch);
00986         sprintf (buf, "$N restores channels to %s", victim->name);
00987         wiznet (buf, ch, NULL, WIZ_PENALTIES, WIZ_SECURE, 0);
00988     }
00989     else
00990     {
00991         SET_BIT (victim->comm, COMM_NOCHANNELS);
00992         send_to_char ("The gods have revoked your channel priviliges.\n\r",
00993                       victim);
00994         send_to_char ("NOCHANNELS set.\n\r", ch);
00995         sprintf (buf, "$N revokes %s's channels.", victim->name);
00996         wiznet (buf, ch, NULL, WIZ_PENALTIES, WIZ_SECURE, 0);
00997     }
00998 
00999     return;
01000 }
01001 
01002 
01003 void do_smote (CHAR_DATA * ch, char *argument)
01004 {
01005     CHAR_DATA *vch;
01006     char *letter, *name;
01007     char last[MAX_INPUT_LENGTH], temp[MAX_STRING_LENGTH];
01008     int matches = 0;
01009 
01010     if (!IS_NPC (ch) && IS_SET (ch->comm, COMM_NOEMOTE))
01011     {
01012         send_to_char ("You can't show your emotions.\n\r", ch);
01013         return;
01014     }
01015 
01016     if (argument[0] == '\0')
01017     {
01018         send_to_char ("Emote what?\n\r", ch);
01019         return;
01020     }
01021 
01022     if (strstr (argument, ch->name) == NULL)
01023     {
01024         send_to_char ("You must include your name in an smote.\n\r", ch);
01025         return;
01026     }
01027 
01028     send_to_char (argument, ch);
01029     send_to_char ("\n\r", ch);
01030 
01031     for (vch = ch->in_room->people; vch != NULL; vch = vch->next_in_room)
01032     {
01033         if (vch->desc == NULL || vch == ch)
01034             continue;
01035 
01036         if ((letter = strstr (argument, vch->name)) == NULL)
01037         {
01038             send_to_char (argument, vch);
01039             send_to_char ("\n\r", vch);
01040             continue;
01041         }
01042 
01043         strcpy (temp, argument);
01044         temp[strlen (argument) - strlen (letter)] = '\0';
01045         last[0] = '\0';
01046         name = vch->name;
01047 
01048         for (; *letter != '\0'; letter++)
01049         {
01050             if (*letter == '\'' && matches == strlen (vch->name))
01051             {
01052                 strcat (temp, "r");
01053                 continue;
01054             }
01055 
01056             if (*letter == 's' && matches == strlen (vch->name))
01057             {
01058                 matches = 0;
01059                 continue;
01060             }
01061 
01062             if (matches == strlen (vch->name))
01063             {
01064                 matches = 0;
01065             }
01066 
01067             if (*letter == *name)
01068             {
01069                 matches++;
01070                 name++;
01071                 if (matches == strlen (vch->name))
01072                 {
01073                     strcat (temp, "you");
01074                     last[0] = '\0';
01075                     name = vch->name;
01076                     continue;
01077                 }
01078                 strncat (last, letter, 1);
01079                 continue;
01080             }
01081 
01082             matches = 0;
01083             strcat (temp, last);
01084             strncat (temp, letter, 1);
01085             last[0] = '\0';
01086             name = vch->name;
01087         }
01088 
01089         send_to_char (temp, vch);
01090         send_to_char ("\n\r", vch);
01091     }
01092 
01093     return;
01094 }
01095 
01096 void do_bamfin (CHAR_DATA * ch, char *argument)
01097 {
01098     char buf[MAX_STRING_LENGTH];
01099 
01100     if (!IS_NPC (ch))
01101     {
01102         smash_tilde (argument);
01103 
01104         if (argument[0] == '\0')
01105         {
01106             sprintf (buf, "Your poofin is %s\n\r", ch->pcdata->bamfin);
01107             send_to_char (buf, ch);
01108             return;
01109         }
01110 
01111         if (strstr (argument, ch->name) == NULL)
01112         {
01113             send_to_char ("You must include your name.\n\r", ch);
01114             return;
01115         }
01116 
01117         free_string (ch->pcdata->bamfin);
01118         ch->pcdata->bamfin = str_dup (argument);
01119 
01120         sprintf (buf, "Your poofin is now %s\n\r", ch->pcdata->bamfin);
01121         send_to_char (buf, ch);
01122     }
01123     return;
01124 }
01125 
01126 void do_bamfout (CHAR_DATA * ch, char *argument)
01127 {
01128     char buf[MAX_STRING_LENGTH];
01129 
01130     if (!IS_NPC (ch))
01131     {
01132         smash_tilde (argument);
01133 
01134         if (argument[0] == '\0')
01135         {
01136             sprintf (buf, "Your poofout is %s\n\r", ch->pcdata->bamfout);
01137             send_to_char (buf, ch);
01138             return;
01139         }
01140 
01141         if (strstr (argument, ch->name) == NULL)
01142         {
01143             send_to_char ("You must include your name.\n\r", ch);
01144             return;
01145         }
01146 
01147         free_string (ch->pcdata->bamfout);
01148         ch->pcdata->bamfout = str_dup (argument);
01149 
01150         sprintf (buf, "Your poofout is now %s\n\r", ch->pcdata->bamfout);
01151         send_to_char (buf, ch);
01152     }
01153     return;
01154 }
01155 
01156 
01157 
01158 void do_deny (CHAR_DATA * ch, char *argument)
01159 {
01160     char arg[MAX_INPUT_LENGTH], buf[MAX_STRING_LENGTH];
01161     CHAR_DATA *victim;
01162 if (ch->level < 59)
01163 {
01164 send_to_char("Only imps can perform this function.\n\r",ch);
01165 return;
01166 }
01167 
01168     one_argument (argument, arg);
01169     if (arg[0] == '\0')
01170     {
01171         send_to_char ("Deny whom?\n\r", ch);
01172         return;
01173     }
01174 
01175     if ((victim = get_char_world (ch, arg)) == NULL)
01176     {
01177         send_to_char ("They aren't here.\n\r", ch);
01178         return;
01179     }
01180 
01181     if (IS_NPC (victim))
01182     {
01183         send_to_char ("Not on NPC's.\n\r", ch);
01184         return;
01185     }
01186 
01187     if (get_trust (victim) >= get_trust (ch))
01188     {
01189         send_to_char ("You failed.\n\r", ch);
01190         return;
01191     }
01192 
01193     SET_BIT (victim->act, PLR_DENY);
01194     send_to_char ("You are denied access!\n\r", victim);
01195     sprintf (buf, "$N denies access to %s", victim->name);
01196     wiznet (buf, ch, NULL, WIZ_PENALTIES, WIZ_SECURE, 0);
01197     send_to_char ("OK.\n\r", ch);
01198     save_char_obj (victim);
01199     stop_fighting (victim, TRUE);
01200     do_function (victim, &do_quit, "");
01201 
01202     return;
01203 }
01204 
01205 
01206 
01207 void do_disconnect (CHAR_DATA * ch, char *argument)
01208 {
01209     char arg[MAX_INPUT_LENGTH];
01210     DESCRIPTOR_DATA *d;
01211     CHAR_DATA *victim;
01212 
01213     one_argument (argument, arg);
01214     if (arg[0] == '\0')
01215     {
01216         send_to_char ("Disconnect whom?\n\r", ch);
01217         return;
01218     }
01219 
01220     if (is_number (arg))
01221     {
01222         int desc;
01223 
01224         desc = atoi (arg);
01225         for (d = descriptor_list; d != NULL; d = d->next)
01226         {
01227             if (d->descriptor == desc)
01228             {
01229                 close_socket (d);
01230                 send_to_char ("Ok.\n\r", ch);
01231                 return;
01232             }
01233         }
01234     }
01235 
01236     if ((victim = get_char_world (ch, arg)) == NULL)
01237     {
01238         send_to_char ("They aren't here.\n\r", ch);
01239         return;
01240     }
01241 
01242     if (victim == ch)
01243     {
01244         send_to_char("Do not disconnect yourself...\n\r",ch);
01245         return;
01246     }
01247 
01248     if (victim->desc == NULL)
01249     {
01250         act ("$N doesn't have a descriptor.", ch, NULL, victim, TO_CHAR);
01251         return;
01252     }
01253 
01254     for (d = descriptor_list; d != NULL; d = d->next)
01255     {
01256         if (d == victim->desc)
01257         {
01258             close_socket (d);
01259             send_to_char ("Ok.\n\r", ch);
01260             return;
01261         }
01262     }
01263 
01264     bug ("Do_disconnect: desc not found.", 0);
01265     send_to_char ("Descriptor not found!\n\r", ch);
01266     return;
01267 }
01268 
01269 void do_asleep(CHAR_DATA *ch, char *argument)
01270 {
01271     if (IS_SET(ch->sleep, BTS_SLEEP))
01272     {
01273         send_to_char ("Sleep status removed.\n\r",ch);
01274         REMOVE_BIT (ch->sleep, BTS_SLEEP);
01275         return;
01276     }
01277     if (!IS_SET(ch->sleep, BTS_SLEEP))
01278     {
01279         send_to_char("Sweet dreams...\n\r",ch);
01280         SET_BIT(ch->sleep, BTS_SLEEP);
01281         return;
01282     }
01283 }
01284 
01285 void do_pardon (CHAR_DATA * ch, char *argument)
01286 {
01287     char arg1[MAX_INPUT_LENGTH];
01288     char arg2[MAX_INPUT_LENGTH];
01289     CHAR_DATA *victim;
01290 
01291     argument = one_argument (argument, arg1);
01292     argument = one_argument (argument, arg2);
01293 
01294     if (arg1[0] == '\0' || arg2[0] == '\0')
01295     {
01296         send_to_char ("Syntax: pardon <character> <killer|thief>.\n\r", ch);
01297         return;
01298     }
01299 
01300     if ((victim = get_char_world (ch, arg1)) == NULL)
01301     {
01302         send_to_char ("They aren't here.\n\r", ch);
01303         return;
01304     }
01305 
01306     if (IS_NPC (victim))
01307     {
01308         send_to_char ("Not on NPC's.\n\r", ch);
01309         return;
01310     }
01311 
01312     if (!str_cmp (arg2, "killer"))
01313     {
01314         if (IS_SET (victim->act, PLR_KILLER))
01315         {
01316             REMOVE_BIT (victim->act, PLR_KILLER);
01317             send_to_char ("Killer flag removed.\n\r", ch);
01318             send_to_char ("You are no longer a KILLER.\n\r", victim);
01319         }
01320         return;
01321     }
01322 
01323     if (!str_cmp (arg2, "thief"))
01324     {
01325         if (IS_SET (victim->act, PLR_THIEF))
01326         {
01327             REMOVE_BIT (victim->act, PLR_THIEF);
01328             send_to_char ("Thief flag removed.\n\r", ch);
01329             send_to_char ("You are no longer a THIEF.\n\r", victim);
01330         }
01331         return;
01332     }
01333 
01334     send_to_char ("Syntax: pardon <character> <killer|thief>.\n\r", ch);
01335     return;
01336 }
01337 
01338 
01339 
01340 void do_echo (CHAR_DATA * ch, char *argument)
01341 {
01342     DESCRIPTOR_DATA *d;
01343 
01344     if (argument[0] == '\0')
01345     {
01346         send_to_char ("Global echo what?\n\r", ch);
01347         return;
01348     }
01349 
01350     for (d = descriptor_list; d; d = d->next)
01351     {
01352         if (d->connected == CON_PLAYING)
01353         {
01354             if (get_trust (d->character) >= get_trust (ch))
01355                 send_to_char ("global> ", d->character);
01356             send_to_char (argument, d->character);
01357             send_to_char ("\n\r", d->character);
01358         }
01359     }
01360 
01361     return;
01362 }
01363 
01364 
01365 
01366 void do_recho (CHAR_DATA * ch, char *argument)
01367 {
01368     DESCRIPTOR_DATA *d;
01369 
01370     if (argument[0] == '\0')
01371     {
01372         send_to_char ("Local echo what?\n\r", ch);
01373 
01374         return;
01375     }
01376 
01377     for (d = descriptor_list; d; d = d->next)
01378     {
01379         if (d->connected == CON_PLAYING
01380             && d->character->in_room == ch->in_room)
01381         {
01382             if (get_trust (d->character) >= get_trust (ch))
01383                 send_to_char ("local> ", d->character);
01384             send_to_char (argument, d->character);
01385             send_to_char ("\n\r", d->character);
01386         }
01387     }
01388 
01389     return;
01390 }
01391 
01392 void do_zecho (CHAR_DATA * ch, char *argument)
01393 {
01394     DESCRIPTOR_DATA *d;
01395 
01396     if (argument[0] == '\0')
01397     {
01398         send_to_char ("Zone echo what?\n\r", ch);
01399         return;
01400     }
01401 
01402     for (d = descriptor_list; d; d = d->next)
01403     {
01404         if (d->connected == CON_PLAYING
01405             && d->character->in_room != NULL && ch->in_room != NULL
01406             && d->character->in_room->area == ch->in_room->area)
01407         {
01408             if (get_trust (d->character) >= get_trust (ch))
01409                 send_to_char ("zone> ", d->character);
01410             send_to_char (argument, d->character);
01411             send_to_char ("\n\r", d->character);
01412         }
01413     }
01414 }
01415 
01416 void do_pecho (CHAR_DATA * ch, char *argument)
01417 {
01418     char arg[MAX_INPUT_LENGTH];
01419     CHAR_DATA *victim;
01420 
01421     argument = one_argument (argument, arg);
01422 
01423     if (argument[0] == '\0' || arg[0] == '\0')
01424     {
01425         send_to_char ("Personal echo what?\n\r", ch);
01426         return;
01427     }
01428 
01429     if ((victim = get_char_world (ch, arg)) == NULL)
01430     {
01431         send_to_char ("Target not found.\n\r", ch);
01432         return;
01433     }
01434 
01435     if (get_trust (victim) >= get_trust (ch) && get_trust (ch) != MAX_LEVEL)
01436         send_to_char ("personal> ", victim);
01437 
01438     send_to_char (argument, victim);
01439     send_to_char ("\n\r", victim);
01440     send_to_char ("personal> ", ch);
01441     send_to_char (argument, ch);
01442     send_to_char ("\n\r", ch);
01443 }
01444 
01445 
01446 ROOM_INDEX_DATA *find_location (CHAR_DATA * ch, char *arg)
01447 {
01448     CHAR_DATA *victim;
01449     OBJ_DATA *obj;
01450 
01451     if (is_number (arg))
01452         return get_room_index (atoi (arg));
01453 
01454     if ((victim = get_char_world (ch, arg)) != NULL)
01455         return victim->in_room;
01456 
01457     if ((obj = get_obj_world (ch, arg)) != NULL)
01458         return obj->in_room;
01459 
01460     return NULL;
01461 }
01462 
01463 
01464 
01465 void do_transfer (CHAR_DATA * ch, char *argument)
01466 {
01467     char arg1[MAX_INPUT_LENGTH];
01468     char arg2[MAX_INPUT_LENGTH];
01469     ROOM_INDEX_DATA *location;
01470     DESCRIPTOR_DATA *d;
01471     CHAR_DATA *victim;
01472     CHAR_DATA *victim2;
01473   //  CHAR_DATA *vch;
01474     //CHAR_DATA *vch_next;
01475 
01476     argument = one_argument (argument, arg1);
01477     argument = one_argument (argument, arg2);
01478 
01479     if (arg1[0] == '\0')
01480     {
01481         send_to_char ("Transfer whom (and where)?\n\r", ch);
01482         return;
01483     }
01484 /*
01485     if (!str_cmp (arg1, "sall"))
01486     {
01487         char buf2[MSL];
01488         for (vch = char_list; vch != NULL; vch = vch_next)
01489         {
01490             vch_next = vch->next;
01491             sprintf (buf2, "%s %s", vch->name, arg2);
01492             do_transfer(ch, buf2);
01493         }
01494         return;
01495     }
01496 
01497 */      
01498     if (!str_cmp (arg1, "all"))
01499     {
01500         for (d = descriptor_list; d != NULL; d = d->next)
01501         {
01502             if (d->connected == CON_PLAYING
01503                 && d->character != ch
01504                 && d->character->in_room != NULL
01505                 && can_see (ch, d->character)/*&& d->character->comm != WIZ_NOTRANS*/)
01506             {
01507                 char buf[MAX_STRING_LENGTH];
01508                 sprintf (buf, "%s %s", d->character->name, arg2);
01509                 do_function (ch, &do_transfer, buf);
01510             }
01511         }
01512         return;
01513     }
01514 
01515     /*
01516      * Thanks to Grodyn for the optional location parameter.
01517      */
01518     if (arg2[0] == '\0')
01519     {
01520         location = ch->in_room;
01521     }
01522     
01523     if ((victim2 = get_char_world(ch, arg2)) !=NULL)
01524     {
01525         if (!IS_NPC(victim2))
01526         {
01527             if (IS_SET(victim2->comm, WIZ_NOTRANS))
01528             {
01529                 send_to_char("That person is not available for trans at the moment.\n\r",ch);
01530                 return;
01531             }
01532         }
01533     }
01534     if (arg2[0] == '\0')
01535     {
01536         location = ch->in_room;
01537     }
01538     else
01539     {
01540         if ((location = find_location (ch, arg2)) == NULL)
01541         {
01542             send_to_char ("No such location.\n\r", ch);
01543             return;
01544         }
01545 
01546         if (!is_room_owner (ch, location) && room_is_private (location)
01547             && get_trust (ch) < MAX_LEVEL)
01548         {
01549             send_to_char ("That room is private right now.\n\r", ch);
01550             return;
01551         }
01552     }
01553 
01554     if ((victim = get_char_world (ch, arg1)) == NULL)
01555     {
01556         send_to_char ("They aren't here.\n\r", ch);
01557         return;
01558     }
01559 
01560     if (victim->in_room == NULL)
01561     {
01562         send_to_char ("They are in limbo.\n\r", ch);
01563         return;
01564     }
01565 
01566    if (!IS_NPC(victim) && IS_SET(victim->comm, WIZ_NOTRANS))
01567    {
01568        send_to_char("This person is not avaiable for transfer at the moment.\n\r",ch);
01569       return;
01570     } 
01571    if (victim->fighting != NULL)
01572         stop_fighting (victim, TRUE);
01573     act ("$n disappears in a mushroom cloud.", victim, NULL, NULL, TO_ROOM);
01574     char_from_room (victim);
01575     char_to_room (victim, location);
01576     act ("$n arrives from a puff of smoke.", victim, NULL, NULL, TO_ROOM);
01577     if (ch != victim)
01578         act ("$n has transferred you.", ch, NULL, victim, TO_VICT);
01579     do_function (victim, &do_look, "auto");
01580     send_to_char ("Ok.\n\r", ch);
01581 }
01582 
01583 
01584 void do_at (CHAR_DATA * ch, char *argument)
01585 {
01586     char arg[MAX_INPUT_LENGTH];
01587     ROOM_INDEX_DATA *location;
01588     ROOM_INDEX_DATA *original;
01589     OBJ_DATA *on;
01590     CHAR_DATA *wch;
01591 
01592     argument = one_argument (argument, arg);
01593 
01594  //  if (ch->level < 60)
01595    // {
01596 //      send_to_char("You are not high enough level to do this.\n\r",ch);
01597 //      return;
01598   //  }
01599 
01600     if (arg[0] == '\0' || argument[0] == '\0')
01601     {
01602         send_to_char ("At where what?\n\r", ch);
01603         return;
01604     }
01605 
01606     if ((location = find_location (ch, arg)) == NULL)
01607     {
01608         send_to_char ("No such location.\n\r", ch);
01609         return;
01610     }
01611 
01612     if (!is_room_owner (ch, location) && room_is_private (location)
01613         && get_trust (ch) < MAX_LEVEL)
01614     {
01615         send_to_char ("That room is private right now.\n\r", ch);
01616         return;
01617     }
01618 
01619     original = ch->in_room;
01620     on = ch->on;
01621     char_from_room (ch);
01622     char_to_room (ch, location);
01623     interpret (ch, argument);
01624 
01625     /*
01626      * See if 'ch' still exists before continuing!
01627      * Handles 'at XXXX quit' case.
01628      */
01629     for (wch = char_list; wch != NULL; wch = wch->next)
01630     {
01631         if (wch == ch)
01632         {
01633             char_from_room (ch);
01634             char_to_room (ch, original);
01635             ch->on = on;
01636             break;
01637         }
01638     }
01639 
01640     return;
01641 }
01642 
01643 
01644 
01645 void do_goto (CHAR_DATA * ch, char *argument)
01646 {
01647     ROOM_INDEX_DATA *location;
01648     CHAR_DATA *rch;
01649     CHAR_DATA *victim;
01650     int count = 0;
01651 
01652     if (argument < 0)
01653     {
01654         send_to_char("Yea.....right. Actually think there are negative vnums? pfft.\n\r",ch);
01655         return;
01656     }
01657 
01658     if (argument[0] == '\0')
01659     {
01660         send_to_char ("Goto where?\n\r", ch);
01661         return;
01662     }
01663     if ((victim = get_char_world(ch, argument))  != NULL)
01664     {
01665         /*    if (!IS_NPC(victim) && IS_SET(victim->chann, WIZ_NOGOTO))
01666         {
01667             send_to_char("Leave them alone.\n\r",ch);
01668             return;
01669         }*/
01670     }
01671     if ((location = find_location (ch, argument)) == NULL)
01672     {
01673         send_to_char ("No such location.\n\r", ch);
01674         return;
01675     }
01676    
01677    
01678         
01679     count = 0;
01680     for (rch = location->people; rch != NULL; rch = rch->next_in_room)
01681         count++;
01682 
01683     if (victim == ch)
01684     {
01685         send_to_char("You'll implode!\n\r",ch);
01686         return;
01687     }
01688 
01689     if (!is_room_owner (ch, location) && room_is_private (location)
01690         && (count > 1 || get_trust (ch) < MAX_LEVEL))
01691     {
01692         send_to_char ("That room is private right now.\n\r", ch);
01693         return;
01694     }