Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yahoo!

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » New do_areas command from Sma...
Forum Rules | Mark all | Recent Posts

New do_areas command from Smaug 1.8
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Dec 2, 2007, 7:56 pm   Last edited Dec 2, 2007, 7:58 pm by Kayle
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

To make use of this in FUSS 1.8 (might have been an oversight), it's really quite simple.

Mud.h
Find the AFLAG defines and in the next available slot, add:
#define AFLAG_HIDDEN            BVXX /* Hidden from area list. */

where XX is the next available number.

Build.c:
in char *const area_flags[]
Add:
"hidden",
to the spot in the list corresponding to the XX's from the mud.h define.

Act_info.c
Find and replace do_areas with the following:
/*
 * New do_areas, written by Fireblade, last modified - 4/27/97
 *
 *   Syntax: area             ->      lists areas in alphanumeric order
 *           area <a>         ->      lists areas with soft max less than
 *                                                    parameter a
 *           area <a> <b>     ->      lists areas with soft max bewteen
 *                                                    numbers a and b
 *           area old         ->      list areas in order loaded
 *           area <area name> ->  list detailed info on a specified area
 *
 */
void do_areas( CHAR_DATA * ch, char *argument )
{
	char *header_string1 = "\r\n   Author    |             Area                     | Recommended |  Enforced\r\n";
	char *header_string2 = "-------------+--------------------------------------+-------------+-----------\r\n";
	char *print_string = "%-12s | %-36s | %4d - %-4d | %3d - %-3d \r\n";
	AREA_DATA *pArea;
	int lower_bound = 0;
	int upper_bound = MAX_LEVEL + 1;
	/* make sure is to init. > max area level */
	char arg[MAX_STRING_LENGTH];
	char *org = argument;
   
	argument = one_argument(argument,arg);
		
	if( arg[0] != '\0' )
	{
		if( !is_number( arg ) )
		{
			if( !strcmp( arg,"old" ) )
			{
				set_pager_color( AT_PLAIN, ch );
				send_to_pager_color(header_string1, ch);
				send_to_pager_color(header_string2, ch);
				for( pArea = first_area; pArea;pArea = pArea->next )
				{   
					if( IS_SET( pArea->flags, AFLAG_HIDDEN ) )
						continue; /* Blod, 2000 */
					pager_printf_color(ch, print_string, pArea->author, pArea->name, pArea->low_soft_range, pArea->hi_soft_range, pArea->low_hard_range, pArea->hi_hard_range );
				}  
				return;
			}
			else
			{
				for( pArea = first_area_name; pArea; pArea = pArea->next_sort_name )
				{
					if( !str_cmp( pArea->name, org ) )
					{
						pager_printf_color( ch, "&CArea:  &Y%s\n\r", pArea->name );
						pager_printf_color( ch, "&CAuthor:  &Y%s\n\r", pArea->author );
						pager_printf_color( ch, "&CCredits: &Y%s\n\r", pArea->credits );
						pager_printf_color( ch, "&CLevel Range:  &Y%d - %d\n\r\n\r", pArea->low_soft_range, pArea->hi_soft_range );
						do_help( ch, pArea->name );
						return;
					}
				}
			}
			send_to_char( "Area may only be followed by numbers, 'old', or an area name.\n\r", ch );
			return;
		}
								 
		upper_bound = atoi( arg );
		lower_bound = upper_bound;
												
		argument = one_argument( argument,arg );
												
		if( arg[0] != '\0' )
		{
			if( !is_number( arg ) )
			{
				send_to_char( "Area may only be followed by numbers.\n\r", ch );
				return;
			}
								
			upper_bound = atoi( arg );
				 
			argument = one_argument( argument, arg );
			if( arg[0] != '\0')
			{
				send_to_char( "Only two level numbers allowed.\n\r", ch );
				return;
			}
		}
	}
						 
	if( lower_bound > upper_bound )
	{
		int swap = lower_bound;
		lower_bound = upper_bound;
		upper_bound = swap;
	}
 
	set_pager_color( AT_PLAIN, ch );
	send_to_pager_color( header_string1, ch );
	send_to_pager_color( header_string2, ch );
								
	for( pArea = first_area_name; pArea; pArea = pArea->next_sort_name )
	{
		if( pArea->hi_soft_range >= lower_bound && pArea->low_soft_range <= upper_bound )
		{
			if ( IS_SET( pArea->flags, AFLAG_HIDDEN ) )
				continue; /* Blod, 2000 */
			pager_printf_color(ch, print_string, pArea->author, pArea->name, pArea->low_soft_range,	pArea->hi_soft_range, pArea->low_hard_range, pArea->hi_hard_range );
		}
	}
	return;
}
*Note: Spacing may look awkward because of Visual Studio's apparent inability to play nice when it comes to swapping out tab characters for plain spaces.

Example output from the new argument:
<30hp 112m 110mv> <#1214> areas limbo
Area:  Limbo
Author:  RoD
Credits: (null)
Level Range:  0 - 60

The limitless void known as Limbo is a strange plane fabricated by
the Gods to hold mortals who have been rendered unconscious or have
been mortally wounded. It is a well known fact that only Gods may travel
here of their own volition.
       
Pages:<< prev 1 next >>