示例#1
0
/* Function modified from original form - Samson */
void do_instaroom( CHAR_DATA * ch, const char *argument )
{
	bool dodoors;

	if ( IS_NPC( ch ) || get_trust( ch ) < LEVEL_SAVIOR || !ch->pcdata->area )
	{
		send_to_char( "You don't have an assigned area to create resets for.\r\n", ch );
		return;
	}

	if ( !str_cmp( argument, "nodoors" ) )
		dodoors = FALSE;
	else
		dodoors = TRUE;

	if ( !can_rmodify( ch, ch->in_room ) )
		return;
	if ( ch->in_room->area != ch->pcdata->area && get_trust( ch ) < LEVEL_GREATER )
	{
		send_to_char( "You cannot reset this room.\r\n", ch );
		return;
	}
	if ( ch->in_room->first_reset )
		wipe_resets( ch->in_room );
	instaroom( ch->in_room, dodoors );
	send_to_char( "Room resets installed.\r\n", ch );
}
示例#2
0
文件: guild.c 项目: michaelmwu/bota
void do_noclan( CHAR_DATA *ch, char *argument )
{
    char arg[MAX_INPUT_LENGTH],buf[MAX_STRING_LENGTH];
    CHAR_DATA *victim;
 
    one_argument( argument, arg );
 
    if ( arg[0] == '\0' )
    {
        send_to_char( "Noclan whom?\n\r", ch );
        return;
    }
       
    if ( ( victim = get_char_world( ch, arg ) ) == NULL )
    {
        send_to_char( "They aren't here.\n\r", ch );
        return;
    }
       
    if ( IS_NPC(victim) )
    {
        send_to_char( "Not on NPC's.\n\r", ch );
        return;
    }
       
    if ( get_trust( victim ) >= get_trust( ch ) )
    {
        send_to_char( "You failed.\n\r", ch );
        return;
    }
       
    if ( IS_SET(victim->act, PLR_NOCLAN) )
    {
        REMOVE_BIT(victim->act, PLR_NOCLAN);
        send_to_char( "NOCLAN removed.\n\r", ch );
        sprintf(buf,"$N allows %s to join pkill clans.",victim->name);
        wiznet(buf,ch,NULL,WIZ_PENALTIES,WIZ_SECURE,0);
    }
    else
    {
        SET_BIT(victim->act, PLR_NOCLAN);

        if(ch->clan)
        {
	    victim->clan = 0;
	    victim->rank = 0;
        }

        send_to_char( "NOCLAN set.\n\r", ch );
        sprintf(buf,"$N forbids %s to join pkill clans.",victim->name);
        wiznet(buf,ch,NULL,WIZ_PENALTIES,WIZ_SECURE,0);
    }
       
    save_char_obj( victim );
 
    return;
}
示例#3
0
文件: scan.c 项目: MUDOmnibus/Rot14
void scan_list(ROOM_INDEX_DATA *scan_room, CHAR_DATA *ch, sh_int depth,
               sh_int door)
{
   CHAR_DATA *rch;

   if (scan_room == NULL) return;
   for (rch=scan_room->people; rch != NULL; rch=rch->next_in_room)
   {
      if (rch == ch) continue;
      if (!IS_NPC(rch) && rch->invis_level > get_trust(ch)) continue;
      if ( get_trust(ch) < rch->ghost_level) continue;
      if (can_see(ch, rch)) scan_char(rch, ch, depth, door);
   }
   return;
}
示例#4
0
文件: interp.C 项目: SinaC/OldMud
// Modified by SinaC 2001
void do_wizhelp( CHAR_DATA *ch, const char *argument ) {
  char buf[MAX_STRING_LENGTH];
  int cmd;
  int col;

  if ( IS_NPC(ch) ) {
    send_to_char("Mobiles can't see immortal command.\n\r",ch);
    return;
  }

  // Added by SinaC 2001
  int lvl = get_trust(ch);
  if ( argument[0] != '\0' && is_number(argument)) {
    lvl = UMIN( atoi(argument), lvl );
  }

  col = 0;
  //for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ ) {
  for ( cmd = 0; cmd < MAX_COMMANDS; cmd++ ) {
    if ( cmd_table[cmd].level >= LEVEL_HERO
	 &&   cmd_table[cmd].level <= /*get_trust( ch )*/lvl // Modified by SinaC 2001
	 &&   cmd_table[cmd].show) {
      sprintf( buf, "%-12s", cmd_table[cmd].name );
      send_to_char( buf, ch );
      if ( ++col % 6 == 0 )
	send_to_char( "\n\r", ch );
    }
  }
 
  if ( col % 6 != 0 )
    send_to_char( "\n\r", ch );
  return;
}
示例#5
0
void do_title( CHAR_DATA * ch, const char *argument )
{
   if( IS_NPC( ch ) )
      return;

   if( IS_SET( ch->pcdata->flags, PCFLAG_NOTITLE ) )
   {
      send_to_char( "You try but the Force resists you.\r\n", ch );
      return;
   }


   if( argument[0] == '\0' )
   {
      send_to_char( "Change your title to what?\r\n", ch );
      return;
   }

   if( ( get_trust( ch ) <= LEVEL_IMMORTAL ) && ( !nifty_is_name( ch->name, argument ) ) )
   {
      send_to_char( "You must include your name somewhere in your title!", ch );
      return;
   }

   argument = smash_tilde_static( argument );
   set_title( ch, argument );
   send_to_char( "Ok.\r\n", ch );
}
示例#6
0
void do_wizhelp( CHAR_DATA *ch, char *argument )
{
	int cmd = 0;
	int col = 0;
	int clevel = 0;

	for( clevel = LEVEL_HERO + 1; clevel < MAX_LEVEL + 1; clevel++ )
	{
		for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ )
		{
			if ( cmd_table[cmd].level >= LEVEL_HERO
				&& cmd_table[cmd].level <= get_trust( ch )
				&& cmd_table[cmd].show
				&& cmd_table[cmd].level == clevel)
			{
				send_to_char( Format("[\tC%-3d\tn] \t<send href='help %s' hint='Click to see help on %s'>%-12s\t</send> |", cmd_table[cmd].level, cmd_table[cmd].name, cmd_table[cmd].name, cmd_table[cmd].name), ch );
				if ( ++col % 4 == 0 )
					send_to_char( "\n\r", ch );
			}
		}
	}

	if ( col % 4 != 0 )
		send_to_char( "\n\r", ch );
	return;
}
示例#7
0
bool
check_level_use(CHAR_DATA *ch, int level)
{
    char                buf[MAX_STRING_LENGTH];
    char                out[MAX_STRING_LENGTH];

    if (get_trust(ch) >= level)
        return TRUE;

    sprintf(out, "This option limited to ");

    switch (level) {
        case 90:
            strcat(out, "Creators only.\n\r");
            break;
        case 84:
            strcat(out, "Supremes or higher.\n\r");
            break;
        case 83:
            strcat(out, "Dieties or higher.\n\r");
            break;
        case 82:
            strcat(out, "Immortals or higher.\n\r");
            break;
        case 81:
            strcat(out, "Adepts or higher.\n\r");
            break;
        default:
            sprintf(buf, "level %d players and higher.\n\r", level);
            strcat(out, buf);
    }
    send_to_char(out, ch);
    return FALSE;
}
示例#8
0
void icec_showchannel(ice_channel *c, const char *from, const char *txt, int emote)
{
  DESCRIPTOR_DATA *d, *dnext;
  CHAR_DATA *ch;
  char buf[MAX_STRING_LENGTH];

  if (!c->local)
    return;
  
  sprintf(buf, emote ? c->local->format2 : c->local->format1, from, color_itom(txt));
  strcat(buf, "\n\r");
  
  for (d=descriptor_list; d; d=dnext)
  {
    dnext=d->next;

    ch=d->original ? d->original : d->character;

    if (!ch ||
	IS_NPC(ch) ||
	get_trust(ch) < c->local->level ||
	!ice_audible(c, imc_makename(ch->name, imc_name)) ||
	!imc_hasname(ch->pcdata->ice_listen, c->local->name))
      continue;

    send_to_char(buf, ch);
  }
}
示例#9
0
//gdy gracz wywala artefakt to zdejmujemy go raz z listy
//ktos pozbyl sie artefaktu, wywalam go z listy raz
//znaczy zostaje na mudzie ale nie ma go gracz
void artefact_from_char( OBJ_DATA *obj, CHAR_DATA *ch )
{
	ARTEFACT_DATA * atmp = NULL;
	ARTEFACT_OWNER *otmp, *prev = NULL;

	for ( atmp = artefact_system;atmp;atmp = atmp->next )
	{
		if ( obj->pIndexData->vnum == atmp->avnum )
		{
			for ( otmp = atmp->first_owner;otmp;otmp = otmp->next )
			{
				if ( !strcmp( ch->name, otmp->owner ) )
				{
					if ( prev != NULL )
						prev->next = otmp->next;
					else
						atmp->first_owner = otmp->next;

					otmp->next = NULL;
					free_artefact_owner( otmp );


					wiznet( "$N {RSTRACIL(a){x artefakt : $p.", ch, obj, WIZ_ARTEFACT, 0, get_trust( ch ) );
					append_file_format_daily( ch, ARTEFACT_LOG_FILE, "-> STRACIL :%s vnum:%d count:%d max: %d (move)", obj->short_descr, atmp->avnum, atmp->count, atmp->max_count );
					return ;
				}
				else //to nie ten
					prev = otmp;
			}
		}
	}

}
示例#10
0
/* Returns TRUE if the specified note is address to ch */
bool is_note_to (CHAR_DATA *ch, NOTE_DATA *note)
{
	if (!str_cmp (ch->pcdata->switchname, note->sender))
		return TRUE;
	
	if (is_full_name ("all", note->to_list))
		return TRUE;
		
	if (IS_IMMORTAL(ch) && ( 
		is_full_name ("imm", note->to_list) ||
		is_full_name ("imms", note->to_list) ||
		is_full_name ("immortal", note->to_list) ||
		is_full_name ("god", note->to_list) ||
		is_full_name ("gods", note->to_list) ||
		is_full_name ("immortals", note->to_list)))
		return TRUE;

	if (get_trust(ch) == MAX_LEVEL) return TRUE;

	if ((get_trust(ch) == MAX_LEVEL) && (
		is_full_name ("imp", note->to_list) ||
		is_full_name ("imps", note->to_list) ||
		is_full_name ("implementor", note->to_list) ||
		is_full_name ("implementors", note->to_list)))
		return TRUE;
		
	if (is_full_name (ch->pcdata->switchname, note->to_list))
		return TRUE;
        
        if( ch->pcdata->religion != 0 )
	{
          if (is_full_name (note->to_list, religion_table[ch->pcdata->religion].truename)) return TRUE;
	}

	if( ch->pcdata->kingdom != 0 )
	{
	    if( IS_IMMORTAL(ch)) return TRUE;
//	    if(is_full_name(king_table[ch->pcdata->kingdom].name, note->to_list) ) return TRUE;
	}

	/* Allow a note to e.g. 40 to send to characters level 40 and above */		
	if (is_number(note->to_list) && get_trust(ch) >= atoi(note->to_list))
		return TRUE;
		
	return FALSE;
}
示例#11
0
/*
 * Lets the mobile force someone to do something. Must be mortal level
 * and the all argument only affects those in the room with the mobile.
 *
 * Syntax: mob force [victim] [commands]
 */
