|
function Enemy_Alive_All_Ability takes integer Ability_Hero,integer Ability_unit,unit SpellUnit,unit EnumUnit returns nothing
local location UnitLoc = GetUnitLoc(SpellUnit)
local location EnumLoc = GetUnitLoc(EnumUnit)
local unit FalseSpell = CreateUnitAtLoc(GetOwningPlayer(SpellUnit), 'ewsp', UnitLoc, AngleBetweenPoints(UnitLoc, EnumLoc))
call UnitAddAbility( FalseSpell, Ability_unit )
call SetUnitAbilityLevel( FalseSpell, Ability_unit, GetUnitAbilityLevel(SpellUnit, Ability_Hero) )
call IssueTargetOrderById( FalseSpell, 852095, EnumUnit )
call ShowUnitHide( FalseSpell )
call RemoveLocation( UnitLoc )
call RemoveLocation( EnumLoc )
endfunction
function Enemy_Alive_Ability_Choose takes nothing returns boolean
if GetBooleanAnd(IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetSpellAbilityUnit())),IsUnitAliveBJ(GetFilterUnit())) == true then
return TRUE
else
return FALSE
endif
endfunction
function Enemy_Alive_Ability_Actions takes nothing returns nothing
if GetSpellAbilityId() == 'AUfn' then
call Enemy_Alive_All_Ability('AUfn','ACfn',GetSpellAbilityUnit(),GetEnumUnit())
elseif GetSpellAbilityId() == 'AHtb' then
call Enemy_Alive_All_Ability('AHtb','A000',GetSpellAbilityUnit(),GetEnumUnit())
else
call DoNothing( )
endif
endfunction
function Trig____________________001_Actions takes nothing returns nothing
call ForGroupBJ( GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(GetSpellTargetUnit()), Condition(function Enemy_Alive_Ability_Choose)), function Enemy_Alive_Ability_Actions )
endfunction
function InitTrig____________________001 takes nothing returns nothing
set gg_trg____________________001 = CreateTrigger( )
call TriggerAddAction( gg_trg____________________001, function Trig____________________001_Actions )
endfunction |
|