Welcome to the Builder Academy

Question Dispel Magic

More
02 Sep 2016 20:32 #6155 by JTP
Dispel Magic was created by JTP
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
08 Sep 2016 18:56 #6159 by DirtyDevil
Replied by DirtyDevil on topic Dispel Magic
Not sure if this will work with stock TBA

Code:
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.167 seconds