EXAMPLE:
Code: Select all
case 4215: return CreateTokens(TextFile.Formatting.JustifyLeft,
"corrupt knights",
"oppressive warriors",
"berserker soldiers"
);
Code: Select all
case 4215: return CreateTokens(TextFile.Formatting.JustifyLeft,
"corrupt knights",
"oppressive warriors",
"berserker soldiers"
);
Code: Select all
using UnityEngine;
using DaggerfallWorkshop.Game;
using DaggerfallWorkshop.Game.Utility.ModSupport;
using DaggerfallWorkshop.Utility;
using DaggerfallConnect.Arena2;
using DaggerfallWorkshop;
namespace HistoryFixesMod
{
public class HistoryFixes : MonoBehaviour
{
private static Mod mod;
[Invoke(StateManager.StateTypes.Start, 0)]
public static void Init(InitParams initParams)
{
mod = initParams.Mod;
var go = new GameObject(mod.Title);
go.AddComponent<HistoryFixes>();
mod.IsReady = true;
}
private void Start()
{
DaggerfallUnity.Instance.TextProvider = new TextProvider(DaggerfallUnity.Instance.TextProvider);
}
}
class TextProvider : FallbackTextProvider
{
public TextProvider(ITextProvider fallback)
: base(fallback)
{
}
public override TextFile.Token[] GetRSCTokens(int id)
{
// Corrections to text strings that contribute to the class histories accessible in your character sheet
switch(id)
{
case 4119: return CreateTokens(TextFile.Formatting.JustifyLeft,
"Your parents complemented one another, both as sorcerers as",
"well as educators. Your mother was most attentive in teaching",
"you the finer points of %q1,",
"but your father would use more dramatic methods. As you grew",
"in your talents and your mother taught you the spells, your",
"father would show you how you must attract and draw upon the",
"magicka of the universe to have the power to cast those spells.",
"He explained that you, like them, were not able to regenerate",
"magicka within your own body. It was commonplace for him to",
"walk in the room and cast a lightning spell at you. Frightful",
"though it was, you would feel exhilaration upon drawing upon",
"the magicka.",
" ",
"As you grew, it was apparent that you had unusually strong",
"magical powers. Soon you were able to %q1a",
"yourself. You remember your parents talking about an evil",
"Battlemage, Jagar Tharn, how it was known in their circle",
"that he had usurped the power of the land away from its",
"rightful ruler. No one dared to move against him.",
"%q2.",
"One day in your twentieth year, a courier arrived at your",
"house with the news that a powerful hero had killed",
"Jagar Tharn and restored the rightful Emperor to the throne.",
"Even your gruff father nearly wept with joy at the news.",
" ",
"The courier also brought the news that there would be a great",
"celebration in Imperial City and that all the people who had",
"worked secretly to depose Tharn were invited. Once the",
"courier left, you asked your parents if you could go to the",
"celebration. Your mother and father looked concerned and",
"explained that there was not enough gold for all three of you",
"to make the trip. Downcast, you tried to hide your",
"disappointment. Your father, however, turned to you and said",
"that it was time you made your own way in the world. He gave",
"you %q4 and a very unusual staff",
"and sent you on your way to the Imperial City and the",
"celebration.",
" ",
"After many days of travel, you approached the capital of the",
"realm -- Imperial City. You noticed a small band of travelers",
"a short distance in front of you. As you were about to hail",
"them, they were attacked by brigands who had been lying in",
"wait in the woods that lined the road. As you rushed to help,",
"one of the brigands, obviously a Mage, raised his staff and",
"cast a spell at you. Your ears roared as the flame bolt hit",
"you, but you absorbed the magicka and let fly a very powerful",
"shock spell. When the bolt struck the brigand mage, he erupted",
"into a column of flames and was reduced to a pile of ashes.",
"The brigands and the travelers all stopped and stared, and the",
"brigands ran back into the woods. The travelers thanked you",
"and introduced themselves as members of the Imperial Family",
"returning to Imperial City for the celebrations. They insisted",
"that you come with them to the palace and have an audience",
"with the Emperor.",
" ",
"The Emperor was very impressed by your bravery and knew",
"your family as loyal supporters of the Empire. He presented",
"you with %q5. The celebrations continued for",
"weeks, and the Emperor often called on you for informal talks.",
"When you were not in audience, you usually spent your time",
"%q3.",
"One night you were called to the Emperor's presence in a",
"manner such that you knew the business was serious. He",
"met you in his study and there told you he had a favor",
"to ask."
);
case 4122: return CreateTokens(TextFile.Formatting.JustifyLeft,
"Your parents traveled with a carnival throughout your youth,",
"so you were exposed to the best and worst of Tamriel. From your",
"mother you learned how to %q1.",
"From your father you learned many things -- how to",
"%q2, to %q3,",
"and the rudiments of %q4.",
"All could be used for defense as well as entertainment.",
" ",
"The years between your tenth and twentieth birthdays are among",
"the worst Tamriel has ever suffered. The carnival was not such",
"a happy place, and movement within the land was severely",
"restricted. Agents of the Emperor would search the countryside",
"for enemies of the Empire and would question all quite rudely.",
"You always hoped that such a refugee would make his way to the",
"carnival, and then one day, one did. When the bedraggled young",
"man was hidden away, you had your opportunity to have fun with",
"the Imperial agents. Gleefully, you convinced half of the agents",
"that you were their commanding officer in disguise and sent",
"them after the other agents, insisting they were double-",
"agents. It turned out to be your last prank. You were",
"shortly after jailed as an enemy of the Emperor.",
" ",
"When the true Emperor took his throne back from the usurper",
"Jagar Tharn, all political prisoners, including you, were",
"released from the dungeons. You and only you were bathed,",
"dressed in fine clothing, and presented to the Emperor",
"himself. Emperor Uriel told you that the young man whose",
"life you saved at the carnival was his own son, the prince",
"%imp. The Emperor congratulated you on your",
"ability to charm, confuse, and befuddle and gave you",
"%q6 as a token of his appreciation.",
"He also asked you for a special favor."
);
case 4124: return CreateTokens(TextFile.Formatting.JustifyLeft,
"You grew up on the streets, an urchin in your little village",
"in the %hpw of %hpn. You do not know when you",
"first learned to %q1 or to %q2 or when",
"%q3.",
"You only know that your skills and your philosophy are what",
"kept you alive and sane during the dark years when Jagar Tharn",
"usurped the throne of the rightful emperor. Tharn's agents",
"even searched out your little village, looking for political",
"dissidents and other undesirables. Those they found",
"disappeared forever.",
" ",
"For the benefit of all, an uneasy alliance formed between you",
"and all the other villagers who were in questionable lines of",
"work. One night, you witnessed a ragged boy being pursued by",
"a dozen blackclad agents of Jagar Tharn. You took a shortcut",
"through the alleys to meet the boy, and it took little effort",
"to convince him to run with you. The two of you stole into a",
"concealed cellar and waited for the agents to pass. The boy",
"was obviously not from the village, and when you asked him",
"his name, he told you, hesitantly, %imp.",
"You laughed at his royal sounding name, and he told you very",
"seriously that he was the son of the rightful ruler of Tamriel",
"and that an imposter was on the throne. At the time, you",
"humored his boyish imagination. Now, of course, you know that",
"he was telling the truth. You told him the best way out of the",
"village, avoiding the areas frequented by the blackclad ones,",
"and he told you that when he saw his father again, you would",
"be properly thanked for that act of kindness.",
" ",
"Some years later, your luck ran out and you were imprisoned",
"on the charge of %q4.",
"You had been in jail for several days when you received a",
"visitor in the full regalia of an Imperial courier. He told",
"you that in reward for your service to Prince %imp,",
"you were granted a full pardon and %q5",
"You were also given a simple, unpretentious letter inviting",
"you to the Imperial City for an audience with the Emperor. You",
"had your eyes set on a bigger fishpond anyhow, so you went."
);
case 4125: return CreateTokens(TextFile.Formatting.JustifyLeft,
"You grew up on a farm and became quite agile from",
"continually rounding up wandering sheep. One Merchants",
"Festival, while visiting the village with your family, you",
"were intrigued with a group of wandering acrobats and decided",
"that you wanted to become an acrobat yourself. At home you",
"started practicing even though your parents complained that",
"you were neglecting your duties. Finally, when you were just",
"old enough to be called an adult, you ran away from home.",
" ",
"You never did find that carnival troupe. You wandered to a small",
"village deep in the %hpw and learned to %q1",
"and to %q2 and",
"%q3.",
" ",
"You know that your skills and your philosophy are what",
"kept you alive and sane during the dark years when Jagar Tharn",
"usurped the throne of the rightful emperor. Tharn's agents",
"even searched out that little village, looking for political",
"dissidents and other undesirables. Those they found",
"disappeared forever.",
" ",
"For the benefit of all, an uneasy alliance formed between you",
"and all the other villagers who were in questionable lines of",
"work. One night, you witnessed a ragged boy being pursued by",
"a dozen blackclad agents of Jagar Tharn. You took a shortcut",
"through the alleys to meet the boy, and it took little effort",
"to convince him to run with you. The two of you stole into a",
"concealed cellar and waited for the agents to pass. The boy",
"was obviously not from the village, and when you asked him",
"his name, he told you, hesitantly, %imp.",
"You laughed at his royal sounding name, and he told you very",
"seriously that he was the son of the rightful ruler of Tamriel",
"and that an imposter was on the throne. At the time, you",
"humored his boyish imagination. Now, of course, you know that",
"he was telling the truth. You told him the best way out of the",
"village, avoiding the areas frequented by the blackclad ones,",
"and he told you that when he saw his father again, you would",
"be properly thanked for that act of kindness.",
" ",
"Some years later, your luck ran out and you were imprisoned",
"on the charge of %q4.",
"You had been in jail for several days when you received a",
"visitor in the full regalia of an Imperial courier. He told",
"you that in reward for your service to Prince %imp,",
"you were granted a full pardon and %q5",
"You were also given a simple, unpretentious letter inviting",
"you to the Imperial City for an audience with the Emperor. You",
"had your eyes set on a bigger fishpond anyhow, so you went."
);
case 4126: return CreateTokens(TextFile.Formatting.JustifyLeft,
"You might not ever have been a thief, for you had been",
"raised and trained from an early age to be %q1.",
"Until the fateful day when the caravan your master,",
"%mn, and you were traveling in",
"was waylaid by an orc tribe, you were content that your place in",
"life was set. Suddenly, everything you believed in was proved",
"false. The treacherous %q1a you had put",
"your faith in sacrificed you in order that he might escape the",
"orcs. Though you managed to survive in your new role as a",
"captive of the orcs, you never again would trust",
"%q1.",
" ",
"You had grown up among the superstitious people in the backwater",
"%hpw of %hpn, and had believed that orcs",
"were demons or daedra, but you found the tribe to be surprisingly",
"civil. They needed a %ra to interpret the books they",
"had found about the ancient orcish capital of Orsinium. As you",
"stayed with them and learned their language, you developed a",
"respect for their primitive but noble ambitions. Nevertheless,",
"you knew that you needed the society of other %ra",
"people, so when the opportunity rose, you escaped.",
" ",
"Times were difficult all over %hpn, but you found",
"that the %q2 and %q3 skills you had",
"developed in the orc camp allowed you to be a fairly successful",
"thief. One night, while ransacking a nobleman's townhouse, you",
"came across correspondence between him and the former Imperial",
"Battlemage Jagar Tharn. You sold these to a contact you had in",
"town for more gold than you anticipated they would be worth.",
"You did not realize their full value until you received a",
"visit from Prince %imp in your room at the tavern.",
" ",
"He told you that Jagar Tharn had been magically impersonating",
"his father for the past ten years, and only recently had the",
"true Emperor been restored. Loyal subjects like you were rare",
"and the Emperor wished to thank you personally. You traveled",
"with Prince %imp to the Imperial City and",
"there you were presented to the Emperor. He was indeed very",
"grateful for your service and gave you %q4.",
"He also asked you for a favor."
);
case 4127: return CreateTokens(TextFile.Formatting.JustifyLeft,
"You grew up on the streets, an urchin in your little village",
"in the %hpw of %hpn. You do not know when you",
"first learned to %q1 or to %q2 or when",
"%q3.",
"You only know that your skills and your philosophy are what",
"kept you alive and sane during the dark years when Jagar Tharn",
"usurped the throne of the rightful emperor. Tharn's agents",
"even searched out your little village, looking for political",
"dissidents and other undesirables. Those they found",
"disappeared forever.",
" ",
"For the benefit of all, an uneasy alliance formed between you",
"and all the other villagers who were in questionable lines of",
"work. One night, you witnessed a ragged boy being pursued by",
"a dozen blackclad agents of Jagar Tharn. You took a shortcut",
"through the alleys to meet the boy, and it took little effort",
"to convince him to run with you. The two of you stole into a",
"concealed cellar and waited for the agents to pass. The boy",
"was obviously not from the village, and when you asked him",
"his name, he told you, hesitantly, %imp.",
"You laughed at his royal sounding name, and he told you very",
"seriously that he was the son of the rightful ruler of Tamriel",
"and that an imposter was on the throne. At the time, you",
"humored his boyish imagination. Now, of course, you know that",
"he was telling the truth. You told him the best way out of the",
"village, avoiding the areas frequented by the blackclad ones,",
"and he told you that when he saw his father again, you would",
"be properly thanked for that act of kindness.",
" ",
"Some years later, your luck ran out and you were imprisoned",
"on the charge of %q4.",
"You had been in jail for several days when you received a",
"visitor in the full regalia of an Imperial courier. He told",
"you that in reward for your service to Prince %imp,",
"you were granted a full pardon and %q5",
"You were also given a simple, unpretentious letter inviting",
"you to the Imperial City for an audience with the Emperor. You",
"had your eyes set on a bigger fishpond anyhow, so you went."
);
case 4177: return CreateTokens(TextFile.Formatting.JustifyLeft,
"the Orcs from a nearby stronghold"
);
case 4213: return CreateTokens(TextFile.Formatting.JustifyLeft,
"corrupt marketeers",
"extortionate traders"
);
case 4215: return CreateTokens(TextFile.Formatting.JustifyLeft,
"corrupt knights",
"oppressive warriors",
"berserker soldiers"
);
case 4227: return CreateTokens(TextFile.Formatting.JustifyLeft,
"learned scholar"
);
case 4230: return CreateTokens(TextFile.Formatting.JustifyLeft,
"converse with the Orcs"
);
case 4409: return CreateTokens(TextFile.Formatting.JustifyLeft,
"jumping high and long",
"developing your jumping ability"
);
case 4435: return CreateTokens(TextFile.Formatting.JustifyLeft,
"the mischievous imps of Oblivion"
);
case 4443: return CreateTokens(TextFile.Formatting.JustifyLeft,
"wealthy merchant",
"rich merchant"
);
case 4652: return CreateTokens(TextFile.Formatting.JustifyLeft,
"a scholar",
"an intellectual"
);
case 4653: return CreateTokens(TextFile.Formatting.JustifyLeft,
"scholar"
);
}
return base.GetRSCTokens(id);
}
}
}
Code: Select all
public static TextFile.Token[] CreateSimpleTokens(string line)
{
return new TextFile.Token[] { new TextFile.Token(TextFile.Formatting.Text, line), new TextFile.Token(TextFile.Formatting.EndOfRecord) };
}
public static TextFile.Token[] CreateSimpleTokens(string[] lines)
{
return CreateFormattedTokens(TextFile.Formatting.NewLine, lines);
}
public static TextFile.Token[] CreateFormattedTokens(TextFile.Formatting formatting, params string[] lines)
{
List<TextFile.Token> tokens = new List<TextFile.Token>();
foreach (string line in lines)
{
tokens.Add(new TextFile.Token(TextFile.Formatting.Text, line));
tokens.Add(new TextFile.Token(formatting));
}
tokens.Add(new TextFile.Token(TextFile.Formatting.EndOfRecord));
return tokens.ToArray();
}
public static TextFile.Token[] CreateAlternativeTokens(params string[] lines)
{
if (lines.Count() == 0)
return Enumerable.Empty<TextFile.Token>().ToArray();
List<TextFile.Token> tokens = new List<TextFile.Token>();
for(int i = 0; i < lines.Count() - 1; ++i)
{
tokens.Add(new TextFile.Token(TextFile.Formatting.Text, lines[i]));
tokens.Add(new TextFile.Token(TextFile.Formatting.SubrecordSeparator));
}
tokens.Add(new TextFile.Token(TextFile.Formatting.Text, lines[lines.Count() - 1]));
tokens.Add(new TextFile.Token(TextFile.Formatting.EndOfRecord));
return tokens.ToArray();
}