void do_mpforce( CHAR_DATA *ch, char *argument )
{
    char arg[ MAX_INPUT_LENGTH ];

    argument = one_argument( argument, arg );

    if ( arg[0] == '\0' || argument[0] == '\0' )
    {
	bug( "Mpforce - Bad syntax from vnum %d.", 
		IS_NPC(ch) ? ch->pIndexData->vnum : 0 );
	return;
    }

    if ( !str_cmp( arg, "all" ) )
    {
        CHAR_DATA *vch;
        CHAR_DATA *vch_next;

	for ( vch = char_list; vch != NULL; vch = vch_next )
	{
	    vch_next = vch->next;

	    if ( vch->in_room == ch->in_room
		&& get_trust( vch ) < get_trust( ch ) 
		&& can_see( ch, vch ) )
	    {
		interpret( vch, argument );
	    }
	}
    }
    else
    {
	CHAR_DATA *victim;

	if ( ( victim = get_char_room( ch, arg ) ) == NULL )
	    return;

	if ( victim == ch )
	    return;

	interpret( victim, argument );
    }

    return;
}
示例#12
0
void do_mob(CHAR_DATA * ch, char *argument)
{
    /*
     * Security check!
     */
    if (ch->desc != NULL && get_trust(ch) < MAX_LEVEL)
	return;
    mob_interpret(ch, argument);
}
示例#13
0
文件: macros.c 项目: dantothelz/tze
bool	ok_to_use( CHAR_DATA *ch, int value )
{
   if ( value == NO_USE 
   &&   get_trust(ch) < 85 )
   {
      send_to_char( "Only Creators may use this value.\n\r", ch );
      return FALSE;
   }
   return TRUE;
}
示例#14
0
bool
ok_to_use(CHAR_DATA *ch, const struct lookup_type *table, int value)
{
    int minlev = level_table_lookup(table, value);

    if (minlev > get_trust(ch)) {
        sendf(ch, "You must be level %d to use this value.\n\r", minlev);
        return FALSE;
    }

    return TRUE;
}
示例#15
0
struct char_data *get_random_pc(struct char_data *ch, struct area_data *area)
{
    struct char_data *vch = NULL;
    struct char_data *wch;
    int count = 0;

