@execute
Hopefully this works how you would like it to so the timer just doesn't decrease and can still increase and gain bonus time for better rewards. You can also change the time on the clock manually in the script.
Shattered Realm - Timer Does Not Decrease
(Tested on Steam-based v1.1.8.1-v1.1.9.1 x64 only)
This option causes the timer in the Shattered Realm to not decrease, but it can still increase as you gain bonus time for better rewards.
The option's script can also be edited to directly change the time remaining on the clock.
Code: Select all
// Grim Dawn v1.1.8.1 (x64)
// Address:
// Game.GAME::PlayStats::UpdateBonusTimer+13 - 2B C2 - sub eax,edx
// Game.GAME::PlayStats::UpdateBonusTimer+15 - 89 81 6C010000 - mov [rcx+0000016C],eax
// Optional: Custom Timer Value
// Replace "eax" value on line 23 with the time you want on the clock in milliseconds "#300000" = 5 min
// mov [rcx+0000016C],eax
// With:
// mov [rcx+0000016C],#300000
[ENABLE]
aobscanmodule(infRealmTimer,Game.dll,2B C2 89 81 6C 01 00 00)
alloc(newmem,$1000,"Game.dll"+3280C3)
label(code)
label(return)
newmem:
code:
// sub eax,edx // Orig: Subtracts 1 second(edx) from timer(eax)
sub eax,0 // Option: Amount of time subtracted changed to zero
mov [rcx+0000016C],eax // Orig: Moves time(eax) to active timer value after 1 second(edx) is subtracted
jmp return
infRealmTimer:
jmp newmem
nop 3
return:
registersymbol(infRealmTimer)
[DISABLE]
infRealmTimer:
db 2B C2 89 81 6C 01 00 00
unregistersymbol(infRealmTimer)
dealloc(newmem)
{
// ORIGINAL CODE - INJECTION POINT: "Game.dll"+3280C3
"Game.dll"+3280AC: CC - int 3
"Game.dll"+3280AD: CC - int 3
"Game.dll"+3280AE: CC - int 3
"Game.dll"+3280AF: CC - int 3
"Game.dll"+3280B0: 40 53 - push rbx
"Game.dll"+3280B2: 48 83 EC 20 - sub rsp,20
"Game.dll"+3280B6: 8B 81 6C 01 00 00 - mov eax,[rcx+0000016C]
"Game.dll"+3280BC: 48 8B D9 - mov rbx,rcx
"Game.dll"+3280BF: 85 C0 - test eax,eax
"Game.dll"+3280C1: 7E 7C - jle Game.dll+32813F
// ---------- INJECTING HERE ----------
"Game.dll"+3280C3: 2B C2 - sub eax,edx
"Game.dll"+3280C5: 89 81 6C 01 00 00 - mov [rcx+0000016C],eax
// ---------- DONE INJECTING ----------
"Game.dll"+3280CB: 0F B6 89 70 01 00 00 - movzx ecx,byte ptr [rcx+00000170]
"Game.dll"+3280D2: 84 C9 - test cl,cl
"Game.dll"+3280D4: 74 14 - je Game.dll+3280EA
"Game.dll"+3280D6: 3D 10 27 00 00 - cmp eax,00002710
"Game.dll"+3280DB: 7C 09 - jl Game.dll+3280E6
"Game.dll"+3280DD: C6 83 70 01 00 00 00 - mov byte ptr [rbx+00000170],00
"Game.dll"+3280E4: EB 39 - jmp Game.dll+32811F
"Game.dll"+3280E6: 84 C9 - test cl,cl
"Game.dll"+3280E8: 75 35 - jne Game.dll+32811F
"Game.dll"+3280EA: 3D 10 27 00 00 - cmp eax,00002710
}
_____
I am also still learning a lot from inspecting fantomas's options and doing more research, so I also tried to do the option in a way that is more direct and streamlined, but also might be more compatible across game versions. It doesn't do anything with allowing for setting the time on the clock and only stops the timer from decreasing.
Code: Select all
[ENABLE]
Game.GAME::PlayStats::UpdateBonusTimer+13:
db 90 90
[DISABLE]
Game.GAME::PlayStats::UpdateBonusTimer+13:
db 2B C2
As usual, I'm also including the first code I note above as an option in table format for quickly copying the option and pasting it into fantomas's table, or fantomas's options can be copied over into this table if the option sorting framework in it is of use.