Dispel Magic

  • JTP
  • JTP's Avatar Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
More
1 year 8 months ago #6155 by JTP
JTP created the topic: Dispel Magic
Hi
Anyone have a dispel magic code they could share ?

Maybe one that dispels everything when cast on a player, and if cast on a mob remove 1 random spell per cast.

I made triggers that casts spells on mobs so it can be dispelled.

But any dispel magic would be helpfull. Thanks in advance.

Please Log in or Create an account to join the conversation.

More
1 year 8 months ago #6159 by DirtyDevil
DirtyDevil replied the topic: Dispel Magic
Not sure if this will work with stock TBA

ASPELL(spell_dispel_magic)
{
  int ld;
  struct affected_type *af, *next;

  if (ch == NULL || victim == NULL)
    return;

  /* Now I fixed up the levels system in affects we can do this properly */
  for(af = victim->affected;af;af = next) {
    next = af->next;
    /* Non-spell affects cannot be dispelled, and no fail msg */
    if ((af->type == SPELL_POISON) || (af->type > MAX_SPELLS))
      continue;
    /* level difference modifies casting chance */
    ld = af->level - GET_LEVEL(ch) + 20;
    if (ld < number(0,40)) {
      if (*spell_wear_off_msg[af->type]) {
	send_to_char(spell_wear_off_msg[af->type], victim);
	send_to_char("\r\n", victim);
      }
      affect_remove(victim, af);
    } else {
      send_to_char("Part of the dispel fails!\r\n", ch);
    }
  }
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.932 seconds