|
以下东西关于复活,还没做动作,由于不会写,所以厚面皮的发上来了.我想问问,我有编写错误吗?
[codes=jass]function H2I takes handle h returns integer
return h
return 174
endfunction
function I2T takes integer i returns timer
return i
return null
endfunction
function i2td takes integer i returns timerdialog
return i
return null
endfunction
function I2U takes integer i returns unit
return i
return null
endfunction
function LocalVars takes nothing returns gamecache
if udg_Cache==null then
call FlushGameCache(InitGameCache("lzf"))
set udg_Cache=InitGameCache("lzf")
endif
return udg_Cache
endfunction
function SetHandleInt takes handle h,string s,integer i returns nothing
if i==0 then
call FlushStoredInteger(LocalVars(),I2S(H2I(h)),s)
else
call StoreInteger(LocalVars(),I2S(H2I(h)),s,i)
endif
endfunction
function SetHandleReal takes handle h, string s,real r returns nothing
if r==0 then
call FlushStoredReal(LocalVars(),I2S(H2I(h)),s)
else
call StoreReal(LocalVars(),I2S(H2I(h)),s,r)
endif
endfunction
function GetHandleInt takes handle h ,string s returns integer
return GetStoredInteger(LocalVars(),I2S(H2I(h)),s)
endfunction
function GetHandleReal takes handle h,string s returns real
return GetStoredReal(LocalVars(),I2S(H2I(h)),s)
endfunction
function FlushHandleLocals takes handle h returns nothing
call FlushStoredMission(LocalVars(),I2S(H2I(h)))
endfunction
function pd takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function fuhuo takes nothing returns nothing
//此处写复活内容(还没编写)
//===========================================================================
function InitTrig_qwe takes nothing returns nothing
local integer t=H2I(CreateTrigger())
call TriggerRegisterAnyUnitEventBJ(I2TR(t),EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition(I2TR(t),Condition(function pd))
call TriggerAddAction(I2TR(t), function fuhuo )
endfunction[/codes]
//关于缓存那里是抄的.因为不懂,是因为call后面的东东实在不清楚是什么意思,又不知道去哪里找解释. |
评分
-
查看全部评分
|