- Joined
- Aug 31, 2008
- Messages
- 1,780



JASS:
function IsNotHero takes nothing returns boolean
if IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==false then
call UnitAddAbility(GetFilterUnit(),’Aloc’)
return true
endif
return false
endfunction
function PerspclreWork takes nothing returns nothing
local real x=GetUnitX(gg_unit_Ewar_0759)
local real y=GetUnitY(gg_unit_Ewar_0759)
local real x1=GetUnitX(GetEnumUnit())
local real y1=GetUnitY(GetEnumUnit())
local real d=SquareRoot((x-x1)*(x-x1)+(y-y1)*(y-y1))
local integer t=R2I(0.255*d)
if t>255 then
set t=255
endif
call SetUnitVertexColor(GetEnumUnit(),255,255,255,t)
endfunction
function PerspclreDone takes nothing returns nothing
call SetUnitVertexColor(GetEnumUnit(),255,255,255,255)
endfunction
function Perspclre takes nothing returns nothing
if IsUnitInRegion(udg_rg,gg_unit_Ewar_0759) then
set udg_b=true
call ForGroup(udg_g,function PerspclreWork)
else
if udg_b then
set udg_b=false
call ForGroup(udg_g,function PerspclreDone)
endif
endif
endfunction
function SystemInit takes nothing returns nothing
local boolexpr b=Condition(function IsNotHero)
call GroupEnumUnitsInRect(udg_g,bj_mapInitialPlayableArea,b)
call DestroyBoolExpr(b)
set b=null
call RegionAddRect(udg_rg,gg_rct_r01)
call RegionAddRect(udg_rg,gg_rct_r02)
call RemoveRect(gg_rct_r01)
call RemoveRect(gg_rct_r02)
call TimerStart(CreateTimer(),0.1,true,function Perspclre)
call DestroyTrigger(GetTriggeringTrigger())
endfunction