mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Implement NPC greeting voice lines
Added NPC voice manager that plays greeting sounds when clicking on NPCs: Features: - Voice line library with multiple race/gender voice types (Human, Dwarf, Night Elf, etc.) - 3D positional audio - voice comes from NPC location - Cooldown system prevents spam clicking same NPC - Randomized pitch/volume for variety - Loads greeting sounds from character voice files in MPQ - Generic fallback voices for NPCs without specific voice types Voice lines trigger automatically when gossip window opens (SMSG_GOSSIP_MESSAGE). Uses same audio system as other sound effects with ma_sound_set_position.
This commit is contained in:
parent
71c4fb3ae6
commit
eb288d2064
7 changed files with 37 additions and 1 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "core/logger.hpp"
|
||||
#include "core/memory_monitor.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "audio/npc_voice_manager.hpp"
|
||||
#include "rendering/camera.hpp"
|
||||
#include "rendering/camera_controller.hpp"
|
||||
#include "rendering/terrain_renderer.hpp"
|
||||
|
|
@ -814,6 +815,15 @@ void Application::setupUICallbacks() {
|
|||
}
|
||||
});
|
||||
|
||||
// NPC greeting callback - play voice line
|
||||
gameHandler->setNpcGreetingCallback([this](uint64_t guid, const glm::vec3& position) {
|
||||
if (renderer && renderer->getNpcVoiceManager()) {
|
||||
// Convert canonical to render coords for 3D audio
|
||||
glm::vec3 renderPos = core::coords::canonicalToRender(position);
|
||||
renderer->getNpcVoiceManager()->playGreeting(guid, audio::VoiceType::GENERIC, renderPos);
|
||||
}
|
||||
});
|
||||
|
||||
// "Create Character" button on character screen
|
||||
uiManager->getCharacterScreen().setOnCreateCharacter([this]() {
|
||||
uiManager->getCharacterCreateScreen().reset();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue