I'm currently trying to make a spell in which I'm using a timer to perform a periodic event. So, I need a system that will allow me to use handles... I've been doing some research and there is a lot of stuff out there I don't understand so I was hoping someone here could introduce me to a simple yet effective system.
To give you an idea of what im trying to do...
To give you an idea of what im trying to do...
JASS:
function Cast_Sleep_T takes nothing returns nothing
local timer HauntSleepTimer = GetExpiredTimer()
local unit Caster = GetHandleUnit(HauntSleepTimer, "HauntCaster")
local unit Target = GetHandleUnit(HauntSleepTimer, "HauntTarget")
//actions
if(//end condition)then
call PauseTimer(HauntSleepTimer)
call SetHandleHandle(HauntSleepTimer, "Caster", null)
call SetHandleHandle(HauntSleepTimer, "Target", null)
set Caster = null
set Target = null
set AL = 0
endif
endfunction
function Trig_HauntJASS_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local unit Target = GetSpellTargetUnit()
local timer HauntSleepTimer = CreateTimer()
call SetHandle(HauntSleepTarget, "HauntCaster", Caster)
call SetHandle(HauntSleepTarget, "HauntTarget", Target)
call TimerStart(HauntSleepTimer, 0.1, true, function Cast_Sleep_T)
set Target = null
set Caster = null
endfunction