feat: Adds configurable skill and stat gain (#1489)

### Summary

- Adds the following configurations:
```json
"stats.statMax": "125",
"stats.gainChanceMultiplier": 1.0,
"stats.primaryStatGainChance": 0.75,
"stats.gainDelay": "00:10:00",
"stats.petGainDelay": "00:05:00",
"stats.usePub45StatGain": "False"
```

- Adds Pub 45 stat gain rate for UOML+.
- Reduces the gain delay for legacy stat gain from 15 minutes to 10 minutes.
- Legacy gain no longer requires a gain in skill to gain in a stat.
This commit is contained in:
Vitalii Zurian 2023-10-14 21:02:36 +02:00 committed by GitHub
parent 29c7d839a7
commit f9517854d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 311 additions and 118 deletions

View file

@ -64,6 +64,12 @@ public static class ServerConfiguration
return bool.TryParse(strValue, out var value) ? value : defaultValue;
}
public static TimeSpan GetSetting(string key, TimeSpan defaultValue)
{
_settings.Settings.TryGetValue(key, out var strValue);
return TimeSpan.TryParse(strValue, out var value) ? value : defaultValue;
}
public static T GetSetting<T>(string key, T defaultValue) where T : struct, Enum
{
_settings.Settings.TryGetValue(key, out var strValue);