Mercurial > mm7
annotate Items.h @ 374:f0f66f690777
items
author | Gloval |
---|---|
date | Fri, 22 Feb 2013 08:20:59 +0400 |
parents | 0f35f908547f |
children | 243418228760 |
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 { | |
365 | 66 EQUIP_ONE_OR_TWO_HANDS = 0, |
67 EQUIP_TWO_HANDED = 1, | |
68 EQUIP_BOW = 2, | |
69 EQUIP_ARMOUR = 3, | |
70 EQUIP_SHIELD = 4, | |
71 EQUIP_HELMET = 5, | |
72 EQUIP_BELT = 6, | |
73 EQUIP_CLOAK = 7, | |
374 | 74 EQUIP_GAUNTLETS = 8, |
75 EQUIP_BOOTS = 9, | |
76 EQUIP_RING = 10, | |
77 EQUIP_AMULET = 11, | |
78 EQUIP_WAND = 12, | |
79 EQUIP_REAGENT = 13, | |
80 EQUIP_POTION = 14, | |
81 EQUIP_SPELL_SCROLL = 15, | |
82 EQUIP_BOOK = 16, | |
83 EQUIP_MESSAGE_SCROLL = 17, | |
84 EQUIP_GOLD = 18, | |
85 EQUIP_GEM = 19, | |
86 EQUIP_NONE = 20 | |
0 | 87 }; |
88 | |
89 | |
90 | |
91 /* 64 */ | |
92 #pragma pack(push, 1) | |
93 struct ItemGen | |
94 { | |
95 //----- (0042EB25) -------------------------------------------------------- | |
96 inline ItemGen() | |
97 { | |
98 Reset(); | |
99 } | |
100 | |
315 | 101 inline bool Broken() {return uAttributes & ITEM_BROKEN;} |
102 inline bool Identified() {return uAttributes & ITEM_IDENTIFIED;} | |
103 inline void SetIdentified() {uAttributes |= ITEM_IDENTIFIED;} | |
104 inline bool Stolen() {return uAttributes & ITEM_STOLEN;} | |
271 | 105 |
0 | 106 bool GenerateArtifact(); |
107 unsigned int GetValue(); | |
108 const char *GetDisplayName(); | |
109 const char *GetIdentifiedName(); | |
110 void UpdateTempBonus(__int64 uTimePlayed); | |
111 void Reset(); | |
112 int _439DF3_get_additional_damage(int *a2, int *a3); | |
113 | |
114 | |
115 | |
116 unsigned int uItemID; | |
117 int _bonus_type; | |
118 int _bonus_strength; | |
119 int uAdditionalValue; | |
120 int uNumCharges; | |
121 unsigned int uAttributes; | |
122 unsigned __int8 uBodyAnchor; | |
123 char uMaxCharges; | |
124 char field_1A; | |
125 char field_1B; | |
126 unsigned __int64 uExpireTime; | |
127 }; | |
128 #pragma pack(pop) | |
129 | |
130 | |
131 | |
132 /* 175 */ | |
133 #pragma pack(push, 1) | |
134 struct ItemDesc | |
229 | 135 { //Item # |Pic File|Name|Value|Equip Stat|Skill Group|Mod1|Mod2|material| |
136 ///ID/Rep/St|Not identified name|Sprite Index|VarA|VarB|Equip X|Equip Y|Notes | |
137 char *pIconName; //0 4 | |
138 char *pName; //4 8 | |
139 char *pUnidentifiedName; //8 c | |
140 char *pDescription; //0c 10 | |
141 unsigned int uValue; //10 14 | |
142 unsigned __int16 uSpriteID; //14 18 | |
143 __int16 field_1A; //16 | |
365 | 144 signed __int16 uEquipX; //18 1c |
145 signed __int16 uEquipY; //1a 1e | |
229 | 146 unsigned __int8 uEquipType; //1c 20 |
147 unsigned __int8 uSkillType; //1d 21 | |
148 unsigned __int8 uDamageDice; //1e 22 | |
149 unsigned __int8 uDamageRoll; //1f 23 | |
150 unsigned __int8 uDamageMod; //20 24 | |
151 unsigned __int8 uMaterial; //21 25 | |
152 char _additional_value; //22 26 | |
153 char _bonus_type; //23 27 | |
154 char _bonus_strength; //24 28 | |
155 char field_25; // 25 29 | |
156 char field_26; //26 2A | |
157 char field_27; // 27 2b | |
158 union | |
315 | 159 { |
229 | 160 unsigned __int8 uChanceByTreasureLvl[6]; |
161 struct { | |
162 unsigned __int8 uChanceByTreasureLvl1; // 28 2c | |
163 unsigned __int8 uChanceByTreasureLvl2; // 29 2d | |
164 unsigned __int8 uChanceByTreasureLvl3; // 2A 2e | |
165 unsigned __int8 uChanceByTreasureLvl4; // 2B 2f | |
166 unsigned __int8 uChanceByTreasureLvl5; // 2C 30 | |
167 unsigned __int8 uChanceByTreasureLvl6; // 2D 32 | |
168 }; | |
315 | 169 }; |
170 unsigned char uItemID_Rep_St; //2e 32 | |
171 char field_2f; | |
172 }; | |
0 | 173 #pragma pack(pop) |
174 | |
175 | |
176 | |
177 /* 177 */ | |
178 #pragma pack(push, 1) | |
179 struct ItemEnchantment | |
222 | 180 { //Bonus|Sta|Of Name|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul |
181 char *pBonusStat; | |
182 char *pOfName; | |
183 /* union{ | |
184 struct { | |
185 unsigned char to_arm; | |
186 unsigned char to_shld; | |
187 unsigned char to_helm; | |
188 unsigned char to_belt; | |
189 unsigned char to_cape; | |
190 unsigned char to_gaunt; | |
191 unsigned char to_boot; | |
192 unsigned char to_ring; | |
193 unsigned char to_amul; | |
194 }; */ | |
195 unsigned char to_item[12]; | |
196 // }; | |
197 }; | |
0 | 198 #pragma pack(pop) |
199 | |
200 /* 178 */ | |
201 #pragma pack(push, 1) | |
202 struct ItemSpecialEnchantment | |
222 | 203 { //Bonus Stat|Name Add|W1|W2|Miss|Arm|Shld|Helm|Belt|Cape|Gaunt|Boot|Ring|Amul|Value|Lvl|Description fo special Bonuses and values |
204 | |
205 char *pBonusStatement; | |
206 char *pNameAdd; | |
207 char to_item_apply[12]; | |
208 int iValue; | |
209 int iTreasureLevel; | |
0 | 210 }; |
211 #pragma pack(pop) | |
212 | |
222 | 213 #pragma pack(push, 1) |
214 struct BonusRange | |
215 { | |
216 unsigned int minR; | |
217 unsigned int maxR; | |
218 }; | |
219 #pragma pack(pop) | |
193
821fd955c379
fixed potion data parsing. Somehow 3d render was affected
Gloval
parents:
0
diff
changeset
|
220 |
0 | 221 /* 176 */ |
222 #pragma pack(push, 1) | |
223 struct ItemsTable | |
224 { | |
225 void Initialize(); | |
226 void LoadPotions(); | |
227 void LoadPotionNotes(); | |
228
46ae2602aceb
Item generation doesn't crash (thou still generates weird stuff)
Nomad
parents:
224
diff
changeset
|
228 void GenerateItem(int treasure_level, int a3, ItemGen *pItem); |
0 | 229 void SetSpecialBonus(ItemGen *pItem); |
230 bool _456D43_is_material_equals_3(ItemGen *pItem); | |
231 bool _456D5E_is_some_material(ItemGen *pItem); | |
374 | 232 void Release(); |
0 | 233 |
222 | 234 int uAllItemsCount; |
235 ItemDesc pItems[800]; //4-9604h | |
236 ItemEnchantment pEnchantments[24]; //9604h | |
229 | 237 ItemSpecialEnchantment pSpecialEnchantments[72]; //97E4h -9FC4h |
224 | 238 char field_9FC4[5000]; |
0 | 239 char field_B348[5000]; |
240 char field_C6D0[5000]; | |
241 char field_DA58[5000]; | |
229 | 242 char field_EDE0[384]; |
222 | 243 unsigned __int16 potion_data[50][50]; // 77B2h*2=EF64h -102ECh |
244 unsigned __int16 potion_note[50][50]; // 8176h*2=102ECh -11674h | |
245 char *pItemsTXT_Raw; //11674h | |
0 | 246 char *pRndItemsTXT_Raw; |
222 | 247 char *pStdItemsTXT_Raw; //1167Ch |
248 char *pSpcItemsTXT_Raw; //11680h | |
224 | 249 unsigned int uChanceByTreasureLvlSumm[6]; //11684 |
250 unsigned int uBonusChanceStandart[6]; //1169c | |
251 unsigned int uBonusChanceSpecial[6]; //116B4 | |
252 unsigned int uBonusChanceWpSpecial[6]; //116cc -116e4 | |
222 | 253 unsigned int pEnchantmentsSumm[9]; //116E4h -11708h |
254 BonusRange bonus_ranges[6]; //45C2h*4 =11708h | |
224 | 255 unsigned int pSpecialEnchantmentsSumm[24]; //11738h |
256 unsigned int pSpecialEnchantments_count; //11798h | |
0 | 257 char field_1179C; |
315 | 258 char field_1179D; |
259 char field_1179E; | |
260 char field_1179F; | |
0 | 261 }; |
262 #pragma pack(pop) | |
263 | |
264 | |
265 | |
266 | |
267 extern ItemGen *ptr_50C9A4; | |
268 | |
269 extern struct ItemsTable *pItemsTable; |