Ultima Underworld/technical/conversations/142
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 #142 // string block 0x0e8e (3726), name Rodrick // // 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[1]; if ( npc_goal == 11 ) { npc_goal = 5; } // end if if ( private[2] > 8 ) { func_0352(); } else { locals[1] = private[2]; if ( 0 == locals[1] ) { say( "Ha! Another has come to be defeated by the Chaos Knight! Very well, let us see how quickly I can slay thee." ); } else { if ( 1 == locals[1] ) { say( "I am almost tempted to spare thee so that thou canst tell thy companions of my power." ); } else { if ( 2 == locals[1] ) { say( "I see that thou art more interested in conversing than in fighting. A true warrior thou art not." ); } else { if ( 3 == locals[1] ) { say( "Have the Knights sent thee? So much the better, as thy defeat will be a lesson to them all!" ); } else { if ( 4 == locals[1] ) { say( "If thou wert as intelligent as thou art talkative, thou wouldst have fled long ago." ); } else { if ( 5 == locals[1] ) { say( "Thy bravery is admirable, but thy skill is not." ); } else { if ( 6 == locals[1] ) { say( "Perhaps I should have warned thee earlier that I am invincible." ); } else { if ( 7 == locals[1] ) { say( "Thou hast not had enough of my sword? I have certainly had enough of thy tongue." ); } else { if ( 8 == locals[1] ) { say( "Perhaps thou art proud that thou hast not been defeated yet. Worry not, thy time will come soon enough." ); } else { if ( 9 == locals[1] ) { say( "If thou dost think thou canst tire me by speaking incessantly, thou art quite mistaken." ); } // end if } // end if } // end if } // end if } // end if } // end if } // end if } // end if } // end if } // end if private[2] = private[2] + 1; func_008b(); } // end if } // end func void func_0352() { say( "I am bored with speaking to thee, but I will never tire of fighting!" ); func_008b(); } // end func