Scripts

TR_m1_q50_GO5_cultist_scpt

TR_Mainland.esm
Variables 11
Local Variables
state
control
TR_Map
nolore
flag
flag2
currday
starday
T_Local_NPC
T_Local_NoLore
timer
Source
1Begin TR_m1_q50_GO5_cultist_scpt 2 3short state 4short control 5short TR_Map 6short nolore 7short flag 8short flag2 9short currday 10short starday 11float timer 12short T_Local_NPC 13short T_Local_NoLore 14 15if ( MenuMode ) 16 Return 17endif 18 19if ( state == -10 ) 20 if ( timer > 3 ) 21 SetDelete 1 22 Return 23 endif 24 set timer to ( timer + GetSecondsPassed ) 25 Return 26endif 27 28if ( flag2 == 0 ) 29 if ( GetJournalIndex TR_m1_GO_5 >= 20 ) 30 set flag2 to 1 31 set starday to DaysPassed 32 endif 33endif 34 35if ( control == 10 ) 36 ; Start teleporting away. (Teleportation is faked by a "spell absorption" spell.) 37 SetMagicka 100 38 Cast "spell absorption" TR_m1_Q50_GO5_Cultist 39 set control to 11 40 set timer to 0 41 return 42elseif ( control == 11 ) 43 ; Teleportation. I've added the "if ( timer > 12 )" loop to ensure that failure of 44 ; GetSoundPlaying on certain systems doesn't break teleportation. 45 ; -- arvisrend, 20 Nov 2012 46 if ( timer > 12 ) 47 Disable 48 set timer to 0 49 set state to -10 50 return 51 endif 52 if ( GetSoundPlaying "mysticism hit" == 1 ) 53 Disable 54 set timer to 0 55 set state to -10 56 return 57 endif 58 set timer to ( timer + GetSecondsPassed ) 59endif 60 61if ( flag <= 0 ) 62 if ( GetSpell "TR_m1_Q50_G05Paral_Curse" == 1 ) 63 if ( flag == -1 ) 64 if ( HitOnMe TR_m1_Q50_G05_Dagger == 1 ) 65 sethealth 127 66 endif 67 endif 68 if ( GetHealth < 126 ) 69 RemoveSpell "TR_m1_Q50_G05Paral_Curse" 70 set control to 2 71 set flag to 1 72 ForceGreeting 73 set state to 4 74 endif 75 endif 76endif 77 78if ( state == 0 ) 79 Disable 80 set TR_Map to 1 81 set state to 1 82 return 83elseif ( state == 1 ) 84 if ( GetJournalIndex TR_m1_GO_5 >= 10 ) 85 Enable 86 set state to 2 87 endif 88 return 89elseif ( state == 2 ) 90 if ( flag2 == 1 ) 91 set currday to DaysPassed 92 if ( currday > starday ) 93 set TR_m1_Q50_GO5_Husband.control to 1 94 set flag2 to -1 95 endif 96 endif 97 return 98elseif ( state == 3 ) 99 if ( flag != -1 ) 100 set flag to -1 101 endif 102 if ( timer > 15 ) 103 if ( GetDistance player < 1024 ) 104 RemoveSpell "TR_m1_Q50_G05Paral_Curse" 105 set control to 3 106 set state to -1 107 set timer to 0 108 ForceGreeting 109 endif 110 endif 111 set timer to ( timer + GetSecondsPassed ) 112 return 113elseif ( state == 4 ) 114 if ( MenuMode == 0 ) 115 Cast "bound dagger" TR_m1_Q50_GO5_Cultist 116 SetMagicka 0 117 set state to -1 118 endif 119endif 120 121End