|
function QCB takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer i=GetHandleId(t)
local unit u=LoadUnitHandle(BX, i, 0)
local integer a=LoadInteger(BX, i, 1)
local integer ii=GetHandleId(gg_unit_Hmkg_0002)//暂时
local integer k=LoadInteger(BX,ii,5)//local integer k=//GetUnitAbilityLevel(u, a)来自记录
call UnitRemoveAbility(u,'A08U')//去除模板
call UnitAddAbility(u, a)//刷新
call SetUnitAbilityLevel(u, a, k)//设置到应有等级
call FlushChildHashtable(BX, i)
call PauseTimer(t)
call DestroyTimer(t)
set t=null
endfunction
function QCD takes unit whichUnit,integer abilcode,real cd,integer r0,integer r1,integer r2,integer r3,integer r4 returns nothing// 这里的cd为技能原始的
local timer t=CreateTimer() //q模板id‘A08U’
local integer i=GetHandleId(t) //QCD(GetTriggerUnit(),'A08Q',8,69,63,56,50,41)
local real r
local real n=0
local real k=0
local integer l=0
local integer level
call UnitRemoveAbility(whichUnit,abilcode)//1
//loop
//exitwhen l > 5
//set r=GetWidgetLife(( UnitItemInSlot(whichUnit, l) ))//all-0.1,0.2,0.3,0.4 暂时屏蔽
//if r > 75 then
//set k=S2R(SubString(R2S(r), 3, 4))
//set n=n + k/10
//endif
//set l=l + 1
//endloop
if n > 0.4 then
set n=0.4
endif
set n=0.1//zanshi
if n==0 then
set level=r0
elseif n==0.1 then
set level=r1
elseif n==0.2 then
set level=r2
elseif n==0.3 then
set level=r3
elseif n>=0.4 then
set level=r4
endif
set n=cd * ( 1 - n ) //这个n影响加的模板的等级
call UnitAddAbility(whichUnit,'A08U')
call SetUnitAbilityLevel(whichUnit,'A08U',level)//秒级
call IssueImmediateOrder(whichUnit, "berserk" )//显示
call SaveUnitHandle(BX, i, 0, whichUnit)
call SaveInteger(BX, i, 1, abilcode)
call TimerStart(t,n, false, function QCB)//计时
endfunction
function Trig____________________005Actions takes nothing returns nothing
if GetSpellAbilityId() == 'A08Q' then
call QCD(GetTriggerUnit(),'A08Q',8,69,63,56,50,41)//8 7.2 6.4 5.6 4.8//69,63,56,50,41
endif
if GetSpellAbilityId() == 'A08P' then
call WCD(GetTriggerUnit(),'A08P',22)//
endif
endfunction |
|