Dispel Magic

  • JTP
  • Topic Author
  • Offline
  • Platinum Boarder
  • Platinum Boarder
2 years 3 weeks ago #6155 by JTP
Dispel Magic was created by JTP
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.

2 years 2 weeks ago #6159 by DirtyDevil
Replied by DirtyDevil on topic Dispel Magic
Not sure if this will work with stock TBA

  int ld;
  struct affected_type *af, *next;

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

  /* 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))
    /* 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: 1.242 seconds