Add oset command

This commit is contained in:
kinther 2026-01-01 09:05:00 -08:00
parent aac7cee6dc
commit fa1a64a47a
4 changed files with 1135 additions and 57 deletions

View file

@ -13447,4 +13447,89 @@ Amos sees:
Gesturing to your empty mug, the bald, pudgy man waves you over with his right
hand, pointing to an empty seat at his table.
#0
OVALS
Ovals are object value slots (0-7). Use OSET ADD OVAL <position|name> <value>
to set them. Positions are 0-based.
LIGHT:
2 - hours_left
SCROLL:
0 - spell_level
1 - spell1
2 - spell2
3 - spell3
POTION:
0 - spell_level
1 - spell1
2 - spell2
3 - spell3
WAND:
0 - level
1 - max_charges
2 - remaining_charges
3 - spell
STAFF:
0 - level
1 - max_charges
2 - remaining_charges
3 - spell
WEAPON:
0 - dice_num
1 - dice_size
2 - weapon_type
3 - message_type
ARMOR:
0 - piece_ac
1 - bulk
2 - magic_bonus
3 - stealth_disadv
4 - durability
5 - str_requirement
CONTAINER:
0 - capacity
1 - flags
2 - key_vnum
3 - corpse
WORN:
0 - closable
1 - hooded
2 - is_closed
3 - capacity
4 - hood_raised
LIQ CONTAINER:
0 - capacity
1 - contains
2 - liquid_type
3 - poisoned
FOUNTAIN:
0 - capacity
1 - contains
2 - liquid_type
3 - poisoned
FOOD:
0 - bites_capacity
1 - bites_left
2 - hours_full_per_bite
3 - poisoned
COINS:
0 - coins
FURNITURE:
0 - max_seats
1 - current_occupants
2 - allowed_pos
#0
$~

View file

@ -6350,53 +6350,6 @@ ACMD(do_recent)
}
ACMD(do_oset)
{
char arg[MAX_INPUT_LENGTH];
char arg2[MAX_INPUT_LENGTH];
const char usage[] = "Usage: \r\n"
"Options: alias, apply, longdesc, shortdesc\r\n"
"> oset <object> <option> <value>\r\n";
struct obj_data *obj;
bool success = TRUE;
if (IS_NPC(ch) || ch->desc == NULL) {
send_to_char(ch, "oset is only usable by connected players.\r\n");
return;
}
argument = one_argument(argument, arg);
if (!*arg)
send_to_char(ch, usage);
else if (!(obj = get_obj_in_list_vis(ch, arg, NULL, ch->carrying)) &&
!(obj = get_obj_in_list_vis(ch, arg, NULL, world[IN_ROOM(ch)].contents)))
send_to_char(ch, "You don't seem to have %s %s.\r\n", AN(arg), arg);
else {
argument = one_argument(argument, arg2);
if (!*arg2)
send_to_char(ch, usage);
else {
if (is_abbrev(arg2, "alias") && (success = oset_alias(obj, argument)))
send_to_char(ch, "Object alias set.\r\n");
else if (is_abbrev(arg2, "longdesc") && (success = oset_long_description(obj, argument)))
send_to_char(ch, "Object long description set.\r\n");
else if (is_abbrev(arg2, "shortdesc") && (success = oset_short_description(obj, argument)))
send_to_char(ch, "Object short description set.\r\n");
else if (is_abbrev(arg2, "apply") && (success = oset_apply(obj, argument)))
send_to_char(ch, "Object apply set.\r\n");
else {
if (!success)
send_to_char(ch, "%s was unsuccessful.\r\n", arg2);
else
send_to_char(ch, usage);
return;
}
}
}
}
/* 5e system helpers */
/* Helper: map wear flags to our armor_slots[] index (-1 if not an armor slot) */

1059
src/set.c

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@
ACMD(do_rset);
ACMD(do_rcreate);
ACMD(do_ocreate);
ACMD(do_oset);
ACMD(do_osave);
#endif