|
发表于 2010-3-5 12:38:45
|
显示全部楼层
[jass]function YN1 takes unit U,integer ID,boolean BL returns nothing
if GetUnitAbilityLevel(U,ID) == 1 and not BL then
call UnitRemoveAbility(U,ID)
elseif BL then
call UnitAddAbility(U,ID)
endif
endfunction
function SetHeroData takes unit U,integer M,integer N returns nothing
local integer A = 0
local integer B = N+10
if N==70 then
call SetUnitMoveSpeed( U,(GetUnitDefaultMoveSpeed(U)+ M ))
return
endif
loop
exitwhen M == 0
set A = M-((M/2)*2)
set M = M/2
call YN1(U,udg_Data_I[N],A==1)
set N = N+1
endloop
loop
exitwhen N >= B
call YN1(U,udg_Data_I[N],false)
set N = N+1
endloop
endfunction
call SetHeroData(u,增加数值(最大1023),这个是类型(属性或攻击防御))
[/jass]
第二个问题
自己写的做物品属性用的udg_Data_I[N]=1,2,4,8...........
不需要的部分自己改吧 |
|