-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathent.h
More file actions
325 lines (290 loc) · 6.32 KB
/
ent.h
File metadata and controls
325 lines (290 loc) · 6.32 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
#pragma once
#pragma comment(lib, "OpenGL32.lib")
#include <string>
#include <vector>
#include <stdio.h>
#include <Windows.h>
#include <memory>
#include "vec.h"
#include "memory.h"
#include <gl\GL.h>
///////////////////////////////////////////////////////////////
// struct AnglesDistances - angles and distances to players from me
struct AnglesDistances
{
float distanceXY;
float distanceAbs;
float angleTo;
float angleFrom;
float angleSetHor;
float angleSetVert;
};
///////////////////////////////////////////////////////////////
// struct WeaponInfo - adjustments for the weapon im holding
struct WeaponInfo
{
float shoulderAdj;
float distAdjust;
float projvelAdj;
};
///////////////////////////////////////////////////////////////
// struct Info2d - 2d render of 3d enemy coordinates and relevant data
struct Info2d
{
vec2_t screenCrd;
vec2_t screenFeet;
vec2_t screenHead;
vec2_t screenMyPos;
float modelWidth;
float modelHeight;
};
///////////////////////////////////////////////////////////////
// struct ColorInfo - ESP colors and other settings
struct ColorInfo
{
GLubyte colorEnemy[3];
GLubyte colorEnemyInvis[3];
GLubyte colorAlly[3];
GLubyte colorTarget[3];
GLubyte colorAllyInvis[3];
GLubyte colorFriend[3];
GLubyte colorFriendInvis[3];
GLubyte colorTargetInvis[3];
float linesEnemyThickness = 1;
float linesTargetThickness = 1;
float linesAllyThickness = 1;
float linesFriendThickness = 1;
float boxEnemyThickness = 1;
float boxAllyThickness = 1;
float boxFriendThickness = 1;
float boxTargetThickness = 1;
int fontSize = 9;
bool bold = 0;
bool italic = 0;
std::string font = "Ariel";
};
///////////////////////////////////////////////////////////////
// struct ScreenData - screen FOV and resolution
struct ScreenData
{
vec2_t fov;
int res[2];
};
enum Weapons : int
{
WP_NONE,
WP_PROJ,
WP_MELEE,
WP_LS,
WP_PISTOL,
WP_E11,
WP_DISR,
WP_BOW,
WP_CR,
WP_CPISTOL,
WP_DLT,
WP_PLX,
WP_T21 = 20,
WP_SBD,
WP_WPISTOL,
};
enum Classes : int
{
CL_NONE,
CL_SOLDIMP,
CL_SOLD,
CL_ETIMP,
CL_ET,
CL_SITH,
CL_JEDI,
CL_BH,
CL_HERO,
CL_SBD,
CL_WOOK,
CL_DEKA,
CL_CLONE,
CL_MANDA,
CL_ARC,
};
enum permanentValuesList
{
VAR_LOCK,
VAR_SMOOTHAIM,
VAR_WALLHACK,
VAR_SWITCHONKILL,
VAR_AUTOTARGETJEDI,
VAR_ANTIKNOCKBACK,
VAR_AIMTARGET,
VAR_AUTOPB,
VAR_ANTIAFK,
VAR_TARGETEXCLUSIVE,
VAR_DRAWBOXES,
VAR_DRAWBOXES_ALLIES,
VAR_DRAWBOXES_ENEMIES,
VAR_DRAWBOXES_FRIENDS,
VAR_DRAWBOXES_TARGETS,
VAR_DRAWLINES,
VAR_DRAWLINES_TOALLIES,
VAR_DRAWLINES_TOENEMIES,
VAR_DRAWLINES_FRIENDS,
VAR_DRAWLINES_TARGETS,
VAR_DRAW_ENEMY_STATS,
VAR_DRAW_ALLY_STATS,
VAR_DRAW_BIG_STATS,
VAR_TOGGLETOHITSCAN,
VAR_AUTOPUNISH,
};
///////////////////////////////////////////////////////////////
// struct PlayerNames - player name and truncated name
struct PlayerNames
{
int id;
std::string name;
std::string shortName;
bool ignored;
public:
PlayerNames():
id(0), ignored(false)
{ }
};
///////////////////////////////////////////////////////////////
// class Ent - entity (player)
class Ent
{
public:
int color1;
int color2;
int id;
int surface;
int saberAnim;
int numWeapon;
int stance;
int stance2;
int hp;
int force;
int charScale;
int team;
int myTeam;
int isRendered;
int entClass;
int weapon;
int dekaNum = -1;
int swordOn;
float distGround;
float enYaw;
float enPitch;
float realModelHeight;
bool isVisible;
bool deadOrAlive;
bool isClosestEnemy;
bool isClosest;
bool isDisrupted;
bool isTarget;
bool isFriend;
bool isAlly;
bool isEnemy;
bool correctColor1;
bool correctColor2;
bool correctColor3;
bool correctColor4;
const char* className;
std::string name;
std::string shortName;
Info2d info2d;
vec3_t pos;
vec3_t posPing;
vec3_t feetPos;
vec3_t headPos;
vec3_t predPos;
vec3_t speed;
vec3_t groundContact;
vec3_t shotEndpos;
AnglesDistances anglesDistances;
std::shared_ptr<WeaponInfo> weaponInfo;
public:
// FillEnt - assign values to fields in my entity
void FillEnt(uintptr_t mbiiBase, uintptr_t entBase);
// FillDeka - assign values to fields in droideka entities (are treated as NPCs by the game hence different
//addresses
void FillDeka(uintptr_t dekaBase);
public:
virtual ~Ent() = default;
};
///////////////////////////////////////////////////////////////
// class me - my entity
class Me : public Ent
{
public:
int myCharScale = 0;
int* myRawYawAdd = nullptr;
int* myRawPitchAdd = nullptr;
int myHp;
int myShield;
int WristBlaster;
int IsAltFire;
int IsScope;
int ping;
int ammo;
int totalAmmo;
int clipAmmo;
int lastAttackerNum;
int entInCrosshair;
int tkPoints;
int tked;
int trueId;
vec3_t whereImLooking;
vec3_t cameraPos;
vec3_t lookingToUVec;
float myRawYaw = 0;
float myRawPitch = 0;
float yaw;
float pitch;
float pitch360;
float yaw360;
float obstacleHeight;
float depth;
float depthBehind;
float obstacleDistLeft;
float obstacleDistRight;
std::string forcepowers;
std::string serverName;
std::shared_ptr<Ent> lastAttacker;
bool forward;
bool back;
bool left;
bool right;
bool enemiesAround;
bool moveDown;
bool isOnFire;
bool amIdead;
bool attack;
bool altAttack;
bool amIFollowing;
bool amAttacking;
bool amAltAttacking;
void FillMe(AddressesList& address, uintptr_t myTrueId, uintptr_t playerOffset);
};
class WorldToScreen
{
public:
vec2_t fov;
int res[2];
std::shared_ptr<Me> me;
public:
bool WTS(vec3_t point, vec2_t& result);
};
///////////////////////////////////////////////////////////////
// struct UIInfo - struct to pass some values
struct UIInfo
{
bool isTK;
bool isThroughWalls;
bool isHitscan;
bool correctColor1;
bool correctColor2;
bool correctColor3;
bool correctColor4;
std::vector<std::shared_ptr<Ent>> targets;
int posX;
int posY;
};