    for (wch = char_list; wch != NULL; wch = wch->next) {
        if (!IS_NPC(wch)
            && can_see(ch, wch)
            && wch->in_room != NULL
            && !IS_SET(wch->in_room->room_flags, ROOM_NORANDOM)
            && (area == NULL || wch->in_room->area == area)
            && wch != ch
            && get_trust(wch) < get_trust(ch)
            && number_range(0, count) == 0) {
            vch = wch;
            count++;
        }
    }

    return vch;
}
示例#16
0
void channels_permission(struct char_data *grantor, struct char_data *grantee, bool granted, const CHANNEL_DEFINITION const *channel)
{
    static char buf[MAX_INPUT_LENGTH];

    DENY_NPC(grantor);

    if (IS_NPC(grantee)) {
	send_to_char("Not on NPC's.\n\r", grantor);
	return;
    }

    if (get_trust(grantee) >= get_trust(grantor)) {
	send_to_char("You failed.\n\r", grantor);
	return;
    }


    if (granted) {
	if (!CHAN_DENIED(grantee, channel->flag)) {
	    printf_to_char(grantor, "%s is already granted channel %s.\n\r", capitalize(grantee->name), channel->name);
	    return;
	}
	GRANT_CHAN(grantee, channel->flag);
    } else {
	if (CHAN_DENIED(grantee, channel->flag)) {
	    printf_to_char(grantor, "%s is already denied channel %s.\n\r", capitalize(grantee->name), channel->name);
	    return;
	}
	DENY_CHAN(grantee, channel->flag);
    }

    printf_to_char(grantee, "You have been %s access to channel %s.\n\r", granted ? "granted": "denied", channel->name);
    printf_to_char(grantor, "Channel access %s to %s.", granted ? "granted": "denied", capitalize(grantee->name));
    (void)snprintf(buf, MAX_INPUT_LENGTH, "$N %s %s to %s.", granted ? "grants" : "denies", channel->name, grantee->name);
    wiznet(buf, grantor, NULL, WIZ_PENALTIES, WIZ_SECURE, 0);
}
示例#17
0
/* check for icec channels, return TRUE to stop command processing, FALSE otherwise */
bool icec_command_hook(CHAR_DATA *ch, const char *command, const char *argument)
{
  ice_channel *c;
  char arg[MAX_STRING_LENGTH];
  const char *word2;
  int emote=0;
  
  if (IS_NPC(ch))
    return FALSE;
  
#ifdef CIRCLE
  skip_spaces(&argument);
#endif
  
  c=icec_findlchannel(command);
  if (!c || !c->local)
    return FALSE;

  if (c->local->level > get_trust(ch))
    return FALSE;

  if (!imc_hasname(ch->pcdata->ice_listen, c->local->name))
    return FALSE;
  
  if (!ice_audible(c, imc_makename(ch->name, imc_name)))
  {
    send_to_char("You cannot use that channel.\n\r", ch);
    return TRUE;
  }

  word2=imc_getarg(argument, arg, MAX_STRING_LENGTH);

  if (!arg[0])
  {
    send_to_char("Use ichan to toggle the channel - or provide some text.\n\r", ch);
    return TRUE;
  }

  if (!str_cmp(arg, ",") ||
      !str_cmp(arg, "emote"))
  {
    emote=1;
    argument=word2;
  }
  
  icec_sendmessage(c, ch->name, color_mtoi(argument), emote);
  return TRUE;
}
示例#18
0
/*
 * Unbans a site.
 */
