#if defined(macintosh) #include <types.h> #else #include <sys/types.h> #endif #include <stdio.h> #include <time.h> #include "merc.h" #include "magic.h" #include "interp.h" /* * do_train_new() * * Handles Display, and training of Skill Trees */ void do_train_new (CHAR_DATA * ch, char *argument) { int sn; char buf[MSL]; char arg1[MAX_INPUT_LENGTH]; //char arg2[MAX_INPUT_LENGTH]; int cnt = 0; argument = one_argument (argument, arg1); //argument = one_argument (argument, arg2); if (arg1[0] == '\0') { int col; stc("Current Skill Trees you can Learn:\n", ch); stc("Tree Name Lvl Tree Name Lvl Tree Name Lvl\n", ch); stc("---------- --- ----------- --- ----------- ---\n", ch); col = 0; 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; sprintf (buf, "{c%-19s {w%-3d{c ", skill_table[sn].name, ch->pcdata->learned[sn]); send_to_char (buf, ch); cnt += 1; if (++col % 3 == 0) send_to_char ("\n{x", ch); } if (col % 3 != 0) send_to_char ("\n{x", ch); sprintf (buf, "You have %d practice sessions left (%d total).\n", ch->practice, cnt); send_to_char (buf, ch); } else { do_function (ch, &do_train_new, ""); return; } }