|
楼主 |
发表于 2009-9-2 17:48:51
|
显示全部楼层
[jass]
function Trig_gamecache_TimerFunc takes nothing returns nothing
local integer n = GetStoredInteger(udg_GC, I2S(h2i(GetExpiredTimer())), "N")
local unit u = i2u(GetStoredInteger(udg_GC, I2S(h2i(GetExpiredTimer())), "Caster"))
local real distance = GetStoredReal(udg_GC, I2S(h2i(GetExpiredTimer())), "distance")
local real angle = GetStoredReal(udg_GC, I2S(h2i(GetExpiredTimer())), "angle")
local location p1 = GetUnitLoc(u)
local location p2
set p2 = PolarProjectionBJ(p1, distance, angle)
call SetUnitPositionLocFacingBJ( u, p2, angle )
set n = n - 1
call StoreInteger(udg_GC, I2S(h2i(bj_lastStartedTimer)), "N", n)
call RemoveLocation(p1)
call RemoveLocation(p2)
if n <= 0 then
call FlushStoredMission(udg_GC, I2S(h2i(GetExpiredTimer())))
call DestroyTimer(GetExpiredTimer())
endif
endfunction
function Trig_jump_1_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function Trig_jump_1_Actions takes nothing returns nothing
local location p1 = GetUnitLoc(GetTriggerUnit())
local location p2 = GetSpellTargetLoc()
local real distance = ((DistanceBetweenPoints(p1, p2))/60.00)
local real angle = AngleBetweenPoints(p1, p2)
local integer n = 50
if not HaveStoredInteger(udg_GC, I2S(h2i(GetTriggerUnit())), "JumpTimer") then
set bj_lastStartedTimer = CreateTimer()
call StoreInteger(udg_GC, I2S(h2i(GetTriggerUnit())), "JumpTimer", h2i(bj_lastStartedTimer))
call StoreInteger(udg_GC, I2S(h2i(bj_lastStartedTimer)), "Caster", h2i(GetTriggerUnit()))
call StoreInteger(udg_GC, I2S(h2i(bj_lastStartedTimer)), "N", n)
call StoreReal(udg_GC, I2S(h2i(bj_lastStartedTimer)), "distance", distance)
call StoreReal(udg_GC, I2S(h2i(bj_lastStartedTimer)), "angle", angle)
call TimerStart(bj_lastStartedTimer,0.01,true, function Trig_gamecache_TimerFunc)
endif
endfunction
//===========================================================================
function InitTrig_jump_1 takes nothing returns nothing
set gg_trg_jump_1 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_jump_1, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_jump_1, Condition( function Trig_jump_1_Conditions ) )
call TriggerAddAction( gg_trg_jump_1, function Trig_jump_1_Actions )
endfunction
[/jass]
还是那段代码,为啥只有第一次有效,后面再次释放技能就无效呢? |
|