Files
kq4-decompile/rooms/kq4-074-troll-cave.md
2026-02-20 10:16:03 -08:00

4.7 KiB

Room 74: Troll Cave

A dark cave area within the troll caverns. This room serves as a transitional space connecting to the main troll cave areas. The player enters with a lantern (view 904) and must be careful not to let it go out, or they will be caught by the troll. The room has minimal local logic and relies entirely on region 605 (regTroll) for all interactions.

Look Description

"Passageways lead into the darkness of this frightening cave!" (Print 605 5)

Interactions

Status Behavior Type Command Response
TODO Look look / look around "The cave is VERY dark. Try as you might, you cannot peer through the darkness." (Print 605 7)
TODO Look look out / look out/cave "You cannot look outside from here." (Print 605 2)
TODO Look look cave "The lantern you are carrying does little good in helping you to see in this dark cave." (Print 605 3) - requires lantern (item 3)
TODO Look look dirt / look down "The earth floor of the cave is cold and hard." (Print 605 4) - requires lantern (item 3)
TODO Look look passageway "Passageways lead into the darkness of this frightening cave!" (Print 605 5) - requires lantern (item 3)
TODO Look look troll "You can't SEE the troll! It's too DARK in here!" (Print 605 6)
TODO Action climb boulder / get boulder "It's difficult to see in here." (Print 605 8)
TODO Action find troll "You can't SEE the troll! It's too DARK in here!" (Print 605 6)
TODO Talk talk troll / converse/troll "Conversation is not recommended at this time!" (Print 605 9)
TODO Action kill troll "You have NO way of killing a vicious troll!" (Print 605 10)
TODO Action get troll / capture troll "BE SERIOUS!!" (Print 605 11)
TODO Action kiss troll / kiss "Are you sure you're all right?" (Print 605 12)
TODO Inventory give/deliver <item> to troll "Trying to give ANYTHING to this nasty troll is not a good idea!!" (Print 605 13)
TODO Inventory extinguish lantern / turn off lantern Extinguishes the lantern
TODO Inventory light lantern / ignite lantern / turn on lantern Lights the lantern

Scripts

Status Behavior Type Name Trigger Behavior
TODO Background trollScript When global126 = 1 (troll is active) Spawns the troll NPC (view 190) at position (73, 166) and initiates chase behavior
TODO Background trollScript Random 50% chance on room entry (rooms 71, 72, 73, 74, 75) when troll not already present 50% chance to spawn the troll in the room
TODO Interaction gotchaScript When player extinguishes lantern in darkness Triggers the troll capture sequence with death
TODO Interaction gotchaScript When troll catches player (within 5 pixels) Triggers the troll capture sequence
TODO Background theLight Always when player has lantern lit Follows player and provides light effect (view 967, loop 4)
TODO Background doMusic On room entry Plays troll cave ambient music (sound 66)

Technical Notes

  • Room Number: 74
  • Picture: 74
  • Region: 605 (regTroll) - handles all troll-related interactions
  • Exits: North→71, East→75
  • Music: Sound 66 (trollCaveMusic) - ambient cave sound

State Variables

Variable Values Description
global101 1 Room initialization flag
global126 0, 1 Troll state: 0 = not spawned, 1 = troll is active
global127 0, 1 Player caught flag - set when troll catches player
global189 0, 1 Region initialized flag
local1 0, 1 Troll spawn attempt flag - prevents multiple spawn attempts
local2 0, 1 Hidden troll flag - for room 76 stealth sequences
local3 0, 1 Player caught sequence flag
gEgo view 904, 967 904 = normal lantern view, 967 = lit lantern view

Synonyms

  • dirt = dirt (region-level synonym)
  • kiss = kiss, embrace (region-level synonym)
  • troll = troll, man (region-level synonym)

Entry Points

  • From room 75 (east): Player positioned at (295, 167)
  • From other directions: Player positioned at (109, 84)

Special Mechanics

  • Player uses view 904 (lantern) on entry - this is the cave/lantern view
  • If player does not have lantern (item 3), they cannot see the troll or examine cave features
  • Extinguishing the lantern in the dark area triggers the gotchaScript and results in death
  • The troll can randomly spawn in this room (50% chance on entry)
  • The troll uses view 190 with walk animation and chases the player