Ultima Underworld/technical/conversations/193
Technical Details Warning |
While the encyclopedic nature of the codex means that many articles will have information that could spoil some minor aspects of the game for newer players, this article is known to contain technical information about the game, game engine, data files, logic, etc. This information is not generally useful to the typical game players.
Continue reading at your own discretion. |
This page contains decompiled conversation code from Ultima Underworld. The original files came from Paul Carr and are currently archived here.
This file has been modified from that source (by Sir Robin) in the following ways:
- local variables holding pointers to string text have had that string text specified in a comment on that same line. This should make the conversation code easier to read.
- strings (both dereferenced ones in the code and also the ones added to comments as specified above) have been highlighted for easier reading
- function definitions have been anchored and function calls have been linked, to make it easier to follow the flow of the code
Start viewing the flow at main
// cnvdasm - ultima underworld conversation script disassembler / decompiler // // loading game strings // // conversation #193 // string block 0x0ec1 (3777), name Louvnon // // converting to graph // searching functions // replacing expression opcodes // folding expressions // adding control structures // fixing up functions extern int private[31]; void main() { private[1] = 0; func_029d(); func_0012(); } // end func void func_0012() { private[0] = 1; } // end func void func_0020() { int locals[1]; if ( (((npc_goal == 5 || npc_goal == 6) || npc_goal == 9) && npc_gtarg == 1 || npc_attitude == 0) ) { locals[1] = 0; } else { locals[1] = 1; } // end if return locals[1]; } // end func void func_0063() { npc_gtarg = 1; npc_attitude = 1; npc_goal = 6; func_0012(); } // end func void func_007c() { npc_goal = 1; func_0012(); } // end func void func_008b() { npc_gtarg = 1; npc_goal = 5; npc_attitude = 1; func_0012(); } // end func void func_00a4() { npc_attitude = 6; } // end func void func_00b1() { npc_attitude = param1[0]play_hunger; func_0012(); } // end func void func_00c2() { npc_attitude = 2; func_0012(); } // end func void func_00d1() { npc_attitude = 1; func_0012(); } // end func void func_00e0() { func_0012(); } // end func void func_00ea() { param1[1] = game_days; param1[2] = game_mins; } // end func void func_0106() { int locals[4]; locals[2] = game_days - param2[1]; locals[3] = game_mins - param2[2]; if ( locals[3] < 0 ) { locals[3] = locals[3] + 1440; locals[2] = locals[2] - 1; } // end if if ( locals[2] >= param1[1] && locals[3] >= param1[2] ) { locals[1] = 1; } else { locals[1] = 0; } // end if return locals[1]; } // end func void func_018f() { param1[1] = game_days - param3[1]; param1[2] = game_mins - param3[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if param1[1] = param2[1] - param1[1]; param1[2] = param2[2] - param1[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if } // end func void func_0243() { param1[1] = game_days - param2[1]; param1[2] = game_mins - param2[2]; if ( param1[2] < 0 ) { param1[2] = param1[2] + 1440; param1[1] = param1[1] - 1; } // end if } // end func void func_029d() { int locals[182]; if ( private[0] ) { } else { say( "Ah, hello there. Art thou a mage, as I am?" ); locals[2] = 2; // "I dabble in the mystical arts occasionally." locals[3] = 3; // "Yes, I consider myself to be a mage." locals[4] = 4; // "I prefer to solve the problems I encounter without resorting to magic." locals[5] = 0; // "" locals[23] = babl_menu( 0, &locals[2] ); switch ( locals[23] ) { case 1: goto label_02fd; break; case 2: goto label_02fd; break; case 3: goto label_032e; break; } // end switch label_02fd:; label_02fd:; private[2] = 1; say( "Then I am sure thou wouldst be interested in my research. I am exploring the properties of mantras and shrines." ); locals[24] = 6; // "What hast thou found?" locals[25] = 0; // "" locals[45] = babl_menu( 0, &locals[24] ); if ( locals[45] == 1 ) { } else { label_032e:; say( "Perhaps my research could benefit thee, although thou couldst probably not understand it. I am exploring the properties of mantras and shrines." ); locals[46] = 8; // "What hast thou found?" locals[47] = 0; // "" locals[67] = babl_menu( 0, &locals[46] ); if ( locals[67] == 1 ) { goto label_035a; } // end if } // end if label_035a:; say( "It was long thought that the shrines of the Abyss served only to increase one's ability at some skill. But I have found that this is not necessarily the case. Apparently, some mantras exist that will produce objects, or dispense information." ); locals[68] = 10; // "What mantras are these?" locals[69] = 11; // "Thy research sounds fascinating." locals[70] = 0; // "" locals[89] = babl_menu( 0, &locals[68] ); switch ( locals[89] ) { case 1: break; case 2: break; } // end switch say( "I have not been able to discover any specific mantras with these properties. However, it is said that there is a mantra which will direct one to a powerful object. The mantra has been divided into three parts, which must be reassembled to produce the original word. The tale is from long ago, so I know not its veracity." ); locals[90] = 13; // "Hast thou knowledge of any other mantras?" locals[91] = 14; // "Thank thee for thy time." locals[92] = 0; // "" locals[111] = babl_menu( 0, &locals[90] ); switch ( locals[111] ) { case 1: break; case 2: say( "Thou art quite welcome. Good luck in thy quests!" ); locals[112] = 3; func_00b1( &locals[112] ); break; } // end switch say( "Sadly, I have no further knowledge of individual mantras. I hope that my research has been of some use to thee, however." ); locals[113] = 17; // "We shall see." locals[114] = 18; // "It certainly has. I thank thee kindly." locals[115] = 0; // "" locals[134] = babl_menu( 0, &locals[113] ); switch ( locals[134] ) { case 1: locals[135] = 2; func_00b1( &locals[135] ); break; case 2: locals[136] = 3; func_00b1( &locals[136] ); } // end if break; } // end switch if ( private[2] ) { locals[1] = 19; } else { locals[1] = 20; } // end if say( "@SS1 How may I help thee?" ); locals[137] = 22; // "I would like to know more of mantras." locals[138] = 23; // "I thank thee, but I need thy help no longer." locals[139] = 0; // "" locals[158] = babl_menu( 0, &locals[137] ); switch ( locals[158] ) { case 1: goto label_048c; break; case 2: locals[159] = 2; func_00b1( &locals[159] ); break; } // end switch label_048c:; say( "Unfortunately, I know of no other legendary mantras other than the one of which I told thee previously - the mantra which has been divided into three parts. Magical research is a long and arduous process, and only rarely does one discover truly interesting information." ); locals[160] = 25; // "I thank thee for the help." locals[161] = 0; // "" locals[181] = babl_menu( 0, &locals[160] ); if ( locals[181] == 1 ) { } // end if say( "It has been my pleasure." ); locals[182] = 3; func_00b1( &locals[182] ); } // end func