- Joined
- Jun 7, 2008
- Messages
- 440
This is my trigger. It seems that it works fine. But the problem is, the dummy units do not cast the ability i want them to. I tried manually giving the ability to the dummy, but that did not work - frustrating. I am out of ideas, literally 
JASS:
function Trig_Stun_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A01C'
endfunction
function Trig_Stun_Actions takes nothing returns nothing
local unit cast = GetTriggerUnit()
local location t = GetSpellTargetLoc()
local group g = CreateGroup()
local unit u
local unit dumb
call GroupEnumUnitsInRangeOfLoc(g, t, 512.00, null)
loop
exitwhen u==null
if IsUnitEnemy(u, GetOwningPlayer(cast)) then
set dumb = CreateUnit(GetOwningPlayer(cast), 'h01X', GetUnitX(cast), GetUnitY(cast), 0.00)
call UnitAddAbility(dumb, 'A00F')
call IssueTargetOrder(dumb, "firebolt", u)
call UnitApplyTimedLife(dumb, 'BTLF', 3)
call GroupRemoveUnit(g,u)
endif
call GroupRemoveUnit(g,u)
endloop
call RemoveLocation(t)
call DestroyGroup(g)
set g = null
set dumb = null
set cast = null
set t = null
endfunction
//===========================================================================
function InitTrig_Stun takes nothing returns nothing
set gg_trg_Stun = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Stun, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Stun, Condition( function Trig_Stun_Conditions ) )
call TriggerAddAction( gg_trg_Stun, function Trig_Stun_Actions )
endfunction