找回密码
 点一下
查看: 1374|回复: 9

按S键的问题???   无限沉默??

[复制链接]
发表于 2008-9-18 21:58:41 | 显示全部楼层 |阅读模式
这个技能,在施放的时,马上按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]
恶声恶气 该用户已被删除
发表于 2008-9-18 22:00:16 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-9-18 22:03:04 | 显示全部楼层
代码可以用codes标签框起来,而且lz把字体方那么大,看起来好吃力………………

补充下1楼,就是把event改成EVENT_PLAYER_UNIT_SPELL_EFFECT
回复

使用道具 举报

 楼主| 发表于 2008-9-18 22:11:34 | 显示全部楼层

Re:按S键的问题???  无限沉默??

我还是不太明白,各位大哥,帮我改好一下吧。

把正确的发出来
回复

使用道具 举报

发表于 2008-9-18 22:12:58 | 显示全部楼层

Re:按S键的问题???  无限沉默??

不是很明白了吗,把注册的事件改成2楼的那个
回复

使用道具 举报

发表于 2008-9-18 22:13:25 | 显示全部楼层

Re:按S键的问题???   无限沉默??

刷新一下 眼前一亮

还是高亮好~~~

传说中的等待+隐藏显示单位也可能造成的
回复

使用道具 举报

 楼主| 发表于 2008-9-18 22:13:28 | 显示全部楼层

Re:按S键的问题???   无限沉默??

引用第2楼zhuzeitou于2008-09-18 22:03发表的  :
代码可以用codes标签框起来,而且lz把字体方那么大,看起来好吃力………………

补充下1楼,就是把event改成EVENT_PLAYER_UNIT_SPELL_EFFECT


event?????????
回复

使用道具 举报

发表于 2008-9-18 22:14:27 | 显示全部楼层

Re:按S键的问题???   无限沉默??

event就是事件

话说中秋活动可以卸甲了~~
回复

使用道具 举报

发表于 2008-9-18 22:15:42 | 显示全部楼层

Re:按S键的问题???   无限沉默??

call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
这个不就是注册事件么,事件不就是event么………………

卸甲的事情等小灼自己来吧~~
回复

使用道具 举报

 楼主| 发表于 2008-9-18 22:17:02 | 显示全部楼层

Re:Re:按S键的问题???   无限沉默??

引用第8楼zhuzeitou于2008-09-18 22:15发表的 Re:按S键的问题???   无限沉默?? :
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
这个不就是注册事件么,事件不就是event么………………


谢谢啦,我也是这么想的。

可是第二个问题,怎么解决呢?
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-21 06:26 , Processed in 0.031266 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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