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

Allow guild quests to be dispensed by player level as well as rank #2688

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions Assets/Scripts/Game/Guilds/Guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public abstract class Guild : IGuild

public abstract List<DFCareer.Skills> TrainingSkills { get; }

public virtual bool IsSatisfyQuestReqByLevel()
{
return false;
}

#endregion

#region Guild Ranks
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/Game/Guilds/IGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public interface IGuild : IMacroContextProvider

List<DFCareer.Skills> TrainingSkills { get; }

bool IsSatisfyQuestReqByLevel();

#endregion

#region Guild Ranks
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/Game/Guilds/KnightlyOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public enum Orders

public override List<DFCareer.Skills> TrainingSkills { get { return null; } }

public override bool IsSatisfyQuestReqByLevel()
{
return true;
}

#endregion

#region Knightly Order
Expand Down
5 changes: 5 additions & 0 deletions Assets/Scripts/Game/Guilds/MagesGuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public class MagesGuild : Guild

public override List<DFCareer.Skills> TrainingSkills { get { return trainingSkills; } }

public override bool IsSatisfyQuestReqByLevel()
{
return true;
}

#endregion

#region Guild Membership and Faction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,14 @@ protected override void GetQuest()
// Get the faction id for affecting reputation on success/failure
int factionId = GetFactionIdForGuild();

// Set the effective guild rank, player level can override for some guilds. (e.g. Mages/Knights)
int rank = guild.Rank;
if (guild.IsSatisfyQuestReqByLevel() && playerEntity.Level > rank)
rank = playerEntity.Level;

// Set up a pool of available quests.
QuestListsManager questListsManager = GameManager.Instance.QuestListsManager;
questPool = questListsManager.GetGuildQuestPool(guildGroup, status, factionId, guild.GetReputation(playerEntity), guild.Rank);
questPool = questListsManager.GetGuildQuestPool(guildGroup, status, factionId, guild.GetReputation(playerEntity), rank);

// Show the quest selection list if that feature has been enabled.
if (DaggerfallUnity.Settings.GuildQuestListBox)
Expand Down