Scripts

bittercup

Morrowind.esm
Variables 19
Local Variables
button
messageOn
drink
gone
testdist
str
int
wil
agi
spd
end
per
luc
maxatt
maxattval
minatt
minattval
TGtest
timer
Source
1begin bittercup 2 3;this is used on the bittercup artifact to ask you if you want to drink from it or carry it 4;the question is asked whenever you activate (pick it up). 5;the cup raises your top attribute by the var and lowers your worst by the var 6; modified: bburcham 20010919, 20011008, 20011015 7 8short button 9short messageOn 10short drink 11short gone 12short testdist 13 14; attribute variables 15short str 16short int 17short wil 18short agi 19short spd 20short end 21short per 22short luc 23 24short maxatt 25short maxattval 26short minatt 27short minattval 28short TGtest 29float timer 30 31; disable if used (a 1 use item) 32if ( gone == 1 ) 33 Disable 34 set gone to 0 35 return 36endif 37 38; bug out if in menumode 39if ( MenuMode == 1 ) 40 return 41endif 42 43; bug out if player cant touch it 44;set testDist to GetDistance, Player 45;if ( testDist > 300 ) 46; return 47;endif 48 49if ( OnActivate == 1 ) 50 Set messageOn to 2 51endif 52 53if ( messageOn == 0 ) 54 return 55endif 56 57if ( messageOn == 2 ) 58 MessageBox "Do you wish to drink from the Bitter Cup or to pick it up? Drinking from the cup will improve your best attribute and lower your worst. If you drink, the Cup is lost forever." "Drink from the Bitter Cup" "Pick it up." 59 Set messageOn to 1 60endif 61 62if ( messageOn == 1 ) 63 set button to GetButtonPressed 64 if ( button == 0 ) 65 ; drink it 66 Set drink to 1 67 Set messageOn to 0 68 endif 69 if ( button == 1 ) 70 ; pick it up 71 Activate 72 Set messageOn to 0 73 return 74 endif 75endif 76 77; drink from the cup 78if ( drink == 1 ) 79 80 ; attributes are 'get' once, determine maxatt and minatt 81 82 ; strength 83 set str to ( Player->GetStrength ) 84 set maxatt to 1 85 set maxattval to str 86 set minatt to 1 87 set minattval to str 88 89 ; intelligence 90 set int to ( Player->GetIntelligence ) 91 if ( int > maxattval ) 92 set maxatt to 2 93 set maxattval to int 94 endif 95 if ( int < minattval ) 96 set minatt to 2 97 set minattval to int 98 endif 99 100 ; willpower 101 set wil to ( Player->GetWillpower ) 102 if ( wil > maxattval ) 103 set maxatt to 3 104 set maxattval to wil 105 endif 106 if ( wil < minattval ) 107 set minatt to 3 108 set minattval to wil 109 endif 110 111 ; agility 112 set agi to ( Player->GetAgility ) 113 if ( agi > maxattval ) 114 set maxatt to 4 115 set maxattval to agi 116 endif 117 if ( agi < minattval ) 118 set minatt to 4 119 set minattval to agi 120 endif 121 122 ; speed 123 set spd to ( Player->GetSpeed ) 124 if ( spd > maxattval ) 125 set maxatt to 5 126 set maxattval to spd 127 endif 128 if ( spd < minattval ) 129 set minatt to 5 130 set minattval to spd 131 endif 132 133 ; endurance 134 set end to ( Player->GetEndurance ) 135 if ( end > maxattval ) 136 set maxatt to 6 137 set maxattval to end 138 endif 139 if ( end < minattval ) 140 set minatt to 6 141 set minattval to end 142 endif 143 144 ; personality 145 set per to ( Player->GetPersonality ) 146 if ( per > maxattval ) 147 set maxatt to 7 148 set maxattval to per 149 endif 150 if ( per < minattval ) 151 set minatt to 7 152 set minattval to per 153 endif 154 155 ; luck 156 set luc to ( Player->GetLuck ) 157 if ( luc > maxattval ) 158 set maxatt to 8 159 set maxattval to luc 160 endif 161 if ( luc < minattval ) 162 set minatt to 8 163 set minattval to luc 164 endif 165 166 ; modify the selected attributes 167 ; one cannot modatt using a variable. it does wierd things 168 if ( maxatt == 1 ) 169 Player->ModStrength, 20 170 endif 171 172 if ( minatt == 1 ) 173 Player->ModStrength, -20 174 endif 175 176 if ( maxatt == 2 ) 177 Player->ModIntelligence, 20 178 endif 179 180 if ( minatt == 2 ) 181 Player->ModIntelligence, -20 182 endif 183 184 if ( maxatt == 3 ) 185 Player->ModWillpower, 20 186 endif 187 188 if ( minatt == 3 ) 189 Player->ModWillpower, -20 190 endif 191 192 if ( maxatt == 4 ) 193 Player->ModAgility, 20 194 endif 195 196 if ( minatt == 4 ) 197 Player->ModAgility, -20 198 endif 199 200 if ( maxatt == 5 ) 201 Player->ModSpeed, 20 202 endif 203 204 if ( minatt == 5 ) 205 Player->ModSpeed, -20 206 endif 207 208 if ( maxatt == 6 ) 209 Player->ModEndurance, 20 210 endif 211 212 if ( minatt == 6 ) 213 Player->ModEndurance, -20 214 endif 215 216 if ( maxatt == 7 ) 217 Player->ModPersonality, 20 218 endif 219 220 if ( minatt == 7 ) 221 Player->ModPersonality, -20 222 endif 223 224 if ( maxatt == 8 ) 225 Player->ModLuck, 20 226 endif 227 228 if ( minatt == 8 ) 229 Player->ModLuck, -20 230 endif 231 232 ; cleanup 233 MessageBox "You feel strange..." 234 set TGtest to ( Player->GetJournalIndex TG_BitterBribe ) 235 if ( TGtest >= 10 ) 236 Player->Journal TG_BitterBribe 30 237 else 238 Player->Journal TG_BitterBribe 25 239 endif 240 241 set gone to 1 242 set drink to 0 243 244endif 245 246end bittercup