set WeightedOdds for Vibration trigger

This commit is contained in:
Mercurio 2024-09-19 15:12:11 +02:00
parent 910e9d1473
commit 78b66c5023

View file

@ -107,7 +107,16 @@ namespace DalamudShock
var intensity = random.Next(0, Configuration.MaxValue);
var duration = random.Next(1000, Configuration.MaxDuration);
var type = isVibrationAllowed && random.Next(2) == 0 ? "shock" : "vibrate";
// Calculate the type based on weighted odds
var type = "shock";
if (isVibrationAllowed)
{
var chance = random.Next(1, 11);
if (chance > 8)
{
type = "vibrate";
}
}
var requestData = new[]
{
@ -121,6 +130,7 @@ namespace DalamudShock
};
var jsonContent = JsonConvert.SerializeObject(requestData);
var content = new StringContent(jsonContent, Encoding.UTF8, "application/json");