Scripts

TR_m4_NPC_Terani_Deroth

TR_Mainland.esm
Variables 7
Local Variables
TR_Map
control
controlQ
NoLore
T_Local_NPC
OnPCHitMe
timer
Source
1Begin TR_m4_NPC_Terani_Deroth 2 3; script to control Terani Deroth's behavior during The Reverse Rescue 4 5short TR_Map 6short control 7short controlQ ; controls teleport 8short NoLore 9short T_Local_NPC 10float timer 11short OnPCHitMe 12 13if ( MenuMode ) 14 return 15endif 16 17if ( OnDeath ) 18 if ( GetJournalIndex "TR_m4_HH_AND_ReverseRescue" >= 10 ) 19 if ( GetJournalIndex "TR_m4_HH_AND_ReverseRescue" < 100 ) 20 Journal "TR_m4_HH_AND_ReverseRescue" 70 21 endif 22 endif 23endif 24 25if ( OnPCHitMe ) 26 Set OnPCHitMe to 0 27 if ( "TR_m4_q_Galesa Arethi"->GetCurrentAIPackage == 3 ) 28 ; prevent Galesa from attacking Terani 29 "TR_m4_q_Galesa Arethi"->AIWander 0 0 0 0 60 20 10 0 0 0 0 0 30 "TR_m4_q_Galesa Arethi"->StopCombat 31 endif 32endif 33 34if ( controlQ == 1 ) 35 Cast "almsivi intervention" "TR_m4_Terani_Deroth" 36 Set controlQ to 3 37 Set timer to 0 38elseif ( controlQ == 3 ) 39 ; wait for cast effect to finish 40 Set timer to ( timer + GetSecondsPassed ) 41 if ( timer < 2.2 ) 42 return 43 endif 44 Set "TR_m4_q_Galesa Arethi".controlQ to 1 45 PositionCell 4405 3916 15080 5640 "Bal Foyen, Hlaalu Council Company Bank" 46 Set controlQ to 4 47endif 48 49if ( TR_Map != 4 ) 50 Set TR_Map to 4 51endif 52 53End