|
发表于 2008-11-27 04:11:26
|
显示全部楼层
[codes=jass]function SetPlayerAllianceStateBJ takes player sourcePlayer, player otherPlayer, integer allianceState returns nothing
// Prevent players from attempting to ally with themselves.
if (sourcePlayer == otherPlayer) then
return
endif
if allianceState == bj_ALLIANCE_UNALLIED then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
elseif allianceState == bj_ALLIANCE_UNALLIED_VISION then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
elseif allianceState == bj_ALLIANCE_ALLIED then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
elseif allianceState == bj_ALLIANCE_ALLIED_VISION then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
elseif allianceState == bj_ALLIANCE_ALLIED_UNITS then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
elseif allianceState == bj_ALLIANCE_ALLIED_ADVUNITS then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, true )
elseif allianceState == bj_ALLIANCE_NEUTRAL then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAlliance( sourcePlayer, otherPlayer, ALLIANCE_PASSIVE, true )
elseif allianceState == bj_ALLIANCE_NEUTRAL_VISION then
call SetPlayerAllianceStateAllyBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateVisionBJ( sourcePlayer, otherPlayer, true )
call SetPlayerAllianceStateControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
call SetPlayerAlliance( sourcePlayer, otherPlayer, ALLIANCE_PASSIVE, true )
else
// Unrecognized alliance state - ignore the request.
endif
endfunction[/codes]
可以参考下BJ的函数
当然直接用CJ比较快啦 |
|