Quest for Glory 4 Flags

From Sierra WikiNew
Revision as of 19:51, 18 September 2023 by sierraw>Andrew Branscom (→‎Room 330 (Hero's room))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Quest for Glory 4 Flags[1]



Flag Numbers

Event Flags

To Do: Finish this section up with descriptions of all the flags

Regular Flags

  • 1 - Stamina is gone (worn out)
  • 2 - Hungry
  • 3 - Starving
  • 5 - Carrying too much stuff (overloaded)
  • 6 - Active time
  • 8 - Reversal Spell
  • 11 - Got warned about Katrina's geas to bring her all rituals
  • 13 - Displayed current stats
  • 14 - Got Poisoned
  • 20 - Sense Danger Paladin ability (only used when confronting Ad Avis in the forest to get a warning)
  • 21 - Honor Shield Paladin ability
  • 22 - Turned Baba Yaga into a Frog in QFG1 QfG1VGA/QfG1EGA (determined only upon importing directly from QFG1, as QFG2 didn't export it)
  • 29 - Paladin was originally a Wizard (determined upon importing from QfG2, if the Paladin's import file had no chain mail armor, although this signals a former Thief as well)
  • 30 - First comments from Burgomeister
  • 32 - Exited town's main street
  • 34 - Ad Avis appears outside the castle gates at night
  • 35 - Ad Avis' Necrotaurs chasing you through the forest
  • 37 - Igor is missing (stuck in a grave waiting to be saved)
  • 38 - Igor died (it's then game over only if entering the town's main street or the Burgomeister's office: if flag 39 is set, the Burgomeister gives a deadly message. If flag 39 is not set, deadly townspeople are gathered outside the inn)
  • 39 - Helped Gypsy Davy escape prison
  • 41 - Monastery is toast
  • 43 - Told Burgomeister about Piotyr's Sword after finding it (to gain Piotyr's Shield)
  • 44 - Something to do with Burgomeister
  • 45 - Nikolai is gone
  • 47 - Second comments from Burgomeister
  • 48 - Igor was saved (used for Igor thanking the hero)
  • 49 - Options box is on
  • 50 - Game is paused
  • 57 - Raided Master Wraith's mound
  • 60 - Normal Wraith defeated
  • 61 - Normal Wraith defeated
  • 62 - Master Wraith defeated
  • 63 - Normal Wraith defeated
  • 64 - Normal Wraith defeated
  • 68 - Something to do with post-burglary at Burgomeister
  • 70 - Went in/out Burgomeister's Office through the window
  • 72 - Sat down to watch a Gnome Punny Bones' first or second performance
  • 76 - Igor thanked Ego for saving him
  • 77 - Met Igor in town for the first time
  • 79 - About to meet Katrina outside of town at night for the first time (if it's in any day after 2 and flag 115 isn't set i.e. Tanya wasn't saved yet)
  • 83 - Something to do with burning down the monastery
  • 84 - Introduced yourself to Olga (which provides her full name)
  • 85 - Asked Olga about her husband
  • 86 - Asked for Boris' name (which provides his full name)
  • 94 - Asked Olga about Nikolai's Death.
  • 95 - Asked Olga about Burgomeister
  • 96 - Asked Olga about Tanya.
  • 97 - Asked Olga about Gravedigger (After he was trapped).
  • 98 - Asked Olga about Gypsies.
  • 100 - Asked Olga about Monastery
  • 101 - Allows opening the Bone Cave once back in the Dark One's Cave (enabled when warping to the Dark One's Cave mouth from the Castle Hall for the endgame, but also set at the Castle Gate after passing the "do you have all rituals?" check)
  • 103 - Olga comments on Igor missing.
  • 104 - Olga comments on the Burgomeister setting the Gypsy free
  • 105 - Olga comments on the burned down monastery
  • 106 - Olga comments on Nikolai going missing
  • 107 - Olga comments on Tanya being returned to her parents
  • 109 - Unsure. Can be set by Day 3
  • 110 - Be Geassed by Katrina, and formally tasked to recover all rituals, required for warping back to the Dark One's Cave for the endgame
  • 111 - Get flask in the Castle's room 623
  • 112 - Eavesdropped by listening behind the door on Ad Avis and Katrina in the Castle's lobby
  • 113 - Are Ad Avis and Katrina present (Results in death if opening the door to the main hall at night and this flag is set)
  • 114 - Castle Main Hall door oiled when sneaking upon Ad Avis and Katrina (Results in death if going in main hall at night and this flag is not set)
  • 115 - Tanya has been rescued. Affects large stone, Inn, Olga and Burgomeister
  • 116 - Meeting the Rusalka for the first time
  • 117 - Rusalka is gone
  • 119 - Something to do with breaking through the front gate. At least one Necrotaur is already dead.
  • 120 - Spoken to the Castle Gate Guard once
  • 121 - Spoken to the Castle Gate Guard more than once
  • 122 - Broke through the Castle Gate & killed the Necrotaur Guards
  • 123 - Unknown; likely for options when talking to the Castle Gatekeeper
  • 124 - Unknown; likely for options when talking to the Castle Gatekeeper
  • 126 - First time at the inn in general.
  • 127 - First evening at the inn (with the townsfolk present and eyeing you) - this can't coincide with flag 126.
  • 129 - Gnome Punny Bones is shown at the inn (initially in the evening of day 3 or above but only if flag 127 occurred earlier, and later on after learning the ultimate joke with flag 161)
  • 130 - Re-entered Gnome Punny Bones' room with the good humor bar (similar to 433?)
  • 134 - Special scene at the inn after rescuing Tanya
  • 135 - Met the Domovoi at the inn more than twice
  • 136 - Heard Bella weeping at night
  • 138 - Saved the Domovoi from the Monastery
  • 139 - Met the Domovoi at the inn for the second time
  • 140 - Tried to enter Tanya's room during day time while she's there
  • 141 - Entered Tanya's room at night for the first time
  • 143 - Gave Tanya her doll and thus gained her trust (similar to 449?)
  • 144 - Entered the Gypsy Wagon at least 4 times (upon which the dialog stops changing) and asked about Erana=>Staff=>Destiny Spell (this flag adds the "Tell About Erana's Staff" option in Tanya's Room if she was given a doll)
  • 145 - Tried to attack Tanya or Toby at her room (if flag 143 is set, it means immediate game over. If it's not set it means game over next time you enter her room at night)
  • 146 - Has something to do with talking portraits
  • 147 - Has something to do with talking portraits. Crashes game if on when trying to talk to someone
  • 148 - Portrait box is on
  • 150 - Approached Bonehead and thus learned about Baba Yaga being in Mordavia for a Leshy's riddle
  • 152 - Note was left in the hero's inn room
  • 153 - Get the dream about Erasmus and Fenrus trying to scry on the Hero, and Erasmus zapping his beard
  • 154 - Domovoi requesting you to help the Monastery Domovoi
  • 155 - Domovoi requesting you to help Gnome Punny Bones
  • 156 - Domovoi requesting you to help Tanya
  • 159 - Entered Gnome Punny Bones' room for the first time
  • 160 - Re-entered Gnome Punny Bones' room for the first time without the good humor bar
  • 161 - Learned the Ultimate Joke from Gnome Punny Bones upon leaving his room after re-entering it with the good humor bar (finishing the Gnome's quest)
  • 162 - Gnome Punny Bones addressing the hero in the inn
  • 166 - Entered Baba Yaga's Hut for the first time and thus learned about her favorite food for a Leshy's riddle
  • 175 - Avoozl emerging from the mountain (leading to game over)
  • 176 - Learned about the Leshy from the Adventure's Guild's "HERO" Magazine - needed for a Leshy's riddle
  • 177 - Learned about the Rusalka from the Adventure's Guild's "HERO" Magazine - needed for a Leshy's riddle
  • 179 - Has met Baba Yaga
  • 183 - Received Adventurer's Guild key from Burgomeister
  • 186 - Learned Baba Yaga's Barrier Magic Phrase from the Leshy
  • 189 - Fetched all possible fruits (i.e. 1) today from Erana's Garden - clearing this flag after it's set also requires re-entering the screen
  • 193 - Set when giving the right formula for Healing Potions
  • 194 - Set when giving the right formula for Poison Cure Potions
  • 195 - Set when giving the right formula for the Rehydration Solution
  • 196 - Set when giving the wrong formula for a potion, flipped when giving the right formula for the Rehydration Solution
  • 198 - Got the Rehydration Solution from Dr. Cranium in exchange for Grue Goo
  • 204 - Got enough exercise today in the Adventurer's Guild
  • 227 - Learn the Rusalka's true name from its grave
  • 228 - Killed Janos (Rusalka's unfaithful lover)
  • 229 - Entered cemetery for the first time at day
  • 230 - Entered cemetery for the first time at night
  • 231 - Entered cemetery for the second time at day (making Igor show up)
  • 234 - Kissed Katrina in her room (instead of better but also worse options)
  • 237 - Approaching Lake of the Lost for the first time
  • 238 - Entered last day to save Igor (used only if flag 37 is also set)
  • 249 - Entered crypt from the cemetery for the first time (similar to 446?)
  • 266 - Entered town's main street
  • 268 - Received Crypt Key from Igor
  • 269 - First encounter with the Faery Folk Queen
  • 278 - Can't get anymore visions from Magda because every card comes back as a Void
  • 279 - Vision from Magda concerning the Thief Chief as a monster
  • 280 - Vision from Magda concerning the Hero saving the dried up Domovoi
  • 281 - Vision from Magda concerning the Wizard Hero encountering the Faery Folk Queen for the first time
  • 282 - Vision from Magda concerning the Rusalka
  • 283 - Vision from Magda concerning the Hero meeting Gnome Punny Bones at the Inn
  • 284 - Vision from Magda concerning the Hero casting spells (if a Wizard, but botched class check), or using the rubber chicken on the Elderberry bush
  • 285 - Vision from Magda concerning the Hero helping the Thief Chief
  • 286 - Vision from Magda concerning the Paladin Hero fighting the Master Wraith for the Heart Ritual and Piotyr's Sword
  • 287 - Vision from Magda concerning the Wizard Hero encountering the Faery Folk Queen for the last time
  • 288 - Vision from Magda concerning the Hero meeting Tanya
  • 289 - Vision from Magda concerning the Hero giving Tanya her doll
  • 302 - Bone Cave, take the right torch
  • 303 - Bone Cave, light the left torch
  • 304 - Bone Cave, light the right torch
  • 312 - Befriended the Rusalka (similar to 444?)
  • 313 - Learn about the ritual to free the Rusalka from the Gypsies
  • 320 - 2nd time you visited the Rusalka on nice terms
  • 321 - Found 5 Crowns in the stump outside town
  • 323 - Performed Bone Ritual (set as the Bone Cage triggers ; duplicated by flag 453 for points)
  • 324 - Unused - (Referenced in a check associated with the Blood Ritual in room 600 ; probably meant to check if Blood Ritual was performed, but is never set, and superseded by flag 455 for points)
  • 325 - Unused - (Referenced in a check associated with the Sense Ritual in room 600 ; probably meant to check if Senses Ritual was performed, but is never set, and superseded by flag 459 for points)
  • 326 - Unused - (Referenced in a check associated with the Heart Ritual in room 600 ; probably meant to check if Heart Ritual was performed, but is never set, and superseded by flag 462 for points)
  • 327 - Performed Breath Ritual (set as the Breath Ritual completes ; duplicated by flag 457 for points)
  • 338 - Saw lost ghost in forest (room 568)
  • 354 - Took the Dark One's Sign (similar to 404?)
  • 360 - Choosing Erana's Staff in Inventory after telling the Ultimate Joke
  • 361 - Opened Mad Monk's Tomb and retrieved the Bone Ritual
  • 364 - Second encounter with the Faery Folk Queen
  • 365 - Last encounter with the Faery Folk Queen
  • 368 - Encountered the cave Badders
  • 371 - Heart Cave, 1st time
  • 373 - Player is carrying a torch or attending endgame ceremony
  • 374 - Heart Cave, Badders are defeated
  • 376 - Switched from Arcade to Strategy or vice versa
  • 379 - On by default
  • 382 - Triggered the Warp screen (Restore/Restart/Quit upon dying)
  • 385 - Flaming sword Paladin ability was activated (impossible to activate by normal means)
  • 386 - Making heroic pose (?)
  • 387 - Had Blackbird in Quest for Glory 3 (determined upon importing)
  • 392 - Crossed over the pit in the room above Pit Horror (formerly the last Boyar)
  • 398 - Encountered Ligeia's Ghost at the cemetery
  • 399 - Read note (which was left with flag 152) in the hero's inn room
  • 400 - Restarted

Points Flags

To Do: Finish this section up with descriptions of all the flags

  • 401 - Bone Cave, lighted a torch
  • 402 - Bone Cave, picked up Dagger, 5 Crowns, 13 Kopeks from the very first corpse
  • 403 - Room above Pit Horror (formerly the last Boyar), crossed the tightrope
  • 404 - Took the Dark One's Sign (like 354?)
  • 411 - Got your first Healing Potion (2 points)
  • 412 - Got your first Poison Cure Potion (2 points)
  • 413 - Got the Rehydration Solution (2 points)
  • 428 - Took Rubber Chicken from Gnome Punny Bones' room (2 points)
  • 433 - Re-entered Gnome Punny Bones' room with the good humor bar (similar to 130?)
  • 440 - Rehydrate the Monastery Domovoi (6 points ; also used in logic to determine whether you have received/used the Rehydration solution)
  • 444 - Befriended the Rusalka (similar to 312?)
  • 446 - Entered crypt from the cemetery for the first time (similar to 249?)
  • 448 - Exited crypt to the secret passage for the first time
  • 448 - Exited crypt to the cemetery for the first time
  • 449 - Gave Tanya her doll and thus gained her trust (like 143?)
  • 450 - (following Tanya's rescue) non Wizards acquire Erana's staff while Wizards learn Summon Staff (and thus Resistance too)
  • 452 - Entering the Dark One's Cave for the endgame when taken there by Katrina and Ad Avis (15 points)
  • 453 - Performed the Bone Ritual (6 points), allows access to the Blood Cave
  • 454 - Got out of the Bone Cage (15 points)
  • 455 - Performed the Blood Ritual (6 points), allows access to the Breath Cave
  • 456 - Escaped the Blood Room (15 poins)
  • 457 - Performed the Breath Ritual (6 points), allows access to the Senses Cave
  • 458 - Escaped the Breath Room after the Ritual was performed (15 points)
  • 459 - Performed the Senses Ritual (6 points), activates the sparks in the Senses Cave, enables the Heart Ritual to be performed
  • 460 - Escaped the Senses Room after the Ritual was performed (15 points)
  • 461 - Got the Essence Ritual book nearby Pit Horror (formerly the last Boyar) (15 points)
  • 462 - Heart Cave, performed the Heart Ritual (6 points)
  • 463 - Climbing to the Essence Room (6 points)
  • 464 - Freed Erana (50 points)
  • 443 - Got at least one card reading (2 points)
  • 479 - Related to defeating the Master Wraith
  • 480 - Defeated Badders - Fighter
  • 482 - Defeated Revenant - Fighter
  • 488 - Defeated Wraith
  • 498 - Learned the Glide spell from Dr. Cranium by asking about magic
  • 513 - Finding the Thief Chief in the Thieves' Guild
  • 514 - Helping out the Thief Chief
  • 516 - Related to defeating the Master Wraith
  • 528 - Related to defeating the Master Wraith

Global scripting values

To Do: Finish this section up with descriptions of all the values

  • 12 - Previous room (Used for some event checks for story bound warps)
  • 15 - New puzzle points (still shown in red in the stats' screen)
  • 121 - Night time? (0 is day, 1 is night)
  • 122 - Current day
  • 123 - Time of day - the value can be between 0 to 7, each signifying 3 hours of a day:
    • 0 - Day is dawning (5-7)
    • 1 - Mid morning (8-10)
    • 2 - Midday (11-13)
    • 3 - Mid afternoon (14-16)
    • 4 - Sunset approaching (17-19)
    • 5 - Night is still young (20-22)
    • 6 - Middle of night (23-1)
    • 7 - Not yet dawn (2-4)
  • 125 - Character class (0 for Fighter, 1 for Wizard, 2 for Thief, 3 for Paladin)
  • 140 - Old puzzle points (becomes a copy of global flag 15 once the stats' screen is shown)
  • 201 - Debug mode (0 by default, unless you have the special resource file activating it)
  • 361 - Initial Honor score upon the start of the game, used as a base value when Honor varies, to determine when you get additional Paladin abilities via current honor - initial honor
  • 365 - Current monster encounter
  • 394 - Set to 1 when class is 3 (Paladin), used when Honor varies, to determine when you get additional Paladin abilities
  • 414 - Used in room 280 (Mordavia East end with Nikolai) for date checks regarding your first interaction with Nikolai
  • 415 - Used in room 250 (Mordavia North end) and initialized with global122
  • 416 - Records on which day you last met Katrina (at the town gate or at the castle gates) by copying the value of global122, used for date checks in the room at the inn (3 days) or at the castle gate (2 days) to enforce delays
  • 425 - Records on which day you last were at room 600 (Castle Gates), used in the event determination logic
  • 426 - Copy of global122 (current day) in rooms 320 and 330 (Inn and Hero's room), probably to keep track of the time the Hero entered the screen
  • 427 - Controls the event number to be executed in the inn when the Hero sleeps
    • 1 - Not defined ?
    • 2 - Not defined ?
    • 3 - Not defined ?
    • 4 - Sets local0 variable to 5 -> global variable incremented by 1
      • Set to this value when sleeping at the Inn after flag 39 has been set (Gypsy has been set free; method doesn't matter)
      • Will cause the Hero to hear Bella weep (dialogue sequence 10 6 10) and flag 136 to be set (then used in room 320)
    • 5 - Sets local0 variable in room 330 set to 7 -> global variable incremented by 1
      • Set to this value when interrupted sleeping at night by Bella's weeping
      • Reaching this value will prevent the sleep interruption that would nudge you into seeing the Domovoi
      • Will then do nothing other than incrementing the variable
    • 6 - Sets local0 variable to 75 -> Erasmus and Fenrus trying to locate the Hero and musing about a Rootin' Tootin' Root Beer commercial -> global variable incremented by 1
    • 7 - Not defined ? Can only be further incremented by saving Tanya ?
    • 8 - Set when coming from the staff screen to your room (happens when having saved Tanya, overrides everything else as it will ensure you get back on track and receive the fake note)
    • 9 - Set when in state 8 and learning the Ultimate Joke ; Triggers the fake Katrina note from Ad Avis that will trigger the end game
  • 428 - Number of times the Hero has slept at the inn (incremented when stamina, health and mana are restored)
    • Sleep 2 times -> local0 variable set to 1 -> Hear Ad Avis and Katrina trying to scry on the Hero (dialogue sequence 10 6 12)
    • Sleep 4 times -> local0 variable set to 2 -> Hear Erasmus and Fenrus trying to scry on the Hero (reference to Erasmus spying on the Dryad; dialogue sequence 10 6 13)
  • 434 - Initialized to a random value (1-26) for the formula to give for Healing Potions
  • 435 - Initialized to a random value (1-26) for the formula to give for Poison Cure Potions
  • 436 - Initialized to a random value (1-26) for the formula to give for the Rehydration Solution
  • 446 - Set to the current day when requesting a Healing Potion, used to ensure you get only one a day
  • 447 - Set to the current day when requesting a Poison Cure Potion, used to ensure you get only one a day
  • 468 - Tracks the total amount paid to the Innkeeper for board and room
  • 469 - When you last paid at the inn
  • 473 - When you last had a card reading by Magda to ensure you get only one a day
  • 500 - Where the above event flags are stored

Local variable flow notes in important rooms

To Do: Finish this section up with descriptions of all the values

Hero's room (Room 330)

  • local0 definition (First condition to match takes precedence)
    • 8 : Set when coming from the staff screen to your room (ostensibly happens when saving Tanya), sets global 427 variable to 8 for the next time you sleep at the Inn, which will trigger the fake note if you know the Ultimate Joke
    • 5 : Set if global variable 427 was equal to 4
    • 4 : Set if flag 39 was set (Gypsy released), and global variable 427 < 4
    • 11 : Domovoi quest related (help Monastery Domovoi) ; Set if global variable 426 was set, if flag 138 was set (Monastery Domovoi saved), and flags 154 and 139 not set
    • 12 : Domovoi quest related (help Gnome Punny Bones) ; Set if global variable 426 was set but different from global variable 122, if global variable 122 was >= to 12, and flags 130 and 155 not set
    • 13 : Domovoi quest related (rescue Tanya) ; Set if global variable 426 was set but different from global variable 122, if global variable 122 was >= to 16, and flag 139 set (Domovoi met a second time) but flags 115 and 156 not set
    • 3 : Set if global variable 122 >= to 5, flag 37 set (Igor missing), flag 48 not set (Igor not yet saved)
    • 1 : Set if you have slept two nights at the Inn
    • 2 : Set if you have slept four nights at the Inn
    • 10 : Set if flag 110 (Katrina Geas) is set but flag 153 is not (Hearing Erasmus zap his beard while scrying)
    • 75 : Set if global variable 427 was equal to 6
    • 7 : Set if global variable 427 was equal to 5 and flag 115 was not set (Tanya not rescued)
  • local0 use (First condition to match takes precedence)
    • 11 12 13 : Also checks if global variable 123 is <= 6 and local10 is not defined -> Sets local10 and local4 to 1 (local4 spawns the Domovoi)
      • 11 : Sets flag 154
      • 12 : Sets flag 155
      • 13 : Sets flags 156 and 144
    • 5 : If global variable 427 was not at 5 your sleep is interrupted at midnight (dialogue sequence 10 6 15), local5 is set
    • 1 : Hear Ad Avis and Katrina scrying on the Hero (dialogue sequence 10 6 12)
    • 2 : Hear Erasmus and Fenrus trying to scry on the Hero (reference to Erasmus spying on the Dryad; dialogue sequence 10 6 13)
    • 3 : Hear Ad Avis and Katrina scry again on the Hero (dialogue sequence 10 6 14)
    • 4 : Set global variable 427 to 4 -> Do nothing that night but trigger next night at the Inn
    • 7 : Set global variable 427 to 6 -> Do nothing that night but trigger next night at the Inn
    • 75 : Set global variable 427 to 7, Erasmus and Fenrus trying to locate the Hero and musing about a Rootin' Tootin' Root Beer commercial
    • 8 : Set global variable 427 to 8 -> Do nothing that night but trigger next night at the Inn
    • 10 : Hear Erasmus zap his beard while scrying, flag 153 is set
  • local4 : If set, the Domovoi will appear
  • local5 : Set when your sleep is interrupted
    • Interruption can be caused by the Domovoi for local0 values 11 12 13
    • But also by Bella weeping (dialogue sequence 10 6 16), which sets flag 136, and forces global variable 123 to be at 6 if it was >= 4, also kicking script 7 7
  • local10 : Set at the same time as local4 for Domovoi related events, likely to prevent the Domovoi from spawning again


References


Related Links