Core/BattlePets: Misc fixes (#26964)

* Define BattlePetSpeciesFlags enum class.
* Define BattlePetDbFlags enum class.
* Added check to prevent the pet from being caged if its species has flag BattlePetSpeciesFlags::NotTradable.
* Added check to prevent the pet from being caged if it's in battle pet slots.
* Added check to prevent the pet from being caged if its health is below maximum health.
* Only add pet if the species has flag BattlePetSpeciesFlags::WellKnown.
* Added function to check flag BattlePetSpeciesFlags::LegacyAccountUnique to avoid learning copies of unique pets.
* Implemented CMSG_BATTLE_PET_CLEAR_FANFARE.
This commit is contained in:
Meji
2021-09-29 22:26:25 +02:00
committed by GitHub
parent f507737ecf
commit de4eaa0de9
10 changed files with 116 additions and 9 deletions

View File

@@ -5607,7 +5607,7 @@ void Spell::EffectUncageBattlePet()
return;
}
if (battlePetMgr->GetPetCount(speciesId) >= MAX_BATTLE_PETS_PER_SPECIES)
if (battlePetMgr->HasMaxPetCount(speciesEntry))
{
battlePetMgr->SendError(BATTLEPETRESULT_CANT_HAVE_MORE_PETS_OF_THAT_TYPE, creatureId); // or speciesEntry.CreatureID
SendCastResult(SPELL_FAILED_CANT_ADD_BATTLE_PET);