Code:
Double Shot
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Double Shot
Actions
Set ACast = (Triggering unit)
Set ACastPos = (Position of ACast)
Set ATarget = (Target unit of ability being cast)
Unit - Create 1 Double Shot Dummy for (Owner of ACast) at ACastPos facing Default building facing degrees
Set ADummy = (Last created unit)
Unit - Hide ADummy
Hero - Create Illusion and give it to ADummy
Hero - Order ADummy to use (Last created item) on ACast
Wait 0.00 seconds
Set AGroup = (Units owned by (Owner of ACast) matching (((Matching unit) is an illusion) Equal to True))
Unit Group - Pick every unit in AGroup and do (Actions)
Loop - Actions
Unit - Hide (Picked unit)
Unit - Order (Picked unit) to Attack ATarget
Unit - Order ACast to Attack ATarget
Wait 1.00 seconds
Unit Group - Pick every unit in AGroup and do (Unit - Remove (Picked unit) from the game)
Unit - Remove (Last created unit) from the game
Custom script: call RemoveLocation(udg_ACastPos)
Custom script: call DestroyGroup(udg_AGroup)
Basically I am creating an illusion to shoot so it seems like the hero is doing a double shot. But sometimes the illusion refuses to disappear after shooting. Sometimes it works. How do i solve this problem?