|
在地图中添加了一段可以A小兵不能打己方英雄的j,然后保存的时候jasshelper显示Too
many arguement given to function:GetUnitLifePercent
代码:
function Trig_Prevent_Team_KillActions takes nothing returns nothing
if ((IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetTriggerUnit())) == true) and (GetUnitLifePercent(whichUnit, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) > 41.00)) then
call IssueTargetOrder( GetAttacker(), "move", GetTriggerUnit() )
else
if ((IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetTriggerUnit())) == true) and (IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) != true) and (GetUnitLifePercent(whichUnit, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) <= 40.00)) then
call IssueTargetOrder( GetAttacker(), "attack", GetTriggerUnit() )
else
endif
endif
endfunction
//===========================================================================
function InitTrig_Prevent_Team_Kill takes nothing returns nothing
set gg_trg_Prevent_Team_Kill = CreateTrigger()
call YDWESaveTriggerName(gg_trg_Prevent_Team_Kill, "Prevent Team Kill")
call TriggerRegisterAnyUnitEventBJ( gg_trg_Prevent_Team_Kill, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction(gg_trg_Prevent_Team_Kill, function Trig_Prevent_Team_KillActions)
endfunction
主要是这段 if ((IsPlayerAlly(GetOwningPlayer(GetAttacker()), GetOwningPlayer(GetTriggerUnit())) == true) and (GetUnitLifePercent(whichUnit, UNIT_STATE_LIFE, UNIT_STATE_MAX_LIFE) > 41.00)) then
求解 |
|