- Joined
- Feb 11, 2011
- Messages
- 1,860
Hi,
I based a lightning spell off the Channel spell. I want to play the "LightningBolt.wav" sound when the spell is cast. The problem is that when I set the "Sound - Effect Sound" field of the spell to the desired sound, it doesn't play. I figured that I would have to trigger the sound. Here is what I have so far:
Am I missing an important function?
Thanks for your help.
I based a lightning spell off the Channel spell. I want to play the "LightningBolt.wav" sound when the spell is cast. The problem is that when I set the "Sound - Effect Sound" field of the spell to the desired sound, it doesn't play. I figured that I would have to trigger the sound. Here is what I have so far:
JASS:
local sound snd = CreateSound("Abilities\\Spells\\Orc\\LightningBolt\\LightningBolt.wav", false, true, true, 12700, 12700, "")
call StartSound(snd)
call SetSoundPlayPosition(snd, 3)
call SetSoundPosition(snd, GetUnitX(.caster), GetUnitY(.caster), 0)
call SetSoundChannel(snd, 11)
call SetSoundDistanceCutoff(snd, 3000)
call SetSoundVolume(snd, 122)
call KillSoundWhenDone(snd)
set snd = null
Thanks for your help.