azerothcore / azerothcore/mod-npc-beastmaster
[Suggestion] Enhance Beastmaster NPC: Family-based pet sorting & Goodbye gossip
- Dominant language
- C++
- Stars
- 31
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
This proposal adds two quality-of-life improvements to the `NpcBeastmaster` script:
1. **Sort displayed tame lists by pet family (then by name)** – makes the gossip menu more intuitive for hunters.
2. **Add a "Goodbye" gossip option** that gracefully dismisses temporary Beastmaster summons with a farewell whisper.
---
## 1. Sort rare and exotic pet lists by family + name
Currently, the `LoadSystem()` method loads pets from `beastmaster_tames` without any guaranteed order.
This change sorts both `rarePets` and `rareExoticPets` primarily by `family`, then by `name` for a clean, grouped display.
### Code addition (inside `NpcBeastmaster::LoadSystem`)
```cpp
void NpcBeastmaster::LoadSystem(bool /*reload = false*/) {
QueryResult result = WorldDatabase.Query(
"SELECT entry, name, family, rarity FROM beastmaster_tames");
// ... existing loading logic ...
// Sort rare pets by family, then by name
std::sort(rarePets.begin(), rarePets.end(),
[](const PetInfo& a, const PetInfo& b) {
if (a.family != b.family)
return a.family < b.family;
return a.name < b.name;
});
// Sort exotic pets the same way
std::sort(rareExoticPets.begin(), rareExoticPets.end(),
[](const PetInfo& a, const PetInfo& b) {
if (a.family != b.family)
return a.family < b.family;
return a.name < b.name;
});
}
```
---
## 2. Add a "Goodbye" gossip option for temporary Beastmaster summons
When the Beastmaster is a temporary summon (e.g., from an item or spell), players should have a polite way to dismiss it.
This adds a new gossip action that:
- Shows a farewell whisper from the NPC.
- If the creature is a temporary summon, sets its duration to 1 second (causing it to despawn shortly).
- Closes the gossip window.
### New enum value
```cpp
enum PetGossip {
// ... existing entries ...
PET_GOSSIP_GOODBYE = 601028, // new
};
```
### Add the gossip item (in the menu building function)
```cpp
AddGossipItemFor(player, GOSSIP_ICON_TALK, "Goodbye", GOSSIP_SENDER_MAIN, PET_GOSSIP_GOODBYE);
```
### Handle the selection (in `GossipSelect`)
```cpp
else if (action == PET_GOSSIP_GOODBYE) {
if (creature) {
creature->Whisper("Farewell, adventurer! May your pets always be loyal.", LANG_UNIVERSAL, player);
if (creature->IsTempSummon()) {
creature->SetDuration(1000); // despawn after 1 second
}
CloseGossipMenuFor(player);
} else {
CloseGossipMenuFor(player);
}
}
```
---
## Expected behaviour
- Pet lists now appear grouped by family (e.g., all Cats together, all Wolves together), with alphabetical order within each family.
- Talking to a temporary Beastmaster and choosing "Goodbye" dismisses it with a friendly in-character message.
## Additional notes
- No database changes required.
- Fully backwards compatible with existing scripts.
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the NpcBeastmaster script and read LoadSystem, the gossip menu builder, and GossipSelect, along with the beastmaster_tames query. Done means rare and exotic pets display grouped by family and name, while the Goodbye option whispers, closes the menu, and shortens temporary summons to one second.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100