Here's your trigger:
-
Cannot Teleport
-
Events
-
Unit - A unit Begins casting an ability
-
Conditions
-
(Ability being cast) Equal to Blink
-
Actions
-
Set TempLocA = (Target point of ability being cast)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(TempLocA is blighted) Equal to True
-
Then - Actions
-
Unit - Order (Triggering unit) to Stop
-
Else - Actions
-
Custom script: call RemoveLocation(udg_TempLocA)
But right now, let's break it down. The event of the trigger,
Unit - A unit Begins casting an ability, is what tells the trigger to turn on. It means that the trigger will take effect before the unit uses mana, activates a cooldown, and creates a projectile (the last one is only for spells that use projectiles, such as stormbolt). The condition contains the ability your using, I chose
Blink, because it is a teleport spell. The condition tells the trigger when and when not to run, it will only run if the condition is met. The line,
Set TempLocA = (Target point of ability being cast), set's a point variable,
TempLocA, to the target point of the ability being cast. The next part is an
if/then/else statement. It says that
if the condition is met,
then do this,
else do this. This is probably the most usefull tool in triggering. The condition
(TempLocA is blighted) Equal to True is just like the condition at the top of the trigger, exept it only dictates the
if/then/else. The line in the
then section,
Unit - Order (Triggering unit) to Stop, just tells the unit to stop. This will tell the unit to stop casting the abilty before the cooldown is activated or mana is used. Outside the
if/then/else statement is the
Custom script, wich allows you to acces jass commands inside GUI. If you didn't know, GUI is built upon Jass, it's purpose is to make triggering easier. This
Custom script tells the game to remove the memory leak of the location
TempLocA. Please refer to
Things That Leak for more information. I hope this post was helpfull and Welcome to the Hive