From e8b3dda4a0cbbea0236ec607265fe80236c17a74 Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 17 Dec 2021 14:05:01 +0100 Subject: Core/BattlePets: Wrap battle pet related code in a separate namespace --- src/server/game/Spells/SpellEffects.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/server/game/Spells/SpellEffects.cpp') diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 7d337387441..cf8fe0fa959 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2053,7 +2053,8 @@ void Spell::EffectLearnSpell() 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)); + player->GetSession()->GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePets::BattlePetMgr::SelectPetDisplay(speciesEntry), + BattlePets::BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePets::BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID)); // If the spell summons a battle pet, we fake that it has been learned and the battle pet is added // marking as dependent prevents saving the spell to database (intended) dependent = true; @@ -5291,7 +5292,7 @@ void Spell::EffectHealBattlePetPct() if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - if (BattlePetMgr* battlePetMgr = unitTarget->ToPlayer()->GetSession()->GetBattlePetMgr()) + if (BattlePets::BattlePetMgr* battlePetMgr = unitTarget->ToPlayer()->GetSession()->GetBattlePetMgr()) battlePetMgr->HealBattlePetsPct(damage); } @@ -5305,7 +5306,7 @@ void Spell::EffectEnableBattlePets() Player* player = unitTarget->ToPlayer(); player->AddPlayerFlag(PLAYER_FLAGS_PET_BATTLES_UNLOCKED); - player->GetSession()->GetBattlePetMgr()->UnlockSlot(BattlePetSlot::Slot0); + player->GetSession()->GetBattlePetMgr()->UnlockSlot(BattlePets::BattlePetSlot::Slot0); } void Spell::EffectLaunchQuestChoice() @@ -5338,27 +5339,27 @@ void Spell::EffectUncageBattlePet() return; Player* player = m_caster->ToPlayer(); - BattlePetMgr* battlePetMgr = player->GetSession()->GetBattlePetMgr(); + BattlePets::BattlePetMgr* battlePetMgr = player->GetSession()->GetBattlePetMgr(); if (!battlePetMgr) return; if (battlePetMgr->GetMaxPetLevel() < level) { - battlePetMgr->SendError(BattlePetError::TooHighLevelToUncage, speciesEntry->CreatureID); + battlePetMgr->SendError(BattlePets::BattlePetError::TooHighLevelToUncage, speciesEntry->CreatureID); SendCastResult(SPELL_FAILED_CANT_ADD_BATTLE_PET); return; } if (battlePetMgr->HasMaxPetCount(speciesEntry, player->GetGUID())) { - battlePetMgr->SendError(BattlePetError::CantHaveMorePetsOfType, speciesEntry->CreatureID); + battlePetMgr->SendError(BattlePets::BattlePetError::CantHaveMorePetsOfType, speciesEntry->CreatureID); SendCastResult(SPELL_FAILED_CANT_ADD_BATTLE_PET); return; } - battlePetMgr->AddPet(speciesId, displayId, breed, BattlePetBreedQuality(quality), level); + battlePetMgr->AddPet(speciesId, displayId, breed, BattlePets::BattlePetBreedQuality(quality), level); - player->SendPlaySpellVisual(player, SPELL_VISUAL_UNCAGE_PET, 0, 0, 0.f, false); + player->SendPlaySpellVisual(player, BattlePets::SPELL_VISUAL_UNCAGE_PET, 0, 0, 0.f, false); player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true); m_CastItem = nullptr; -- cgit v1.2.3