function Trig_On_Attacks_Actions takes nothing returns nothing
local unit a = GetAttacker()
local location p = GetUnitLoc(GetAttackedUnitBJ())
local location o = GetUnitLoc(a)
local integer ut = GetUnitTypeId(a)
local integer bd = UT_GetAttachedInt(ut,"BaseDamage")
local integer nd = UT_GetAttachedInt(ut,"NumDice")
local integer ds = UT_GetAttachedInt(ut,"DiceSides")
local string pa = UT_GetAttachedString(ut,"ProjectileArt")
local real ps = UT_GetAttachedReal(ut,"ProjectileSpeed")
local unit m = CreateUnitAtLoc( GetOwningPlayer(a),'e000',o, 0 )
local effect fx = AddSpecialEffectTarget("Abilities\\Weapons\\SerpentWardMissile\\SerpentWardMissile.mdl", m, "origin" )
local timer t = CreateTimer()
local integer i = 1
call SetUnitMoveSpeed(m, ps)
call SetUnitPathing(m, false)
call IssuePointOrder(m,"move",GetLocationX(p), GetLocationY(p))
loop
exitwhen i>nd
set bd = bd + GetRandomInt(1,ds)
set i = i + 1
endloop
call AttachInt(m, "Damage",bd)
call AttachObject(m,"Effect",fx)
call AttachObject(m,"Attacker",a)
call AttachObject(t,"Unit",m)
call AttachInt(t,"StepsRemaining",40)
call TimerStart (t, .05, true, function CollisionCheck)
endfunction