Cokemonkey11
Spell Reviewer
- Joined
- May 9, 2006
- Messages
- 3,575
Hey guys,
I'm trying to instantly retrieve the pointer for the illusion last created.
I've tried a trigger, dynamic triggering, and grouping, but it seems that there is a tiny casting delay that is ruining everything for me.
here's what I currently have (after trigger and dynamic triggers failed):
Thanks in advance
I'm trying to instantly retrieve the pointer for the illusion last created.
I've tried a trigger, dynamic triggering, and grouping, but it seems that there is a tiny casting delay that is ruining everything for me.
here's what I currently have (after trigger and dynamic triggers failed):
JASS:
private function illusionF takes nothing returns boolean
local unit filter=GetFilterUnit()
if IsUnitIllusion(filter) then
set lastCreatedIllusion=filter
endif
set filter=null
return false
endfunction
public function addIllusion takes unit source, real duration returns unit
local unit dummy=addDummy(GetUnitX(source),GetUnitY(source),GetPlayerId(GetOwningPlayer(source)))
call UnitAddAbility(dummy,ILLUSIONID)
call IssueTargetOrderById(dummy,ILLUSIONORDER,source)
call UnitAddAbility(dummy,'Aloc')
call GroupEnumUnitsInRange(grp,GetUnitX(source),GetUnitY(source),500.,Filter(function illusionF))
call UnitApplyTimedLife(lastCreatedIllusion,'BTLF',duration)
set dummy=null
return lastCreatedIllusion
endfunction
Thanks in advance