Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/server/game/BattlePet/BattlePetMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@

namespace
{
// Kill credit creatures of the trainer tutorial quests Learning the Ropes
// and Level Up!. Retail grants them through client spells 127966 and
// 129584; nothing casts those here, so credit them directly. Got one! is
// credited where a capture is stored.
uint32 const BATTLE_PET_QUEST_CREDIT_WIN = 65355;
uint32 const BATTLE_PET_QUEST_CREDIT_LEVEL_3 = 65876;

uint8 const BATTLE_PET_QUEST_CREDIT_LEVEL = 3;

CreatureTemplate const* GetBattlePetCreatureTemplate(BattlePet const* battlePet)
{
if (!battlePet)
Expand Down Expand Up @@ -1409,6 +1418,9 @@ void BattlePetMgr::UpdateBattlePetLevelAchievement(BattlePet const& battlePet, u
uint32 const familyMask = BattlePetSpeciesFamilyMask(battlePet.GetSpecies());
for (uint8 level = initialLevel + 1; level <= finalLevel; ++level)
m_owner->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_BATTLE_PET_LEVEL, level, familyMask);

if (initialLevel < BATTLE_PET_QUEST_CREDIT_LEVEL && finalLevel >= BATTLE_PET_QUEST_CREDIT_LEVEL)
m_owner->KilledMonsterCredit(BATTLE_PET_QUEST_CREDIT_LEVEL_3);
}

void BattlePetMgr::UpdateFinishedPetBattleAchievements()
Expand All @@ -1421,6 +1433,8 @@ void BattlePetMgr::UpdateFinishedPetBattleAchievements()
if (m_activePetBattle.Winner != PET_BATTLE_WINNER_ALLY)
return;

m_owner->KilledMonsterCredit(BATTLE_PET_QUEST_CREDIT_WIN);

BattlePetAchievementContext const context = BuildActivePetBattleAchievementContext(
m_activePetBattle.EnemySpecies, m_activePetBattle.EnemyQuality, true, false);
if (!context.IsValid())
Expand Down
Loading