Although chaning the v4 flags to something like weap_flags isn't practical,
there is, however, a
very easy way to setting weapon flags on weapons. Rather than using set, you
could use, say, flag,
or yet another command to easily set and remove weaponflags. The key item to
use here is a function
named "flag_lookup".
Example:
void do_weaptoggle( CHAR_DATA *ch, char *argument )
...
int wflag = NO_FLAG;
char buf[MSL];
<Find the object with argument and the flag you're trying to toggle with the
remnants of argument>.
obj = item to flag.
WeaponflagArgument = a string, such as "shocking".
if (obj->item_type != ITEM_WEAPON)
{
send_to_char("Item must be a weapon.\n\r", ch);
return;
}
wflag = flag_lookup(WeaponflagArgument, weapon_type2);
if (wflag == NO_FLAG)
{
send_to_char("Unable to find that weapon flag. 'Help weaponflag'
for a list.\n\r", ch);
return;
}
TOGGLE_BIT(obj->value[4], wflag);
sprintf(buf, "Weapon flag '%s' toggled on object '%s'.\n\r",
WeaponflagArgument,
obj->short_descr);
send_to_char(buf, ch);
return;
}
Easy enough.
----- Original Message -----
From: "Oestreich, Charles ICFN" <[EMAIL PROTECTED]>
To: "Rom (E-mail)" <[email protected]>
Sent: Monday, January 20, 2003 9:16 AM
Subject: weapon flags
> i wanna change weapon flags from a v to something much like the wear_flags
> so it will be easier to set. anyone know where i should start, or if it is
> even worth doing? thanks very much.
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom