Scripts

TR_m4_NPC_AndasGuard

TR_Mainland.esm
Variables 7
Local Variables
TR_Map
control
controlQ
doOnce
greetOnce
T_Local_NPC
NoLore
Source
1Begin TR_m4_NPC_AndasGuard 2 3short TR_Map 4short control 5short controlQ 6short doOnce 7short greetOnce 8short T_Local_NPC 9short NoLore 10;global TR_m4_AndasGuestState 11 12if ( MenuMode == 1 ) 13 return 14endif 15 16if ( GetJournalindex "TR_m4_HH_AND_Hearing" >= 80 ) 17 return 18endif 19 20if ( greetOnce == 1 ) 21 if ( doOnce == 1 ) 22 ForceGreeting 23 set greetOnce to 0 24 endif 25endif 26 27if ( doOnce == 0 ) 28 29 if ( TR_m4_AndasGuestState <= 1 ) 30 31 if ( GetDistance, player < 700 ) 32 33 if ( player->GetEffect, sEffectInvisibility == 1 ) 34 if ( GetPCSneaking == 1 ) 35 if ( GetDistance, player >= 32 ) 36 return 37 endif 38 endif 39 endif 40 41 if ( GetDetected player == 1 ) 42 if ( GetLOS player == 1 ) 43 if ( GetPCSneaking == 1 ) 44 if ( GetDistance, player <= 128 ) 45 set greetOnce to 1 46 set doOnce to 1 47 endif 48 elseif ( GetDistance, player <= 256 ) 49 set greetOnce to 1 50 set doOnce to 1 51 endif 52 endif 53 endif 54 55 endif 56 57endif 58 59endif 60 61 62if ( TR_Map > 0 ) 63 return 64endif 65 66set TR_Map to 4 67 68End