purify.txt
snippets · 2.3 KB · 2010-03-30
Purify: purify poisoned and diseased food/drink containers (something for healers to do).
Download « Back to the snippets list
/* Purify poisoned and diseased food and drink containers. Give those healer */
/* types something else useful to do. */
/* Use it if you wish and modify it if you wish, but please let me know if */
/* you use it and how well it works for you. You need not give me credit, */
/* but as always do not credit yourself for work you do not do. Thanks, Creo */
PLACE IN: act_obj.c
/* Creodin for Acasaid 2001 */
void do_purify (CHAR_DATA * ch, char *argument)
{
OBJ_DATA *obj;
int skill;
/* find out what */
if (argument[0] == '\0')
{
send_to_char ("Purify what food or drink?\n\r", ch);
return;
}
obj = get_obj_list (ch, argument, ch->carrying);
if (obj == NULL)
{
send_to_char ("You don't have that item.\n\r", ch);
return;
}
if ((skill = get_skill (ch, gsn_purify)) < 1)
{
send_to_char("Thats an issue you may wish to take up with your patron.\n\r", ch);
return;
}
if (obj->item_type == ITEM_FOOD || obj->item_type == ITEM_DRINK_CON)
{
if (number_percent () < skill)
{
act ("$n calls upon $s deity to purify $p.", ch, obj, NULL, TO_ROOM);
act ("You call upon your deity to purify $p.", ch, obj, NULL, TO_CHAR);
obj->value[3] = 0;
check_improve (ch, gsn_purify, TRUE, 4);
WAIT_STATE (ch, skill_table[gsn_purify].beats);
ch->mana -= 10;
return;
} else {
act ("You fail to purify $p.", ch, obj, NULL, TO_CHAR);
check_improve (ch, gsn_purify, FALSE, 3);
WAIT_STATE (ch, skill_table[gsn_purify].beats);
ch->mana -= 10;
return;
}
}
}
PLACE IN: const.c
{
"purify", {53, 53},
{1, 1},
spell_null, TAR_IGNORE, POS_RESTING,
&gsn_purify, SLOT (0), 0, 36,
"", "!Purify!", "", CT_SKILL
},
PLACE IN: db.c
sh_int gsn_purify;
PLACE IN: interp.c
{"purify", do_purify, POS_RESTING, 0, LOG_NORMAL, 0, 0},
PLACE IN: interp.h
DECLARE_DO_EXFUN( do_purify );
PLACE IN: merc.h
extern sh_int gsn_purify;
/* Remember to increase MAX_SKILL, compile and it should work fine - Creodin */