void PlayerAchievementMgr::Reset() { AchievementMgr::Reset(); for (auto iter = _completedAchievements.begin(); iter != _completedAchievements.end(); ++iter) { WorldPackets::Achievement::AchievementDeleted achievementDeleted; achievementDeleted.AchievementID = iter->first; SendPacket(achievementDeleted.Write()); } _completedAchievements.clear(); _achievementPoints = 0; DeleteFromDB(_owner->GetGUID()); // re-fill data CheckAllAchievementCriteria(_owner); }
void AchievementMgr::Reset() { for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4); data << uint32(iter->first); _player->SendDirectMessage(&data); } for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { WorldPacket data(SMSG_CRITERIA_DELETED, 4); data << uint32(iter->first); _player->SendDirectMessage(&data); } m_completedAchievements.clear(); m_criteriaProgress.clear(); DeleteFromDB(_player->GetGUIDLow()); // re-fill data CheckAllAchievementCriteria(); }
void GuildAchievementMgr::Reset() { for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4); // ToDo, find opcode for guild data << uint32(iter->first); SendDirectMessageToAll(&data); } for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { WorldPacket data(SMSG_CRITERIA_DELETED, 4); // ToDo, find opcode for guild data << uint32(iter->first); SendDirectMessageToAll(&data); } m_completedAchievements.clear(); m_criteriaProgress.clear(); DeleteFromDB(_guild->GetId()); // re-fill data CheckAllAchievementCriteria(); }