aboutsummaryrefslogtreecommitdiff
path: root/Classes.h
blob: 3f05b31da4abaf28aa4491f39fdfa859dc4bd6bf (plain)
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
#pragma once
// Generated using ReClass 2016
#include <cstdint>
#include "Engine.h"

struct Vector4
{
	float x;
	float y;
	float z;
	float w;

	Vector4(float x, float y, float z, float w)
	{
		this->x = x;
		this->y = y;
		this->z = z;
		this->w = w;
	}
};

struct Vector3
{
	float x;
	float y;
	float z;

	Vector3()
	{
		x = 0;
		y = 0;
		z = 0;
	}

	Vector3(float x, float y, float z)
	{
		this->x = x;
		this->y = y;
		this->z = z;
	}
};

struct Vector2
{
	float x;
	float y;

	Vector2()
	{
		x = 0;
		y = 0;
	}

	Vector2(float x, float y)
	{
		this->x = x;
		this->y = y;
	}
};


// Generated using ReClass 2016

class World;
class pWorld;
class Map;
class PlayerArray;
class MainScreen;
class GameScreen;
class MainView;
class ObjectManager;
class Player;


enum class EnumUnitDataClass : int16_t //From Age of Empires 2013
{
	InvalidClass = -1,
	Archer = 0,
	Artifact = 1,
	TradeBoat = 2,
	Building = 3,
	Civilian = 4,
	OceanFish = 5,
	Infantry = 6,
	BerryBush = 7,
	StoneMine = 8,
	PreyAnimal = 9,
	PredatorAnimal = 10,
	Miscellaneous = 11,
	Cavalry = 12,
	SiegeWeapon = 13,
	Terrain = 14,
	Tree = 15,
	TreeStump = 16,
	Healer = 17,
	Monk = 18,
	TradeCart = 19,
	TransportBoat = 20,
	FishingBoat = 21,
	Warship = 22,
	Conquistador = 23,
	WarElephant = 24,
	Hero = 25,
	ElephantArcher = 26,
	Wall = 27,
	Phalanx = 28,
	DomesticAnimal = 29,
	Flag = 30,
	DeepSeaFish = 31,
	GoldMine = 32,
	ShoreFish = 33,
	Cliff = 34,
	Petard = 35,
	CavalryArcher = 36,
	Doppelganger = 37,
	Bird = 38,
	Gate = 39,
	SalvagePile = 40,
	ResourcePile = 41,
	Relic = 42,
	MonkWithRelic = 43,
	HandCannoneer = 44,
	TwoHandedSwordsman = 45,
	Pikeman = 46,
	Scout = 47,
	OreMine = 48,
	Farm = 49,
	Spearman = 50,
	PackedUnit = 51,
	Tower = 52,
	BoardingBoat = 53,
	UnpackedSiegeUnit = 54,
	Ballista = 55,
	Raider = 56,
	CavalryRaider = 57,
	Livestock = 58,
	King = 59,
	MiscBuilding = 60,
	ControlledAnimal = 61
};

class PathfindingSystem
{
public:
	World* GetWorld()
	{
		return *reinterpret_cast<World**>((uint64_t)this + 0x18);
	}
};

class Resources
{
public:
	float food; //0x0000 
	float wood; //0x0004 
	float stone; //0x0008 
	float gold; //0x000C 
	float popSpaceLeft; //0x0010 
	char pad_0x0014[0x4]; //0x0014
	float age; //0x0018 
	char pad_0x001C[0x10]; //0x001C
	float currentPop; //0x002C 
	char pad_0x0030[0x64]; //0x0030
	float villagerCount; //0x0094 

}; //Size=0x0098

class Player
{
public:
	char pad_0x0000[0x28]; //0x0000
	ObjectManager* pObjectManager; //0x0028 
	char pad_0x0030[0x40]; //0x0030
	Resources* pResources; //0x0070 
	char pad_0x0078[0xE0]; //0x0078
	int* pColor; //0x0158 
	char pad_0x0160[0x18]; //0x0160
	float xScreenPos; //0x0178 
	float yScreenPos; //0x017C 
	char pad_0x0180[0x9210]; //0x0170
	char* name; //0x9390
	
	void SetCameraPosition(Vector2 pos)
	{
		xScreenPos = pos.x;
		yScreenPos = pos.y;
	}

	void SetCameraPosition(Vector3 pos)
	{
		xScreenPos = pos.x;
		yScreenPos = pos.y;
	}

	bool IsAllied(Player* other)
	{
		int32_t playerNumber = Engine::Get()->GetPlayerNumber(other);
		int32_t* diplomacy = (int32_t*)((int64_t)this + 0xd0);
		return *(diplomacy + playerNumber) == 2;
	}

	bool IsEnemy(Player* other)
	{
		int32_t playerNumber = Engine::Get()->GetPlayerNumber(other);
		int32_t* diplomacy = (int32_t*)((int64_t)this + 0xd0);
		return *(diplomacy + playerNumber) == 4;
	}

