Spoiler:
Code: Select all
function NT takes unit fG,real Zq,real vQ returns integer
local timer z=(ch(0))
local integer kf=og()
local group g=WG()
local unit v
call GroupEnumUnitsInRect(g,bj_mapInitialPlayableArea,null)
loop
set v=FirstOfGroup(g)
exitwhen v==null
if IsUnitType(v,UNIT_TYPE_STRUCTURE)==false then
set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(v),'h002',GetUnitX(v),GetUnitY(v),bj_UNIT_FACING)
call UnitAddAbility(bj_lastCreatedUnit,'A06F')
call IssueTargetOrderById(bj_lastCreatedUnit,852075,v)
call UnitApplyTimedLife(bj_lastCreatedUnit,'BTLF',.5)
endif
call GroupRemoveUnit(g,v)
endloop
call yG(g)
set IN[kf]=fG
set dN[kf]=Zq
set DN[kf]=vQ
set fN[kf]=WG()
set CN[kf]=mG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])
call UnitAddAbility(IN[kf],'Amrf')
call UnitRemoveAbility(IN[kf],'Amrf')
call SetUnitFlyHeight(IN[kf],550,0)
set BN[kf]=MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])/ 20
set cN[kf]=32
set GN[hN[kf]+1]=AddSpecialEffectTarget("war3mapImported\\SolarBlast2.mdx",IN[kf],"hand right")
set GN[hN[kf]+2]=AddSpecialEffectTarget("war3mapImported\\SolarBlast2.mdx",IN[kf],"hand left")
call PauseUnit(IN[kf],true)
call SetUnitInvulnerable(IN[kf],true)
call SetUnitAnimation(IN[kf],"spell three")
call TriggerSleepAction(3.5)
if MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=300 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04N',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=400 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04R',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=500 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04K',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=600 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04Q',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=700 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04L',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=800 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04P',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=900 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04M',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
elseif MG(GetUnitX(IN[kf]),GetUnitY(IN[kf]),dN[kf],DN[kf])<=1000 then
set NN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h04O',GetUnitX(IN[kf]),GetUnitY(IN[kf]),CN[kf])
endif
set AN[kf]=CreateUnit(GetOwningPlayer(IN[kf]),'h002',(((GetUnitX(IN[kf]))*1.)+((200)*1.)*Cos(((CN[kf])*1.)*bj_DEGTORAD)),(((GetUnitY(IN[kf]))*1.)+((200)*1.)*Sin(((CN[kf])*1.)*bj_DEGTORAD)),0)
call SetUnitFlyHeight(AN[kf],650,0)
call SetUnitScale(AN[kf],1,1,1)
call SetUnitTimeScale(IN[kf],0)
call SaveInteger(J,0,GetHandleId((z)),(kf))
call TimerStart(z,.02,true,function AT)
return kf
endfunction