feat(Core/Achievements): Add configurable realm first kill time window (#24920)
This commit is contained in:
@@ -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