Hi everyone, i was interested of TF2's Spy that he can turn himself into an enemy treat as enemy's ally. So i decided to make a spell based on it, when im testing. Sometimes it cant create the target unit, and i dont know what's wrong here 
-
Disguise
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Ability being cast) Equal to (==) Disguise
-
-
Actions
-
Set Disguise_User = (Triggering unit)
-
Set Disguise_Loc = (Position of Disguise_User)
-
Unit - Create 1 (Unit-type of (Target unit of ability being cast)) for (Owner of (Target unit of ability being cast)) at Disguise_Loc facing (Facing of (Target unit of ability being cast)) degrees
-
Set Disguise_Dummy = (Last created unit)
-
Unit - Add a 120.00 second Generic expiration timer to Disguise_Dummy
-
Unit - Add Locust to Disguise_Dummy
-
Unit - Remove 'Aatk' (Attack) from Disguise_Dummy
-
-------- INVISIBLE --------
-
Unit - Create 1 Craggy Exterior Dummy for (Owner of Disguise_User) at Disguise_Loc facing Default building facing (270.0) degrees
-
Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
-
Unit - Add Disguise [Invi] to (Last created unit)
-
Unit - Order (Last created unit) to Human Sorceress - Invisibility Disguise_User
-
Trigger - Turn on Disguise Timer <gen>
-
Trigger - Turn on Disguise Moves <gen>
-
Trigger - Turn on Disguise Attacks <gen>
-
Custom script: call RemoveLocation (udg_Disguise_Loc)
-
-
-
Disguise Timer
-
Events
-
Time - Every 0.20 seconds of game time
-
-
Conditions
-
Actions
-
Set Disguise_Loc = (Position of Disguise_User)
-
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
((Disguise_Dummy is dead) Equal to (==) True) or ((Disguise_User has buff Disguise ) Not equal to (!=) True)
-
-
Then - Actions
-
Unit - Remove Disguise_Dummy from the game
-
Unit - Remove Disguise buff from Disguise_User
-
Trigger - Turn off (This trigger)
-
Trigger - Turn off Disguise Attacks <gen>
-
Trigger - Turn off Disguise Moves <gen>
-
-
Else - Actions
-
-
-
Custom script: call RemoveLocation (udg_Disguise_Loc)
-
-
-
Disguise Moves
-
Events
-
Unit - A unit Is issued an order targeting a point
-
-
Conditions
-
(Triggering unit) Equal to (==) Disguise_User
-
-
Actions
-
Set AALoc1 = (Target point of issued order)
-
Unit - Order Disguise_Dummy to Move To AALoc1
-
Custom script: call RemoveLocation (udg_AALoc1)
-
-
-
Disguise Attacks
-
Events
-
Unit - A unit Is issued an order targeting an object
-
-
Conditions
-
(Triggering unit) Equal to (==) Disguise_User
-
-
Actions
-
Unit - Order Disguise_Dummy to Right-Click (Target unit of issued order)
-
-
Last edited: