Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix. lockpicking reaction. #673

Merged
merged 1 commit into from
Aug 20, 2024
Merged

Conversation

Domarion
Copy link
Contributor

@Domarion Domarion commented Aug 20, 2024

Hi!
Npcs wake up if player is picking a lock in sneak mode because every lock-picking action calls snd_play3d which unconditionally sends PERC_ASSESSQUIETSOUND.

In G2NotR scripts snd_play3d function is used only for lock-picking status sounds. And script sends PERC_ASSESSQUIETSOUND only when lock-pick was broken:

func void G_PickLock(var int bSuccess,var int bBrokenOpen)
{
	var int rnd;
	if(bSuccess)
	{
		if(bBrokenOpen)
		{
			Snd_Play3d(self,"PICKLOCK_UNLOCK");
			Print(PRINT_PICKLOCK_UNLOCK);
		}
		else
		{
			Snd_Play3d(self,"PICKLOCK_SUCCESS");
			Print(PRINT_PICKLOCK_SUCCESS);
		};
	}
	else if(bBrokenOpen)
	{
		Snd_Play3d(self,"PICKLOCK_BROKEN");
		Print(PRINT_PICKLOCK_BROKEN);
		rnd = Hlp_Random(100);
		if(rnd <= 25)
		{
			Npc_SendPassivePerc(hero,PERC_ASSESSQUIETSOUND,hero,hero);
		};
	}
	else
	{
		Snd_Play3d(self,"PICKLOCK_FAILURE");
		Print(PRINT_PICKLOCK_FAILURE);
	};
};

@Try Try merged commit 44e19a1 into Try:master Aug 20, 2024
1 check was pending
@Try
Copy link
Owner

Try commented Aug 20, 2024

Make sense. Merged, thanks @Domarion !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants