|
运行原理:
当目标被冰封时(之前没有被冰封,通过索引检查Cache){
使用Return成整数将目标单位(整数)用Cache记录起来。
使用单位(整数)目标作用索引创建计时器、特效、单位等并使用Return成整数记录起来。
}
当目标被冰封时(之前已经被冰封,通过索引检查Cache){
刷新计时器时间()
}
function SevereWinterTinge takes unit Unia returns nothing
为被首调用函数,参数为:Unia(目标单位)
事件我想大家都知道是什么了,所以就不写了
[codes=jass]
function H2I takes handle H returns integer
return H
return 0
endfunction
function I2U takes integer I returns unit
return I
return null
endfunction
function I2TR takes integer I returns timer
return I
return null
endfunction
function I2E takes integer I returns effect
return I
return null
endfunction
[/codes]
[codes=jass]
function SevereWinterTingeRun takes nothing returns nothing
local unit Unia=I2U(GetStoredInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(GetExpiredTimer())),"Unit"))
local real Reaa=0
if GetStoredReal(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"TimerRun")<3 and GetUnitState(Unia,UNIT_STATE_LIFE)!=0 then
set Reaa=GetStoredReal(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"TimerRun")
set Reaa=Reaa+0.2
call StoreReal(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"TimerRun",Reaa)
else
call PauseUnit(Unia,false)
call SetUnitTimeScale(Unia,1)
call DestroyEffect(I2E(GetStoredInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"Effect")))
call FlushStoredMission(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)))
call FlushStoredMission(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(GetExpiredTimer())))
call DestroyTimer(GetExpiredTimer())
endif
set Unia=null
endfunction
function SevereWinterTinge takes unit Unia returns nothing
local timer Tima
local effect Effa
if GetStoredInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"Effect")==0 then
call PauseUnit(Unia,true)
call SetUnitTimeScale(Unia,0)
set Effa=AddSpecialEffectTarget("Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdx",Unia,"origin")
call StoreInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"Effect",H2I(Effa))
set Effa=null
endif
if GetStoredInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"Timer")==0 then
set Tima=CreateTimer()
call TimerStart(Tima,0.2,true,function SevereWinterTingeRun)
call StoreInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"Timer",H2I(Tima))
call StoreInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Tima)),"Unit",H2I(Unia))
call StoreReal(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"TimerRun",0)
set Tima=null
else
call TimerStart(I2TR(GetStoredInteger(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"Timer")),0.2,true,function SevereWinterTingeRun)
call StoreReal(udg_Titans_Cache,"SevereWinterTinge"+I2S(H2I(Unia)),"TimerRun",0)
endif
endfunction
function InitTrig_Severe_Winter_Tinge takes nothing returns nothing
endfunction
[/codes] |
|