Scripts

TR_m4_NPC_HisHeartClay_Scp

TR_Mainland.esm
Variables 9
Local Variables
slaveStatus
disableOnce
doOnce
NoLore
TR_Map
control
controlQ
T_Local_NPC
T_Local_NoLore
Source
1Begin TR_m4_NPC_HisHeartClay_Scp 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 13short slaveStatus 14short disableOnce 15short doOnce 16short NoLore 17short TR_Map 18short control 19short controlQ 20short T_Local_NPC 21short T_Local_NoLore 22;global TR_m4_AA_IssarbaddonHostile 23 24;This block checks if the player has escorted the slave to Uvayn Manor 25 26if ( GetPCCell "Arvud, Uvayn Manor" == 1 ) 27 if ( GetDistance, player <= 512 ) 28 if ( GetJournalIndex "TR_m4_Arv_StolenCargo" >= 10 ) 29 if ( GetJournalIndex "TR_m4_Arv_StolenCargo" < 65 ) 30 Journal "TR_m4_Arv_StolenCargo" 65 31 AiWander 256 30 40 20 0 0 10 0 32 set TR_m4_AA_IssarbaddonHostile to 0 33 "TR_m4_O_Garvs Adram"->SetFight 90 34 endif 35 endif 36 endif 37endif 38 39;This block checks if the slave is dead 40 41if ( OnDeath == 1 ) 42 if ( GetJournalIndex "TR_m4_Arv_StolenCargo" >= 10 ) 43 if ( GetJournalIndex "TR_m4_Arv_StolenCargo" < 70 ) 44 Journal "TR_m4_Arv_StolenCargo" 70 45 set TR_m4_AA_IssarbaddonHostile to 0 46 "TR_m4_O_Garvs Adram"->SetFight 90 47 endif 48 endif 49endif 50 51;This block checks if the player leave the slave alone - causing him to escape Morrowind 52 53if ( GetJournalIndex "TR_m4_Arv_StolenCargo" >= 100 ) 54 if ( GetJournalIndex "TR_m4_Arv_StolenCargo" <= 140 ) 55 if ( GetPCCell "Issarbaddon, Lair" == 1 ) 56 if ( GetDistance, player <= 2048 ) 57 if ( GetDisabled == 0 ) 58 if ( disableOnce == 0 ) 59 Set FreedSlavesCounter to FreedSlavesCounter + 1 60 disable 61 set disableOnce to 1 62 endif 63 endif 64 endif 65 endif 66 endif 67endif 68 69if ( slaveStatus == 0 ) 70 return 71endif 72 73if ( slaveStatus == 1 ) 74 return 75endif 76 77if ( slaveStatus == 2 ) 78 if ( doOnce == 0 ) 79 AIFollow Player 0 0 0 0 0 80 Set doOnce to 1 81 endif 82 return 83endif 84 85if ( slaveStatus == 3 ) 86 if ( GetCurrentAIPackage == 3 ) 87 AIWander 512 0 0 0 0 0 0 0 0 0 0 0 88 endif 89 if ( GetItemCount Slave_Bracer_Left > 0 ) 90 Drop Slave_Bracer_Left 1 91 endif 92 if ( GetItemCount Slave_Bracer_Right > 0 ) 93 Drop Slave_Bracer_Right 1 94 endif 95 if ( CellChanged == 1 ) 96 Disable 97 endif 98endif 99 100 101if ( TR_Map == 4 ) 102 return 103endif 104 105set TR_Map to 4 106 107end