mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/BattlePets: Fixes when adding pets (#27076)
* Add pet when learning it for the first time (summon spell not known). * Removed code that adds battle pet if its summon spell is known (Learn cageable pet -> Cage pet -> Log out -> Log in -> Pet is added). * When uncaging check that the species has a summon spell before trying to learn it.
This commit is contained in:
@@ -2146,6 +2146,9 @@ void Spell::EffectLearnSpell()
|
||||
continue;
|
||||
|
||||
player->LearnSpell(itemEffect->SpellID, false);
|
||||
|
||||
if (BattlePetSpeciesEntry const* speciesEntry = sSpellMgr->GetBattlePetSpecies(uint32(itemEffect->SpellID)))
|
||||
player->GetSession()->GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePetMgr::SelectPetDisplay(speciesEntry), BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5713,8 +5716,9 @@ void Spell::EffectUncageBattlePet()
|
||||
|
||||
battlePetMgr->AddPet(speciesId, displayId, breed, BattlePetBreedQuality(quality), level);
|
||||
|
||||
if (!plr->HasSpell(speciesEntry->SummonSpellID))
|
||||
plr->LearnSpell(speciesEntry->SummonSpellID, false);
|
||||
if (speciesEntry->SummonSpellID)
|
||||
if (!plr->HasSpell(speciesEntry->SummonSpellID))
|
||||
plr->LearnSpell(speciesEntry->SummonSpellID, false);
|
||||
|
||||
plr->SendPlaySpellVisual(plr, SPELL_VISUAL_UNCAGE_PET, 0, 0, 0.f, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user