Practice Command Organized [by Frollo]
Snippet Posted Wednesday, August 12th @ 11:34:09 PM, by George Greer in the Commands dept.
Added Jul 20, 1998. Click the link below to read it or download it.

From: Frollo 
Subject: New Practice command

An improved way of listing spells/skills/languages (This snippet might
work nicely with my languages snip)  Again, might want to mess with the &c
and &n and stuff...  i'm real lazy, if you havn't noticed...don't really
wanna take em out :)

---spec_procs.c---
void list_skills(struct char_data * ch)
{

extern char *spells[];

extern struct spell_info_type spell_info[];

int i, x;


sprintf(buf, "&c---------------------------------[ LANGUAGE ]------------------
---------------\r\n");

x = 0;

for (i = MIN_LANGUAGES; i < MAX_SKILLS; i++) {


if (GET_LEVEL(ch) >= spell_info[i].min_level[(int)GET_CLASS(ch)]) {



x++;



sprintf(buf, "%s%20.20s &w(&c%2d%%&w)&c%s", buf, spells[i], GET_SKILL(ch, i), x
 == 3 ? "\r\n" : "");



if (x == 3)




x = 0;


}

}




sprintf(buf, "%s%s----------------------------------[ SKILLS ]-----------------
-----------------\r\n", buf, x != 3 ? "\r\n" : "");

x = 0;

for (i = MAX_SPELLS ; i < MIN_LANGUAGES; i++) {


if (GET_LEVEL(ch) >= spell_info[i].min_level[(int)GET_CLASS(ch)]) {



x++;



sprintf(buf, "%s%20.20s &w(&c%2d%%&w)&c%s", buf, spells[i], GET_SKILL(ch, i), x
 == 3 ? "\r\n" : "");



if (x == 3)




x = 0;


}

}



sprintf(buf, "%s%s----------------------------------[ SPELLS ]-----------------
-----------------\r\n", buf, x != 3 ? "\r\n" : "");

x = 0;

for (i = 1; i < MAX_SPELLS; i++) {


if (GET_LEVEL(ch) >= spell_info[i].min_level[(int)GET_CLASS(ch)]) {



x++;



sprintf(buf, "%s%20.20s &w(&c%2d%%&w)&c%s", buf, spells[i], GET_SKILL(ch, i), x
 == 3 ? "\r\n" : "");



if (x == 3)




x = 0;


}

}

if (x != 3)


strcat(buf,"\r\n");


if (!GET_PRACTICES(ch))


sprintf(buf, "%sYou have no practice sessions remaining.\r\n",buf);

else


sprintf(buf, "%sYou have %d practice session%s remaining.\r\n", buf,


GET_PRACTICES(ch), (GET_PRACTICES(ch) == 1 ? "" : "s"));

send_to_char(buf, ch);
}


<< Private Channels [by Darksword] | Reply | View as text | Threaded | Proficiency System [by Chuck Reed] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

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.