Remove practice command, add skills command, remove guild special room assignment

This commit is contained in:
kinther 2025-08-17 09:12:48 -07:00
parent 31e46e739d
commit 5a19b015e3
11 changed files with 27 additions and 139 deletions

View file

@ -240,9 +240,9 @@ ACMD(do_display);
ACMD(do_group);
ACMD(do_hide);
ACMD(do_not_here);
ACMD(do_practice);
ACMD(do_report);
ACMD(do_save);
ACMD(do_skills);
ACMD(do_sneak);
ACMD(do_split);
ACMD(do_steal);

View file

@ -266,19 +266,14 @@ ACMD(do_steal)
hit(vict, ch, TYPE_UNDEFINED);
}
ACMD(do_practice)
ACMD(do_skills)
{
char arg[MAX_INPUT_LENGTH];
if (IS_NPC(ch))
return;
one_argument(argument, arg);
list_skills(ch);
if (*arg)
send_to_char(ch, "You can only practice skills in your guild.\r\n");
else
list_skills(ch);
}
ACMD(do_visible)

View file

@ -797,9 +797,9 @@ static void do_stat_character(struct char_data *ch, struct char_data *k)
send_to_char(ch, "Created: [%s], Last Logon: [%s]\r\n", buf1, buf2);
send_to_char(ch, "Played: [%dh %dm], Age: [%d], STL[%d]/per[%d]/NSTL[%d]",
send_to_char(ch, "Played: [%dh %dm], Age: [%d], per[%d]/NSTL[%d]",
k->player.time.played / 3600, (k->player.time.played % 3600) / 60,
age(k)->year, GET_PRACTICES(k), int_app[GET_INT(k)].learn,
age(k)->year, int_app[GET_INT(k)].learn,
wis_app[GET_WIS(k)].bonus);
/* Display OLC zone for immorts. */
if (GET_LEVEL(k) >= LVL_BUILDER) {
@ -2615,9 +2615,9 @@ ACMD(do_show)
send_to_char(ch, "Player: %-12s (%s) [%2d %s]\r\n", GET_NAME(vict),
genders[(int) GET_SEX(vict)], GET_LEVEL(vict), class_abbrevs[(int)
GET_CLASS(vict)]);
send_to_char(ch, "Gold: %-8d Bal: %-8d Exp: %-8d Align: %-5d Lessons: %-3d\r\n",
send_to_char(ch, "Gold: %-8d Bal: %-8d Exp: %-8d Align: %-5d\r\n",
GET_GOLD(vict), GET_BANK_GOLD(vict), GET_EXP(vict),
GET_ALIGNMENT(vict), GET_PRACTICES(vict));
GET_ALIGNMENT(vict));
send_to_char(ch, "Started: %-25.25s Last: %-25.25s\r\n", buf1, buf2);
send_to_char(ch, "Played: %dh %dm\r\n",
(int) (vict->player.time.played / 3600),
@ -2873,7 +2873,6 @@ static struct set_struct {
{ "password", LVL_GRGOD, PC, MISC },
{ "poofin", LVL_IMMORT, PC, MISC },
{ "poofout", LVL_IMMORT, PC, MISC }, /* 40 */
{ "practices", LVL_GOD, PC, NUMBER },
{ "quest", LVL_GOD, PC, BINARY },
{ "room", LVL_BUILDER, BOTH, NUMBER },
{ "screenwidth", LVL_GOD, PC, NUMBER },
@ -3202,13 +3201,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
POOFOUT(vict) = strdup(val_arg);
}
break;
case 41: /* practices */
GET_PRACTICES(vict) = RANGE(0, 100);
break;
case 42: /* quest */
case 41: /* quest */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_QUEST);
break;
case 43: /* room */
case 42: /* room */
if ((rnum = real_room(value)) == NOWHERE) {
send_to_char(ch, "No room exists with that number.\r\n");
return (0);
@ -3217,23 +3213,23 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
char_from_room(vict);
char_to_room(vict, rnum);
break;
case 44: /* screenwidth */
case 43: /* screenwidth */
GET_SCREEN_WIDTH(vict) = RANGE(40, 200);
break;
case 45: /* sex */
case 44: /* sex */
if ((i = search_block(val_arg, genders, FALSE)) < 0) {
send_to_char(ch, "Must be 'male', 'female', or 'neutral'.\r\n");
return (0);
}
GET_SEX(vict) = i;
break;
case 46: /* showvnums */
case 45: /* showvnums */
SET_OR_REMOVE(PRF_FLAGS(vict), PRF_SHOWVNUMS);
break;
case 47: /* siteok */
case 46: /* siteok */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_SITEOK);
break;
case 48: /* str */
case 47: /* str */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3242,16 +3238,16 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.str_add = 0;
affect_total(vict);
break;
case 49: /* stradd */
case 48: /* stradd */
vict->real_abils.str_add = RANGE(0, 100);
if (value > 0)
vict->real_abils.str = 18;
affect_total(vict);
break;
case 50: /* thief */
case 49: /* thief */
SET_OR_REMOVE(PLR_FLAGS(vict), PLR_THIEF);
break;
case 51: /* thirst */
case 50: /* thirst */
if (!str_cmp(val_arg, "off")) {
GET_COND(vict, THIRST) = -1;
send_to_char(ch, "%s's thirst is now off.\r\n", GET_NAME(vict));
@ -3265,17 +3261,17 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
return (0);
}
break;
case 52: /* title */
case 51: /* title */
set_title(vict, val_arg);
send_to_char(ch, "%s's title is now: %s\r\n", GET_NAME(vict), GET_TITLE(vict));
break;
case 53: /* variable */
case 52: /* variable */
return perform_set_dg_var(ch, vict, val_arg);
case 54: /* weight */
case 53: /* weight */
GET_WEIGHT(vict) = value;
affect_total(vict);
break;
case 55: /* wis */
case 54: /* wis */
if (IS_NPC(vict) || GET_LEVEL(vict) >= LVL_GRGOD)
RANGE(3, 25);
else
@ -3283,10 +3279,10 @@ static int perform_set(struct char_data *ch, struct char_data *vict, int mode, c
vict->real_abils.wis = value;
affect_total(vict);
break;
case 56: /* questpoints */
case 55: /* questpoints */
GET_QUESTPOINTS(vict) = RANGE(0, 100000000);
break;
case 57: /* questhistory */
case 56: /* questhistory */
qvnum = atoi(val_arg);
if (real_quest(qvnum) == NOTHING) {
send_to_char(ch, "That quest doesn't exist.\r\n");

View file

@ -634,11 +634,6 @@ void advance_level(struct char_data *ch)
if (GET_LEVEL(ch) > 1)
ch->points.max_mana += add_mana;
if (IS_MAGIC_USER(ch) || IS_CLERIC(ch))
GET_PRACTICES(ch) += MAX(2, wis_app[GET_WIS(ch)].bonus);
else
GET_PRACTICES(ch) += MIN(2, MAX(1, wis_app[GET_WIS(ch)].bonus));
if (GET_LEVEL(ch) >= LVL_IMMORT) {
for (i = 0; i < 3; i++)
GET_COND(ch, i) = (char) -1;

View file

@ -930,13 +930,6 @@ void find_replacement(void *go, struct script_data *sc, trig_data *trig,
}
snprintf(str, slen, "%s", position_types[GET_POS(c)]);
}
else if (!str_cmp(field, "prac")) {
if (subfield && *subfield) {
int addition = atoi(subfield);
GET_PRACTICES(c) = MAX(0, GET_PRACTICES(c) + addition);
}
snprintf(str, slen, "%d", GET_PRACTICES(c));
}
else if (!str_cmp(field, "pref")) {
if (subfield && *subfield) {
int pref = get_flag_by_name(preference_bits, subfield);

View file

@ -232,7 +232,6 @@ cpp_extern const struct command_info cmd_info[] = {
{ "put" , "p" , POS_RESTING , do_put , 0, 0 },
{ "peace" , "pe" , POS_DEAD , do_peace , LVL_BUILDER, 0 },
{ "pick" , "pi" , POS_STANDING, do_gen_door , 1, SCMD_PICK },
{ "practice" , "pr" , POS_RESTING , do_practice , 1, 0 },
{ "page" , "pag" , POS_DEAD , do_page , 1, 0 },
{ "pardon" , "pardon" , POS_DEAD , do_wizutil , LVL_GOD, SCMD_PARDON },
{ "plist" , "plist" , POS_DEAD , do_plist , LVL_GOD, 0 },
@ -283,6 +282,7 @@ cpp_extern const struct command_info cmd_info[] = {
{ "send" , "send" , POS_SLEEPING, do_send , LVL_GOD, 0 },
{ "set" , "set" , POS_DEAD , do_set , LVL_IMMORT, 0 },
{ "shout" , "sho" , POS_RESTING , do_gen_comm , 0, SCMD_SHOUT },
{ "skills" , "sk" , POS_SLEEPING, do_skills , 0, 0 },
{ "show" , "show" , POS_DEAD , do_show , LVL_IMMORT, 0 },
{ "shutdow" , "shutdow" , POS_DEAD , do_shutdown , LVL_IMPL, 0 },
{ "shutdown" , "shutdown", POS_DEAD , do_shutdown , LVL_IMPL, SCMD_SHUTDOWN },

View file

@ -265,7 +265,6 @@ int load_char(const char *name, struct char_data *ch)
GET_COND(ch, THIRST) = PFDEF_THIRST;
GET_COND(ch, DRUNK) = PFDEF_DRUNK;
GET_BAD_PWS(ch) = PFDEF_BADPWS;
GET_PRACTICES(ch) = PFDEF_PRACTICES;
GET_GOLD(ch) = PFDEF_GOLD;
GET_BANK_GOLD(ch) = PFDEF_BANK;
GET_EXP(ch) = PFDEF_EXP;
@ -384,7 +383,6 @@ int load_char(const char *name, struct char_data *ch)
case 'L':
if (!strcmp(tag, "Last")) ch->player.time.logon = atol(line);
else if (!strcmp(tag, "Lern")) GET_PRACTICES(ch) = atoi(line);
else if (!strcmp(tag, "Levl")) GET_LEVEL(ch) = atoi(line);
else if (!strcmp(tag, "Lmot")) GET_LAST_MOTD(ch) = atoi(line);
else if (!strcmp(tag, "Lnew")) GET_LAST_NEWS(ch) = atoi(line);
@ -623,7 +621,6 @@ void save_char(struct char_data * ch)
if (GET_LOADROOM(ch) != PFDEF_LOADROOM) fprintf(fl, "Room: %d\n", GET_LOADROOM(ch));
if (GET_BAD_PWS(ch) != PFDEF_BADPWS) fprintf(fl, "Badp: %d\n", GET_BAD_PWS(ch));
if (GET_PRACTICES(ch) != PFDEF_PRACTICES) fprintf(fl, "Lern: %d\n", GET_PRACTICES(ch));
if (GET_COND(ch, HUNGER) != PFDEF_HUNGER && GET_LEVEL(ch) < LVL_IMMORT) fprintf(fl, "Hung: %d\n", GET_COND(ch, HUNGER));
if (GET_COND(ch, THIRST) != PFDEF_THIRST && GET_LEVEL(ch) < LVL_IMMORT) fprintf(fl, "Thir: %d\n", GET_COND(ch, THIRST));

View file

@ -67,46 +67,6 @@ void assign_mobiles(void)
ASSIGNMOB(3095, cryogenicist);
ASSIGNMOB(120, guild);
ASSIGNMOB(121, guild);
ASSIGNMOB(122, guild);
ASSIGNMOB(123, guild);
ASSIGNMOB(2556, guild);
ASSIGNMOB(2559, guild);
ASSIGNMOB(2562, guild);
ASSIGNMOB(2564, guild);
ASSIGNMOB(2800, guild);
ASSIGNMOB(3020, guild);
ASSIGNMOB(3021, guild);
ASSIGNMOB(3022, guild);
ASSIGNMOB(3023, guild);
ASSIGNMOB(5400, guild);
ASSIGNMOB(5401, guild);
ASSIGNMOB(5402, guild);
ASSIGNMOB(5403, guild);
ASSIGNMOB(11518, guild);
ASSIGNMOB(25720, guild);
ASSIGNMOB(25721, guild);
ASSIGNMOB(25722, guild);
ASSIGNMOB(25723, guild);
ASSIGNMOB(25726, guild);
ASSIGNMOB(25732, guild);
ASSIGNMOB(27572, guild);
ASSIGNMOB(27573, guild);
ASSIGNMOB(27574, guild);
ASSIGNMOB(27575, guild);
ASSIGNMOB(27721, guild);
ASSIGNMOB(29204, guild);
ASSIGNMOB(29227, guild);
ASSIGNMOB(31601, guild);
ASSIGNMOB(31603, guild);
ASSIGNMOB(31605, guild);
ASSIGNMOB(31607, guild);
ASSIGNMOB(31609, guild);
ASSIGNMOB(31611, guild);
ASSIGNMOB(31639, guild);
ASSIGNMOB(31641, guild);
ASSIGNMOB(3105, mayor);
ASSIGNMOB(110, postmaster);
@ -188,7 +148,6 @@ static struct spec_func_data spec_func_list[] = {
{"Bank", bank },
{"Pet Shop", pet_shops },
{"Dump", dump },
{"Guildmaster", guild },
{"Guild Guard", guild_guard },
{"Questmaster", questmaster },
{"Shopkeeper", shop_keeper },

View file

@ -86,6 +86,7 @@ static const char *prac_types[] = {
"skill"
};
/* TO-DO: Dig deeper and figure out if the min/max practice defines can be removed */
#define LEARNED_LEVEL 0 /* % known which is considered "learned" */
#define MAX_PER_PRAC 1 /* max percent gain in skill per practice */
#define MIN_PER_PRAC 2 /* min percent gain in skill per practice */
@ -103,9 +104,7 @@ void list_skills(struct char_data *ch)
size_t len = 0;
char buf2[MAX_STRING_LENGTH];
len = snprintf(buf2, sizeof(buf2), "You have %d practice session%s remaining.\r\n"
"You know of the following %ss:\r\n", GET_PRACTICES(ch),
GET_PRACTICES(ch) == 1 ? "" : "s", SPLSKL(ch));
len = snprintf(buf2, sizeof(buf2), "You know of the following %ss:\r\n", SPLSKL(ch));
for (sortpos = 1; sortpos <= MAX_SKILLS; sortpos++) {
i = spell_sort_info[sortpos];
@ -122,49 +121,6 @@ void list_skills(struct char_data *ch)
page_string(ch->desc, buf2, TRUE);
}
SPECIAL(guild)
{
int skill_num, percent;
if (IS_NPC(ch) || !CMD_IS("practice"))
return (FALSE);
skip_spaces(&argument);
if (!*argument) {
list_skills(ch);
return (TRUE);
}
if (GET_PRACTICES(ch) <= 0) {
send_to_char(ch, "You do not seem to be able to practice now.\r\n");
return (TRUE);
}
skill_num = find_skill_num(argument);
if (skill_num < 1 ||
GET_LEVEL(ch) < spell_info[skill_num].min_level[(int) GET_CLASS(ch)]) {
send_to_char(ch, "You do not know of that %s.\r\n", SPLSKL(ch));
return (TRUE);
}
if (GET_SKILL(ch, skill_num) >= LEARNED(ch)) {
send_to_char(ch, "You are already learned in that area.\r\n");
return (TRUE);
}
send_to_char(ch, "You practice for a while...\r\n");
GET_PRACTICES(ch)--;
percent = GET_SKILL(ch, skill_num);
percent += MIN(MAXGAIN(ch), MAX(MINGAIN(ch), int_app[GET_INT(ch)].learn));
SET_SKILL(ch, skill_num, MIN(LEARNED(ch), percent));
if (GET_SKILL(ch, skill_num) >= LEARNED(ch))
send_to_char(ch, "You are now learned in that area.\r\n");
return (TRUE);
}
SPECIAL(dump)
{
struct obj_data *k;

View file

@ -952,7 +952,6 @@ struct player_special_data_saved
struct txt_block *comm_hist[NUM_HIST]; /**< Communication history */
ubyte page_length; /**< Max number of rows of text to send at once */
ubyte screen_width; /**< How wide the display page is */
int spells_to_learn; /**< Remaining number of practice sessions */
int olc_zone; /**< Current olc permissions */
int questpoints; /**< Number of quest points earned */
qst_vnum *completed_quests; /**< Quests completed */
@ -1209,7 +1208,7 @@ struct str_app_type
* wisdom attribute. */
struct wis_app_type
{
byte bonus; /**< how many practices player gains per lev */
byte bonus; /**< how many practices player gains per lev, unused now */
};
/** Describes the bonuses applied for a specific value of a character's

View file

@ -558,8 +558,6 @@ do \
#define GET_COND(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.conditions[(i)]))
/** The room to load player ch into. */
#define GET_LOADROOM(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.load_room))
/** Number of skill practice sessions remaining for ch. */
#define GET_PRACTICES(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.spells_to_learn))
/** Current invisibility level of ch. */
#define GET_INVIS_LEV(ch) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.invis_level))
/** Current wimpy level of ch. */