comparison Items.h @ 1611:8e99b4a7176f

Слияние
author Ritor1
date Sat, 14 Sep 2013 10:28:23 +0600
parents 4b79ff62df3a
children a4390cef284c
comparison
equal deleted inserted replaced
1610:fa0e700bcc80 1611:8e99b4a7176f
1 #pragma once 1 #pragma once
2 #include <array> 2 #include <array>
3 #include <map>
3 4
4 enum DAMAGE_TYPE:unsigned int 5 enum DAMAGE_TYPE:unsigned int
5 { 6 {
6 DMGT_FIRE = 0, 7 DMGT_FIRE = 0,
7 DMGT_ELECTR = 1, 8 DMGT_ELECTR = 1,
133 ITEM_ARTIFACT_MINDS_EYE = 532,//214 134 ITEM_ARTIFACT_MINDS_EYE = 532,//214
134 ITEM_ELVEN_CHAINMAIL = 533,//215 135 ITEM_ELVEN_CHAINMAIL = 533,//215
135 ITEM_FORGE_GAUNTLETS = 534, 136 ITEM_FORGE_GAUNTLETS = 534,
136 ITEM_ARTIFACT_HEROS_BELT = 535,//217 137 ITEM_ARTIFACT_HEROS_BELT = 535,//217
137 ITEM_ARTIFACT_LADYS_ESCORT = 536, 138 ITEM_ARTIFACT_LADYS_ESCORT = 536,
139 ITEM_RARE_CLANKERS_AMULET = 537,
140 ITEM_RARE_LIETENANTS_CUTLASS = 538,
141 ITEM_RARE_MEDUSAS_MIRROR = 539,
142 ITEM_RARE_LADY_CARMINES_DAGGER = 540,
143 ITEM_RARE_VILLAINS_BLADE = 541,
144 ITEM_RARE_PERFECT_BOW = 542,
145 ITEM_RARE_PERFECT_BOW_FIXED = 543,
138 ITEM_RARE_SHADOWS_MASK = 544,//220 146 ITEM_RARE_SHADOWS_MASK = 544,//220
147 ITEM_RARE_GHOST_RING = 545,//220
148 ITEM_RARE_FAERIE_RING = 546,//220
139 ITEM_RARE_SUN_CLOAK = 547,//223 149 ITEM_RARE_SUN_CLOAK = 547,//223
140 ITEM_RARE_MOON_CLOAK = 548,//224 150 ITEM_RARE_MOON_CLOAK = 548,//224
151 ITEM_RARE_ZOKKARS_AXE = 549,//224
141 ITEM_RARE_VAMPIRES_CAPE = 550,//226 152 ITEM_RARE_VAMPIRES_CAPE = 550,//226
153 ITEM_RARE_MINOTAURS_AXE = 551,//226
154 ITEM_RARE_GROGNARDS_CUTLASS = 552,//226
142 ITEM_LICH_JAR_FULL = 601, 155 ITEM_LICH_JAR_FULL = 601,
143 ITEM_WETSUIT = 604, 156 ITEM_WETSUIT = 604,
144 ITEM_LICH_JAR_EMPTY = 615, 157 ITEM_LICH_JAR_EMPTY = 615,
145 ITEM_RECIPE_REJUVENATION = 740, 158 ITEM_RECIPE_REJUVENATION = 740,
146 ITEM_RECIPE_BODY_RESISTANCE = 771, 159 ITEM_RECIPE_BODY_RESISTANCE = 771,
171 EQUIP_GOLD = 18, 184 EQUIP_GOLD = 18,
172 EQUIP_GEM = 19, 185 EQUIP_GEM = 19,
173 EQUIP_NONE = 20 186 EQUIP_NONE = 20
174 }; 187 };
175 188
176 189 enum CHARACTER_ATTRIBUTE_TYPE;
190 struct Player;
191
192 typedef struct CEnchantment
193 {
194 CEnchantment(int bonus, unsigned __int16 Player::* skillPtr = NULL):
195 statBonus(bonus),
196 statPtr(skillPtr)
197 {
198 }
199 int statBonus;
200 unsigned __int16 Player::* statPtr;
201 } CEnchantment;
177 202
178 /* 64 */ 203 /* 64 */
179 #pragma pack(push, 1) 204 #pragma pack(push, 1)
180 struct ItemGen //0x24 205 struct ItemGen //0x24
181 { 206 {
182 //----- (0042EB25) -------------------------------------------------------- 207 //----- (0042EB25) --------------------------------------------------------
183 // inline ItemGen() 208 // inline ItemGen()
184 // { 209 // {
185 // Reset(); 210 // Reset();
186 // } 211 // }
212 static void AddToMap(std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > &maptoadd,
213 int enchId,
214 CHARACTER_ATTRIBUTE_TYPE attrId,
215 int bonusValue = 0,
216 unsigned __int16 Player::* skillPtr = NULL);
217
218 static std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > regularBonusMap;
219 static std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > specialBonusMap;
220 static std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > artifactBonusMap;
221
222 static void PopulateSpecialBonusMap();
223 static void PopulateRegularBonusMap();
224 static void PopulateArtifactBonusMap();
225
226 void GetItemBonusSpecialEnchantment(Player* owner, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* additiveBonus, int* halfSkillBonus);
227 void GetItemBonusArtifact(Player* owner, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* bonusSum);
228 bool IsRegularEnchanmentForAttribute(CHARACTER_ATTRIBUTE_TYPE attrToGet);
187 229
188 inline bool IsBroken() {return (uAttributes & ITEM_BROKEN) != 0;} 230 inline bool IsBroken() {return (uAttributes & ITEM_BROKEN) != 0;}
189 inline void SetBroken() {uAttributes |= ITEM_BROKEN;} 231 inline void SetBroken() {uAttributes |= ITEM_BROKEN;}
190 inline bool IsIdentified() {return (uAttributes & ITEM_IDENTIFIED) != 0;} 232 inline bool IsIdentified() {return (uAttributes & ITEM_IDENTIFIED) != 0;}
191 inline void SetIdentified() {uAttributes |= ITEM_IDENTIFIED;} 233 inline void SetIdentified() {uAttributes |= ITEM_IDENTIFIED;}
202 244
203 245
204 246
205 int uItemID; //0 247 int uItemID; //0
206 int uEnchantmentType; //4 248 int uEnchantmentType; //4
207 int _bonus_strength; //8 249 int m_enchantmentStrength; //8
208 int uSpecEnchantmentType; // 25 +5 levels //0c 250 int uSpecEnchantmentType; // 25 +5 levels //0c
209 // 16 Drain Hit Points from target. 251 // 16 Drain Hit Points from target.
210 // 35 Increases chance of disarming. 252 // 35 Increases chance of disarming.
211 // 39 Double damage vs Demons. 253 // 39 Double damage vs Demons.
212 // 40 Double damage vs Dragons 254 // 40 Double damage vs Dragons