Skip to content

Commit

Permalink
Update metadata and improve compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed May 11, 2024
1 parent 5b0fa26 commit 014073d
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
push:
paths:
- "Ninja/**/*.src"
- "Ninja/**/*.SRC"
- "Ninja/**/*.d"
- "Ninja/**/*.D"
workflow_dispatch:

# These permissions are necessary for creating the check runs
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
push:
paths:
- "Ninja/**/*.src"
- "Ninja/**/*.SRC"
- "Ninja/**/*.d"
- "Ninja/**/*.D"
- "_work/Data/**/*"
workflow_dispatch:

# These permissions are necessary for creating the check runs
permissions:
Expand Down
3 changes: 3 additions & 0 deletions KeepTraderWeapons.vm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ VDFName=.\KeepTraderWeapons.vdf

[FILES]
; Modular resources
_work\Data\Anims\*.MDS
_work\Data\Anims\MDS_Mobsi\*.MDS
_work\Data\Anims\MDS_Overlay\*.MDS
_work\Data\Anims\_compiled\*.MAN
_work\Data\Anims\_compiled\*.MDH
_work\Data\Anims\_compiled\*.MDL
Expand Down
20 changes: 4 additions & 16 deletions Ninja/KeepTraderWeapons/Content/FixEquipBestWeapons.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ func void Patch_KTW_FixEquipBestWeapons_Init() {
if (!once) {
MEM_InitAll();

const int oCNpc__Enable_equipBestWeapons_G1C = 6955616; //0x6A2260
const int oCNpc__Enable_equipBestWeapons_G1A = 7162498; //0x6D4A82
const int oCNpc__Enable_equipBestWeapons_G2C = 7238946; //0x6E7522
const int oCNpc__Enable_equipBestWeapons_G2A = 7626662; //0x745FA6
var int addr; addr = MEMINT_SwitchExe(oCNpc__Enable_equipBestWeapons_G1C,
oCNpc__Enable_equipBestWeapons_G1A,
oCNpc__Enable_equipBestWeapons_G2C,
oCNpc__Enable_equipBestWeapons_G2A);
const int oCNpc__Enable_equipBestWeapons[4] = { /*G1*/6955616, /*G1A*/7162498, /*G2*/7238946, /*G2A*/7626662 };
var int addr; addr = oCNpc__Enable_equipBestWeapons[KTW_EXE];

// Remove default equipping of best melee and ranged weapon to add more conditions
const int nop20Bytes[5] = { -1869574000, -1869574000, -1869574000, -1869574000, -1869574000 }; //0x90 * 20
Expand All @@ -41,18 +35,12 @@ func void Patch_KTW_FixEquipBestWeapons_Init() {
};

func void Patch_KTW_NpcEquipBestWeaponByType(var C_Npc npc, var int type) {
const int oCNpc__EquipBestWeapon_G1C = 6988320; //0x6AA220
const int oCNpc__EquipBestWeapon_G1A = 7196944; //0x6DD110
const int oCNpc__EquipBestWeapon_G2C = 7274832; //0x6F0150
const int oCNpc__EquipBestWeapon_G2A = 7663408; //0x74EF30
const int oCNpc__EquipBestWeapon[4] = { /*G1*/6988320, /*G1A*/7196944, /*G2*/7274832, /*G2A*/7663408 };
var int npcPtr; npcPtr = _@(npc);
const int call = 0;
if (CALL_Begin(call)) {
CALL_IntParam(_@(type));
CALL__thiscall(_@(npcPtr), MEMINT_SwitchExe(oCNpc__EquipBestWeapon_G1C,
oCNpc__EquipBestWeapon_G1A,
oCNpc__EquipBestWeapon_G2C,
oCNpc__EquipBestWeapon_G2A));
CALL__thiscall(_@(npcPtr), oCNpc__EquipBestWeapon[KTW_EXE]);
call = CALL_End();
};
};
Expand Down
1 change: 1 addition & 0 deletions Ninja/KeepTraderWeapons/Content/exe_G1.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const int KTW_EXE = 0;
1 change: 1 addition & 0 deletions Ninja/KeepTraderWeapons/Content/exe_G112.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const int KTW_EXE = 1;
1 change: 1 addition & 0 deletions Ninja/KeepTraderWeapons/Content/exe_G130.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const int KTW_EXE = 2;
1 change: 1 addition & 0 deletions Ninja/KeepTraderWeapons/Content/exe_G2.d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const int KTW_EXE = 3;
2 changes: 2 additions & 0 deletions Ninja/KeepTraderWeapons/Content_G1.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Ikarus
LeGo

Content\exe_G1.d

Content\FixEquipBestWeapons.d

Content\init.d
2 changes: 2 additions & 0 deletions Ninja/KeepTraderWeapons/Content_G112.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Ikarus
LeGo

Content\exe_G112.d

Content\FixEquipBestWeapons.d

Content\init.d
2 changes: 2 additions & 0 deletions Ninja/KeepTraderWeapons/Content_G130.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Ikarus
LeGo

Content\exe_G130.d

Content\FixEquipBestWeapons.d

Content\init.d
2 changes: 2 additions & 0 deletions Ninja/KeepTraderWeapons/Content_G2.src
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Ikarus
LeGo

Content\exe_G2.d

Content\FixEquipBestWeapons.d

Content\init.d
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Prevent traders from auto-equipping the best weapons which made them inaccessibl
This is a modular modification (a.k.a. patch or add-on) that can be installed and uninstalled at any time and is virtually compatible with any modification.
It supports <kbd>Gothic 1</kbd>, <kbd>Gothic Sequel</kbd>, <kbd>Gothic II (Classic)</kbd> and <kbd>Gothic II: NotR</kbd>.

###### Generated from [szapp/patch-template](https://github.com/szapp/patch-template).
<sup>Generated from [szapp/patch-template](https://github.com/szapp/patch-template).</sup>

![Screenshot](https://github.com/szapp/KeepTraderWeapons/assets/20203034/1277de6a-f626-4229-95aa-76cf1d9c7dbe)

Expand Down Expand Up @@ -48,8 +48,8 @@ The patch is also available on
### Requirements

<table><thead><tr><th>Gothic</th><th>Gothic Sequel</th><th>Gothic II (Classic)</th><th>Gothic II: NotR</th></tr></thead>
<tbody><tr><td><a href="https://www.worldofgothic.de/dl/download_6.htm">Version 1.08k_mod</a></td><td>Version 1.12f</td><td><a href="https://www.worldofgothic.de/dl/download_278.htm">Report version 1.30.0.0</a></td><td><a href="https://www.worldofgothic.de/dl/download_278.htm">Report version 2.6.0.0</a></td></tr></tbody>
<tbody><tr><td colspan="4" align="center"><a href="https://github.com/szapp/Ninja">Ninja 2</a> (or higher)</td></tr></tbody></table>
<tbody><tr><td><a href="https://www.worldofgothic.de/dl/download_34.htm">Version 1.08k_mod</a></td><td>Version 1.12f</td><td><a href="https://www.worldofgothic.de/dl/download_278.htm">Report version 1.30.0.0</a></td><td><a href="https://www.worldofgothic.de/dl/download_278.htm">Report version 2.6.0.0</a></td></tr></tbody>
<tbody><tr><td colspan="4" align="center"><a href="https://github.com/szapp/Ninja">Ninja 2.8</a> or higher</td></tr></tbody></table>

<!--
Expand Down

0 comments on commit 014073d

Please sign in to comment.