Welcome to the Hive!
You might have better luck posting in the World Editor Help Zone next time (usually the "Requests" forum is for resource requests):
Ask general questions about World Editor features and use in this forum. If you need help fixing a trigger, please post it in Triggers & Scripts. Please review the forum rules before posting.
www.hiveworkshop.com
The reason it is playing two sounds with your current logic is because it first tries to play "Vereesa_What1", and then because the unit you're selecting is a hero (so it passes your "If - Condition", instead of "Skipping the remaining actions"), it'll continue with the rest of the code and play "Vereesa_What2".
It looks like you're roughly trying to use that integer variable to control which sound to play. For something like that,
arrays are perfect. They're basically a special type of variable that can hold many values, each at a particular
index (a number). So first, I'd recommend creating a sound array variable, e.g. VereesaSounds:
Then create a trigger with the event "Map Initialization" (so it runs just before the map starts) to set up the variable with values:
-
Sound Init
-

Events
-

Conditions
-

Actions
-


Set VariableSet VereesaSounds[1] = Vereesa_What1 <gen>
-


Set VariableSet VereesaSounds[2] = Vereesa_What2 <gen>
-


Set VariableSet VereesaSounds[3] = Vereesa_What3 <gen>
Finally, you can update your trigger to play a random sound by simply using "Sound - Play Sound", choosing that variable, and then using "Math - Random" to select a random index between 1 and 3:
-
RandomClickHero1
-

Events
-


Player - Player 1 (Red) Selects a unit
-

Conditions
-


(Unit-type of (Triggering unit)) Equal to bolapi
-

Actions
-


Sound - Play VereesaSounds[(Random integer number between 1 and 3)]
I'll attach the map below (but I'm using the latest patch, so it may not open for you if you're running on an older patch).
However, for custom sound-sets, it's usually recommended to
replace an existing sound set and use that instead. That way you get all the default wc3 sound behavior for free (e.g. selection sounds, "yes" sounds, attack sounds, etc.). To do that:
- Open the sound editor
- Find a sound-set that you're unlikely to use, e.g. "Units/Human/KnightNoRider" or "Units/Naga/NagaMyrmidon". You'll usually want to use one that has a similar number of sounds as you have.
- Right-click a sound, e.g. KnightNoRiderWhat1.flac, and replace it with your sound (e.g. Vereesa_What1.wav). You'll need to select it from your hard drive. If it gives you an error saying that file already exists, then I recommend deleting the sound from the import manager and then going back to the sound editor to try again.
- Once you've replaced the sound, double-click the sound (or right-click -> play) to make sure it plays the sound you expect.
- Once you're done replacing all the sounds, go to the unit in the object editor and update its sound set to the one you replaced, e.g. KnightNoRider.
Usually that is the recommended route over using triggers. With triggers, it is hard to get it to behave exactly like the native wc3 set-up for all those weird edge cases (e.g. when a unit is selected as part of a group but isn't the "primary" selection, it shouldn't play the sound).