/*************************************************************************** * This code was written by Morglum AKA Dave Spink * * E-mail Morglum@another.co.uk * * ALL following code is Copyright 2000 Morglum * ***************************************************************************/ #if defined(macintosh) #include <types.h> #else #include <sys/types.h> #endif #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "merc.h" void npack( CHAR_DATA *ch, char *argument ); DO_COM( do_leave ) { char arg[MIL]; char buf[MSL]; if ( IS_NPC( ch ) ) return; argument = one_argument( argument, arg ); if ( ch->class != CLASS_VAMPIRE && ch->class != CLASS_WEREWOLF && ch->class != CLASS_DEMON && ch->class != CLASS_ANGEL ) { send_to_char("Huh?\n\r", ch ); return; } if ( strlen( ch->clan ) < 3 ) { if ( IS_WEREWOLF( ch ) ) send_to_char( "You need to be in a Tribe, before you can leave one.\n\r", ch ); else send_to_char( "You need to be in a Clan, before you can leave one.\n\r", ch ); return; } if ( ch->vampgen <= 2 ) { send_to_char( "No that would be silly!\n\r", ch ); return; } if ( arg[0] == '\0' ) { send_to_char( "Syntax: leave [password]\n\r", ch ); return; } if ( strcmp( crypt( arg, ch->pcdata->pwd ), ch->pcdata->pwd ) ) { send_to_char( "Wrong Password, wait 10 seconds.\n\r", ch ); WAIT_STATE( ch, 40 ); return; } sprintf( buf, "You become a %s!\n\r", IS_WEREWOLF( ch ) ? "Orphan" : "Caitiff" ); send_to_char( buf, ch ); sprintf( buf, "%s has become a %s.", ch->name, IS_WEREWOLF( ch ) ? "Orphan" : "Caitiff" ); class_info( buf, ch ); FILL_STRING( ch->clan, "" ); REMOVE_BIT( ch->extra, EXTRA_SIRE ); REMOVE_BIT( ch->extra, EXTRA_PRINCE ); return; } void class_info( char *argument, CHAR_DATA *ch ) { DESCRIPTOR_DATA *d; CHAR_DATA *vch; if ( IS_NPC( ch ) ) return; if ( argument[0] == '\0' ) return; if ( ch->class < 1 ) return; for ( d = descriptor_list ; d != NULL ; d = d->next ) { if ( d->connected > CON_PLAYING ) continue; if ( d->connected < CON_PLAYING ) continue; if ( ( vch = d->character ) == NULL ) continue; if ( IS_SET( vch->deaf, CHANNEL_INFO ) ) continue; if ( vch->class < 1 ) continue; if ( vch->class != ch->class && !IS_IMMORTAL( vch ) ) continue; send_to_char( "#wCLASS-INFO > #r", vch ); send_to_char( argument, vch ); send_to_char( "\n\r", vch ); } return; } DO_COM( do_anarch ) { char buf[MAX_STRING_LENGTH]; if ( IS_NPC( ch ) ) return; if ( ch->class != CLASS_VAMPIRE ) { send_to_char("Huh?\n\r", ch ); return; } if ( ch->vampgen <= 2 ) { send_to_char( "No that would be silly!\n\r", ch ); return; } if ( strlen( ch->clan ) > 0 ) { send_to_char( "But you are in a clan.\n\r", ch ); return; } if ( !IS_MORE( ch, MORE_OUTCAST ) ) { SET_BIT( ch->more, MORE_OUTCAST ); send_to_char( "You become an anarch.\n\r", ch ); sprintf( buf, "%s has become an Anarch!", capitalize( ch->name ) ); class_info( buf, ch ); } else { REMOVE_BIT( ch->more, MORE_OUTCAST ); send_to_char( "You are no longer an anarch.\n\r", ch ); sprintf( buf, "%s is no longer an Anarch!", capitalize( ch->name ) ); class_info( buf, ch ); } WAIT_STATE( ch, 20 ); return; } DO_COM( do_ronin ) { char buf[MAX_STRING_LENGTH]; if ( IS_NPC( ch ) ) return; if ( ch->class != CLASS_WEREWOLF ) { send_to_char("Huh?\n\r", ch ); return; } if ( ch->vampgen <= 2 ) { send_to_char( "No that would be silly!\n\r", ch ); return; } if ( strlen( ch->clan ) > 0 ) { send_to_char( "But you are in a tribe.\n\r", ch ); return; } if ( !IS_MORE( ch, MORE_OUTCAST ) ) { SET_BIT( ch->more, MORE_OUTCAST ); send_to_char( "You become a ronin.\n\r", ch ); sprintf( buf, "%s has become a Ronin!", capitalize( ch->name ) ); class_info( buf, ch ); } else { REMOVE_BIT( ch->more, MORE_OUTCAST ); send_to_char( "You are no longer a ronin.\n\r", ch ); sprintf( buf, "%s is no longer a Ronin!", capitalize( ch->name ) ); class_info( buf, ch ); } WAIT_STATE( ch, 20 ); return; } void do_afk( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; if ( IS_NPC(ch) ) return; if (ch->position == POS_FIGHTING) { send_to_char("No way! You are still fighting!\n\r",ch); return; } if (IS_SET(ch->extra, EXTRA_AFK)) { send_to_char( "You are no longer AFK.\n\r", ch ); sprintf(buf,"#w%s #ris no longer AFK!#n",ch->name); do_info(ch,buf); REMOVE_BIT(ch->extra,EXTRA_AFK); return; } else if (!IS_SET(ch->extra,EXTRA_AFK)) { send_to_char( "You are now AFK.\n\r", ch ); sprintf(buf,"#w%s#r is now AFK!#n",ch->name); do_info(ch,buf); SET_BIT(ch->extra,EXTRA_AFK); WAIT_STATE(ch, 25); return; } else return; } void do_resetpassword( CHAR_DATA *ch, char *argument ) { char arg1[MAX_INPUT_LENGTH]; char arg2[MAX_INPUT_LENGTH]; char buf[MAX_STRING_LENGTH]; CHAR_DATA *victim; char *pwdnew; if ( IS_NPC(ch) ) return; argument=one_argument( argument, arg1 ); argument=one_argument( argument, arg2 ); victim = get_char_world(ch, arg1); if ( ( ch->pcdata->pwd != '\0' ) && ( arg1[0] == '\0' || arg2[0] == '\0') ) { send_to_char( "Syntax: password <char> <new>.\n\r", ch ); return; } if( victim == '\0' ) { send_to_char( "That person isn't here, they have to be here to reset pwd's.\n\r", ch); return; } if ( IS_NPC( victim ) ) { send_to_char( "You cannot change the password of NPCs!\n\r",ch); return; } if (( victim->level > LEVEL_IMMORTAL ) || ( get_trust(victim) > LEVEL_IMMORTAL )) { send_to_char( "You can't change the password of a god.\n\r",ch); return; } if ( strlen(arg2) < 5 ) { send_to_char( "New password must be at least five characters long.\n\r", ch ); return; } pwdnew = crypt( arg2, victim->name ); free_string( victim->pcdata->pwd ); victim->pcdata->pwd = str_dup( pwdnew ); save_char_obj( victim ); send_to_char( "Ok.\n\r", ch ); sprintf( buf, "Your password has been changed to %s.", arg2 ); send_to_char( buf, victim); return; } void do_newbiepack( CHAR_DATA *ch, char *argument ) { char buf[MAX_STRING_LENGTH]; if (IS_EXTRA(ch,EXTRA_NEWBIEPACK)) { send_to_char("But you've already made your newbie pack!\n\r",ch); return; } npack(ch, "pack"); npack(ch, "plate"); npack(ch, "helmet"); npack(ch, "sleeves"); npack(ch, "leggings"); npack(ch, "gloves"); npack(ch, "boots"); npack(ch, "bracer"); npack(ch, "bracer"); npack(ch, "sword"); npack(ch, "dagger"); npack(ch, "ring"); npack(ch, "ring"); npack(ch, "collar"); npack(ch, "collar"); npack(ch, "lantern"); npack(ch, "mask"); npack(ch, "girth"); do_wear(ch, "sword"); do_wear(ch, "dagger"); sprintf(buf,"all"); do_wear(ch, buf); sprintf(buf,"all pack"); do_put(ch,buf); SET_BIT(ch->extra,EXTRA_NEWBIEPACK); return; } void npack( CHAR_DATA *ch, char *argument ) { OBJ_INDEX_DATA *pObjIndex; OBJ_DATA *obj; char arg[MAX_INPUT_LENGTH]; int vnum = 0; argument = one_argument( argument, arg ); if (IS_NPC(ch)) return; if (!str_cmp(arg, "pack" )) vnum = 2335; else if (!str_cmp(arg, "plate" )) vnum = 253; else if (!str_cmp(arg, "helmet" )) vnum = 252; else if (!str_cmp( arg,"sleeves" )) vnum = 255; else if (!str_cmp( arg,"leggings" )) vnum = 254; else if (!str_cmp( arg,"gloves" )) vnum = 256; else if (!str_cmp( arg,"boots" )) vnum = 257; else if (!str_cmp( arg,"bracer" )) vnum = 258; else if (!str_cmp( arg,"sword" )) vnum = 250; else if (!str_cmp( arg,"dagger" )) vnum = 251; else if (!str_cmp( arg,"ring" )) vnum = 259; else if (!str_cmp( arg,"collar" )) vnum = 261; else if (!str_cmp( arg,"lantern" )) vnum = 260; else if (!str_cmp( arg,"mask" )) vnum = 2622; else if (!str_cmp( arg,"girth" )) vnum = 2204; if ( vnum == 0 || (pObjIndex = get_obj_index( vnum )) == NULL) { send_to_char("Missing object Please inform Morglum.\n\r",ch); return; } obj = create_object(pObjIndex, 50); obj_to_char(obj, ch); return; } DO_COM( do_rolldirt ) { CHAR_DATA *vch; bool set_fire = FALSE; if ( !IS_AFFECTED( ch, AFF_FLAMING ) ) { send_to_char("You are not on fire.\n\r", ch ); return; } act("$n rolls about in the dirt.", ch, NULL, NULL, TO_ROOM ); send_to_char( "You roll about in the dirt.\n\r", ch ); if ( IS_AFFECTED( ch, AFF_FLAMING ) && number_percent() > 80 && ch->in_room != NULL ) { set_fire = TRUE; for ( vch = ch->in_room->people ; vch != NULL ; vch = vch->next_in_room ) { if ( number_percent() < 65 ) continue; if ( !IS_HERO( vch ) ) continue; if ( IS_IMMORTAL( vch ) ) continue; if ( IS_AFFECTED( vch, AFF_FLAMING ) ) continue; act( "A spark leaps from $n's body and sets you on fire!",ch,NULL,vch,TO_VICT); act( "A spark leaps from your body and sets $N on fire!",ch,NULL,vch,TO_CHAR); act( "A sprak leaps from $n's body and sets $N on fire!",ch,NULL,vch,TO_NOTVICT); SET_BIT( vch->affected_by, AFF_FLAMING ); if ( IS_MORE( ch, MORE_FLAMES ) ) SET_BIT( vch->more, MORE_FLAMES ); } } if ( set_fire ) return; if ( number_percent() < 25 ) { send_to_char("The flames around your body die out.\n\r", ch ); act("The flames around $n's body die out.",ch,NULL,NULL,TO_ROOM); REMOVE_BIT(ch->affected_by, AFF_FLAMING); REMOVE_BIT(ch->more, MORE_FLAMES); } return; } DO_COM( do_ivamp ) { char buf[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; CHAR_DATA *vch; if ( IS_NPC( ch ) ) return; send_to_char( "Vampires on:\n\r", ch ); send_to_char( "[ Name ] [ Sire ] [ Clan ] [ Gen ] [ Blood ]\n\r", ch ); for ( vch = char_list ; vch != NULL ; vch = vch->next ) { if ( IS_NPC( vch ) ) continue; if ( !IS_VAMPIRE( vch ) ) continue; if ( !can_see( ch, vch ) ) continue; if ( !str_cmp( vch->name, "morglum" ) ) sprintf( buf2, "Morglum" ); else sprintf( buf2, "%s", capitalize( vch->name ) ); sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); send_to_char( "[", ch ); display_sire( ch, vch->lord ); send_to_char( "] ", ch ); if ( strlen( vch->clan ) < 3 ) { if ( IS_ABOMINATION( vch ) ) sprintf( buf2, "Abomination" ); else if ( IS_LICH( vch ) ) sprintf( buf2, "Lich" ); else if ( IS_BAALI( vch ) ) sprintf( buf2, "Baali" ); else if ( vch->vampgen == 1 ) sprintf( buf2, "Master" ); else if ( IS_MORE( vch, MORE_OUTCAST ) ) sprintf( buf2, "Anarch" ); else sprintf( buf2, "Caitiff" ); } else sprintf( buf2, "%s", vch->clan ); sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); sprintf( buf, "[ %-2d ] ", vch->vampgen ); send_to_char( buf, ch ); sprintf( buf, "[ %-5d ]\n\r", vch->blood[BLOOD_CURRENT] ); send_to_char( buf, ch ); } return; } DO_COM( do_itribe ) { char buf[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; CHAR_DATA *vch; if ( IS_NPC( ch ) ) return; send_to_char( "Werewolf's on:\n\r", ch ); send_to_char( "[ Name ] [ Sire ] [ Tribe ] [ Gen ]\n\r", ch ); for ( vch = char_list ; vch != NULL ; vch = vch->next ) { if ( IS_NPC( vch ) ) continue; if ( !IS_WEREWOLF( vch ) ) continue; if ( !can_see( ch, vch ) ) continue; if ( !str_cmp( vch->name, "morglum" ) ) sprintf( buf2, "Morglum" ); else sprintf( buf2, "%s", capitalize( vch->name ) ); sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); send_to_char( "[", ch ); display_sire( ch, vch->lord ); send_to_char( "] ", ch ); if ( strlen( vch->clan ) < 3 ) { if ( IS_ABOMINATION( vch ) ) sprintf( buf2, "Abomination" ); else if ( IS_SKINDANCER( vch ) ) sprintf( buf2, "Skindancer" ); else if ( IS_BLACK_SPIRAL_DANCER( vch ) ) sprintf( buf2, "B.S.D." ); else if ( vch->vampgen == 1 ) sprintf( buf2, "Master" ); else if ( IS_MORE( vch, MORE_OUTCAST ) ) sprintf( buf2, "Ronin" ); else sprintf( buf2, "Orphan" ); } else sprintf( buf2, "%s", vch->clan ); sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); sprintf( buf, "[ %-2d ]\n\r", vch->vampgen ); send_to_char( buf, ch ); } return; } DO_COM( do_image ) { char buf[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; CHAR_DATA *vch; if ( IS_NPC( ch ) ) return; send_to_char( "Mages on:\n\r", ch ); send_to_char( "[ Name ] [ Sire ] [ Colour ] [ Level ]\n\r", ch ); for ( vch = char_list ; vch != NULL ; vch = vch->next ) { if ( IS_NPC( vch ) ) continue; if ( !IS_SET( vch->class, CLASS_MAGE ) ) continue; if ( !can_see( ch, vch ) ) continue; if ( !str_cmp( vch->name, "morglum" ) ) sprintf( buf2, "Morglum" ); else sprintf( buf2, "%s", capitalize( vch->name ) ); sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); send_to_char( "[", ch ); display_sire( ch, vch->lord ); send_to_char( "] ", ch ); if ( vch->class != CLASS_MAGE ) { if ( IS_NEPHANDI( vch ) ) sprintf( buf2, "Nephandi" ); else if ( IS_SKINDANCER( vch ) ) sprintf( buf2, "Skindancer" ); else if ( IS_LICH( vch ) ) sprintf( buf2, "Lich" ); else sprintf( buf2, "Bugged" ); } else { switch( vch->pcdata->runes[0] ) { default : sprintf( buf2, "Bugged" ); break; case PURPLE_MAGIC : sprintf( buf2, "Air" ); break; case RED_MAGIC : sprintf( buf2, "Fire" ); break; case BLUE_MAGIC : sprintf( buf2, "Water" ); break; case GREEN_MAGIC : sprintf( buf2, "Earth" ); break; case YELLOW_MAGIC : sprintf( buf2, "Spirit" ); break; } } sprintf( buf, "[%-10s] ", buf2 ); send_to_char( buf, ch ); if ( vch->class != CLASS_MAGE ) { if ( IS_NEPHANDI( vch ) || IS_LICH( vch ) || IS_SKINDANCER( vch ) ) { if ( vch->vampgen <= 3 ) sprintf( buf2, "Leader" ); else sprintf( buf2, "N/A" ); } else sprintf( buf2, "Bugged" ); } else { switch( vch->level ) { default : sprintf( buf2, "Mortal" ); break; case LEVEL_HERO : sprintf( buf2, "Avatar" ); break; case LEVEL_APPRENTICE : sprintf( buf2, "Apprentice" ); break; case LEVEL_MAGE : sprintf( buf2, "Mage" ); break; case LEVEL_ARCHMAGE : sprintf( buf2, "Archmage" ); break; case LEVEL_BUILDER : sprintf( buf2, "Builder" ); break; case LEVEL_QUESTMAKER : sprintf( buf2, "Questmaker" ); break; case LEVEL_ENFORCER : sprintf( buf2, "Enforcer" ); break; case LEVEL_JUDGE : sprintf( buf2, "Judge" ); break; case LEVEL_HIGHJUDGE : sprintf( buf2, "Highjudge" ); break; case LEVEL_IMPLEMENTOR: sprintf( buf2, "Implementor" ); break; } } sprintf( buf, "[%-11s]\n\r", buf2 ); send_to_char( buf, ch ); } return; } DO_COM( do_idemon ) { char buf[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; CHAR_DATA *vch; if ( IS_NPC( ch ) ) return; send_to_char( "Demons on:\n\r", ch ); send_to_char( "[ Name ] [ Lord ] [ Position ] [ Mag/Imm ] [ Power ]\n\r", ch ); for ( vch = char_list ; vch != NULL ; vch = vch->next ) { if ( IS_NPC( vch ) ) continue; if ( !IS_DEMON( vch ) ) continue; if ( !can_see( ch, vch ) ) continue; if ( !str_cmp( vch->name, "morglum" ) ) sprintf( buf2, "Morglum" ); else sprintf( buf2, "%s", capitalize( vch->name ) ); sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); if ( vch->class != CLASS_DEMON ) { if ( IS_BAALI( vch ) ) sprintf( buf2, "Baali" ); else if ( IS_BLACK_SPIRAL_DANCER( vch ) ) sprintf( buf2, "B.S.D." ); else if ( IS_NEPHANDI( vch ) ) sprintf( buf2, "Nephandi" ); else sprintf( buf2, "Bugged" ); } else { if ( IS_SET( vch->act, PLR_DEMON ) ) sprintf( buf2, "Demon Lord" ); else if ( vch->lord != NULL && !str_cmp( vch->lord, "morglum" ) ) sprintf( buf2, "Morglum" ); else if ( strlen( vch->lord ) > 2 ) sprintf( buf2, "%s", capitalize( vch->lord ) ); else sprintf( buf2, "Bugged" ); } sprintf( buf, "[%-16s] ", buf2 ); send_to_char( buf, ch ); if ( vch->class != CLASS_DEMON ) { if ( vch->vampgen <= 3 ) sprintf( buf2, "Leader" ); else sprintf( buf2, "N/A" ); } else { if ( IS_SET( vch->act, PLR_DEMON ) ) sprintf( buf2, "Lord" ); else if ( IS_MORE( vch, MORE_OUTCAST ) ) sprintf( buf2, "Rogue" ); else if ( IS_EXTRA( vch, EXTRA_PRINCE ) ) sprintf( buf2, "Prince" ); else if ( IS_EXTRA( vch, EXTRA_SIRE ) ) sprintf( buf2, "Greater" ); else sprintf( buf2, "Lesser" ); } sprintf( buf, "[%-10s] ", buf2 ); send_to_char( buf, ch ); sprintf( buf, "[ %3d%% ] ", vch->pcdata->atm ); send_to_char( buf, ch ); sprintf( buf, "[%-9d %9d]\n\r", vch->pcdata->power[0], vch->pcdata->power[1] ); send_to_char( buf, ch ); } return; } void display_sire( CHAR_DATA *ch, char *argument ) { char sire1[MAX_STRING_LENGTH]; char sire2[MAX_STRING_LENGTH]; char sire3[MAX_STRING_LENGTH]; char sire4[MAX_STRING_LENGTH]; char sire5[MAX_STRING_LENGTH]; char sire6[MAX_STRING_LENGTH]; char buf[MAX_STRING_LENGTH]; if ( strlen( argument ) < 3 ) { sprintf( buf, "%-16s", "None" ); send_to_char( buf, ch ); return; } argument = one_argument( argument, sire1 ); argument = one_argument( argument, sire2 ); argument = one_argument( argument, sire3 ); argument = one_argument( argument, sire4 ); argument = one_argument( argument, sire5 ); argument = one_argument( argument, sire6 ); if ( sire1 != '\0' ) sire1[0] = UPPER( sire1[0] ); if ( sire2 != '\0' ) sire2[0] = UPPER( sire2[0] ); if ( sire3 != '\0' ) sire3[0] = UPPER( sire3[0] ); if ( sire4 != '\0' ) sire4[0] = UPPER( sire4[0] ); if ( sire5 != '\0' ) sire5[0] = UPPER( sire5[0] ); if ( sire6 != '\0' ) sire6[0] = UPPER( sire6[0] ); if ( sire1[0] == '\0' ) sprintf( buf, "%-16s", "None" ); else if ( sire2[0] == '\0' ) sprintf( buf, "%-16s", sire1 ); else if ( sire3[0] == '\0' ) sprintf( buf, "%-16s", sire2 ); else if ( sire4[0] == '\0' ) sprintf( buf, "%-16s", sire3 ); else if ( sire5[0] == '\0' ) sprintf( buf, "%-16s", sire4 ); else if ( sire6[0] == '\0' ) sprintf( buf, "%-16s", sire5 ); else sprintf( buf, "%-16s", sire6 ); if ( !str_cmp( buf, "morglum" ) ) { sprintf( buf, "%-16s", "Morglum" ); send_to_char( buf, ch ); } else send_to_char( buf, ch ); return; } void do_clearpks(CHAR_DATA *ch, char *argument) { if (IS_NPC(ch)) return; if (ch->in_room->vnum != 3054) { send_to_char("Please step into the Temple Altar to clear your records.\r\n", ch); return; } send_to_char("Done\r\n", ch); ch->pkill = 0; ch->pdeath = 0; ch->race = 0; }