Вот код способности по идеи вокруг указанного героя создаются dummy и использует спелл цепь молний. Почему неработает?((
Code
function Trig_Chain_lightning_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00B'
endfunction
function Trig_Chain_lightning_Actions takes nothing returns nothing
local unit CLc = GetSpellAbilityUnit()
local unit CLt = GetSpellTargetUnit()
local player CLp = GetOwningPlayer(CLc)
local unit CLd
local real CLx
local real CLy
local integer CLi
set CLi = 0
loop
set CLx = GetUnitX(CLt)+ 450*Cos(22.5*CLi*bj_DEGTORAD)
set CLy = GetUnitY(CLt)+ 450*Sin(22.5*CLi*bj_DEGTORAD)
set CLd = CreateUnit(CLp,1,CLx,CLy,1)
call UnitAddAbility(CLd,'AOcl')
call UnitApplyTimedLife(CLd,'BTLF',2.0)
call IssueTargetOrder( CLd, "chainlightning", CLt )
set CLi = CLi +1
exitwhen CLi == 16
endloop
set CLc = null
set CLt = null
endfunction
//===========================================================================
function InitTrig_Chain_lightning takes nothing returns nothing
local trigger CL = CreateTrigger( )
local integer CLii
set CLii = 0
loop
call TriggerRegisterPlayerUnitEvent(CL,Player(CLii),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set CLii = CLii + 1
exitwhen CLii == 12
endloop
call TriggerAddCondition( CL, Condition( function Trig_Chain_lightning_Conditions ) )
call TriggerAddAction( CL, function Trig_Chain_lightning_Actions )
endfunction