practice_spell_and_skill_sort.txt
snippets · 1.9 KB · 2010-03-30
Practice sort: sort spells and skills in the practice list.
Download « Back to the snippets list
/***Add this Variable***/
int spn = 0;
/***********************/
/***
All DIKU/ROM/MUD, etc etc rules apply for this snippet.
Please respect my work, as I have respected others.
Leave this comment in for my work.
Snippet Creator: Silence Tyire
/***
/***Replace the display for the practice command with:**********/
send_to_char("{G+{W**************************************{MSPELLS{W***********************************{G+\n\r", ch);
for (sn = 0; sn < MAX_SKILL; sn++)
{
if (skill_table[sn].name == NULL)
break;
if (ch->level < skill_table[sn].skill_level[ch->class]
|| ch->pcdata->learned[sn] < 1 /* skill is not known */ )
continue;
if ((skill_table[sn].spell_fun == spell_null) && (spn == 0))
{
spn++;
send_to_char("\n\r{G+{W**************************************{MSKILLS{W***********************************{G+\n\r", ch);
col = 0;
}
sprintf (buf, " {C%-18s {B%3d%% {x",
skill_table[sn].name, ch->pcdata->learned[sn]);
send_to_char (buf, ch);
if (++col % 3 == 0)
send_to_char ("\n\r", ch);
}
if (col % 3 != 0)
send_to_char ("\n\r", ch);
sprintf (buf, "{G+{W**************************************{MPractices{D: {R%-3d{W***************************{G+{x\n\r",
ch->practice);
send_to_char (buf, ch);
}
/***This snippet ends right before do_practice jumps into the
else
{
CHAR_DATA *mob;
int adept;
if (!IS_AWAKE (ch))
{
send_to_char ("In your dreams, or what?\n\r", ch);
return;
}
part of your code***/