HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is it posible to stop a spell before its effect takes place?

09-24-2006, 06:50 PM#1
grupoapunte
Hi, is it posible to stop a spell before its effect takes place? is there any kind of restriction to do this, i have to stop a teleporting spell in case the target is in a forbiden zone, but i also have other spells i would like to block.

About the teleporting im actualy detecting the spell and if the target is in a specific place then move it somewhere else (after spell ended ofcourse, but its so fast that players dont notice the diference) but i havae a custom group teleport spell and everytime i have to import it to another map i have to modify its code acording to the restrictions, so i would like to have a separate trigger detecting this spells and stoping them before the EVENT_PLAYER_UNIT_SPELL_EFFECT takes place and the spell trigger fires.

Thanks
09-24-2006, 06:55 PM#2
Rising_Dusk
Yes there is.

Use the EVENT_PLAYER_UNIT_SPELL_CAST (Or the specific unit variant) and then do the following.

Collapse JASS:
call PauseUnit(Caster, true)
call IssueImmediateOrder(Caster, "stop")
call PauseUnit(Caster, false)
09-24-2006, 08:22 PM#3
grupoapunte
Thanks man it worked fine, i used EVENT_PLAYER_UNIT_SPELL_CHANNEL which i think it comes before enything, it also stops item spells the only problem is that when i stop the teleport the special effects (lighting in the ground) are still shown in the map, when the spell is in an item the lighting apears in a ramdom position instead of doing it where the hero is (like when a hero spell is casted) is it posible to block this too?
09-24-2006, 09:34 PM#4
TaintedReality
I haven't found a way to block that. However, you can simply leave the special effect fields blank and just create it manually inside your trigger.