- Joined
- Jun 8, 2007
- Messages
- 97
JASS:
function Trig_Sounds takes item, (GetItemTypeId(GetManipulatedItem())) returns nothing
if (GetItemTypeId(GetManipulatedItem())) == 'I009' then
call StopMusic( false )
call PlaySound( "gg_snd_Poppin_Drums_1" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00E' then
call StopMusic( false )
call PlaySound( "gg_snd_Poppin_Drums_2" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I008' then
call StopMusic( false )
call PlaySound( "gg_snd_Poppin_Drums_3" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00F' then
call StopMusic( false )
call PlaySound( "gg_snd_Poppin_Drums_4" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I004' then
call StopMusic( false )
call PlaySound( "gg_snd_Rockin'_Drums_1" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00G' then
call StopMusic( false )
call PlaySound( "gg_snd_Rockin'_Drums_2" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00D' then
call StopMusic( false )
call PlaySound( "gg_snd_Rockin'_Drums_3" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00C' then
call StopMusic( false )
call PlaySound( "gg_snd_Rockin'_Drums_4" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I000' then
call StopMusic( false )
call PlaySound( "gg_snd_Funky_Drums_1" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I001' then
call StopMusic( false )
call PlaySound( "gg_snd_Funky_Drums_2" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I002' then
call StopMusic( false )
call PlaySound( "gg_snd_Funky_Drums_3" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I003' then
call StopMusic( false )
call PlaySound( "gg_snd_Funky_Drums_4" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I007' then
call StopMusic( false )
call PlaySound( "gg_snd_Latino_Drums_1" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00A' then
call StopMusic( false )
call PlaySound( "gg_snd_Latino_Drums_2" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I005' then
call StopMusic( false )
call PlaySound( "gg_snd_Latino_Drums_3" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I006' then
call StopMusic( false )
call PlaySound( "gg_snd_Latino_Drums_4" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
elseif (GetItemTypeId(GetManipulatedItem())) == 'I00B' then
call StopMusic( false )
call PlaySound( "gg_snd_Drum_Arrangement_1" )
call VolumeGroupSetVolume( SOUND_VOLUMEGROUP_MUSIC, 100 )
else
call DoNothing()
endif
endfunction
//===========================================================================
function InitTrig_Sounds takes nothing returns nothing
set gg_trg_Sounds = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Sounds, EVENT_PLAYER_UNIT_USE_ITEM )
call TriggerAddAction( gg_trg_Sounds, function Trig_Sounds )
endfunction
Did i use the trigger take thing correct?
WE gives errors for the first line, i want to fix that before anything else