comparison Engine/Party.h @ 2499:68cdef6879a0

engine folder
author Ritor1
date Fri, 19 Sep 2014 02:57:42 +0600
parents
children 3121fb54a110
comparison
equal deleted inserted replaced
2498:92eeeb5200f2 2499:68cdef6879a0
1 #pragma once
2 #include "Engine/Objects/Player.h"
3 #include "Engine/Objects/NPC.h"
4 #include <array>
5
6
7
8 #define PARTY_AUTONOTES_BIT__EMERALD_FIRE_FOUNTAIN 2
9
10 enum PARTY_QUEST_BITS: uint16_t
11 {
12 PARTY_QUEST_EMERALD_RED_POTION_ACTIVE = 1,
13 PARTY_QUEST_EMERALD_SEASHELL_ACTIVE = 2,
14 PARTY_QUEST_EMERALD_LONGBOW_ACTIVE = 3,
15 PARTY_QUEST_EMERALD_PLATE_ACTIVE = 4,
16 PARTY_QUEST_EMERALD_LUTE_ACTIVE = 5,
17 PARTY_QUEST_EMERALD_HAT_ACTIVE = 6,
18
19 PARTY_QUEST_EMERALD_MARGARETH_OFF = 17,
20
21 PARTY_QUEST_EVENMORN_MAP_FOUND = 64,
22 PARTY_QUEST_FINISHED_EMERALD_ISLE = 136,
23
24 PARTY_QUEST_OBELISK_HARMONDALE = 164,
25 PARTY_QUEST_OBELISK_ERATHIA = 165,
26 PARTY_QUEST_OBELISK_TULAREAN_FOREST = 166,
27 PARTY_QUEST_OBELISK_DEYJA = 167,
28 PARTY_QUEST_OBELISK_BRACADA_DESERT = 168,
29 PARTY_QUEST_OBELISK_CELESTE = 169,
30 PARTY_QUEST_OBELISK_THE_PIT = 170,
31 PARTY_QUEST_OBELISK_EVENMORN_ISLAND = 171,
32 PARTY_QUEST_OBELISK_MOUNT_NIGHON = 172,
33 PARTY_QUEST_OBELISK_BARROW_DOWNS = 173,
34 PARTY_QUEST_OBELISK_LAND_OF_THE_GIANTS = 174,
35 PARTY_QUEST_OBELISK_TATALIA = 175,
36 PARTY_QUEST_OBELISK_AVLEE = 176,
37 PARTY_QUEST_OBELISK_STONE_CITY = 177,
38
39 PARTY_QUEST_OBELISK_TREASURE_FOUND = 178,
40
41 PARTY_QUEST_FOUNTAIN_HARMONDALE = 206,
42 PARTY_QUEST_FOUNTAIN_NIGHON = 207,
43 PARTY_QUEST_FOUNTAIN_PIERPONT = 208,
44 PARTY_QUEST_FOUNTAIN_CELESTIA = 209,
45 PARTY_QUEST_FOUNTAIN_THE_PIT = 210,
46 PARTY_QUEST_FOUNTAIN_EVENMORN_ISLE = 211
47 };
48
49 /* 355 */
50 enum PARTY_FLAGS_1: __int32
51 {
52 PARTY_FLAGS_1_0002 = 0x0002,
53 PARTY_FLAGS_1_WATER_DAMAGE = 0x0004,
54 PARTY_FLAGS_1_FALLING = 0x0008,
55 PARTY_FLAGS_1_ALERT_RED = 0x0010,
56 PARTY_FLAGS_1_ALERT_YELLOW = 0x0020,
57 PARTY_FLAGS_1_STANDING_ON_WATER = 0x0080,
58 PARTY_FLAGS_1_LANDING = 0x0100,
59 PARTY_FLAGS_1_BURNING = 0x200
60 };
61 enum PARTY_FLAGS_2: __int32
62 {
63 PARTY_FLAGS_2_RUNNING = 0x2,
64 };
65
66 /* 347 */
67 enum PARTY_BUFF_INDEX
68 {
69 PARTY_BUFF_RESIST_AIR = 0,
70 PARTY_BUFF_RESIST_BODY = 1,
71 PARTY_BUFF_DAY_OF_GODS = 2,
72 PARTY_BUFF_DETECT_LIFE = 3,
73 PARTY_BUFF_RESIST_EARTH = 4,
74 PARTY_BUFF_FEATHER_FALL = 5,
75 PARTY_BUFF_RESIST_FIRE = 6,
76 PARTY_BUFF_FLY = 7,
77 PARTY_BUFF_HASTE = 8,
78 PARTY_BUFF_HEROISM = 9,
79 PARTY_BUFF_IMMOLATION = 10,
80 PARTY_BUFF_INVISIBILITY = 11,
81 PARTY_BUFF_RESIST_MIND = 12,
82 PARTY_BUFF_PROTECTION_FROM_MAGIC = 13,
83 PARTY_BUFF_SHIELD = 14,
84 PARTY_BUFF_STONE_SKIN = 15,
85 PARTY_BUFF_TORCHLIGHT = 16,
86 PARTY_BUFF_RESIST_WATER = 17,
87 PARTY_BUFF_WATER_WALK = 18,
88 PARTY_BUFF_WIZARD_EYE = 19,
89 };
90
91
92
93 /* 300 */
94 enum PartyAction: unsigned __int32
95 {
96 PARTY_INVALID = 0,
97 PARTY_TurnLeft = 0x1,
98 PARTY_TurnRight = 0x2,
99 PARTY_StrafeLeft = 0x3,
100 PARTY_StrafeRight = 0x4,
101 PARTY_WalkForward = 0x5,
102 PARTY_WalkBackward = 0x6,
103 PARTY_LookUp = 0x7,
104 PARTY_LookDown = 0x8,
105 PARTY_CenterView = 0x9,
106 PARTY_unkA = 0xA,
107 PARTY_unkB = 0xB,
108 PARTY_Jump = 0xC,
109 PARTY_FlyUp = 0xD,
110 PARTY_FlyDown = 0xE,
111 PARTY_Land = 0xF,
112 PARTY_RunForward = 0x10,
113 PARTY_RunBackward = 0x11,
114 PARTY_FastTurnLeft = 0x12,
115 PARTY_FastTurnRight = 0x13,
116
117 PARTY_dword = 0xFFFFFFFF
118 };
119
120
121
122 /* 135 */
123 #pragma pack(push, 1)
124 struct ActionQueue
125 {
126 inline ActionQueue():
127 uNumActions(0)
128 {}
129
130 void Add(PartyAction action);
131 void Reset();
132 PartyAction Next();
133
134 unsigned int uNumActions;
135 PartyAction pActions[30];
136 };
137 #pragma pack(pop)
138
139
140
141
142
143 enum PartyAlignment: unsigned __int32
144 {
145 PartyAlignment_Good = 0,
146 PartyAlignment_Neutral = 1,
147 PartyAlignment_Evil = 2
148 };
149
150
151
152
153
154 /* 208 */
155 #pragma pack(push, 1)
156 struct PartyTimeStruct
157 {
158 std::array<__int64, 10> bountyHunting_next_generation_time;
159 std::array<__int64, 85> Shops_next_generation_time;//field_50
160 std::array<__int64, 53> _shop_ban_times;
161 std::array<unsigned __int64, 10> CounterEventValues; // (0xACD314h in Silvo's binary)
162 std::array<__int64, 29> HistoryEventTimes; // (0xACD364h in Silvo's binary)
163 std::array<unsigned __int64, 20> _s_times; //5d8 440h+8*51 //(0xACD44Ch in Silvo's binary)
164 };
165 #pragma pack(pop)
166
167 /* 207 */
168 #pragma pack(push, 1)
169 struct Party
170 {
171 Party():
172 uTimePlayed(0)
173 {
174 Zero();
175 }
176
177 void Zero();
178 void UpdatePlayersAndHirelingsEmotions();
179 void RestAndHeal();
180 unsigned int GetPartyFame();
181 void CreateDefaultParty(char bGiveItems);
182 int Reset();
183 void ResetPosMiscAndSpellBuffs();
184 bool HasItem(unsigned int uItemID);
185 void SetHoldingItem(ItemGen *pItem);
186 int GetNextActiveCharacter();
187 bool _497FC5_check_party_perception_against_level();
188 bool AddItemToParty(ItemGen *pItem);
189 void Yell();
190 void CountHirelings();
191
192 void GivePartyExp(unsigned int pEXPNum);
193 int GetPartyReputation();
194
195
196 void PartyFindsGold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal);
197 void sub_421B2C_PlaceInInventory_or_DropPickedItem();
198
199 static void SetGold(unsigned int uNumGold);
200 static void TakeGold(unsigned int uNumGold);
201 static void SetFood(unsigned int uNumFood);
202 static void TakeFood(unsigned int uNumFood);
203 static void GiveFood(unsigned int _this);
204
205 static void Sleep6Hours();
206
207 inline bool WizardEyeActive() {return pPartyBuffs[PARTY_BUFF_WIZARD_EYE].uExpireTime > 0;}
208 inline int WizardEyeSkillLevel() {return pPartyBuffs[PARTY_BUFF_WIZARD_EYE].uSkill;}
209 inline bool TorchlightActive() {return pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0;}
210 inline bool FlyActive() {return pPartyBuffs[PARTY_BUFF_FLY].uExpireTime > 0;}
211 inline bool WaterWalkActive() {return pPartyBuffs[PARTY_BUFF_WATER_WALK].uExpireTime > 0;}
212 inline bool ImmolationActive() {return pPartyBuffs[PARTY_BUFF_IMMOLATION].uExpireTime > 0;}
213 inline int ImmolationSkillLevel() {return pPartyBuffs[PARTY_BUFF_IMMOLATION].uSkill;}
214 inline bool FeatherFallActive() {return pPartyBuffs[PARTY_BUFF_FEATHER_FALL].uExpireTime > 0;}
215 inline bool Invisible() {return pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0;}
216
217 inline bool GetRedAlert() {return (uFlags & PARTY_FLAGS_1_ALERT_RED) != 0;}
218 inline void SetRedAlert() {uFlags |= PARTY_FLAGS_1_ALERT_RED;}
219 inline bool GetYellowAlert() {return (uFlags & PARTY_FLAGS_1_ALERT_YELLOW) != 0;}
220 inline void SetYellowAlert() {uFlags |= PARTY_FLAGS_1_ALERT_YELLOW;}
221
222 bool IsPartyEvil();
223 bool IsPartyGood();
224 int _46A89E_immolation_effect(int* affected, int affectedArrSize, int effectRange);
225 int field_0;
226 unsigned int uPartyHeight;
227 unsigned int uDefaultPartyHeight;
228 int sEyelevel;
229 unsigned int uDefaultEyelevel;
230 int field_14_radius;
231 int y_rotation_granularity;
232 unsigned int uWalkSpeed;
233 int y_rotation_speed; // deg/s
234 int field_24;
235 int field_28;
236 unsigned __int64 uTimePlayed;
237 __int64 uLastRegenerationTime;
238 PartyTimeStruct PartyTimes;
239 Vec3_int_ vPosition;
240 int sRotationY;
241 int sRotationX;
242 Vec3_int_ vPrevPosition;
243 int sPrevRotationY;
244 int sPrevRotationX;
245 int sPrevEyelevel;
246 int field_6E0;
247 int field_6E4;
248 int uFallSpeed;
249 int field_6EC;
250 int field_6F0;
251 int floor_face_pid; // face we are standing at
252 int walk_sound_timer;
253 int field_6FC;
254 int uFallStartY;
255 unsigned int bFlying;
256 char field_708;
257 unsigned __int8 hirelingScrollPosition;
258 char field_70A;
259 char field_70B;
260 unsigned int uCurrentYear;
261 unsigned int uCurrentMonth;
262 unsigned int uCurrentMonthWeek;
263 unsigned int uDaysPlayed;
264 unsigned int uCurrentHour;
265 unsigned int uCurrentMinute;
266 unsigned int uCurrentTimeSecond;
267 unsigned int uNumFoodRations;
268 int field_72C;
269 int field_730;
270 unsigned int uNumGold;
271 unsigned int uNumGoldInBank;
272 unsigned int uNumDeaths;
273 int field_740;
274 int uNumPrisonTerms;
275 unsigned int uNumBountiesCollected;
276 int field_74C;
277 std::array<__int16, 5> monster_id_for_hunting;
278 std::array<__int16, 5> monster_for_hunting_killed;
279 unsigned char days_played_without_rest;
280 unsigned __int8 _quest_bits[64];
281 std::array<unsigned __int8, 16> pArcomageWins;
282 char field_7B5_in_arena_quest;
283 char uNumArenaPageWins;
284 char uNumArenaSquireWins;
285 char uNumArenaKnightWins;
286 char uNumArenaLordWins;
287 std::array<char, 29> pIsArtifactFound; //7ba
288 std::array<char, 39> field_7d7;
289 unsigned char _autonote_bits[26];
290 std::array<char, 60> field_818;
291 std::array<char, 32> field_854;
292 int uNumArcomageWins;
293 int uNumArcomageLoses;
294 unsigned int bTurnBasedModeOn;
295 int field_880;
296 int uFlags2;
297 PartyAlignment alignment;
298 std::array<SpellBuff, 20> pPartyBuffs;
299 std::array<Player, 4> pPlayers;
300 std::array<NPCData, 2> pHirelings;
301 ItemGen pPickedItem;
302 unsigned int uFlags;
303 std::array<std::array<ItemGen, 12>, 53> StandartItemsInShops;
304 std::array<std::array<ItemGen, 12>, 53> SpecialItemsInShops; //D0EC
305 std::array<std::array<ItemGen, 12>, 32> SpellBooksInGuilds;
306 std::array<char, 24> field_1605C;
307 char pHireling1Name[100];
308 char pHireling2Name[100];
309 int armageddon_timer;
310 int armageddonDamage;
311 std::array<int, 4> pTurnBasedPlayerRecoveryTimes;
312 std::array<int, 53> InTheShopFlags;
313 int uFine;
314 float flt_TorchlightColorR;
315 float flt_TorchlightColorG;
316 float flt_TorchlightColorB;
317 };
318 #pragma pack(pop)
319
320
321
322 extern Party *pParty; // idb
323
324
325 extern struct ActionQueue *pPartyActionQueue;
326
327 bool TestPartyQuestBit(PARTY_QUEST_BITS bit);
328 void __fastcall Rest(unsigned int uHoursToSleep);
329 void RestAndHeal(__int64 uNumMinutes); // idb
330 int GetTravelTime();
331
332 bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2);
333 void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb