well, it is not the prettiest, but it works well for what I needed
/*
in handler.c add this function
this does not automatically check materials
you must manually add vulnerabilities flags, and materials.
*/
bool is_vuln_material(CHAR_DATA * ch, OBJ_DATA * obj)
{
if (obj != NULL)
{
if (!strcmp(obj->material, "iron") && IS_SET(ch->vuln_flags,
VULN_IRON))
return TRUE;
else if (!strcmp(obj->material, "silver") && IS_SET(ch->vuln_flags,
VULN_SILVER))
return TRUE;
else if (!strcmp(obj->material, "wood") && IS_SET(ch->vuln_flags,
VULN_WOOD))
return TRUE;
}
return FALSE;
}
/*
add this to merc.h preferably under the line
int check_immune args((CHAR_DATA * ch, int dam_type));
*/
bool is_vuln_material args((CHAR_DATA * ch, OBJ_DATA * obj));
/*
in fight.c put in a multiplier for weapons that damage the char put it under
the block
switch (check_immune(victim, dam_type))
{
case (IS_IMMUNE):
immune = TRUE;
dam = 0;
break;
case (IS_RESISTANT):
dam -= dam / 3;
break;
case (IS_VULNERABLE):
dam += dam / 2;
break;
}
*/
if (is_vuln_material(victim, wield))
dam += dam / 2;
/*
in act_obj.c
in do_wear and in do_hold functions
*/
if (is_vuln_material(ch, obj))
{
send_to_char("Just thinking about touching this makes you itch.\n\r", ch);
return;
}