One who can give me an example how SAVING_SPELL …..something could help the victim resist the spell ?
And maybe how to put in a message for the victim to let them know they resisted ?
I have a damage spell that puts a debuff on the target.
In mag_assisgn_spells() in spell_parser.c
Code:
spello(SPELL_DISRUPT, "disruption", 500, 100, 50, POS_FIGHTING,
TAR_CHAR_ROOM | TAR_FIGHT_VICT, TRUE, MAG_DAMAGE | MAG_AFFECTS,
NULL);
In mag_damage() in magic.c
Code:
switch (spellnum)
{
case SPELL_DISRUPT:
to_char = "Tendrils of arcane disruption eminate from you!";
to_room = "You are horrified as tendrils of arcane disruption float toward you.";
base = 1000;
for (aff = victim->affected; aff; aff = aff->next)
{
if (aff->spell == spell_type(victim, SPELL_DISRUPT))
if (aff->modifier > 0)
mult += aff->modifier;
}
break;
<other spells here>
}
In mag_affects() in
Code:
case SPELL_DISRUPT:
if (mag_savingthrow(victim, ch, SAVING_SPELL, spellnum, 0))
{
send_to_char(ch, "Your attempt at %s fails.\r\n", spell_info[spellnum].name);
return;
}
else if (rand_number(1, 10)==1)
{
af[0].duration = 1;
af[0].modifier = 1;
SET_BIT_AR(af[0].bitvector, AFF_DISRUPT);
accum_affect = TRUE;
to_vict = "Your soul is disrupted!";
send_to_char(ch, "%sYou disrupt %s's soul!%s\r\n", BBLU, GET_SHORT(victim), KNRM);
break;
}
else
return;
The disrupt spell is categorized as both a damage spell and an aff spell. The call_magic() function in spell_parser.c allows multiple spell routines to be processed with the same input spellnum.
Hope this helps