Add mount idle fidget animations and ambient sounds

Implements WoW-style mount idle behavior when player is stationary:
- Fidget animations: discovered via property search (non-looping, 500-1500ms, stationary, IDs 1-10)
- Triggers random fidget every 6-12 seconds when standing still
- Ambient idle sounds: snorts/breaths for ground mounts, soft wing sounds for flyers
- Triggers random idle sound every 8-15 seconds when stationary
- Both systems reset timers on movement to avoid triggering while riding
This commit is contained in:
Kelsi 2026-02-10 19:53:23 -08:00
parent 4b9a2394d5
commit 8d8e780607
4 changed files with 74 additions and 1 deletions

View file

@ -302,6 +302,27 @@ void MountSoundManager::playLandSound() {
}
}
void MountSoundManager::playIdleSound() {
if (!mounted_ || moving_) return;
// Ambient idle sounds (snort, breath, soft neigh)
if (currentMountType_ == MountType::GROUND && !horseBreathSounds_.empty()) {
static std::mt19937 rng(std::random_device{}());
std::uniform_int_distribution<size_t> dist(0, horseBreathSounds_.size() - 1);
const auto& sample = horseBreathSounds_[dist(rng)];
if (!sample.data.empty()) {
AudioEngine::instance().playSound2D(sample.data, 0.3f * volumeScale_, 0.95f);
}
} else if (currentMountType_ == MountType::FLYING && !wingIdleSounds_.empty()) {
static std::mt19937 rng(std::random_device{}());
std::uniform_int_distribution<size_t> dist(0, wingIdleSounds_.size() - 1);
const auto& sample = wingIdleSounds_[dist(rng)];
if (!sample.data.empty()) {
AudioEngine::instance().playSound2D(sample.data, 0.25f * volumeScale_, 1.0f);
}
}
}
MountType MountSoundManager::detectMountType(uint32_t creatureDisplayId) const {
// TODO: Load from CreatureDisplayInfo.dbc or CreatureModelData.dbc
// For now, use simple heuristics based on common display IDs