I used channel and trigger to summon a unit, and I also want the summoned unit to summon hellfire ability, but it doesn't work. I used trigger as below:
JASS:
function Trig_SummonUnit_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A007' ) ) then
return false
endif
return true
endfunction
function Trig_SummonUnit_Actions takes nothing returns nothing
call CreateNUnitsAtLoc( 1, 'h002', Player(0), GetSpellTargetLoc(), bj_UNIT_FACING )
call UnitAddAbilityBJ( 'A002', GetLastCreatedUnit() )
call PolledWait( 3.00 )
call IssuePointOrderLocBJ( GetLastCreatedUnit(), "inferno", GetRectCenter(GetPlayableMapRect()) )
endfunction
//===========================================================================
function InitTrig_SummonUnit takes nothing returns nothing
set gg_trg_SummonUnit = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_SummonUnit, gg_unit_H003_0010, EVENT_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_SummonUnit, Condition( function Trig_SummonUnit_Conditions ) )
call TriggerAddAction( gg_trg_SummonUnit, function Trig_SummonUnit_Actions )
endfunction