Scripts

TR_m2_q_A8_5_Shamirr_sc

TR_Mainland.esm
Variables 9
Local Variables
Escape
NoLore
doOnce
daycheck0
T_Local_NPC
T_Local_NoLore
TR_Map
T_Local_Khajiit
timer
Source
1Begin TR_m2_q_A8_5_Shamirr_sc 2 3 4short Escape ;0 - Waiting, 1 - Planning Escape, 2 - Escaping, 3 - Following, 4 - Running, 5 - Captured 5short NoLore 6short doOnce ;1 - Escape warning, 2 - Suicide, 3 - Forcegreet 7short daycheck0 ;used to transfer to the corpse Shamirr_D the date at which it will appear 8float timer 9short T_Local_NPC 10short T_Local_NoLore 11short TR_Map 12short T_Local_Khajiit 13 14if ( TR_Map != 2 ) 15 set TR_Map to 2 16 set T_Local_Khajiit to 1 17endif 18 19If ( OnDeath ) 20 if ( GetJournalIndex TR_m2_A8_5_FreeAtLast != 125 ) 21 if ( GetJournalIndex TR_m2_A8_5_FreeAtLast != 126 ) 22 Journal TR_m2_A8_5_FreeAtLast 95 23 endif 24 endif 25endif 26 27 ;Disable if quest not started 28if ( GetJournalIndex TR_m2_A8_5_FreeAtLast < 30 ) 29 if ( GetJournalIndex TR_m2_A8_5_FreeAtLast != 10 ) 30 if ( GetDisabled == 0 ) 31 Disable 32 endif 33 endif 34 ;Escape if freed from Dras Varethi and left alone and player did not promise help 35elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 50 ) 36 if ( Escape == 0 ) 37 Set Escape to 1 38 endif 39elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 70 ) 40 if ( Escape == 0 ) 41 Set Escape to 1 42 endif 43elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 110 ) 44 if ( Escape == 0 ) 45 Set Escape to 1 46 endif 47 ;If player promised help, do not escape and wait 48elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 80 ) 49 if ( Escape == 1 ) 50 Set Escape to 0 51 endif 52elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 85 ) 53 if ( Escape == 1 ) 54 Set Escape to 0 55 endif 56 57 58 ;Being escorted to Erethan plantation 59elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 100 ) 60 if ( Escape < 3 ) 61 AIFollow Player 0 0 0 0 0 62 Set Escape to 3 63 ;If escorted 64 elseif ( Escape == 3 ) 65 ;Start running if player gets too far 66 if ( GetDistance Player > 1024 ) 67 set Escape to 4 68 SetFlee 100 69 StartCombat Player 70 if ( doOnce < 1 ) 71 MessageBox, "As you press on, you no longer hear Shamirr's footsteps..." ;give one warning 72 set doOnce to 1 73 endif 74 endif 75 ;Stop following when Erethan Plantation reached 76 if ( GetDistance TR_m2_q_A8_5_Shamirr_D < 1024 ) 77 AiWander 0 0 10 15 10 10 5 5 5 15 10 10 78 Set Escape to 5 79 if ( GetDeadCount "TR_m2_q_A8_5_guard" < 1 ) 80 TR_m2_q_A8_5_guard->Say, "Vo\d\m\OP_DM005.mp3", "There he is!" 81 endif 82 Journal TR_m2_A8_5_FreeAtLast 120 83 endif 84 ;If running 85 elseif ( Escape == 4 ) 86 ;Start following player again, if he gets too close 87 if ( GetDistance Player < 600 ) 88 AIFollow Player 0 0 0 0 0 89 StopCombat 90 SetFight 0 91 Set Escape to 3 92 ;Escape if player too far 93 elseif ( GetDistance Player > 5000 ) 94 set Escape to 2 95 Journal TR_m2_A8_5_FreeAtLast 105 96 Disable 97 endif 98 endif 99 100 ;if escorted back to plantation, wait for spell effect before dying on suicide 101elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast == 125 ) 102 if ( doOnce < 3 ) 103 if ( MenuMode == 0 ) 104 set timer to ( timer + GetSecondsPassed ) 105 endif 106 if ( doOnce < 2 ) 107 if ( timer > 2.2 ) 108 SetHealth -5 109 set doOnce to 2 110 TR_m2_Midave_Llarys->Say, "vo\d\m\Hlo_DM027.mp3", "Filthy s'wit...!" 111 endif 112 elseif ( GetJournalIndex TR_m2_A8_5_FreeAtLast < 126 ) 113 if ( timer > 3.2 ) 114 set doOnce to 3 115 TR_m2_Midave_Llarys->ForceGreeting 116 Return 117 endif 118 endif 119 endif 120endif 121 122if ( Escape == 1 ) 123 if ( CellChanged == 1 ) 124 Disable 125 Set Escape to 2 126 endif 127endif 128 129End