void do_allow(CHAR_DATA * ch, char *argument)
{
    char arg[MAX_INPUT_LENGTH];
    char buf[MAX_STRING_LENGTH];
    BAN_DATA *prev;
    BAN_DATA *curr;

    one_argument(argument, arg);

    if (arg[0] == '\0')
    {
        send_to_char("Remove which site from the ban list?\r\n", ch);
        return;
    }

    prev = NULL;
    for (curr = ban_list; curr != NULL; prev = curr, curr = curr->next)
    {
        if (!str_cmp(arg, curr->name))
        {
            if (curr->level > get_trust(ch))
            {
                send_to_char("You are not powerful enough to lift that ban.\r\n", ch);
                return;
            }

            if (prev == NULL)
            {
                ban_list = ban_list->next;
            }
            else
            {
                prev->next = curr->next;
            }

            free_ban(curr);
            sprintf(buf, "Ban on %s lifted.\r\n", arg);
            send_to_char(buf, ch);
            save_bans();
            return;
        }
    }

    send_to_char("Site is not banned.\r\n", ch);
    return;

} // end do_allow
示例#19
0
//na przyklad jak cialko sie robi, to calkiem z listy wywala
//ownera ale zostaje na mudzie artef. count sie nie zmienia
void all_artefact_from_char( CHAR_DATA *ch )
{
	ARTEFACT_DATA * atmp = NULL;
	ARTEFACT_OWNER *otmp, *prev = NULL;
	OBJ_DATA *obj = NULL;

	for ( atmp = artefact_system;atmp;atmp = atmp->next )
	{
		otmp = atmp->first_owner;
		for ( ;otmp; )
		{
			if ( !strcmp( ch->name, otmp->owner ) )
			{
				if ( prev != NULL )
					prev->next = otmp->next;
				else
					atmp->first_owner = otmp->next;

				obj = create_object( get_obj_index( atmp->avnum ), FALSE );
				wiznet( "$N STRACIL(a) artefact : $p.", ch, obj, WIZ_ARTEFACT, 0, get_trust( ch ) );

				append_file_format_daily( ch, ARTEFACT_LOG_FILE, "-> STRACIL (zgon):%s vnum:%d count:%d max: %d (move)", obj->short_descr, atmp->avnum, atmp->count, atmp->max_count );

				extract_obj( obj );

				otmp->next = NULL;
				free_artefact_owner( otmp );

				//nastepny element
				if ( prev != NULL )
					otmp = prev->next;
				else
					otmp = atmp->first_owner;


			}
			else //to nie ten
			{
				prev = otmp;
				otmp = otmp->next;
			}
		}
	}

}
示例#20
0
void wiznet_printf( CHAR_DATA * ch, OBJ_DATA * obj, long flag, long flag_skip, int min_level, char *format, ... )
{
   va_list ap;
   char buf[MSL], buf2[MSL], Newtime[30];
   char *strtime = ( char * )ctime( &current_time );
   DESCRIPTOR_DATA *d;
   int pos = 0, i = 1;

   do
   {
      if( i > 11 )
         buf[pos++] = *strtime;
   }
   while( *strtime++ && i++ && pos < 8 );
   buf[pos] = '\0';
   mudstrlcpy( Newtime, buf, 30 );
   xprintf( buf, "[WiZNET] %s: ", Newtime );

   va_start( ap, format );

   if( !descriptor_list )
      return;

   for( d = descriptor_list; d != NULL; d = d->next )
   {
      char immnetbuffer[MSL];

      if( !d->character )
         continue;

      if( d->connected == CON_PLAYING && IS_IMMORTAL( d->character ) && IS_SET( d->character->wiznet, WIZ_ON )
          && ( !flag || IS_SET( d->character->wiznet, flag ) ) && ( !flag_skip
                                                                    || !IS_SET( d->character->wiznet, flag_skip ) )
          && get_trust( d->character ) >= min_level && d->character != ch )
      {
         vsnprintf( buf2, sizeof( buf2 ), format, ap );
         mudstrlcat( buf, buf2, MSL );
         xprintf( immnetbuffer, "%s", buf );
         act( immnetbuffer, d->character, obj, ch, TO_CHAR );
      }
   }

   va_end( ap );
   return;
}
示例#21
0
/* Returns BOARD_NOACCESS if ch has no access to board */
int unread_notes (CHAR_DATA *ch, BOARD_DATA *board)
{
	NOTE_DATA *note;
	time_t last_read;
	int count = 0;
	

	if (board->read_level > get_trust(ch))
		return BOARD_NOACCESS;
		
	last_read = ch->pcdata->last_note[board_number(board)];
	
	for (note = board->note_first; note; note = note->next)
		if (is_note_to(ch, note) && ((long)last_read < (long)note->date_stamp))
			count++;
			
	return count;
}
示例#22
0
//ktos podniosl artefakt i to go wrzuca na liste
void artefact_to_char( OBJ_DATA *obj, CHAR_DATA *ch )
{
	char buf[ MAX_STRING_LENGTH ];
	ARTEFACT_DATA *atmp = NULL;
	ARTEFACT_OWNER *ow, *otmp = NULL;
	int licznik;

	for ( atmp = artefact_system;atmp;atmp = atmp->next )
	{

		if ( atmp->avnum == obj->pIndexData->vnum )
		{
			licznik = 0;
			for ( otmp = atmp->first_owner;otmp;otmp = otmp->next )
			{
				licznik++;
				if ( otmp->next == NULL ) break;
			}
			if ( licznik > atmp->max_count )   //jak by sie cos jeblo
			{
				sprintf( buf, "Artefact error posiadacze: %d, max_count: %d", licznik, atmp->max_count );
				log_string( buf );
			}

			ow = new_artefact_owner();

			if ( atmp->first_owner != NULL )
				otmp->next = ow;
			else
				atmp->first_owner = ow;

			ow->next = NULL;
			ow->owner = str_dup( ch->name );
			ow->status = 1;
			ow->last_logoff = current_time;

			wiznet( "$N {GDOSTAL(a){x artefakt : $p.", ch, obj, WIZ_ARTEFACT, 0, get_trust( ch ) );
			append_file_format_daily( ch, ARTEFACT_LOG_FILE, "-> DOSTAL :%s vnum:%d count:%d max: %d (move)", obj->short_descr, atmp->avnum, atmp->count, atmp->max_count );

			return ;
		}
	}
}
示例#23
0
bool is_note_to( CHAR_DATA *ch, NOTE_DATA *pnote )
{
    if ( !str_cmp( ch->name, pnote->sender ) )
	return TRUE;

    if ( is_name( "all", pnote->to_list ) )
	return TRUE;

    if ( IS_IMMORTAL(ch) && is_name( "immortal", pnote->to_list ) )
	return TRUE;

    if ( is_name( ch->name, pnote->to_list ) )
	return TRUE;

    if ( get_trust(ch) >= 40)
	return TRUE;

    return FALSE;
}
void show_char_to_char(struct char_data *list, struct char_data *ch)
{
    struct char_data *rch;

    for (rch = list; rch != NULL; rch = rch->next_in_room) {
	if (rch == ch)
	    continue;

	if (get_trust(ch) < rch->invis_level)
	    continue;

	if (can_see(ch, rch))
	    show_char_to_char_0(rch, ch);
	else if (room_is_dark(ch, ch->in_room)
		&& IS_AFFECTED(rch, AFF_INFRARED))
	    send_to_char("You see glowing ```1red ``eyes watching YOU!\n\r", ch);
    }

    return;
}
示例#25
0
bool spec_thief(CHAR_DATA * ch)
{
	CHAR_DATA *victim;
	CHAR_DATA *v_next;
	int gold, maxgold;

	if (ch->position != POS_STANDING)
		return FALSE;

	for (victim = ch->in_room->first_person; victim; victim = v_next) {
		v_next = victim->next_in_room;

		if (IS_NPC(victim) || get_trust(victim) >= LEVEL_IMMORTAL || number_bits(2) != 0 || !can_see(ch, victim))	/* Thx Glop */
			continue;

		if (IS_AWAKE(victim) && number_range(0, ch->top_level) == 0) {
			act(AT_ACTION,
			    "You discover $n's hands in your wallet!", ch, NULL,
			    victim, TO_VICT);
			act(AT_ACTION, "$N discovers $n's hands in $S wallet!",
			    ch, NULL, victim, TO_NOTVICT);
			return TRUE;
		} else {
			maxgold = ch->top_level * ch->top_level * 1000;
			gold = victim->gold
			    * number_range(1,
					   URANGE(2, ch->top_level / 4,
						  10)) / 100;
			ch->gold += 9 * gold / 10;
			victim->gold -= gold;
			if (ch->gold > maxgold) {
				boost_economy(ch->in_room->area,
					      ch->gold - maxgold / 2);
				ch->gold = maxgold / 2;
			}
			return TRUE;
		}
	}

	return FALSE;
}
示例#26
0
/* Function modified from original form - Samson */
void do_instazone( CHAR_DATA * ch, const char *argument )
{
	AREA_DATA *pArea;
	ROOM_INDEX_DATA *pRoom;
	bool dodoors;

	if ( IS_NPC( ch ) || get_trust( ch ) < LEVEL_SAVIOR || !ch->pcdata->area )
	{
		send_to_char( "You don't have an assigned area to create resets for.\r\n", ch );
		return;
	}
	if ( !str_cmp( argument, "nodoors" ) )
		dodoors = FALSE;
	else
		dodoors = TRUE;
	pArea = ch->pcdata->area;
	wipe_area_resets( pArea );
	for ( pRoom = pArea->first_room; pRoom; pRoom = pRoom->next_aroom )
		instaroom( pRoom, dodoors );
	send_to_char( "Area resets installed.\r\n", ch );
	return;
}
示例#27
0
/*
 * Contributed by Alander.
 */
