|
[jass]//先把所有被动技能放进一本魔法书内(A001) ,并且将所以技能设定默认等级下不起作用,在地图初始化时运行该函数
function Init takes unit u returns nothing
call UnitAddAbility(u,A001)//给单位添加
call UnitMakeAbilityPermanent (u,ture,AOO1)
call SetPlayerAbilityAvailable(GetOwningPlayer(u),A001,false)
endfunction
//主要函数,修改被动技能等级,使其生效
function AddBonus takes unit u, integer whichability ,integer abilitylevel returns nothing
call SetUnitAbilityLevel(u,whichability,abilitylevel)
endfunction
//移除被动技能效果
function RemoveBonus takes unit u, integer whichability returns nothing
call SetUnitAbilityLevel(u,whichability,0)
endfunction |
|