forked from GamesDeadLol/GDL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClientEvents.h
125 lines (99 loc) · 3.81 KB
/
ClientEvents.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#pragma once
#include "BinaryReader.h"
class CPlayerWeenie;
const float sidestep_factor = 0.5f;
const float backwards_factor = 0.64999998f;
const float run_turn_factor = 1.5f;
const float run_anim_speed = 4.0f;
const float walk_anim_speed = 3.1199999f;
const float sidestep_anim_speed = 1.25f;
const float max_sidestep_anim_rate = 3.0f;
// Client/World interaction
class CClientEvents
{
public:
CClientEvents(CClient *);
~CClientEvents();
void Think();
void DetachPlayer();
DWORD GetPlayerID();
CPlayerWeenie* GetPlayer();
void LoginError(int iError);
void LoginCharacter(DWORD dwGUID, const char *szAccount);
void BeginLogout();
void OnLogoutCompleted();
void ExitWorld();
void ActionComplete(int error = WERROR_NONE);
void SendText(const char *szText, long lColor);
bool CheckForChatSpam();
// Network events
void ActionText(const char* szText);
void Attack(DWORD dwTarget, DWORD dwHeight, float flPower);
void MissileAttack(DWORD dwTarget, DWORD dwHeight, float flPower);
void ChangeCombatStance(COMBAT_MODE mode);
void ChannelText(DWORD dwChannel, const char* szText);
void ClientText(const char* szText);
bool DropItem(DWORD item_id);
void EmoteText(const char* szText);
void EquipItem(DWORD dwItemID, DWORD dwCoverage);
void ExitPortal();
void Identify(DWORD dwObjectID);
void LifestoneRecall();
void MarketplaceRecall();
void Ping();
void RequestHealthUpdate(DWORD dwGUID);
void SendTellByGUID(const char *text, DWORD dwGUID);
void SendTellByName(const char *text, const char *name);
void SpendAttributeXP(STypeAttribute key, DWORD exp);
void SpendAttribute2ndXP(STypeAttribute2nd key, DWORD exp);
void SpendSkillXP(STypeSkill key, DWORD exp);
void SpendSkillCredits(STypeSkill key, DWORD credits);
bool StoreItem(DWORD item_id, DWORD container_id, DWORD slot);
void TryBuyItems(DWORD vendor_id, std::list<class ItemProfile *> &items);
void TrySellItems(DWORD vendor_id, std::list<class ItemProfile *> &items);
void TryInscribeItem(DWORD object_id, const std::string &text);
void UseItemEx(DWORD dwSourceID, DWORD dwDestID);
void UseObject(DWORD dwEID);
void ProcessEvent(BinaryReader *);
// Fellowship functionality
void TryFellowshipCreate(const std::string name, int shareXP);
void TryFellowshipQuit(int disband);
void TryFellowshipDismiss(DWORD dismissed);
void TryFellowshipRecruit(DWORD target);
void TryFellowshipUpdate(int on);
void TryFellowshipAssignNewLeader(DWORD target);
void TryFellowshipChangeOpenness(int open);
void SendFellowshipUpdate();
// Allegiance functionality
void TrySwearAllegiance(DWORD target);
void TryBreakAllegiance(DWORD target);
void SetRequestAllegianceUpdate(int on);
void SendAllegianceUpdate();
void SendAllegianceMOTD();
void AllegianceInfoRequest(const std::string &target);
void TrySetAllegianceMOTD(const std::string &text);
// Player Options
void ChangePlayerOption(PlayerOptions option, bool value);
// Inventory
void TryGiveObject(DWORD target_id, DWORD object_id, DWORD amount);
void TryStackableMerge(DWORD merge_from_id, DWORD merge_to_id, DWORD amount);
void TryStackableSplitToContainer(DWORD stack_id, DWORD container_id, DWORD place, DWORD amount);
void TryStackableSplitTo3D(DWORD stack_id, DWORD amount);
void TryStackableSplitToWield(DWORD stack_id, DWORD loc, DWORD amount);
// House
void BuyHouse(DWORD slumlord, const PackableList<DWORD> &items);
void RentHouse(DWORD slumlord, const PackableList<DWORD> &items);
// Remote Container
void NoLongerViewingContents(DWORD container_id);
private:
CClient *m_pClient;
CPlayerWeenie *m_pPlayer;
WORD m_MoveActionStamp = 0xFFFF;
double m_fNextAllegianceUpdate = 0.0;
BOOL m_bSendAllegianceUpdates = FALSE;
BOOL m_bSentFirstAllegianceUpdate = FALSE;
double _next_chat_interval = 0.0;
double _next_chat_allowed = 0.0;
unsigned int _num_chat_sent = 0;
double _next_allowed_identify = 0.0;
};