annotate Items.cpp @ 2266:01489aec3cb0

EventProcessor cleared
author Ritor1
date Sat, 08 Mar 2014 23:53:00 +0600
parents 236d8d7c7295
children 037ad3678c0f
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2250
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
0
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
3 #include <string>
0
Ritor1
parents:
diff changeset
4
Ritor1
parents:
diff changeset
5 #include "Items.h"
Ritor1
parents:
diff changeset
6 #include "MapInfo.h"
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
7 #include "GUIWindow.h"
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
8 #include "Events2D.h"
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
9 #include "Chest.h"
0
Ritor1
parents:
diff changeset
10 #include "LOD.h"
Ritor1
parents:
diff changeset
11 #include "Monsters.h"
Ritor1
parents:
diff changeset
12 #include "Party.h"
Ritor1
parents:
diff changeset
13 #include "FactionTable.h"
Ritor1
parents:
diff changeset
14 #include "StorylineTextTable.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 0
diff changeset
15 #include "texts.h"
0
Ritor1
parents:
diff changeset
16 #include "mm7_data.h"
Ritor1
parents:
diff changeset
17
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
18 struct ci_less : std::binary_function<std::string, std::string, bool>
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
19 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
20 // case-independent (ci) compare_less binary function
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
21 struct nocase_compare : public std::binary_function<unsigned char,unsigned char,bool>
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
22 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
23 bool operator() (const unsigned char& c1, const unsigned char& c2) const {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
24 return tolower (c1) < tolower (c2);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
25 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
26 };
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
27 bool operator() (const std::string & s1, const std::string & s2) const {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
28 return std::lexicographical_compare
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
29 (s1.begin (), s1.end (), // source range
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
30 s2.begin (), s2.end (), // dest range
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
31 nocase_compare ()); // comparison
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
32 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
33 };
0
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
36 struct ITEM_VARIATION
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
37 {
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
38 unsigned __int16 treasure_level;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
39 unsigned __int16 item_class[4];
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
40 };
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
41
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
42
1202
0dbf6c4dd029 arrays to std::arrays phase 1
Grumpy7
parents: 1165
diff changeset
43 std::array<const char, 5> uItemsAmountPerShopType={ 0, 6, 8, 12, 12};
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
44
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
45 const ITEM_VARIATION shopWeap_variation_ord[15] ={
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
46 { 0, { 0, 0, 0, 0 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
47 { 1, { 23, 27, 20, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
48 { 1, { 23, 24, 28, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
49 { 2, { 23, 24, 25, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
50 { 2, { 27, 27, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
51 { 4, { 24, 30, 25, 27 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
52 { 4, { 24, 30, 25, 27 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
53 { 3, { 30, 24, 20, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
54 { 2, { 20, 20, 20, 20 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
55 { 3, { 27, 27, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
56 { 3, { 28, 28, 25, 25 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
57 { 2, { 23, 23, 24, 24 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
58 { 3, { 23, 23, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
59 { 2, { 30, 26, 26, 26 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
60 { 2, { 28, 25, 28, 29 }}};
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
61
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
62 const ITEM_VARIATION shopArmr_variation_ord[28] ={
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
63 { 1, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
64 { 1, { 31, 31, 31, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
65 { 1, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
66 { 1, { 31, 31, 32, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
67 { 2, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
68 { 2, { 31, 32, 32, 33 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
69 { 2, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
70 { 2, { 31, 31, 32, 32 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
71 { 4, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
72 { 4, { 31, 32, 33, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
73 { 4, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
74 { 4, { 31, 32, 33, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
75 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
76 { 3, { 31, 31, 31, 31 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
77 { 2, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
78 { 2, { 31, 32, 34, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
79 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
80 { 3, { 31, 31, 32, 32 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
81 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
82 { 3, { 32, 32, 32, 33 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
83 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
84 { 3, { 31, 31, 31, 32 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
85 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
86 { 3, { 33, 31, 32, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
87 { 3, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
88 { 3, { 33, 31, 32, 34 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
89 { 4, { 35, 35, 38, 38 }},
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
90 { 4, { 33, 31, 32, 34 }}};
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
91
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
92
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
93
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
94 const unsigned __int16 shopMagic_treasure_lvl[14]= {0, 1, 1, 2, 2, 4, 4, 3, 2, 2, 2, 2, 2, 2};
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
95 const unsigned __int16 shopAlch_treasure_lvl[13] = {0, 1, 1, 2, 2, 3, 3, 4, 4, 2, 2, 2, 2};
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
96
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
97 const ITEM_VARIATION shopWeap_variation_spc[15]={
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
98 { 0, { 0, 0, 0, 0 }},
470
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
99 { 2, { 25, 30, 20, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
100 { 2, { 23, 24, 28, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
101 { 3, { 23, 24, 25, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
102 { 3, { 27, 27, 26, 26}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
103 { 5, { 23, 26, 28, 27}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
104 { 5, { 23, 26, 28, 27}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
105 { 4, { 30, 24, 20, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
106 { 3, { 20, 20, 20, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
107 { 4, { 27, 27, 26, 26}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
108 { 4, { 28, 28, 25, 25}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
109 { 4, { 23, 23, 24, 24}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
110 { 4, { 24, 24, 27, 20}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
111 { 4, { 30, 26, 26, 26}},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
112 { 4, { 28, 25, 28, 29}}};
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
113
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
114 const ITEM_VARIATION shopArmr_variation_spc[28]={
470
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
115 { 2, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
116 { 2, { 31, 31, 31, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
117 { 2, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
118 { 2, { 31, 31, 32, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
119 { 3, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
120 { 3, { 31, 32, 32, 33 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
121 { 3, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
122 { 3, { 31, 31, 32, 32 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
123 { 5, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
124 { 5, { 31, 32, 33, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
125 { 5, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
126 { 5, { 31, 32, 33, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
127 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
128 { 4, { 31, 31, 31, 31 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
129 { 3, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
130 { 3, { 31, 32, 34, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
131 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
132 { 4, { 31, 31, 32, 33 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
133 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
134 { 4, { 32, 32, 33, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
135 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
136 { 4, { 31, 31, 31, 32 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
137 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
138 { 4, { 32, 32, 32, 32 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
139 { 4, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
140 { 4, { 34, 34, 34, 34 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
141 { 5, { 35, 35, 38, 38 }},
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
142 { 5, { 33, 33, 33, 33 }}
fcdaa804074f Tables for shopgenerators
Gloval
parents: 463
diff changeset
143 };
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
144
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
145 const unsigned __int16 shopMagicSpc_treasure_lvl[14] = {0, 2, 2, 3, 3, 5, 5, 4, 3, 3, 3, 3, 3, 3};
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
146 const unsigned __int16 shopAlchSpc_treasure_lvl[13] = {0, 2, 2, 3, 3, 4, 4, 5, 5, 3, 2, 2, 2};
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
147
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
148
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
149 std::array< std::array<char, 14>, 7> byte_4E8168={{ //byte_4E8178
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
150 { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
151 { 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2},
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
152 { 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3},
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
153 { 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4},
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
154 { 2, 2, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5},
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
155 { 2, 2, 2, 2, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6},
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
156 { 2, 2, 2, 2, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}}};
0
Ritor1
parents:
diff changeset
157
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
158 int sub_4BE571(int a1, int *a2, int a3, int a4);
0
Ritor1
parents:
diff changeset
159
1682
3c451fd02fcf OnInventoryLeftClick cleanup
Grumpy7
parents: 1648
diff changeset
160 ItemGen *ptr_50C9A4_ItemToEnchant;
0
Ritor1
parents:
diff changeset
161
315
2a09e1d6fc8f Some 0041D895 GameUI_DrawItemInfo overhaul
Nomad
parents: 296
diff changeset
162 struct ItemsTable *pItemsTable; // 005D29E0
0
Ritor1
parents:
diff changeset
163
Ritor1
parents:
diff changeset
164
Ritor1
parents:
diff changeset
165
Ritor1
parents:
diff changeset
166
Ritor1
parents:
diff changeset
167
Ritor1
parents:
diff changeset
168 //----- (00439DF3) --------------------------------------------------------
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
169 int ItemGen::_439DF3_get_additional_damage(int *damage_type, bool *draintargetHP)
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
170 {
1933
5fcf6023f9c3 DamageMonsterFromParty some additional vars removed, changed the ordering part to something more readable
Grumpy7
parents: 1920
diff changeset
171 *draintargetHP = false;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
172 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
173 if ( !uItemID )
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
174 return 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
175 UpdateTempBonus(pParty->uTimePlayed);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
176 if (uItemID == 501 ) //Iron Feather -sword
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
177 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
178 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
179 return rand() % 10 + 6;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
180 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
181 if (uItemID == 507 ) //Ghoulsbane -axe
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
182 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
183 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
184 return rand() % 16 + 3;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
185 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
186 if ( uItemID == 510 ) //Ullyses -bow
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
187 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
188 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
189 return rand() % 4 + 9;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
190 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
191 if ( uItemID == 517 ) //Old Nick -dagger
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
192 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
193 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
194 return 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
195 }
0
Ritor1
parents:
diff changeset
196
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
197 switch (uSpecEnchantmentType)
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
198 {
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
199 case 4: //Adds 3-4 points of Cold damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
200 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
201 return rand() % 2 + 3;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
202 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
203 case 5: //Adds 6-8 points of Cold damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
204 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
205 return rand() % 3 + 6;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
206 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
207 case 6: //Adds 9-12 points of Cold damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
208 *damage_type = 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
209 return rand() % 4 + 9;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
210 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
211 case 7: //Adds 2-5 points of Electrical damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
212 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
213 return rand() % 4 + 2;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
214 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
215 case 8: //Adds 4-10 points of Electrical damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
216 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
217 return rand() % 7 + 4;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
218 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
219 case 9: //Adds 6-15 points of Electrical damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
220 *damage_type = 1;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
221 return rand() % 10 + 6;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
222 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
223 case 10: //Adds 1-6 points of Fire damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
224 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
225 return GetDiceResult(1, 6);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
226 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
227 case 11: //Adds 2-12 points of Fire damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
228 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
229 return GetDiceResult(2, 6);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
230 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
231 case 12: //Adds 3-18 points of Fire damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
232 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
233 return GetDiceResult(3, 6);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
234 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
235 case 13: //Adds 5 points of Body damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
236 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
237 return 5;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
238 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
239 case 14: //Adds 8 points of Body damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
240 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
241 return 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
242 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
243 case 15: //Adds 12 points of Body damage.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
244 *damage_type = 8;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
245 return 12;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
246 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
247 case 16: //Drain Hit Points from target.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
248 case 41: //Drain Hit Points from target and Increased Weapon speed.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
249 *damage_type = 10;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
250 *draintargetHP = true;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
251 return 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
252 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
253 case 46: //Adds 10-20 points of Fire damage and +25 Might.
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
254 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
255 return rand() % 11 + 10;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
256 break;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
257 default:
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
258 *damage_type = 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
259 return 0;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
260
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
261 }
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
262
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
263 }
0
Ritor1
parents:
diff changeset
264
Ritor1
parents:
diff changeset
265
Ritor1
parents:
diff changeset
266 //----- (00402F07) --------------------------------------------------------
Ritor1
parents:
diff changeset
267 void ItemGen::Reset()
Ritor1
parents:
diff changeset
268 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
269 this->uHolderPlayer = 0;
0
Ritor1
parents:
diff changeset
270 this->uAttributes = 0;
Ritor1
parents:
diff changeset
271 this->uNumCharges = 0;
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
272 this->uSpecEnchantmentType = 0;
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
273 this->m_enchantmentStrength = 0;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
274 this->uEnchantmentType = 0;
0
Ritor1
parents:
diff changeset
275 this->uItemID = 0;
Ritor1
parents:
diff changeset
276 this->uBodyAnchor = 0;
Ritor1
parents:
diff changeset
277 this->uExpireTime = 0i64;
Ritor1
parents:
diff changeset
278 }
Ritor1
parents:
diff changeset
279
Ritor1
parents:
diff changeset
280 //----- (00458260) --------------------------------------------------------
Ritor1
parents:
diff changeset
281 void ItemGen::UpdateTempBonus(__int64 uTimePlayed)
Ritor1
parents:
diff changeset
282 {
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
283 if ( this->uAttributes & ITEM_TEMP_BONUS )
0
Ritor1
parents:
diff changeset
284 {
Ritor1
parents:
diff changeset
285 if ( uTimePlayed > (signed __int64)this->uExpireTime )
Ritor1
parents:
diff changeset
286 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
287 this->uEnchantmentType = 0;
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
288 this->uSpecEnchantmentType = 0;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
289 this->uAttributes = this->uAttributes&(~ITEM_TEMP_BONUS);
0
Ritor1
parents:
diff changeset
290 }
Ritor1
parents:
diff changeset
291 }
Ritor1
parents:
diff changeset
292 }
Ritor1
parents:
diff changeset
293
Ritor1
parents:
diff changeset
294 //----- (0045814E) --------------------------------------------------------
374
Gloval
parents: 365
diff changeset
295 void ItemsTable::Release()
0
Ritor1
parents:
diff changeset
296 {
Ritor1
parents:
diff changeset
297 if ( pMonstersTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
298 free(pMonstersTXT_Raw);
0
Ritor1
parents:
diff changeset
299 if ( pMonsterPlacementTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
300 free(pMonsterPlacementTXT_Raw);
0
Ritor1
parents:
diff changeset
301 if ( pSkillDescTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
302 free(pSkillDescTXT_Raw);
374
Gloval
parents: 365
diff changeset
303 if (pSpcItemsTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
304 free(pSpcItemsTXT_Raw);
374
Gloval
parents: 365
diff changeset
305 if ( pStdItemsTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
306 free(pStdItemsTXT_Raw);
374
Gloval
parents: 365
diff changeset
307 if ( pRndItemsTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
308 free(pRndItemsTXT_Raw);
374
Gloval
parents: 365
diff changeset
309 if ( pItemsTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
310 free(pItemsTXT_Raw);
0
Ritor1
parents:
diff changeset
311 if ( pHostileTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
312 free(pHostileTXT_Raw);
0
Ritor1
parents:
diff changeset
313 if ( pHistoryTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
314 free(pHistoryTXT_Raw);
0
Ritor1
parents:
diff changeset
315 if ( pPotionsTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
316 free(pPotionsTXT_Raw);
0
Ritor1
parents:
diff changeset
317 if ( pPotionNotesTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
318 free(pPotionNotesTXT_Raw);
374
Gloval
parents: 365
diff changeset
319 pSpcItemsTXT_Raw = NULL;
Gloval
parents: 365
diff changeset
320 pSkillDescTXT_Raw = NULL;
Gloval
parents: 365
diff changeset
321 pStdItemsTXT_Raw = NULL;
Gloval
parents: 365
diff changeset
322 pRndItemsTXT_Raw = NULL;
Gloval
parents: 365
diff changeset
323 pItemsTXT_Raw = NULL;
0
Ritor1
parents:
diff changeset
324 }
Ritor1
parents:
diff changeset
325
1082
Gloval
parents: 1018
diff changeset
326
0
Ritor1
parents:
diff changeset
327 //----- (00456D84) --------------------------------------------------------
Ritor1
parents:
diff changeset
328 void ItemsTable::Initialize()
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
329 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
330 std::map<std::string, ITEM_EQUIP_TYPE, ci_less> equipStatMap;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
331 equipStatMap["weapon"] = EQUIP_SINGLE_HANDED;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
332 equipStatMap["weapon2"] = EQUIP_TWO_HANDED;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
333 equipStatMap["weapon1or2"] = EQUIP_SINGLE_HANDED;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
334 equipStatMap["missile"] = EQUIP_BOW;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
335 equipStatMap["bow"] = EQUIP_BOW;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
336 equipStatMap["armor"] = EQUIP_ARMOUR;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
337 equipStatMap["shield"] = EQUIP_SHIELD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
338 equipStatMap["helm"] = EQUIP_HELMET;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
339 equipStatMap["belt"] = EQUIP_BELT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
340 equipStatMap["cloak"] = EQUIP_CLOAK;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
341 equipStatMap["gauntlets"] = EQUIP_GAUNTLETS;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
342 equipStatMap["boots"] = EQUIP_BOOTS;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
343 equipStatMap["ring"] = EQUIP_RING;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
344 equipStatMap["amulet"] = EQUIP_AMULET;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
345 equipStatMap["weaponw"] = EQUIP_WAND;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
346 equipStatMap["herb"] = EQUIP_REAGENT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
347 equipStatMap["reagent"] = EQUIP_REAGENT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
348 equipStatMap["bottle"] = EQUIP_POTION;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
349 equipStatMap["sscroll"] = EQUIP_SPELL_SCROLL;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
350 equipStatMap["book"] = EQUIP_BOOK;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
351 equipStatMap["mscroll"] = EQUIP_MESSAGE_SCROLL;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
352 equipStatMap["gold"] = EQUIP_GOLD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
353 equipStatMap["gem"] = EQUIP_GEM;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
354
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
355 std::map<std::string, PLAYER_SKILL_TYPE, ci_less> equipSkillMap;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
356 equipSkillMap["staff"] = PLAYER_SKILL_STAFF;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
357 equipSkillMap["sword"] = PLAYER_SKILL_SWORD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
358 equipSkillMap["dagger"] = PLAYER_SKILL_DAGGER;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
359 equipSkillMap["axe"] = PLAYER_SKILL_AXE;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
360 equipSkillMap["spear"] = PLAYER_SKILL_SPEAR;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
361 equipSkillMap["bow"] = PLAYER_SKILL_BOW;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
362 equipSkillMap["mace"] = PLAYER_SKILL_MACE;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
363 equipSkillMap["blaster"] = PLAYER_SKILL_BLASTER;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
364 equipSkillMap["shield"] = PLAYER_SKILL_SHIELD;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
365 equipSkillMap["leather"] = PLAYER_SKILL_LEATHER;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
366 equipSkillMap["chain"] = PLAYER_SKILL_CHAIN;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
367 equipSkillMap["plate"] = PLAYER_SKILL_PLATE;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
368 equipSkillMap["club"] = PLAYER_SKILL_CLUB;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
369
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
370 std::map<std::string, ITEM_MATERIAL, ci_less> materialMap;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
371 materialMap["artifact"] = MATERIAL_ARTEFACT;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
372 materialMap["relic"] = MATERIAL_RELIC;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
373 materialMap["special"] = MATERIAL_SPECIAL;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
374
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
375 int i,j;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
376 char* test_string;
229
Gloval
parents: 224
diff changeset
377 unsigned char c;
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
378 bool break_loop;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
379 unsigned int temp_str_len;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
380 char* tmp_pos;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
381 int decode_step;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
382 int item_counter;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
383
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
384 pMapStats = new MapStats;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
385 pMapStats->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
386
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
387 pMonsterStats = new MonsterStats;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
388 pMonsterStats->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
389 pMonsterStats->InitializePlacements();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
390
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
391 pSpellStats = new SpellStats;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
392 pSpellStats->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
393
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
394 LoadPotions();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
395 LoadPotionNotes();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
396
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
397 pFactionTable = new FactionTable;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
398 pFactionTable->Initialize();
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
399
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
400 pStorylineText = new StorylineText;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
401 pStorylineText->Initialize();
0
Ritor1
parents:
diff changeset
402
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
403 pStdItemsTXT_Raw = NULL;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
404 pStdItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("stditems.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
405 strtok(pStdItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
406 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
407 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
408 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
409 //Standard Bonuses by Group
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
410 for (i=0;i<24;++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
411 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
412 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
413 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
414 pEnchantments[i].pBonusStat=RemoveQuotes(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
415 pEnchantments[i].pOfName=RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
416 for (int j = 0; j < 9; j++)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
417 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
418 pEnchantments[i].to_item[j]=atoi(tokens[j+2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
419 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
420 }
0
Ritor1
parents:
diff changeset
421
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
422 memset(&pEnchantmentsSumm, 0, 36);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
423 for(i=0;i<9;++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
424 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
425 for (j=0;j<24;++j)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
426 pEnchantmentsSumm[i]+=pEnchantments[j].to_item[i];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
427 }
0
Ritor1
parents:
diff changeset
428
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
429 //Bonus range for Standard by Level
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
430 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
431 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
432 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
433 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
434 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
435 for(i=0;i<6;++i) //counted from 1
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
436 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
437 test_string = strtok(NULL, "\r") + 1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
438 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
439 Assert(tokens.size() == 4, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
440 bonus_ranges[i].minR = atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
441 bonus_ranges[i].maxR =atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
442 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
443
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
444
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
445 pSpcItemsTXT_Raw = 0;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
446 pSpcItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("spcitems.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
447 strtok(pSpcItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
448 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
449 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
450 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
451 for (i=0;i<72;++i)
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
452 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
453 test_string = strtok(NULL, "\r") + 1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
454 auto tokens = Tokenize(test_string, '\t');
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
455 Assert(tokens.size() >= 17, "Invalid number of tokens");
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
456 pSpecialEnchantments[i].pBonusStatement=RemoveQuotes(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
457 pSpecialEnchantments[i].pNameAdd= RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
458 for (int i = 0; i < 12; i++)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
459 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
460 pSpecialEnchantments[i].to_item_apply[i]=atoi(tokens[i+2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
461 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
462 int res;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
463 res=atoi(tokens[14]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
464 if(!res)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
465 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
466 ++tokens[14];
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
467 while (*tokens[14]==' ')//fix X 2 case
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
468 ++tokens[14];
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
469 res=atoi(tokens[14]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
470 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
471 pSpecialEnchantments[i].iValue=res;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
472 pSpecialEnchantments[i].iTreasureLevel= tolower(tokens[15][0]) - 97;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
473 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
474
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
475 pSpecialEnchantments_count = 71;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
476 memset(&pSpecialEnchantmentsSumm, 0, 96);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
477 for(i=0;i<12;++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
478 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
479 for (j=0;j<=pSpecialEnchantments_count;++j)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
480 pSpecialEnchantmentsSumm[i]+=pSpecialEnchantments[j].to_item_apply[i];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
481 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
482
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
483 Initialize2DA();
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
484
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
485 pItemsTXT_Raw = NULL;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
486 pItemsTXT_Raw = (char*) pEvents_LOD->LoadRaw("items.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
487 strtok(pItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
488 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
489 uAllItemsCount = 0;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
490 item_counter = 0;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
491 while (item_counter < 800)
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
492 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
493 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
494 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
495 item_counter=atoi(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
496 uAllItemsCount=item_counter;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
497 pItems[item_counter].pIconName = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
498 pItems[item_counter].pName = RemoveQuotes(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
499 pItems[item_counter].uValue=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
500 auto findResult = equipStatMap.find(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
501 pItems[item_counter].uEquipType = findResult == equipStatMap.end() ? EQUIP_NONE : findResult->second;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
502 auto findResult2 = equipSkillMap.find(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
503 pItems[item_counter].uSkillType = findResult2 == equipSkillMap.end() ? PLAYER_SKILL_MISC : findResult->second;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
504 auto tokens2 = Tokenize(tokens[6], 'd');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
505 if (tokens2.size() == 2)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
506 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
507 pItems[item_counter].uDamageDice=atoi(tokens2[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
508 pItems[item_counter].uDamageRoll=atoi(tokens2[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
509 }
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
510 else if (tolower(tokens2[0][0]) != 's')
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
511 {
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
512 pItems[item_counter].uDamageDice=atoi(tokens2[0]);
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
513 pItems[item_counter].uDamageRoll=1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
514 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
515 else
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
516 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
517 pItems[item_counter].uDamageDice=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
518 pItems[item_counter].uDamageRoll=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
519 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
520 pItems[item_counter].uDamageMod=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
521 auto findResult3 = materialMap.find(tokens[8]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
522 pItems[item_counter].uSkillType = findResult3 == materialMap.end() ? MATERIAL_COMMON : findResult->second;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
523 pItems[item_counter].uItemID_Rep_St=atoi(tokens[9]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
524 pItems[item_counter].pUnidentifiedName = RemoveQuotes(tokens[10]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
525 pItems[item_counter].uSpriteID=atoi(tokens[11]);
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
526
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
527 pItems[item_counter]._additional_value=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
528 pItems[item_counter]._bonus_type=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
529 if (pItems[item_counter].uMaterial==MATERIAL_SPECIAL)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
530 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
531 for(int ii=0; ii<24; ++ii)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
532 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
533 if (!_stricmp(tokens[12],pEnchantments[ii].pOfName))
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
534 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
535 pItems[item_counter]._bonus_type=ii+1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
536 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
537 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
538 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
539 if (!pItems[item_counter]._bonus_type)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
540 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
541 for(int ii=0; ii<72; ++ii)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
542 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
543 if (!_stricmp(tokens[12],pSpecialEnchantments[ii].pNameAdd))
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
544 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
545 pItems[item_counter]._additional_value=ii+1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
546 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
547 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
548 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
549 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
550
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
551 if ((pItems[item_counter].uMaterial==MATERIAL_SPECIAL)&&(pItems[item_counter]._bonus_type))
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
552 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
553 char b_s=atoi(tokens[13]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
554 if (b_s)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
555 pItems[item_counter]._bonus_strength=b_s;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
556 else
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
557 pItems[item_counter]._bonus_strength=1;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
558 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
559 else
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
560 pItems[item_counter]._bonus_strength=0;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
561 pItems[item_counter].uEquipX=atoi(tokens[14]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
562 pItems[item_counter].uEquipY=atoi(tokens[15]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
563 pItems[item_counter].pDescription = RemoveQuotes(tokens[16]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
564 item_counter++;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
565 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
566
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
567 pRndItemsTXT_Raw = NULL;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
568 uAllItemsCount = item_counter;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
569 pRndItemsTXT_Raw = (char *)pEvents_LOD->LoadRaw("rnditems.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
570 strtok(pRndItemsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
571 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
572 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
573 strtok(NULL, "\r");
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
574 for (int item_counter = 0; item_counter < 619; item_counter++)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
575 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
576 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
577 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
578 Assert(tokens.size() > 7, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
579 item_counter = atoi(tokens[0]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
580 pItems[item_counter].uChanceByTreasureLvl1=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
581 pItems[item_counter].uChanceByTreasureLvl2=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
582 pItems[item_counter].uChanceByTreasureLvl3=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
583 pItems[item_counter].uChanceByTreasureLvl4=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
584 pItems[item_counter].uChanceByTreasureLvl5=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
585 pItems[item_counter].uChanceByTreasureLvl6=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
586 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
587
1006
e865f349aa41 ui cleanup
Gloval
parents: 972
diff changeset
588 //ChanceByTreasureLvl Summ - to calculate chance
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
589 memset(&uChanceByTreasureLvlSumm, 0, 24);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
590 for(i=0;i<6;++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
591 {
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
592 for (j=1;j<item_counter;++j)
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
593 uChanceByTreasureLvlSumm[i]+=pItems[j].uChanceByTreasureLvl[i];
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
594 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
595
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
596 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
597 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
598 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
599 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
600 strtok(NULL, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
601 for (i=0;i<3;++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
602 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
603 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
604 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
605 Assert(tokens.size() > 7, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
606 switch (i)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
607 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
608 case 0:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
609 uBonusChanceStandart[0]=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
610 uBonusChanceStandart[1]=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
611 uBonusChanceStandart[2]=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
612 uBonusChanceStandart[3]=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
613 uBonusChanceStandart[4]=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
614 uBonusChanceStandart[5]=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
615 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
616 case 1:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
617 uBonusChanceSpecial[0]=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
618 uBonusChanceSpecial[1]=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
619 uBonusChanceSpecial[2]=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
620 uBonusChanceSpecial[3]=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
621 uBonusChanceSpecial[4]=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
622 uBonusChanceSpecial[5]=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
623 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
624 case 2:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
625 uBonusChanceWpSpecial[0]=atoi(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
626 uBonusChanceWpSpecial[1]=atoi(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
627 uBonusChanceWpSpecial[2]=atoi(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
628 uBonusChanceWpSpecial[3]=atoi(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
629 uBonusChanceWpSpecial[4]=atoi(tokens[6]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
630 uBonusChanceWpSpecial[5]=atoi(tokens[7]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
631 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
632 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
633 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
634
705
e39702f35283 memory allocation partly reworked
zipi
parents: 598
diff changeset
635 if ( pRndItemsTXT_Raw )
e39702f35283 memory allocation partly reworked
zipi
parents: 598
diff changeset
636 {
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
637 free(pRndItemsTXT_Raw);
705
e39702f35283 memory allocation partly reworked
zipi
parents: 598
diff changeset
638 pRndItemsTXT_Raw = NULL;
e39702f35283 memory allocation partly reworked
zipi
parents: 598
diff changeset
639 }
e39702f35283 memory allocation partly reworked
zipi
parents: 598
diff changeset
640
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
641 pSkillDescTXT_Raw = NULL;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
642 pSkillDescTXT_Raw = (char *)pEvents_LOD->LoadRaw("skilldes.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
643 strtok(pSkillDescTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
644 for (i=0; i<37; ++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
645 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
646 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
647 auto tokens = Tokenize(test_string, '\t');
2261
236d8d7c7295 Fixing a bug in tokenization
Grumpy7
parents: 2260
diff changeset
648 Assert(tokens.size() >= 6, "Invalid number of tokens");
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
649 pSkillDesc[i] = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
650 pNormalSkillDesc[i] = RemoveQuotes(tokens[2]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
651 pExpertSkillDesc[i] = RemoveQuotes(tokens[3]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
652 pMasterSkillDesc[i] = RemoveQuotes(tokens[4]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
653 pGrandSkillDesc[i] = RemoveQuotes(tokens[5]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
654 }
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
655
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
656 pStatsTXT_Raw = 0;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
657 pStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("stats.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
658 strtok(pStatsTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
659 for (i=0; i<26; ++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
660 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
661 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
662 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
663 Assert(tokens.size() == 2, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
664 switch (i)
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
665 {
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
666 case 0:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
667 case 1:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
668 case 2:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
669 case 3:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
670 case 4:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
671 case 5:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
672 case 6:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
673 pAttributeDescriptions[i] = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
674 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
675 case 7:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
676 pHealthPointsAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
677 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
678 case 8:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
679 pArmourClassAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
680 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
681 case 9:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
682 pSpellPointsAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
683 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
684 case 10:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
685 pPlayerConditionAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
686 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
687 case 11:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
688 pFastSpellAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
689 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
690 case 12:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
691 pPlayerAgeAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
692 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
693 case 13:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
694 pPlayerLevelAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
695 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
696 case 14:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
697 pPlayerExperienceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
698 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
699 case 15:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
700 pAttackBonusAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
701 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
702 case 16:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
703 pAttackDamageAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
704 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
705 case 17:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
706 pMissleBonusAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
707 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
708 case 18:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
709 pMissleDamageAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
710 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
711 case 19:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
712 pFireResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
713 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
714 case 20:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
715 pAirResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
716 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
717 case 21:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
718 pWaterResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
719 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
720 case 22:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
721 pEarthResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
722 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
723 case 23:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
724 pMindResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
725 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
726 case 24:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
727 pBodyResistanceAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
728 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
729 case 25:
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
730 pSkillPointsAttributeDescription = RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
731 break;
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
732 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
733 }
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
734
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
735 pClassTXT_Raw = 0;
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
736 pClassTXT_Raw = (char *)pEvents_LOD->LoadRaw("class.txt", 0);
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
737 strtok(pClassTXT_Raw, "\r");
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
738 for (i=0; i<36; ++i)
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
739 {
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
740 test_string = strtok(NULL, "\r") + 1;
2260
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
741 auto tokens = Tokenize(test_string, '\t');
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
742 Assert(tokens.size() == 3, "Invalid number of tokens");
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
743 pClassDescriptions[i]=RemoveQuotes(tokens[1]);
eab43c3d7767 Using new tokenizer in Items.cpp initialize function
Grumpy7
parents: 2253
diff changeset
744 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
745
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
746
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
747
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
748 ItemGen::PopulateSpecialBonusMap();
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
749 ItemGen::PopulateArtifactBonusMap();
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
750 ItemGen::PopulateRegularBonusMap();
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
751
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
752
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
753 }
0
Ritor1
parents:
diff changeset
754
Ritor1
parents:
diff changeset
755 //----- (00456D17) --------------------------------------------------------
Ritor1
parents:
diff changeset
756 void ItemsTable::SetSpecialBonus(ItemGen *pItem)
Ritor1
parents:
diff changeset
757 {
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
758 if ( pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL )
0
Ritor1
parents:
diff changeset
759 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
760 pItem->uEnchantmentType = pItems[pItem->uItemID]._bonus_type;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
761 pItem->uSpecEnchantmentType = pItems[pItem->uItemID]._additional_value;
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
762 pItem->m_enchantmentStrength = pItems[pItem->uItemID]._bonus_strength;
0
Ritor1
parents:
diff changeset
763 }
Ritor1
parents:
diff changeset
764 }
Ritor1
parents:
diff changeset
765
Ritor1
parents:
diff changeset
766 //----- (00456D43) --------------------------------------------------------
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
767 bool ItemsTable::IsMaterialSpecial(ItemGen *pItem)
0
Ritor1
parents:
diff changeset
768 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
769 return this->pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL;
0
Ritor1
parents:
diff changeset
770 }
Ritor1
parents:
diff changeset
771
Ritor1
parents:
diff changeset
772 //----- (00456D5E) --------------------------------------------------------
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
773 bool ItemsTable::IsMaterialNonCommon(ItemGen *pItem)
0
Ritor1
parents:
diff changeset
774 {
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
775 return pItems[pItem->uItemID].uMaterial == MATERIAL_SPECIAL ||
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
776 pItems[pItem->uItemID].uMaterial == MATERIAL_RELIC ||
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
777 pItems[pItem->uItemID].uMaterial == MATERIAL_ARTEFACT;
0
Ritor1
parents:
diff changeset
778 }
Ritor1
parents:
diff changeset
779
Ritor1
parents:
diff changeset
780
Ritor1
parents:
diff changeset
781 //----- (00453B3C) --------------------------------------------------------
Ritor1
parents:
diff changeset
782 void ItemsTable::LoadPotions()
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
783 {
0
Ritor1
parents:
diff changeset
784
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
785 CHAR Text[90]; // [sp+Ch] [bp-6Ch]@26
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
786 char* test_string;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
787 unsigned int uRow;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
788 unsigned int uColumn;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
789 unsigned __int8 potion_value;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
790
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
791 if ( pPotionsTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
792 free(pPotionsTXT_Raw);
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
793 pPotionsTXT_Raw = NULL;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
794 pPotionsTXT_Raw = (char *)pEvents_LOD->LoadRaw("potion.txt", 0);
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
795 test_string = strtok(pPotionsTXT_Raw,"\t\r\n");
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
796 while ( 1 )
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
797 {
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
798 if ( !test_string )
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
799 {
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
800 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
801 return;
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
802 }
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
803 if ( !strcmp(test_string, "222") )
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
804 break;
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
805
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
806 test_string = strtok(NULL, "\t\r\n");
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
807 }
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
808 while ( 1 )
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
809 {
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
810 test_string = strtok(NULL, "\t\r\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
811
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
812 if ( !test_string )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
813 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
814 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
815 return;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
816 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
817 if ( !strcmp(test_string, "222") )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
818 break;
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
819 }
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
820
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
821 for (uRow = 0;uRow < 50; ++uRow)
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
822 {
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
823 int skip_count;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
824 for (skip_count = 0;skip_count < 6; ++skip_count)
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
825 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
826 if ( !strtok(NULL, "\r\t\n") )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
827 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
828 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
829 if ( skip_count != 6 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
830 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
831 for (uColumn = 0; uColumn < 50; ++uColumn)
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
832 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
833 test_string = strtok(NULL, "\r\t\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
834 if ( !test_string )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
835 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
836 potion_value = atoi(test_string);
233
0df4136b6aac store_line
Gloval
parents: 230
diff changeset
837 unsigned char c=*test_string;
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
838 if ( !potion_value )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
839 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
840 if ( tolower(c) == 'e' )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
841 potion_value = atoi(test_string + 1);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
842 else
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
843 potion_value = 0;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
844 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
845 this->potion_data[uRow][uColumn]=potion_value;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
846 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
847 if ( uColumn != 50 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
848 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
849 strtok(NULL, "\r\t\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
850 }
193
821fd955c379 fixed potion data parsing. Somehow 3d render was affected
Gloval
parents: 189
diff changeset
851
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
852 if ( uRow != 50 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
853 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
854 wsprintfA(Text, "Error Parsing Potion Table at Row: %d Column: %d", uRow, uColumn);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
855 MessageBoxA(0, Text, "Parsing Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
856 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
857 if ( pPotionsTXT_Raw )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
858 {
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
859 free(pPotionsTXT_Raw);
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
860 pPotionsTXT_Raw = 0;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
861 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
862 }
0
Ritor1
parents:
diff changeset
863
Ritor1
parents:
diff changeset
864 //----- (00453CE5) --------------------------------------------------------
Ritor1
parents:
diff changeset
865 void ItemsTable::LoadPotionNotes()
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
866 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
867
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
868 CHAR Text[90];
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
869 char* test_string;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
870 unsigned int uRow;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
871 unsigned int uColumn;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
872 unsigned __int8 potion_note;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
873
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
874 if ( pPotionNotesTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
875 free(pPotionNotesTXT_Raw);
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
876 pPotionNotesTXT_Raw = NULL;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
877 pPotionNotesTXT_Raw = (char *)pEvents_LOD->LoadRaw("potnotes.txt", 0);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
878 test_string = strtok(pPotionNotesTXT_Raw ,"\t\r\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
879 while ( 1 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
880 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
881 if ( !test_string )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
882 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
883 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
884 return;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
885 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
886 if ( !strcmp(test_string, "222") )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
887 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
888 test_string = strtok(NULL, "\t\r\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
889 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
890 while ( 1 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
891 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
892 test_string = strtok(NULL, "\t\r\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
893
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
894 if ( !test_string )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
895 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
896 MessageBoxA(0, "Error Pre-Parsing Potion Table", "Load Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
897 return;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
898 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
899 if ( !strcmp(test_string, "222") )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
900 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
901 }
0
Ritor1
parents:
diff changeset
902
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
903 for (uRow = 0;uRow < 50; ++uRow)
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
904 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
905 int skip_count;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
906 for (skip_count = 0;skip_count < 6; ++skip_count)
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
907 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
908 if ( !strtok(NULL, "\r\t\n") )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
909 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
910 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
911 if ( skip_count != 6 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
912 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
913 for (uColumn = 0; uColumn < 50; ++uColumn)
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
914 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
915 test_string = strtok(NULL, "\r\t\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
916 if ( !test_string )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
917 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
918 potion_note = atoi(test_string);
233
0df4136b6aac store_line
Gloval
parents: 230
diff changeset
919 unsigned char c=*test_string;
222
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
920 if ( !potion_note )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
921 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
922 if ( tolower(c) == 'e' )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
923 potion_note = atoi(test_string + 1);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
924 else
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
925 potion_note = 0;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
926 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
927 this->potion_note[uRow][uColumn]=potion_note;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
928 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
929 if ( uColumn != 50 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
930 break;
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
931 strtok(NULL, "\r\t\n");
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
932 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
933 if ( uRow != 50 )
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
934 {
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
935 wsprintfA(Text, "Error Parsing Potion Table at Row: %d Column: %d", uRow, uColumn);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
936 MessageBoxA(0, Text, "Parsing Error", MB_ICONHAND|MB_CANCELTRYCONTINUE);
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
937 }
8113753ed2ae more item init fixing
Gloval
parents: 193
diff changeset
938 }
0
Ritor1
parents:
diff changeset
939
Ritor1
parents:
diff changeset
940
Ritor1
parents:
diff changeset
941 //----- (00456442) --------------------------------------------------------
Ritor1
parents:
diff changeset
942 unsigned int ItemGen::GetValue()
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
943 {
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
944 unsigned int uBaseValue; // edi@1
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
945 unsigned int bonus;
0
Ritor1
parents:
diff changeset
946
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
947 uBaseValue = pItemsTable->pItems[this->uItemID].uValue;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
948 if ( this->uAttributes & ITEM_TEMP_BONUS || pItemsTable->IsMaterialNonCommon(this) )
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
949 return uBaseValue;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
950 if (uEnchantmentType )
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
951 return uBaseValue + 100 * m_enchantmentStrength;;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
952 if (uSpecEnchantmentType )
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
953 {
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
954 bonus = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType].iTreasureLevel;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
955 if ( bonus > 10 )
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
956 return uBaseValue + bonus;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
957 else
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
958 return uBaseValue * bonus;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
959 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
960 return uBaseValue;
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
961 }
0
Ritor1
parents:
diff changeset
962
Ritor1
parents:
diff changeset
963 //----- (00456499) --------------------------------------------------------
Ritor1
parents:
diff changeset
964 const char *ItemGen::GetDisplayName()
Ritor1
parents:
diff changeset
965 {
1567
9f8b3e904e14 Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents: 1545
diff changeset
966 if (IsIdentified())
366
85edec9da96b _4B910F_shop_interaction
Nomad
parents: 365
diff changeset
967 return GetIdentifiedName();
0
Ritor1
parents:
diff changeset
968 else
366
85edec9da96b _4B910F_shop_interaction
Nomad
parents: 365
diff changeset
969 return pItemsTable->pItems[uItemID].pUnidentifiedName;
0
Ritor1
parents:
diff changeset
970 }
Ritor1
parents:
diff changeset
971
Ritor1
parents:
diff changeset
972 //----- (004564B3) --------------------------------------------------------
Ritor1
parents:
diff changeset
973 const char *ItemGen::GetIdentifiedName()
Ritor1
parents:
diff changeset
974 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
975 unsigned __int8 equip_type;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
976 const char *player_name;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
977 const char *nameModificator;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
978 const char *format_str;
0
Ritor1
parents:
diff changeset
979
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
980 equip_type = GetItemEquipType();
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
981 if ( (equip_type == EQUIP_REAGENT) || (equip_type == EQUIP_POTION) || (equip_type == EQUIP_GOLD) )
0
Ritor1
parents:
diff changeset
982 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
983 sprintf(item__getname_buffer.data(), "%s", pItemsTable->pItems[uItemID].pName);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
984 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
985 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
986 sprintf(item__getname_buffer.data(), "%s", pItemsTable->pItems[uItemID].pName);
1358
61010a655c94 a few itemID changed to their enum values + added a few new ones
Grumpy7
parents: 1297
diff changeset
987 if ( uItemID == ITEM_LICH_JAR_FULL ) //Lich Jar
0
Ritor1
parents:
diff changeset
988 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
989 if ( (uHolderPlayer >0 )&& (uHolderPlayer <= 4) )
0
Ritor1
parents:
diff changeset
990 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
991 player_name = pPlayers[uHolderPlayer]->pName;
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
992 if ( player_name[strlen(player_name) - 1] == 's' )
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
993 format_str = pGlobalTXT_LocalizationStrings[655]; //"%s' Jar"
0
Ritor1
parents:
diff changeset
994 else
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
995 format_str = pGlobalTXT_LocalizationStrings[654]; //"%s's Jar"
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
996 sprintf(item__getname_buffer.data(), format_str, pPlayers[uHolderPlayer]->pName);
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
997 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
998 }
Ritor1
parents:
diff changeset
999 }
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1000 if ( !pItemsTable->IsMaterialNonCommon(this) )
0
Ritor1
parents:
diff changeset
1001 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1002 if ( uEnchantmentType )
0
Ritor1
parents:
diff changeset
1003 {
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1004 strcat(item__getname_buffer.data(), " ");
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1005 nameModificator = pItemsTable->pEnchantments[uEnchantmentType-1].pOfName;
0
Ritor1
parents:
diff changeset
1006 }
Ritor1
parents:
diff changeset
1007 else
Ritor1
parents:
diff changeset
1008 {
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1009 if ( !uSpecEnchantmentType )
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1010 return item__getname_buffer.data();
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1011 if ( uSpecEnchantmentType == 16 //Drain Hit Points from target.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1012 || uSpecEnchantmentType == 39 //Double damage vs Demons.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1013 || uSpecEnchantmentType == 40 //Double damage vs Dragons
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1014 || uSpecEnchantmentType == 45 //+5 Speed and Accuracy
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1015 || uSpecEnchantmentType == 56 //+5 Might and Endurance.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1016 || uSpecEnchantmentType == 57 //+5 Intellect and Personality.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1017 || uSpecEnchantmentType == 58 //Increased Value.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1018 || uSpecEnchantmentType == 60 //+3 Unarmed and Dodging skills
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1019 || uSpecEnchantmentType == 61 //+3 Stealing and Disarm skills.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1020 || uSpecEnchantmentType == 59 //Increased Weapon speed.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1021 || uSpecEnchantmentType == 63 //Double Damage vs. Elves.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1022 || uSpecEnchantmentType == 64 //Double Damage vs. Undead.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1023 || uSpecEnchantmentType == 67 //Adds 5 points of Body damage and +2 Disarm skill.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1024 || uSpecEnchantmentType == 68 ) //Adds 6-8 points of Cold damage and +5 Armor Class.
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1025 { //enchantment and name positions inverted!
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1026 sprintf( item__getname_buffer.data(), "%s %s",
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1027 pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd,
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1028 pItemsTable->pItems[uItemID].pName);
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1029 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
1030 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1031 strcat(item__getname_buffer.data(), " ");
377
243418228760 GetIdentifiedName
Gloval
parents: 375
diff changeset
1032 nameModificator = pItemsTable->pSpecialEnchantments[uSpecEnchantmentType-1].pNameAdd;
0
Ritor1
parents:
diff changeset
1033 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1034 strcat(item__getname_buffer.data(), nameModificator);
0
Ritor1
parents:
diff changeset
1035 }
1205
8c02e6f74b29 arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents: 1202
diff changeset
1036 return item__getname_buffer.data();
0
Ritor1
parents:
diff changeset
1037 }
Ritor1
parents:
diff changeset
1038
Ritor1
parents:
diff changeset
1039
Ritor1
parents:
diff changeset
1040 //----- (00456620) --------------------------------------------------------
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1041 void ItemsTable::GenerateItem(int treasure_level, unsigned int uTreasureType, ItemGen *out_item)
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1042 {
0
Ritor1
parents:
diff changeset
1043
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1044 ItemsTable *v5; // edi@1
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1045 int v6; // ebx@3
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1046 int *v7; // ecx@33
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1047 //int v8; // eax@34
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1048 //int v9; // eax@39
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1049 int current_chance; // ebx@43
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1050 int tmp_chance; // ecx@47
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1051 unsigned int *v12; // edx@48
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1052 unsigned int v13; // eax@49
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1053 signed int v14; // ebx@52
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1054 int v15; // eax@53
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1055 signed int v16; // eax@55
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1056 int v17; // ebx@57
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1057 int v18; // edx@62
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1058 signed int v19; // ebx@70
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1059 unsigned __int8 v20; // al@81
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1060 int v21; // eax@84
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1061 int v22; // ebx@85
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1062 int v23; // eax@86
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1063 int v24; // ebx@86
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1064 int special_chance; // edx@86
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1065 int v26; // edx@89
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1066 unsigned int v27; // eax@89
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1067 int i; // ebx@89
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1068 unsigned int v29; // ecx@90
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1069 int v30; // ebx@91
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1070 int v31; // eax@91
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1071 int v32; // ecx@91
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1072 int v33; // eax@91
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1073 int v34; // eax@97
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1074 unsigned __int8 v35; // sf@97
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1075 unsigned __int8 v36; // of@97
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1076 int v37; // ebx@98
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1077 int v38; // edx@99
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1078 signed int v39; // ebx@101
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1079 int v40; // ecx@102
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1080 char v41; // zf@107
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1081 char v42; // al@108
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1082 char v43; // al@111
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1083 int *v44; // edx@118
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1084 int v45; // eax@120
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1085 int v46; // edx@120
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1086 int j; // eax@121
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1087 unsigned int v48; // ecx@123
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1088 int v49; // eax@123
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1089 int v50; // eax@123
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1090 int val_list[800]; // [sp+Ch] [bp-C88h]@33
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1091 int total_chance; // [sp+C8Ch] [bp-8h]@33
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1092 int v53; // [sp+C90h] [bp-4h]@1
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1093 int v54; // [sp+C9Ch] [bp+8h]@3
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1094 //int v55; // [sp+CA0h] [bp+Ch]@34
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1095 signed int v56; // [sp+CA0h] [bp+Ch]@55
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1096 int v57; // [sp+CA0h] [bp+Ch]@62
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1097 int *v58; // [sp+CA0h] [bp+Ch]@102
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1098 int v59; // [sp+CA0h] [bp+Ch]@123
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1099 //signed int a2a; // [sp+CA4h] [bp+10h]@33
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1100 int a2b; // [sp+CA4h] [bp+10h]@101
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1101 int a2c; // [sp+CA4h] [bp+10h]@120
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1102
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1103 v5 = this;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1104 if (!out_item)
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1567
diff changeset
1105 out_item = (ItemGen *)malloc(sizeof(ItemGen));
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1106 memset(out_item, 0, sizeof(*out_item));
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1107
228
46ae2602aceb Item generation doesn't crash (thou still generates weird stuff)
Nomad
parents: 224
diff changeset
1108
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1109 v6 = treasure_level - 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1110 v54 = treasure_level - 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1111 if ( uTreasureType ) //generate known treasure type
0
Ritor1
parents:
diff changeset
1112 {
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1113 ITEM_EQUIP_TYPE requested_equip;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1114 PLAYER_SKILL_TYPE requested_skill = PLAYER_SKILL_INVALID;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1115 switch (uTreasureType)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1116 {
1989
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1933
diff changeset
1117 case 20: requested_equip = EQUIP_SINGLE_HANDED; break;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1118 case 21: requested_equip = EQUIP_ARMOUR; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1119 case 22: requested_skill = PLAYER_SKILL_MISC; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1120 case 23: requested_skill = PLAYER_SKILL_SWORD; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1121 case 24: requested_skill = PLAYER_SKILL_DAGGER; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1122 case 25: requested_skill = PLAYER_SKILL_AXE; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1123 case 26: requested_skill = PLAYER_SKILL_SPEAR; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1124 case 27: requested_skill = PLAYER_SKILL_BOW; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1125 case 28: requested_skill = PLAYER_SKILL_MACE; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1126 case 29: requested_skill = PLAYER_SKILL_CLUB; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1127 case 30: requested_skill = PLAYER_SKILL_STAFF; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1128 case 31: requested_skill = PLAYER_SKILL_LEATHER; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1129 case 32: requested_skill = PLAYER_SKILL_CHAIN; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1130 case 33: requested_skill = PLAYER_SKILL_PLATE; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1131 case 34: requested_equip = EQUIP_SHIELD; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1132 case 35: requested_equip = EQUIP_HELMET; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1133 case 36: requested_equip = EQUIP_BELT; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1134 case 37: requested_equip = EQUIP_CLOAK; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1135 case 38: requested_equip = EQUIP_GAUNTLETS; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1136 case 39: requested_equip = EQUIP_BOOTS; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1137 case 40: requested_equip = EQUIP_RING; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1138 case 41: requested_equip = EQUIP_AMULET; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1139 case 42: requested_equip = EQUIP_WAND; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1140 case 43: requested_equip = EQUIP_SPELL_SCROLL; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1141 case 44: requested_equip = EQUIP_POTION; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1142 case 45: requested_equip = EQUIP_REAGENT; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1143 case 46: requested_equip = EQUIP_GEM; break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1144 default:
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1145 __debugbreak(); // check this condition
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1146 requested_equip = (ITEM_EQUIP_TYPE)(uTreasureType - 1);
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1147 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1148 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1149 memset(val_list, 0, sizeof(val_list));
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1150 total_chance = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1151 j=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1152 //a2a = 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1153 if (requested_skill == PLAYER_SKILL_INVALID) // no skill for this item needed
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1154 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1155 for (uint i = 1; i < 500; ++i)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1156 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1157 if (pItems[i].uEquipType == requested_equip)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1158 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1159 val_list[j] = i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1160 ++j;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1161 total_chance += pItems[i].uChanceByTreasureLvl[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1162 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1163 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1164 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1165 else //have needed skill
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1166 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1167 for (uint i = 1; i < 500; ++i)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1168 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1169 if (pItems[i].uSkillType == requested_skill)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1170 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1171 val_list[j] = i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1172 ++j;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1173 total_chance += pItems[i].uChanceByTreasureLvl[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1174 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1175 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1176 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1177
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1178 current_chance = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1179 if ( total_chance )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1180 current_chance = rand() % total_chance;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1181
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1182 out_item->uItemID = val_list[0];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1183 if (!out_item->uItemID)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1184 out_item->uItemID = 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1185
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1186 if ( pItems[out_item->uItemID].uChanceByTreasureLvl[treasure_level - 1] < current_chance )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1187 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1188 j=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1189 tmp_chance=pItems[out_item->uItemID].uChanceByTreasureLvl[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1190 do
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1191 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1192 ++j;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1193 out_item->uItemID = val_list[j];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1194 tmp_chance += pItems[val_list[j]].uChanceByTreasureLvl[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1195 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1196 while ( tmp_chance < current_chance );
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1197 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1198
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1199 if (out_item->GetItemEquipType() == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1200 {// if it potion set potion spec
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1201 out_item->uEnchantmentType = 0;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1202 for (int i=0; i<2; ++i)
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1203 out_item->uEnchantmentType += rand() % 4 + 1;
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1204 out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1205 }
0
Ritor1
parents:
diff changeset
1206 }
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1207 else
0
Ritor1
parents:
diff changeset
1208 {
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1209 //artifact
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1210 v56 = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1211 for(int i=0; i<29; ++i)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1212 v56 += pParty->pIsArtifactFound[i];
228
46ae2602aceb Item generation doesn't crash (thou still generates weird stuff)
Nomad
parents: 224
diff changeset
1213
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1214 v17 = rand() % 29;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1215
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1216 if ( v6 == 5 && (rand() % 100 < 5) && !pParty->pIsArtifactFound[v17] && v56 < 13 )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1217 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1218 pParty->pIsArtifactFound[v17] = 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1219 out_item->uAttributes = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1220 out_item->uItemID = v17 + 500;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1221 SetSpecialBonus(out_item);
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1222 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1223 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1224
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1225 v57 = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1226 v18 = rand() % v5->uChanceByTreasureLvlSumm[treasure_level - 1];
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1227 out_item->uItemID = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1228 if ( v18 > 0 )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1229 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1230 do
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1231 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1232 v57 += pItems[out_item->uItemID + 1].uChanceByTreasureLvl[v6];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1233 ++out_item->uItemID;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
1234 }
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1235 while ( v57 < v18 );
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1236 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1237
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1238 if ( !v18 )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1239 out_item->uItemID = 1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1240 if ( !out_item->uItemID )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1241 out_item->uItemID = 1;
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1242 if (out_item->GetItemEquipType() == EQUIP_POTION && out_item->uItemID != ITEM_POTION_BOTTLE )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1243 {// if it potion set potion spec
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1244 out_item->uEnchantmentType = 0;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1245 for (int i=0; i<2; ++i)
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1246 out_item->uEnchantmentType += rand() % 4 + 1;
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1247 out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1248 }
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1249 out_item->uEnchantmentType = out_item->uEnchantmentType * treasure_level;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1250 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1251
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1252 if ( out_item->uItemID == ITEM_SPELLBOOK_LIGHT_DIVINE_INTERVENTION
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1253 && !(unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 239) )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1254 out_item->uItemID = ITEM_SPELLBOOK_LIGHT_SUN_BURST;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1255 if ( pItemsTable->pItems[out_item->uItemID + 1].uItemID_Rep_St )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1256 out_item->uAttributes = 0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1257 else
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1258 out_item->uAttributes = 1;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1259
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1260 if ( out_item->GetItemEquipType() != EQUIP_POTION )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1261 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1262 out_item->uSpecEnchantmentType = 0;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1263 out_item->uEnchantmentType = 0;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1264 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1265 //try get special enhansment
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1266 switch (out_item->GetItemEquipType())
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1267 {
1989
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1933
diff changeset
1268 case EQUIP_SINGLE_HANDED:
33787c8938a5 Single and Two-handed ENUM
zipi
parents: 1933
diff changeset
1269 case EQUIP_TWO_HANDED :
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1270 case EQUIP_BOW :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1271 if ( !uBonusChanceWpSpecial[v6] )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1272 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1273 if ((rand() % 100)>=uBonusChanceWpSpecial[v6])
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1274 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1275 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1276 case EQUIP_ARMOUR :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1277 case EQUIP_SHIELD :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1278 case EQUIP_HELMET :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1279 case EQUIP_BELT :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1280 case EQUIP_CLOAK :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1281 case EQUIP_GAUNTLETS :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1282 case EQUIP_BOOTS :
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1283 case EQUIP_RING :
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1284
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1285 if ( !uBonusChanceStandart[v6] )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1286 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1287 special_chance = rand() % 100;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1288 if ( special_chance < uBonusChanceStandart[v6])
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1289 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1290 v26 = rand() %pEnchantmentsSumm[out_item->GetItemEquipType()-3];
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1291 out_item->uEnchantmentType = 0;
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1292 v27=pEnchantments[out_item->uEnchantmentType].to_item[out_item->GetItemEquipType()-3];
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1293 if (v26>v27 )
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1294 {
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1295 do
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1296 {
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1297 ++out_item->uEnchantmentType;
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1298 v27+=pEnchantments[out_item->uEnchantmentType].to_item[out_item->GetItemEquipType()-3];
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1299 } while (v26>v27);
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1300 }
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1301 ++out_item->uEnchantmentType;
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1302
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1303 v33 = rand() % (bonus_ranges[v6].maxR - bonus_ranges[v6].minR + 1);
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1304 out_item->m_enchantmentStrength = v33 + bonus_ranges[v6].minR;
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1305 v32 = out_item->uEnchantmentType - 1;
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1306 if ( v32 == 21 || v32 == 22 || v32 == 23 ) //Armsmaster skill, Dodge skill, Unarmed skill
1599
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1307 out_item->m_enchantmentStrength = out_item->m_enchantmentStrength/2;
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1308 if ( out_item->m_enchantmentStrength <= 0 )
bb2378f58767 Player::GetItemsBonus removed majority of labels
Grumpy7
parents: 1567
diff changeset
1309 out_item->m_enchantmentStrength = 1;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1310 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1311
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1312 }
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1313 if ( !uBonusChanceSpecial[v6])
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1314 return;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1315 v34 = uBonusChanceStandart[v6] + uBonusChanceSpecial[v6];
570
f54481c85df8 itemgen working, i hope
Gloval
parents: 559
diff changeset
1316 if ( special_chance>v34 )
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1317 return;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1318 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1319 case EQUIP_WAND:
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1320 out_item->uNumCharges = rand() % 6 + out_item->GetDamageMod() + 1;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1321 out_item->uMaxCharges = out_item->uNumCharges;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1322 default:
224
9917d3b4925e items init refactored
Gloval
parents: 223
diff changeset
1323 return;
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1324 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1325
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1326 j=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1327 int spc_sum=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1328 int spc;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1329 memset(&val_list, 0, 3200);
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1330 for (int i=0; i<pSpecialEnchantments_count;++i)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1331 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1332 int tr_lv= pSpecialEnchantments[i].iTreasureLevel;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1333 switch ( treasure_level - 1 )
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1334 {
0
Ritor1
parents:
diff changeset
1335 case 2:
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1336 if ((tr_lv==1)||(tr_lv==0))
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1337 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1338 spc=pSpecialEnchantments[i].to_item_apply[out_item->GetItemEquipType()];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1339 spc_sum+=spc;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1340 if(spc)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1341 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1342 val_list[j++]=i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1343 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1344 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1345 break;
0
Ritor1
parents:
diff changeset
1346 case 3:
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1347 if ((tr_lv==2)||(tr_lv==1)||(tr_lv==0))
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1348 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1349 spc=pSpecialEnchantments[i].to_item_apply[out_item->GetItemEquipType()];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1350 spc_sum+=spc;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1351 if(spc)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1352 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1353 val_list[j++]=i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1354 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1355 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1356 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1357 case 4:
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1358 if ((tr_lv==3)||(tr_lv==2)||(tr_lv==1))
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1359 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1360 spc=pSpecialEnchantments[i].to_item_apply[out_item->GetItemEquipType()];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1361 spc_sum+=spc;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1362 if(spc)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1363 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1364 val_list[j++]=i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1365 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1366 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1367 break;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1368 case 5:
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1369 if (tr_lv==3)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1370 {
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1371 spc=pSpecialEnchantments[i].to_item_apply[out_item->GetItemEquipType()];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1372 spc_sum+=spc;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1373 if(spc)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1374 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1375 val_list[j++]=i;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1376 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1377 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1378 break;
0
Ritor1
parents:
diff changeset
1379 }
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1380 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1381
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1382 v46 = rand()%spc_sum+1;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1383 j=0;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1384 out_item->uSpecEnchantmentType =val_list[j];
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1385 v45=pSpecialEnchantments[val_list[j]].to_item_apply[out_item->GetItemEquipType()];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1386 if (v45<v46)
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1387 {
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1388 do
245
f070b49d40dd goto cleaning
zipi
parents: 243
diff changeset
1389 {
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1390 ++j;
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1391 out_item->uSpecEnchantmentType=val_list[j];
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1392 v45+=pSpecialEnchantments[val_list[j]].to_item_apply[out_item->GetItemEquipType()];
559
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1393 } while (v45<v46);
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1394 }
09108e73f2f4 item gen fixes (not full)
Gloval
parents: 526
diff changeset
1395 ++out_item->uSpecEnchantmentType;
0
Ritor1
parents:
diff changeset
1396 }
Ritor1
parents:
diff changeset
1397
Ritor1
parents:
diff changeset
1398 //----- (004505CC) --------------------------------------------------------
Ritor1
parents:
diff changeset
1399 bool ItemGen::GenerateArtifact()
Ritor1
parents:
diff changeset
1400 {
Ritor1
parents:
diff changeset
1401 signed int uNumArtifactsNotFound; // esi@1
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1402 int artifacts_list[32];
0
Ritor1
parents:
diff changeset
1403
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1404 memset(artifacts_list, 0,sizeof(artifacts_list));
0
Ritor1
parents:
diff changeset
1405 uNumArtifactsNotFound = 0;
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1406
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1407 for (int i=500;i<529;++i)
484
4bd56919f075 avard quest guild bits
Gloval
parents: 475
diff changeset
1408 if ( !pParty->pIsArtifactFound[i-500] )
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1409 artifacts_list[uNumArtifactsNotFound++] = i;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1410
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1411 Reset();
0
Ritor1
parents:
diff changeset
1412 if ( uNumArtifactsNotFound )
Ritor1
parents:
diff changeset
1413 {
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1414 uItemID = artifacts_list[rand() % uNumArtifactsNotFound];
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1415 pItemsTable->SetSpecialBonus(this);
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1416 return true;
0
Ritor1
parents:
diff changeset
1417 }
Ritor1
parents:
diff changeset
1418 else
385
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1419 return false;
b509ef97807a additional dmg
Gloval
parents: 377
diff changeset
1420
0
Ritor1
parents:
diff changeset
1421 }
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1422
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1423 std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* >ItemGen::regularBonusMap;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1424 std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* >ItemGen::specialBonusMap;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1425 std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* >ItemGen::artifactBonusMap;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1426
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1427 #define NEWBONUSINTOSPECIALLIST(x,y) AddToMap(ItemGen::specialBonusMap, enchId, x, y);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1428 #define NEWBONUSINTOSPECIALLIST2(x,y,z) AddToMap(ItemGen::specialBonusMap, enchId, x, y, z);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1429
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1430 #define NEWBONUSINTOREGULARLIST(x) AddToMap(ItemGen::regularBonusMap, enchId, x);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1431
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1432 #define NEWBONUSINTOARTIFACTLIST(x,y) AddToMap(ItemGen::artifactBonusMap, itemId, x, y);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1433 #define NEWBONUSINTOARTIFACTLIST2(x,y,z) AddToMap(ItemGen::artifactBonusMap, itemId, x, y, z);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1434
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1435 void ItemGen::AddToMap( std::map<int, std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* > &maptoadd, int enchId, CHARACTER_ATTRIBUTE_TYPE attrId, int bonusValue /*= 0*/, unsigned __int16 Player::* skillPtr /*= NULL*/ )
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1436 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1437 auto key = maptoadd.find(enchId);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1438 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currMap;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1439 if (key == maptoadd.end())
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1440 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1441 currMap = new std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1442 maptoadd[enchId] = currMap;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1443 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1444 else
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1445 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1446 currMap = key->second;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1447 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1448 Assert(currMap->find(attrId) == currMap->end(), "Attribute %d already present for enchantment %d", attrId, enchId);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1449 (*currMap)[attrId] = new CEnchantment(bonusValue, skillPtr);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1450 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1451
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1452 void ItemGen::PopulateSpecialBonusMap()
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1453 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1454 int enchId = 1;// of Protection, +10 to all Resistances
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1455 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1456 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_AIR, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1457 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_WATER, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1458 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_EARTH, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1459 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_MIND, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1460 NEWBONUSINTOSPECIALLIST( CHARACTER_ATTRIBUTE_RESIST_BODY, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1461
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1462 enchId = 2;//of The Gods, +10 to all Seven Statistics
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1463 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1464 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1465 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1466 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1467 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1468 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1469 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1470
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1471 enchId = 26;//of Air Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1472 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_AIR,0, &Player::skillAir);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1473
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1474 enchId = 27;//of Body Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1475 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_BODY,0, &Player::skillBody);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1476
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1477 enchId = 28;//of Dark Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1478 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_DARK,0, &Player::skillDark);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1479
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1480 enchId = 29;//of Earth Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1481 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_EARTH,0, &Player::skillEarth);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1482
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1483 enchId = 30;//of Fire Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1484 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_FIRE,0, &Player::skillFire);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1485
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1486 enchId = 31;//of Light Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1487 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_LIGHT,0, &Player::skillLight);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1488
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1489 enchId = 32;//of Mind Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1490 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_MIND,0, &Player::skillMind);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1491
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1492 enchId = 33;//of Spirit Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1493 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_SPIRIT,0, &Player::skillSpirit);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1494
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1495 enchId = 34;//of Water Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1496 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_WATER,0, &Player::skillWater);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1497
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1498 enchId = 42;//of Doom
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1499 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1500 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1501 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1502 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1503 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1504 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1505 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1506 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_HEALTH, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1507 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_MANA, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1508 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1509 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1510 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1511 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1512 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1513 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_MIND, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1514 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_BODY, 1);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1515
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1516 enchId = 43;//of Earth
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1517 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1518 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1519 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_HEALTH, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1520
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1521 enchId = 44;//of Life
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1522 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_HEALTH, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1523
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1524 enchId = 45;//Rogues
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1525 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1526 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1527
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1528 enchId = 46;//of The Dragon
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1529 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 25);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1530
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1531 enchId = 47;//of The Eclipse
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1532 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_MANA, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1533
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1534 enchId = 48;//of The Golem
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1535 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1536 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1537
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1538 enchId = 49;//of The Moon
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1539 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1540 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1541
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1542 enchId = 50;//of The Phoenix
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1543 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 30);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1544
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1545 enchId = 51;//of The Sky
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1546 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_MANA, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1547 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_SPEED, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1548 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1549
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1550 enchId = 52;//of The Stars
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1551 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1552 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ACCURACY, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1553
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1554 enchId = 53;//of The Sun
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1555 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1556 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1557
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1558 enchId = 54;//of The Troll
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1559 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1560
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1561 enchId = 55;//of The Unicorn
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1562 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_LUCK, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1563
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1564 enchId = 56;//Warriors
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1565 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_STRENGTH, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1566 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1567
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1568 enchId = 57;//Wizards
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1569 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1570 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1571
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1572 enchId = 60;//Monks'
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1573 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_DODGE, 3, &Player::skillDodge);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1574 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_UNARMED, 3, &Player::skillUnarmed);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1575
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1576 enchId = 61;//Thieves'
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1577 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 3, &Player::skillStealing);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1578 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_STEALING, 3, &Player::skillDisarmTrap);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1579
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1580 enchId = 62;//of Identifying
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1581 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID, 3, &Player::skillItemId);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1582 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID, 3, &Player::skillMonsterId);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1583
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1584 enchId = 67;//Assassins'
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1585 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 2, &Player::skillDisarmTrap);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1586
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1587 enchId = 68;//Barbarians'
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1588 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_AC_BONUS, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1589
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1590 enchId = 69;//of the Storm
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1591 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, 20);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1592
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1593 enchId = 70;//of the Ocean
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1594 NEWBONUSINTOSPECIALLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1595 NEWBONUSINTOSPECIALLIST2(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY, 2, &Player::skillAlchemy);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1596 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1597
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1598 void ItemGen::PopulateRegularBonusMap()
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1599 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1600 int enchId = 1;//of Might
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1601 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_STRENGTH);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1602
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1603 enchId = 2;//of Thought
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1604 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1605
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1606 enchId = 3;//of Charm
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1607 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_WILLPOWER);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1608
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1609 enchId = 4;//of Vigor
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1610 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_ENDURANCE);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1611
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1612 enchId = 5;//of Precision
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1613 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_ACCURACY);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1614
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1615 enchId = 6;//of Speed
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1616 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SPEED);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1617
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1618 enchId = 7;//of Luck
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1619 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_LUCK);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1620
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1621 enchId = 8;//of Health
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1622 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_HEALTH);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1623
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1624 enchId = 9;//of Magic
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1625 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_MANA);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1626
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1627 enchId = 10;//of Defense
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1628 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_AC_BONUS);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1629
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1630 enchId = 11;//of Fire Resistance
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1631 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1632
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1633 enchId = 12;//of Air Resistance
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1634 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_AIR);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1635
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1636 enchId = 13;//of Water Resistance
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1637 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_WATER);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1638
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1639 enchId = 14;//of Earth Resistance
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1640 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1641
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1642 enchId = 15;//of Mind Resistance
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1643 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_MIND);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1644
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1645 enchId = 16;//of Body Resistance
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1646 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_RESIST_BODY);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1647
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1648 enchId = 17;//of Alchemy
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1649 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1650
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1651 enchId = 18;//of Stealing
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1652 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_STEALING);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1653
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1654 enchId = 19;//of Disarming
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1655 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1656
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1657 enchId = 20;//of Items
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1658 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1659
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1660 enchId = 21;//of Monsters
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1661 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1662
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1663 enchId = 22;//of Arms
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1664 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1665
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1666 enchId = 23;//of Dodging
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1667 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_DODGE);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1668
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1669 enchId = 24;//of the Fist
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1670 NEWBONUSINTOREGULARLIST(CHARACTER_ATTRIBUTE_SKILL_UNARMED);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1671 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1672
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1673 void ItemGen::PopulateArtifactBonusMap()
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1674 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1675 int itemId;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1676 itemId = ITEM_ARTIFACT_PUCK;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1677 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1678
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1679 itemId = ITEM_ARTIFACT_IRON_FEATHER;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1680 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1681
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1682 itemId = ITEM_ARTIFACT_WALLACE;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1683 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1684 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1685
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1686 itemId = ITEM_ARTIFACT_CORSAIR;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1687 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_LUCK, 40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1688 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1689 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_STEALING, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1690
1648
a4390cef284c DamagePlayerFromMonster starting cleanup
Grumpy7
parents: 1604
diff changeset
1691 itemId = ITEM_ARTIFACT_GOVERNORS_ARMOR;
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1692 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1693 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1694 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1695 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1696 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ACCURACY, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1697 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1698 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_LUCK, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1699
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1700 itemId = ITEM_ARTIFACT_YORUBA;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1701 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 25);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1702
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1703 itemId = ITEM_ARTIFACT_SPLITTER;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1704 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1705
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1706 itemId = ITEM_ARTEFACT_ULLYSES,
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1707 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ACCURACY, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1708
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1709 itemId = ITEM_ARTEFACT_HANDS_OF_THE_MASTER,
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1710 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_DODGE, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1711 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_UNARMED, 10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1712
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1713 itemId = ITEM_ARTIFACT_LEAGUE_BOOTS;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1714 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, 40);
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1715 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_WATER, 0, &Player::skillWater);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1716
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1717 itemId = ITEM_ARTIFACT_RULERS_RING;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1718 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_MIND, 0, &Player::skillMind);
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1719 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_DARK, 0, &Player::skillDark);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1720
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1721 itemId = ITEM_RELIC_MASH;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1722 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 150);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1723 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, -40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1724 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, -40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1725 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, -40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1726
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1727 itemId = ITEM_RELIC_ETHRICS_STAFF;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1728 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_DARK, 0, &Player::skillDark);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1729 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_MEDITATION, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1730
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1731 itemId = ITEM_RELIC_HARECS_LEATHER;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1732 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1733 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_STEALING, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1734 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_LUCK, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1735 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1736 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1737 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1738 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1739 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_MIND, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1740 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_BODY, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1741
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1742 itemId = ITEM_RELIC_OLD_NICK;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1743 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1744
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1745 itemId = ITEM_RELIC_AMUCK;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1746 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 100);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1747 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 100);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1748 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_AC_BONUS, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1749
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1750 itemId = ITEM_RELIC_GLORY_SHIELD;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1751 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_SPIRIT, 0, &Player::skillSpirit);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1752 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_SHIELD, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1753 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_MIND, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1754 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_BODY, -10);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1755
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1756 itemId = ITEM_RELIC_KELEBRIM;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1757 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1758 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH, -30);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1759
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1760 itemId = ITEM_RELIC_TALEDONS_HELM;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1761 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_LIGHT, 0, &Player::skillLight);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1762 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1763 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1764 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_LUCK, -40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1765
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1766 itemId = ITEM_RELIC_SCHOLARS_CAP;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1767 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_LEARNING, +15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1768 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ENDURANCE, -50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1769
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1770 itemId = ITEM_RELIC_PHYNAXIAN_CROWN;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1771 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_FIRE, 0, &Player::skillFire);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1772 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, +50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1773 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 30);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1774 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_AC_BONUS, -20);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1775
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1776 itemId = ITEM_RILIC_TITANS_BELT;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1777 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 75);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1778 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, -40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1779
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1780 itemId = ITEM_RELIC_TWILIGHT;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1781 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1782 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_LUCK, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1783 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1784 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_WATER, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1785 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1786 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_EARTH, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1787 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_MIND, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1788 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_BODY, -15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1789
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1790 itemId = ITEM_RELIC_ANIA_SELVING;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1791 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ACCURACY, 150);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1792 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_BOW, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1793 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_AC_BONUS, -25);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1794
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1795 itemId = ITEM_RELIC_JUSTICE;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1796 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_MIND, 0, &Player::skillMind);
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1797 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_BODY, 0, &Player::skillBody);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1798 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, -40);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1799
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1800 itemId = ITEM_RELIC_MEKORIGS_HAMMER;
1826
bdac32c645c5 Changing arrays in class Player to std::array
Grumpy7
parents: 1709
diff changeset
1801 NEWBONUSINTOARTIFACTLIST2(CHARACTER_ATTRIBUTE_SKILL_SPIRIT, 0, &Player::skillSpirit);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1802 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 75);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1803 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, -50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1804
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1805 itemId = ITEM_ARTIFACT_HERMES_SANDALS;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1806 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, 100);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1807 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ACCURACY, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1808 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_AIR, 50);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1809
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1810 itemId = ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1811 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, -20);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1812 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, -20);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1813
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1814 itemId = ITEM_ARTIFACT_MINDS_EYE;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1815 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_WILLPOWER, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1816 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_INTELLIGENCE, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1817
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1818 itemId = ITEM_ELVEN_CHAINMAIL;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1819 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SPEED, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1820 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ACCURACY, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1821
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1822 itemId = ITEM_FORGE_GAUNTLETS;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1823 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1824 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_ENDURANCE, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1825 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_RESIST_FIRE, 30);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1826
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1827 itemId = ITEM_ARTIFACT_HEROS_BELT;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1828 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_STRENGTH, 15);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1829 NEWBONUSINTOARTIFACTLIST(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER, 5);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1830 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1831
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1832 void ItemGen::GetItemBonusSpecialEnchantment( Player* owner, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* additiveBonus, int* halfSkillBonus )
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1833 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1834 auto bonusList = ItemGen::specialBonusMap.find(this->uSpecEnchantmentType);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1835 if (bonusList == ItemGen::specialBonusMap.end())
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1836 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1837 return;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1838 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1839 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currList = bonusList->second;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1840 if (currList->find(attrToGet) != currList->end())
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1841 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1842 CEnchantment* currBonus = (*currList)[attrToGet];
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1843 if (currBonus->statPtr != NULL)
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1844 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1845 if (currBonus->statBonus == 0)
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1846 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1847 *halfSkillBonus = owner->*currBonus->statPtr / 2;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1848 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1849 else
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1850 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1851 if (*additiveBonus < currBonus->statBonus)
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1852 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1853 *additiveBonus = currBonus->statBonus;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1854 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1855 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1856 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1857 else
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1858 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1859 *additiveBonus += currBonus->statBonus;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1860 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1861 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1862 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1863
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1864 void ItemGen::GetItemBonusArtifact( Player* owner, CHARACTER_ATTRIBUTE_TYPE attrToGet, int* bonusSum )
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1865 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1866 auto bonusList = ItemGen::artifactBonusMap.find(this->uItemID);
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1867 if (bonusList == ItemGen::artifactBonusMap.end())
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1868 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1869 return;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1870 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1871 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currList = bonusList->second;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1872 if (currList->find(attrToGet) != currList->end())
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1873 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1874 CEnchantment* currBonus = (*currList)[attrToGet];
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1875 if (currBonus->statPtr != NULL)
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1876 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1877 *bonusSum = owner->*currBonus->statPtr / 2;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1878 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1879 else
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1880 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1881 *bonusSum += currBonus->statBonus;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1882 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1883 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1884 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1885
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1886 bool ItemGen::IsRegularEnchanmentForAttribute( CHARACTER_ATTRIBUTE_TYPE attrToGet )
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1887 {
1685
2a309997c42f Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents: 1682
diff changeset
1888 auto bonusList = ItemGen::specialBonusMap.find(this->uEnchantmentType);
1604
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1889 if (bonusList == ItemGen::specialBonusMap.end())
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1890 {
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1891 return false;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1892 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1893 std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currList = bonusList->second;
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1894 return (currList->find(attrToGet) != currList->end());
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1895 }
4b79ff62df3a Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents: 1603
diff changeset
1896
1709
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1897 ITEM_EQUIP_TYPE ItemGen::GetItemEquipType()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1898 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1899 return pItemsTable->pItems[this->uItemID].uEquipType;
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1900 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1901
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1902 unsigned char ItemGen::GetPlayerSkillType()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1903 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1904 return pItemsTable->pItems[this->uItemID].uSkillType;
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1905 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1906
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1907 char* ItemGen::GetIconName()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1908 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1909 return pItemsTable->pItems[this->uItemID].pIconName;
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1910 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1911
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1912 unsigned __int8 ItemGen::GetDamageDice()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1913 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1914 return pItemsTable->pItems[this->uItemID].uDamageDice;
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1915 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1916
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1917 unsigned __int8 ItemGen::GetDamageRoll()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1918 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1919 return pItemsTable->pItems[this->uItemID].uDamageRoll;
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1920 }
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1921
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1922 unsigned __int8 ItemGen::GetDamageMod()
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1923 {
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1924 return pItemsTable->pItems[this->uItemID].uDamageMod;
8251e59fd7c1 ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents: 1685
diff changeset
1925 }
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
1926 //----- (004B8E3D) --------------------------------------------------------
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1927 void GenerateStandartShopItems()
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1928 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1929 signed int item_count;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1930 signed int shop_index;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1931 int treasure_lvl;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1932 int item_class;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1933 int mdf;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1934
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1935 shop_index = (signed int)window_SpeakInHouse->ptr_1C;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1936 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1937 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1938 for (item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1939 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1940 if (shop_index <= 14) //weapon shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1941 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1942 treasure_lvl = shopWeap_variation_ord[shop_index].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1943 item_class = shopWeap_variation_ord[shop_index].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1944 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1945 else if (shop_index <= 28) //armor shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1946 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1947 mdf = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1948 if (item_count > 3)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1949 ++mdf;// rechek offsets
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1950 treasure_lvl = shopArmr_variation_ord[2*(shop_index - 15) + mdf].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1951 item_class = shopArmr_variation_ord[2*(shop_index - 15) + mdf].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1952 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1953 else if (shop_index <= 41) //magic shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1954 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1955 treasure_lvl = shopMagic_treasure_lvl[shop_index - 28];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1956 item_class = 22; //misc
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1957 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1958 else if (shop_index <= 53) //alchemist shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1959 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1960 if (item_count < 6)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1961 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1962 pParty->StandartItemsInShops[shop_index][item_count].Reset();
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1963 pParty->StandartItemsInShops[shop_index][item_count].uItemID = 220; //potion bottle
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1964 continue;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1965 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1966 else
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1967 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1968 treasure_lvl = shopAlch_treasure_lvl[shop_index - 41];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1969 item_class = 45; //reagent
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1970 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1971 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1972 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->StandartItemsInShops[shop_index][item_count]);
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1973 pParty->StandartItemsInShops[shop_index][item_count].SetIdentified(); //identified
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1974 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1975 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1976 pParty->InTheShopFlags[shop_index] = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1977 }
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1978
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1979 //----- (004B8F94) --------------------------------------------------------
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1980 void GenerateSpecialShopItems()
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1981 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1982 signed int item_count;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1983 signed int shop_index;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1984 int treasure_lvl;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1985 int item_class;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1986 int mdf;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
1987
1920
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1988 shop_index = (signed int)window_SpeakInHouse->ptr_1C;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1989 if ( uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType] )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1990 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1991 for ( item_count = 0; item_count < uItemsAmountPerShopType[p2DEvents[shop_index - 1].uType]; ++item_count )
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1992 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1993 if (shop_index <= 14) //weapon shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1994 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1995 treasure_lvl = shopWeap_variation_spc[shop_index].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1996 item_class = shopWeap_variation_spc[shop_index].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1997 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1998 else if (shop_index <= 28) //armor shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
1999 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2000 mdf = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2001 if (item_count > 3)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2002 ++mdf;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2003 treasure_lvl = shopArmr_variation_spc[2*(shop_index - 15) + mdf].treasure_level;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2004 item_class = shopArmr_variation_spc[2*(shop_index - 15) + mdf].item_class[rand() % 4];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2005 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2006 else if (shop_index <= 41) //magic shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2007 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2008 treasure_lvl = shopMagicSpc_treasure_lvl[shop_index - 28];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2009 item_class = 22; //misc
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2010 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2011 else if (shop_index <= 53) //alchemist shop
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2012 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2013 if (item_count < 6)
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2014 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2015 pParty->SpecialItemsInShops[shop_index][item_count].Reset();
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2016 pParty->SpecialItemsInShops[shop_index][item_count].uItemID = rand() % 32 + 740; //mscrool
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2017 continue;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2018 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2019 else
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2020 {
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2021 treasure_lvl = shopAlchSpc_treasure_lvl[shop_index - 41];
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2022 item_class = 44; //potion
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2023 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2024 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2025 pItemsTable->GenerateItem(treasure_lvl, item_class, &pParty->SpecialItemsInShops[shop_index][item_count]);
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2026 pParty->SpecialItemsInShops[shop_index][item_count].SetIdentified(); //identified
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2027 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2028 }
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2029 pParty->InTheShopFlags[shop_index] = 0;
05b433b8cb37 GuildDialog fix and cleared
Ritor1
parents: 1898
diff changeset
2030 }
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2031
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2032
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2033 //----- (00450218) --------------------------------------------------------
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2034 void GenerateItemsInChest()
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
2035 {
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2036 unsigned int v0; // eax@1
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2037 Chest *v1; // ebx@1
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2038 MapInfo *v2; // esi@1
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2039 ItemGen *v3; // ebx@2
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2040 int v4; // ebp@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2041 int v5; // edi@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2042 int v6; // esi@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2043 int v7; // eax@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2044 signed int v8; // esi@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2045 int v9; // edx@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2046 int v10; // esi@8
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2047 int v11; // ebp@25
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2048 int v12; // esi@25
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2049 signed int v13; // ebp@27
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2050 ItemGen *v14; // edi@28
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2051 signed int v15; // edx@32
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2052 signed __int64 v16; // qtt@32
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2053 int v17; // esi@34
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2054 signed int v18; // [sp+10h] [bp-18h]@1
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2055 int v19; // [sp+14h] [bp-14h]@4
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2056 MapInfo *v20; // [sp+18h] [bp-10h]@1
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2057 Chest *v21; // [sp+1Ch] [bp-Ch]@1
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2058 int v22; // [sp+20h] [bp-8h]@26
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2059 signed int v23; // [sp+24h] [bp-4h]@2
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2060
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2061 v18 = rand() % 100; //main random
1477
7ef4b64f6329 * LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents: 1358
diff changeset
2062 v0 = pMapStats->GetMapInfo(pCurrentMapName);
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2063 // v1 = pChests;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2064 v2 = &pMapStats->pInfos[v0];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2065 //v21 = pChests;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2066 //v20 = &pMapStats->pInfos[v0];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2067 for(int i=1; i<20;++i)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2068 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2069 for(int j=0; j<140;++j)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2070 {
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
2071
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2072 v3 = &pChests[i].igChestItems[j];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2073 if ( v3->uItemID < 0 )
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2074 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2075 v4 = rand() % 5; //additional items in chect
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2076 v5 = (unsigned __int8)byte_4E8168[abs((int)v3->uItemID)-1][2*v2->Treasure_prob];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2077 v6 = (unsigned __int8)byte_4E8168[abs((int)v3->uItemID)-1][2*v2->Treasure_prob+1];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2078 v8 = v6 - v5 + 1;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2079 v9 = v5 + rand() % v8; //treasure level
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2080 if (v9<7)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2081 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2082 if (v18<20)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2083 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2084 v3->Reset();
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2085 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2086 else if (v18<60) //generate gold
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2087 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2088 v10=0;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2089 v3->Reset();
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2090 switch (v9)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2091 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2092 case 1: //small gold
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2093 v10 = rand() % 51 + 50;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2094 v3->uItemID = 197;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2095 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2096 case 2://small gold
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2097 v10 = rand() % 101 + 100;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2098 v3->uItemID = 197;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2099 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2100 case 3: //medium
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2101 v10 = rand() % 301 + 200;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2102 v3->uItemID = 198;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2103 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2104 case 4: //medium
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2105 v10 = rand() % 501 + 500;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2106 v3->uItemID = 198;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2107 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2108 case 5: //big
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2109 v10 = rand() % 1001 + 1000;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2110 v3->uItemID = 199;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2111 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2112 case 6: //big
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2113 v10 = rand() % 3001 + 2000;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2114 v3->uItemID = 199;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2115 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2116 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2117 v3->SetIdentified();
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2118 v3->uSpecEnchantmentType = v10;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2119 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2120 else
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2121 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2122 pItemsTable->GenerateItem(v9, 0, v3);
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2123 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2124
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2125 v12 = 0;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2126 //generate more items
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2127 for (v11=0; v11<v4; ++v11)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2128 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2129
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2130 if ( v12 >= 140 )
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2131 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2132 while ( !(pChests[i].igChestItems[v12].uItemID==0) &&(v12<140))
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2133 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2134 ++v12;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2135 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2136 v14=&pChests[i].igChestItems[v12];
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2137 v18 = rand() % 100;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2138 if (v18<20)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2139 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2140 v3->Reset();
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2141 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2142 else if (v18<60) //generate gold
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2143 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2144 v10=0;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2145 v3->Reset();
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2146 switch (v9)
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2147 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2148 case 1: //small gold
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2149 v10 = rand() % 51 + 50;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2150 v14->uItemID = 197;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2151 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2152 case 2://small gold
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2153 v10 = rand() % 101 + 100;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2154 v14->uItemID = 197;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2155 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2156 case 3: //medium
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2157 v10 = rand() % 301 + 200;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2158 v14->uItemID = 198;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2159 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2160 case 4: //medium
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2161 v10 = rand() % 501 + 500;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2162 v14->uItemID = 198;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2163 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2164 case 5: //big
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2165 v10 = rand() % 1001 + 1000;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2166 v14->uItemID = 199;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2167 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2168 case 6: //big
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2169 v10 = rand() % 3001 + 2000;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2170 v14->uItemID = 199;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2171 break;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2172 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2173 v14->SetIdentified();
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2174 v14->uSpecEnchantmentType = v10;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2175 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2176 else
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2177 {
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2178 pItemsTable->GenerateItem(v9, 0, v14);
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2179 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2180 ++v12;
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2181 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2182 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2183 else
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2184 v3->GenerateArtifact();
526
214d9d47cf1f Chest working, but items are not laid correctly
Gloval
parents: 484
diff changeset
2185 }
598
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2186 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2187 }
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2188
f8a4a2e0b4c9 fixed random iten generator, chest generator
Gloval
parents: 570
diff changeset
2189 }
461
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2190
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2191
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2192
197461e5acec moved shop generators to item.cpp
Gloval
parents: 436
diff changeset
2193
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2194 // 4505CC: using guessed type int var_A0[32];
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2195 //----- (004B3703) --------------------------------------------------------
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2196 void FillAviableSkillsToTeach( int _this )
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2197 {
1838
211dfe2d8db1 changing global char* vars to const char* vars
Grumpy7
parents: 1826
diff changeset
2198 const char *v30; // ecx@65
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2199 unsigned int v29; // edx@56
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2200 int v15; // ecx@19
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2201 int v33; // [sp-4h] [bp-2Ch]@23
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2202 int v34; // [sp-4h] [bp-2Ch]@43
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2203 int v21; // ecx@34
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2204 int v35[5]; // [sp+Ch] [bp-1Ch]@8
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2205 int v37=0; // [sp+24h] [bp-4h]@1*
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2206 int i=0;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2207
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2208 dword_F8B1DC = 0;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2209
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2210 switch (_this)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2211 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2212 case 1: //shop weapon
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2213 for (int i=0; i<2; ++i)
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2214 {
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2215 for (int j=0; j<4; ++j)
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2216 {
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2217 if ( i )
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2218 v21 = shopWeap_variation_spc[(unsigned int)window_SpeakInHouse->ptr_1C].item_class[j];
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2219 else
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2220 v21 = shopWeap_variation_ord[(unsigned int)window_SpeakInHouse->ptr_1C].item_class[j];
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2221
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2222 switch (v21)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2223 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2224 case 23: v34 = 37; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2225 case 24: v34 = 38; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2226 case 25: v34 = 39; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2227 case 26: v34 = 40; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2228 case 27: v34 = 41; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2229 case 28: v34 = 42; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2230 case 30: v34 = 36; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2231 default:
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2232 continue;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2233 }
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2234 v37 = sub_4BE571(v34, v35, v37, 5);
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2235 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2236 }
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2237 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2238 case 2: //shop armor
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2239
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2240 for (int i=0; i<2; ++i)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2241 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2242 for (int j=0; j<2; ++j)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2243 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2244 for (int k=0; k<4; ++k)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2245 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2246 if ( i )
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2247 v15 = shopArmr_variation_spc[(unsigned int)window_SpeakInHouse->ptr_1C-15+j].item_class[k];
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2248 else
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2249 v15 = shopArmr_variation_ord[(unsigned int)window_SpeakInHouse->ptr_1C-15+j].item_class[k];
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2250 switch (v15)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2251 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2252 case 31: v33 = 45; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2253 case 32: v33 = 46; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2254 case 33: v33 = 47; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2255 case 34: v33 = 44; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2256 default:
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2257 continue;
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2258 }
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2259 v37 = sub_4BE571(v33, v35, v37, 5);
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2260 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2261 }
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2262 }
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2263 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2264 case 3: //shop magic
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2265 v37 = 2;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2266 v35[0] = 57;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2267 v35[1] = 59;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2268 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2269 case 4: //shop alchemist
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2270 v37 = 2;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2271 v35[0] = 71;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2272 v35[1] = 68;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2273 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2274 case 21: //tavern
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2275 v37 = 3;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2276 v35[0] = 70;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2277 v35[1] = 65;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2278 v35[2] = 62;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2279 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2280 case 23: //temple
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2281 v37 = 3;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2282 v35[0] = 67;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2283 v35[1] = 66;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2284 v35[2] = 58;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2285 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2286 case 30: ///trainig
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2287 v37 = 2;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2288 v35[0] = 69;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2289 v35[1] = 60;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2290 break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2291 }
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2292 for(i=0;i<v37;++i)
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2293 {
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2294 v29=v35[i];
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2295 switch(v29)
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2296 {
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2297 case 40 :v30 = pSkillNames[4]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2298 case 5 : v30 = pSkillNames[23]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2299 case 36 :v30 = pSkillNames[0]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2300 case 37 :v30 = pSkillNames[1]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2301 case 38 :v30 = pSkillNames[2]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2302 case 39 :v30 = pSkillNames[3]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2303 case 41 :v30 = pSkillNames[5]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2304 case 42 :v30 = pSkillNames[6]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2305 case 44 :v30 = pSkillNames[8]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2306 case 45 :v30 = pSkillNames[9]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2307 case 46 :v30 = pSkillNames[10]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2308 case 47 :v30 = pSkillNames[11]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2309 case 66 :v30 = pSkillNames[30]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2310 case 57 :v30 = pSkillNames[21]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2311 case 58 :v30 = pSkillNames[22]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2312 case 60 :v30 = pSkillNames[24]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2313 case 62 :v30 = pSkillNames[26]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2314 case 65 :v30 = pSkillNames[29]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2315 case 67:v30 = pSkillNames[31]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2316 case 68:v30 = pSkillNames[32]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2317 case 69:v30 = pSkillNames[33]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2318 case 70:v30 = pSkillNames[34]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2319 case 71:v30 = pSkillNames[35]; break;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2320 default:
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2321 v30 = pGlobalTXT_LocalizationStrings[127]; //"No Text!"
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2322 }
1843
2e6d3cd052e0 some char* cast removal + adding const_casts where appropriate
Grumpy7
parents: 1838
diff changeset
2323 pShopOptions[dword_F8B1DC] = const_cast<char *>(v30);
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2324 ++dword_F8B1DC;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2325 CreateButtonInColumn(i+1, v29);
463
f7b91ef98ab2 shopgenerators done, except config tables
Gloval
parents: 461
diff changeset
2326 }
972
c8a0f6d89c70 Some inqury on selecting Knight bug.
Nomad
parents: 901
diff changeset
2327 pDialogueWindow->_41D08F_set_keyboard_control_group(i, 1, 0, 2);
473
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2328 dword_F8B1E0 = pDialogueWindow->pNumPresenceButton;
7f1b00901cf7 Skill learning menu in shops
Gloval
parents: 470
diff changeset
2329 }
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2330
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2331 //----- (004BE571) --------------------------------------------------------
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2332 int sub_4BE571(int a1, int *a2, int a3, int a4)
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2333 {
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2334 int result; // eax@1
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2335 int i; // esi@3
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2336
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2337 result = a3;
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2338 if ( a3 < a4 )
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2339 {
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2340 for ( i = 0; i < a3; ++i )
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2341 {
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2342 if ( a1 == a2[i] )
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2343 break;
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2344 }
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2345 if ( i == a3 )
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2346 {
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2347 a2[a3] = a1;
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2348 result = a3 + 1;
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2349 }
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2350 return result;
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2351 }
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2352 else
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2353 {
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2354 return a4;
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2355 }
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2356 }
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2357 //----- (0043C91D) --------------------------------------------------------
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2358 int __fastcall GetItemTextureFilename(char *pOut, signed int item_id, int index, int shoulder)
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2359 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2360 int result; // eax@2
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2361 char v5; // zf@3
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2362 const char *v6; // [sp-Ch] [bp-18h]@88
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2363 signed int v7; // [sp-8h] [bp-14h]@61
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2364 int v8; // [sp-4h] [bp-10h]@61
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2365 signed int v9; // [sp-4h] [bp-10h]@69
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2366
1297
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2367 result = 0; //BUG fn is void
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2368 if ( item_id <= 500 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2369 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2370 //v5 = *((char *)&pBloodsplatContainer->std__vector_pBloodsplats[62].field_20 + a2 + 2) == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2371 v5 = party_has_equipment[(item_id - 100) + 32 + 2] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2372 switch ( item_id )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2373 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2374 case 516:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2375 v5 = byte_5111F6[2] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2376 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2377 case 505:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2378 v5 = byte_5111F6[1] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2379 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2380 case 504:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2381 v5 = byte_5111F6[0] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2382 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2383 case 533:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2384 v5 = byte_5111F6[16] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2385 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2386 case 512:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2387 v5 = byte_5111F6[3] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2388 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2389 case 521:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2390 v5 = byte_5111F6[4] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2391 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2392 case 522:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2393 v5 = byte_5111F6[5] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2394 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2395 case 523:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2396 v5 = byte_5111F6[6] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2397 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2398 case 532:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2399 v5 = byte_5111F6[7] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2400 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2401 case 544:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2402 v5 = byte_5111F6[8] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2403 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2404 case 524:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2405 v5 = byte_5111F6[9] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2406 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2407 case 535:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2408 v5 = byte_5111F6[10] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2409 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2410 case 525:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2411 v5 = byte_5111F6[11] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2412 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2413 case 530:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2414 v5 = byte_5111F6[12] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2415 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2416 case 547:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2417 v5 = byte_5111F6[13] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2418 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2419 case 548:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2420 v5 = byte_5111F6[14] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2421 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2422 case 550:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2423 v5 = byte_5111F6[15] == 0;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2424 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2425 default:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2426 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2427 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2428 if ( v5 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2429 return result;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2430 result = 516;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2431 if ( item_id < 66 || item_id > 78 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2432 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2433 if ( item_id == 516 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2434 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2435 if ( !shoulder )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2436 return sprintf(pOut, "item%3.3dv%d", 234, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2437 if ( shoulder == 1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2438 return sprintf(pOut, "item%3.3dv%da1", 234, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2439 if ( shoulder == 2 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2440 return sprintf(pOut, "item%3.3dv%da2", 234, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2441 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2442 if ( item_id != 504 && item_id != 505 && item_id != 533 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2443 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2444 if ( (item_id < 100 || item_id > 104) && item_id != 524 && item_id != 535 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2445 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2446 if ( item_id >= 115 && item_id <= 119 || item_id == 512 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2447 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2448 if ( item_id == 512 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2449 item_id = 312;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2450 return sprintf(pOut, "item%3.3dv%d", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2451 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2452 if ( (item_id < 89 || item_id > 99) && item_id != 521 && item_id != 522 && item_id != 523 && item_id != 532 && item_id != 544 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2453 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2454 result = 525;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2455 if ( (item_id < 105 || item_id > 109) && item_id != 525 && item_id != 530 && item_id != 547 && item_id != 548 && item_id != 550 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2456 return result;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2457 switch ( item_id )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2458 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2459 case 525:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2460 item_id = 325;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2461 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2462 case 530:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2463 item_id = 330;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2464 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2465 case 547:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2466 item_id = 347;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2467 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2468 case 548:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2469 item_id = 348;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2470 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2471 case 550:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2472 item_id = 350;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2473 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2474 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2475 if ( !shoulder )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2476 return sprintf(pOut, "item%3.3dv%d", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2477 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2478 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2479 if ( item_id == 521 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2480 return sprintf(pOut, "item%3.3dv%d", 239, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2481 if ( item_id == 522 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2482 return sprintf(pOut, "item%3.3dv%d", 240, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2483 if ( item_id == 523 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2484 return sprintf(pOut, "item%3.3dv%d", 241, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2485 if ( item_id != 532 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2486 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2487 if ( item_id == 544 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2488 item_id = 344;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2489 return sprintf(pOut, "item%3.3dv%d", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2490 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2491 return sprintf(pOut, "item%3.3dv%d", 93, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2492 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2493 if ( item_id == 524 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2494 return sprintf(pOut, "item%3.3dv%d", 324, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2495 if ( item_id == 535 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2496 item_id = 104;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2497 return sprintf(pOut, "item%3.3dv%d", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2498 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2499 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2500 if ( item_id != 516 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2501 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2502 switch ( item_id )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2503 {
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2504 case 504:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2505 item_id = 235;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2506 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2507 case 505:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2508 item_id = 236;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2509 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2510 case 533:
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2511 item_id = 73;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2512 break;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2513 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2514 if ( !shoulder )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2515 return sprintf(pOut, "item%3.3dv%d", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2516 if ( shoulder == 1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2517 return sprintf(pOut, "item%3.3dv%da1", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2518 if ( shoulder == 2 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2519 return sprintf(pOut, "item%3.3dv%da2", item_id, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2520 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2521 if ( !shoulder )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2522 return sprintf(pOut, "item%3.3dv%d", 234, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2523 if ( shoulder == 1 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2524 return sprintf(pOut, "item%3.3dv%da1", 234, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2525 if ( shoulder == 2 )
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2526 return sprintf(pOut, "item%3.3dv%da2", 234, index);
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2527 }
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2528 result = item_id - 504;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2529 return result;
5450af4f57ef moving files mm7_x ending
Ritor1
parents: 1231
diff changeset
2530 }
475
77430756f06a fix show info item in shop
Gloval
parents: 473
diff changeset
2531
2250
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2532
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2533 //----- (004BDAAF) --------------------------------------------------------
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2534 bool ItemGen::MerchandiseTest(int _2da_idx)
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2535 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2536 bool test;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2537
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2538 if ( (p2DEvents[_2da_idx - 1].uType != 4 || (signed int)this->uItemID < 740 || (signed int)this->uItemID > 771)
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2539 && ((signed int)this->uItemID >= 600 || (signed int)this->uItemID >= 529 && (signed int)this->uItemID <= 599) || this->IsStolen())
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2540 return false;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2541 switch( p2DEvents[_2da_idx - 1].uType )
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2542 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2543 case BuildingType_WeaponShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2544 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2545 test = this->GetItemEquipType() <= EQUIP_BOW;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2546 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2547 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2548 case BuildingType_ArmorShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2549 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2550 test = this->GetItemEquipType() >= EQUIP_ARMOUR && this->GetItemEquipType() <= EQUIP_BOOTS;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2551 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2552 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2553 case BuildingType_MagicShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2554 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2555 test = this->GetPlayerSkillType() == PLAYER_SKILL_MISC || this->GetItemEquipType() == EQIUP_ANY;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2556 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2557 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2558 case BuildingType_AlchemistShop:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2559 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2560 test = this->GetItemEquipType() == EQUIP_REAGENT || this->GetItemEquipType() == EQUIP_POTION
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2561 || (this->GetItemEquipType() > EQUIP_POTION && !(this->GetItemEquipType() != EQUIP_MESSAGE_SCROLL
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2562 || (signed int)this->uItemID < 740) && this->uItemID != 771);
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2563 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2564 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2565 default:
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2566 {
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2567 test = false;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2568 break;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2569 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2570 }
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2571 return test;
3cc3a29f073b moved MerchandiseTest to ItemGen::MerchandiseTest
Grumpy7
parents: 2195
diff changeset
2572 }