Mercurial > mm7
annotate Items.h @ 305:cc8e4dc397ec
MonsterPopup_Draw crash fix
author | Nomad |
---|---|
date | Tue, 19 Feb 2013 21:50:33 +0200 |
parents | 640a176c030f |
children | 2a09e1d6fc8f |
rev | line source |
---|---|
0 | 1 #pragma once |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 /* 338 */ | |
9 enum ITEM_FLAGS | |
10 { | |
11 ITEM_IDENTIFIED = 0x1, | |
12 ITEM_BROKEN = 0x2, | |
13 ITEM_TEMP_BONUS = 0x8, | |
14 ITEM_STOLEN = 0x100, | |
15 ITEM_ENCHANTED = 0x200, | |
16 }; | |
17 | |
18 | |
19 /* 330 */ | |
20 enum ITEM_TYPE | |
21 { | |
22 ITEM_LONGSWORD_1 = 0x1, | |
23 ITEM_DAGGER_1 = 0xF, | |
24 ITEM_AXE_1 = 0x17, | |
25 ITEM_SPEAR_1 = 0x1F, | |
26 ITEM_CROSSBOW_1 = 0x2F, | |
27 ITEM_MACE_1 = 0x32, | |
28 ITEM_STAFF_1 = 0x3D, | |
271 | 29 ITEM_BLASTER = 65, |
30 ITEM_LASER_RIFLE = 66, | |
0 | 31 ITEM_LEATHER_1 = 0x42, |
32 ITEM_CHAINMAIL_1 = 0x47, | |
33 ITEM_PLATE_1 = 0x4C, | |
34 ITEM_BUCKLER_1 = 0x54, | |
35 ITEM_GAUNTLETS_1 = 0x6E, | |
36 ITEM_BOOTS_1 = 0x73, | |
37 ITEM_WAND_FIRE = 0x87, | |
38 ITEM_WAND_STUN = 0x8A, | |
39 ITEM_WAND_INCENERATION = 0x9F, | |
40 ITEM_TROLL_BLOOD = 0xCA, | |
41 ITEM_DRAGON_EYE = 0xCC, | |
42 ITEM_HARPY_FEATHER = 0xCF, | |
43 ITEM_DEVIL_ICHOR = 0xD6, | |
44 ITEM_OOZE_ECTOPLASM_BOTTLE = 0xD9, | |
45 ITEM_POTION_BOTTLE = 0xDC, | |
46 ITEM_SPELLBOOK_FIRE_STRIKE = 0x191, | |
47 ITEM_SPELLBOOK_AIR_FEATHER_FALL = 0x19C, | |
48 ITEM_SPELLBOOK_WATER_POISON_SPRAY = 0x1A7, | |
49 ITEM_SPELLBOOK_EARTH_SLOW = 0x1B2, | |
50 ITEM_SPELLBOOK_SPIRIT_BLESS = 0x1BD, | |
51 ITEM_SPELLBOOK_MIND_MIND_BLAST = 0x1C8, | |
52 ITEM_SPELLBOOK_BODY_FIRST_AID = 0x1D3, | |
53 ITEM_SPELLBOOK_BODY_HEAL = 0x1D6, | |
54 ITEM_SPELLBOOK_BODY_BREAK_POISON = 0x1D7, | |
55 ITEM_SPELLBOOK_LIGHT_LIGHT_BOLT = 0x1DD, | |
56 ITEM_SPELLBOOK_LIGHT_SUN_BURST = 0x1E6, | |
57 ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION = 0x1E7, | |
58 ITEM_ARTIFACT_PUCK = 0x1F4, | |
305 | 59 ITEM_ARTIFACT_SPLITTER = 506,//1FA |
0 | 60 ITEM_RELIC_MEKORIGS_HAMMER = 0x210, |
61 }; | |
62 | |
63 /* 331 */ | |
64 enum ITEM_EQUIP_TYPE | |
65 { | |
66 EQUIP_ONE_OR_TWO_HANDS = 0x0, | |
67 EQUIP_TWO_HANDED = 0x1, | |
68 EQUIP_BOW = 0x2, | |
69 EQUIP_ARMOUR = 0x3, | |
70 EQUIP_SHIELD = 0x4, | |
71 EQUIP_HELMET = 0x5, | |
72 EQUIP_BELT = 0x6, | |
73 EQUIP_CLOAK = 0x7, | |
74 EQUIP_GAUNTLETS = 0x8, | |
75 EQUIP_BOOTS = 0x9, | |
76 EQUIP_RING = 0xA, | |
77 EQUIP_AMULET = 0xB, | |
295 | 78 EQUIP_WAND = 12, |
0 | 79 EQUIP_REAGENT = 0xD, |
80 EQUIP_POTION = 0xE, | |
81 EQUIP_F = 0xF, | |
82 EQUIP_BOOK = 0x10, | |
83 EQUIP_11 = 0x11, | |
84 EQUIP_GOLD = 0x12, | |
85 EQUIP_GEM = 0x13, | |
86 }; | |
87 | |
88 | |
89 | |
90 /* 64 */ | |
91 #pragma pack(push, 1) | |
92 struct ItemGen | |
93 { | |
94 //----- (0042EB25) -------------------------------------------------------- | |
95 inline ItemGen() | |
96 { | |
97 Reset(); | |
98 } | |
99 | |
271 | 100 inline bool Broken() {return uAttributes & ITEM_BROKEN;} |
101 | |
0 | 102 bool GenerateArtifact(); |
103 unsigned int GetValue(); | |
104 const char *GetDisplayName(); | |
105 const char *GetIdentifiedName(); | |
106 void UpdateTempBonus(__int64 uTimePlayed); | |
107 void Reset(); | |
108 int _439DF3_get_additional_damage(int *a2, int *a3); | |
109 | |
110 | |
111 | |
112 unsigned int uItemID; | |
113 int _bonus_type; | |
114 int _bonus_strength; | |
115 int uAdditionalValue; | |
116 int uNumCharges; | |
117 unsigned int uAttributes; | |
118 unsigned __int8 uBodyAnchor; | |
119 char uMaxCharges; | |
120 char field_1A; | |
121 char field_1B; | |
122 unsigned __int64 uExpireTime; | |
123 }; | |
124 #pragma pack(pop) | |
125 | |
126 | |
127 | |
128 /* 175 */ | |
129 #pragma pack(push, 1) | |
130 struct ItemDesc | |
229 | 131 { //Item # |Pic File|Name|Value|Equip Stat|Skill Group|Mod1|Mod2|material| |
132 ///ID/Rep/St|Not identified name|Sprite Index|VarA|VarB|Equip X|Equip Y|Notes | |
133 char *pIconName; //0 4 | |
134 char *pName; //4 8 | |
135 char *pUnidentifiedName; //8 c | |
136 char *pDescription; //0c 10 | |
137 unsigned int uValue; //10 14 | |
138 unsigned __int16 uSpriteID; //14 18 | |
139 __int16 field_1A; //16 | |
140 unsigned __int16 uEquipX; //18 1c | |
141 unsigned __int16 uEquipY; //1a 1e | |
142 unsigned __int8 uEquipType; //1c 20 | |
143 unsigned __int8 uSkillType; //1d 21 | |
144 unsigned __int8 uDamageDice; //1e 22 | |
145 unsigned __int8 uDamageRoll; //1f 23 | |
146 unsigned __int8 uDamageMod; //20 24 | |
147 unsigned __int8 uMaterial; //21 25 | |
148 char _additional_value; //22 26 | |
149 char _bonus_type; //23 27 | |
150 char _bonus_strength; //24 28 | |
151 char field_25; // 25 29 | |
152 char field_26; //26 2A | |
153 char field_27; // 27 2b | |
154 union | |
155 { | |
156 unsigned __int8 uChanceByTreasureLvl[6]; | |
157 struct { | |
158 unsigned __int8 uChanceByTreasureLvl1; // 28 2c | |
159 unsigned __int8 uChanceByTreasureLvl2; // 29 2d | |
160 unsigned __int8 uChanceByTreasureLvl3; // 2A 2e | |
161 unsigned __int8 uChanceByTreasureLvl4; // 2B 2f | |
162 unsigned __int8 uChanceByTreasureLvl5; // 2C 30 | |
163 unsigned __int8 uChanceByTreasureLvl6; // 2D 32 | |
164 }; | |
165 }; | |
166 unsigned char uItemID_Rep_St; //2e 32 | |
167 char field_2f; | |
168 }; | |
0 | 169 #pragma pack(pop) |
170 | |
171 | |
172 | |
173 /* 177 */ | |
174 #pragma pack(push, 1) | |
175 struct ItemEnchantment | |
222 | 176 { //Bonus|Sta|Of Name|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul |
177 char *pBonusStat; | |
178 char *pOfName; | |
179 /* union{ | |
180 struct { | |
181 unsigned char to_arm; | |
182 unsigned char to_shld; | |
183 unsigned char to_helm; | |
184 unsigned char to_belt; | |
185 unsigned char to_cape; | |
186 unsigned char to_gaunt; | |
187 unsigned char to_boot; | |
188 unsigned char to_ring; | |
189 unsigned char to_amul; | |
190 }; */ | |
191 unsigned char to_item[12]; | |
192 // }; | |
193 }; | |
0 | 194 #pragma pack(pop) |
195 | |
196 /* 178 */ | |
197 #pragma pack(push, 1) | |
198 struct ItemSpecialEnchantment | |
222 | 199 { //Bonus Stat|Name Add|W1|W2|Miss|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul|Value|Lvl|Description fo special Bonuses and values |
200 | |
201 char *pBonusStatement; | |
202 char *pNameAdd; | |
203 char to_item_apply[12]; | |
204 int iValue; | |
205 int iTreasureLevel; | |
0 | 206 }; |
207 #pragma pack(pop) | |
208 | |
222 | 209 #pragma pack(push, 1) |
210 struct BonusRange | |
211 { | |
212 unsigned int minR; | |
213 unsigned int maxR; | |
214 }; | |
215 #pragma pack(pop) | |
193
821fd955c379
fixed potion data parsing. Somehow 3d render was affected
Gloval
parents:
0
diff
changeset
|
216 |
0 | 217 /* 176 */ |
218 #pragma pack(push, 1) | |
219 struct ItemsTable | |
220 { | |
221 void Initialize(); | |
222 void LoadPotions(); | |
223 void LoadPotionNotes(); | |
228
46ae2602aceb
Item generation doesn't crash (thou still generates weird stuff)
Nomad
parents:
224
diff
changeset
|
224 void GenerateItem(int treasure_level, int a3, ItemGen *pItem); |
0 | 225 void SetSpecialBonus(ItemGen *pItem); |
226 bool _456D43_is_material_equals_3(ItemGen *pItem); | |
227 bool _456D5E_is_some_material(ItemGen *pItem); | |
228 char *Release(); | |
229 | |
222 | 230 int uAllItemsCount; |
231 ItemDesc pItems[800]; //4-9604h | |
232 ItemEnchantment pEnchantments[24]; //9604h | |
229 | 233 ItemSpecialEnchantment pSpecialEnchantments[72]; //97E4h -9FC4h |
224 | 234 char field_9FC4[5000]; |
0 | 235 char field_B348[5000]; |
236 char field_C6D0[5000]; | |
237 char field_DA58[5000]; | |
229 | 238 char field_EDE0[384]; |
222 | 239 unsigned __int16 potion_data[50][50]; // 77B2h*2=EF64h -102ECh |
240 unsigned __int16 potion_note[50][50]; // 8176h*2=102ECh -11674h | |
241 char *pItemsTXT_Raw; //11674h | |
0 | 242 char *pRndItemsTXT_Raw; |
222 | 243 char *pStdItemsTXT_Raw; //1167Ch |
244 char *pSpcItemsTXT_Raw; //11680h | |
224 | 245 unsigned int uChanceByTreasureLvlSumm[6]; //11684 |
246 unsigned int uBonusChanceStandart[6]; //1169c | |
247 unsigned int uBonusChanceSpecial[6]; //116B4 | |
248 unsigned int uBonusChanceWpSpecial[6]; //116cc -116e4 | |
222 | 249 unsigned int pEnchantmentsSumm[9]; //116E4h -11708h |
250 BonusRange bonus_ranges[6]; //45C2h*4 =11708h | |
224 | 251 unsigned int pSpecialEnchantmentsSumm[24]; //11738h |
252 unsigned int pSpecialEnchantments_count; //11798h | |
0 | 253 char field_1179C; |
254 }; | |
255 #pragma pack(pop) | |
256 | |
257 | |
258 | |
259 | |
260 extern ItemGen *ptr_50C9A4; | |
261 | |
262 extern struct ItemsTable *pItemsTable; |