Morag Tong Guide
Morag Tong writs in both vanilla Morrowind and in TR follow a very standardised formula. This means much of the implementation work will just be copy-pasting, but it also means that a lot of abstract scripting has to run in the background to be able to handle all those standardised processes. Once you know how the system works it's very quick to add more writs to it, but it's also not as intuitive as adding quests for other factions, so be sure to follow this guide step by step if it's your first Morag Tong claim. It's also a good idea to look through already-implemented claims, as you will be able to copy and paste large parts between writs.
This guide assumes a general familiarity with NPC scripts and dialogue filtering. If you have any questions, ask on discord.
Adding a new Master
Due to the structure of Morag Tong quests, your claim might only require you to add new targets, not a new master. In this case you can skip this section.
Note that for now this guide is only about adding questgivers of the rank "Master", which is what the chapter leaders in Balmora, Sadrith Mora and Ald-ruhn are, as well as the three in Akamora, Andothren and Almas Thirr. Vanilla also has a rank between Master and Grandmaster called "Exalted Master", but no vanilla NPC has that rank. If we add questgivers of this rank to TR, this section will have to be revised to take them into account.
Every Master has a unique script on them that defines for which zones they hand out writs. This is done with a list of short locals, defined at the start of the script, next to the locals every TR NPC has. The script follows the naming convention of TR_mX_Name_MT_scr. To find which locals need to be defined on your new NPC, look at the map on the left. At every location with a MT chapter you will see a list of green numbers - those are the locals you need to add. For example, the Master in Andothren hands out writs for zones 1,2,4,5 and so her script has:
short TR_MT_zone_1 short TR_MT_zone_2 short TR_MT_zone_4 short TR_MT_zone_5
Keep in mind that outside of the already implemented writs this map is largely speculative, and the location of MT guildhalls and exact boundaries will change as development moves along.
But the way to determine which locals go on your NPC will stay the same.
Now there is only one more line we need to add - the one that will play if you have exhausted all available writs in this location. This is the only line that will actually get filtered to your new master specifically, so it can be more personalised. Use it to specify (relatively) nearby guildhalls that the player shoud check out if they haven't done so yet. Add it above the "I have no writs for you at this time."-line.
Once a Master with the correct locals has been added and placed, they will immediately become fully functional - handing out and accepting writs for their assigned area (note that they do not handle joining and advancement, for now this is reserved for the Grandmaster).
Adding a new target
What makes a good target?
- The player will usually not be told why their target has been marked for death. This means we don't have to invent an in-depth rationale like we would have to do with other quests, but it's still good to have at least a vague reason in your head, even if it's never said in the final quest. MT targets shouldn't just feel random, they should offer glimpses into power struggles and feuds going on behind the curtains.
- MT quests use a mix of non-hostile targets in settlements and hostile targets like outlaws or cultists. They are a good excuse to make the player travel to places they might otherwise miss
- MT writs predominantly target native Dunmer, although there can be rare exceptions, like Larius Varro in Fort Moonmoth. The Morag Tong is a traditional Dunmer institution mostly getting hired as a result of internal politics, and as such usually doesn't target outlanders and imperial institutions.
- MT writs very often target mid- to high-ranking members of the Great Houses. See the last point. Of course, more advanced missions skew toward targetting higher-ranked NPCs.
- For reference, the 18 writs handed out in vanilla go to: 2 Redoran, 2 Hlaalu, 6 Telvanni, 1 Legion and 7 factionless (of which one is called an Ashlander and two are called Camonna Tong members).
As a MT assassin you (hopefully) carry a writ that means your bounty gets cleared if a guard apprehends you for a killing. This is a fun, unique system, but it also means you need to consider the reactions of other NPCs around the target who witness the crime.
- Do not put a Guard (as in, an NPC with the class Guard, who is programmed to apprehend players with a bounty) in the same interior cell as your target, or nearby in the case of an exterior cell. Vanilla avoided this for every single MT writ, even Larius Varro, and with very good reason. If you got a bounty for striking your opponent but haven't killed them yet, a guard in the same cell will try to arrest you while you are still fighting your target. This causes all kinds of weird behaviour. If you want to create a writ on a target who shares the cell with a guard, one way to solve this is by replacing that generic guard with a unique version who does not have the "Guard" character class. Of course, this also means they won't act like a guard for ANY purpose.
- Other NPCs in the int with a high enough Alarm value will also come to your target's aid. In large ints like an inn this can be a problem, as suddenly the player is fighting eight strangers along with their target, and that can get messy quickly. Of course, this is not always bad, if your target has nearby friends and allies they SHOULD help them.
- A writ clears your bounty, but it does not clear getting expelled from a faction. This makes writs on members of your own faction significantly more complicated, and should be taken into account when selecting targets.
Many writs get around this by either making the target hostile on sight or on talking to them as soon as the player has the quest active. This makes killing them count as self-defence, and solves the problem. But it also undermines the whole writ mechanic and removes the incentive to kill them stealthily. Conversely, some writs even UP the difficulty by making the target Goodbye you when you talk to them (but without making them hostile), meaning you can't use Taunt to make them attack you first, and so the only options are a stealth kill or a frenzy spell. It's up to you to decide how you want this to play out.
But now for the actual implementation.
Determine the zone of your target
Writ targets in TR, like vanilla are not assigned to one particular questgiver, rather they are assigned a zone number based on where the target is. So the first step is looking at the map and finding the zone your target will be in.
We are going to use Indriri Veram as our example of the platonic ideal of a MT writ target with no frills attached.
She is in Uman in the southern Velothi Mountains, which is part of zone 5.
Important: these zones only exist for how we organise writs. They are not in any way an "in-game thing". No MT questgiver will ever talk about their zones. They will, however, tell you which guildhalls you should report your particular successful writs to, as otherwise the player would have no in-game way of tracking where they need to go after the target is dead.
Place your target in the Writ Master List
Now take a look at this spreadsheet: https://docs.google.com/spreadsheets/d/12hhwT6vtexK3sxThpwjArtaOPt0ncfAKGoQ9fbDdIOY
It lists ALL writs added by TR. As no standard writ is assigned to one particular questgiver, the order in which they are given out has to be defined globally. The goal is to have them all sorted roughly by difficulty, from least to most challenging, but this is not an exact science, so don't worry too much about it. Decide where to put your target(s), add them to the list, and note whichever targets are above and below them.
Important: If several consecutive targets on the list are in the same zone, their writs can be handed out at the same time. So don't add a new target in between two targets that the Notes column says are handed out together
Add the Journal
All MT writs follow the same basic quest structure, and use a very formalised and standardised language:
- ID: TR_mX_MT_Name - in our case this is TR_m3_MT_Indriri (the map number is 3 because this writ was implemented as part of the Almas Thirr redo, which is in m3, even if the target herself is in m4)
- Name: Morag Tong: Writ for Name - quest name
- Stage 10: Says that you got the writ, and gives specifics on who or where your target is.
- Stage 80: Says that you killed your target, and got reported for it.
- Stage 90: Says that you killed your target, and did not get reported for it.
- Stage 100: Says that you reported the execution and sets it as finished
- Stage 110: Exact same text and function as 100, but will get set if you executed them without being reported.
For most cases, all you should do is substitute in the name of your target and change the description for Stage 10, although some writs might require a change in phrasing. Sometimes writs may also include extra complications that require additional journal stages. However, stages 10, 80, 90, 100 and 110 should always be reserved as outlined above, as the scripts you will later use are written for those variables.
Add the actual writ item
This is a quick step, as all the writs are almost exactly the same. Open any existing writ added by TR, change the ID and save as a new object. Your ID is TR_mX_MT_writ_name, in our case this is TR_m3_MT_writ_indriri. Then add the name of your target in the actual text of the writ.
Implement the new dialogue in the "Writ" topic.
All writs, both vanilla and TR, are handed out through the same "Writ" topic, where they are all in a long list. Unlike how we usually implement questlines, a writ closer to the top of the list will get handed out EARLIER than one further down, neatly corresponding to how they are ordered in the spreadsheet from earlier.
Find the two existing writs that your new target goes in between, and add a new response there. You can vary the line a bit between writs, but it's basically always just telling the player that there is a writ available. This response must always be filtered in the following way:
- Faction: Morag Tong - speaker is in the MT
- Rank: Master - speaker is of rank Master
- PC Faction: Morag Tong - player is in the MT
- Local: TR_MT_zone_X = 0 - replace X with the zone number your target is in that you determined in step 1, but always leave the = 0. In Indiri's case this is TR_MT_zone_5
- Journal: TR_mX_MT_Name < 100 - this is the quest you created earlier, so TR_m3_MT_Indriri for us
In the case of the Indriri writ, it's made available at the same time as the writ on Almse Ramaran, who is also in zone 5. In this case you need 3 lines instead of 1 - one for when the player hasn't completed either, one for when they have completed Almse only, and one for when they have completed Indriri only. So in the first case the line is filtered to TR_m4_MT_Almse < 100 and TR_m3_MT_Indriri < 100, in the second case to TR_m4_MT_Almse >= 100 and TR_m3_MT_Indriri < 100, and in the third case to TR_m4_MT_Almse < 100 and TR_m3_MT_Indriri >= 100.
Also put Addtopic "Name" in the results, so the topic is sure to show up. We will create it in the next step
Create the writ-specific topic OR add to an existing one
The topic that deals with the handing out and cashing in of writs is always simply named after the target. So we create "Indriri Veram", a topic that previously didn't exist, which makes the next step easier for us (see below for what to do when a topic already exists)
Like the writs, this follows a standardised formula, although there is more room for individual touches here. Again, all the lines get filtered to NPCs who are Master rank in the MT, to players who are in the MT, and most of them to Local TR_MT_zone_X = 0.
- At the very top is a line that checks for if the player has been expelled, in which case questgivers (any questgivers) will not talk about any of the writs:
- Second is a generic line that gets filtered to Journal TR_mX_MT_Name >= 100 and that's some variation of "X is dead/You have killed X etc." This also applies to all questgivers, and is just flavour to you let reminisce about all the people you murdered.
- Third is the line that comes up when the player has killed the target before taking the writ. As such, it's filtered to the relevant quest still being at stage 0, and to the target being dead. The result immediately sets the stage to 100. The usual outcome is that the player receives faction reputation, does NOT receive gold, and loses disposition with the Master, although this might be different in special cases (they shouldn't be mad at you if you killed an outlaw in self-defence, but they still won't pay you on principle). Note that this and the following lines now have a TR_MT_zone_X local filter to only apply to correct questgivers.
- Fourth and fifth are two identical lines commending the player for killing the target. One is filtered to stage 80 (reported killing) and one to stage 90 (unreported killing). They set the quest to stage 100 or 110 respectively. Both have the same faction reputation and gold reward, but undetected gives twice as much disposition with the master (it's honestly pretty redundant, but that's how vanilla set it up...)
- Sixth and seventh are both filtered to the quest being at stage 10. The shorter version is for when the player has the writ in their inventory, the longer is for when they don't. You could vary the exact wording, but it's probably not worth it, just copy the vanilla message.
- The eight line is where all the interesting stuff goes - details on your target, where they are, any additional info you want to give the player. But keep in mind that MT writs tend to be light on details, because it's not your job as the assassin to know WHY your target has been marked for death, just that they are. This line is filtered to the quest not having started yet and the results set it to stage 10, give the player the writ, and do any other relevant operations like marking something on the map.
- Finally, the ninth line is for any MT master who is not one of the ones responsible for this writ, so they will instead direct you to the guildhalls who are. This should be a standardised text in the form of "This writ should be reported to the Masters in X, Y, or Z.".
If you are dealing with a topic that already exists, because there is some existing dialogue about this NPC that's unrelated to your MT claim, you will need an extra condition to prevent getting the writ too early. Take a look at the Writ Master List again, and find whoever is the person that shares the same zone as your target and comes before them in the list. If there is none, you can leave it like that. If there is one, set that respective quest (or quests in the case of multiple writs at the same time) being completed as a prerequisite for the Master telling you about the writ. For example, here is the writ on Nalvos Omayn, who comes up in other quests as well. It's filtered to TR_m4_MT_Llirala and _Serali both being at >= 100, so you can never get it before completing those.
It's of course possible that the target you are adding right now is the reason another target further down the line needs to filter to YOUR quest from now on. If you aren't sure if you should change this yourself, just note it in the merge notes, and the quest reviewer will take care of it as your claim gets merged.
Thankfully, even if this doesn't prevent all cases of it firing early, it can't actually break the quests - all that will happen is that the Master gives and accepts a writ that they would have available anyway, just sooner than intended. It will not skip any of the quests.
In many cases you yourself might want to add additional lines to the topic, such as other people being able to tell you where your target is. In that case, it's a good idea to add a filter checking for if the player has already taken the quest, to avoid accidentally tripping the topic in general NPC dialogue. Here is an example for Felrar Berathi, whose name comes up in random conversation around town, so the Journal filter prevents getting the topic too early. In this case the line is filtered to stage 10 and to him not being dead, but of course you can also add lines that fire only WHEN the target is dead instead, if it makes sense for your claim.
Put a target script on your target.
Every writ target requires a unique script put on them. But conveniently, Bethesda already wrote that for us. Here is the script for our example target Indriri:
Begin TR_m3_MT_WritIndriri short CL1 short CL2 short TR_map short control short controlQ short nolore short T_Local_NPC set TR_map to 4 if ( MenuMode == 1 ) return endif if ( CellChanged == 1 ) set CL1 to GetPCCrimeLevel endif if ( OnDeath == 1 ) ; when we are killed... if ( GetJournalIndex TR_m3_MT_Indriri > 0 ) ; ... and if the player has a writ for us... set CL2 to GetPCCrimeLevel if ( CL2 > CL1 ) ; ... append a journal entry if the execution is seen ... Player->Journal TR_m3_MT_Indriri 80 else ; ... append a journal entry if the execution is NOT seen ... Player->Journal TR_m3_MT_Indriri 90 endif endif endif End
The script name is always formatted as TR_mX_MT_WritName. She has all the normal TR locals and map variable (and if she were a Khajiit she'd need the segment that deals with recognising the different types of Khajiit as the same race too), with the addition of CL1 and CL2. Those two are used to determine if the killing was reported or not. All you have to do now is change the GetJournalIndex and the two Player->Journal to your quest ID, and you're done. (the player-> bit isn't doing anything and the lines that start with ; are just comments, so you could delete them to make your script shorter. I've just left them in because Bethesda did)
Add your target to the CalcLegitKills and RemoveWrits scripts
These two scripts are responsible for you being able to turn in your writs to guards after you've done your contracted killing. In vanilla, this was done by one consolidated script, but for TR we quickly hit the max length of scripts Morrowind handles without issue (which seems to be at or around 256 lines). So we have to use multiple scripts.
Open TR_MT_CalcLegitKillsX - X is whatever the highest available number is. Right now only TR_MT_CalcLegitKills1 exists, but by the time you read this it might be up to 4 or 5 or 10, so take the biggest number. Here you will see a lot of repetitive code, and all you need to do is add your own repetition. It should always look like this:
if ( GetJournalIndex TR_mX_MT_Name == 80 ) if ( Player->GetItemCount "TR_mX_MT_Writ_Name" > 0 ) set MT_LegitKills to ( MT_LegitKills + 1 ) endif endif if ( GetJournalIndex TR_mX_MT_Name == 100 ) if ( Player->GetItemCount "TR_mX_MT_Writ_Name" > 0 ) set MT_LegitKills to ( MT_LegitKills + 1 ) endif endif
Here is how it should look when you are done, again using Indriri's writ as an example:
Save this script and open TR_MT_RemoveWritsX - again, highest number. You will add another repetition in here, this time it's:
if ( MT_LegitKills > 0 ) if ( GetJournalIndex TR_mX_MT_Name >= 80 ) if ( GetJournalIndex TR_mX_MT_Name < 110 ) if ( Player->GetItemCount "TR_mX_MT_Writ_Name" > 0 ) set MT_LegitKills to ( MT_LegitKills - 1 ) Player->RemoveItem "TR_mX_MT_Writ_Name" 1 endif endif endif endif
and again, here is how it should look in our example:
And with that, you're done. It looks very long and complicated when written out in exhaustive detail, but it really is just a lot of copy/paste. MT writs are a bit tedious to make, but for targets following this standard formula without any extra complications, you can make them very quickly, with very little writing and no scripting beyond what's indicated above necessary.
But what if the scripts get too long?
Then you need to add the next iteration of the CalcLegitKills and RemoveWrits scripts.
- Copy this script:
Begin TR_MT_RemoveWritsX if ( MT_LegitKills > 0 ) if ( GetJournalIndex TR_mX_MT_Name >= 80 ) if ( GetJournalIndex TR_mX_MT_Name < 110 ) if ( Player->GetItemCount "TR_mX_MT_Writ_Name" > 0 ) set MT_LegitKills to ( MT_LegitKills - 1 ) Player->RemoveItem "TR_mX_MT_Writ_Name" 1 endif endif endif endif StopScript TR_MT_RemoveWritsX End
Rename it to TR_MT_RemoveWritsX, where X is whatever the current highest number is +1. Also change that name at the StopScript command at the bottom.
Replace the placeholder lines with the block(s) relevant to your claim as outlined in the previous section.
Do the same with this script:
Begin TR_MT_CalcLegitKillsX if ( GetJournalIndex TR_mX_MT_Name == 80 ) if ( Player->GetItemCount "TR_mX_MT_Writ_Name" > 0 ) set MT_LegitKills to ( MT_LegitKills + 1 ) endif endif if ( GetJournalIndex TR_mX_MT_Name == 100 ) if ( Player->GetItemCount "TR_mX_MT_Writ_Name" > 0 ) set MT_LegitKills to ( MT_LegitKills + 1 ) endif endif set TR_MT_Killcalc.doOnce to ( TR_MT_Killcalc.doOnce + 1 ) StopScript TR_MT_CalcLegitKills1 End
Now open TR_MT_Killcalc, which is the master script that handles all our writ interactions
Look for where it says
StartScript TR_MT_CalcLegitKills2 etc. and add
StartScript TR_MT_CalcLegitKillsX, where X is the number of your new script
Look for where it says
elseif ( doOnce == X ) ; 1 + # of calculation scripts and increase X by 1. It should now be one higher than the number of the scripts you just made
Look for where it says
StartScript TR_MT_RemoveWrits2 etc. and add
StartScript TR_MT_RemoveWritsX, where X is the number of your new script.
And now the master script can handle one more set of writ redemptions.
Special duties are quests that are assigned to only one particular MT master. Vanilla uses special duties to handle the conflict between the Morag Tong and the Dark Brotherhood. Special duties might be typical Morag Tong assassinations (with or without a writ), but they can also be any other kind of quest. Recon, recruitment, intimidation, whatever else Mephala needs doing...
Because they are assigned to an individual Master they should have more details and personal touches than the normal writs. Basically, they are a normal quest. They still get the prefix "Morag Tong:" in the journal and reward faction reputation. The only thing pertinent to the MT as a whole is that they should be introduced to the player via an entry in Greeting 5 that goes something like "Hello, are you here for a writ? Also I need someone to [quest topic]."