call SetUnitExploded(u,true)
call KillUnit(u)
else
call SetUnitVertexColor(u,i,i,255,255)
call SaveInteger(HT,GetHandleId(u),65535,i)
endif
endif
endloop
loop
set r=r+1
call SetUnitX(LoadUnitHandle(HT,pk,R2I(100+r)),x)
call SetUnitY(LoadUnitHandle(HT,pk,R2I(100+r)),y)
call SetUnitFlyHeight(LoadUnitHandle(HT,pk,R2I(100+r)),GetUnitFlyHeight(LoadUnitHandle(HT,pk,1)),0)
call SetUnitX(LoadUnitHandle(HT,pk,R2I(200+r)),x)
call SetUnitY(LoadUnitHandle(HT,pk,R2I(200+r)),y)
call SetUnitFlyHeight(LoadUnitHandle(HT,pk,R2I(200+r)),GetUnitFlyHeight(LoadUnitHandle(HT,pk,1)),0)
exitwhen r==12
endloop
set u2=null
endif
call GroupAdd(G,g)
loop
set u=FirstOfGroup(g)
exitwhen u==null
call GroupRemoveUnit(g,u)
if IsUnitType(u,UNIT_TYPE_DEAD) then
call GroupRemoveUnit(G,u)
call SetUnitVertexColor(u,255,255,255,255)
call UnitRemoveAbility(u,'A000')
call SetUnitTurnSpeed(u,GetUnitDefaultTurnSpeed(u))
else
if LoadBoolean(HT,GetHandleId(u),65536)==false then
set i=LoadInteger(HT,GetHandleId(u),65535)
set i=i+5
if i>=250 then
call SaveInteger(HT,GetHandleId(u),65535,255)
call SetUnitVertexColor(u,255,255,255,255)
call UnitRemoveAbility(u,'A000')
call UnitRemoveAbility(u,'B000')
call SetUnitTurnSpeed(u,GetUnitDefaultTurnSpeed(u))
call GroupRemoveUnit(G,u)
else
call SetUnitVertexColor(u,i,i,255,255)
call SaveInteger(HT,GetHandleId(u),65535,i)
endif
endif
endif
call SaveBoolean(HT,GetHandleId(u),65536,false)
endloop
call DestroyGroup(g)
set t=null
set g=null
set G=null
endfunction
private function tsunamiA2 takes nothing returns nothing
local timer t=GetExpiredTimer()
local timer t2
local integer pk=GetHandleId(t)
local integer pk2
local unit u=LoadUnitHandle(HT,pk,1)
local real i=LoadReal(HT,pk,2)
local real r=0
local real x
local real y
local unit u2
set i=i+1
if LoadTimerHandle(HT,pk,2)==null then
set t2=CreateTimer()
set pk2=GetHandleId(t2)
call SaveUnitHandle(HT,pk2,1,u)
call SaveTimerHandle(HT,pk2,2,t2)
call SaveGroupHandle(HT,pk2,3,CreateGroup())
call TimerStart(t2,0.1,true,function tsunamiA3)
else
set t2=LoadTimerHandle(HT,pk,2)
set pk2=GetHandleId(t2)
endif
loop
set r=r+30
set x=GetUnitX(u)+Cos(r*bj_DEGTORAD)*50
set y=GetUnitY(u)+Sin(r*bj_DEGTORAD)*50
set u2=CreateUnit(GetOwningPlayer(u),'u000',GetUnitX(u),GetUnitY(u),r)
call SetUnitVertexColor(u2,255,255,255,0)
call SaveUnitHandle(HT,pk2,R2I(i*100+r/30),u2)
exitwhen r==360
endloop
if i>=2 then
call FlushChildHashtable(HT,pk)
call DestroyTimer(t)
else
call SaveReal(HT,pk,2,i)
endif
set u=null
set u2=null
set t=null
set t2=null
endfunction
private function tsunamiA takes nothing returns nothing
local timer t
local integer pk
if GetLearnedSkill()=='A001' then
set t=CreateTimer()
set pk=GetHandleId(t)
call SaveUnitHandle(HT,pk,1,GetTriggerUnit())
call TimerStart(t,0.5,true,function tsunamiA2)
set t=null
endif
endfunction
private function tsunamiT takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterPlayerUnitEvent(t,Player(0),EVENT_PLAYER_HERO_SKILL,null)
call TriggerAddCondition(t,Condition(function tsunamiA))
set t=null
call FlushParentHashtable(HT)
set HT=InitHashtable()
endfunction
endlibrary
2012年03月14日 03点03分
4