fix: Fixes undead slayer chance (#1135)

This commit is contained in:
mark1145 2022-08-03 14:21:37 +10:00 committed by GitHub
parent c4b814cc07
commit 41cc7e60d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -529,29 +529,12 @@ namespace Server.Items
return SlayerName.None;
}
var
group = groups[
Utility.Random(
groups.Length -
1
)]; // -1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
SlayerEntry entry;
// -1 To Exclude the Fey Slayer which appears ONLY on a certain artifact.
var group = groups[Utility.Random(groups.Length - 1)];
if (Utility.Random(100) < 10) // 10% chance to do super slayer
{
entry = group.Super;
}
else
{
var entries = group.Entries;
if (entries.Length == 0)
{
return SlayerName.None;
}
entry = entries.RandomElement();
}
// 10% chance for a super slayer
var entry = group.Entries.Length == 0 || Utility.Random(10) == 0
? group.Super : group.Entries.RandomElement();
return entry.Name;
}