aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2021-12-17 14:05:01 +0100
committerShauren <shauren.trinity@gmail.com>2021-12-17 14:23:43 +0100
commite8b3dda4a0cbbea0236ec607265fe80236c17a74 (patch)
tree63eadf6097808d98235a1a33329e02e811cc8206 /src/server/game/Spells/SpellEffects.cpp
parent446997cdf2bf24163141d7dcaa80bb6ef891f933 (diff)
Core/BattlePets: Wrap battle pet related code in a separate namespace
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp17
1 files changed, 9 insertions, 8 deletions
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;