azerothcore / azerothcore/mod-npc-beastmaster
Incompatibility with MOD-STARTING-PET
- Dominant language
- C++
- Stars
- 31
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
I was getting a weird issue where playerbot warlocks were all getting the hunter beastmaster skill and spells, and the server was complaining that they were not compatible and thus removed them. I asked Gemini-CLI to find the source of the issue and it came up with this:
```
The module causing this is MOD-NPC-BEASTMASTER, and it is conflicting with MOD-STARTING-PET.
Why this is happening:
1. MOD-STARTING-PET is giving your Warlock (Race 9, Class 9) a starting minion/pet.
2. MOD-NPC-BEASTMASTER has a "fix" in its code (OnPlayerLogin) that checks if a player has a pet. If they do, and
they aren't a Hunter, it force-teaches them the following spells so they can manage that pet:
* 883 (Call Pet), 982 (Revive Pet), 2641 (Dismiss Pet), 6991 (Feed Pet), 48990 (Call Stabled Pet), 1002 (Eyes of
the Beast), 1462 (Beast Lore), 6197 (Eagle Eye).
3. AzerothCore's Security/Cleanup logic sees these Hunter spells on a Warlock and correctly identifies them as
"invalid race/class combination" (Skill 50 - Beast Training) and deletes them.
4. The Loop: Every time the player logs in, mod-npc-beastmaster adds them, and the Core deletes them, causing the log
spam you see.
The Proof
In modules/mod-npc-beastmaster/src/NpcBeastmaster.cpp, there is a vector called HunterSpells that contains the exact
list of spell IDs from your error log:
1 std::vector HunterSpells = {883, 982, 2641, 6991, 48990, 1002, 1462, 6197};
The module then runs this logic on login:
1 if (player->getClass() != CLASS_HUNTER) {
2 if (res || res2) { // If player has a pet...
3 for (uint32 spell : HunterSpells) {
4 player->learnSpell(spell, false); // Force learn
5 }
6 }
7 }
How to fix it:
You have two options:
Option 1: Disable the Beastmaster behavior for non-Hunters
In your worldserver.conf (or mod_npc_beastmaster.conf), find the setting that restricts pets to Hunters only.
* If BeastMaster.HunterOnly = 1, the module should skip this, but some versions of the module have a bug where the
login "fix" runs anyway.
Option 2: Modify the Module Code (Recommended)
If you want Warlocks to have pets from mod-starting-pet without the log errors, you need to tell mod-npc-beastmaster
to stop "helping" non-Hunters.
In modules/mod-npc-beastmaster/src/NpcBeastmaster.cpp, find the OnPlayerLogin function and comment out or remove the
loop that learns HunterSpells for non-hunters.
Summary: mod-npc-beastmaster is trying to be "helpful" by giving Hunter pet controls to your mod-starting-pet Warlock,
but the server core blocks it because it's illegal in WotLK logic.
```
So is there anything that can be done about this?
Contributor guide
No contributing guide indexed for this repository
Research direction
Read modules/mod-npc-beastmaster/src/NpcBeastmaster.cpp, starting with OnPlayerLogin and the HunterSpells vector. Reproduce the interaction with a non-Hunter player who has a pet, then determine the intended handling of Hunter-only spells and verify that login no longer causes incompatible spells to be learned or removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100