function Trig_EffectSound_Conditions takes nothing returns boolean
if ( not ( GetUnitTypeId(GetAttacker()) == 'O002' ) ) then
return false
endif
return true
endfunction
function trg_rifleeffects takes nothing returns nothing
local sound VV
local unit pe
local effect e
set VV=CreateSound("Shot1.mp3",false,true,false,10,10,"DefaultEAXON")
call SetSoundDuration(VV,713)
call SetSoundChannel(VV,0)
call SetSoundVolume(VV,225)
call SetSoundPitch(VV,1.)
call SetSoundDistances(VV,600.,10000.)
call SetSoundDistanceCutoff(VV,3000.)
call SetSoundConeAngles(VV,.0,.0,127)
call SetSoundConeOrientation(VV,.0,.0,.0)
call PlaySoundBJ( VV )
set pe=GetAttacker()
call AddSpecialEffectTargetUnitBJ("weapon",pe,"Konstrukt_AssaultRifleEffektAttachment.MDX")
set e=bj_lastCreatedEffect
call DestroyEffectBJ(e)
endfunction
//===========================================================================
function InitTrig_EffectSound takes nothing returns nothing
set gg_trg_EffectSound = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_EffectSound, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_EffectSound, Condition( function Trig_EffectSound_Conditions ) )
call TriggerAddAction( gg_trg_EffectSound, function trg_rifleeffects)
endfunction