I got some bug.
- When unit begins casting an ability , create 2 dummy unit . One use item cast magic spell on target unit , one cast magic to casting unit. But some time , target take damage or effect before dummy unit cast spell shield . Help me plz
- When unit begins casting an ability , create 2 dummy unit . One use item cast magic spell on target unit , one cast magic to casting unit. But some time , target take damage or effect before dummy unit cast spell shield . Help me plz
Code:
Reflect
Events
Unit - A unit Begins casting an ability
Conditions
(Random integer number between 1 and 100) Less than or equal to 99
(Unit-type of (Casting unit)) Not equal to Block Dummy
Actions
Set MirrorCaster = (Casting unit)
Set TargetMirror = (Target unit of ability being cast)
Set TargetMirrorLoc = (Position of (Target unit of ability being cast))
Unit - Create 1 Block Dummy for (Owner of TargetMirror) at (Position of TargetMirror) facing Default building facing degrees
Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Entangling Roots
Then - Actions
Unit - Add Entangling Roots to (Last created unit)
Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Casting unit)
Unit - Set level of Entangling Roots for (Last created unit) to (Level of Entangling Roots for (Casting unit))
Trigger - Run Counter Spell <gen> (ignoring conditions)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Frost Nova1
Then - Actions
Unit - Add Frost Nova1 to (Last created unit)
Unit - Set level of Frost Nova1 for (Last created unit) to (Level of Frost Nova1 for (Casting unit))
Unit - Order (Last created unit) to Undead Lich - Frost Nova (Casting unit)
Trigger - Run Counter Spell <gen> (ignoring conditions)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to Storm Bolt
Then - Actions
Unit - Add Storm Bolt to (Last created unit)
Unit - Set level of Storm Bolt for (Last created unit) to (Level of Storm Bolt for (Casting unit))
Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Casting unit)
Trigger - Run Counter Spell <gen> (ignoring conditions)
Else - Actions
Set MirrorCaster = No unit
Set TargetMirror = No unit
Code:
Counter Spell
Events
Conditions
Actions
Unit - Create 1 Block Spell Dummy for (Owner of TargetMirror) at (Position of TargetMirror) facing Default building facing degrees
Hero - Create BlockMagic and give it to (Last created unit)
Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type BlockMagic) on (Position of TargetMirror)
Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
Custom script: call RemoveLocation (udg_TargetMirrorLoc)