Scripts

TR_m1_q_FW_MG02_Script

TR_Mainland.esm
Variables 10
Local Variables
TR_Map
control
controlQ
T_Local_NPC
nolore
freed
floating
dispel
T_Local_NoLore
Timer
Source
1Begin TR_m1_q_FW_MG02_Script 2 3;This script is placed on TR_m1_Claudine Hesault for the Mages Guild quest TR_m1_FW_MG02 4;It makes her stick to the roof until the player saves her. 5 6;Script rewritten by rot and edited by arvisrend, 8 January 2013. 7;Script edited slightly by Taniquetil for Embers of Empire overhaul of Firewatch MG questline, 22 June 2022. 8 9short TR_Map 10short control 11short controlQ 12short T_Local_NPC 13short nolore 14short freed 15short floating 16short dispel 17Float Timer 18short T_Local_NoLore 19 20if ( MenuMode ) 21 return 22endif 23 24;standard TR NPC stuff 25if ( TR_Map != 1 ) 26 set TR_Map to 1 27endif 28 29If ( OnActivate == 1 ) ;prevent speech while she falls or recovers 30 If ( controlQ == 3 ) 31 Return 32 ElseIf ( controlQ == 4 ) 33 Return 34 Endif 35 Activate 36Endif 37 38if ( controlQ == 5 ) 39 return 40elseif ( GetJournalIndex TR_m1_FW_MG02 < 30 ) ;no bullshit before the quest 41 return 42elseif ( controlQ == 0 ) ;initially after quest given 43 AddSpell "TR_m1_q_FW_MG02_LevAb" ;give levitation spell 44 Set controlQ to 1 45endif 46 47if ( freed == 0 ) ;until she's been freed 48 if ( GetPos Z < 15635 ) ;if she's not stuck to the roof stick her to the roof 49 PositionCell 4244 3813 15660 16200 "Nivalis, Claudine Hesault's House" ;TR_m1_MARK_Claudine 50 AiWander 0 0 0 0 0 0 0 0 0 0 0 0 51 AddSpell "TR_m1_q_FW_MG02_LevAb" ;give levitation spell if she doesn't have it 52 endif 53endif 54 55;setting dialogue variable for player levitating up to her 56if ( player->GetPos Z >= 15600 ) 57 set floating to 1 58elseif ( player->GetPos Z <= 15375 ) 59 set floating to 0 60endif 61 62if ( controlQ == 3 ) 63 If ( GetPos Z < 15475 ) 64 ModCurrentFatigue -500 ;falls flat 65 Set controlQ to 4 66 Set Timer to 0 67 Stopcombat ;in case the player tried attacking her 68 Setfight 0 69 Endif 70 Return 71elseif ( controlQ == 4 ) 72 Set Timer to ( Timer + GetSecondsPassed ) 73 if ( Timer > 2 ) ;after 3 seconds 74 if ( getLOS Player == 1 ) 75 if ( floating == 0 ) 76 ForceGreeting 77 set controlQ to 5 78 endif 79 elseif ( Timer > 5 ) ;avoiding an irreproducible bug where Claudine fails to stand up 80 if ( GetFatigue < 500 ) 81 modfatigue 1 82 else 83 modfatigue -60 84 endif 85 set Timer to 2 86 endif 87 Return 88 elseif ( GetFatigue <= 5 ) 89 ModCurrentFatigue 600 ;get back up 90 endif 91 Return 92endif 93 94if ( GetEffect sEffectDispel == 1 ) ;if player casts dispel 95 RemoveSpell TR_m1_q_FW_MG02_LevAb ;remove levitation spell 96 Set freed to 1 ;and mark as freed 97 Set controlQ to 3 98 SetPos Z 15640 ;get her unstuck from the beam so she can fall 99 Journal TR_m1_FW_MG02 50 100 AiWander 0 0 0 0 0 0 0 0 0 0 0 0 101 return 102endif 103 104if ( controlQ == 1 ) 105 Set Timer to ( Timer + GetSecondsPassed ) 106 if ( Timer > 2 ) 107 if ( getLOS Player == 1 ) 108 Set controlQ to 2 109 Set Timer to 0 110 ForceGreeting 111 Return 112 endif 113 endif 114endif 115 116if ( CellChanged == 0 ) 117 Return 118endif 119 120set dispel to 0 121;setting dialogue variable if player has dispelling magic 122if ( player->GetSpell "purge magic" ) 123 set dispel to 1 124elseif ( player->GetSpell "T_Com_Mys_DispelMagic" ) 125 set dispel to 2 126elseif ( player->GetSpell "TR_m1_q_MG4Dispel" ) 127 set dispel to 2 128endif 129 130End