forked from dredknight/H5_DLL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModSpellProof.cpp
61 lines (54 loc) · 1.57 KB
/
ModSpellProof.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
60
61
#include "pch.h"
// EDIT MAGIC PROOF FROM ARTIFACTS
// (13) Breastplate of the Forgotten Hero : 10% proof
// (174) Ancient Protection Charm : 10% proof
void MagicProofFork();
int MagicProof_fork = 0x0097AFC0;
int MagicProof_return = 0x0097AFC7;
void MagicProof_init(pugi::xml_document& doc) {
assembly_patches.push_back({ PATCH_HOOK, MagicProof_fork, 7, MagicProofFork, 0, 0, 0 });
}
__declspec(naked) void MagicProofFork() {
__asm
{
mov edx, dword ptr [ebx]
mov ecx, ebx
call dword ptr [edx + 0x74]
push 0xD
mov ecx, eax
call[count_equipped_artifact]
test eax, eax
je MAGICPROOF_2
mov ecx, dword ptr ss : [esp + 0x4C]
push 0x0
push 0x0
push 0xD
xor dl, dl
call[notify_artifact_buff]
fld dword ptr ss : [esp + 0x48]
fmul dword ptr [constf_0_9]
fstp dword ptr ss : [esp + 0x48]
MAGICPROOF_2:
mov edx, dword ptr [ebx]
mov ecx, ebx
call dword ptr [edx + 0x74]
push 0xAE
mov ecx, eax
call[count_equipped_artifact]
test eax, eax
je MAGICPROOF_END
mov ecx, dword ptr ss : [esp + 0x4C]
push 0x0
push 0x0
push 0xAE
xor dl, dl
call[notify_artifact_buff]
fld dword ptr ss : [esp + 0x48]
fmul dword ptr [constf_0_9]
fstp dword ptr ss : [esp + 0x48]
MAGICPROOF_END:
mov ecx, ebp
call[get_spell_school]
jmp[MagicProof_return]
}
}