RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

New information regarding packets 0x54 and 0x7B

Folko

Sorceror
Hello,

I recently tried to create a music instrument that allows you to play custom melodies using the sound effects for single notes (e.g. 0x400). It works quite well, but the client refuses to play a sound if it's already playing. I did some reverse engineering in the client to figure out if there is any way around this and found some information regarding the packets 0x54 and 0x7B that are wrong in all packet guides I've found:

0x54 has the following format, verified from client 1.25 to 7.0.21:
BYTE 0x54 (packet id)
BYTE ambient (if 0: sound is played as ambient sound - more quiet and repeating, used for background music in ancient days. otherwise: play normally. This is *not* a flag field but a boolean. I checked the name of the field - 'ambient' is used in the debug version of the clients)
WORD sfxID
WORD unused (this word is unused even in the oldest clients I found)
WORD X
WORD Y
WORD unknown (this is *not* Z and has never been. It's ignored if not in sequence mode, see below)

0x7B is used to start a so-called sequence: a number of effects that can be sent to the client which will then be played in order without timing issues, also present since 1.25 or maybe even before:
BYTE 0x7B
BYTE loopCount: 0 starts a sequence, end the sequence with a value > 0 that's used as repeat count

So to create a nice sequence of effects, send 7B 00 and then any of the following packets in any amount and order: 0x70, 0x6E, 0x54, 0xC7, 0xC0. End the sequence by sending 7B nn where nn is the number of times you want the sequence to play.

Important: Make sure the sequences do not overlap, i.e. it's best to send the whole sequence 7B 00 ... 7B nn at once.

The sequence packet can be used to make sure a sound plays after an animation is done instead of approximating the animation time on the server side and then sending a sound packet.

I have yet to figure out what the unknown WORD in 0x54 does. Since it's only evaluated when 0x54 is sent in a sequence, I guess it's related to something with the sequence.

Regards

Folko
 
Top