function Trig_Test_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'Your Ability Id'
endfunction
function Trig_Test_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local real r=GetUnitFacing(u)*3.14159/180.
call clsParticleCreate(u)
call MakeUnitFlyable(u)
call GroupAddUnit(udg_particleGroup, u)
call ParticleSetSpeed(u,Cos(r)*500,Sin(r)*500,2000)
function GroundHit_BounceJump takes nothing returns nothing
local unit u = GetEnumUnit()
local integer i = GetUnitUserData(u)
local integer p = udg_clsParticlePlace[i]
local integer v = udg_clsParticleSpeed[i]
local integer vector1 = VectorGetTerrainNormal(udg_vectorX, udg_vectorY, 25.0)
local integer vector2 = VectorProjectVector(v,vector1)
set udg_vectorX = udg_vectorX - udg_vectorX[v]*ParticlePeriod()
set udg_vectorY = udg_vectorY - udg_vectorY[v]*ParticlePeriod()
set udg_vectorZ = udg_vectorZ - udg_vectorZ[v]*ParticlePeriod()
if IsTerrainPathable(GetUnitX(u),GetUnitY(u), PATHING_TYPE_WALKABILITY) then
call PauseUnit(u,false)
call RemoveParticle(u,false)
endif
call VectorScale(vector2, -2)
call VectorAdd(v, vector2)
call VectorScale(v, 0.90)
call VectorDestroy(vector1)
call VectorDestroy(vector2)
set u = null
endfunction
call ParticleLinkConditionTrigger2Func(u, ParticleGroundHit(), "GroundHit_RemoveParticle")
call ParticleAddForce(u, Wind())
call ParticleAddForce(u, G())
call TriggerSleepAction(1)
call clsParticleDestroy(u)
call GroupRemoveUnit(udg_particleGroup, u)
set u = null
endfunction
//===========================================================================
function InitTrig_Test takes nothing returns nothing
set gg_trg_Test = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Test, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Test, Condition( function Trig_Test_Conditions ) )
call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction