Skip to content

Commit

Permalink
Fix additional bug in the random divine selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVanEijden committed Dec 15, 2022
1 parent 597e9cf commit a9190c5
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Assets/Scripts/Game/Questing/QuestMCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,8 @@ public override string God()
{
// Classic returns "BLANK" if no temple is found, here we return a random deity name.
// We do the same for Fighters Guild halls, which are are considered temples in some areas.
const int minGodID = 21;
const int maxGodID = 35;
var god = GetRandomDivine();

FactionFile.FactionIDs god = (FactionFile.FactionIDs)UnityEngine.Random.Range(minGodID, maxGodID + 1);
return god.ToString();
}

Expand Down Expand Up @@ -259,6 +257,22 @@ public override string Direction()

return TextManager.Instance.GetLocalizedText("resolvingError");
}

private static FactionFile.FactionIDs GetRandomDivine()
{
switch (UnityEngine.Random.Range(0, 9))
{
case 0: return FactionFile.FactionIDs.Arkay;
case 1: return FactionFile.FactionIDs.Zen;
case 2: return FactionFile.FactionIDs.Mara;
case 3: return FactionFile.FactionIDs.Ebonarm;
case 4: return FactionFile.FactionIDs.Akatosh;
case 5: return FactionFile.FactionIDs.Julianos;
case 6: return FactionFile.FactionIDs.Dibella;
case 7: return FactionFile.FactionIDs.Stendarr;
default: return FactionFile.FactionIDs.Kynareth;
}
}
}
}
}

0 comments on commit a9190c5

Please sign in to comment.