找回密码
 点一下
查看: 1665|回复: 5

dota中德鲁伊的熊离英雄很远的时候无法攻击,怎么做出来的啊?

[复制链接]
发表于 2010-2-28 17:23:43 | 显示全部楼层 |阅读模式
RT。。

dota德鲁伊召唤出来的熊,与英雄离得很远的话就不会攻击了,怎么能做出来这个效果啊?
发表于 2010-2-28 17:35:23 | 显示全部楼层
任意单位被攻击
攻击单位是熊
如果攻击单位和英雄的距离>500的话
对攻击单位发布stop命令。
回复

使用道具 举报

 楼主| 发表于 2010-2-28 17:54:16 | 显示全部楼层
谢谢
回复

使用道具 举报

 楼主| 发表于 2010-2-28 18:47:45 | 显示全部楼层
请问。。这个错在哪里啊啊?

我这个是按照1L的转化成代码。。我自己加了一个循环。结果没效果。。T_T...没转成代码的时候有效果的,我这个哪里改错了,求教啊


function Trig_JudgeATK_Actions takes nothing returns nothing
    local integer index=0
    loop
        set index=index+1
        if GetOwningPlayer(GetAttacker()) == Player(index+1) and GetAttacker() != udg_Hero_sign[index] then
//玩家n的单位,且不是英雄单位。Hero_sign[index]记录的是每个玩家的英雄。每个玩家只有一个英雄。
            if ( YDWEDistanceBetweenUnits(GetAttacker(), udg_Hero_sign[index]) > 750.00 ) then
//判断距离的。
                call IssueImmediateOrder( GetAttacker(), "stop" )
            endif
        endif
    exitwhen(index==5)
    endloop
endfunction

//===========================================================================
function InitTrig_JudgeATK takes nothing returns nothing
    set gg_trg_JudgeATK = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_JudgeATK, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddAction( gg_trg_JudgeATK, function Trig_JudgeATK_Actions )
endfunction
回复

使用道具 举报

 楼主| 发表于 2010-2-28 18:53:09 | 显示全部楼层
set index=index+1
放错地方了。。。
回复

使用道具 举报

 楼主| 发表于 2010-2-28 21:43:38 | 显示全部楼层
转完的是正确的啊,自己给改糟了
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-22 12:21 , Processed in 0.030991 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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