Core/Achievements: Simplify handling of achievements for GMs: Do not allow achievements when GM-mode is enabled, allow when disabled
This commit is contained in:
@@ -433,7 +433,8 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2);
|
||||
|
||||
if (m_player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS)))
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->GetSession()->isGameMaster())
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
|
||||
@@ -733,7 +734,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2);
|
||||
|
||||
if (m_player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS)))
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->GetSession()->isGameMaster())
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
|
||||
@@ -2000,11 +2002,12 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
}
|
||||
}
|
||||
|
||||
void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, bool ignoreGMAllowAchievementConfig)
|
||||
void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
{
|
||||
sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
|
||||
|
||||
if (m_player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS)) && !ignoreGMAllowAchievementConfig)
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->GetSession()->isGameMaster())
|
||||
return;
|
||||
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement))
|
||||
|
||||
@@ -253,7 +253,7 @@ class AchievementMgr
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, bool evenIfCriteriaComplete = false);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig = false);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
void CheckAllAchievementCriteria();
|
||||
void SendAllAchievementData() const;
|
||||
void SendRespondInspectAchievements(Player* player) const;
|
||||
|
||||
@@ -23436,9 +23436,9 @@ void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 mis
|
||||
GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
|
||||
}
|
||||
|
||||
void Player::CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig)
|
||||
void Player::CompletedAchievement(AchievementEntry const* entry)
|
||||
{
|
||||
GetAchievementMgr().CompletedAchievement(entry, ignoreGMAllowAchievementConfig);
|
||||
GetAchievementMgr().CompletedAchievement(entry);
|
||||
}
|
||||
|
||||
void Player::LearnTalent(uint32 talentId, uint32 talentRank)
|
||||
|
||||
@@ -2420,7 +2420,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
AchievementMgr& GetAchievementMgr() { return m_achievementMgr; }
|
||||
AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; }
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig = false);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
|
||||
bool HasTitle(uint32 bitIndex);
|
||||
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
|
||||
|
||||
@@ -854,7 +854,6 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfig->GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR);
|
||||
m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfig->GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR);
|
||||
m_int_configs[CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS] = sConfig->GetIntDefault("GM.AllowAchievementGain.Level", SEC_ADMINISTRATOR);
|
||||
m_bool_configs[CONFIG_GM_LOG_TRADE] = sConfig->GetBoolDefault("GM.LogTrade", false);
|
||||
m_int_configs[CONFIG_START_GM_LEVEL] = sConfig->GetIntDefault("GM.StartLevel", 1);
|
||||
if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL])
|
||||
|
||||
@@ -1901,17 +1901,6 @@ GM.AllowFriend = 0
|
||||
|
||||
GM.LowerSecurity = 0
|
||||
|
||||
#
|
||||
# GM.AllowAchievementGain.Level
|
||||
# Description: Max GM level allowed to obtain achievements.
|
||||
# Default: 3 - (Players, Moderators, GameMasters, Admins)
|
||||
# 0 - (Players)
|
||||
# 1 - (Players, Moderators)
|
||||
# 2 - (Players, Moderators, GameMasters)
|
||||
# 3 - (Players, Moderators, GameMasters, Admins)
|
||||
|
||||
GM.AllowAchievementGain.Level = 3
|
||||
|
||||
#
|
||||
# GM.TicketSystem.ChanceOfGMSurvey
|
||||
# Description: Chance of sending a GM survey after ticket completion.
|
||||
|
||||
Reference in New Issue
Block a user