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

Exploit: Grindstone in the New Camp can be used without sword blade #52

Merged
merged 1 commit into from Mar 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,7 @@

## v1.1.0 (TBA)
### General
* Fix [#52](https://g1cp.org/issues/52): The grindstone in the New Camp now correctly requires a sword blade to use.
* Fix [#149](https://g1cp.org/issues/149): The armor "Improved ore Armor" is now correctly labelled as "Improved Ore Armor".
* Fix [#192](https://g1cp.org/issues/192): Mages (NPCs fighting only with spells) no longer auto-equip weapons (e.g. after trading). This requires fix #59 to be active.

Expand Down
1 change: 1 addition & 0 deletions docs/changelog_de.md
Expand Up @@ -2,6 +2,7 @@

## v1.1.0 (TBA)
### General
* Fix [#52](https://g1cp.org/issues/52): Der Schleifstein im Neuen Lager setzt zur Benutzung nun korrekt eine Schwertklinge voraus.
* Fix [#144](https://g1cp.org/issues/144): Die Rüstung "Gomez'Rüstung" heißt nun korrekt "Gomez' Rüstung".
* Fix [#145](https://g1cp.org/issues/145): Die Rüstung "leichte Söldnerrüstung" heißt nun korrekt "Leichte Söldnerrüstung".
* Fix [#146](https://g1cp.org/issues/146): Die Rüstung "Novizen Rock" heißt nun korrekt "Novizenrock".
Expand Down
@@ -0,0 +1,47 @@
/*
* #52 MOBs in New Camp can be used without corresponding items
*/
func int G1CP_052_UseWithItemNCGrindstone() {
// Make sure the usage item actually exists
const int symbId = -2;
if (symbId == -2) {
symbId = MEM_GetSymbolIndex("ItMiSwordBlade");
};
if (symbId == -1) {
return FALSE;
};

// Search the VOB
var int vobPtr; vobPtr = G1CP_FindVobByPosF(-58212.9141, 3233.08716, 7490.75928);
if (Hlp_Is_oCMobInter(vobPtr)) {
var oCMobInter mob; mob = _^(vobPtr);
if (Hlp_StrCmp(mob.sceme, "BSSHARP"))
&& (Hlp_StrCmp(mob.useWithItem, "")) {
mob.useWithItem = "ITMISWORDBLADE";
return TRUE;
};
};
return FALSE;
};

/*
* This function reverts the changes
*/
func int G1CP_052_UseWithItemNCGrindstoneRevert() {
// Only revert if it was applied by the G1CP
if (!G1CP_IsFixApplied(52)) {
return FALSE;
};

// Search the VOB again
var int vobPtr; vobPtr = G1CP_FindVobByPosF(-58212.9141, 3233.08716, 7490.75928);
if (Hlp_Is_oCMobInter(vobPtr)) {
var oCMobInter mob; mob = _^(vobPtr);
if (Hlp_StrCmp(mob.sceme, "BSSHARP"))
&& (Hlp_StrCmp(mob.useWithItem, "ITMISWORDBLADE")) {
mob.useWithItem = "";
return TRUE;
};
};
return FALSE;
};
2 changes: 2 additions & 0 deletions src/Ninja/G1CP/Content/Fixes/gamesave.d
Expand Up @@ -26,6 +26,7 @@ func void G1CP_GamesaveFixes_Apply() {
if (G1CP_InitStart()) { // Maximum fix function name length: 45 characters
G1CP_046_SmithDoor(); // #46
G1CP_050_Pillar(); // #50
G1CP_052_UseWithItemNCGrindstone(); // #52
G1CP_093_DE_LogEntryHoratio(); // #93
G1CP_121_DE_LogTopicShrikeHut(); // #121
G1CP_124_GateGuardID(); // #124
Expand All @@ -39,6 +40,7 @@ func void G1CP_GamesaveFixes_Revert() {
if (G1CP_InitStart()) { // Maximum fix function name length: 45 characters
G1CP_046_SmithDoorRevert(); // #46
G1CP_050_PillarRevert(); // #50
G1CP_052_UseWithItemNCGrindstoneRevert(); // #52
G1CP_093_DE_LogEntryHoratioRevert(); // #93
G1CP_121_DE_LogTopicShrikeHutRevert(); // #121
G1CP_124_GateGuardIDRevert(); // #124
Expand Down
13 changes: 13 additions & 0 deletions src/Ninja/G1CP/Content/Tests/test052.d
@@ -0,0 +1,13 @@
/*
* #52 MOBs in New Camp can be used without corresponding items
*
* There does not seem an easy way to test this fix programmatically, so this test relies on manual confirmation.
*
* Expected behavior: The grindstone is not usable anymore (without a sword blade).
*/
func void G1CP_Test_052() {
if (G1CP_TestsuiteAllowManual) {
Wld_SetTime(3, 0); // Get that mercenary out of the way
AI_Teleport(hero, "NC_HUT03_OUT_MOVEMENT");
};
};
2 changes: 2 additions & 0 deletions src/Ninja/G1CP/Content_G1.src
Expand Up @@ -98,6 +98,7 @@ Content\Fixes\Session\fix201_DE_AncientOreArmorText.d
// Game save fixes
Content\Fixes\Gamesave\fix046_SmithDoor.d
Content\Fixes\Gamesave\fix050_Pillar.d
Content\Fixes\Gamesave\fix052_UseWithItemNCGrindstone.d
Content\Fixes\Gamesave\fix093_DE_LogEntryHoratio.d
Content\Fixes\Gamesave\fix121_DE_LogTopicShrikeHut.d
Content\Fixes\Gamesave\fix124_GateGuardID.d
Expand Down Expand Up @@ -139,6 +140,7 @@ Content\Tests\test044.d
Content\Tests\test046.d
Content\Tests\test049.d
Content\Tests\test050.d
Content\Tests\test052.d
Content\Tests\test059.d
Content\Tests\test060.d
Content\Tests\test078.d
Expand Down