forked from dredknight/H5_DLL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrainingGrounds.cpp
59 lines (54 loc) · 1.19 KB
/
TrainingGrounds.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "pch.h"
// REMOVE HERO CLASS AND SKILL REQUIREMENTS FOR TRAINING CREATURES IN HAVEN TOWNS
void TrainingGrounds_Towngate();
void TrainingGrounds_Garrison();
void TrainingGrounds_init(pugi::xml_document& doc) {
assembly_patches.push_back({ PATCH_NOP, 0x00CCEBAC, 2, nullptr, 0, 0, 0, 0 });
assembly_patches.push_back({ PATCH_WRTE, 0x00CD384A, 1, nullptr, 0, 0, 0, "EB" });
assembly_patches.push_back({ PATCH_CALL, 0x0061509E, 10, TrainingGrounds_Towngate, 0, 0, 0 });
assembly_patches.push_back({ PATCH_CALL, 0x006150D7, 13, TrainingGrounds_Garrison, 0, 0, 0 });
}
__declspec(naked) void TrainingGrounds_Towngate() {
__asm
{
push esi
mov esi, dword ptr [esp + 0x20]
cmp esi, 0xD
jne LABEL_TG1
mov bl, 0x1
pop esi
ret
LABEL_TG1:
test eax, eax
je LABEL_TG2
mov bl, 0x1
pop esi
ret
LABEL_TG2:
xor bl,bl
pop esi
ret
}
}
__declspec(naked) void TrainingGrounds_Garrison() {
__asm
{
push esi
mov esi, dword ptr [esp + 0x20]
cmp esi, 0xD
jne LABEL_TG1
mov eax, 0x1
pop esi
ret
LABEL_TG1:
test eax, eax
je LABEL_TG2
mov eax, 0x1
pop esi
ret
LABEL_TG2:
xor eax, eax
pop esi
ret
}
}