mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
feat: show fish-hooked notification when fishing bobber splashes
When the server sends SMSG_GAMEOBJECT_CUSTOM_ANIM with animId=0 for a GO of type 17 (FISHINGNODE), a fish has been hooked and the player needs to click the bobber quickly. Add a system chat message and a UI sound to alert the player — previously there was no visual/audio feedback beyond the bobber animation itself.
This commit is contained in:
parent
01f4ef5e79
commit
f44defec38
1 changed files with 19 additions and 0 deletions
|
|
@ -4528,6 +4528,25 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
if (gameObjectCustomAnimCallback_) {
|
||||
gameObjectCustomAnimCallback_(guid, animId);
|
||||
}
|
||||
// animId == 0 is the fishing bobber splash ("fish hooked").
|
||||
// Detect by GO type 17 (FISHINGNODE) and notify the player so they
|
||||
// know to click the bobber before the fish escapes.
|
||||
if (animId == 0) {
|
||||
auto goEnt = entityManager.getEntity(guid);
|
||||
if (goEnt && goEnt->getType() == ObjectType::GAMEOBJECT) {
|
||||
auto go = std::static_pointer_cast<GameObject>(goEnt);
|
||||
auto* info = getCachedGameObjectInfo(go->getEntry());
|
||||
if (info && info->type == 17) { // GO_TYPE_FISHINGNODE
|
||||
addSystemChatMessage("A fish is on your line!");
|
||||
// Play a distinctive UI sound to alert the player
|
||||
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||
if (auto* sfx = renderer->getUiSoundManager()) {
|
||||
sfx->playQuestUpdate(); // Distinct "ping" sound
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue