找回密码
 点一下
查看: 7589|回复: 2

[演示]返回单位组里HP最低的函数

  [复制链接]
发表于 2007-3-5 18:18:14 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2007-3-9 21:47:08 | 显示全部楼层
汗,这函数需要这么麻烦吗。。。
  1. function GroupPickLowestLifeUnitEnum takes nothing returns nothing
  2.     if GetUnitState(GetEnumUnit(), UNIT_STATE_LIFE) < GetUnitState(bj_groupRandomCurrentPick, UNIT_STATE_LIFE) then
  3.         set bj_groupRandomCurrentPick = GetEnumUnit()
  4.     endif
  5. endfunction
  6. function GroupPickLowestLifeUnit takes group whichGroup returns unit
  7.     set bj_groupRandomCurrentPick = FirstOfGroup(whichGroup)
  8.     call ForGroup(whichGroup, function GroupPickLowestLifeUnitEnum)
  9.     if bj_wantDestroyGroup then
  10.         call DestroyGroup(whichGroup)
  11.     endif
  12.     set bj_wantDestroyGroup = false
  13.     return bj_groupRandomCurrentPick
  14. endfunction
复制代码
回复

使用道具 举报

 楼主| 发表于 2007-3-10 01:38:00 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-27 15:31 , Processed in 0.140147 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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