- Joined
- Sep 29, 2006
- Messages
- 447
I'm trying to make a spell that will target an area, and make all units in the area invulnerable and unable to move/attack/anything for 4,5,6,7 seconds. As of now the units become invulnerable and unable to do anything, but the effects are permanent and the special effect that's created is never destroyed and I don't know why. Can anyone help?
Here's the Trigger:
Here's the Trigger:
JASS:
function Trig_Stasis_Field_New_Copy_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A018'
endfunction
function Trig_Stasis_Field_New_Copy_Func003Func005Func001Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A018', GetTriggerUnit()) == 4 ) ) then
return false
endif
return true
endfunction
function Trig_Stasis_Field_New_Copy_Func003Func005Func001Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A018', GetTriggerUnit()) == 3 ) ) then
return false
endif
return true
endfunction
function Trig_Stasis_Field_New_Copy_Func003Func005Func001C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A018', GetTriggerUnit()) == 2 ) ) then
return false
endif
return true
endfunction
function Trig_Stasis_Field_New_Copy_Func003Func005C takes nothing returns boolean
if ( not ( GetUnitAbilityLevelSwapped('A018', GetTriggerUnit()) == 1 ) ) then
return false
endif
return true
endfunction
function CheckLevel takes nothing returns nothing
local unit TempUnit = GetEnumUnit()
local effect spfx
call SetUnitInvulnerable( TempUnit, true )
call PauseUnit( TempUnit, true )
set spfx = AddSpecialEffectTargetUnitBJ( "origin", TempUnit, "Abilities\\Spells\\Human\\ManaShield\\ManaShieldCaster.mdl" )
if ( Trig_Stasis_Field_New_Copy_Func003Func005C() ) then
call TriggerSleepAction( 4.00 )
else
if ( Trig_Stasis_Field_New_Copy_Func003Func005Func001C() ) then
call TriggerSleepAction( 5.00 )
else
if ( Trig_Stasis_Field_New_Copy_Func003Func005Func001Func001C() ) then
call TriggerSleepAction( 6.00 )
else
if ( Trig_Stasis_Field_New_Copy_Func003Func005Func001Func001Func001C() ) then
call TriggerSleepAction( 7.00 )
else
endif
endif
endif
endif
call SetUnitInvulnerable( TempUnit, false )
call PauseUnit( TempUnit, false )
call DestroyEffect( spfx )
set spfx = null
set TempUnit = null
endfunction
function Trig_Stasis_Field_New_Copy_Actions takes nothing returns nothing
local location TempPoint = GetSpellTargetLoc()
local group TempGroup = GetUnitsInRangeOfLocAll(300.00, TempPoint)
call ForGroup( TempGroup, function CheckLevel )
call RemoveLocation(TempPoint)
call DestroyGroup(TempGroup)
endfunction
//===========================================================================
function InitTrig_Stasis_Field_New_Copy takes nothing returns nothing
set gg_trg_Stasis_Field_New_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Stasis_Field_New_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stasis_Field_New_Copy, Condition( function Trig_Stasis_Field_New_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Stasis_Field_New_Copy, function Trig_Stasis_Field_New_Copy_Actions )
endfunction