- Joined
- Dec 18, 2004
- Messages
- 148
How do i add a collision to take place from this code?
Code:
function Trig_sec_Func001Func011001 takes nothing returns boolean
return ( GetSpellAbilityId() == 'A000' )
endfunction
function Trig_sec_Func001Func011002 takes nothing returns boolean
return ( GetOwningPlayer(GetSpellAbilityUnit()) == Player(0) )
endfunction
function Trig_sec_Func001C takes nothing returns boolean
if ( not GetBooleanAnd( Trig_sec_Func001Func011001(), Trig_sec_Func001Func011002() ) ) then
return false
endif
return true
endfunction
function Trig_sec_Actions takes nothing returns nothing
if ( Trig_sec_Func001C() ) then
call CreateNUnitsAtLoc( 1, 'h001', Player(0), PolarProjectionBJ(GetUnitLoc(udg_unit), 100.00, ( GetUnitFacing(udg_unit) + 30.00 )), GetUnitFacing(udg_unit) )
set udg_missile = GetLastCreatedUnit()
call AddSpecialEffectTargetUnitBJ( "origin", udg_missile, "Abilities\\Weapons\\SkeletalMageMissile\\SkeletalMageMissile.mdl" )
call SetUnitFlyHeightBJ( udg_missile, ( GetUnitFlyHeight(udg_unit) + 35.00 ), 0.00 )
call Move_Missile( udg_unit, udg_missile, 0, 2000 + (udg_velocity / .02), 0, 1 )
call CreateNUnitsAtLoc( 1, 'h001', Player(0), PolarProjectionBJ(GetUnitLoc(udg_unit), 100.00, ( GetUnitFacing(udg_unit) - 30.00 )), GetUnitFacing(udg_unit) )
set udg_missile = GetLastCreatedUnit()
call AddSpecialEffectTargetUnitBJ( "origin", udg_missile, "Abilities\\Weapons\\SkeletalMageMissile\\SkeletalMageMissile.mdl" )
call SetUnitFlyHeightBJ( udg_missile, ( GetUnitFlyHeight(udg_unit) + 35.00 ), 0.00 )
call Move_Missile( udg_unit, udg_missile, 0, 2500, 0, 1 )
else
endif
endfunction
//===========================================================================
function InitTrig_sec takes nothing returns nothing
set gg_trg_sec = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_sec, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddAction( gg_trg_sec, function Trig_sec_Actions )
endfunction