|
这个技能,在施放的时,马上按S,就会没有CD,可以一直放,怎么解决? 是什么原因造成的呢?
[codes=jass]//TESH.scrollpos=12
//TESH.alwaysfold=0
function JW_LBLZ takes nothing returns nothing
local unit u
local trigger t
local effect ef
local integer i
local integer iloop
if(GetSpellAbilityId()=='A0DP')then
set u=GetTriggerUnit()
set i=GetUnitAbilityLevel(u,'A0DP')*4
debug call BJDebugMsg("I:"+I2S(i))
debug call BJDebugMsg("1")
set iloop=0
loop
exitwhen iloop>=i
debug call BJDebugMsg("X")
set ef=AddSpecialEffectTarget("Abilities\\Spells\\Human\\Heal\\HealTarget.mdl",u,"overhead")
call SetUnitLifeBJ( u, GetUnitStateSwap(UNIT_STATE_LIFE, u)+( ( GetUnitStateSwap(UNIT_STATE_MAX_LIFE, u) - GetUnitStateSwap(UNIT_STATE_LIFE, u) ) / 40 ) )
call TriggerSleepAction(1)
call DestroyEffect(ef)
set iloop=iloop+1
endloop
set ef=null
set u=null
debug call BJDebugMsg("2")
endif
endfunction
//===========================================================================
function InitTrig_LBLZ takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddAction(t, function JW_LBLZ)
set t=null
endfunction
[/codes]
这个技能为; 实现沉默光环的效果,但是却有一定可能会造成无限沉默,死了再复活也还是不能用技能,这是怎么回事?怎么解决?
[codes=jass]//TESH.scrollpos=44
//TESH.alwaysfold=0
library CY
globals
public unit CY
public unit TGYHunit
public timer ti
public integer FYZDL
public unit FYZDunit
public player CYP
endglobals
endlibrary
//===========================================================================
//852592
function CY_TGYHdie takes nothing returns nothing
local unit u=GetDyingUnit()
call PauseTimer(CY_ti)
call TriggerSleepAction(I2R(GetUnitLevel(u)+1)*5-1)
call TimerStart(CY_ti,.6,true,null)
set u=null
endfunction
function CY_TGYHhelp takes nothing returns nothing
local location l=GetUnitLoc(CY_CY)
call IssuePointOrderByIdLoc(CY_TGYHunit,852592,l)
call RemoveLocation(l)
set l=null
endfunction
function CY_TGYH takes nothing returns nothing
local integer i
local unit u
local trigger t
local trigger t2
if(GetLearnedSkill()=='A0D3')then
set u=GetTriggerUnit()
set i=GetUnitAbilityLevel(u,'A0D3')
if(i==1)then
set CY_CY=u
set CY_TGYHunit= CreateUnit(GetOwningPlayer(u),'n002',0,0,0)
call ShowUnit(CY_TGYHunit, false)
call SetUnitInvulnerable(CY_TGYHunit,true)
call UnitAddAbility(CY_TGYHunit,'A0D2')
set CY_ti=CreateTimer()
call TimerStart(CY_ti,.6,true,null)
set t=CreateTrigger()
call TriggerRegisterTimerExpireEventBJ(t,CY_ti)
call TriggerAddAction(t, function CY_TGYHhelp)
set t2=CreateTrigger()
call TriggerRegisterUnitEvent(t2,CY_CY, EVENT_UNIT_DEATH )
call TriggerAddAction(t2, function CY_TGYHdie)
set t=null
set t2=null
else
if(i==4)then
set t=GetTriggeringTrigger()
call DestroyTrigger(t)
set t=null
endif
call SetUnitAbilityLevel(CY_TGYHunit,'A0D2',i)
endif
endif
endfunction
//-
function InitTrig_TGYH takes nothing returns nothing
local trigger t=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_SKILL)
call TriggerAddAction(t, function CY_TGYH)
set t=null
endfunction[/codes] |
|