ServUO Version
Publish 57
Ultima Expansion
Time Of Legends
Title says it all. I'd like to play the recall sound when an evil NPC spawns. Tried dropping the line


C#:
this.PlaySound(0x1FC);

at the end of the constructor. Script compiles but no sound.
 
Solution
Toss it in the BaseVendor add a region change it will fire the sound change
Basevendor:
public override void OnRegionChange(Region Old, Region New)
        {
            base.OnRegionChange(Old, New);
            PlaySound(0x1FC);
        }
Toss it in the BaseVendor add a region change it will fire the sound change
Basevendor:
public override void OnRegionChange(Region Old, Region New)
        {
            base.OnRegionChange(Old, New);
            PlaySound(0x1FC);
        }
 
Solution
I'm sure the mobile heard it! That was a bad joke but in a way it also outlines the issue, <this> is a keyword referring to that mobile, so basically you told the server to play sound for the mobile, nothing there to send sound to a player. You'll need to override the onafterspawn iirc, then do a check for players in area and if any, send them each the sound!
 
Back