local unit u = GetTriggerUnit() local unit f = CreateUnit(GetOwningPlayer(u), 'uef1', GetUnitX(u), GetUnitY(u), 0) local group g call IssuePointOrderLoc(f, "move", PolarProjectionBJ(GetUnitLoc(u), 700.00, GetUnitFacing(u))) call UnitAddAbility(f, 'A057') set g = GetUnitsInRangeOfLocAll(150, GetUnitLoc(f)) call IssueTargetOrderById(f,OrderId("frostnova"),GetEnumUnit()) call PolledWait(1) call RemoveUnit(f) set f = null
вот пример работы с группами и каста дамми сразу по нескольким юнитам:
Code
function Trig_poison_Actions takes nothing returns nothing local unit u=GetSpellAbilityUnit() local integer lvl=GetUnitAbilityLevel(u,'A00H') local group gr=CreateGroup() local unit g local unit d
call GroupEnumUnitsInRange(gr,GetUnitX(u),GetUnitY(u),300.,null) loop set g=FirstOfGroup(gr) exitwhen g==null if IsUnitType(g, UNIT_TYPE_STRUCTURE) == false and GetWidgetLife(g) > 0.405 and IsUnitEnemy(g, GetOwningPlayer(u)) == true then set d=CreateUnit(GetOwningPlayer(u),'h00I',GetUnitX(g),GetUnitY(g),0) call UnitAddAbility(d,'A00G') call SetUnitAbilityLevel(d,'A00G',lvl) call IssueTargetOrder(d, "shadowstrike",g) call UnitApplyTimedLife(d, 'BTLF', 1) endif call GroupRemoveUnit(gr,g) endloop call DestroyGroup(gr) set gr=null set u=null set g=null set d=null endfunction
Сообщение отредактировал Banzay89 - Суббота, 08 Января 2011, 17:18:27