|
Sylvanoes Beginner
Joined: 30 Jan 2003 Posts: 22 Location: USA
|
Posted: Fri Nov 21, 2003 2:06 pm
Coding Question |
I am definately not a decent enough coder to be able to solve this problem, but I know what it is. Hopefully someone can help with this.
void do_showstatistic( CHAR_DATA *ch, char *argument )
{
PC_DATA *pcdata;
CHAR_DATA *raceCh;
int race;
bool chk_race = FALSE;
char buf[MAX_INPUT_LENGTH];
char arg[MAX_INPUT_LENGTH];
if ( race < 0 || arg[0] == '\0' )
{
send_to_char( "&W&RSyntax: Showstat nr", ch );
return;
}
else
chk_race = TRUE;
race = get_race_from_name( argument );
if( race < 0 )
{
send_to_char( "No such race.nr", ch );
return;
}
CREATE( raceCh, CHAR_DATA, 1 );
raceCh->top_level = 1;
raceCh->trust = 0;
CREATE( pcdata, PC_DATA, 1 );
raceCh->pcdata = pcdata;
raceCh->in_room = get_room_index( ROOM_VNUM_LIMBO );
raceCh->perm_str = 20;
raceCh->perm_int = 20;
raceCh->perm_wis = 20;
raceCh->perm_dex = 20;
raceCh->perm_con = 20;
raceCh->perm_cha = 20;
raceCh->perm_lck = 3;
if( chk_race )
raceCh->race = race;
raceCh->perm_str
+= race_table[raceCh->race].str_plus;
raceCh->perm_int
+= race_table[raceCh->race].int_plus;
raceCh->perm_wis
+= race_table[raceCh->race].wis_plus;
raceCh->perm_dex
+= race_table[raceCh->race].dex_plus;
raceCh->perm_con
+= race_table[raceCh->race].con_plus;
raceCh->perm_cha
+= race_table[raceCh->race].cha_plus;
if( chk_race )
{
sprintf( buf, "&R%s Statisticsnr", race_table[race].race_name );
send_to_pager( buf, ch );
sprintf( buf, "&cStr: &C%d &cWis: &C%d &cInt: &C%d &cDex: &C%d &cCon: &C%d &cCha: &C%dnr",
raceCh->perm_str, raceCh->perm_wis, raceCh->perm_int,
raceCh->perm_dex, raceCh->perm_con, raceCh->perm_cha );
send_to_pager( buf, ch );
}
DISPOSE( raceCh->pcdata );
DISPOSE( raceCh );
}
how would I change it to check the current players race, and default to using the race? currently the activation command is SHOWSTATISITC.
it defaults to the perm_stats (perm_int = 20) currently.
Thanks in advance |
|
|
|
Cuttlefish Apprentice
Joined: 28 Oct 2003 Posts: 164
|
Posted: Fri Nov 21, 2003 5:11 pm |
Is this a zMUD related question?
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sat Nov 22, 2003 1:47 am |
This forum is devoted to zMud, the most advanced mud client. While I would love to take the time to anylyze the C code you presented it is totally off the topic of this forum. I would suggest you find a forum for whatever codebase you are using.
Topic locked. |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|