|
楼主 |
发表于 2008-3-21 12:45:24
|
显示全部楼层
关键就是您说的那个计时器变量连local都还没local呢````最困扰我的地方恰恰就在这里`
[codes=jass]function lightscreen takes nothing returns nothing
local unit I2Uunit=I2U(GetStoredInteger(udg_GC,I2S(H2I(GetExpiredTimer)), "lightscreenMY"))
call UnitRemoveAbility( I2Uunit, 'A02X' )
endfunction
function Trig_lightscreen_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A02V' ) ) then
return false
endif
return true
endfunction
function SkillTimer takes nothing returns nothing
local timer skilltimer=CreateTimer()
call TimerStart(skilltimer, 30, false, function lightscreen)
set skilltimer=null
endfunction
function Trig_lightscreen_Actions takes nothing returns nothing
call StoreInteger(udg_GC,I2S(H2I(skilltimer)), "lightscreenMY", H2I(GetTriggerUnit()) )
call UnitAddAbility( GetTriggerUnit(), 'A02X' )
call SetPlayerAbilityAvailableBJ( false, 'A02X', GetTriggerPlayer() )
call SkillTimer()
endfunction
//===========================================================================
function InitTrig_lightscreen takes nothing returns nothing
local trigger Initlightscreen = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( Initlightscreen, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( Initlightscreen, Condition( function Trig_lightscreen_Conditions ) )
call TriggerAddAction( Initlightscreen, function Trig_lightscreen_Actions )
endfunction
[/codes]
还是把问题jass发上来吧````这样我也好理解一点- -`` |
|