TR_m3_Oth_BuyableSlave_sc
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_Oth_BuyableSlave_sc
2
3;Slave Status... each slave has a status as follows
4;0 = Owned ( default state... does not indicate who they are owned by )
5;1 = For Sale ( someone in the game can "sell" this slave via dialogue )
6;2 = Owned By the Player ( the player has purchased this slave and the slave follows the player )
7;3 = Freed ( the player has freed this slave, the slave eventually disables himself)
8
9;-1 = Dead (for these NPCs specifically. Helps a ton with cutting down bloat in scripts)
10
11short slaveStatus
12short doOnce
13short NoLore
14short TR_Map
15short control
16short controlQ
17short T_Local_NPC
18short T_Local_NoLore
19short T_Local_Khajiit
20
21if ( slaveStatus == 2 )
22 if ( doOnce == 0 )
23 AIFollow Player 0 0 0 0 0
24 Set doOnce to 1
25 set control to 1
26 endif
27 return
28endif
29
30if ( slaveStatus == 3 )
31 if ( GetCurrentAIPackage == 3 )
32 AIWander 512 0 0 0 0 0 0 0 0 0 0 0
33 endif
34 if ( GetItemCount Slave_Bracer_Left > 0 )
35 Drop Slave_Bracer_Left 1
36 endif
37 if ( GetItemCount Slave_Bracer_Right > 0 )
38 Drop Slave_Bracer_Right 1
39 endif
40 if ( CellChanged == 1 )
41 Disable
42 endif
43 if ( control == 0 )
44 if ( T_Local_Khajiit )
45 set "TR_m3_Oth_SlavesAvailableKha" to ( "TR_m3_Oth_SlavesAvailableKha" - 1 )
46 elseif ( GetRace "Argonian" )
47 set "TR_m3_Oth_SlavesAvailableArg" to ( "TR_m3_Oth_SlavesAvailableArg" - 1 )
48 else
49 set "TR_m3_Oth_SlavesAvailableOth" to ( "TR_m3_Oth_SlavesAvailableOth" - 1 )
50 endif
51 set control to 1
52 endif
53endif
54
55if ( OnDeath == 1 )
56 if ( control == 0 )
57 if ( T_Local_Khajiit == 1 )
58 set "TR_m3_Oth_SlavesAvailableKha" to ( "TR_m3_Oth_SlavesAvailableKha" - 1 )
59 elseif ( GetRace "Argonian" )
60 set "TR_m3_Oth_SlavesAvailableArg" to ( "TR_m3_Oth_SlavesAvailableArg" - 1 )
61 else
62 set "TR_m3_Oth_SlavesAvailableOth" to ( "TR_m3_Oth_SlavesAvailableOth" - 1 )
63 endif
64 endif
65 set control to 1
66 set slaveStatus to -1
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
93AddTopic "go free"
94
95end