I got that chronosphere spell from http://www.hiveworkshop.com/forums/resource.php?t=103046&prev=search%3Ddota%26d%3Dlist%26r%3D20 and I'm trying to add conditions so some unit type don't have any effect from this spell.
JASS:
function Trig_Chronosphere_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A02K'
endfunction
function Chronosphere_Group takes nothing returns boolean
return ( GetFilterUnit() != GetTriggerUnit() )
endfunction
function Trig_Chronosphere_Actions takes nothing returns nothing
local integer i=GetUnitAbilityLevel(GetTriggerUnit(),'A02K')
local unit u
local unit v
local real r=1+(i*1)
local timer t=CreateTimer()
local location l=GetSpellTargetLoc()
local group g
set u = CreateUnit(GetOwningPlayer(GetTriggerUnit()),'u00A',GetLocationX(l),GetLocationY(l),bj_UNIT_FACING)
call TriggerSleepAction (0.3)
call UnitApplyTimedLife(u,'BTLF',r)
call SetUnitTimeScalePercent(u,0.00)
set g = GetUnitsInRangeOfLocMatching(425.00, l, Condition(function Chronosphere_Group))
call StartTimerBJ(t,false,r)
loop
exitwhen TimerGetRemaining(t)<=0.0
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call PauseUnit(v,true)
call SetUnitTimeScalePercent(v,0.00)
endloop
if (TimerGetRemaining(t)<0.8) then
call TriggerSleepAction(0.1)
else
call TriggerSleepAction(0.3)
endif
call DestroyGroup(g)
set g = GetUnitsInRangeOfLocMatching(425.00, l, Condition(function Chronosphere_Group))
endloop
loop
set v = FirstOfGroup(g)
exitwhen v == null
call GroupRemoveUnit(g,v)
call PauseUnit(v,false)
call SetUnitTimeScalePercent(v,100.00)
endloop
call DestroyTimer(t)
set u = null
call RemoveLocation(l)
set l = null
call DestroyGroup(g)
set g = null
endfunction
//===========================================================================
function InitTrig_Chronosphere takes nothing returns nothing
set gg_trg_Chronosphere = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Chronosphere, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Chronosphere, Condition( function Trig_Chronosphere_Conditions ) )
call TriggerAddAction( gg_trg_Chronosphere, function Trig_Chronosphere_Actions )
endfunction