TR_m2_q_9_DreynisScript
TR_Mainland.esm
Variables
9
Local Variables
TR_Map
control
controlQ
Dreyvar
fallvar
NoLore
T_Local_NPC
T_Local_NoLore
Timer
Source
1Begin TR_m2_q_9_DreynisScript
2
3;This is the script on TR_m2_q_9_DreynisDummy, the drunk version of Dreynis Teran used during the Flin Galore! quest
4
5short TR_Map
6short control
7short controlQ
8short Dreyvar ;keeps track of what booze the player has
9short fallvar ;makes Dreynis fall over
10short NoLore
11float Timer
12short T_Local_NPC
13short T_Local_NoLore
14
15
16if ( TR_Map != 2 )
17 set TR_Map to 2
18endif
19
20
21;This handles the normal Dreynis Teran being replaced by our drunk Dreynis Teran
22if ( GetJournalIndex "TR_m2_AO_FlinGalore" >= 80 ) ;when quest is finished
23 if ( GetDisabled == 0 ) ;if Drunk Dreynis is still enabled
24 if ( GetDeadCount "TR_m2_q_9_DreynisDummy" == 0 ) ;if you didn't kill the drunk one
25 disable ;replace him with the normal one
26 "TR_m2_Dreynis_Teran"->enable
27 else ;if you did kill the drunk one
28 disable ;get rid of the body
29 endif
30 else ;if he's been disabled
31 SetDelete 1 ;delete the reference
32 Return
33 endif
34elseif ( GetJournalIndex "TR_m2_AO_FlinGalore" >= 5 ) ;when the quest has started
35 if ( GetDeadCount "TR_m2_Dreynis_Teran" == 0 ) ;if you didn't kill the normal Dreynis
36 if ( GetDisabled )
37 enable ;replace normal Dreynis with drunk Dreynis
38 elseif ( "TR_m2_Dreynis_Teran"->GetDisabled == 0 )
39 "TR_m2_Dreynis_Teran"->disable
40 endif
41 else ;if you did kill the normal Dreynis
42 SetDelete 1 ;delete the reference to Drunk Dreynis
43 Return
44 endif
45else
46 if ( GetDisabled == 0 )
47 disable ;disable the drunk Dreynis
48 endif
49 return ;don't run the script if the quest hasn't started
50endif
51
52;This section makes Dreynis fall over when we toggle fallvar to 1
53if ( MenuMode == 0 )
54 if ( fallvar == 1 ) ;if we've toggled it on
55 SetFatigue, -10 ;set his fatigue to 0
56 Set fallvar to 2 ;go to next step
57 elseif ( fallvar == 2 ) ;at the next step
58 AiActivate, "TR_m2_q_9_Pot_uni" ;make him move so he falls over
59 Set fallvar to 3
60 elseif ( fallvar == 3 )
61 Set Timer to ( Timer + GetSecondsPassed ) ;start counting
62 if ( Timer > 3 ) ;if you've counted 3 seconds
63 Set Timer to 0 ;reset the timer
64 ModFatigue, 20 ;let him get back up
65 Set fallvar to 4
66 endif
67 elseif ( fallvar == 4 )
68 Set Timer to ( Timer + GetSecondsPassed ) ;start counting
69 if ( Timer > 3 ) ;if you've counted 1 seconds
70 Set Timer to 0 ;reset the timer
71 AIWander, 20, 5, 0, 60, 20, 10, 0, 0, 0, 0, 0 ;stop making him try to activate pot
72 Set fallvar to 0
73 endif
74 endif
75 return ; because we only need to check for the player having alcohol when in menumode.
76 ; -- arvisrend, 1 Dec 2012
77endif
78
79
80;This checks if the player has any booze, and if so what they have
81if ( player->GetItemCount "T_We_Drink_PigmilkbeerJagga_01" > 0 ) ; Jagga, 10 (this is the value of the drink, just for reference)
82 Set Dreyvar to 18
83elseif ( player->GetItemCount "Potion_Local_Brew_01" > 0 ) ; Mazte, 10
84 Set Dreyvar to 17
85elseif ( player->GetItemCount "potion_comberry_wine_01" > 0 ) ; Shein, 10
86 Set Dreyvar to 16
87elseif ( player->GetItemCount "T_Imp_Drink_WinePlalloVin_01" > 0 ) ; Plallo's Vineyard Wine, 20
88 Set Dreyvar to 15
89elseif ( player->GetItemCount "potion_comberry_brandy_01" > 0 ) ; Greef, 30 x
90 Set Dreyvar to 14
91elseif ( player->GetItemCount "potion_local_liquor_01" > 0 ) ; Sujamma, 30
92 Set Dreyvar to 13
93elseif ( player->GetItemCount "T_Imp_Drink_WineFreeEstat_01" > 0 ) ; Free Estates Wine, 40
94 Set Dreyvar to 12
95elseif ( player->GetItemCount "T_Nor_Drink_SnowberryaleVeig_01" > 0 ) ; Veig, 50
96 Set Dreyvar to 11
97elseif ( player->GetItemCount "T_Imp_Drink_WineSurilieBr_01" > 0 ) ; Surilie Brothers, 60
98 Set Dreyvar to 10
99elseif ( player->GetItemCount "T_Imp_Drink_WineWolfsbl_01" > 0 ) ; Wolfsblood Wine, 70
100 Set Dreyvar to 9
101elseif ( player->GetItemCount "T_Imp_Drink_WineTamikaClr_01" > 0 ) ; Tamika's Cellar Fine Wine, 75
102 Set Dreyvar to 8
103elseif ( player->GetItemCount "potion_nord_mead" > 0 ) ; Nord Mead, 80
104 Set Dreyvar to 7
105elseif ( player->GetItemCount "potion_cyro_brandy_01" > 0 ) ; Cyrodiilic Brandy, 100
106 Set Dreyvar to 6
107elseif ( player->GetItemCount "T_De_Drink_BourbonGoya_01" > 0 ) ; Goya, 100
108 Set Dreyvar to 5
109elseif ( player->GetItemCount "T_Imp_Drink_WineTwinMoon_01" > 0 ) ; Twin Moons Wine, 100
110 Set Dreyvar to 4
111elseif ( player->GetItemCount "T_De_Drink_LiquorLlotham_01" > 0 ) ; Ungorth, 120
112 Set Dreyvar to 3
113elseif ( player->GetItemCount "p_vintagecomberrybrandy1" > 0 ) ; Vintage Brandy, 500
114 Set Dreyvar to 2
115elseif ( player->GetItemCount "potion_ancient_brandy" > 0 ) ; Ancient Dagoth Brandy, 1500
116 Set Dreyvar to 1
117else
118 Set Dreyvar to 0
119endif
120
121End