mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Increased the maximum party member level from 6 to 10 (closes #621)
Updated scripting documents. * the game reserves 10 level-up messages for each party member. More level-ups require either more hacks or renumbering all level-up messages in misc.msg. Otherwise, one will start using others' lines (e.g. Sulik says Lenny's lines after lv10).
This commit is contained in:
@@ -943,7 +943,10 @@
|
||||
- name: inc_npc_level
|
||||
detail: void inc_npc_level(int party_member_pid)
|
||||
opcode: 0x81a5
|
||||
doc: Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party. This function ignores the player's minimum level and the required number of level-ups between NPC level gains. It also ignores the random element, regardless of sfall's `NPCAutoLevel` or `PartyMemberNonRandomLevelUp` setting.
|
||||
doc: |
|
||||
Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party.
|
||||
- This function ignores the player's minimum level and the required number of level-ups between NPC level gains. It also ignores the random element, regardless of sfall's `NPCAutoLevel` or `PartyMemberNonRandomLevelUp` setting.
|
||||
- Starting from sfall 4.4.10/3.8.50, the maximum possible NPC level is 10.
|
||||
- name: get_npc_level
|
||||
detail: int get_npc_level(string npc)
|
||||
opcode: 0x8241
|
||||
|
||||
@@ -120,6 +120,7 @@ FUNCTION REFERENCE
|
||||
#### `void inc_npc_level(int pid/string name)`
|
||||
- Takes a party member PID or an NPC name (deprecated, for compatibility with sfall 4.1.5/3.8.15 or earlier) as an argument. The NPC must be in your party.
|
||||
- This function ignores the player's minimum level and the required number of level-ups between NPC level gains. It also ignores the random element, regardless of sfall's **NPCAutoLevel** or **PartyMemberNonRandomLevelUp** setting.
|
||||
- Starting from sfall 4.4.10/3.8.50, the maximum possible NPC level is 10.
|
||||
|
||||
-----
|
||||
#### `int get_npc_level(int pid/string name)`
|
||||
|
||||
@@ -1007,7 +1007,7 @@ static __declspec(naked) void op_wield_obj_critter_adjust_ac_hook() {
|
||||
static __declspec(naked) void NPCStage6Fix1() {
|
||||
static const DWORD partyMember_init_End = 0x493D16;
|
||||
__asm {
|
||||
imul eax, edx, 204; // multiply record size 204 bytes by number of NPC records in party.txt
|
||||
imul eax, edx, 220; // multiply record size 220 bytes by number of NPC records in party.txt
|
||||
mov ebx, eax; // copy total record size for later memset
|
||||
call fo::funcoffs::mem_malloc_; // malloc the necessary memory
|
||||
jmp partyMember_init_End; // call memset to set all malloc'ed memory to 0
|
||||
@@ -1017,7 +1017,7 @@ static __declspec(naked) void NPCStage6Fix1() {
|
||||
static __declspec(naked) void NPCStage6Fix2() {
|
||||
static const DWORD partyMemberGetAIOptions_End = 0x49423A;
|
||||
__asm {
|
||||
imul edx, 204; // multiply record size 204 bytes by NPC number as listed in party.txt
|
||||
imul edx, 220; // multiply record size 220 bytes by NPC number as listed in party.txt
|
||||
mov eax, dword ptr ds:[FO_VAR_partyMemberAIOptions]; // get starting offset of internal NPC table
|
||||
jmp partyMemberGetAIOptions_End; // eax + edx = offset of specific NPC record
|
||||
}
|
||||
@@ -3836,13 +3836,13 @@ void BugFixes::init() {
|
||||
HookCall(0x476598, drop_ammo_into_weapon_hook);
|
||||
//}
|
||||
|
||||
// Enable party members with level 6 protos to reach level 6
|
||||
// Enable party members with level 6 protos to reach level 6 (increase the maximum level from vanilla 5 to 10)
|
||||
//if (IniReader::GetConfigInt("Misc", "NPCStage6Fix", 1)) {
|
||||
dlogr("Applying NPC Stage 6 Fix.", DL_FIX);
|
||||
MakeJump(0x493CE9, NPCStage6Fix1); // partyMember_init_
|
||||
MakeJump(0x494224, NPCStage6Fix2); // partyMemberGetAIOptions_
|
||||
SafeWrite8(0x494063, 6); // loop should look for a potential 6th stage (partyMember_init_)
|
||||
SafeWrite8(0x4940BB, 204); // move pointer by 204 bytes instead of 200
|
||||
SafeWrite8(0x494063, 10); // loop should look for a potential 10th stage (partyMember_init_)
|
||||
SafeWrite32(0x4940BB, 220); // move pointer by 220 bytes instead of 200
|
||||
//}
|
||||
|
||||
//if (IniReader::GetConfigInt("Misc", "NPCLevelFix", 1)) {
|
||||
|
||||
Reference in New Issue
Block a user