AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "AchievementMgr.h"
Static Public Member Functions | |
static void | DeleteFromDB (ObjectGuid::LowType lowguid) |
Private Types | |
enum | ProgressType { PROGRESS_SET , PROGRESS_ACCUMULATE , PROGRESS_HIGHEST , PROGRESS_RESET } |
typedef std::map< uint32, uint32 > | TimedAchievementMap |
Private Member Functions | |
void | SendAchievementEarned (AchievementEntry const *achievement) const |
void | SendCriteriaUpdate (AchievementCriteriaEntry const *entry, CriteriaProgress const *progress, uint32 timeElapsed, bool timedCompleted) const |
void | SetCriteriaProgress (AchievementCriteriaEntry const *entry, uint32 changeValue, ProgressType ptype=PROGRESS_SET) |
void | CompletedCriteriaFor (AchievementEntry const *achievement) |
bool | IsCompletedCriteria (AchievementCriteriaEntry const *achievementCriteria, AchievementEntry const *achievement) |
bool | IsCompletedAchievement (AchievementEntry const *entry) |
bool | CanUpdateCriteria (AchievementCriteriaEntry const *criteria, AchievementEntry const *achievement) |
void | BuildAllDataPacket (WorldPacket *data) const |
void | UpdateTimedAchievements (uint32 timeDiff) |
void | ProcessOfflineUpdate (AchievementOfflinePlayerUpdate const &update) |
void | ProcessOfflineUpdatesQueue () |
|
private |
|
private |
AchievementMgr::AchievementMgr | ( | Player * | player | ) |
References _offlineUpdatesDelayTimer, and _player.
AchievementMgr::~AchievementMgr | ( | ) |
|
private |
used by SMSG_RESPOND_INSPECT_ACHIEVEMENT and SMSG_ALL_ACHIEVEMENT_DATA
References _completedAchievements, _criteriaProgress, ACHIEVEMENT_FLAG_HIDDEN, ByteBuffer::AppendPackedTime(), ByteBuffer::appendPackGUID(), AchievementEntry::flags, GameTime::GetGameTime(), Object::GetPackGUID(), GetPlayer(), sAchievementCriteriaStore, sAchievementMgr, and sAchievementStore.
Referenced by SendAllAchievementData(), and SendRespondInspectAchievements().
|
private |
References ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, ACHIEVEMENT_CRITERIA_CONDITION_NOT_IN_GROUP, ACHIEVEMENT_FACTION_ALLIANCE, ACHIEVEMENT_FACTION_HORDE, AchievementCriteriaEntry::additionalRequirement_type, AchievementCriteriaEntry::additionalRequirement_value, AchievementCriteriaEntry::additionalRequirements, DISABLE_TYPE_ACHIEVEMENT_CRITERIA, GetPlayer(), GetTeamId(), AchievementCriteriaEntry::ID, IsCompletedCriteria(), DisableMgr::IsDisabledFor(), AchievementEntry::mapID, MAX_CRITERIA_REQUIREMENTS, AchievementEntry::requiredFaction, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by UpdateAchievementCriteria().
void AchievementMgr::CheckAllAchievementCriteria | ( | ) |
called at player login. The player might have fulfilled some achievements when the achievement system wasn't working yet.
References ACHIEVEMENT_CRITERIA_TYPE_TOTAL, and UpdateAchievementCriteria().
Referenced by Player::CheckAllAchievementCriteria(), and Reset().
void AchievementMgr::CompletedAchievement | ( | AchievementEntry const * | entry | ) |
Currently there's only one achievement that deals with gender-specific titles. Since no common attributes were found, (not even in titleRewardFlags field) we explicitly check by ID. Maybe in the future we could move the achievement_reward condition fields to the condition system.
References _completedAchievements, _player, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, ACHIEVEMENT_FLAG_COUNTER, ACHIEVEMENT_FLAG_REALM_FIRST_KILL, ACHIEVEMENT_FLAG_REALM_FIRST_REACH, MailDraft::AddItem(), CompletedAchievementData::changed, CharacterDatabase, Item::CreateItem(), CompletedAchievementData::date, AchievementEntry::flags, GetCriteriaProgress(), GameTime::GetGameTime(), ObjectMgr::GetLocaleString(), GetPlayer(), WorldSession::GetSecurity(), Player::GetSession(), WorldSession::GetSessionDbLocaleIndex(), GetTeamId(), HasAchieved(), AchievementEntry::ID, IsCompletedAchievement(), Player::IsGameMaster(), AccountMgr::IsPlayerAccount(), AchievementReward::itemId, LOCALE_enUS, LOG_DEBUG, LOG_INFO, MAIL_CREATURE, AchievementReward::mailTemplate, AchievementEntry::points, ChatHandler::PSendSysMessage(), AchievementEntry::refAchievement, sAchievementMgr, Item::SaveToDB(), sCharTitlesStore, SendAchievementEarned(), AchievementReward::sender, MailDraft::SendMailTo(), Player::SetTitle(), sScriptMgr, AchievementReward::subject, AchievementReward::text, AchievementReward::titleId, and UpdateAchievementCriteria().
Referenced by Player::CompletedAchievement(), CompletedCriteriaFor(), ProcessOfflineUpdate(), and UpdateAchievementCriteria().
|
private |
References ACHIEVEMENT_FLAG_COUNTER, CompletedAchievement(), AchievementEntry::flags, HasAchieved(), AchievementEntry::ID, and IsCompletedAchievement().
Referenced by UpdateAchievementCriteria().
|
static |
References CHAR_DEL_CHAR_ACHIEVEMENT, CHAR_DEL_CHAR_ACHIEVEMENT_OFFLINE_UPDATES, CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS, CharacterDatabase, and PreparedStatementBase::SetData().
Referenced by reset_commandscript::HandleResetAchievementsCommand(), and Reset().
CompletedAchievementMap const & AchievementMgr::GetCompletedAchievements | ( | ) |
References _completedAchievements.
CriteriaProgress * AchievementMgr::GetCriteriaProgress | ( | AchievementCriteriaEntry const * | entry | ) |
References _criteriaProgress, and AchievementCriteriaEntry::ID.
Referenced by CompletedAchievement(), IsCompletedAchievement(), IsCompletedCriteria(), SetCriteriaProgress(), and UpdateAchievementCriteria().
|
inline |
References _player.
Referenced by BuildAllDataPacket(), CanUpdateCriteria(), CompletedAchievement(), LoadFromDB(), ProcessOfflineUpdate(), ProcessOfflineUpdatesQueue(), SaveToDB(), SendAchievementEarned(), SendAllAchievementData(), SendCriteriaUpdate(), SendRespondInspectAchievements(), SetCriteriaProgress(), and UpdateAchievementCriteria().
bool AchievementMgr::HasAchieved | ( | uint32 | achievementId | ) | const |
References _completedAchievements.
Referenced by CompletedAchievement(), CompletedCriteriaFor(), Player::HasAchieved(), IsCompletedCriteria(), ResetAchievementCriteria(), and UpdateAchievementCriteria().
|
private |
References ACHIEVEMENT_FLAG_COUNTER, ACHIEVEMENT_FLAG_SUMM, AchievementEntry::count, AchievementCriteriaEntry::count, CriteriaProgress::counter, AchievementEntry::flags, GetCriteriaProgress(), AchievementEntry::ID, IsCompletedCriteria(), AchievementCriteriaEntry::raw, AchievementEntry::refAchievement, and sAchievementMgr.
Referenced by CompletedAchievement(), CompletedCriteriaFor(), IsCompletedCriteria(), and UpdateAchievementCriteria().
|
private |
References ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT, ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, ACHIEVEMENT_CRITERIA_TYPE_DEATH, ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA, ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING, ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE, ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, ACHIEVEMENT_CRITERIA_TYPE_ON_LOGIN, ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK, ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA, ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED, ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL, ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, ACHIEVEMENT_CRITERIA_TYPE_ROLL_DISENCHANT, ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA, ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, ACHIEVEMENT_FLAG_COUNTER, ACHIEVEMENT_FLAG_REALM_FIRST_KILL, ACHIEVEMENT_FLAG_REALM_FIRST_REACH, AchievementCriteriaEntry::be_spell_target, AchievementCriteriaEntry::bg_objective, AchievementCriteriaEntry::buy_bank_slot, AchievementCriteriaEntry::cast_spell, AchievementCriteriaEntry::castCount, AchievementCriteriaEntry::complete_daily_quest, AchievementCriteriaEntry::complete_daily_quest_daily, AchievementCriteriaEntry::complete_quest_count, AchievementCriteriaEntry::complete_quests_in_zone, AchievementCriteriaEntry::completeCount, AchievementCriteriaEntry::count, CriteriaProgress::counter, AchievementCriteriaEntry::creatureCount, AchievementCriteriaEntry::do_emote, AchievementCriteriaEntry::duelCount, AchievementCriteriaEntry::dungeonsComplete, AchievementCriteriaEntry::equip_epic_item, AchievementCriteriaEntry::equip_item, AchievementCriteriaEntry::fall_without_dying, AchievementCriteriaEntry::fallHeight, AchievementCriteriaEntry::fish_in_gameobject, AchievementEntry::flags, AchievementCriteriaEntry::gain_exalted_reputation, AchievementCriteriaEntry::gain_reputation, AchievementCriteriaEntry::get_killing_blow, GetCriteriaProgress(), AchievementCriteriaEntry::goldInCopper, HasAchieved(), AchievementCriteriaEntry::healing_done, AchievementCriteriaEntry::highest_personal_rating, AchievementCriteriaEntry::hk_class, AchievementCriteriaEntry::hk_race, AchievementCriteriaEntry::honorable_kill, AchievementCriteriaEntry::honorable_kill_at_area, AchievementEntry::ID, IsCompletedAchievement(), AchievementCriteriaEntry::itemCount, AchievementCriteriaEntry::kill_creature, AchievementCriteriaEntry::killCount, AchievementCriteriaEntry::learn_skill_level, AchievementCriteriaEntry::learn_skill_line, AchievementCriteriaEntry::learn_skillline_spell, AchievementCriteriaEntry::level, AchievementCriteriaEntry::loot_item, AchievementCriteriaEntry::loot_money, AchievementCriteriaEntry::loot_type, AchievementCriteriaEntry::lootCount, AchievementCriteriaEntry::lootTypeCount, AchievementCriteriaEntry::numberOfDays, AchievementCriteriaEntry::numberOfExaltedFactions, AchievementCriteriaEntry::numberOfSlots, AchievementCriteriaEntry::numberOfVisits, AchievementCriteriaEntry::own_item, AchievementCriteriaEntry::PersonalRating, AchievementCriteriaEntry::quest_reward_money, AchievementCriteriaEntry::questCount, AchievementCriteriaEntry::reach_level, AchievementCriteriaEntry::reach_skill_level, AchievementCriteriaEntry::reputationAmount, AchievementCriteriaEntry::requiredType, AchievementCriteriaEntry::roll_greed_on_loot, sAchievementMgr, AchievementCriteriaEntry::skillLevel, AchievementCriteriaEntry::special_pvp_kill, AchievementCriteriaEntry::spellCount, sScriptMgr, AchievementCriteriaEntry::totalQuestCount, AchievementCriteriaEntry::use_gameobject, AchievementCriteriaEntry::use_item, AchievementCriteriaEntry::use_lfg, AchievementCriteriaEntry::useCount, AchievementCriteriaEntry::visit_barber, AchievementCriteriaEntry::win_arena, AchievementCriteriaEntry::win_bg, AchievementCriteriaEntry::win_duel, AchievementCriteriaEntry::win_rated_arena, and AchievementCriteriaEntry::winCount.
Referenced by CanUpdateCriteria(), IsCompletedAchievement(), ResetAchievementCriteria(), SetCriteriaProgress(), StartTimedAchievement(), and UpdateAchievementCriteria().
void AchievementMgr::LoadFromDB | ( | PreparedQueryResult | achievementResult, |
PreparedQueryResult | criteriaResult, | ||
PreparedQueryResult | offlineUpdatesResult | ||
) |
References _completedAchievements, _criteriaProgress, _offlineUpdatesDelayTimer, _offlineUpdatesQueue, AchievementOfflinePlayerUpdate::arg1, AchievementOfflinePlayerUpdate::arg2, AchievementOfflinePlayerUpdate::arg3, CriteriaProgress::changed, CompletedAchievementData::changed, CHAR_DEL_INVALID_ACHIEV_PROGRESS_CRITERIA, CharacterDatabase, CriteriaProgress::counter, CriteriaProgress::date, CompletedAchievementData::date, Field::Get(), GameTime::GetGameTime(), GetPlayer(), IN_MILLISECONDS, LOG_ERROR, sAchievementCriteriaStore, sAchievementMgr, sAchievementStore, sCharTitlesStore, SECOND, PreparedStatementBase::SetData(), Player::SetTitle(), Player::TeamIdForRace(), AchievementCriteriaEntry::timeLimit, and AchievementOfflinePlayerUpdate::updateType.
Referenced by Player::LoadFromDB().
|
private |
References ACHIEVEMENT_OFFLINE_PLAYER_UPDATE_TYPE_COMPLETE_ACHIEVEMENT, ACHIEVEMENT_OFFLINE_PLAYER_UPDATE_TYPE_UPDATE_CRITERIA, AchievementOfflinePlayerUpdate::arg1, AchievementOfflinePlayerUpdate::arg2, AchievementOfflinePlayerUpdate::arg3, ASSERT, CompletedAchievement(), GetPlayer(), sAchievementStore, UpdateAchievementCriteria(), and AchievementOfflinePlayerUpdate::updateType.
Referenced by ProcessOfflineUpdatesQueue().
|
private |
References _offlineUpdatesQueue, CHAR_DEL_CHAR_ACHIEVEMENT_OFFLINE_UPDATES, CharacterDatabase, GetPlayer(), ProcessOfflineUpdate(), and PreparedStatementBase::SetData().
Referenced by Update().
void AchievementMgr::RemoveCriteriaProgress | ( | AchievementCriteriaEntry const * | entry | ) |
References _criteriaProgress, _player, AchievementCriteriaEntry::ID, Player::SendDirectMessage(), and SMSG_CRITERIA_DELETED.
Referenced by RemoveTimedAchievement(), ResetAchievementCriteria(), and UpdateTimedAchievements().
void AchievementMgr::RemoveTimedAchievement | ( | AchievementCriteriaTimedTypes | type, |
uint32 | entry | ||
) |
References _timedAchievements, RemoveCriteriaProgress(), and sAchievementMgr.
Referenced by Player::RemoveTimedAchievement().
void AchievementMgr::Reset | ( | ) |
References _completedAchievements, _criteriaProgress, _player, CheckAllAchievementCriteria(), DeleteFromDB(), ObjectGuid::GetCounter(), Object::GetGUID(), Player::SendDirectMessage(), SMSG_ACHIEVEMENT_DELETED, and SMSG_CRITERIA_DELETED.
Referenced by Player::ResetAchievements().
void AchievementMgr::ResetAchievementCriteria | ( | AchievementCriteriaCondition | condition, |
uint32 | value, | ||
bool | evenIfCriteriaComplete = false |
||
) |
References _player, HasAchieved(), AchievementEntry::ID, IsCompletedCriteria(), Player::IsGameMaster(), LOG_DEBUG, AchievementCriteriaEntry::referredAchievement, RemoveCriteriaProgress(), sAchievementMgr, and sAchievementStore.
Referenced by Player::ResetAchievementCriteria().
void AchievementMgr::SaveToDB | ( | CharacterDatabaseTransaction | trans | ) |
References _completedAchievements, _criteriaProgress, CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT, CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS_BY_CRITERIA, CHAR_INS_CHAR_ACHIEVEMENT, CHAR_INS_CHAR_ACHIEVEMENT_PROGRESS, CharacterDatabase, GetPlayer(), PreparedStatementBase::SetData(), and sScriptMgr.
Referenced by Player::SaveToDB().
|
private |
References ACHIEVEMENT_FLAG_HIDDEN, ACHIEVEMENT_FLAG_REALM_FIRST_KILL, ACHIEVEMENT_FLAG_REALM_FIRST_REACH, ByteBuffer::AppendPackedTime(), BROADCAST_TEXT_ACHIEVEMENT_EARNED, Guild::BroadcastWorker(), CHAT_MSG_ACHIEVEMENT, CHAT_MSG_GUILD_ACHIEVEMENT, Acore::ComputeCellCoord(), CONFIG_LISTEN_RANGE_SAY, AchievementEntry::flags, GameTime::GetGameTime(), Object::GetGUID(), WorldObject::GetName(), Guild::GetName(), Object::GetPackGUID(), GetPlayer(), Player::GetTeamId(), AchievementEntry::ID, Object::IsInWorld(), LOG_DEBUG, ByteBuffer::put(), Player::SendMessageToSetInRange(), Cell::SetNoCreate(), sGuildMgr, SMSG_ACHIEVEMENT_EARNED, SMSG_SERVER_FIRST_ACHIEVEMENT, sWorld, TEAM_ALLIANCE, TEAM_HORDE, Cell::VisitWorldObjects(), and ByteBuffer::wpos().
Referenced by CompletedAchievement().
void AchievementMgr::SendAllAchievementData | ( | ) | const |
References _completedAchievements, _criteriaProgress, BuildAllDataPacket(), GetPlayer(), Player::GetSession(), WorldSession::SendPacket(), and SMSG_ALL_ACHIEVEMENT_DATA.
Referenced by Player::SendInitialPacketsBeforeAddToMap().
|
private |
References ByteBuffer::AppendPackedTime(), ByteBuffer::appendPackGUID(), CriteriaProgress::counter, CriteriaProgress::date, GameTime::GetGameTime(), Object::GetPackGUID(), GetPlayer(), AchievementCriteriaEntry::ID, sAchievementMgr, Player::SendDirectMessage(), SMSG_CRITERIA_UPDATE, and AchievementCriteriaEntry::timeLimit.
Referenced by SetCriteriaProgress().
void AchievementMgr::SendRespondInspectAchievements | ( | Player * | player | ) | const |
References _completedAchievements, _criteriaProgress, BuildAllDataPacket(), Object::GetPackGUID(), GetPlayer(), Player::GetSession(), WorldSession::SendPacket(), and SMSG_RESPOND_INSPECT_ACHIEVEMENTS.
Referenced by Player::SendRespondInspectAchievements().
|
private |
References _criteriaProgress, _player, _timedAchievements, CriteriaProgress::changed, CriteriaProgress::counter, CriteriaProgress::date, GetCriteriaProgress(), GameTime::GetGameTime(), Object::GetGUID(), GetPlayer(), AchievementCriteriaEntry::ID, IN_MILLISECONDS, IsCompletedCriteria(), LOG_DEBUG, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST, PROGRESS_RESET, PROGRESS_SET, AchievementCriteriaEntry::referredAchievement, sAchievementStore, SendCriteriaUpdate(), sScriptMgr, AchievementCriteriaEntry::timeLimit, and ObjectGuid::ToString().
Referenced by StartTimedAchievement(), and UpdateAchievementCriteria().
void AchievementMgr::StartTimedAchievement | ( | AchievementCriteriaTimedTypes | type, |
uint32 | entry, | ||
uint32 | timeLost = 0 |
||
) |
References _timedAchievements, IN_MILLISECONDS, IsCompletedCriteria(), PROGRESS_SET, sAchievementMgr, sAchievementStore, and SetCriteriaProgress().
Referenced by Player::StartTimedAchievement().
void AchievementMgr::Update | ( | uint32 | timeDiff | ) |
References _offlineUpdatesDelayTimer, ProcessOfflineUpdatesQueue(), and UpdateTimedAchievements().
Referenced by Player::Update().
void AchievementMgr::UpdateAchievementCriteria | ( | AchievementCriteriaTypes | type, |
uint32 | miscValue1 = 0 , |
||
uint32 | miscValue2 = 0 , |
||
Unit * | unit = nullptr |
||
) |
this function will be called whenever the user might have done a criteria relevant action
References _completedAchievements, _player, ACHIEVEMENT_CRITERIA_CONDITION_BG_MAP, ACHIEVEMENT_CRITERIA_CONDITION_NO_LOSE, ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT, ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_DAILY_QUEST_DAILY, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE, ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_RAID, ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION, ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, ACHIEVEMENT_CRITERIA_TYPE_DEATH, ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, ACHIEVEMENT_CRITERIA_TYPE_DEATHS_FROM, ACHIEVEMENT_CRITERIA_TYPE_DO_EMOTE, ACHIEVEMENT_CRITERIA_TYPE_EARN_ACHIEVEMENT_POINTS, ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_TYPE_EQUIP_EPIC_ITEM, ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM, ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA, ACHIEVEMENT_CRITERIA_TYPE_FALL_WITHOUT_DYING, ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, ACHIEVEMENT_CRITERIA_TYPE_GET_KILLING_BLOWS, ACHIEVEMENT_CRITERIA_TYPE_GOLD_EARNED_BY_AUCTIONS, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_MAIL, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TALENTS, ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_ARMOR, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_SOLD, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_GOLD_VALUE_OWNED, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALING_RECEIVED, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEALTH, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_DEALT, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HIT_RECEIVED, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_PERSONAL_RATING, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_POWER, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_RATING, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_SPELLPOWER, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_STAT, ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING, ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE_TYPE, ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY, ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, ACHIEVEMENT_CRITERIA_TYPE_LOSE_DUEL, ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_QUEST_REWARD, ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_TALENT_RESETS, ACHIEVEMENT_CRITERIA_TYPE_ON_LOGIN, ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, ACHIEVEMENT_CRITERIA_TYPE_OWN_RANK, ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA, ACHIEVEMENT_CRITERIA_TYPE_QUEST_ABANDONED, ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL, ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, ACHIEVEMENT_CRITERIA_TYPE_RECEIVE_EPIC_ITEM, ACHIEVEMENT_CRITERIA_TYPE_ROLL_DISENCHANT, ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED, ACHIEVEMENT_CRITERIA_TYPE_ROLL_GREED_ON_LOOT, ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED, ACHIEVEMENT_CRITERIA_TYPE_ROLL_NEED_ON_LOOT, ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, ACHIEVEMENT_CRITERIA_TYPE_TOTAL, ACHIEVEMENT_CRITERIA_TYPE_TOTAL_DAMAGE_RECEIVED, ACHIEVEMENT_CRITERIA_TYPE_TOTAL_HEALING_RECEIVED, ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT, ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM, ACHIEVEMENT_CRITERIA_TYPE_USE_LFD_TO_GROUP_WITH_PLAYERS, ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, ACHIEVEMENT_CRITERIA_TYPE_WIN_ARENA, ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, ACHIEVEMENT_CRITERIA_TYPE_WIN_DUEL, ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, ACHIEVEMENT_CRITERIA_TYPE_WON_AUCTIONS, ACHIEVEMENT_FLAG_SUMM, achievIdByArenaSlot, achievIdForDungeon, AchievementCriteriaEntry::additionalRequirement_type, AchievementCriteriaEntry::additionalRequirement_value, AchievementCriteriaEntry::additionalRequirements, AchievementCriteriaEntry::areaID, AchievementCriteriaEntry::areaReference, WorldMapOverlayEntry::areatableID, AchievementCriteriaEntry::be_spell_target, AchievementCriteriaEntry::bg_objective, AchievementCriteriaEntry::bgMapID, CanUpdateCriteria(), AchievementCriteriaEntry::cast_spell, CATEGORY_CHILDRENS_WEEK, AchievementEntry::categoryId, AchievementCriteriaEntry::classID, AchievementCriteriaEntry::complete_achievement, AchievementCriteriaEntry::complete_battleground, AchievementCriteriaEntry::complete_quest, AchievementCriteriaEntry::complete_quests_in_zone, AchievementCriteriaEntry::complete_raid, CompletedAchievement(), CompletedCriteriaFor(), AchievementCriteriaEntry::count, AchievementCriteriaEntry::creatureEntry, AchievementCriteriaEntry::creatureID, CriteriaProgress::date, AchievementCriteriaEntry::death_at_map, AchievementCriteriaEntry::death_from, AchievementCriteriaEntry::death_in_dungeon, AchievementCriteriaEntry::do_emote, AchievementCriteriaEntry::duelCount, DUNGEON_DIFFICULTY_NORMAL, AchievementCriteriaEntry::emoteID, AchievementCriteriaEntry::equip_epic_item, AchievementCriteriaEntry::equip_item, AchievementCriteriaEntry::explore_area, AreaTableEntry::exploreFlag, AchievementCriteriaEntry::factionID, AchievementCriteriaEntry::fish_in_gameobject, AchievementEntry::flags, AchievementCriteriaEntry::gain_reputation, Player::GetArenaTeamId(), Battleground::GetArenaType(), Player::GetBattleground(), GetCriteriaProgress(), WorldObject::GetMap(), InstanceMap::GetMaxPlayers(), ArenaTeam::GetMember(), GetPlayer(), ReputationMgr::GetReputation(), Player::GetReputationMgr(), Player::getRewardedQuests(), ArenaTeam::GetSlotByType(), Player::GetSpellMap(), ArenaTeam::GetStats(), GetTeamId(), ArenaTeam::GetType(), Object::GetUInt32Value(), Quest::GetZoneOrSort(), AchievementCriteriaEntry::goEntry, AchievementCriteriaEntry::groupSize, HasAchieved(), Quest::HasSpecialFlag(), AchievementCriteriaEntry::highest_personal_rating, AchievementCriteriaEntry::highest_team_rating, AchievementCriteriaEntry::hk_class, AchievementCriteriaEntry::hk_race, AchievementCriteriaEntry::honorable_kill_at_area, AchievementEntry::ID, Battleground::isArena(), IsCompletedAchievement(), IsCompletedCriteria(), Map::IsDungeon(), Player::IsGameMaster(), Object::IsInWorld(), Object::IsPlayer(), Map::IsRaid(), ITEM_QUALITY_EPIC, AchievementCriteriaEntry::itemID, ItemTemplate::ItemLevel, AchievementCriteriaEntry::itemSlot, AchievementCriteriaEntry::kill_creature, AchievementCriteriaEntry::killed_by_creature, AchievementCriteriaEntry::learn_skill_level, AchievementCriteriaEntry::learn_skill_line, AchievementCriteriaEntry::learn_skillline_spell, AchievementCriteriaEntry::learn_spell, AchievementCriteriaEntry::linkedAchievement, LOG_DEBUG, AchievementCriteriaEntry::loot_type, AchievementCriteriaEntry::lootType, AchievementCriteriaEntry::lootTypeCount, AchievementCriteriaEntry::manLimit, AchievementCriteriaEntry::mapID, MAX_ARENA_SLOT, MAX_WORLD_MAP_OVERLAY_AREA_IDX, AchievementCriteriaDataSet::Meets(), AchievementCriteriaEntry::objectiveId, AchievementCriteriaEntry::own_item, AchievementCriteriaEntry::PersonalRating, PLAYER_EXPLORED_ZONES_1, PLAYER_EXPLORED_ZONES_SIZE, PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, PROGRESS_ACCUMULATE, PROGRESS_HIGHEST, PROGRESS_RESET, PROGRESS_SET, ItemTemplate::Quality, QUEST_SPECIAL_FLAGS_NO_LOREMASTER_COUNT, AchievementCriteriaEntry::questID, AchievementCriteriaEntry::raceID, ArenaTeamStats::Rating, AchievementCriteriaEntry::reach_skill_level, AchievementCriteriaEntry::referredAchievement, AchievementCriteriaEntry::roll_greed_on_loot, AchievementCriteriaEntry::rollValue, sAchievementMgr, sAchievementStore, sAreaTableStore, sArenaTeamMgr, SetCriteriaProgress(), AchievementCriteriaEntry::skillID, AchievementCriteriaEntry::skillLine, sMapMgr, sObjectMgr, AchievementCriteriaEntry::spellID, sScriptMgr, sSpellMgr, sWorld, sWorldMapOverlayStore, AchievementCriteriaEntry::teamtype, Map::ToInstanceMap(), AchievementCriteriaEntry::type, AchievementCriteriaEntry::use_gameobject, AchievementCriteriaEntry::use_item, AchievementCriteriaEntry::win_arena, AchievementCriteriaEntry::win_bg, AchievementCriteriaEntry::win_duel, and AchievementCriteriaEntry::zoneID.
Referenced by CheckAllAchievementCriteria(), CompletedAchievement(), ProcessOfflineUpdate(), and Player::UpdateAchievementCriteria().
|
private |
References _timedAchievements, RemoveCriteriaProgress(), and sAchievementCriteriaStore.
Referenced by Update().
|
private |
|
private |
|
private |
Referenced by AchievementMgr(), LoadFromDB(), and Update().
|
private |
Referenced by LoadFromDB(), and ProcessOfflineUpdatesQueue().
|
private |
|
private |
Referenced by RemoveTimedAchievement(), SetCriteriaProgress(), StartTimedAchievement(), and UpdateTimedAchievements().