void do_commands( CHAR_DATA *ch, char *argument )
{
	int cmd = 0;
	int col = 0;

	col = 0;
	for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ )
	{
		if ( cmd_table[cmd].level <  LEVEL_HERO
			&&   cmd_table[cmd].level <= get_trust( ch ) 
			&&   cmd_table[cmd].show)
		{
			send_to_char( Format("%-12s", cmd_table[cmd].name), ch );
			if ( ++col % 4 == 0 )
				send_to_char( "\n\r", ch );
		}
	}

	if ( col % 4 != 0 )
		send_to_char( "\n\r", ch );
	return;
}
示例#28
0
void wiznet( char *string, CHAR_DATA * ch, OBJ_DATA * obj, long flag, long flag_skip, int min_level )
{
   char buf[MAX_STRING_LENGTH];
   DESCRIPTOR_DATA *d;

   xprintf( buf, "#W%s#n", string );
   for( d = descriptor_list; d != NULL; d = d->next )
   {
	  if(!d->character) return;
      if( d->connected == CON_PLAYING && ( IS_HERO( d->character ) ) && IS_SET( d->character->wiznet, WIZ_ON )
          && ( !flag || IS_SET( d->character->wiznet, flag ) ) && ( !flag_skip
                                                                    || !IS_SET( d->character->wiznet, flag_skip ) )
          && get_trust( d->character ) >= min_level && d->character != ch )
      {
         if( IS_SET( d->character->wiznet, WIZ_PREFIX ) )
            send_to_char( "#Y-->#n ", d->character );
         act( buf, d->character, obj, ch, TO_CHAR );
      }
   }

   return;
}
示例#29
0
文件: interp.C 项目: SinaC/OldMud
/*
 * Contributed by Alander.
 */
