找回密码
 点一下
查看: 4472|回复: 3

可重复刷新效果持续时间的冰封技能函数

[复制链接]
发表于 2007-12-7 22:37:27 | 显示全部楼层 |阅读模式
运行原理:
当目标被冰封时(之前没有被冰封,通过索引检查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]
发表于 2011-5-2 21:36:35 | 显示全部楼层
来学习下
回复

使用道具 举报

发表于 2011-6-4 02:45:55 | 显示全部楼层
值得研究
回复

使用道具 举报

发表于 2011-7-5 22:22:16 | 显示全部楼层
暂停单位会导致单位身上的BUFF计时也暂停,算是一个BUG吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-22 23:30 , Processed in 0.033625 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表