|
发表于 2007-11-17 17:07:28
|
显示全部楼层
吐血了,原来只要把"Agho"改成'Agho'
再改下function OrderSystem takes unit u,string open,string close,integer skill returns nothing
就ok了,我居然舍本逐末,找AbilityId的麻烦。。。。。
齐活
[codes=jass]function H2I takes handle h returns integer
return h
return 0
endfunction
//************************************
function OrderOpen takes nothing returns boolean
local unit u =GetTriggerUnit()
local string ts=GetStoredString(udg_GC,I2S(H2I(u)),"orderopen")
return (GetIssuedOrderId() == String2OrderIdBJ(ts) )
endfunction
function OrderClose takes nothing returns boolean
local unit u =GetTriggerUnit()
local string ts=GetStoredString(udg_GC,I2S(H2I(u)),"orderclose")
return (GetIssuedOrderId() == String2OrderIdBJ(ts) )
endfunction
function AddInvisible takes nothing returns nothing
local unit u =GetTriggerUnit()
local integer skill=GetStoredInteger(udg_GC,I2S(H2I(u)),"AddAbility")
call UnitAddAbility(GetTriggerUnit(),skill)
endfunction
function RemoveInvisible takes nothing returns nothing
local unit u =GetTriggerUnit()
local integer skill=GetStoredInteger(udg_GC,I2S(H2I(u)),"AddAbility")
call UnitRemoveAbility(GetTriggerUnit(),skill)
endfunction
function InvisibleAll takes unit u returns nothing
local trigger trg
local trigger trg1
local trigger trg2
local trigger trg3
//begin
set trg=CreateTrigger()
call TriggerRegisterUnitEvent( trg,u, EVENT_UNIT_ISSUED_ORDER )
call TriggerAddCondition( trg, Condition( function OrderOpen ) )
call TriggerAddAction( trg, function AddInvisible )
//over1
set trg1=CreateTrigger()
call TriggerRegisterUnitEvent( trg1,u,EVENT_UNIT_ISSUED_ORDER )
call TriggerAddCondition( trg1, Condition( function OrderClose ) )
call TriggerAddAction( trg1, function RemoveInvisible )
set trg2=CreateTrigger()
call TriggerRegisterUnitManaEvent(trg2, u, LESS_THAN, 10.00 )
call TriggerAddAction( trg2, function RemoveInvisible )
//over3
set trg3=CreateTrigger()
call TriggerRegisterUnitEvent( trg3,u, EVENT_UNIT_DEATH )
call TriggerAddAction( trg3, function RemoveInvisible )
set trg=null
set trg1=null
set trg2=null
set trg3=null
endfunction
//****************************************
function OrderSystem takes unit u,string open,string close,integer skill returns nothing
call StoreString(udg_GC, I2S(H2I(u)), "orderopen",open)
call StoreString(udg_GC, I2S(H2I(u)), "orderclose",close)
call StoreInteger(udg_GC, I2S(H2I(u)), "AddAbility",skill)
call InvisibleAll(u)
endfunction[/codes]
[trigger]j
事件
时间 - 游戏开始 0.00 秒
条件
动作
游戏 - 对 玩家1(红色) 在屏幕位移(0.00,0.00)处显示文本: 开始设置…… ...
设置 hero = 恶魔猎手 0000 <预设>
自定义代码: call OrderSystem(udg_hero,"immolation","unimmolation",'Agho')
自定义代码: call OrderSystem(udg_hero,"defend","undefend",'ACev')
自定义代码: call OrderSystem(udg_hero,"bearform","unbearform ",'ANb2')
自定义代码: call OrderSystem(udg_hero,"robogoblin","unrobogoblin ",'ACct')
[/trigger]
不过四个代码只能设置一个有效。。。还待改进啊 |
|