void do_commands( CHAR_DATA *ch, const char *argument ) {
  char buf[MAX_STRING_LENGTH];
  int cmd;
  int col;
 
  col = 0;
  //for ( cmd = 0; cmd_table[cmd].name[0] != '\0'; cmd++ ) {
  for ( cmd = 0; cmd < MAX_COMMANDS; cmd++ ) {
    if ( cmd_table[cmd].level < LEVEL_HERO
	 &&   cmd_table[cmd].level <= get_trust( ch ) 
	 &&   cmd_table[cmd].show) {
      sprintf( buf, "%-13s", cmd_table[cmd].name );
      send_to_char( buf, ch );
      if ( ++col % 6 == 0 )
	send_to_char( "\n\r", ch );
    }
  }
 
  if ( col % 6 != 0 )
    send_to_char( "\n\r", ch );
  return;
}
示例#30
0
文件: news.c 项目: Igdra/smaugfuss
/* news command hook; interp.c -Nopey */
bool news_cmd_hook( CHAR_DATA * ch, char *cmd, char *argument )
{
   int x = 0;

   for( x = 0; x < top_news_type; ++x )
      if( !str_cmp( cmd, news_command_table[x] ) )
      {
         NEWS_TYPE *type = NULL;

         sprintf( local_buf, "%d", x );
         if( ( type = figure_type( local_buf ) ) == NULL )
         {
            bug( "news_cmd_hook(): cannot find type for cmd %s", cmd );
            return FALSE;
         }
         if( get_trust( ch ) < type->level )
            return FALSE;

         display_news_type( ch, type, argument );
         return TRUE;
      }
   return FALSE;
}