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
The player can cancel fights by entering a room #14
Conversation
gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/AI/ZS_Human/ZS_Attack.d Lines 279 to 295 in 2775fbc
changed to func void B_CombatAssessEnterRoom ()
{
PrintDebugNpc (PD_ZS_FRAME, "B_CombatAssessEnterRoom");
if (Wld_GetPlayerPortalGuild() == GIL_NONE
&& !Npc_HasNews(self, NEWS_THEFT, other, self)
&& self.aivar[AIV_ATTACKREASON] == AIV_AR_INTRUDER ) // sonst braucht man nur in einen Raum rennen und der Kampf ist vorbei
{
PrintDebugNpc (PD_ZS_CHECK, "...SC hat Raum des NSCs verlassen und noch nichts geklaut!");
if (self.attribute[ATR_HITPOINTS]==self.attribute[ATR_HITPOINTS_MAX]) // ...und wurde der NSC noch nicht getroffen...
{
PrintDebugNpc (PD_ZS_CHECK, "...NSC unverletzt!");
B_FullStop (self);
B_SetAttackReason (self, AIV_AR_NONE);
B_ResetTempAttitude (self);
B_AssessRemoveWeapon(); // ...dann bricht der NSC den Kampf gerade noch ab!
};
};
}; |
This fix could be implemented by hooking |
What's with |
I can't reproduce the bug. @AmProsius can you give me a scenario how to trigger it reliably? |
Actually, the fix as proposed here does not work. (Where does it come from?) An attack reason ( All this suggested change does is completely disabling aborting an attack when the PC leaves a hut, because the condition will never be true. That's unfortunately not a fix, it actually removes a feature. |
I found a solution that should work: gothic-1-community-patch/scriptbase/_work/Data/Scripts/Content/AI/ZS_Human/ZS_Attack.d Lines 279 to 295 in 2775fbc
changed to func void B_CombatAssessEnterRoom ()
{
PrintDebugNpc (PD_ZS_FRAME, "B_CombatAssessEnterRoom");
if (Wld_GetPlayerPortalGuild() == GIL_NONE
&& !Npc_HasNews(self, NEWS_THEFT, other, self))
&& ((Npc_WasInState(self, ZS_ClearRoom)) || (Npc_WasInState(self, ZS_ClearRoomWait)))
{
PrintDebugNpc (PD_ZS_CHECK, "...SC hat Raum des NSCs verlassen und noch nichts geklaut!");
if (self.attribute[ATR_HITPOINTS]==self.attribute[ATR_HITPOINTS_MAX]) // ...und wurde der NSC noch nicht getroffen...
{
PrintDebugNpc (PD_ZS_CHECK, "...NSC unverletzt!");
B_FullStop (self);
B_ResetTempAttitude (self);
B_AssessRemoveWeapon(); // ...dann bricht der NSC den Kampf gerade noch ab!
};
};
}; |
The test is manual:
|
I reproduced the bug by attacking the immortal gate guard at the main gate of the Old Camp and then running into and out of a hut. The guard then stopped attacking me and returned to the gate. |
Describe the bug
The player can run into a room and immediately leave it to cancel a fight if the NPC has full HP.
Expected behavior
The player can no longer cancel fights by entering and leaving a room.