Scripts

TR_m4_NPC_JoKaar

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