Welcome to the Builder Academy

Question Stat function for mortals to see their own stats

More
16 Jan 2013 00:47 - 16 Jan 2013 01:12 #1352 by Juras
In act.wizard.c

find line 44 showing:
Code:
static void do_stat_character(struct char_data *ch, struct char_data *k);

and add this below:
Code:
static void do_stat_mortal(struct char_data *ch);

around line 961 at the end of do_stat_character add this:
Code:
static void do_stat_mortal(struct char_data *ch) { char buf1[MAX_STRING_LENGTH]; char buf2[MAX_STRING_LENGTH]; sprinttype(GET_SEX(ch), genders, buf1, sizeof(buf1)); sprinttype(ch->player.chclass, pc_class_types, buf2, sizeof(buf2)); send_to_char(ch, "You are known as %s %s, the level %2d %s %s\r\n", GET_NAME(ch), ch->player.title ? ch->player.title : "the nobody", GET_LEVEL(ch), buf1, buf2); send_to_char(ch, "Str: [%s%d/%d%s] Int: [%s%d%s] Wis: [%s%d%s] " "Dex: [%s%d%s] Con: [%s%d%s] Cha: [%s%d%s]\r\n", CCCYN(ch, C_NRM), GET_STR(ch), GET_ADD(ch), CCNRM(ch, C_NRM), CCCYN(ch, C_NRM), GET_INT(ch), CCNRM(ch, C_NRM), CCCYN(ch, C_NRM), GET_WIS(ch), CCNRM(ch, C_NRM), CCCYN(ch, C_NRM), GET_DEX(ch), CCNRM(ch, C_NRM), CCCYN(ch, C_NRM), GET_CON(ch), CCNRM(ch, C_NRM), CCCYN(ch, C_NRM), GET_CHA(ch), CCNRM(ch, C_NRM)); send_to_char(ch, "AC: [%d%+d/10], Hitroll: [%2d], Damroll: [%2d]\r\n", GET_AC(ch), dex_app[GET_DEX(ch)].defensive, ch->points.hitroll, ch->points.damroll); send_to_char(ch, "Gold: [%9d], Bank: [%9d] (Total: %d) \r\n", GET_GOLD(ch), GET_BANK_GOLD(ch), GET_GOLD(ch) + GET_BANK_GOLD(ch)); sprintbitarray(AFF_FLAGS(ch), affected_bits, AF_ARRAY_MAX, buf1); send_to_char(ch, "Affected by: %s%s%s\r\n", CCYEL(ch, C_NRM), buf1, CCNRM(ch, C_NRM)); }

just below that in ACMD (do_stat) find:
Code:
half_chop(argument, buf1, buf2);

and add this below it:
Code:
if (GET_LEVEL(ch) < LVL_IMMORT) { /* Check to see if they're an imm or a mortal */ do_stat_mortal(ch); /* Mortals use do_stat_mortal - imms continue on */ return; }

Last but not least:
In interpreter.c
line 304

find:
Code:
{ "stat" , "stat" , POS_DEAD , do_stat , LVL_IMMORT, 0 }

and change it to:
Code:
{ "stat" , "stat" , POS_DEAD , do_stat , 1, 0 }
Last edit: 16 Jan 2013 01:12 by Juras.
The following user(s) said Thank You: thomas, Axanon, zusuk

Please Log in or Create an account to join the conversation.

More
18 Jan 2013 19:33 #1374 by Axanon
This is nice, though I always preferred adding more fields to players' score sheet. The function is already there, just needs some love.

Please Log in or Create an account to join the conversation.

More
18 Jan 2013 21:31 #1376 by Juras
Valid point.

From what I've seen that's the direction most muds take.

I like this however as a way to keep the score sheet from becoming bloated with too much information.

Please Log in or Create an account to join the conversation.

More
19 Jan 2013 17:04 #1382 by zusuk
Yeah I hear you, already I have a score-sheet, affects command, attacks command and if you are a caster, various caster-interface commands for info :P

Website
www.luminariMUD.com

Main Game Port
luminariMUD.com:4100

Please Log in or Create an account to join the conversation.

Time to create page: 0.177 seconds