Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Random Function #241

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Security.Cryptography;
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.ClientState.Objects.Types;
using Dalamud.Game.ClientState.Statuses;
Expand Down Expand Up @@ -74,7 +75,7 @@ public enum Mode
private State _state = State.None;

public override HashSet<uint>? ValidTerritories => [1238];
public override Metadata? Metadata => new(8, "Garume");
public override Metadata? Metadata => new(9, "Garume");

private Config C => Controller.GetConfig<Config>();

Expand Down Expand Up @@ -168,7 +169,7 @@ public override void OnGainBuffEffect(uint sourceId, Status Status)
var myKindFire = GetKindFire(Player.Status);
var random = 0;
if (C.ShouldUseRandomWait)
random = new Random().Next((int)(C.WaitRange.X * 1000), (int)(C.WaitRange.Y * 1000));
random = RandomNumberGenerator.GetInt32((int)(C.WaitRange.X * 1000), (int)(C.WaitRange.Y * 1000));
Controller.Schedule(() =>
{
switch (myKindFire)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Security.Cryptography;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Game.ClientState.Objects.SubKinds;
using Dalamud.Game.ClientState.Objects.Types;
Expand Down Expand Up @@ -85,7 +86,7 @@ private IPlayerCharacter BasePlayer
private bool IsActive => Svc.Objects.Any(x => x.DataId == 17837) && !BasePlayer.IsDead;

public override HashSet<uint>? ValidTerritories => [1238];
public override Metadata? Metadata => new(6, "Garume, NightmareXIV");
public override Metadata? Metadata => new(7, "Garume, NightmareXIV");

private Config C => Controller.GetConfig<Config>();

Expand Down Expand Up @@ -255,7 +256,7 @@ public override void OnGainBuffEffect(uint sourceId, Status Status)
{
var random = 0;
if (C.ShouldUseRandomWait)
random = new Random().Next((int)(C.WaitRange.X * 1000), (int)(C.WaitRange.Y * 1000));
random = RandomNumberGenerator.GetInt32((int)(C.WaitRange.X * 1000), (int)(C.WaitRange.Y * 1000));
Controller.Schedule(() => { Chat.Instance.ExecuteCommand(C.CommandWhenBlueDebuff); }, random);
}

Expand Down