Scripts

slaveScript

Morrowind.esm
Variables 3
Local Variables
slaveStatus
doOnce
NoLore
Source
1begin slaveScript 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;dead = not in slave status, but a state one should check for 9 10short slaveStatus 11short doOnce 12short NoLore 13 14if ( slaveStatus == 0 ) 15 return 16endif 17 18if ( slaveStatus == 1 ) 19 return 20endif 21 22if ( slaveStatus == 2 ) 23 if ( doOnce == 0 ) 24 AIFollow Player 0 0 0 0 0 25 Set doOnce 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 43endif 44 45end slaveScript