-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEvents.h
97 lines (84 loc) · 2.08 KB
/
Events.h
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#pragma once
#ifndef __EVENTS_H__
#define __EVENTS_H__
#include <windows.h>
enum event_meta_id
{
EM_FIRST,
EM_ITEMACTION,
EM_SCRIPTMSG,
EM_GAMEEVENT,
EM_COPYDATA,
EM_MOUSEMOVE,
EM_MOUSECLICK,
EM_CHATMSG,
EM_CHATMSGBLOCKER,
EM_CHATINPUT,
EM_CHATINPUTBLOCKER,
EM_WHISPERMSG,
EM_WHISPERMSGBLOCKER,
EM_KEYUP,
EM_KEYDOWN,
EM_KEYDOWNBLOCKER,
EM_MEMANA,
EM_MELIFE,
EM_PLAYERASSIGN,
EM_GAMEPACKET,
EM_GAMEPACKETSENT,
EM_REALMPACKET,
EM_LAST
};
enum event_arg_mode
{
EAM_CHAR = 0,
EAM_BYTE
};
struct EventMeta
{
const unsigned int id;
const char *name;
const bool blocked;
const bool every;
// event_arg_mode
const unsigned int mode;
};
class Script;
struct Event
{
Script *owner;
const EventMeta *meta;
unsigned int argc;
void *argv;
unsigned long size;
void *result;
Event();
~Event();
};
const EventMeta *GetEventMeta(const char *name);
bool KeyDownUpEvent(const WPARAM bByte, const BYTE bUp);
void MouseMoveEvent(const POINT pt);
void MouseClickEvent(const int button, const POINT pt, const bool bUp);
void CopyDataEvent(const DWORD dwMode, const wchar_t *lpszMsg);
void GameActionEvent(const BYTE mode, const DWORD param1, const DWORD param2, const char *name1, const wchar_t *name2);
void PlayerAssignEvent(const DWORD dwUnitId);
// void GameMsgEvent(const char *lpszMsg);
bool ChatEvent(const char *lpszNick, const wchar_t *lpszMsg);
bool ChatInputEvent(const wchar_t *lpszMsg);
bool WhisperEvent(const char *lpszNick, const wchar_t *lpszMsg);
void LifeEvent(const DWORD dwLife);
void ManaEvent(const DWORD dwMana);
void ItemActionEvent(const DWORD GID, const char *Code, const BYTE Mode, const bool Global);
// void GoldDropEvent(const DWORD GID, const BYTE Mode);
bool GamePacketEvent(const BYTE *pPacket, const DWORD dwSize);
bool GamePacketSentEvent(const BYTE *pPacket, const DWORD dwSize);
bool RealmPacketEvent(const BYTE *pPacket, const DWORD dwSize);
void ScriptBroadcastEvent(const unsigned int argc, const char *argv);
struct EachHelper
{
const EventMeta *meta;
};
struct StopEventHelper : EachHelper
{
const bool force;
};
#endif