I try to save my Jass spell but it doesn't work, why?
JASS:
//==========================================================================
function C takes nothing returns boolean
return GetSpellAbilityId() == 039;A000039;
endfunction
//==========================================================================
function CG takes nothing returns boolean
return if ( IsUnitAlly( caster, gowner) == TRUE)
endif
endfunction
//==========================================================================
function InDaGroup takesnothing returns nothing
if (function CG()) then
else
endif
endfunction
//==========================================================================
function A takes nothing returns nothing
local unit caster == GetTriggerUnit()
local location casterloc = GetUnitLoc( caster )
local unit genum
local unit cre
local player = gowner = GetOwningPlayer( caster )
call ForGroupBJ(GetUnitsInRangeOfLocAll( 500, catserloc, function InDaGroup )
endfunction
//===========================================================================
function InitTrig_Vigority takes nothing returns nothing
set gg_trg_Vigority = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Vigority, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_Vigority, function C )
endfunction