mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 13:35:08 +00:00
feat(Core/Achievements): Add configurable realm first kill time window (#24920)
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
# CHARACTER DELETE
|
||||
# CHARACTER CREATION
|
||||
# CHARACTER
|
||||
# ACHIEVEMENT
|
||||
# SKILL
|
||||
# STATS
|
||||
# REPUTATION
|
||||
@@ -2225,6 +2226,22 @@ SpellQueue.Window = 400
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
###################################################################################################
|
||||
# ACHIEVEMENT
|
||||
#
|
||||
# Achievement.RealmFirstKillWindow
|
||||
# Description: Time window (in seconds) for realm first kill achievements after the first
|
||||
# completion. This setting controls whether multiple groups can earn the
|
||||
# realm first kill achievement within a short time window.
|
||||
# Default: 60 - (Allow additional groups to complete within 60 seconds/1 minute)
|
||||
# 0 - (Strict mode, only the first group/player gets the achievement)
|
||||
# 1+ - (Extended window, allow N seconds for additional completions)
|
||||
|
||||
Achievement.RealmFirstKillWindow = 60
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
###################################################################################################
|
||||
# SKILL
|
||||
#
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "DBCEnums.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DisableMgr.h"
|
||||
#include "Duration.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameTime.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
@@ -2592,11 +2593,18 @@ bool AchievementGlobalMgr::IsRealmCompleted(AchievementEntry const* achievement)
|
||||
if (itr->second == SystemTimePoint::max())
|
||||
return true;
|
||||
|
||||
// Allow completing the realm first kill for entire minute after first person did it
|
||||
// Allow completing the realm first kill for configurable time window after first person did it
|
||||
// it may allow more than one group to achieve it (highly unlikely)
|
||||
// but apparently this is how blizz handles it as well
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_REALM_FIRST_KILL)
|
||||
return (GameTime::GetSystemTime() - itr->second) > 1min;
|
||||
{
|
||||
Seconds windowSeconds = Seconds(sWorld->getIntConfig(CONFIG_ACHIEVEMENT_REALM_FIRST_KILL_WINDOW));
|
||||
|
||||
if (windowSeconds == 0s)
|
||||
return true;
|
||||
|
||||
return (GameTime::GetSystemTime() - itr->second) > windowSeconds;
|
||||
}
|
||||
|
||||
sScriptMgr->SetRealmCompleted(achievement);
|
||||
|
||||
|
||||
@@ -674,4 +674,7 @@ void WorldConfig::BuildConfigCache()
|
||||
SetConfigValue<uint32>(CONFIG_SCOURGEINVASION_COUNTER_THIRD, "ScourgeInvasion.CounterThird", 150);
|
||||
|
||||
SetConfigValue<std::string>(CONFIG_NEW_CHAR_STRING, "PlayerStart.String", "");
|
||||
|
||||
// Achievement
|
||||
SetConfigValue<uint32>(CONFIG_ACHIEVEMENT_REALM_FIRST_KILL_WINDOW, "Achievement.RealmFirstKillWindow", 60);
|
||||
}
|
||||
|
||||
@@ -489,6 +489,7 @@ enum ServerConfigs
|
||||
RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER,
|
||||
CONFIG_NEW_CHAR_STRING,
|
||||
CONFIG_VALIDATE_SKILL_LEARNED_BY_SPELLS,
|
||||
CONFIG_ACHIEVEMENT_REALM_FIRST_KILL_WINDOW,
|
||||
|
||||
MAX_NUM_SERVER_CONFIGS
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user