Gwani Cloaks around Gwani?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Gwani Cloaks around Gwani?

Post by Knight Captain »

I seem to remember the Gwani having a negative reaction if anyone in the party is wearing a Gwani cloak, but can't recreate that even in the DOS version with SS installed. Am I imagining things or did this exist pre-Silver Seed Serpent Isle?
WJH

Re: Gwani Cloaks around Gwani?

Post by WJH »

I very much remember reading somewhere (maybe in a walkthrough) that the Gwani were supposed to be offended, but whether I was playing back in the DOS days or on Exult, it never did actually happen for me.

I played the DOS version both with and without the SS too.
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Malignant Manor »

It is only coded for Bwundiai, but there are 2 wrong checks in Bwundiai's usecode. It looks for the wrong fur pelt frame and uses a water tile instead of the cloak's shape number.

Code: Select all

extern void delayedBark 0x97F (var npc, var bark, var delay);
extern var npcNearbyAndVisible 0x942 (var npc);
extern var hasItemCount 0x97D (var cont, var mincount, var shapenum, var quality, var framenum);
extern var partyUtters 0x992 (var npcnum, var partyutter, var avatarutter, var isbark);

void Func0490 object#(0x490) ()
{
	var var0000;
	var var0001;
	var var0002;
	var var0003;
	var var0004;

	if (!(event == DOUBLECLICK)) goto labelFunc0490_0028;
	UI_item_say(AVATAR, "@Hail there!@");
	delayedBark(0xFF70, "@Aruk nok! Raag!@", 3);
	UI_set_schedule_type(0xFF70, 3);
labelFunc0490_0028:
	if (!(event == STARTED_TALKING)) goto labelFunc0490_0181;
	UI_run_schedule(0xFF70);
	UI_clear_item_say(0xFF70);
	UI_show_npc_face0(0xFF70, 0);
	var0000 = npcNearbyAndVisible(0xFF6F);
	var0001 = hasItemCount(0xFE9B, 1, 0x3D1, 0xFE99, 8); // FUR_PELT with wrong frame number it uses 8 instead of 9
	var0002 = hasItemCount(0xFE9B, 1, 2, 0xFE99, 4); // uses the water floor tile (2) instead of shape 227
	var0003 = UI_get_item_flag(item, 0x1C);
	if (!(var0001 || var0002)) goto labelFunc0490_00C6;
	message("\"Botoka na guta!\" *This creature looks at you with eyes so filled with hate that it is painful to look at them.");
	say();
	if (!var0000) goto labelFunc0490_00B3;
	UI_show_npc_face1(0xFF6F, 0);
	UI_set_conversation_slot(1);
	message("\"Umgabar fotuba na Gwani!\" *This one looks at you with eyes that are cold and feral.");
	say();
	UI_remove_npc_face1();
labelFunc0490_00B3:
	var0004 = partyUtters(0xFFFD, "@Avatar, they smell the Gwani pelts!@", "@They smell the Gwani pelts!@", false);
	goto labelFunc0490_0181;
labelFunc0490_00C6:
	if (!var0003) goto labelFunc0490_00D3;
	message("\"Be good very much to meet again.\"");
	say();
	goto labelFunc0490_00D7;
labelFunc0490_00D3:
	message("\"Thou... the one... Gwenno spoke.\" ~You can tell the creature obviously has great trouble with your language.");
	say();
labelFunc0490_00D7:
	UI_add_answer(["name", "Gwani", "bye"]);
labelFunc0490_00E7:
	converse (0) atend labelFunc0490_0180;
	case "name" atend labelFunc0490_0105:
	UI_remove_answer("name");
	message("\"Bwundai my name is.\"");
	say();
	UI_set_item_flag(item, MET);
labelFunc0490_0105:
	case "Gwani" atend labelFunc0490_0118:
	UI_remove_answer("Gwani");
	message("\"Our village near. But, thou seek Gwenno...\" ~He pauses thoughtfully before speaking to you again. ~\"Gwani Death Temple on island north. West of Ice dragon caves.\"");
	say();
labelFunc0490_0118:
	case "bye" atend labelFunc0490_017D:
	UI_remove_npc_face0();
	UI_remove_npc_face1();
	UI_set_schedule_type(item, SHY);
	UI_set_new_schedules(0xFF70, [1, 3, 6], [11, 16, 14], [0x3A4, 0x368, 0x431, 0x348, 0x427, 0x34D]);
	delayedBark(AVATAR, "@Farewell, little fellow.@", 0);
	delayedBark(0xFF70, "@Fare -- well@", 3);
	abort;
labelFunc0490_017D:
	goto labelFunc0490_00E7;
labelFunc0490_0180:
	break;
labelFunc0490_0181:
	return;
}
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Malignant Manor »

I decided to make an untested fix for Marzo to look at for SI Fixes. The hostile reaction will still trigger if carrying the frame 8 leopard rug or somehow carry a water tile.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Knight Captain »

This seems to work for me. I was surprised that if I don't have Iolo that Shamino speaks, and not either then Dupre, and alone then only the Avatar.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Knight Captain »

The only time it doesn't work is if I have only forcibly-joined NPCs.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Knight Captain »

Mwaerno also has a similar check, he's object#(0x491).
"Rrrow! Meteka Gwani adu laseka!\" This creature looks at you with angry eyes."
"Soko terama dok!\" This one gives you a mean look and spits."
"Avatar, 'tis the pelts! They can smell that we have Gwani pelts on us! I suggest we throw them away!\"
"@I have Gwani pelts!@"
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Knight Captain »

Malignant Manor, your fix works!

Here's what I found:
Bwundiai's name is misspelled twice in the original code, including in his own code.
I re-implemented his non-check conversation as well, so the bad check will be skipped entirely.
All I need to do now to fix him completely is to set his post-conversation schedule. He is only stuck in TALK until you first speak to him without the check. Since that was buggy for Dominus I might see about fixing it too. For some reason I can't recreate it in SIfixes but only in the original unmodded game.

Mwaerno is re-implemented, so while I don't know what he was checking against, he uses the same checks you wrote for Bwundiai and I added his whole dialog.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Knight Captain »

Bwundiai's checks for the incorrect pelt frame:

Code: Select all

var0001 = Func097D(0xFE9B, 0x0001, 0x03D1, 0xFE99, 0x0008);
var0002 = Func097D(0xFE9B, 0x0001, 0x0002, 0xFE99, 0x0004);
Mwaerno's checks for the crossbeam frame 8, which does not exist:

Code: Select all

var0004 = Func097D(0xFE9B, 0x0001, 0x00E3, 0xFE99, 0x0008);
var0005 = Func097D(0xFE9B, 0x0001, 0x0002, 0xFE99, 0x0004);
Funny that both look for the same water tile.

The new code is almost ready, and full of comments.
Knight Captain
Posts: 1219
Joined: Thu May 14, 2020 1:34 pm

Re: Gwani Cloaks around Gwani?

Post by Knight Captain »

Is there a way I can make this into a function so I can reuse the same check for multiple NPCs? I know it's only a few lines of code but I'd like to do it The Right Way(tm).
Locked