![]() |
Crossfire Server, Trunk
1.75.0
|
This document describes the sound support for Crossfire, and how the client should handle the commands it receives.
Sound support is activated by issuing a 'setup sound2 x' command, with x a combination of:
When sound is activated, the server will send 'sound2' commands to client.
The format of the command is: sound2 <x><y><dir><volume><type><len of action>action<len of name>name
with
Using the type, action and name, the client can determine what sound to play:
If no sound can be found in 'name', client should search in the base directory.
This enables to override sounds for specific monsters or races.
'type' can be:
Each type will have an associated subdirectory, in which will be the sound files.
Examples: (<x> indicates a byte of value x)
sound2 <3><2><5><40><1><8>fireball<4>wand Something cast (<1>) a spell from a 'wand', at position (3,2) relative to the player, in direction south (<5>). The spell is a 'fireball'. Client will first look for a 'cast/wand/fireball' file. If not found, it will look for 'cast/fireball'.
sound2 <0><0><0><80><2><5>apply<17>potion player applies a potion of something. Client should first look for 'item/apply/potion', then 'item/apply'.
For living sounds, the 'action' will be things like 'move', 'death', ...
For spell casting, 'action' will be the spell name. This enables to have spell-specific sounds.
For item sounds, 'action' will be things like 'apply', 'burn' and such.
Ground sounds will have actions like 'hole open', 'trap spring' and such.
For 'hit' and 'hit by' types, the 'action' will be the skill name used to attack.
Name will be the base name of the emitter, so 'wand', 'mouse', 'door'.
For players, it will be the player's race.
Objects have a 'sound_chance' field, 0 to 100, that is the probability of sending a sound.
The volume will be randomly determined at each sound for more variability.
Players receive a maximum of MAX_SOUNDS_TICK sounds per tick, to not send too many.
Server doesn't really care of the actions, that are arbitrary.
Please update this section as you add sounds.
living:
spell:
item:
ground
hit something:
hit by something: