TR_m3_q_Deed_Script_Rulene
TR_Mainland.esm
Variables
9
Local Variables
slaveStatus
doOnce
NoLore
TR_Map
control
controlQ
T_Local_NPC
T_Local_NoLore
T_Local_Khajiit
Source
1begin TR_m3_q_Deed_Script_Rulene
2; This short script is there to allow dialogue to be filtered on the TR_Map local variable,
3; allowing for regional topics such as "Morrowind Lore" or "Geographic Regions" to be
4; appropriate to the location the NPC is. This version is for slave NPCs.
5;
6;Slave Status... each slave has a status as follows
7;0 = Owned ( default state... does not indicate who they are owned by )
8;1 = For Sale ( someone in the game can "sell" this slave via dialogue )
9;2 = Owned By the Player ( the player has purchased this slave and the slave follows the player )
10;3 = Freed ( the player has freed this slave, the slave eventually disables himself)
11;dead = not in slave status, but a state one should check for
12
13; alterations to disable slaves
14
15short slaveStatus
16short doOnce
17short NoLore
18short TR_Map
19short control
20short controlQ
21short T_Local_NPC
22short T_Local_NoLore
23short T_Local_Khajiit
24
25if ( GetDisabled )
26 return
27endif
28
29if ( CellChanged )
30 if ( GetHealth > 0 )
31 if ( GetJournalIndex TR_m3_AT_Deed > 10 )
32 Disable
33 elseif ( GetJournalIndex TR_m3_AT_Deed_c == 40 )
34 Disable
35 set TR_m3_AT_Deed_SlaveFreed to 1
36 endif
37 endif
38endif
39
40if ( OnDeath )
41 if ( GetJournalIndex TR_m3_AT_Deed == 10 )
42 set TR_m3_AT_Deed_SlaveKilled to 1
43 endif
44endif
45
46if ( slaveStatus == 2 )
47 if ( doOnce == 0 )
48 AIFollow Player 0 0 0 0 0
49 Set doOnce to 1
50 endif
51 return
52endif
53
54if ( slaveStatus == 3 )
55 if ( GetCurrentAIPackage == 3 )
56 AIWander 512 0 0 0 0 0 0 0 0 0 0 0
57 endif
58 if ( GetItemCount Slave_Bracer_Left > 0 )
59 Drop Slave_Bracer_Left 1
60 endif
61 if ( GetItemCount Slave_Bracer_Right > 0 )
62 Drop Slave_Bracer_Right 1
63 endif
64 if ( CellChanged == 1 )
65 Disable
66 endif
67endif
68
69if ( T_Local_Khajiit )
70 return
71endif
72
73set T_Local_Khajiit to -1
74
75if ( GetRace "T_Els_Cathay" )
76 set T_Local_Khajiit to 1
77elseif ( GetRace "T_Els_Cathay-raht" )
78 set T_Local_Khajiit to 1
79elseif ( GetRace "T_Els_Dagi-raht" )
80 set T_Local_Khajiit to 1
81elseif ( GetRace "T_Els_Ohmes" )
82 set T_Local_Khajiit to 1
83elseif ( GetRace "T_Els_Ohmes-raht" )
84 set T_Local_Khajiit to 1
85elseif ( GetRace "T_Els_Suthay" )
86 set T_Local_Khajiit to 1
87elseif ( GetRace "T_Els_Tojay" )
88 set T_Local_Khajiit to 1
89elseif ( GetRace "Khajiit" )
90 set T_Local_Khajiit to 1
91endif
92set TR_Map to 3
93
94end