-
Notifications
You must be signed in to change notification settings - Fork 324
/
MagesGuild.cs
180 lines (147 loc) · 5.66 KB
/
MagesGuild.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
// Project: Daggerfall Unity
// Copyright: Copyright (C) 2009-2023 Daggerfall Workshop
// Web Site: http://www.dfworkshop.net
// License: MIT License (http://www.opensource.org/licenses/mit-license.php)
// Source Code: https://github.com/Interkarma/daggerfall-unity
// Original Author: Hazelnut
// Contributors:
using System.Collections.Generic;
using DaggerfallConnect;
using DaggerfallConnect.Arena2;
using DaggerfallWorkshop.Game.Entity;
namespace DaggerfallWorkshop.Game.Guilds
{
public class MagesGuild : Guild
{
#region Constants
protected const int IneligibleBadRepId = 612;
protected const int IneligibleLowSkillId = 611;
protected const int EligibleMsgId = 606;
protected const int WelcomeMsgId = 5293;
protected const int PromotionMsgId = 5236;
protected const int PromotionLibraryId = 5230;
protected const int PromotionMagicItemsId = 5231;
protected const int PromotionEnchantId = 5232;
protected const int PromotionSummonId = 5233;
protected const int PromotionTeleportId = 5234;
private const int factionId = (int)FactionFile.FactionIDs.The_Mages_Guild;
#endregion
#region Properties & Data
static List<DFCareer.Skills> guildSkills = new List<DFCareer.Skills>() {
DFCareer.Skills.Alteration,
DFCareer.Skills.Destruction,
DFCareer.Skills.Illusion,
DFCareer.Skills.Mysticism,
DFCareer.Skills.Restoration,
DFCareer.Skills.Thaumaturgy
};
static List<DFCareer.Skills> trainingSkills = new List<DFCareer.Skills>() {
DFCareer.Skills.Alteration,
DFCareer.Skills.Daedric,
DFCareer.Skills.Destruction,
DFCareer.Skills.Dragonish,
DFCareer.Skills.Harpy,
DFCareer.Skills.Illusion,
DFCareer.Skills.Impish,
DFCareer.Skills.Mysticism,
DFCareer.Skills.Orcish,
DFCareer.Skills.Restoration,
DFCareer.Skills.Spriggan,
DFCareer.Skills.Thaumaturgy
};
public override string[] RankTitles { get { return TextManager.Instance.GetLocalizedTextList("magesRanks"); } }
public override List<DFCareer.Skills> GuildSkills { get { return guildSkills; } }
public override List<DFCareer.Skills> TrainingSkills { get { return trainingSkills; } }
#endregion
#region Guild Membership and Faction
public static int FactionId { get { return factionId; } }
public override int GetFactionId()
{
return factionId;
}
#endregion
#region Guild Ranks
public override TextFile.Token[] TokensPromotion(int newRank)
{
return DaggerfallUnity.Instance.TextProvider.GetRandomTokens(GetPromotionMsgId(newRank));
}
private int GetPromotionMsgId(int newRank)
{
switch (newRank)
{
case 2:
return PromotionLibraryId;
case 3:
return PromotionMagicItemsId;
case 6:
return PromotionSummonId;
case 8:
return PromotionTeleportId;
default:
return PromotionMsgId;
}
}
#endregion
#region Benefits
public override bool HallAccessAnytime()
{
return (rank >= 6);
}
public override bool FreeMagickaRecharge()
{
if (IsMember() && GameManager.Instance.PlayerEntity.Career.NoRegenSpellPoints)
return true;
return false;
}
#endregion
#region Service Access:
public override bool CanAccessLibrary()
{
return (rank >= 2);
}
public override bool CanAccessService(GuildServices service)
{
switch (service)
{
case GuildServices.Training:
return IsMember();
case GuildServices.Quests:
return true;
case GuildServices.Identify:
return true;
case GuildServices.BuySpellsMages:
return true;
case GuildServices.MakeSpells:
return IsMember();
case GuildServices.BuyMagicItems:
return (rank >= 3);
case GuildServices.MakeMagicItems:
return (rank >= 5);
case GuildServices.Teleport:
return (rank >= 8);
case GuildServices.DaedraSummoning:
return (rank >= 6);
case GuildServices.BuySoulgems:
return (rank >= 4);
default:
return false;
}
}
#endregion
#region Joining
public override TextFile.Token[] TokensIneligible(PlayerEntity playerEntity)
{
int msgId = (GetReputation(playerEntity) < 0) ? IneligibleBadRepId : IneligibleLowSkillId;
return DaggerfallUnity.Instance.TextProvider.GetRandomTokens(msgId);
}
public override TextFile.Token[] TokensEligible(PlayerEntity playerEntity)
{
return DaggerfallUnity.Instance.TextProvider.GetRSCTokens(EligibleMsgId);
}
public override TextFile.Token[] TokensWelcome()
{
return DaggerfallUnity.Instance.TextProvider.GetRSCTokens(WelcomeMsgId);
}
#endregion
}
}