doplanets.txt
snippets · 2.6 KB · 2010-03-30
New do_planets by Kaz Ro for SWR (renames the old one to do_planets2).
Download « Back to the snippets list
New do_planets by Kaz Ro
-----------------------------------------
In clans.c
-----------------------------------------
Find: do_planets.
(A)
Remove: void do_planets( CHAR_DATA *ch, char *argument )
Add: void do_planets2( CHAR_DATA *ch, char *argument )
(B) Delete all of do_planets or comment it out
-----------------------------------------
After: do_planets2 or in place of do_planets
Add:
void do_planets( CHAR_DATA *ch, char *argument )
{
PLANET_DATA *planet;
int count = 0;
set_char_color( AT_WHITE, ch );
ch_printf( ch, "&G&B----------------+----------+----------+----------------------+--------+-------+\n\r");
ch_printf( ch, "&G&C Planet&G&B |&G&C Revenue&G&B |&G&C Value&B |&G&C Government&G&B |&G&CCitizens&G&B|&G&CSupport&G&B|\n\r");
ch_printf( ch, "&G&B----------------+----------+----------+----------------------+--------+-------+\n\r");
for ( planet = first_planet; planet; planet = planet->next )
{
ch_printf( ch, "&G&W%-15s&B |&Y %-8ld&B |&O %-8d&B |&w %-20.20s&B |&w %-6d&B |&w %-5.1f&B |\n\r", planet->name, get_taxes(planet), planet->base_value, planet->governed_by ? planet->governed_by->name : "", planet->population, planet->pop_support );
count++;
}
ch_printf( ch, "&G&B----------------+----------+----------+----------------------+--------+-------+\n\r");
if ( !count )
{
set_char_color( AT_BLOOD, ch);
send_to_char( "There are no planets currently formed.\n\r", ch );
}
}
-----------------------------------------
For A only
In mud.h
-----------------------------------------
Find: DECLARE_DO_FUN( do_planets );
Add: DECLARE_DO_FUN( do_planets2 );
-----------------------------------------
in tables.c
-----------------------------------------
Find: if ( !str_cmp( name, "do_planets" )) return do_planets;
Add: if ( !str_cmp( name, "do_planets2" )) return do_planets2;
-----------------------------------------
Find: if ( skill == do_planets ) return "do_planets";
Add: if ( skill == do_planets2 ) return "do_planets2";