function VictorySoundA takes nothing returns nothing
if GetUnitTypeId(GetDyingUnit()) == 'etol' then
set VictorySound=CreateSound("Sound\\Announcer\\announcer_victory_dire.mp3",false,false,false,10,10,"HeroAcksEAX")
call SetSoundDuration(VictorySound,5)
call SetSoundParamsFromLabel(VictorySound,"Victory")
call SetSoundVolume(VictorySound,150)
call PlaySoundBJ(VictorySound)
set VictoryMusic=CreateSound("Sound\\Announcer\\dire_win.mp3",false,false,false,10,10,"HeroAcksEAX")
call SetSoundDuration(Victorymusic,5)
call SetSoundParamsFromLabel(Victorymusic,"Victory")
call SetSoundVolume(Victorymusic,150)
call PlaySoundBJ(VictoryMusic)
endif
if GetUnitTypeId(GetDyingUnit()) == 'unpl' then
set VictorySound=CreateSound("Sound\\Announcer\\announcer_victory_rad.mp3",false,false,false,10,10,"HeroAcksEAX")
call SetSoundDuration(VictorySound,5)
call SetSoundParamsFromLabel(VictorySound,"Victory")
call SetSoundVolume(VictorySound,150)
call PlaySoundBJ(VictorySound)
set VictoryMusic=CreateSound("Sound\\Announcer\\radiant_win.mp3",false,false,false,10,10,"HeroAcksEAX")
call SetSoundDuration(Victorymusic,5)
call SetSoundParamsFromLabel(Victorymusic,"Victory")
call SetSoundVolume(Victorymusic,150)
call PlaySoundBJ(VictoryMusic)
endif
endfunction
function VictorySound takes nothing returns nothing
local trigger victory
set victory = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( victory, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( victory, function VictorySoundA)
endfunction