TR_m3_q_Deed_Script_Slaves
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_Slaves
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 ( GetJournalIndex TR_m3_AT_Deed > 10 )
31 if ( GetHealth > 0 )
32 Disable
33 endif
34 endif
35endif
36
37if ( OnDeath )
38 if ( GetJournalIndex TR_m3_AT_Deed == 10 )
39 set TR_m3_AT_Deed_SlaveKilled to 1
40 endif
41endif
42
43if ( slaveStatus == 2 )
44 if ( doOnce == 0 )
45 AIFollow Player 0 0 0 0 0
46 Set doOnce to 1
47 endif
48 return
49endif
50
51if ( slaveStatus == 3 )
52 if ( GetCurrentAIPackage == 3 )
53 AIWander 512 0 0 0 0 0 0 0 0 0 0 0
54 endif
55 if ( GetItemCount Slave_Bracer_Left > 0 )
56 Drop Slave_Bracer_Left 1
57 endif
58 if ( GetItemCount Slave_Bracer_Right > 0 )
59 Drop Slave_Bracer_Right 1
60 endif
61 if ( CellChanged == 1 )
62 Disable
63 endif
64endif
65
66if ( T_Local_Khajiit )
67 return
68endif
69
70set T_Local_Khajiit to -1
71
72if ( GetRace "T_Els_Cathay" )
73 set T_Local_Khajiit to 1
74elseif ( GetRace "T_Els_Cathay-raht" )
75 set T_Local_Khajiit to 1
76elseif ( GetRace "T_Els_Dagi-raht" )
77 set T_Local_Khajiit to 1
78elseif ( GetRace "T_Els_Ohmes" )
79 set T_Local_Khajiit to 1
80elseif ( GetRace "T_Els_Ohmes-raht" )
81 set T_Local_Khajiit to 1
82elseif ( GetRace "T_Els_Suthay" )
83 set T_Local_Khajiit to 1
84elseif ( GetRace "T_Els_Tojay" )
85 set T_Local_Khajiit to 1
86elseif ( GetRace "Khajiit" )
87 set T_Local_Khajiit to 1
88endif
89set TR_Map to 3
90
91end