找回密码
 点一下
查看: 1292|回复: 12

为什么一使用就结束?

[复制链接]
发表于 2008-11-25 12:52:20 | 显示全部楼层 |阅读模式
function FearSwardLoop takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local unit ut = GetHandleUnit(t,"FearSward_ut")
    local real Ang = GetHandleReal(t,"FearSward_ang")
    local integer j = GetHandleInt(t,"FearSward_j")
    if (GetUnitAbilityLevel(ut,'BNht')==1 ) then
    set j = j + 1
       if ( j>=24)then
       set j = 1
       set Ang = Ang + GetRandomReal(-180,180)
       call SetHandleReal(t,"FearSward_ang",Ang)
       endif
    call SetHandleInt(t,"FearSward_j",j)
    call SetHandleReal(t,"FearSward_ang",Ang)
    call IssuePointOrder(ut,"move",GetUnitX(ut)+300*Cos(Ang*bj_DEGTORAD),GetUnitY(ut)+300*Sin(Ang*bj_DEGTORAD))
    else
    call BJDebugMsg("恐惧效果结束")
    call EndTimer(t)
    endif
    set ut = null
    set t = null
endfunction

function FearSward takes unit ut returns nothing
    local timer t = CreateTimer()
    call SetHandleHandle(t,"FearSward_ut",ut)
    call SetHandleReal(t,"FearSward_ang",GetUnitFacing(ut))
    call SetHandleInt(t,"FearSward_j",1)
    call TimerStart(t,0.12,true,function FearSwardLoop )
    set t = null
endfunction



为什么一使用就结束?
发表于 2008-11-25 13:09:38 | 显示全部楼层
J<=24试试
回复

使用道具 举报

 楼主| 发表于 2008-11-25 14:39:22 | 显示全部楼层
这个判断根本和那个没关系。。。
回复

使用道具 举报

发表于 2008-11-25 15:47:22 | 显示全部楼层
难道第一次运行时单位身上并没有那个BUFF?
回复

使用道具 举报

 楼主| 发表于 2008-11-25 15:49:26 | 显示全部楼层
事实上我都无语了,所有GetUnitAbilityLevel都不对劲。。。
回复

使用道具 举报

发表于 2008-11-25 15:56:45 | 显示全部楼层
啊!!!

绝对不要用BUFF来捕捉技能等级,在释放技能的时候使用单位附加值的判断方法可能好一点
回复

使用道具 举报

 楼主| 发表于 2008-11-25 16:10:13 | 显示全部楼层
我什么时候要用BUFF捕捉技能等级,我是想判断BUFF存在。
这个方式以前一直用来着
回复

使用道具 举报

发表于 2008-11-25 16:19:42 | 显示全部楼层
if (GetUnitAbilityLevel(ut,'BNht')==1 ) then

改成大于等于1再看看
回复

使用道具 举报

 楼主| 发表于 2008-11-25 16:29:46 | 显示全部楼层
反正诡异得很,唉。

现在不只这个技能,而是整个地图的GetUnitAbilityLevel都不对了。我靠!

做了一个箭技能,现在都没伤害了
回复

使用道具 举报

发表于 2008-11-25 17:53:46 | 显示全部楼层
试试GetHandleUnit后Kill这个单位,看是不是原单位
也许你的地图出了RP BUG
回复

使用道具 举报

发表于 2008-11-25 18:50:50 | 显示全部楼层
猜不出原因
直接发图
回复

使用道具 举报

 楼主| 发表于 2008-11-25 19:50:45 | 显示全部楼层
单位没问题
这个问题解决了,这个技能添加BUFF慢。

但另一个问题出现了,麻烦啊。
这个才是RP BUG
回复

使用道具 举报

发表于 2008-11-25 22:34:43 | 显示全部楼层
原来如此
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-21 10:32 , Processed in 0.049680 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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