找回密码
 点一下
查看: 2064|回复: 10

单位组问题??????????

[复制链接]
发表于 2008-3-5 12:34:04 | 显示全部楼层 |阅读模式
[codes=jass]/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//选取范围内敌人....condition
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function enemycondition takes nothing returns boolean
    if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_GROUND) == false ) then
        return false
    endif
    if ( IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) == true ) then
        return false
    endif
    if ( IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(GetTriggerUnit())) == false ) then
        return false
    endif
    return true
endfunction




/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//选取范围内敌人....action
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function enemyaction takes nothing returns nothing
    local unit u = GetEnumUnit()
    call UnitAddAbilityBJ( 'Arav', u )
    call SetUnitFlyHeightBJ( u, 1000, 0.00 )
    call SetUnitAnimation( u, "death" )
    set u = null
endfunction




/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//触发的所有东西
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function Trig_start_Actions takes nothing returns nothing
    local location pts = GetSpellTargetLoc()
    local unit trigerunit = GetTriggerUnit()
    local rect setrect = RectFromCenterSizeBJ(pts, 500.00, 500.00)
    local group enemy = GetUnitsInRectMatching(setrect, Condition(function enemycondition))

    if ( not ( GetSpellAbilityId() == 'AUin' ) ) then
        return
    endif

    call ForGroupBJ( enemy, function enemyaction )

    call RemoveRect(setrect)
    call RemoveLocation(pts)
endfunction[/codes]

出了什么问题,单位组选错了还是什么,无法让单位播放死亡动作。
 楼主| 发表于 2008-3-5 12:40:40 | 显示全部楼层
大概知道了,好象是条件出问题了。
回复

使用道具 举报

 楼主| 发表于 2008-3-5 12:52:36 | 显示全部楼层
[codes=jass]function enemycondition takes nothing returns boolean
    if not IsUnitType(GetEnumUnit(), UNIT_TYPE_GROUND) then
        return false
    endif
    if IsUnitType(GetEnumUnit(), UNIT_TYPE_STRUCTURE) then
        return false
    endif
    if not IsPlayerEnemy(GetOwningPlayer(GetEnumUnit()), GetOwningPlayer(GetTriggerUnit())) then
        return false
    endif
    return true
endfunction[/codes]

还是有问题,选取地面非建筑敌对单位,ms 是这样写的吧,结果还是选不中,有点晕了。
回复

使用道具 举报

发表于 2008-3-5 12:57:39 | 显示全部楼层
我觉得应该是GetFilterUnit()吧,不妨试下~~
回复

使用道具 举报

 楼主| 发表于 2008-3-5 13:02:21 | 显示全部楼层
居然神奇的对了,为什么用t 转过来的函数中不能用GetEnumUnit()呢?
回复

使用道具 举报

发表于 2008-3-5 13:05:45 | 显示全部楼层
额………………
GetFilterUnit()对应的是触发里的匹配单位(Matching Unit),而GetEnumUnit()对应的是选取单位(Picked Unit)
这里是选取举行区域内满足条件的单位,应该是匹配单位做的吧
回复

使用道具 举报

 楼主| 发表于 2008-3-5 13:08:32 | 显示全部楼层
这个我是用t转的jass,里面也是用的GetEnumUnit()呢?
回复

使用道具 举报

发表于 2008-3-5 13:10:23 | 显示全部楼层
额………………那么T本身运行有效吗??
回复

使用道具 举报

 楼主| 发表于 2008-3-5 13:13:37 | 显示全部楼层
没试过,这t转了后已经被改的面目全非了。。。。。。
回复

使用道具 举报

发表于 2008-3-5 13:14:40 | 显示全部楼层
这个………………我就更不会知道了………………
回复

使用道具 举报

 楼主| 发表于 2008-3-5 13:25:23 | 显示全部楼层
以后我再试下,谢谢了哈。。。。。。。
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-6-6 04:44 , Processed in 0.032509 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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