I am learning Jass and I would appreciate it, if someone could make this work for me.
I want it to pause units in area giving them pause(stun) effect, then wait x seconds based on a global variable number, then simply unpause them and remove the effect. Must be MUI when done and have as few leaks as possible.
Heres what I got.
Currently It stuns them and adds the effect, but doesn't unstun or remove the effect.
I want it to pause units in area giving them pause(stun) effect, then wait x seconds based on a global variable number, then simply unpause them and remove the effect. Must be MUI when done and have as few leaks as possible.
Heres what I got.
JASS:
function Trig_ArcaneFlash_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A004' ) ) then
return false
endif
return true
endfunction
function Trig_ArcaneFlash_Func003A takes nothing returns nothing
local effect e=null
call PauseUnitBJ( true, GetEnumUnit() )
call AddSpecialEffectTargetUnitBJ( "overhead", GetEnumUnit(), "Abilities\\Spells\\Human\\Thunderclap\\ThunderclapTarget.mdl" )
set e=bj_lastCreatedEffect
call TriggerSleepAction( ( I2R(udg_Player1skills[1]) / 2.00 ) )
call PauseUnitBJ( false, GetEnumUnit() )
call DestroyEffectBJ( e )
endfunction
function Trig_ArcaneFlash_Actions takes nothing returns nothing
set udg_TempPoint[1] = GetUnitLoc(GetSpellAbilityUnit())
set bj_wantDestroyGroup = true
call ForGroupBJ( GetUnitsInRangeOfLocAll(300.00, GetUnitLoc(GetSpellAbilityUnit())), function Trig_ArcaneFlash_Func003A )
call RemoveLocation(udg_TempPoint[1])
endfunction
//===========================================================================
function InitTrig_ArcaneFlash takes nothing returns nothing
set gg_trg_ArcaneFlash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ArcaneFlash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_ArcaneFlash, Condition( function Trig_ArcaneFlash_Conditions ) )
call TriggerAddAction( gg_trg_ArcaneFlash, function Trig_ArcaneFlash_Actions )
endfunction
Currently It stuns them and adds the effect, but doesn't unstun or remove the effect.