Ultima Underworld/technical/conversations/2

From Ultima Codex
Jump to navigation Jump to search

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 #2 // string block 0x0e02 (3586), name Shak // // 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]global[0]; 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[24]; global[10] = x_skills( 2, &locals[2], &locals[1] ); locals[1] = 15; locals[2] = 10001; if ( global[0] == 0 ) { func_13bb(); global[0] = 1; global[3][1] = 0; global[3][2] = 0; global[6][1] = 0; global[6][2] = 0; global[9] = 0; global[2] = -1; } // end if if ( npc_talkedto ) { func_0729(); } else { say( "Greetings to ye. I am Shak of the Mountain-folk. What may I do for ye?" ); locals[3] = 2; // "I need some information." locals[4] = 3; // "I have need of thy skills." locals[5] = 0; // "" locals[24] = babl_menu( 0, &locals[3] ); switch ( locals[24] ) { case 1: func_0343(); break; case 2: func_03fb(); } // end if break; } // end switch } // end func void func_0343() { int locals[22]; say( "What do ye wish tae ken?" ); locals[1] = 5; // "What dost thou know of the Talismans of Sir Cabirus?" locals[2] = 6; // "Where might I find a good weaponsmith?" locals[3] = 7; // "Canst thou teach me to repair items myself?" locals[4] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_0801(); break; case 2: func_03fb(); break; case 3: func_039f(); break; } // end switch } // end func void func_039f() { int locals[22]; say( "Well, there's no substitute for practice, but I've heard tell that the mantra LON may help ye to repair items with more skill. Now, can I do anything else for ye?" ); locals[1] = 9; // "This is in need of repair. Canst thou repair it?" locals[2] = 10; // "Canst thou tell me what this is?" locals[3] = 11; // "Dost know aught of Cabirus' Talismans?" locals[4] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_0443(); break; case 2: func_0dfb(); break; case 3: func_0801(); break; } // end switch } // end func void func_03fb() { int locals[22]; say( "If it's smithing ye need, ye have come to the right man. But my services are nae cheap. Can ye pay?" ); locals[1] = 13; // "No, I cannot." locals[2] = 14; // "Yes, I'll pay a fair price." locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_067e(); break; case 2: func_06e1(); break; } // end switch } // end func void func_0443() { int locals[69]; locals[21] = 0; label_044d:; if ( locals[21] > 2 ) { say( "Ach, ye're wastin' me time." ); func_00c2(); } // end if locals[18] = 0; locals[19] = 0; locals[16] = show_inv( 2, &locals[8], &locals[3] ); if ( locals[16] == 0 ) { locals[21] = locals[21] + 1; } else { locals[18] = 0; locals[19] = 0; locals[17] = 1; while ( locals[17] <= locals[16] && (!locals[19] || !locals[18]) ) { if ( locals[2] == 280 ) { locals[19] = 1; locals[13] = locals[7]; } // end if if ( locals[2] == 281 ) { locals[18] = 1; locals[14] = locals[7]; } // end if locals[17] = locals[17] + 1; } // while locals[1] = sex( 2, &locals[23], &locals[22] ); locals[22] = 16; locals[23] = 17; if ( locals[19] && locals[18] ) { say( "Aye, 'tis a fine sword there, @SS1. I'm afraid it's seen better days, though. Dinna fear, I'll make it whole for ye again. But I must charge ye 20 gold pieces for such fine work, paid when you pick it up." ); locals[24] = 19; // "Not yet, I have something else to do first." locals[25] = 20; // "Very well. Here it is." locals[26] = 0; // "" locals[45] = babl_menu( 0, &locals[24] ); switch ( locals[45] ) { case 1: func_13ac(); break; case 2: func_0ada( &locals[13] ); } // end if } else { break; } // end switch if ( locals[16] > 1 ) { if ( locals[21] > 2 ) { say( "Ach, ye're wastin' me time" ); func_00c2(); } // end if say( "Ach, do I look like I have four arms? I can only fix one thing at a time, you know. " ); locals[21] = locals[21] + 1; } else { if ( locals[3] > 63 ) { if ( (((locals[3] == 201 || locals[3] == 203) || locals[3] == 202) || locals[3] == 200) ) { say( "Well, I'm afraid this has seen its last fight. 'Tisn't even worth trying to fix." ); } else { if ( (locals[3] == 280 || locals[3] == 281) ) { say( "Ah, looks like 'tis half of the Sword Caliburn. Nothing I can do to it without its other half, though!" ); } else { say( "Ach, what do I look like? This be a smithy, not a trinket shop. Weapons and armor, that's my work!" ); locals[21] = locals[21] + 1; } else { locals[20] = check_inv_quality( 1, &locals[8] ); locals[46] = 0; locals[47] = 0; identify_inv( 4, &locals[47], &locals[2], &locals[46], &locals[8] ); switch ( locals[20] ) { case 16: say( "Ah, ye'll not be bringing me trash like that to fix, will ye? 'Tisn't worthy of me time. Look a' it! S'worthless! Goblin-work, no doubt. No, ye'll be wanting a new one, I'm sure." ); goto label_063b; break; case 63: say( "Ah! This @SS2 is in perfect condition! There's nothin' I can do for ye." ); goto label_063b; break; func_0bb4( &locals[8] ); } // end if } // end if } // end if } // end if } // end if label_063b:; label_063b:; say( "What will ye be needin' fixed, then?" ); locals[48] = 29; // "Oh, here it is." locals[49] = 30; // "Oh, never mind..." locals[50] = 0; // "" locals[69] = babl_menu( 0, &locals[48] ); locals[69] == 1; // expr. has value on stack! goto label_044d; } // end switch if ( locals[69] == 2 ) { func_13ac(); } // end if } // end func void func_067e() { int locals[25]; locals[1] = sex( 2, &locals[3], &locals[2] ); locals[2] = 31; locals[3] = 32; say( "Well, I'm sorry. Ye seem like a nice enough @SS1. Why don't ye go out and kill something and take its hoard?" ); locals[4] = 34; // "I could, but 'twould not be right!" locals[5] = 35; // "Very well. I shall return." locals[6] = 0; // "" locals[25] = babl_menu( 0, &locals[4] ); switch ( locals[25] ) { case 1: func_0a88(); break; case 2: func_0ad0(); break; } // end switch } // end func void func_06e1() { int locals[22]; say( "Ach, verra well then. Let's have a look." ); locals[1] = 37; // "Canst thou tell me what this is?" locals[2] = 38; // "This is in need of repair. Canst thou repair it?" locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_0dfb(); break; case 2: func_0443(); break; } // end switch } // end func void func_0729() { int locals[29]; locals[1] = sex( 2, &locals[7], &locals[6] ); locals[6] = 39; locals[7] = 40; if ( global[2] > 0 ) { if ( !func_0106( 3, 6 ) ) { func_018f( &locals[3], 3, 6 ); if ( locals[4] == 1 ) { locals[2] = 41; } else { locals[2] = 42; } // end if say( "Ach, I told ye it would take @GI3C2 minutes. Come back in @SI3C2 @SS2!" ); func_00c2(); } // end if if ( global[2] == 10 ) { func_1064(); } else { func_0d65(); } // end if } else { say( "Ach, 'tis the bold one @SS1! Wha' may I do for ye?" ); locals[8] = 45; // "This is in need of repair. Canst thou repair it?" locals[9] = 46; // "Canst thou tell me what this is?" locals[10] = 47; // "Dost know aught of Cabirus' Talismans?" locals[11] = 48; // "Canst thou help me to repair broken items?" locals[12] = 0; // "" locals[29] = babl_menu( 0, &locals[8] ); switch ( locals[29] ) { case 1: func_0443(); break; case 2: func_0dfb(); break; case 3: func_0801(); break; case 4: func_039f(); } // end if break; } // end switch return; } // end func void func_0801() { int locals[22]; say( "Little enough o' most, but I ken well that two o' them were smith-work. A sword and a shield they were, both fine work." ); locals[1] = 50; // "Tell me of this Sword." locals[2] = 51; // "Tell me of this Shield." locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_08a5(); break; case 2: func_0849(); break; } // end switch } // end func void func_0849() { int locals[22]; say( "The Shield of Valor, it were named. Never a finer one did I see. 'Twas Blackthorne's once, or so I've 'eard tell. But it were one o' those things easier to set aside than to take up again, an' he left it when he went to become the conscience for all the world. Ach, but that were a mess. Be there aught else I can do for ye?" ); locals[1] = 53; // "Dost know where the Shield is now?" locals[2] = 54; // "Tell me about the Sword." locals[3] = 55; // "No, thank you." locals[4] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_0953(); break; case 2: func_08a5(); break; case 3: func_13ac(); break; } // end switch } // end func void func_08a5() { int locals[22]; if ( global[9] ) { func_08f7(); } else { say( "Aye, now there was a weapon! Willful, they say, but potent beyond mortal blades. It had a sense of fair play, did Caliburn. 'Twasn't for naught they called it the Sword o' Justice. 'Twas forged by the great Flamebeard himself. Would there be anythin' else, then?" ); locals[1] = 57; // "Dost know where the Sword lies?" locals[2] = 59; // "No, thank you." locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: say( "No, I do not. Broken into two pieces, I hear it was, but where they are I canna tell ye." ); break; case 2: break; } // end switch func_13ac(); } // end if } // end func void func_08f7() { int locals[22]; say( "Well, ye can see it yourself, now that I've fixed it for ye. A fine blade, is she not? 'Twill serve ye well, if ye're careful to use it in a just cause. Be there anything else I can do for ye?" ); locals[1] = 61; // "This is in need of repair. Canst thou repair it?" locals[2] = 62; // "Canst thou tell me what this is?" locals[3] = 63; // "No, but I thank thee for thy help." locals[4] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_0443(); break; case 2: func_0dfb(); break; case 3: func_13ac(); break; } // end switch } // end func void func_0953() { int locals[81]; say( "Ah, I dinna ken that a' all. If ye should see it, let me know!" ); locals[16] = 65; // "I will indeed." locals[17] = 66; // "Is this it?" locals[18] = 0; // "" locals[37] = babl_menu( 0, &locals[16] ); switch ( locals[37] ) { case 1: func_13ac(); break; case 2: break; } // end switch label_0996:; locals[1] = 1; locals[2] = 0; locals[3] = show_inv( 2, &locals[9], &locals[4] ); while ( locals[1] <= locals[3] ) { if ( locals[3] == 55 ) { locals[2] = locals[1]; locals[14] = locals[8]; } // end if locals[1] = locals[1] + 1; } // while if ( locals[2] > 0 ) { say( "That's it all right, the Shield of Valor itself. Lucky ye are to have found it. Never a better shield was there fashioned, to my knowledge. Can I help ye further?" ); } else { say( "That's no Shield of Valor I see!" ); locals[38] = 69; // "Ah, is this it?" locals[39] = 70; // "I have not found it, then." locals[40] = 0; // "" locals[59] = babl_menu( 0, &locals[38] ); switch ( locals[59] ) { case 1: goto label_0996; break; case 2: say( "Well, don't ye give up hope. If 'twere made, 'twill be found. Now, is there anything else?" ); goto label_0a34; } // end if break; } // end switch label_0a34:; locals[60] = 72; // "This is need of repair. Canst thou repair it?" locals[61] = 73; // "Canst thou tell me what this is?" locals[62] = 74; // "No, but I thank thee for thy help." locals[63] = 0; // "" locals[81] = babl_menu( 0, &locals[60] ); switch ( locals[81] ) { case 1: func_0443(); break; case 2: func_0dfb(); break; case 3: func_13ac(); break; } // end switch } // end func void func_0a88() { int locals[22]; say( "Aye, I suppose ye're right. Perhaps ye might be able to find some valuables lying around somewhere." ); locals[1] = 76; // "Very well. I shall try it." locals[2] = 77; // "Thanks, but I shall look elsewhere." locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_13ac(); break; case 2: func_13ac(); break; } // end switch } // end func void func_0ad0() { func_13ac(); } // end func void func_0ada() { int locals[46]; locals[1] = 0; label_0ae4:; locals[2] = 2; if ( !give_to_npc( 2, param1, &locals[2] ) ) { say( "Do ye want the sword fixed or not?" ); locals[3] = 79; // "Yes, sorry, here it is." locals[4] = 81; // "No, I have changed my mind." locals[5] = 0; // "" locals[24] = babl_menu( 0, &locals[3] ); switch ( locals[24] ) { case 1: if ( locals[1] > 2 ) { say( "Ach! Ye be wastin' me time for nothing." ); func_00c2(); } // end if locals[1] = locals[1] + 1; goto label_0ae4; break; case 2: func_13ac(); } // end if } else { break; } // end switch say( "Aye, a beauty, this Caliburn. I'll have her right for ye, soon enough. Come back in an hour, and don't forget the 20 pieces of gold." ); global[2] = 10; func_00ea( 6 ); global[3][1] = 0; global[3][2] = 60; global[1] = 20; locals[25] = 83; // "Excellent. I shall see thee then." locals[26] = 84; // "All right, but hurry. Time is shorter than thou dost know." locals[27] = 0; // "" locals[46] = babl_menu( 0, &locals[25] ); switch ( locals[46] ) { case 1: func_00e0(); break; case 2: func_00c2(); break; } // end switch } // end func void func_0bb4() { int locals[75]; locals[1] = 0; locals[2] = identify_inv( 4, &locals[8], &locals[5], &locals[7], param1 ); locals[7] = 0; locals[8] = 0; locals[3] = check_inv_quality( 1, param1 ); locals[4] = 100 - locals[3] * 100 / 63 * locals[2] / 100; locals[4] = locals[4] / 3; locals[4] = locals[4] - global[10] / 6; switch ( locals[4] ) { case 1: locals[4] = 1; break; case 1: locals[6] = 85; break; locals[6] = 86; say( "It'll cost ye @SI4 @SS6 of gold to get this @SS5 fixed up. Do ye want me to go ahead an' fix it then?" ); locals[9] = 88; // "Yes, please do." locals[10] = 89; // "No, I have changed my mind." locals[11] = 0; // "" locals[30] = babl_menu( 0, &locals[9] ); locals[30] == 1; // expr. has value on stack! } // end switch if ( locals[30] == 2 ) { func_13ac(); } // end if label_0c78:; locals[31] = 1; if ( !give_to_npc( 2, param1, &locals[31] ) ) { say( "Do you want it fixed or not?" ); locals[32] = 91; // "Yes, sorry, here it is." locals[33] = 93; // "No, I have changed my mind." locals[34] = 0; // "" locals[53] = babl_menu( 0, &locals[32] ); switch ( locals[53] ) { case 1: if ( locals[1] > 2 ) { say( "Ach! Ye be wastin' me time for nothing." ); func_00c2(); } // end if locals[1] = locals[1] + 1; goto label_0c78; break; case 2: func_13ac(); } // end if } else { break; } // end switch global[3][1] = 0; global[3][2] = 63 - locals[3] / 2; if ( global[3][2] < 2 ) { global[3][2] = 2; } // end if say( "All right, I'll have it ready for ye in @GI3C2 minutes. An' don't forget the @SI4 @SS6 of gold!" ); global[2] = param1[0]global[0]; func_00ea( 6 ); global[1] = locals[4]; locals[54] = 95; // "Excellent. I shall see thee then." locals[55] = 96; // "All right, but hurry. Time is short." locals[56] = 0; // "" locals[75] = babl_menu( 0, &locals[54] ); switch ( locals[75] ) { case 1: func_00e0(); break; case 2: func_00c2(); break; } // end switch } // end func void func_0d65() { int locals[25]; say( "There ye are. 'Tis right as rain now." ); locals[2] = 50 + random( 1, &locals[1] ); locals[1] = 10; set_inv_quality( 2, &locals[2], 2 ); locals[3] = 1; if ( func_11f7( &locals[3], 1 ) ) { if ( take_id_from_npc( 1, 2 ) == 2 ) { say( "Here, I'll just put it on the floor for ye." ); } // end if global[2] = -1; locals[4] = 99; // "Thank thee. Thou art truly a craftsman. " locals[5] = 100; // "Well, 'tis about time!" locals[6] = 0; // "" locals[25] = babl_menu( 0, &locals[4] ); switch ( locals[25] ) { case 1: func_1187(); break; case 2: func_00c2(); } // end if } else { break; } // end switch say( "Well, ye'll have to come back when ye can pay me. 'Tis quality work, ye know!" ); } // end func void func_0dfb() { int locals[109]; locals[1] = 0; label_0e05:; label_0e05:; locals[3] = show_inv( 2, &locals[10], &locals[5] ); switch ( locals[3] ) { case 0: if ( locals[1] > 2 ) { say( "Ach, ye're wastin' me time!" ); func_00c2(); } // end if say( "Well, what is it ye want me to look at?" ); locals[19] = 104; // "Oh, here it is." locals[20] = 105; // "Forgive me, I have changed my mind." locals[21] = 0; // "" locals[40] = babl_menu( 0, &locals[19] ); switch ( locals[40] ) { case 1: locals[1] = locals[1] + 1; goto label_0e05; break; case 2: func_13ac(); break; } // end switch break; case 1: say( "Ah please, one at a time if ye don't mind." ); locals[41] = 107; // "Oh, then just this." locals[42] = 108; // "Sorry, never mind." locals[43] = 0; // "" locals[62] = babl_menu( 0, &locals[41] ); switch ( locals[62] ) { case 1: locals[1] = 1; goto label_0e05; break; case 2: func_13ac(); break; } // end switch break; } // end switch locals[2] = identify_inv( 4, &locals[64], &locals[15], &locals[63], &locals[10] ); locals[63] = 1; locals[64] = 0; if ( locals[2] / 5 < 3 ) { locals[18] = 1; locals[4] = 0; } else { locals[18] = locals[2] / 3; locals[4] = locals[18] / 5; if ( locals[4] <= global[10] / 6 ) { locals[4] = 0; } else { locals[4] = locals[4] - global[10] / 6; } // end if } // end if if ( locals[4] == 0 ) { locals[17] = 1; } else { locals[17] = func_11f7( &locals[65], &locals[4] ); locals[65] = 2; } // end if if ( locals[18] == 1 ) { locals[16] = 109; } else { locals[16] = 110; } // end if if ( locals[17] ) { if ( (locals[5] == 281 || locals[5] == 280) ) { say( "Why, it seems ye've found part of the Sword Caliburn. A fine sword that would be, if made whole! Now, is there anything else?" ); } else { if ( locals[18] == 0 ) { say( "Why, that's @SS15. Anything more?" ); } else { say( "Why, that's @SS15, worth about @SI18 @SS16. Anything more?" ); } // end if } // end if locals[66] = 114; // "I have something that is in need of repair." locals[67] = 115; // "I need something else identified." locals[68] = 116; // "Canst tell me of Cabirus' Talismans?" locals[69] = 117; // "No, but thank thee." locals[70] = 0; // "" locals[87] = babl_menu( 0, &locals[66] ); switch ( locals[87] ) { case 1: func_0443(); break; case 2: func_0dfb(); break; case 3: func_0801(); break; case 4: func_13ac(); } // end if } else { break; } // end switch say( "Well, I don't work for free ye know! Will there be anything else then?" ); locals[88] = 119; // "I have something that is in need of repair." locals[89] = 120; // "I need something else identified." locals[90] = 121; // "Canst tell me of Cabirus' Talismans?" locals[91] = 122; // "No, but thank thee." locals[92] = 0; // "" locals[109] = babl_menu( 0, &locals[88] ); switch ( locals[109] ) { case 1: func_0443(); break; case 2: func_0dfb(); break; case 3: func_0801(); break; case 4: func_13ac(); break; } // end switch } // end func void func_1064() { int locals[38]; say( "There ye are, all fixed now! A beauty, she is, and good as new." ); locals[2] = 281; do_inv_delete( 1, &locals[2] ); locals[3] = 280; do_inv_delete( 1, &locals[3] ); locals[4] = 10; do_inv_create( 1, &locals[4] ); locals[1] = find_inv( 2, &locals[6], &locals[5] ); locals[5] = 10; locals[6] = 0; if ( locals[1] > 0 ) { locals[7] = 1; locals[8] = 7; locals[9] = -1; locals[10] = -1; locals[11] = -1; locals[12] = -1; locals[13] = -1; locals[14] = -1; x_obj_stuff( 9, &locals[14], &locals[13], &locals[12], &locals[11], &locals[10], &locals[9], &locals[8], &locals[7], &locals[1] ); } // end if locals[15] = 1; if ( func_11f7( &locals[15], 1 ) ) { locals[16] = 10; if ( take_from_npc( 1, &locals[16] ) == 2 ) { say( "Here, I'll just put it on the floor for ye." ); } // end if global[2] = -1; global[9] = 1; locals[17] = 125; // "Thank thee. Thou hast done more than thou knowest." locals[18] = 126; // "Well, it's about time!" locals[19] = 0; // "" locals[38] = babl_menu( 0, &locals[17] ); switch ( locals[38] ) { case 1: func_1187(); break; case 2: func_00c2(); } // end if } else { break; } // end switch say( "Well, ye'll have to come back when ye can pay me. 'Tis quality work, ye know!" ); } // end func void func_1187() { int locals[22]; say( "Would ye be needin' anything else?" ); locals[1] = 129; // "Canst tell me of Cabirus' Talismans?" locals[2] = 130; // "Can you tell me what this is?" locals[3] = 131; // "This is in need of repair also. Canst thou help?" locals[4] = 132; // "No, but thank thee." locals[5] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_0801(); break; case 2: func_0dfb(); break; case 3: func_0443(); break; case 4: func_13ac(); break; } // end switch } // end func void func_11f7() { int locals[68]; if ( param2[0]global[0] == 1 ) { locals[23] = 133; } else { locals[23] = 134; } // end if locals[24] = param1[0]global[0]; if ( 1 == locals[24] ) { say( "Well now, do ye have the @PI-3 @SS23 ye owe me for the work?" ); } else { if ( 1 ) { say( "That'll be @PI-3 @SS23 then!" ); } // end if } // end if locals[25] = 137; // "Yes, here thou art." locals[26] = 138; // "No, I don't have it now." locals[27] = 0; // "" locals[46] = babl_menu( 0, &locals[25] ); switch ( locals[46] ) { case 1: break; case 2: locals[1] = 0; goto label_13a4; break; } // end switch locals[3] = 0; } // end if } // end if if ( locals[3] > 0 ) { locals[47] = 139; // "Sorry, here is thy money." locals[48] = 140; // "I'm sorry, I cannot pay thee." locals[49] = 0; // "" locals[68] = babl_menu( 0, &locals[47] ); switch ( locals[68] ) { case 1: break; case 2: locals[1] = 0; } else { break; } // end switch locals[5] = show_inv( 2, &locals[6], &locals[11] ); if ( locals[5] == 0 ) { if ( locals[3] > 2 ) { locals[1] = 0; } else { say( "Well, are ye payin' me or ain't ye?" ); locals[3] = locals[3] + 1; } else { locals[2] = 1; locals[16] = 0; locals[17] = 0; while ( locals[2] <= locals[5] ) { if ( (locals[10] == 160 || locals[10] == 161) ) { locals[16] = locals[16] + count_inv( 1, &locals[5] ); locals[17] = locals[17] + 1; locals[17] = locals[5]; } // end if locals[2] = locals[2] + 1; } // while if ( locals[16] >= param2[0]global[0] ) { give_to_npc( 2, &locals[18], &locals[17] ); if ( locals[16] > param2[0]global[0] ) { say( "Ah! Thank ye for the tip. I can see ye appreciate fine work when ye see it! Come again!" ); } // end if locals[1] = 1; } else { if ( locals[17] > 0 ) { say( "Ye're not makin' a down payment ye know!" ); locals[3] = 1; } else { say( "I take me payment in gold, I'm nae a pawnshop!" ); locals[3] = 1; } // end if } // end if } // end if label_13a4:; return locals[1]; } // end func void func_13ac() { func_1448(); func_00e0(); say( "Farewell then." ); } // end func void func_13bb() { private[2][1] = 1001; private[2][2] = 1002; private[2][3] = 1003; private[2][4] = 1010; private[2][5] = 1016; private[2][6] = 1000; private[2][7] = -1; private[23][1] = 1019; private[23][2] = 1011; private[23][3] = 291; private[23][4] = 32; private[23][5] = 35; private[23][6] = 38; private[23][7] = 44; private[23][8] = -1; set_likes_dislikes( 2, 65, 44 ); } // end func void func_1448() { int locals[22]; if ( !func_0020() ) { } else { say( "Would ye like to trade items?" ); locals[1] = 147; // "Yes." locals[2] = 148; // "No." locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_1498(); break; case 2: return; } // end if break; } // end switch } // end func void func_1498() { int locals[44]; setup_to_barter( 0 ); while ( !private[1] ) { locals[1] = 149; // "I make thee this offer." locals[2] = 150; // "I demand that thou givest me these items." locals[3] = 151; // "Excuse me, I must think about this deal." locals[4] = 152; // "I do not wish to barter any further." locals[5] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: func_1549(); break; case 2: func_158b(); break; case 3: do_judgement( 0 ); break; case 4: do_decline( 0 ); private[1] = 1; break; } // end switch } // while locals[23] = 153; // "Farewell." locals[24] = 0; // "" locals[44] = babl_menu( 0, &locals[23] ); if ( locals[44] == 1 ) { private[1] = 1; } // end if } // end func void func_1549() { int locals[5]; locals[1] = 154; // "I accept your offer." locals[2] = 155; // "No, I do not like this deal." locals[3] = 156; // "Do ye take me for a fool?" locals[4] = 157; // "I am weary of this haggling." locals[5] = 158; // "Are ye joking with me?" if ( do_offer( 5, &locals[5], &locals[4], &locals[3], &locals[2], &locals[1] ) ) { private[1] = 1; } // end if } // end func void func_158b() { int locals[24]; say( "Do ye intend to rob me?" ); locals[1] = 160; // "Yes, I must." locals[2] = 161; // "No, thou dost misunderstand me." locals[3] = 0; // "" locals[22] = babl_menu( 0, &locals[1] ); switch ( locals[22] ) { case 1: break; case 2: return; break; } // end switch locals[23] = 162; // "If ye insist, ye can have them." locals[24] = 163; // "No! Ye shall not take them!" if ( do_demand( 2, &locals[24], &locals[23] ) ) { private[1] = 1; } else { func_008b(); } // end if } // end func