Mercurial > mm7
annotate Party.h @ 1529:61458df2cb4f
bountyHunting fix
author | Ritor1 |
---|---|
date | Fri, 06 Sep 2013 16:42:23 +0600 |
parents | 3efe35df79c3 |
children | 9a6567c6c76c |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "Player.h" | |
3 #include "NPC.h" | |
1494 | 4 #include "mm7_data.h" |
0 | 5 |
6 | |
7 | |
1053 | 8 #define PARTY_AUTONOTES_BIT__EMERALD_FIRE_FOUNTAIN 2 |
0 | 9 |
1494 | 10 enum PARTY_QUEST_BITS: uint16 |
710 | 11 { |
1035 | 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 | |
1052 | 19 PARTY_QUEST_EMERALD_MARGARETH_OFF = 17, |
20 | |
778 | 21 PARTY_QUEST_EVENMORN_MAP_FOUND = 64, |
981 | 22 PARTY_QUEST_FINISHED_EMERALD_ISLE = 136, |
1494 | 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 | |
710 | 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 }; | |
0 | 48 |
49 /* 355 */ | |
141 | 50 enum PARTY_FLAGS_1: __int32 |
51 { | |
1424 | 52 PARTY_FLAGS_1_WATER_DAMAGE = 0x0004, |
569 | 53 PARTY_FLAGS_1_FALLING = 0x0008, |
390 | 54 PARTY_FLAGS_1_ALERT_RED = 0x0010, |
55 PARTY_FLAGS_1_ALERT_YELLOW = 0x0020, | |
569 | 56 PARTY_FLAGS_1_STANDING_ON_WATER = 0x0080, |
390 | 57 PARTY_FLAGS_1_LANDING = 0x0100, |
816 | 58 PARTY_FLAGS_1_BURNING = 0x200 |
141 | 59 }; |
60 enum PARTY_FLAGS_2: __int32 | |
0 | 61 { |
62 PARTY_FLAGS_2_RUNNING = 0x2, | |
63 }; | |
64 | |
65 /* 347 */ | |
66 enum PARTY_BUFF_INDEX | |
67 { | |
488 | 68 PARTY_BUFF_RESIST_AIR = 0, |
69 PARTY_BUFF_RESIST_BODY = 1, | |
70 PARTY_BUFF_DAY_OF_GODS = 2, | |
71 PARTY_BUFF_DETECT_LIFE = 3, | |
72 PARTY_BUFF_RESIST_EARTH = 4, | |
73 PARTY_BUFF_FEATHER_FALL = 5, | |
74 PARTY_BUFF_RESIST_FIRE = 6, | |
75 PARTY_BUFF_FLY = 7, | |
76 PARTY_BUFF_HASTE = 8, | |
77 PARTY_BUFF_HEROISM = 9, | |
78 PARTY_BUFF_IMMOLATION = 10, | |
271 | 79 PARTY_BUFF_INVISIBILITY = 11, |
488 | 80 PARTY_BUFF_RESIST_MIND = 12, |
81 PARTY_BUFF_PROTECTION_FROM_MAGIC = 13, | |
82 PARTY_BUFF_SHIELD = 14, | |
83 PARTY_BUFF_STONE_SKIN = 15, | |
84 PARTY_BUFF_TORCHLIGHT = 16, | |
85 PARTY_BUFF_RESIST_WATER = 17, | |
86 PARTY_BUFF_WATER_WALK = 18, | |
87 PARTY_BUFF_WIZARD_EYE = 19, | |
0 | 88 }; |
89 | |
90 | |
91 | |
92 /* 300 */ | |
93 enum PartyAction: unsigned __int32 | |
94 { | |
95 PARTY_INVALID = 0, | |
96 PARTY_TurnLeft = 0x1, | |
97 PARTY_TurnRight = 0x2, | |
98 PARTY_StrafeLeft = 0x3, | |
99 PARTY_StrafeRight = 0x4, | |
100 PARTY_WalkForward = 0x5, | |
101 PARTY_WalkBackward = 0x6, | |
102 PARTY_LookUp = 0x7, | |
103 PARTY_LookDown = 0x8, | |
104 PARTY_CenterView = 0x9, | |
105 PARTY_unkA = 0xA, | |
106 PARTY_unkB = 0xB, | |
107 PARTY_Jump = 0xC, | |
108 PARTY_FlyUp = 0xD, | |
109 PARTY_FlyDown = 0xE, | |
110 PARTY_Land = 0xF, | |
111 PARTY_RunForward = 0x10, | |
112 PARTY_RunBackward = 0x11, | |
113 PARTY_FastTurnLeft = 0x12, | |
114 PARTY_FastTurnRight = 0x13, | |
115 | |
116 PARTY_dword = 0xFFFFFFFF | |
117 }; | |
118 | |
119 | |
120 | |
121 /* 135 */ | |
122 #pragma pack(push, 1) | |
123 struct ActionQueue | |
124 { | |
125 void Add(PartyAction action); | |
783 | 126 void Reset(); |
0 | 127 PartyAction Next(); |
128 | |
129 unsigned int uNumActions; | |
130 PartyAction pActions[30]; | |
131 }; | |
132 #pragma pack(pop) | |
133 | |
134 | |
135 | |
136 | |
137 | |
373 | 138 enum PartyAlignment: unsigned __int32 |
139 { | |
140 PartyAlignment_Good = 0, | |
141 PartyAlignment_Neutral = 1, | |
142 PartyAlignment_Evil = 2 | |
143 }; | |
0 | 144 |
145 | |
146 | |
147 | |
148 | |
149 /* 208 */ | |
150 #pragma pack(push, 1) | |
151 struct Party_stru0 | |
152 { | |
1529 | 153 //__int64 field_0[10]; |
154 __int64 bountyHunting_next_generation_time[10]; | |
471
c43f156a95c9
ArmorShopDialog crash fixed. All shops show its items
Gloval
parents:
470
diff
changeset
|
155 // int field_50[170]; |
1529 | 156 __int64 Shops_next_generation_time[85];//field_50 |
484 | 157 __int64 _shop_ban_times[53]; |
158 int field_4A0[20]; | |
0 | 159 int field_4F0[38]; |
160 char field_588[2]; | |
484 | 161 __int64 _s_times[21]; //5d8 440h+8*51 |
527 | 162 __int64 field_632[8]; |
163 char field_672[6]; | |
484 | 164 // char pIsArtifactFound[8]; |
0 | 165 }; |
166 #pragma pack(pop) | |
167 | |
168 /* 207 */ | |
169 #pragma pack(push, 1) | |
170 struct Party | |
171 { | |
172 Party(): | |
173 uTimePlayed(0) | |
174 { | |
783 | 175 Zero(); |
0 | 176 } |
177 | |
783 | 178 void Zero(); |
130 | 179 void UpdatePlayersAndHirelingsEmotions(); |
0 | 180 void RestAndHeal(); |
181 unsigned int GetPartyFame(); | |
182 void CreateDefaultParty(char bGiveItems); | |
183 int Reset(); | |
184 void ResetPosMiscAndSpellBuffs(); | |
185 bool HasItem(unsigned int uItemID); | |
186 void SetHoldingItem(ItemGen *pItem); | |
187 int GetNextActiveCharacter(); | |
188 bool _497FC5_check_party_perception_against_level(); | |
189 bool AddItem(ItemGen *pItem); | |
190 void Yell(); | |
1035 | 191 void CountHirelings(); |
0 | 192 |
193 static void SetGold(unsigned int uNumGold); | |
194 static void TakeGold(unsigned int uNumGold); | |
593 | 195 static void SetFood(unsigned int uNumFood); |
0 | 196 static void TakeFood(unsigned int uNumFood); |
592 | 197 static void GiveFood(unsigned int _this); |
0 | 198 |
199 inline bool WizardEyeActive() {return pPartyBuffs[PARTY_BUFF_WIZARD_EYE].uExpireTime > 0;} | |
200 inline int WizardEyeSkillLevel() {return pPartyBuffs[PARTY_BUFF_WIZARD_EYE].uSkill;} | |
201 inline bool TorchlightActive() {return pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uExpireTime > 0;} | |
202 inline bool FlyActive() {return pPartyBuffs[PARTY_BUFF_FLY].uExpireTime > 0;} | |
203 inline bool WaterWalkActive() {return pPartyBuffs[PARTY_BUFF_WATER_WALK].uExpireTime > 0;} | |
204 inline bool ImmolationActive() {return pPartyBuffs[PARTY_BUFF_IMMOLATION].uExpireTime > 0;} | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
205 inline int ImmolationSkillLevel() {return pPartyBuffs[PARTY_BUFF_IMMOLATION].uSkill;} |
0 | 206 inline bool FeatherFallActive() {return pPartyBuffs[PARTY_BUFF_FEATHER_FALL].uExpireTime > 0;} |
141 | 207 inline bool Invisible() {return pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0;} |
0 | 208 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
209 inline bool GetRedAlert() {return (uFlags & PARTY_FLAGS_1_ALERT_RED) != 0;} |
390 | 210 inline void SetRedAlert() {uFlags |= PARTY_FLAGS_1_ALERT_RED;} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1053
diff
changeset
|
211 inline bool GetYellowAlert() {return (uFlags & PARTY_FLAGS_1_ALERT_YELLOW) != 0;} |
390 | 212 inline void SetYellowAlert() {uFlags |= PARTY_FLAGS_1_ALERT_YELLOW;} |
213 | |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1310
diff
changeset
|
214 bool IsPartyEvil(); |
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1310
diff
changeset
|
215 bool IsPartyGood(); |
0 | 216 |
217 int field_0; | |
218 unsigned int uPartyHeight; | |
219 unsigned int uDefaultPartyHeight; | |
220 int sEyelevel; | |
221 unsigned int uDefaultEyelevel; | |
222 int field_14; | |
120 | 223 int y_rotation_granularity; |
0 | 224 unsigned int uWalkSpeed; |
122 | 225 int y_rotation_speed; // deg/s |
0 | 226 int field_24; |
227 int field_28; | |
228 unsigned __int64 uTimePlayed; | |
229 __int64 uLastRegenerationTime; | |
230 Party_stru0 field_3C; | |
231 Vec3_int_ vPosition; | |
232 int sRotationY; | |
233 int sRotationX; | |
234 Vec3_int_ vPrevPosition; | |
235 int sPrevRotationY; | |
236 int sPrevRotationX; | |
237 int sPrevEyelevel; | |
238 int field_6E0; | |
239 int field_6E4; | |
240 int uFallSpeed; | |
241 int field_6EC; | |
242 int field_6F0; | |
831 | 243 int floor_face_pid; // face we are standing at |
244 int walk_sound_timer; | |
0 | 245 int field_6FC; |
246 int uFallStartY; | |
247 unsigned int bFlying; | |
248 char field_708; | |
249 char field_709; | |
250 char field_70A; | |
251 char field_70B; | |
252 unsigned int uCurrentYear; | |
253 unsigned int uCurrentMonth; | |
254 unsigned int uCurrentMonthWeek; | |
255 unsigned int uDaysPlayed; | |
256 unsigned int uCurrentHour; | |
257 unsigned int uCurrentMinute; | |
258 unsigned int uCurrentTimeSecond; | |
259 unsigned int uNumFoodRations; | |
260 int field_72C; | |
261 int field_730; | |
262 unsigned int uNumGold; | |
263 unsigned int uNumGoldInBank; | |
264 unsigned int uNumDeaths; | |
265 int field_740; | |
266 int uNumPrisonTerms; | |
267 unsigned int uNumBountiesCollected; | |
268 int field_74C; | |
1529 | 269 __int16 monster_id_for_hunting[5]; |
270 __int16 monster_for_hunting_killed[5]; | |
766 | 271 unsigned char days_played_without_rest; |
484 | 272 unsigned __int8 _quest_bits[64]; |
0 | 273 unsigned __int8 pArcomageWins[16]; |
274 char field_7B5_in_arena_quest; | |
275 char uNumArenaPageWins; | |
276 char uNumArenaSquireWins; | |
277 char uNumArenaKnightWins; | |
278 char uNumArenaLordWins; | |
492 | 279 char pIsArtifactFound[29]; //7ba |
280 char field_7d7[39]; | |
1310 | 281 unsigned char _autonote_bits[26]; |
282 char field_818[60]; | |
0 | 283 char field_854[32]; |
949 | 284 int uNumArcomageWins; |
285 int uNumArcomageLoses; | |
0 | 286 unsigned int bTurnBasedModeOn; |
287 int field_880; | |
288 int uFlags2; | |
373 | 289 PartyAlignment alignment; |
0 | 290 SpellBuff pPartyBuffs[20]; |
291 Player pPlayers[4]; | |
292 NPCData pHirelings[2]; | |
293 ItemGen pPickedItem; | |
294 unsigned int uFlags; | |
463 | 295 ItemGen StandartItemsInShops[53][12]; |
470 | 296 ItemGen SpecialItemsInShops[53][12]; //D0EC |
496 | 297 ItemGen SpellBooksInGuilds[32][12]; |
527 | 298 char field_1605C[24]; |
0 | 299 char pHireling1Name[100]; |
300 char pHireling2Name[100]; | |
349 | 301 int armageddon_timer; |
0 | 302 int field_16140; |
303 int pTurnBasedPlayerRecoveryTimes[4]; | |
463 | 304 int InTheShopFlags[53]; |
0 | 305 int uFine; |
306 float flt_TorchlightColorR; | |
307 float flt_TorchlightColorG; | |
308 float flt_TorchlightColorB; | |
309 }; | |
310 #pragma pack(pop) | |
311 | |
312 | |
313 | |
314 extern Party *pParty; // idb | |
315 | |
316 | |
66 | 317 extern struct ActionQueue *pPartyActionQueue; |
318 | |
1494 | 319 inline bool TestPartyQuestBit(PARTY_QUEST_BITS bit) |
320 { | |
321 return _449B57_test_bit(pParty->_quest_bits, bit); | |
322 } |