-
Notifications
You must be signed in to change notification settings - Fork 13
/
SkipNpcMessage.cpp
75 lines (61 loc) · 1.14 KB
/
SkipNpcMessage.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include "stdafx.h"
#ifdef MODULE_SKIPNPCMESSAGE
static BOOL fSkipMessageReq = 0 ;
static DWORD mSkipMessageTimer = 0 ;
void __declspec(naked) NPCMessageLoopPatch_ASM()
{
__asm {
test eax , eax
jne noje
mov eax ,[mSkipQuestMessage]
cmp eax , 0 //未开启功能,不处理
je oldje
cmp [fSkipMessageReq] , 0 //非任务信息,不处理
je oldje
add [mSkipMessageTimer],1
cmp [mSkipMessageTimer],eax //小于计时,不处理
jle oldje
mov [mSkipMessageTimer],0
mov eax ,1
ret
oldje:
xor eax ,eax
add dword ptr [esp], 0xB9 // 0F84B8000000
noje:
ret
}
}
//任务信息开始
void __declspec(naked) NPCQuestMessageStartPatch_ASM()
{
__asm {
mov [fSkipMessageReq],1
mov [mSkipMessageTimer],0
//oldcode:
mov ecx, dword ptr [esi+0x0C]
movzx edx, di
ret
}
}
//NPC菜单出现,表示信息结束了
void __declspec(naked) NPCQuestMessageEndPatch1_ASM()
{
__asm {
mov [fSkipMessageReq],0
//oldcode:
mov eax, dword ptr [esp+0x24]
mov ecx, dword ptr [esp+0x20]
ret
}
}
//NPC交互结束,表示信息结束了
void __declspec(naked) NPCQuestMessageEndPatch2_ASM()
{
__asm {
mov [fSkipMessageReq],0
//oldcode:
mov edx, 1
ret
}
}
#endif