Scripts

TR_m2_q_9_BarrelScript

TR_Mainland.esm
Variables 1
Local Variables
barrelvar
Source
1Begin TR_m2_q_9_BarrelScript 2 3;This is the script on TR_m2_q_9_Barrel_uni, the barrel of stolen Flin for the Flin Galore! quest 4;it updates the journal to either 50 or 70 depending when you open it 5;There are originally 6 bottles of Flin in the barrel, two more are added by Vilyn Avani 6 7Short barrelvar ;tracks whether Vilyn has reached the Flin or not 8 9;this enables and disables the barrel as appropriate 10if ( GetJournalIndex "TR_m2_AO_FlinGalore" < 10 ) 11 if ( GetDisabled == 0 ) 12 disable ;keep disabled before quest starts 13 endif 14 return 15else 16 if ( GetDisabled ) 17 enable ;enable when quest starts 18 endif 19endif 20 21;this adds the extra Flin at the right time 22if ( barrelvar == 0 ) ;if never happened before 23 if ( GetDistance "TR_m2_Vilyn Avani" < 800 ) ;Vilyn Avani has got to the barrel 24 AddItem, "potion_cyro_whiskey_01", 2 ;add the Flin 25 Set barrelvar to 1 ;prevent this happening again (and remember it happened) 26 endif 27endif 28 29;don't run rest of the script in menu mode 30if ( MenuMode ) 31 Return 32endif 33 34;this gives the correct journal update 35if ( OnActivate == 1 ) ;if player opens barrel 36 if ( barrelvar == 0 ) ;if Vilyn not arrived 37 Journal "TR_m2_AO_FlinGalore" 60 ;give journal 60 38 Set barrelvar to 2 ;prevent Flin being added 39 Activate ;open barrel. 40 elseif ( barrelvar == 1 ) ;if Flin added 41 Journal "TR_m2_AO_FlinGalore" 70 ;give Journal 70 42 Set barrelvar to 2 ;prevent this happening again 43 Activate ;open barrel 44 else ;if barrel previously opened 45 Activate ;just open barrel 46 endif 47endif 48 49end