Skip to content

Commit

Permalink
Merge pull request #2478 from stellargames/2430-fix_unknown_god_names
Browse files Browse the repository at this point in the history
2430 fix %god macro for fighters guild
  • Loading branch information
Interkarma committed Jan 17, 2023
2 parents 53a682d + a9190c5 commit 9e94b76
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions Assets/Scripts/Game/Questing/QuestMCP.cs
Expand Up @@ -209,17 +209,16 @@ public override string God()
factionId = (int)GameManager.Instance.PlayerEnterExit.FactionID;
}
else
{
{
factionId = GameManager.Instance.PlayerGPS.GetTempleOfCurrentRegion();
}

if (factionId == 0)
if (factionId == 0 || factionId == (int)FactionFile.FactionIDs.The_Fighters_Guild)
{
// Classic returns "BLANK" if no temple is found, here we return a random deity name
const int minGodID = 21;
const int maxGodID = 35;
// 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.
var god = GetRandomDivine();

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

Expand Down Expand Up @@ -258,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 9e94b76

Please sign in to comment.