|
发表于 2012-6-14 05:42:04
|
显示全部楼层
先教你方法吧……
打开脚本后,ctrl+F搜索"-AR"(完全匹配),由于是玩家输入,所以找到的那段函数肯定是初始化触发器函数
然后看那段函数里的AddCondition和AddAction函数里的参数,用搜索去找对应的函数,当然一般不用搜索,初始化函数的上面就是条件和动作
如果条件函数和动作函数里出现了调用别的函数的情况,那么再去找对应的函数
话说这段J是从T做的地图里直接导出来的吧……到处都是可读性极差的T向函数名。。
另外输出文字也是T转J后的乱码……
[jass]function Trig_AR_Func005Func001Func004Func002A takes nothing returns nothing
call SetPlayerTechMaxAllowedSwap(udg_Hero[udg_ARshu[2]],0,GetEnumPlayer())
endfunction[/jass]
[jass]function Trig_AR_Func005Func001Func004Func004A takes nothing returns nothing
call SetPlayerTechMaxAllowedSwap(udg_Hero[udg_ARshu[2]],0,GetEnumPlayer())
endfunction[/jass]
[jass]function Trig_AR_Func005Func001Func004C takes nothing returns boolean
if(not(GetForLoopIndexA()<6))then
return false
endif
return true
endfunction[/jass]
[jass]function Trig_AR_Func005Func001C takes nothing returns boolean
if(not(GetPlayerSlotState(ConvertedPlayer(GetForLoopIndexA()))==PLAYER_SLOT_STATE_PLAYING))then
return false
endif
if(not(GetForLoopIndexA()!=6))then
return false
endif
return true
endfunction[/jass]
[jass]function Trig_AR_Actions takes nothing returns nothing
call DestroyTrigger(gg_trg_RD)
call DestroyTrigger(gg_trg_ld)
call DisplayTimedTextToForce(GetPlayersByMapControl(MAP_CONTROL_USER),5.00,"|cFFFF0000这里的字是乱码,发不上论坛,所以替换之")
set udg_ARshu[1]=64
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=11
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Trig_AR_Func005Func001C())then
set udg_ARshu[2]=GetRandomInt(1,udg_ARshu[1])
if(Trig_AR_Func005Func001Func004C())then
call CreateNUnitsAtLoc(1,udg_Hero[udg_ARshu[2]],ConvertedPlayer(GetForLoopIndexA()),GetRectCenter(gg_rct_herostart01),bj_UNIT_FACING)
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function Trig_AR_Func005Func001Func004Func004A)
else
call CreateNUnitsAtLoc(1,udg_Hero[udg_ARshu[2]],ConvertedPlayer(GetForLoopIndexA()),GetRectCenter(gg_rct_herostart02),bj_UNIT_FACING)
call ForForce(GetPlayersByMapControl(MAP_CONTROL_USER),function Trig_AR_Func005Func001Func004Func002A)
endif
set udg_Heroar[1]=udg_Hero[udg_ARshu[1]]
set udg_Hero[udg_ARshu[2]]=udg_Hero[udg_ARshu[1]]
set udg_Hero[udg_ARshu[1]]=udg_Hero[udg_ARshu[2]]
set udg_ARshu[1]=(udg_ARshu[1]-1)
else
call DoNothing()
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call DestroyTrigger(GetTriggeringTrigger())
endfunction[/jass]
[jass]function InitTrig_AR takes nothing returns nothing
set gg_trg_AR=CreateTrigger()
call TriggerRegisterPlayerChatEvent(gg_trg_AR,Player(0),"-AR",true)
call TriggerRegisterPlayerChatEvent(gg_trg_AR,Player(6),"-AR",true)
call TriggerAddAction(gg_trg_AR,function Trig_AR_Actions)
endfunction[/jass] |
|