Scripts

TR_m1_Q59_HaO_scpt_Brendu

TR_Mainland.esm
Variables 12
Local Variables
TR_Map
control
doonce
state
NoLore
flag
T_Local_NPC
T_Local_NoLore
begintime
currtime
elaptime
timer
Source
1Begin TR_m1_Q59_HaO_scpt_Brendu 2; Script on TR_m1_Q59_HaO_Brendu, controls his actions, includes TR M1 version of NoLore. 3 4short TR_Map 5short control 6short doonce 7short state 8short NoLore 9short flag 10float begintime 11float currtime 12float elaptime 13float timer 14short T_Local_NPC 15short T_Local_NoLore 16 17if ( state == 8 ) 18 Return 19endif 20 21if ( state == -2 ) 22 if ( timer < 3 ) 23 set timer to ( timer + GetSecondsPassed ) 24 else 25 SetDelete 1 26 endif 27 Return 28endif 29 30if ( OnDeath ) 31 Journal TR_m1_PT_Ogrim 110 32 TR_m1_Q59_HaO_cr_Ogrm->SetFight 100 33 set state to 1 34endif 35 36if ( state == 0 ) 37 set TR_Map to 1 38 set state to 1 39 disable 40 Return 41elseif ( state == 1 ) 42 if ( GetDisabled ) 43 if ( player->GetLevel >= 10 ) 44 enable 45 endif 46 endif 47 Return 48elseif ( state == -1 ) 49 if ( CellChanged ) 50 if ( GetDistance player > 1024 ) 51 Disable 52 set state to - 2 53 endif 54 endif 55 Return 56elseif ( state == 2 ) 57 set begintime to ( DaysPassed * 24 ) 58 set begintime to ( begintime + GameHour ) 59 SetSpeed 100 60 SetAlarm 0 61 set state to 3 62 Return 63elseif ( state == 3 ) 64 if ( timer >= 3 ) 65 set timer to 0 66 set currtime to ( DaysPassed * 24 ) 67 set currtime to ( currtime + GameHour ) 68 set elaptime to ( currtime - begintime ) 69 if ( GetLOS TR_m1_Q59_HaO_cr_Ogrm == 1 ) 70 set timer to 0 71 set state to 5 72 endif 73 if ( elaptime > 6 ) 74 TR_m1_Q59_HaO_cr_Ogrm->SetFight 100 75 set state to 4 76 endif 77 endif 78 set timer to ( timer + GetSecondsPassed ) 79 Return 80elseif ( state == 4 ) 81 if ( GetDistance player < 1024 ) 82 if ( doonce == 0 ) 83 ForceGreeting 84 set doonce to 1 85 endif 86 endif 87 Return 88elseif ( state == 5 ) 89 if ( GetDistance player < 1024 ) 90 if ( doonce == 0 ) 91 ForceGreeting 92 set doonce to 1 93 Return 94 elseif ( doonce == 1 ) 95 if ( timer > 1 ) 96 TR_m1_Q59_HaO_cr_Ogrm->StopCombat 97 StartCombat TR_m1_Q59_HaO_cr_Ogrm 98 TR_m1_Q59_HaO_cr_Ogrm->StartCombat TR_m1_Q59_HaO_Brendu 99 set doonce to 2 100 set timer to 0 101 endif 102 set timer to ( timer + GetSecondsPassed ) 103 elseif ( doOnce == 2 ) 104 ; make sure the two are actually fighting 105 if ( timer > 2 ) 106 set timer to 0 107 if ( GetTarget TR_m1_Q59_HaO_cr_Ogrm == 0 ) 108 StartCombat TR_m1_Q59_HaO_cr_Ogrm 109 TR_m1_Q59_HaO_cr_Ogrm->StartCombat TR_m1_Q59_HaO_Brendu 110 endif 111 endif 112 set timer to ( timer + GetSecondsPassed ) 113 endif 114 endif 115 Return 116elseif ( state == 6 ) 117 if ( GetDistance player < 1024 ) 118 if ( doonce < 3 ) 119 AIWander 0 5 0 0 60 20 10 10 0 0 0 0 120 ForceGreeting 121 set doonce to 3 122 endif 123 endif 124 Return 125elseif ( state == 7 ) 126 if ( CellChanged ) 127 if ( GetDisabled == 0 ) 128 Disable 129 endif 130 endif 131endif 132 133End