HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Auras without cheking every x seconds?

12-04-2006, 10:09 PM#1
GALLED
Hello. I would to know if exists some manner to make an aura ability without use triggers or jass thath check the conditions every x seconds.

thanks in advance
12-04-2006, 10:54 PM#2
Jazradel
I suppose you could check when a unit comes within range of the unit with the aura.
12-05-2006, 06:17 AM#3
Captain Griffen
If none of the aura abilities fit the bill, then no.
12-07-2006, 02:22 PM#4
GALLED
And how about of this:
Collapse JASS:
function aura_cond takes nothing returns boolean
return( GetUnitAbilityLevel(GetTriggerUnit(),ability_aura()) > 0 )
endfunction

function aura_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
if(GetUnitAbilityLevel(u,abilty_buff())<=0)then
set u = null
return
endif
//Actions that will be occur to the target unit afected by the aura
set u = null
endfunction

function aura_main takes nothing returns nothing
local unit u = GetTriggerUnit()
local trigger t = CreateTrigger()
local event e
local triggeraction ac
set e = TriggerRegisterUnitInRange(t,u,aura_range(),null)
set ac=TriggerAddAction(t, function aura_Actions)
loop
    exitwhen (GetUnitAbilityLevel(u,abilty_aura())<=0) or (GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)=<0.405)
    call TriggerSleepAction(0.25)
endloop
call DestroyTrigger(t)
set t = null
set e = null
set ac = null
set u = null
endfunction

//===========================================================================
function InitTrig_aura takes nothing returns nothing
    set gg_trg_aura = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_aura, GetPlayableMapRect() )
    call TriggerAddCondition( gg_trg_aura, Condition( function aura_cond ) )
    call TriggerAddAction( gg_trg_aura, function aura_main )
endfunction
12-07-2006, 03:28 PM#5
Captain Griffen
That will only effect units entering. Only occur once.
12-07-2006, 10:03 PM#6
PandaMine
Just use the unit comes within range and unit goes out of range events respectivly
12-08-2006, 06:15 AM#7
Captain Griffen
There is no unit goes out of range event.
12-08-2006, 07:06 AM#8
DioD
create rect and move it around hero
12-08-2006, 07:21 AM#9
PandaMine
Quote:
Originally Posted by PandaMine
Just use the unit comes within range and unit goes out of range events respectivly

Woops I forgot about that, you would have to introduce a check then (which defies the purpouse of this question)

Quote:
Originally Posted by DioD
create rect and move it around hero

That can create a huge amount of lag especially when you call a function more often then once very second
12-08-2006, 12:18 PM#10
BertTheJasser
Quote:
create rect and move it around hero
-> you need periodically stuff
-> Answer is NO