Code
function Trig_Ner2_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00P'
endfunction
function Trig_Ner2_Actions takes nothing returns nothing
unit u=GetTriggerUnit()
unit d=CreateUnit(GetOwningPlayer(u),'h001',GetWidgetX(u),GetWidgetY(u),0.00)
UnitAddAbility(d,'A00Q')
SetUnitAbilityLevel(u,'A00Q',GetUnitAbilityLevel(u,'A00P'))
real x=GetUnitX(u)
real y=GetUnitY(u)
group g=CreateGroup()
unit e
GroupEnumUnitsInRange(g,x,y,300,null)
loop
e=FirstOfGroup(g)
exitwhen e==null
if IsUnitEnemy(e,GetOwningPlayer(u)) and GetWidgetLife(e)>.0 then
IssueTargetOrderById(d,852171,e)
endif
GroupRemoveUnit(g,e)
endloop
DestroyGroup(g)
e=null
u=null
g=null
endfunction
//===========================================================================
function InitTrig_Ner2 takes nothing returns nothing
set gg_trg_Ner2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ner2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Ner2, Condition( function Trig_Ner2_Conditions ) )
call TriggerAddAction( gg_trg_Ner2, function Trig_Ner2_Actions )
endfunction
Подскажите