|
Skill and Spell Listing Command [by T-Rex] |
|
|
|
Posted Wednesday, August 12th @ 11:36:44 PM, by George Greer in the Commands dept.
Updated May 6, 1997. Click the link below to read it or download it.
From: Søren Peter Skou <tigerdyr@internet.dk>
Subject: Spell/Skill Listing
/* Put all of this into act.informative.c */
char *howgood(int percent)
{
static char buf[256];
if (percent == 0)
strcpy(buf, " (not learned)");
else if (percent <= 10)
strcpy(buf, " (awful)");
else if (percent <= 20)
strcpy(buf, " (bad)");
else if (percent <= 40)
strcpy(buf, " (poor)");
else if (percent <= 55)
strcpy(buf, " (average)");
else if (percent <= 70)
strcpy(buf, " (fair)");
else if (percent <= 80)
strcpy(buf, " (good)");
else if (percent <= 85)
strcpy(buf, " (very good)");
else
strcpy(buf, " (superb)");
return (buf);
}
ACMD(do_spells)
{
extern char *spells[];
extern struct spell_info_type spell_info[];
int i;
strcpy(buf, "You know of the following Spells:\r\n");
strcpy(buf2, buf);
for (i = 1; i < MAX_SPELLS+1; i++)
{
if (GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS(ch)])
{
if (GET_SKILL(ch, i) > 0)
{
sprintf(buf, "%-20s %s\r\n", spells[i], howgood(GET_SKILL(ch, i)));
strcat(buf2, buf);
}
}
}
page_string(ch->desc, buf2, 1);
}
ACMD(do_skills)
{
extern char *spells[];
extern struct spell_info_type spell_info[];
int i;
strcpy(buf, "You know of the following Skills:\r\n");
strcpy(buf2, buf);
for (i = MAX_SPELLS +1; i < MAX_SKILLS+1; i++)
{
if (GET_LEVEL(ch) >= spell_info[i].min_level[(int) GET_CLASS(ch)])
{
if (GET_SKILL(ch, i) > 0)
{
sprintf(buf, "%-20s %s\r\n", spells[i], howgood(GET_SKILL(ch, i)));
strcat(buf2, buf);
}
}
}
page_string(ch->desc, buf2, 1);
}
After this you just have to put
ACMD(do_spells) and ACMD(do_skills) into interpreter.c and define some
kind of levels for the poor commands (*grin*)
Thanks to whoever it was (I only know the Mudname Ariella)
If you have any problems, please write to serces@mud.dk or
tigerdyr@internet.dk.
/T-Rex is tired again.
<< Show userids on incoming users [by Mudadmin] | Reply | View as text | Threaded | Skill improvement code [by Nashak] >> |
|
Related Links |
|
|
|
CircleMUD Snippets |
|
|
Note: Not all of these snippets will work perfectly with
your version of code, so be prepared to fix one
or two bugs that may arise, and please let me know
what you needed to do to fix it. Sending a corrected
version is always welcome.
|
Finally, if you wish to use any of the snippets from this
page, you are more than welcome, just mention the
authors in your credits. If you wish to release any
of these snippets to the public on another site,
contact me FIRST.
|
|
|
|
|
|
|