Scripts

TR_m7_NPC_GeronSalaren

TR_Mainland.esm
Variables 9
Local Variables
NoLore
T_Local_NoLore
T_Local_NPC
TR_Map
control
controlQ
OnPCHitMe
moving
timer
Source
1begin TR_m7_NPC_GeronSalaren 2 3short NoLore 4short T_Local_NoLore 5short T_Local_NPC 6short TR_Map 7short control 8short controlQ 9 10short OnPCHitMe 11 12short moving 13float timer 14 15if ( OnDeath ) 16 set controlQ to -1 17 set TR_m7_AI_JNS_5_SmugglerDead to ( TR_m7_AI_JNS_5_SmugglerDead + 1 ) 18 if ( TR_m7_AI_JNS_5_SmugglerDead >= 6 ) 19 Journal TR_m7_AI_JNS_5 90 20 endif 21endif 22 23if ( OnPCHitMe ) 24 if ( controlQ > 0 ) 25 AIWander 128 0 0 60 30 10 0 0 0 0 0 0 26 setfight 100 27 set controlQ to -1 28 endif 29 set OnPCHitMe to 0 30 startcombat player 31endif 32 33if ( MenuMode ) 34 return 35endif 36 37if ( controlQ > 0 ) 38 if ( GetDistance player < 2000 ) 39 AIWander 128 0 0 60 30 10 0 0 0 0 0 0 40 setfight 100 41 startcombat player 42 set controlQ to -1 43 endif 44endif 45 46if ( controlQ == 1 ) ;this block checks to see if the player is looking at the NPC 47 if ( player->GetDistance TR_m7_AI_JNS_5_PCMark < 400 ) 48 Journal TR_m7_AI_JNS_5 30 49 set controlQ to 2 50 endif 51elseif ( controlQ == 2 ) ;this block moves the NPC after a short time 52 set timer to ( timer + getsecondspassed ) 53 if ( timer >= 8 ) 54 set controlQ to 3 55 set timer to 0 56 endif 57elseif ( controlQ == 3 ) ;the following blocks manage the NPC's travel 58 if ( moving == 0 ) 59 AITravel -643 -331919 197 1 ; TR_m7_MARK_AI_JNS_Geron 60 set moving to 1 61 endif 62 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav1 < 100 ) 63 set controlQ to 4 64 set moving to 0 65 endif 66elseif ( controlQ == 4 ) 67 if ( moving == 0 ) 68 AITravel -607 -330993 165 1 ; TR_m7_MARK_AI_JNS_Geron 69 set moving to 1 70 endif 71 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav2 < 100 ) 72 set controlQ to 5 73 set moving to 0 74 endif 75elseif ( controlQ == 5 ) 76 if ( moving == 0 ) 77 AITravel -707 -329885 40 1 ; TR_m7_MARK_AI_JNS_Geron 78 set moving to 1 79 endif 80 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav3 < 100 ) 81 set controlQ to 8 82 set moving to 0 83 endif 84elseif ( controlQ == 8 ) 85 if ( moving == 0 ) 86 AITravel -368 -329331 40 1 ; TR_m7_MARK_AI_JNS_Geron 87 set moving to 1 88 endif 89 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav4 < 100 ) 90 set controlQ to 9 91 set moving to 0 92 endif 93elseif ( controlQ == 9 ) 94 if ( moving == 0 ) 95 AITravel -821 -326512 446 1 ; TR_m7_MARK_AI_JNS_Geron 96 set moving to 1 97 endif 98 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav5 < 100 ) 99 set controlQ to 10 100 set moving to 0 101 endif 102elseif ( controlQ == 10 ) 103 if ( moving == 0 ) 104 AITravel -1951 -326101 436 1 ; TR_m7_MARK_AI_JNS_Geron 105 set moving to 1 106 endif 107 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav6 < 100 ) 108 set controlQ to 12 109 set moving to 0 110 endif 111elseif ( controlQ == 12 ) 112 if ( moving == 0 ) 113 AITravel -4379 -325883 211 1 ; TR_m7_MARK_AI_JNS_Geron 114 set moving to 1 115 endif 116 if ( GetDistance TR_m7_AI_JNS_5_NPCTrav7 < 100 ) 117 set controlQ to 13 118 set moving to 0 119 endif 120elseif ( controlQ == 13 ) 121 AIWander 128 0 0 60 30 10 0 0 0 0 0 0 122 setfight 100 123 set controlQ to -1 124endif 125 126if ( TR_Map ) 127 return 128endif 129 130set TR_Map to 7 131 132end