Mercurial > mm7
annotate Items.h @ 1244:6279bf7a4d1a
Merge
author | Grumpy7 |
---|---|
date | Sun, 09 Jun 2013 23:53:01 +0200 |
parents | 0dbf6c4dd029 |
children | 61010a655c94 |
rev | line source |
---|---|
0 | 1 #pragma once |
1202 | 2 #include <array> |
0 | 3 |
1036 | 4 enum DAMAGE_TYPE:unsigned int |
5 { | |
6 DMGT_FIRE = 0, | |
7 DMGT_ELECTR = 1, | |
8 DMGT_COLD = 2, | |
9 DMGT_3 = 3, | |
10 DMGT_PHISYCAL= 4, | |
11 DMGT_5 = 5, | |
12 DMGT_SPIRIT = 6, | |
13 DMGT_MIND = 7, | |
14 DMGT_BODY = 8, | |
15 DMGT_DARK =10 | |
16 }; | |
0 | 17 |
18 | |
19 | |
20 /* 338 */ | |
463 | 21 enum ITEM_FLAGS :unsigned int |
0 | 22 { |
23 ITEM_IDENTIFIED = 0x1, | |
24 ITEM_BROKEN = 0x2, | |
25 ITEM_TEMP_BONUS = 0x8, | |
984 | 26 ITEM_AURA_EFFECT_RED = 0x10, |
27 ITEM_AURA_EFFECT_BLUE = 0x20, | |
28 ITEM_AURA_EFFECT_GREEN = 0x40, | |
29 ITEM_AURA_EFFECT_PURPLE = 0x80, | |
0 | 30 ITEM_STOLEN = 0x100, |
31 ITEM_ENCHANTED = 0x200, | |
32 }; | |
33 | |
34 | |
377 | 35 enum ITEM_MATERIAL |
437 | 36 { |
377 | 37 MATERIAL_COMMON =0, |
38 MATERIAL_ARTEFACT = 1, | |
39 MATERIAL_RELIC = 2, | |
40 MATERIAL_SPECIAL = 3 | |
437 | 41 }; |
377 | 42 |
0 | 43 /* 330 */ |
44 enum ITEM_TYPE | |
45 { | |
46 ITEM_LONGSWORD_1 = 0x1, | |
47 ITEM_DAGGER_1 = 0xF, | |
48 ITEM_AXE_1 = 0x17, | |
49 ITEM_SPEAR_1 = 0x1F, | |
50 ITEM_CROSSBOW_1 = 0x2F, | |
51 ITEM_MACE_1 = 0x32, | |
52 ITEM_STAFF_1 = 0x3D, | |
816 | 53 ITEM_BLASTER = 64, |
54 ITEM_LASER_RIFLE = 65, | |
0 | 55 ITEM_LEATHER_1 = 0x42, |
56 ITEM_CHAINMAIL_1 = 0x47, | |
57 ITEM_PLATE_1 = 0x4C, | |
58 ITEM_BUCKLER_1 = 0x54, | |
59 ITEM_GAUNTLETS_1 = 0x6E, | |
60 ITEM_BOOTS_1 = 0x73, | |
490 | 61 ITEM_WAND_FIRE = 135, |
62 ITEM_WAND_STUN = 138, | |
0 | 63 ITEM_WAND_INCENERATION = 0x9F, |
64 ITEM_TROLL_BLOOD = 0xCA, | |
65 ITEM_DRAGON_EYE = 0xCC, | |
66 ITEM_HARPY_FEATHER = 0xCF, | |
67 ITEM_DEVIL_ICHOR = 0xD6, | |
68 ITEM_OOZE_ECTOPLASM_BOTTLE = 0xD9, | |
69 ITEM_POTION_BOTTLE = 0xDC, | |
70 ITEM_SPELLBOOK_FIRE_STRIKE = 0x191, | |
71 ITEM_SPELLBOOK_AIR_FEATHER_FALL = 0x19C, | |
72 ITEM_SPELLBOOK_WATER_POISON_SPRAY = 0x1A7, | |
73 ITEM_SPELLBOOK_EARTH_SLOW = 0x1B2, | |
74 ITEM_SPELLBOOK_SPIRIT_BLESS = 0x1BD, | |
75 ITEM_SPELLBOOK_MIND_MIND_BLAST = 0x1C8, | |
76 ITEM_SPELLBOOK_BODY_FIRST_AID = 0x1D3, | |
77 ITEM_SPELLBOOK_BODY_HEAL = 0x1D6, | |
78 ITEM_SPELLBOOK_BODY_BREAK_POISON = 0x1D7, | |
79 ITEM_SPELLBOOK_LIGHT_LIGHT_BOLT = 0x1DD, | |
80 ITEM_SPELLBOOK_LIGHT_SUN_BURST = 0x1E6, | |
81 ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION = 0x1E7, | |
82 ITEM_ARTIFACT_PUCK = 0x1F4, | |
513 | 83 ITEM_ARTICACT_GOVERNONS_ARMOR = 504,//1F8 |
84 ITEM_ARTIFACT_YORUBA = 505,//1F9 | |
305 | 85 ITEM_ARTIFACT_SPLITTER = 506,//1FA |
1080 | 86 ITEM_ARTIFACT_GHOULSBANE = 507,//1FA |
87 ITEM_ARTEFACT_ULLYSES =510, | |
513 | 88 ITEM_ARTIFACT_LEAGUE_BOOTS = 512,//200 |
89 ITEM_RELIC_HARECS_LEATHER = 516,//204 | |
1080 | 90 ITEM_RELIC_KELEBRIM = 520,//208 |
513 | 91 ITEM_RELIC_TALEDONS_HELM = 521,//209 |
92 ITEM_RELIC_SCHOLARS_CAP = 522,//20A | |
93 ITEM_RELIC_PHYNAXIAN_CROWN = 523,//20B | |
94 ITEM_RILIC_TITANS_BELT = 524,//20C | |
95 ITEM_RELIC_TWILIGHT = 525,//20D | |
0 | 96 ITEM_RELIC_MEKORIGS_HAMMER = 0x210, |
831 | 97 ITEM_ARTIFACT_HERMES_SANDALS = 529, |
513 | 98 ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP = 530,//212 |
99 ITEM_ARTIFACT_MINDS_EYE = 532,//214 | |
100 ITEM_ELVEN_CHAINMAIL = 533,//215 | |
831 | 101 ITEM_ARTIFACT_HEROS_BELT = 535,//217 |
102 ITEM_ARTIFACT_LADYS_ESCORT = 536, | |
513 | 103 ITEM_RARE_SHADOWS_MASK = 544,//220 |
104 ITEM_RARE_SUN_CLOAK = 547,//223 | |
105 ITEM_RARE_MOON_CLOAK = 548,//224 | |
106 ITEM_RARE_VAMPIRES_CAPE = 550,//226 | |
377 | 107 ITEM_LICH_JAR = 601 |
0 | 108 }; |
109 | |
110 /* 331 */ | |
816 | 111 enum ITEM_EQUIP_TYPE: unsigned __int8 |
0 | 112 { |
816 | 113 EQUIP_OFF_HAND = 0, |
114 EQUIP_MAIN_HAND = 1, | |
115 EQUIP_BOW = 2, | |
116 EQUIP_ARMOUR = 3, | |
117 EQUIP_SHIELD = 4, | |
118 EQUIP_HELMET = 5, | |
119 EQUIP_BELT = 6, | |
120 EQUIP_CLOAK = 7, | |
1082 | 121 EQUIP_GAUNTLETS = 8, |
122 EQUIP_BOOTS = 9, | |
816 | 123 EQUIP_RING = 10, |
124 EQUIP_AMULET = 11, | |
125 EQUIP_WAND = 12, | |
126 EQUIP_REAGENT = 13, | |
127 EQUIP_POTION = 14, | |
128 EQUIP_SPELL_SCROLL = 15, | |
129 EQUIP_BOOK = 16, | |
1080 | 130 EQIUP_ANY = 16, |
816 | 131 EQUIP_MESSAGE_SCROLL = 17, |
132 EQUIP_GOLD = 18, | |
133 EQUIP_GEM = 19, | |
134 EQUIP_NONE = 20 | |
0 | 135 }; |
136 | |
137 | |
138 | |
139 /* 64 */ | |
140 #pragma pack(push, 1) | |
526 | 141 struct ItemGen //0x24 |
0 | 142 { |
143 //----- (0042EB25) -------------------------------------------------------- | |
1012 | 144 // inline ItemGen() |
145 // { | |
146 // Reset(); | |
147 // } | |
0 | 148 |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1082
diff
changeset
|
149 inline bool Broken() {return (uAttributes & ITEM_BROKEN) != 0;} |
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1082
diff
changeset
|
150 inline bool Identified() {return (uAttributes & ITEM_IDENTIFIED) != 0;} |
315 | 151 inline void SetIdentified() {uAttributes |= ITEM_IDENTIFIED;} |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1082
diff
changeset
|
152 inline bool Stolen() {return (uAttributes & ITEM_STOLEN) != 0;} |
749 | 153 inline void SetStolen() {uAttributes |= ITEM_STOLEN;} |
271 | 154 |
0 | 155 bool GenerateArtifact(); |
156 unsigned int GetValue(); | |
157 const char *GetDisplayName(); | |
158 const char *GetIdentifiedName(); | |
159 void UpdateTempBonus(__int64 uTimePlayed); | |
160 void Reset(); | |
385 | 161 int _439DF3_get_additional_damage(int *a2, bool *vampiyr); |
0 | 162 |
163 | |
164 | |
1019 | 165 int uItemID; //0 |
166 int uEnchantmentType; //4 | |
167 int _bonus_strength; //8 | |
168 int uSpecEnchantmentType; // 25 +5 levels //0c | |
816 | 169 // 16 Drain Hit Points from target. |
170 // 39 Double damage vs Demons. | |
171 // 40 Double damage vs Dragons | |
172 // 45 +5 Speed and Accuracy | |
173 // 56 +5 Might and Endurance. | |
174 // 57 +5 Intellect and Personality. | |
175 // 58 Increased Value. | |
176 // 60 +3 Unarmed and Dodging skills | |
177 // 61 +3 Stealing and Disarm skills. | |
178 // 59 Increased Weapon speed. | |
179 // 63 Double Damage vs. Elves. | |
180 // 64 Double Damage vs. Undead. | |
181 // 67 Adds 5 points of Body damage and +2 Disarm skill. | |
182 // 68 Adds 6-8 points of Cold damage and +5 Armor Class. | |
831 | 183 // 71 Prevents drowning damage. |
184 // 72 Prevents falling damage. | |
1019 | 185 int uNumCharges; //10 |
186 unsigned int uAttributes; //14 | |
0 | 187 unsigned __int8 uBodyAnchor; |
188 char uMaxCharges; | |
377 | 189 char uHolderPlayer; |
0 | 190 char field_1B; |
191 unsigned __int64 uExpireTime; | |
192 }; | |
193 #pragma pack(pop) | |
194 | |
195 | |
196 | |
197 /* 175 */ | |
198 #pragma pack(push, 1) | |
559 | 199 struct ItemDesc //30h |
229 | 200 { //Item # |Pic File|Name|Value|Equip Stat|Skill Group|Mod1|Mod2|material| |
201 ///ID/Rep/St|Not identified name|Sprite Index|VarA|VarB|Equip X|Equip Y|Notes | |
202 char *pIconName; //0 4 | |
203 char *pName; //4 8 | |
204 char *pUnidentifiedName; //8 c | |
205 char *pDescription; //0c 10 | |
206 unsigned int uValue; //10 14 | |
207 unsigned __int16 uSpriteID; //14 18 | |
208 __int16 field_1A; //16 | |
365 | 209 signed __int16 uEquipX; //18 1c |
210 signed __int16 uEquipY; //1a 1e | |
816 | 211 ITEM_EQUIP_TYPE uEquipType; //1c 20 |
229 | 212 unsigned __int8 uSkillType; //1d 21 |
213 unsigned __int8 uDamageDice; //1e 22 | |
214 unsigned __int8 uDamageRoll; //1f 23 | |
215 unsigned __int8 uDamageMod; //20 24 | |
216 unsigned __int8 uMaterial; //21 25 | |
217 char _additional_value; //22 26 | |
218 char _bonus_type; //23 27 | |
219 char _bonus_strength; //24 28 | |
220 char field_25; // 25 29 | |
221 char field_26; //26 2A | |
222 char field_27; // 27 2b | |
223 union | |
315 | 224 { |
229 | 225 unsigned __int8 uChanceByTreasureLvl[6]; |
226 struct { | |
227 unsigned __int8 uChanceByTreasureLvl1; // 28 2c | |
228 unsigned __int8 uChanceByTreasureLvl2; // 29 2d | |
229 unsigned __int8 uChanceByTreasureLvl3; // 2A 2e | |
230 unsigned __int8 uChanceByTreasureLvl4; // 2B 2f | |
231 unsigned __int8 uChanceByTreasureLvl5; // 2C 30 | |
232 unsigned __int8 uChanceByTreasureLvl6; // 2D 32 | |
233 }; | |
315 | 234 }; |
235 unsigned char uItemID_Rep_St; //2e 32 | |
236 char field_2f; | |
237 }; | |
0 | 238 #pragma pack(pop) |
239 | |
240 | |
241 | |
242 /* 177 */ | |
243 #pragma pack(push, 1) | |
244 struct ItemEnchantment | |
222 | 245 { //Bonus|Sta|Of Name|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul |
246 char *pBonusStat; | |
247 char *pOfName; | |
248 /* union{ | |
249 struct { | |
250 unsigned char to_arm; | |
251 unsigned char to_shld; | |
252 unsigned char to_helm; | |
253 unsigned char to_belt; | |
254 unsigned char to_cape; | |
255 unsigned char to_gaunt; | |
256 unsigned char to_boot; | |
257 unsigned char to_ring; | |
258 unsigned char to_amul; | |
259 }; */ | |
260 unsigned char to_item[12]; | |
261 // }; | |
262 }; | |
0 | 263 #pragma pack(pop) |
264 | |
265 /* 178 */ | |
266 #pragma pack(push, 1) | |
559 | 267 struct ItemSpecialEnchantment //1Ch |
222 | 268 { //Bonus Stat|Name Add|W1|W2|Miss|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul|Value|Lvl|Description fo special Bonuses and values |
269 | |
559 | 270 char *pBonusStatement; //0 |
271 char *pNameAdd; //4 | |
272 char to_item_apply[12]; //8 | |
273 int iValue; //14 | |
274 int iTreasureLevel; //18 | |
0 | 275 }; |
276 #pragma pack(pop) | |
277 | |
222 | 278 #pragma pack(push, 1) |
279 struct BonusRange | |
280 { | |
281 unsigned int minR; | |
282 unsigned int maxR; | |
283 }; | |
284 #pragma pack(pop) | |
193
821fd955c379
fixed potion data parsing. Somehow 3d render was affected
Gloval
parents:
0
diff
changeset
|
285 |
0 | 286 /* 176 */ |
287 #pragma pack(push, 1) | |
288 struct ItemsTable | |
289 { | |
290 void Initialize(); | |
291 void LoadPotions(); | |
292 void LoadPotionNotes(); | |
385 | 293 void GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *pItem); |
0 | 294 void SetSpecialBonus(ItemGen *pItem); |
377 | 295 bool IsMaterialSpecial(ItemGen *pItem); |
296 bool IsMaterialNonCommon(ItemGen *pItem); | |
374 | 297 void Release(); |
0 | 298 |
222 | 299 int uAllItemsCount; |
300 ItemDesc pItems[800]; //4-9604h | |
301 ItemEnchantment pEnchantments[24]; //9604h | |
229 | 302 ItemSpecialEnchantment pSpecialEnchantments[72]; //97E4h -9FC4h |
224 | 303 char field_9FC4[5000]; |
0 | 304 char field_B348[5000]; |
305 char field_C6D0[5000]; | |
306 char field_DA58[5000]; | |
229 | 307 char field_EDE0[384]; |
222 | 308 unsigned __int16 potion_data[50][50]; // 77B2h*2=EF64h -102ECh |
309 unsigned __int16 potion_note[50][50]; // 8176h*2=102ECh -11674h | |
310 char *pItemsTXT_Raw; //11674h | |
0 | 311 char *pRndItemsTXT_Raw; |
222 | 312 char *pStdItemsTXT_Raw; //1167Ch |
313 char *pSpcItemsTXT_Raw; //11680h | |
224 | 314 unsigned int uChanceByTreasureLvlSumm[6]; //11684 |
315 unsigned int uBonusChanceStandart[6]; //1169c | |
316 unsigned int uBonusChanceSpecial[6]; //116B4 | |
317 unsigned int uBonusChanceWpSpecial[6]; //116cc -116e4 | |
222 | 318 unsigned int pEnchantmentsSumm[9]; //116E4h -11708h |
319 BonusRange bonus_ranges[6]; //45C2h*4 =11708h | |
224 | 320 unsigned int pSpecialEnchantmentsSumm[24]; //11738h |
321 unsigned int pSpecialEnchantments_count; //11798h | |
0 | 322 char field_1179C; |
315 | 323 char field_1179D; |
324 char field_1179E; | |
325 char field_1179F; | |
0 | 326 }; |
327 #pragma pack(pop) | |
328 | |
463 | 329 void GenerateStandartShopItems(); |
330 void GenerateSpecialShopItems(); | |
598 | 331 void GenerateItemsInChest(); |
0 | 332 |
1202 | 333 extern std::array<const char, 5> uItemsAmountPerShopType; // weak |
0 | 334 extern ItemGen *ptr_50C9A4; |
335 | |
377 | 336 extern struct ItemsTable *pItemsTable; |
337 | |
338 /* | |
339 +10 to all Resistances. 1 | |
340 +10 to all Seven Statistics. 2 | |
341 Explosive Impact! 3 | |
342 Adds 3-4 points of Cold damage. 4 | |
343 Adds 6-8 points of Cold damage. 5 | |
344 Adds 9-12 points of Cold damage. 6 | |
345 Adds 2-5 points of Electrical damage. 7 | |
346 Adds 4-10 points of Electrical damage. 8 | |
347 Adds 6-15 points of Electrical damage. 9 | |
348 Adds 1-6 points of Fire damage. 10 | |
349 Adds 2-12 points of Fire damage. 11 | |
350 Adds 3-18 points of Fire damage. 12 | |
351 Adds 5 points of Body damage. 13 | |
352 Adds 8 points of Body damage. 14 | |
353 Adds 12 points of Body damage. 15 | |
354 Drain Hit Points from target. 16 | |
355 Increases rate of Recovery. 17 | |
356 Wearer resistant to Diseases. 18 | |
357 Wearer resistant to Insanity. 19 | |
358 Wearer resistant to Paralysis. 20 | |
359 Wearer resistant to Poison. 21 | |
360 Wearer resistant to Sleep. 22 | |
361 Wearer resistant to Stone. 23 | |
362 Increased Knockback. 24 | |
363 +5 Level. 25 | |
364 Increases effect of all Air spells. 26 | |
365 Increases effect of all Body spells. 27 | |
366 Increases effect of all Dark spells. 28 | |
367 Increases effect of all Earth spells. 29 | |
368 Increases effect of all Fire spells. 30 | |
369 Increases effect of all Light spells. 31 | |
370 Increases effect of all Mind spells. 32 | |
371 Increases effect of all Spirit spells. 33 | |
372 Increases effect of all Water spells. 34 | |
373 Increases chance of Disarming. 35 | |
374 Half damage from all missile attacks. 36 | |
375 Regenerate Hit points over time. 37 | |
376 Regenerate Spell points over time. 38 | |
377 Double damage vs Demons. 39 | |
378 Double damage vs Dragons 40 | |
379 Drain Hit Points from target and Increased Weapon speed. 41 | |
380 +1 to Seven Stats, HP, SP, Armor, Resistances. 42 | |
381 +10 to Endurance, Armor, Hit points. 43 | |
382 +10 Hit points and Regenerate Hit points over time. 44 | |
383 +5 Speed and Accuracy. 45 | |
384 Adds 10-20 points of Fire damage and +25 Might. 46 | |
385 +10 Spell points and Regenerate Spell points over time. 47 | |
386 +15 Endurance and +5 Armor. 48 | |
387 +10 Intellect and Luck. 49 | |
388 +30 Fire Resistance and Regenerate Hit points over time. 50 | |
389 +10 Spell points, Speed, Intellect. 51 | |
390 +10 Endurance and Accuracy. 52 | |
391 +10 Might and Personality. 53 | |
392 +15 Endurance and Regenerate Hit points over time. 54 | |
393 +15 Luck and Regenerate Spell points over time. 55 | |
394 +5 Might and Endurance. 56 | |
395 +5 Intellect and Personality. 57 | |
396 Increased Value. 58 | |
397 Increased Weapon speed. 59 | |
398 +3 Unarmed and Dodging skills. 60 | |
399 +3 Stealing and Disarm skills. 61 | |
400 +3 ID Item and ID Monster skills. 62 | |
401 Double Damage vs. Elves. 63 | |
402 Double Damage vs. Undead. 64 | |
403 Double Damage vs. Titans. 65 | |
404 Regenerate Spell points and Hit points over time. 66 | |
405 Adds 5 points of Body damage and +2 Disarm skill. 67 | |
406 Adds 6-8 points of Cold damage and +5 Armor Class. 68 | |
407 +20 Air Resistance and Shielding. 69 | |
408 +10 Water Resistance and +2 Alchemy skill. 70 | |
409 Prevents damage from drowning. 71 | |
410 Prevents damage from falling. 72 | |
939 | 411 */ |
412 | |
413 | |
414 /* 391 */ | |
415 #pragma pack(push, 1) | |
416 struct stru351_summoned_item | |
417 { | |
418 int field_0_expire_second; | |
419 int field_4_expire_minute; | |
420 int field_8_expire_hour; | |
421 int field_C_expire_day; | |
422 int field_10_expire_week; | |
423 int field_14_exprie_month; | |
424 int field_18_expire_year; | |
425 }; | |
426 #pragma pack(pop) |