推荐使用EverEdit编辑器war3map.j文件,装了jass插件后不仅可以语法高亮,还可以检查jass错误。
一、解除限制单人游戏
搜索关键触发语句:
(GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_EMPTY
找到有集中判断"玩家游戏状态"的代码段,按Ctrl+/全部注释掉就好。如下:
//function BGJ takes nothing returns boolean
//if not (StringCase(GetPlayerName(Player(0)),false)!=StringCase("rnwjdals",false)) then
//return false
//endif
//return true
//endfunction
//function BGK takes nothing returns boolean
//if not (GetPlayerSlotState(Player(0))==PLAYER_SLOT_STATE_PLAYING) then
//return false
//endif
//if not (GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(2))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(5))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(6))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(7))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//return true
//endfunction
//function BGL takes nothing returns boolean
//if not (GetPlayerSlotState(Player(0))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_PLAYING) then
//return false
//endif
//if not (GetPlayerSlotState(Player(2))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(5))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(6))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(7))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//return true
//endfunction
//function BGM takes nothing returns boolean
//if not (GetPlayerSlotState(Player(0))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(2))==PLAYER_SLOT_STATE_PLAYING) then
//return false
//endif
//if not (GetPlayerSlotState(Player(5))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(6))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(7))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//return true
//endfunction
//function BGN takes nothing returns boolean
//if not (GetPlayerSlotState(Player(0))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(2))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(5))==PLAYER_SLOT_STATE_PLAYING) then
//return false
//endif
//if not (GetPlayerSlotState(Player(6))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(7))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//return true
//endfunction
//function BGO takes nothing returns boolean
//if not (GetPlayerSlotState(Player(0))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(2))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(5))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(6))==PLAYER_SLOT_STATE_PLAYING) then
//return false
//endif
//if not (GetPlayerSlotState(Player(7))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//return true
//endfunction
//function BGP takes nothing returns boolean
//if not (GetPlayerSlotState(Player(0))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(1))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(2))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(5))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(6))==PLAYER_SLOT_STATE_EMPTY) then
//return false
//endif
//if not (GetPlayerSlotState(Player(7))==PLAYER_SLOT_STATE_PLAYING) then
//return false
//endif
//return true
//endfunction
//function BGQ takes nothing returns boolean
//if GetPlayerController(Player(0))==MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(1))==MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(2))==MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(3))!=MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(4))!=MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(5))==MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(6))==MAP_CONTROL_COMPUTER then
//return true
//endif
//if GetPlayerController(Player(7))==MAP_CONTROL_COMPUTER then
//return true
//endif
//if BGK() then
//return true
//endif
//if BGL() then
//return true
//endif
//if BGM() then
//return true
//endif
//if BGN() then
//return true
//endif
//if BGO() then
//return true
//endif
//if BGP() then
//return true
//endif
//return false
//endfunction
//function BGR takes nothing returns boolean
//if not BGQ() then
//return false
//endif
//return true
//endfunction
//function BGS takes nothing returns nothing
//call TriggerExecute(nm)
//if BGR() then
//call CustomDefeatBJ(Player(0),"Defeat!")
//call CustomDefeatBJ(Player(1),"Defeat!")
//call CustomDefeatBJ(Player(2),"Defeat!")
//call CustomDefeatBJ(Player(5),"Defeat!")
//call CustomDefeatBJ(Player(6),"Defeat!")
//call CustomDefeatBJ(Player(7),"Defeat!")
//else
//endif
//call DestroyTrigger(GetTriggeringTrigger())
//endfunction
//function BGT takes nothing returns nothing
//set nl=CreateTrigger()
//call TriggerAddCondition(nl,Condition(function BGJ))
//call TriggerAddAction(nl,function BGS)
//endfunction
统计下上面有多少关联函数(function ),与之有关的也要全部注释掉。从最后面看,首先是创建触发的函数:function BGT,然后是触发条件的函数:function BGJ,再然后是触发动作的函数:function BGS。
别忘记与之有关的调用函数也要干掉:
//call BGT()
二、解除限制单人存档
存档关键触发语句是-save,找到与之有关的触发。
首先把触发的条件注释掉就行。如下:
function BHL takes nothing returns nothing
set n3=CreateTrigger()
call TriggerRegisterPlayerChatEvent(n3,Player(0),"-save",false)
call TriggerRegisterPlayerChatEvent(n3,Player(1),"-save",false)
call TriggerRegisterPlayerChatEvent(n3,Player(2),"-save",false)
call TriggerRegisterPlayerChatEvent(n3,Player(5),"-save",false)
call TriggerRegisterPlayerChatEvent(n3,Player(6),"-save",false)
call TriggerRegisterPlayerChatEvent(n3,Player(7),"-save",false)
//call TriggerAddCondition(n3,Condition(function BHH))
call TriggerAddAction(n3,function BHK)
endfunction
然后把触发条件function BHH全部注释掉。
//function BHH takes nothing returns boolean
//if not (d4[GetConvertedPlayerId(GetTriggerPlayer())]==false) then
//return false
//endif
//if not (StringCase(SubStringBJ(GetEventPlayerChatString(),1,5),false)=="-save") then
//return false
//endif
//return true
//endfunction
最后检查触发动作function BHK里是否还有限制条件。如下明显有禁止单人存档的提示“Cannot save in single player mode.”。
//else
//if BHI() then
//call DisplayTimedTextToPlayer(GetTriggerPlayer(),0.,0.,.1,"|cffFF0202Error) |c00DFFB4FCannot save in single player mode.|r")
//else
//set d4[GetConvertedPlayerId(GetTriggerPlayer())]=true
//call BGC(GetTriggerPlayer(),GetEventPlayerChatString())
//endif
注意上面还有1个if BHI() then的条件语句,为了保险,我们……嘿嘿嘿嘿……一个不留
//function BHI takes nothing returns boolean
//if not (StringCase(GetPlayerName(GetTriggerPlayer()),false)!=StringCase(cv,false)) then
//return false
//endif
//return true
//endfunction
三、解除限制单人N次存档
搜索关键句子
call DestroyTrigger(gg_trg_Save)
当前版本是在以下动作里执行:function Trig_MESSAGE_3_Actions takes nothing returns nothing
所以把所有具体的动作都删了,如下:
if ( Trig_MESSAGE_3_Func002C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
if ( Trig_MESSAGE_3_Func003C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
if ( Trig_MESSAGE_3_Func004C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
if ( Trig_MESSAGE_3_Func005C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
if ( Trig_MESSAGE_3_Func006C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
if ( Trig_MESSAGE_3_Func007C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
if ( Trig_MESSAGE_3_Func008C() ) then
call DestroyTrigger(gg_trg_Save)
else
endif
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_MESSAGE_3_Func009Func001C() ) then
call CustomDefeatBJ(ConvertedPlayer(GetForLoopIndexA()), " ")
else
endif
set bj_forLoopAIndex=bj_forLoopAIndex + 1
endloop
我删了以后,写了一句:call DoNothing( )
,告诉程序不执行任何动作。
大功告成!愉快的玩耍吧!