Here is my code:
function Trig_orderConditions takes nothing returns boolean
return ((GetSpellAbilityId() == 'A002'))
endfunction
function Trig_orderActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit t = CreateUnit(GetOwningPlayer(u), 'e000', x, y, 0)
local integer i = 1
local real x0
local real y0
call UnitApplyTimedLife(t, 'BHwe', 10)
call UnitAddAbility(t, 'A003')
call SetUnitAbilityLevel(t, 'A003', 1)
loop
exitwhen i > 36
set x0 = x + 100 * CosBJ(10.0 * I2R(i))
set y0 = y + 100 * SinBJ(10.0 * I2R(i))
call BJDebugMsg("x:" + R2S(x0) + ", y:" + R2S(y0))
call IssuePointOrder(t, "carrionswarm", x0, y0)
set i = i + 1
endloop
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_order takes nothing returns nothing
set gg_trg_order = CreateTrigger()
#ifdef DEBUG
call YDWESaveTriggerName(gg_trg_order, "order")
#endif
call TriggerRegisterAnyUnitEventBJ( gg_trg_order, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_order, Condition(function Trig_orderConditions))
call TriggerAddAction(gg_trg_order, function Trig_orderActions)
endfunction
What I expected to see is a circle but in game I only got one spelled to the right. I already change the Cool1 and Cost1 to 0.00.
function Trig_orderConditions takes nothing returns boolean
return ((GetSpellAbilityId() == 'A002'))
endfunction
function Trig_orderActions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real x = GetUnitX(u)
local real y = GetUnitY(u)
local unit t = CreateUnit(GetOwningPlayer(u), 'e000', x, y, 0)
local integer i = 1
local real x0
local real y0
call UnitApplyTimedLife(t, 'BHwe', 10)
call UnitAddAbility(t, 'A003')
call SetUnitAbilityLevel(t, 'A003', 1)
loop
exitwhen i > 36
set x0 = x + 100 * CosBJ(10.0 * I2R(i))
set y0 = y + 100 * SinBJ(10.0 * I2R(i))
call BJDebugMsg("x:" + R2S(x0) + ", y:" + R2S(y0))
call IssuePointOrder(t, "carrionswarm", x0, y0)
set i = i + 1
endloop
set u = null
set t = null
endfunction
//===========================================================================
function InitTrig_order takes nothing returns nothing
set gg_trg_order = CreateTrigger()
#ifdef DEBUG
call YDWESaveTriggerName(gg_trg_order, "order")
#endif
call TriggerRegisterAnyUnitEventBJ( gg_trg_order, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_order, Condition(function Trig_orderConditions))
call TriggerAddAction(gg_trg_order, function Trig_orderActions)
endfunction
What I expected to see is a circle but in game I only got one spelled to the right. I already change the Cool1 and Cost1 to 0.00.