|
不知是不是哈希处理上出现的问题还是没排泄好
总是用了几次后会开始卡~就是一用次就卡一下~
帮手帮手
[jass]function IceslamC takes nothing returns boolean
return GetSpellAbilityId() == 'A00D'
endfunction
function IceslamD takes nothing returns nothing
call UnitDamageTarget(udg_u,GetEnumUnit(),200.0,true,false,null,null,null)
call GroupAddUnit(udg_g,GetEnumUnit())
call Ice(udg_u,GetEnumUnit(),5)//自订function Ice
endfunction
function IceslamE takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer a7=GetHandleId(t)
local integer i=GetUnitUserData(GetEnumUnit())
local integer ii=LoadInteger(udg_GC,a7,1)
local group g
local group gg=LoadGroupHandle(udg_GC,a7,2)
if ii==i-400 then
set g=CreateGroup()
call SetUnitUserData(GetEnumUnit(),255)
call SetUnitVertexColor(GetEnumUnit(),120,120,255,255)
call GroupEnumUnitsInRange(g,GetUnitX(GetEnumUnit()),GetUnitY(GetEnumUnit()),183.00,Condition(function GetUnitC13))//自订function GetUnitC13
call ForGroup(g,function IceslamD)
call DestroyGroup(g)
endif
if i<=255 and i>0 then
set i=i-5
call SetUnitUserData(GetEnumUnit(),i)
call SetUnitVertexColor(GetEnumUnit(),120,120,255,i)
endif
if i<=0 then
call GroupRemoveUnit(gg,GetEnumUnit())
call RemoveUnit(GetEnumUnit())
call SaveGroupHandle(udg_GC,a7,2,gg)//不清楚需不需要再存
endif
set g=null
set t=null
set gg=null
endfunction
function Iceslamloop takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer a7=GetHandleId(t)
local integer i=LoadInteger(udg_GC,a7,1)
local group g=LoadGroupHandle(udg_GC,a7,2)
set i=i+1
call SaveInteger(udg_GC,a7,1,i)
set udg_u=LoadUnitHandle(udg_GC,a7,1)
set udg_g=LoadGroupHandle(udg_GC,a7,3)
call ForGroup(g,function IceslamE)
if CountUnitsInGroup(g)==0 then
call DestroyGroup(g)
call DestroyGroup(LoadGroupHandle(udg_GC,a7,2))
call PauseTimer(t)
call FlushChildHashtable(udg_GC,a7)
call DestroyTimer(t)
endif
set t=null
set g=null
endfunction
function Iceslam takes nothing returns nothing
local timer t=CreateTimer()
local integer a7=GetHandleId(t)
local unit u
local real x=GetUnitX(GetTriggerUnit())
local real y=GetUnitY(GetTriggerUnit())
local location l=GetSpellTargetLoc()
local location l2=Location(x,y)
local real z=GetLocationZ(l2)
local real x2=GetLocationX(l)
local real y2=GetLocationY(l)
local real direction=Atan2(y2-y,x2-x)
local real intflyheight=z+1200
local integer i=0
local integer i2=0
local group g=CreateGroup()
call PlaySoundOnUnitBJ(gg_snd_binglong5,100,GetTriggerUnit())音效
call RemoveLocation(l)
call RemoveLocation(l2)
call SaveUnitHandle(udg_GC,a7,1,GetTriggerUnit())
call SaveInteger(udg_GC,a7,1,0)
call SaveGroupHandle(udg_GC,a7,3,CreateGroup())
loop
set i=i+1
set i2=0
set x2=x+(300+I2R(i)*80)*Cos(direction)
set y2=y+(300+I2R(i)*80)*Sin(direction)
set l=Location(x2,y2)
set z=GetLocationZ(l)
call RemoveLocation(l)
exitwhen intflyheight+50-z<0 or i>60
set u=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'u00G',x2,y2,direction*bj_RADTODEG)//
call SetUnitVertexColor(u,120,120,255,0)
call SetUnitScale(u,0.6,0.6,0.6)
call SetUnitFlyHeight(u,intflyheight+50-z,0)
call SetUnitX(u,x2)
call GroupAddUnit(g,u)
call SetUnitUserData(u,i+400)
loop
set i2=i2+1
exitwhen i2>3
set x2=(x+(300+I2R(i)*80)*Cos(direction))+(150-I2R(i2)*75)*Cos(direction+90.0/bj_RADTODEG)
set y2=(y+(300+I2R(i)*80)*Sin(direction))+(150-I2R(i2)*75)*Sin(direction+90.0/bj_RADTODEG)
set u=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'u00G',x2,y2,direction*bj_RADTODEG)//
call SetUnitVertexColor(u,120,120,255,0)
call SetUnitUserData(u,i+400)
if i2==2 then
set l=Location(x2,y2)
set z=GetLocationZ(l)
call RemoveLocation(l)
call SetUnitFlyHeight(u,intflyheight+150-z,0)
else
if intflyheight-z>=0 then
set l=Location(x2,y2)
set z=GetLocationZ(l)
call RemoveLocation(l)
call SetUnitFlyHeight(u,intflyheight-z,0)
else
call RemoveUnit(u)
endif
endif
call SetUnitX(u,x2)
call GroupAddUnit(g,u)
endloop
endloop
call SaveGroupHandle(udg_GC,a7,2,g)
call TimerStart(t,0.04,true,function Iceslamloop)
call RemoveLocation(l)
call RemoveLocation(l2)
set u=null
set l=null
set l2=null
set t=null
endfunction
//===========================================================================
function InitTrig_a7 takes nothing returns nothing
set gg_trg_a7 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_a7, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_a7, Condition( function IceslamC ) )
call TriggerAddAction( gg_trg_a7, function Iceslam )
endfunction[/jass] |
|