|
我用的是1.24b的编辑器.反正本来用1.20的时候编写都没出现卡过- -1.22变就出现了,郁闷啊
[jass]
function BoomWaterC takes nothing returns nothing
local timer tm=GetExpiredTimer()
local integer i=GetHandleId(tm)
local unit u=LoadUnitHandle(udg_hs,i,StringInt("Source"))
local unit ut=null
local group g=LoadGroupHandle(udg_hs,i,StringInt("Group"))
local group g1=CreateGroup()
local integer j=LoadInteger(udg_hs,i,StringInt("RunTime"))
call GroupAddGroup(g,g1)
if j>0 then
loop
set ut=FirstOfGroup(g1)
exitwhen ut==null
call SetUnitFlyHeight(ut,(10000-(100-j)*(100-j))*0.06,0)
call GroupRemoveUnit(g1,ut)
endloop
call SaveInteger(udg_hs,i,StringInt("RunTime"),j-1)
else
loop
set ut=FirstOfGroup(g1)
exitwhen ut==null
call PauseUnit(ut,false)
set udg_s="洪流"
call damage(u,ut,1000,1)
call GroupRemoveUnit(g1,ut)
endloop
call DestroyGroup(g)
call DestroyTimer(tm)
call FlushChildHashtable(udg_hs,i)
endif
call DestroyGroup(g1)
set tm=null
set u=null
set ut=null
set g=null
set g1=null
endfunction
function BoomWaterB takes nothing returns boolean
if IsPlayer() then
call PauseUnit(GetFilterUnit(),true)
call UnitAddAbility(GetFilterUnit(),'Arav')
call UnitRemoveAbility(GetFilterUnit(),'Arav')
set udg_s="洪流"
call damage(LoadUnitHandle(udg_hs,GetHandleId(GetExpiredTimer()),StringInt("Source")),GetFilterUnit(),1000,3)
return true
endif
return false
endfunction
function BoomWaterA takes nothing returns nothing
local timer tm=GetExpiredTimer()
local integer i=GetHandleId(tm)
local unit u=LoadUnitHandle(udg_hs,i,StringInt("Source"))
local real x=LoadReal(udg_hs,i,StringInt("x"))
local real y=LoadReal(udg_hs,i,StringInt("y"))
local group g=CreateGroup()
local timer t=CreateTimer()
local integer j=0
local integer n=0
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Naga\\NagaDeath\\NagaDeath.mdl",x,y))
call DestroyEffect(LoadEffectHandle(udg_hs,i,StringInt("FX0")))
call DestroyEffect(LoadEffectHandle(udg_hs,i,StringInt("FX1")))
call DestroyEffect(LoadEffectHandle(udg_hs,i,StringInt("FX2")))
call DestroyEffect(LoadEffectHandle(udg_hs,i,StringInt("FX3")))
call DestroyEffect(LoadEffectHandle(udg_hs,i,StringInt("FX4")))
call DestroyEffect(LoadEffectHandle(udg_hs,i,StringInt("FX5")))
call GroupEnumUnitsInRange(g,x,y,275,Condition(function BoomWaterB))
set j=GetHandleId(t)
call SaveUnitHandle(udg_hs,j,StringInt("Source"),u)
call SaveGroupHandle(udg_hs,j,StringInt("Group"),g)
call SaveInteger(udg_hs,j,StringInt("RunTime"),200)
call TimerStart(t,0.01,true,function BoomWaterC)
call DestroyTimer(tm)
call FlushChildHashtable(udg_hs,i)
set tm=null
set g=null
set t=null
set u=null
endfunction
function BoomWater takes nothing returns nothing
local timer tm=GetExpiredTimer()
local integer i=GetHandleId(tm)
local unit u=LoadUnitHandle(udg_hs,i,StringInt("Source"))
local timer t=null
local integer j=0
local real x=0
local real y=0
local integer n=0
set t=CreateTimer()
set j=GetHandleId(t)
loop
set n=GetRandomInt(0,9)
exitwhen udg_Hero[n]!=null and IsUnitType(udg_Hero[n],UNIT_TYPE_DEAD)==false
endloop
set x=GetUnitX(udg_Hero[n])
set y=GetUnitY(udg_Hero[n])
call SaveReal(udg_hs,j,StringInt("x"),x)
call SaveReal(udg_hs,j,StringInt("y"),y)
call SaveUnitHandle(udg_hs,j,StringInt("Source"),u)
set n=0
loop
exitwhen n>5
call SaveEffectHandle(udg_hs,j,StringInt("FX"+I2S(n)),AddSpecialEffect("Objects\\Spawnmodels\\Other\\IllidanFootprint\\IllidanWaterSpawnFootPrint.mdl",x+40*Cos(n*60*bj_DEGTORAD),y+40*Sin(n*60*bj_DEGTORAD)))
set n=n+1
endloop
call TimerStart(t,3,false,function BoomWaterA)
set t=null
set tm=null
set u=null
endfunction
[/jass]
运行到上述语句的时候,如果同时还有其他比如说暴风雪技能在释放(用计时器模拟的),就会卡.
下面放出暴风雪的代码-,-
[jass]
function A001B takes nothing returns nothing
call StopSound(gg_snd_BlizzardLoop1,false,false)
call DestroyTimer(GetExpiredTimer())
endfunction
function A001A takes nothing returns nothing
local timer tm=GetExpiredTimer()
local integer i=GetHandleId(tm)
local real x=LoadReal(udg_hs,i,StringInt("x"))
local real y=LoadReal(udg_hs,i,StringInt("y"))
local unit u=LoadUnitHandle(udg_hs,i,StringInt("Source"))
call RangeDmg(u,x,y,325,250,3,0,"暴风雪")
call DestroyTimer(tm)
call FlushChildHashtable(udg_hs,i)
set tm=null
set u=null
endfunction
function A001 takes nothing returns nothing
local trigger t=GetTriggeringTrigger()
local integer j=GetHandleId(t)
local unit u=LoadUnitHandle(udg_hs,j,StringInt("Source"))
local real x=LoadReal(udg_hs,j,StringInt("x"))
local real y=LoadReal(udg_hs,j,StringInt("y"))
local timer tm=null
local integer m=0
local group g=null
local integer n=0
if GetTriggerEventId()==EVENT_UNIT_SPELL_ENDCAST then
call TimerStart(CreateTimer(),1,false,function A001B)
call SaveBoolean(udg_hs,GetHandleId(GetTriggerUnit()),StringInt("IsSpelling"),false)
call DestroyTriggerAll(t)
else
set tm=CreateTimer()
set m=GetHandleId(tm)
call SaveUnitHandle(udg_hs,m,StringInt("Source"),u)
call SaveReal(udg_hs,m,StringInt("y"),y)
call SaveReal(udg_hs,m,StringInt("x"),x)
call TimerStart(tm,0.8,true,function A001A)
set tm=null
call StopSound(gg_snd_BlizzardLoop1,false,false)
call SetSoundPosition(gg_snd_BlizzardLoop1,x,y,0)
call SetSoundVolume(gg_snd_BlizzardLoop1,127)
call StartSound(gg_snd_BlizzardLoop1)
set n=10
loop
exitwhen n==0
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget.mdl",x+GetRandomReal(-325,325),y+GetRandomReal(-325,325)))
set n=n-1
endloop
set g=CreateGroup()
call GroupEnumUnitsInRange(g,x,y,325,Condition(function IsPlayer))
if FirstOfGroup(g)==null then
call IssueTargetOrder(u,"attack",udg_Hero[LoadInteger(udg_hs,j,StringInt("ArgoNum"))])
endif
call DestroyGroup(g)
set g=null
endif
set u=null
set t=null
endfunction
function Trig_NPCSpell_Conditions takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit ut=GetSpellTargetUnit()
local integer id=GetSpellAbilityId()
local real x=GetUnitX(u)
local real y=GetUnitY(u)
local real xt=GetSpellTargetX()
local real yt=GetSpellTargetY()
local trigger t=null
local integer i=0
local integer j=0
local timer tm=null
local group g=null
local integer k=0
local string s
if id=='A002' then
call SaveBoolean(udg_hs,GetHandleId(u),StringInt("IsSpelling"),true)
set t=CreateTrigger()
set j=GetHandleId(t)
call SaveUnitHandle(udg_hs,j,StringInt("Source"),u)
call SaveReal(udg_hs,j,StringInt("y"),yt)
call SaveReal(udg_hs,j,StringInt("x"),xt)
call SaveTriggerConditionHandle(udg_hs,j,StringInt("TriggerCondition"),TriggerAddCondition(t,Condition(function A001)))
call TriggerRegisterUnitEvent(t,u,EVENT_UNIT_SPELL_ENDCAST)
call TriggerRegisterTimerEvent(t,0.99,true)
set t=null
set tm=CreateTimer()
set i=GetHandleId(tm)
call SaveUnitHandle(udg_hs,i,StringInt("Source"),u)
call SaveReal(udg_hs,i,StringInt("y"),yt)
call SaveReal(udg_hs,i,StringInt("x"),xt)
call TimerStart(tm,0.8,true,function A001A)
set tm=null
call StopSound(gg_snd_BlizzardLoop1,false,false)
call SetSoundPosition(gg_snd_BlizzardLoop1,xt,yt,0)
call SetSoundVolume(gg_snd_BlizzardLoop1,127)
call StartSound(gg_snd_BlizzardLoop1)
set j=10
loop
exitwhen j==0
call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Blizzard\\BlizzardTarget.mdl",x+GetRandomReal(-325,325),y+GetRandomReal(-325,325)))
set j=j-1
endloop
set g=CreateGroup()
call GroupEnumUnitsInRange(g,xt,yt,325,Condition(function IsPlayer))
if FirstOfGroup(g)==null then
call IssueTargetOrder(u,"attack",udg_Hero[LoadInteger(udg_hs,GetHandleId(u),StringInt("ArgoNum"))])
endif
call DestroyGroup(g)
set g=null
endif
set u=null
set ut=null
endfunction
[/jass] |
|