	bool IsNeutral(Player* other)
	{
		int32_t playerNumber = Engine::Get()->GetPlayerNumber(other);
		int32_t* diplomacy = (int32_t*)((int64_t)this + 0xd0);

		//TODO is 0 correct?
		return *(diplomacy + playerNumber) == 1;
	}

}; //Size=0x93A0

class World
{
public:
	char pad_0x0000[0x80]; //0x0000
	__int32 gameTime; //0x0080 
	char pad_0x0084[0x1C]; //0x0084
	Map* pMap; //0x00A0 
	char pad_0x00A8[0xB0]; //0x00A8
	float camX; //0x0158 
	float camY; //0x015C 
	char pad_0x0160[0x148]; //0x0168
	PlayerArray* pPlayerArray; //0x02A8 

}; //Size=0x02A8

class pWorld
{
public:
	World* pWorld; //0x0000 

}; //Size=0x0008

class Map
{
public:
	int32_t GetTileSize()
	{
		return *reinterpret_cast<int32_t*>((int64_t)this + 0x5B38);
	}

}; //Size=0x5CC8

class CommHandler
{
public:
	char pad_0x0000[0xC08]; //0x0000
	unsigned char isGamePaused; //0x0C08 
};

class Game
{
public:
	char pad_0x0000[0x298]; //0x0000
	CommHandler* pCommHandler; //0x0298 
	char pad_0x02A0[0x1A8]; //0x02A0
}; //Size=0x0448

class MainScreen
{
public:
	GameScreen* pGameScreen; //0x0000 
	char pad_0x0008[0x38]; //0x0008

}; //Size=0x0040

class GameScreen
{
public:
	char pad_0x0000[0x48]; //0x0000
	__int32 mouseX; //0x0048 
	__int32 mosueY; //0x004C 
	char pad_0x0050[0x5C]; //0x0050
	__int32 ScreenResX; //0x00AC 
	__int32 ScreenResX2; //0x00B0 
	__int32 ScreenResY; //0x00B4 
	__int32 ScreenResY2; //0x00B8 
	char pad_0x00BC[0xD4]; //0x00BC
	MainView* pMainView; //0x0190 
	char pad_0x0198[0x30]; //0x0198

}; //Size=0x01C8

class MainView
{
public:
	char pad_0x0000[0x2C0]; //0x0000
	float ScreenPosX; //0x02C0 
	float ScreenPosY; //0x02C4 
	float ScreenPosZ; //0x02C8 

}; //Size=0x02CC



class UnitData
{
public:
	char* GetName()
	{
		return *reinterpret_cast<char**>(*(uint64_t*)this + 0x848);
	}

	Vector3 GetCollision()
	{
		return *(Vector3*)(*(uint64_t*)this + 0x718);
	}

};


class Unit
{
private:
	float GetPosX()
	{
		int32_t position = *reinterpret_cast<int64_t*>((uint64_t)this + 0x1a0) ^ 0x187F64ADC21CDE88 ^ 0x4F019E376DDAD1E5;
		return *(float*)(&position);
	}

	float GetPosY()
	{
		int32_t position = *reinterpret_cast<int64_t*>((uint64_t)this + 0x308) ^ 0x51E534524D81CFA6;
		return *(float*)(&position);
	}

	float GetPosZ()
	{
		int32_t position = (*reinterpret_cast<int64_t*>((uint64_t)this + 0x3f8) - 0x17258AE0D9C58D92  ) ^ 0x78E0AFEAF822FC61;
		return *(float*)(&position);
	}

public:
	
	UnitData* GetUnitData()
	{
		return reinterpret_cast<UnitData*>((uint64_t)this + 0x10);
	}

	Player* GetOwner()
	{
		return *reinterpret_cast<Player**>((uint64_t)this + 0x18);
	}

	Vector3 GetPosition()
	{
		return Vector3(GetPosX(), GetPosY(), GetPosZ());
	}

	float GetHealth()
	{
		int32_t position = (*reinterpret_cast<int64_t*>((uint64_t)this + 0x100) + 0x16F41E044E9AB282 - 0x3E3A7DDCA209C1DB);
		return *(float*)(&position);
	}

	Vector3* GetTargetPosition()
	{
		uint64_t actionList = *reinterpret_cast<uint64_t*>((uint64_t)this + 0x648);
		if (!actionList) { return NULL; }
		uint64_t targetDataWrapper = *reinterpret_cast<uint64_t*>(actionList + 0x10);
		if (!targetDataWrapper) { return NULL; }
		uint64_t actionMoveTo = *reinterpret_cast<uint64_t*>(targetDataWrapper);
		if (!actionMoveTo) { return NULL; }
		return reinterpret_cast<Vector3*>(actionMoveTo + 0x38);
	}

};

class ObjectManager
{
public:
	char pad_0x0000[0x8]; //0x0000
	Unit** units; //0x0008 
	__int32 Count; //0x0010 

}; //Size=0x0018


class PlayerData
{
public:
	Player* player; //0x0000
	void* unk; //0x0008
};

class PlayerArray
{
public:
	PlayerData playerData[8]; //0x0008
}; //Size: 0x0074

class PlayerName
{
public:
	char pad_0000[68]; //0x0000
}; //Size: 0x0044