|
[codes=jass]function Trig_JumpSpell_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'Afla' ) ) then
return false
endif
return true
endfunction
function Trig_JumpSpell_Actions takes nothing returns nothing
call DCJS_JumpSpeed( GetTriggerUnit(), GetNearestPathableLoc( GetSpellTargetLoc() ), DistanceBetweenPoints(GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc()) / 2, GetUnitMoveSpeed( GetTriggerUnit() ) )
if IsLocPathable( GetSpellTargetLoc() ) == false then
endif
call SetUnitFacingToFaceLocTimed( GetTriggerUnit(), GetSpellTargetLoc(), 0.50 )
call SetUnitAnimationByIndex( GetTriggerUnit(), 6 )
call SetUnitTimeScalePercent( GetTriggerUnit(), 50.00 )
call PolledWait( ( DistanceBetweenPoints(GetUnitLoc(GetTriggerUnit()), GetSpellTargetLoc()) / GetUnitMoveSpeed(GetTriggerUnit()) ) )
call ResetUnitAnimation( GetTriggerUnit() )
call SetUnitTimeScalePercent( GetTriggerUnit(), 100.00 )
endfunction
//===========================================================================
function InitTrig_JumpSpell takes nothing returns nothing
set gg_trg_JumpSpell = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_JumpSpell, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_JumpSpell, Condition( function Trig_JumpSpell_Conditions ) )
call TriggerAddAction( gg_trg_JumpSpell, function Trig_JumpSpell_Actions )
endfunction[/codes] |
|